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

1

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