Commit 79c331f6 authored by 黄媛媛's avatar 黄媛媛

1

parent 561a7ca3
...@@ -62,9 +62,9 @@ ...@@ -62,9 +62,9 @@
{ {
"root": "pages/balance", "root": "pages/balance",
"pages": [ "pages": [
// { {
// "path": "recharge" "path": "recharge"
// }, },
{ {
"path": "balance" "path": "balance"
}, },
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
"root": "pages/live", "root": "pages/live",
"plugins": { "plugins": {
"live-player-plugin": { "live-player-plugin": {
"version": "1.0.18", "version": "1.1.0",
"provider": "wx2b03c6e691cd7370" "provider": "wx2b03c6e691cd7370"
} }
}, },
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
<view class="balance_top" > <view class="balance_top" >
<Text style='margin-top:50rpx ;color: #fff;;font-size: 24rpx;'>账户余额(元)</Text> <Text style='margin-top:50rpx ;color: #fff;;font-size: 24rpx;'>账户余额(元)</Text>
<Text style='margin-top:50rpx ;color: #fff;;font-size: 36px;'>{{balance}}</Text> <Text style='margin-top:50rpx ;color: #fff;;font-size: 36px;'>{{balance}}</Text>
<!-- <view class="recharge" @click="goUrl()"> <view class="recharge" @click="goUrl()" v-if="IsShowRecharge == 1">
<Text style='color: #fff;;font-size: 28rpx;'>充值</Text> <Text style='color: #fff;;font-size: 28rpx;'>充值</Text>
</view> --> </view>
<!-- TODO 暂无余额说明 --> <!-- TODO 暂无余额说明 -->
<u-icon name="question-o" color="#fff" class='explain' size="36" @click="goUrl('/pages/balance/rules')"></u-icon> <!-- <u-icon name="question-o" color="#fff" class='explain' size="36" @click="goUrl('/pages/balance/rules')"></u-icon> -->
</view> </view>
<view class="timechoice"> <view class="timechoice">
<view style="width: 50%;display: flex;flex-direction: row;align-items: center;justify-content: space-between;"> <view style="width: 50%;display: flex;flex-direction: row;align-items: center;justify-content: space-between;">
...@@ -85,6 +85,7 @@ ...@@ -85,6 +85,7 @@
loading: "努力加载中", loading: "努力加载中",
nomore: "没有更多了", nomore: "没有更多了",
}, },
IsShowRecharge:0,
} }
}, },
components:{ components:{
...@@ -93,6 +94,7 @@ ...@@ -93,6 +94,7 @@
mounted() { mounted() {
let currentPages = getCurrentPages(); let currentPages = getCurrentPages();
let u = "/" + currentPages[currentPages.length-1].route; let u = "/" + currentPages[currentPages.length-1].route;
this.IsShowRecharge = uni.getStorageSync("basedata") ? uni.getStorageSync("basedata").mall.setting.IsShowRecharge:0
let pages = uni.getStorageSync("basedata") let pages = uni.getStorageSync("basedata")
? uni.getStorageSync("basedata").bar_title ? uni.getStorageSync("basedata").bar_title
: []; : [];
...@@ -106,7 +108,7 @@ ...@@ -106,7 +108,7 @@
}); });
}, },
onLoad(option){ onLoad(option){
this.balance = option.balance this.balance = option.balance;
this.u = uni.getStorageSync("mall_UserInfo"); this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) { if (!this.u) {
this.u = { this.u = {
...@@ -129,10 +131,8 @@ ...@@ -129,10 +131,8 @@
let date1 = new Date(); let date1 = new Date();
let time1 = date1.getFullYear() + "年" + (date1.getMonth() + 1) +'月' let time1 = date1.getFullYear() + "年" + (date1.getMonth() + 1) +'月'
let time2 = date1.getFullYear() + "-" + (date1.getMonth() + 1) let time2 = date1.getFullYear() + "-" + (date1.getMonth() + 1)
this.date = time1 this.date = time1
this.msg.CreateDate = time2 this.msg.CreateDate = time2
this.balancedata()
this.getlogs() this.getlogs()
}, },
reloadUserinfo() { reloadUserinfo() {
...@@ -142,26 +142,7 @@ ...@@ -142,26 +142,7 @@
}, },
goback(){ goback(){
uni.navigateBack() uni.navigateBack()
}, },
balancedata(){
// uni.showNavigationBarLoading();
// let h=this.apiheader()
// this.request(
// {
// url: "",
// header:h,
// data: {
// r: "api/balance/index",
// }
// },
// res => {
// uni.hideNavigationBarLoading()
// this.g = res.data;
// }
// );
},
getlogs(){ getlogs(){
...@@ -229,15 +210,15 @@ ...@@ -229,15 +210,15 @@
} }
return i; return i;
}, },
goUrl(url){ goUrl(){
// console.log(url )
// uni.navigateTo({ uni.navigateTo({
// url: url url: '/pages/balance/recharge?balance=' + this.balance
// }) })
uni.showToast({ // uni.showToast({
title: '正在开发,敬请期待', // title: '正在开发,敬请期待',
icon: "none" // icon: "none"
}); // });
}, },
godetail(item){ godetail(item){
......
<template> <template>
<view class="rechargeStyle" :style="{'height':contentHeight}" > <view class="rechargeStyle" :style="{'height':contentHeight}" >
<view class="rechargeBox"> <view class="rechargeBox" v-if="IsShowRecharge==1">
<view class="title"> <view class="title">
<view class="title_l" :style="{'background':mainColor}"></view> <view class="title_l" :style="{'background':mainColor}"></view>
<Text style='margin-left: 20rpx;font-size: 26rpx;'>我的账户</Text> <Text style='margin-left: 20rpx;font-size: 26rpx;'>我的账户</Text>
...@@ -9,32 +9,44 @@ ...@@ -9,32 +9,44 @@
<view style="display: flex;align-items: center;"> <view style="display: flex;align-items: center;">
<Text style='margin-left: 20rpx;font-size: 36rpx;'>余额</Text> <Text style='margin-left: 20rpx;font-size: 36rpx;'>余额</Text>
</view> </view>
<Text style='font-size: 42rpx;'>{{g.balance}}</Text> <Text style='font-size: 42rpx;'>{{balance}}</Text>
</view> </view>
<view class="recharge"> <view class="recharge">
<Text style='font-size: 26rpx;color: #c8c9cc;'>充值金额</Text> <Text style='font-size: 14px'>充值金额</Text>
<!-- <input type="text" style='text-align: right;' v-model="inputvalue"> --> <input style='text-align: right;' v-model="inputvalue" placeholder="请输入" type="digit">
</view> </view>
<View> <View class='rulesBox'>
<!-- TODO 充值金额的列表--> <view v-for="(item, index) in g.rechargeRules" :key="index" class="rulesitem" @click="recharge_btn(item)">
<Text style='font-size: 20px;margin: 5px;'>{{item.Money}}</Text>
<Text>名称:{{item.Name}}</Text>
<Text>赠金额:{{item.GiveMoney}}</Text>
<Text>赠积分:{{item.GiveIntegral}}</Text>
</view>
</View> </View>
<!-- <view class='button' <view class='button'
:style="{'background':mainColor}" :style="{'background':mainColor}"
@click="btn_recharge"> @click="btn_recharge">
<Text>立即充值</Text> <Text>立即充值</Text>
</view> --> </view>
<view class="title" style="margin-top: 30rpx;"> <view class="title" style="margin-top: 30rpx;">
<view class="title_l" :style="{'background':mainColor}"></view> <view class="title_l" :style="{'background':mainColor}"></view>
<Text style='margin-left: 20rpx;font-size: 26rpx;'>充值说明</Text> <Text style='margin-left: 20rpx;font-size: 26rpx;'>充值说明</Text>
</view> </view>
<view style="margin: 5px 0;width: 100%;">
<image v-if="settings.ExplainIco!='' " :src="settings.ExplainIco" mode="widthFix" style="width: 100%;" />
<Text>{{settings.Explain}}</Text>
</view>
</view> </view>
<u-empty text="数据为空" mode="data" v-if="IsShowRecharge==0"></u-empty>
</view> </view>
</template> </template>
<script> <script>
import payCom from '@/components/pay/pay';
export default { export default {
data() { data() {
return { return {
...@@ -42,11 +54,15 @@ ...@@ -42,11 +54,15 @@
contentHeight:0, contentHeight:0,
mainColor: "", mainColor: "",
g:{}, g:{},
settings:{},
balance:0,
IsShowRecharge:0,
inputvalue:'',
} }
}, },
mounted() { mounted() {
let currentPages = getCurrentPages(); let currentPages = getCurrentPages();
this.IsShowRecharge = uni.getStorageSync("basedata") ? uni.getStorageSync("basedata").mall.setting.IsShowRecharge:0
let u = "/" + currentPages[currentPages.length-1].route; let u = "/" + currentPages[currentPages.length-1].route;
let pages = uni.getStorageSync("basedata") let pages = uni.getStorageSync("basedata")
? uni.getStorageSync("basedata").bar_title ? uni.getStorageSync("basedata").bar_title
...@@ -56,18 +72,26 @@ ...@@ -56,18 +72,26 @@
this.pageTitle = x.new_name ? x.new_name : x.name; this.pageTitle = x.new_name ? x.new_name : x.name;
} }
}); });
uni.setNavigationBarTitle({ if(this.IsShowRecharge==0){
title: this.pageTitle, uni.setNavigationBarTitle({
}); title: '',
});
}else{
uni.setNavigationBarTitle({
title: this.pageTitle,
});
}
}, },
onLoad(){ onLoad(option){
// this.payInfo.OpenId=uni.getStorageSync('mall_UserInfo').OpenId;
this.balance = option.balance;
this.balancedata()
}, },
created(){ created(){
this.contentHeight = this.$utils.calcContentHeight(-40)+'px'; this.contentHeight = this.$utils.calcContentHeight(-40)+'px';
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
this.balancedata()
}, },
...@@ -75,19 +99,15 @@ ...@@ -75,19 +99,15 @@
balancedata(){ balancedata(){
uni.showNavigationBarLoading(); uni.showNavigationBarLoading();
let h=this.apiheader() this.request2(
this.request(
{ {
url: "", url: '/api/AppletUser/GetUserRechargeSettings',
header:h, data: {}
data: {
r: "api/balance/index",
}
}, },
res => { res => {
uni.hideNavigationBarLoading() uni.hideNavigationBarLoading()
this.g = res.data; this.g = res.data
this.settings = res.data.rechargeSettings[0]
} }
); );
}, },
...@@ -96,6 +116,25 @@ ...@@ -96,6 +116,25 @@
btn_recharge(){ btn_recharge(){
}, },
recharge_btn(item){
uni.showLoading({
title:'加载中',
icon:'none'
})
this.request2(
{
url: '/api/WeChatPay/GetRechargePayInfo',
data: {
Balance:item.Money,
RechargeRulesId:item.ID,
PayWay:1
}
},
res => {
uni.hideLoading()
}
);
}
} }
} }
...@@ -108,7 +147,7 @@ ...@@ -108,7 +147,7 @@
} }
.rechargeStyle .rechargeBox{ .rechargeStyle .rechargeBox{
width: 100%; width: 100%;
padding: 30rpx; padding: 15px;
background: #FFFFFF; background: #FFFFFF;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -124,18 +163,21 @@ ...@@ -124,18 +163,21 @@
height: 15px; height: 15px;
} }
.rechargeStyle .balance{ .rechargeStyle .balance{
background-image: url(../../static/images/icon/icon-balance-recharge-bg.png);
background-repeat:no-repeat;
background-size: 100% 90px;
margin-top: 30rpx; margin-top: 30rpx;
width: 100%; width: 100%;
height: 90px; height: 90px;
border-radius: 10rpx; border-radius: 10rpx;
background: #f4f4f5;
padding:0 40rpx ; padding:0 40rpx ;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
} }
.rechargeStyle .recharge{ .rechargeStyle .recharge{
margin-top: 30rpx; margin: 15px 0;
width: 100%; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -150,4 +192,25 @@ ...@@ -150,4 +192,25 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.rechargeStyle .rulesBox{
display: flex;
flex-direction: row;
flex-wrap: wrap;
width: 100%;
padding: 10px ;
}
.rechargeStyle .rulesitem{
width: calc((100vw - 135px)/3);
margin: 0 15px;
border: 1px solid #F43F3B;
font-size: 12px;
line-height: 16px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 5px 0;
margin-top: 10px;
}
</style> </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