Commit 906db301 authored by Mac's avatar Mac

1

parent 17ca4d6b
......@@ -4,28 +4,41 @@
<view class="topbox">
<span style='font-size: 12px;color: #1B1D1E;'>账户余额(点数)</span>
<span style='font-size: 25px;color: #111111;'>2000</span>
<!-- <view class="recharge" v-if="IsShowRecharge == 1" @click="gopointRecharge">
充值
</view> -->
<view class="recharge" v-if="IsShowRecharge == 0" @click="gopointRecharge">
<view class="recharge" v-if="IsShowRecharge == 1" @click="gopointRecharge">
充值
</view>
</view>
</view>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'goback'></auth>
</view>
</template>
<script>
import auth from "@/components/auth/index.vue";
export default{
components:{
auth
},
data(){
return{
mainColor: '',
secondary: '',
IsShowRecharge:0,
IsShowRecharge:1,
u:{},
}
},
onLoad() {
this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: ""
};
this.showAuth = true;
}else{
this.getData()
}
},
created() {
this.mainColor = this.$uiConfig.mainColor;
......@@ -33,15 +46,26 @@
uni.setNavigationBarTitle({
title: '余额点数'
});
this.IsShowRecharge = uni.getStorageSync("basedata") ? uni.getStorageSync("basedata").mall.setting.IsShowRecharge:0
// this.IsShowRecharge = uni.getStorageSync("basedata") ? uni.getStorageSync("basedata").mall.setting.IsShowRecharge:0//完成时打开
},
methods:{
getData(){
},
gopointRecharge(){
uni.navigateTo({
url: '/pages/appointment/personal/pointRecharge'
});
}
},
reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo");
this.getData()
},
goback(){
uni.navigateBack()
},
}
}
</script>
......
<template>
<view class="pointRecharge">
<view class="recharge-top">
<u-avatar :src="mall_UserInfo.Photo" size="140" ></u-avatar>
<view class="recharge-top-r">
<text class="chaochu1">{{mall_UserInfo.Name}}</text>
<text class="chaochu1" style='font-size: 11px;color: #666666;'>1456</text>
</view>
</view>
<view class="recharge-c">
<text style="font-size: 11px;color: #111111;">充点数</text>
</view>
<view class="rechargelist ">
<view class="rechargeitem" @click="btnRecharge(item)" :style="{'border':'1px solid '+mainColor,'color':mainColor}" v-for="(item, index) in pointGoods" :key="index">
<text class="chaochu1-t" >{{item.SellingPrice}}</text>
<text class="chaochu1-t" style="margin-top: 7px;font-size: 11px;">点数 {{item.PonitNum}}{{item.GivePoint>0?'+送'+item.GivePoint:''}}</text>
</view>
</view>
<u-modal v-model="show" :content="content" :show-cancel-button='true' @confirm='queren'></u-modal>
</view>
</template>
<script>
export default{
data(){
return{
mainColor: '',
secondary: '',
mall_UserInfo:{},
pointGoods:[],
RechargeMsg:{
PayWay:1,
Income:0,
PointGoodsId:0,
},
show:false,
content:'',
}
},
onLoad() {
},
created() {
this.mainColor = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
uni.setNavigationBarTitle({
title: '余额点数'
});
this.mall_UserInfo = uni.getStorageSync("mall_UserInfo") ? uni.getStorageSync("mall_UserInfo"):{};
this.getPointGoodsList()
},
methods:{
getPointGoodsList(){
this.request2({
url: '/api/AppletPoint/GetPointGoodsList',
data: {}
},
res => {
this.pointGoods = res.data
}
);
},
btnRecharge(item){//点击充值
this.show= true;
this.content= '确定花费'+item.SellingPrice+'充值点数'+item.PonitNum+'吗?'
this.RechargeMsg.Income = item.SellingPrice;
this.RechargeMsg.PointGoodsId = item.ID;
},
queren(){
this.request2({
url: '/api/WeChatPay/GetPointPayInfo',
data: this.RechargeMsg
},
res => {
}
);
}
}
}
</script>
<style>
.pointRecharge{
width: 100%;
height: 100vh;
background: #FFF;
}
.pointRecharge .recharge-top{
width: 100%;
padding: 15px;
display: flex;
flex-direction: row;align-items: center;
border-bottom: 1px solid #E2E2E2;
}
.pointRecharge .recharge-top-r{
display: flex;
flex:1;
margin-left: 10px;
font-size: 13px;
color: #111111;
height: 30px;
flex-direction: column;
justify-content: space-between;
}
.pointRecharge .recharge-top-r .chaochu1{
white-space: nowrap;text-overflow: ellipsis;overflow: hidden;width: calc(100vw - 80px);
}
.pointRecharge .recharge-c{
width: 100%;
padding: 15px;
}
.pointRecharge .rechargelist{
width: 100%;
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.pointRecharge .rechargeitem{
width: 28%;
border-radius: 3px;
padding: 15px 0;
display: flex;
flex-direction: column;
align-items: center;
font-size: 16px;
margin-left: 4%;
margin-bottom: 15px;
}
.pointRecharge .chaochu1-t{
white-space: nowrap;text-overflow: ellipsis;overflow: hidden;width: 100%;text-align: center;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment