Commit b0408b22 by zhangzhen

功能优化

parent 8d4cdedf
......@@ -16,11 +16,11 @@ const CONFIG = {
},
// 生产环境配置
production: {
assetsPath: 'https://coujiao.pseer.com/wechat_static', // 静态资源路径
assetsPath: 'http://129.211.46.84:8888/wechat_static', // 静态资源路径
// assetsPath: 'https://www.coujio.com/wechat_static', // 静态资源路径
baseUrl: 'https://coujiao.pseer.com/front-api', // 后台接口请求地址
baseUrl: 'http://129.211.46.84:8883/front-api', // 后台接口请求地址
// baseUrl: 'https://www.coujio.com/front-api', // 后台接口请求地址
hostUrl: 'https://coujiao.pseer.com/prod-api', // H5地址(前端运行地址)
hostUrl: 'http://129.211.46.84:8882/prod-api', // H5地址(前端运行地址)
// hostUrl: 'https://www.coujio.com/prod-api', // H5地址(前端运行地址)
websocketUrl: '', // websocket服务端地址
weixinAppId: '', // 微信公众号appid
......
......@@ -43,7 +43,7 @@
<text class="text-gray">余额</text>
</view>
<view class="value-box">
<text class="text-black text-lg text-bold">{{userWalletInfo.balance || 0}}</text>
<text class="text-black text-lg text-bold">{{userInfo.consumerWallet.balance || 0}}</text>
</view>
</view>
<view class="item-box">
......@@ -54,7 +54,7 @@
<text class="text-gray">积分</text>
</view>
<view class="value-box">
<text class="text-black text-lg text-bold">{{userWalletInfo.remainingIntegral || 0}}</text>
<text class="text-black text-lg text-bold">{{userInfo.consumerWallet.remainingIntegral || 0}}</text>
</view>
</view>
<view class="item-box">
......@@ -65,7 +65,7 @@
<text class="text-gray">时长</text>
</view>
<view class="value-box">
<text class="text-black text-lg text-bold">{{userWalletInfo.remainingDuration || 0}}</text>
<text class="text-black text-lg text-bold">{{userInfo.consumerWallet.remainingDuration || 0}}</text>
</view>
</view>
<view class="item-box" @tap="onNavByPath('couponList')">
......@@ -228,7 +228,6 @@
import fTabbar from '@/components/module/f-tabbar/f-tabbar';
import {
getUserInfo,
getUserWallet,
loginOut,
systemConfig
} from "@/api/index.js"
......@@ -251,7 +250,6 @@
assetsPath: config.assetsPath,
hostUrl: config.hostUrl,
userInfo: {},
userWalletInfo:'',
userAction: [],
wifiData: {
name: "",
......@@ -344,10 +342,6 @@
this.onGetOrderInfo();
}
})
getUserWallet().then(res => {
console.log(res,9999)
this.userWalletInfo = res.data
})
},
onGetOrderInfo(){
orderList({
......
......@@ -240,12 +240,44 @@
<text class="cuIcon-right " :class="useCouponList.length?'text-pink':'text-gray'"></text>
</view>
</view>
<view class="flex-between price">
<view v-if="computePriceInfo.balance" class="flex-between price">
<text class="text-black text-left">优惠金额</text>
<view class="flex-row">
<!-- <text class="text-pink text-sm text-bold" style="margin-bottom: 3upx;">{{computePriceInfo.couponFee>0?'-':''}}</text> -->
<text class="text-pink"></text>
<text class="text-pink text-lg text-bold">{{computePriceInfo.couponFee||0}}</text>
<text class="text-pink text-lg text-bold">{{computePriceInfo.balance||0}}</text>
<text>(余额抵扣)</text>
</view>
</view>
<view v-else-if="computePriceInfo.couponFee" class="flex-between price">
<text class="text-black text-left">优惠金额</text>
<view class="flex-row">
<text class="text-pink"></text>
<text class="text-pink text-lg text-bold">{{computePriceInfo.couponFee}}</text>
<text>(优惠券抵扣)</text>
</view>
</view>
<view v-if="computePriceInfo.duration" class="flex-between price">
<text class="text-black text-left">时长抵扣</text>
<view class="flex-row">
<text class="text-pink"></text>
<text class="text-pink text-lg text-bold">{{computePriceInfo.duration||0}}</text>
</view>
</view>
<view class="flex-between price">
<text class="text-black text-left">钱包余额</text>
<view class="flex-row">
<text class="text-pink"></text>
<text class="text-pink text-lg text-bold">{{computePriceInfo.remainingBalance}}</text>
</view>
</view>
<view class="flex-between price">
<text class="text-black text-left">可用时长</text>
<view class="flex-row">
<text class="text-pink text-lg text-bold">{{computePriceInfo.remainingDuration}}</text>
<text class="text-pink">小时</text>
</view>
</view>
</view>
......
......@@ -38,9 +38,9 @@
</view>
<view v-if="tabIndex ==1" class="list-box">
<view v-for="(item,k) in rechargeConfList" :key="k" class="flex-col item">
<view v-for="(item,k) in rechargeConfList" :key="k" class="flex-col item" @tap="onRechargeChange(k)">
<image class="amount-bg" :src="assetsPath+'/vip/amount_bg.png'" mode="widthFix"></image>
<view class="flex-col item-content">
<view class="flex-col item-content" :class="rechargeIndex === k?'active':''">
<view v-if="item.giveType.includes('1')" class="preferential">
<text>{{item.giveAmount}}小时</text>
</view>
......@@ -52,8 +52,7 @@
<view class="part-amount">
<view class="flex-row amount">
<text class="symbol"></text>
<text class="num">1000</text>
<!-- <text class="num">{{item.rechargeAmount}}</text> -->
<text class="num">{{item.rechargeAmount}}</text>
</view>
</view>
<view class="tip-text">
......@@ -88,8 +87,8 @@
<text class="text-2">99.</text>
<text class="text-3">00</text>
</view>
<view class="cu-btn-box">
<button class="cu-btn">立即开通</button>
<view class="cu-btn-box" @tap="onSubmit">
<button class="cu-btn" :class="consumerMemberStatus?'bg-gray':'bg-pink'">立即开通</button>
</view>
</view>
</view>
......@@ -126,6 +125,11 @@
equityMembersList,
createEquityMembers
} from "@/api/uerInfo.js";
import {
getUserInfo,
} from "@/api/index.js"
import {
rechargeConf,
createRecharge
......@@ -143,7 +147,9 @@
list: [],
rechargeConfList: [],
tabIndex: 1,
index: 0
rechargeIndex:0,
index: 0,
consumerMemberStatus:false
};
},
onLoad() {
......@@ -152,26 +158,36 @@
this.onLoading();
},
methods: {
onGetUserInfo() {
getUserInfo().then(res => {
if (res.data.code == 200) {
if(res.data.data.consumerMember && res.data.data.consumerMember.memberType ==2){
let expirationDate = moment(res.data.data.consumerMember.expirationDate).valueOf();
let nowDate = moment().valueOf()
if(nowDate <= expirationDate){
this.consumerMemberStatus = true;
}
}
}
})
},
onRechargeChange(k){
this.rechargeIndex = k;
},
onRuleTipChange(e){
console.log(e,99999)
this.checked = e.detail.value.includes("checked")
},
onNavToRecharge(){
console.log(this.checked,9999);
if(!this.checked){
uni.showToast({
icon:"none",
title:"请先阅读充值协议并同意"
})
return;
}
},
onLoading() {
equityMembersList().then(res => {
console.log(res, 999999)
if (res.data.code == 200 && res.data.rows) {
this.list = res.data.rows
}
this.onGetUserInfo();
})
},
onGetRechargeConf() {
......@@ -190,13 +206,24 @@
onTabChange(val) {
if (this.tabIndex == val) return;
this.tabIndex = val;
this.checked = false;
},
onSubmit() {
if(!this.checked){
uni.showToast({
icon:"none",
title:"请先阅读充值协议并同意"
})
return;
}
uni.showLoading({
title:"提交中..."
})
createEquityMembers({
payType: 1,
equityMembersConfigId: this.list[this.index].id
}).then(res => {
console.log(res, 9999)
uni.hideLoading();
if (res.data.data.jsConfig) {
wx.requestPayment({
"timeStamp": res.data.data.jsConfig.timeStamp,
......@@ -228,12 +255,22 @@
})
},
onSubmit2() {
onNavToRecharge() {
if(!this.checked){
uni.showToast({
icon:"none",
title:"请先阅读充值协议并同意"
})
return;
}
uni.showLoading({
title:"提交中..."
})
createRecharge({
payType: 1,
rechargeConfId: this.rechargeConfList[0].id
rechargeConfId: this.rechargeConfList[this.rechargeIndex].id
}).then(res => {
console.log(res, 9999)
uni.hideLoading();
if (res.data.data.jsConfig) {
wx.requestPayment({
"timeStamp": res.data.data.jsConfig.timeStamp,
......@@ -406,6 +443,7 @@
.amount-bg {
display: block;
width: 100%;
max-height: 240upx;
}
.item-content {
......@@ -416,9 +454,8 @@
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
align-items: center;
}
.line {
width: 80%;
height: 1rpx;
......@@ -462,22 +499,20 @@
flex-direction: row;
align-items: flex-end;
justify-content: center;
color: #FE3F00;
.symbol {
font-weight: 400;
font-size: 29upx;
color: #FE3F00;
margin-bottom: 10upx;
}
.num {
font-weight: 400;
font-size: 64upx;
color: #FE3F00;
}
}
.tip-text {
position: relative;
display: flex;
justify-content: center;
align-items: center;
......@@ -485,12 +520,34 @@
height: 50upx;
background: linear-gradient(-90deg, #FCD25B, #FA541D);
border-radius: 0 0 23upx 23upx;
z-index: 2;
text {
font-size: 19upx;
color: #ffffff;
}
}
.active{
background: linear-gradient(-90deg, #FCD25B, #FA541D);
box-shadow: 0 4upx 12upx #FA541D;
border-radius: 12upx;
.amount{
color: #ffffff;
}
.preferential{
text{
color: #ffffff;
background: #ffffff;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
}
.part-bottom{
.tip-text{
background: linear-gradient(-45deg, #FCD25B, #FA541D);
}
}
}
}
}
......@@ -541,6 +598,7 @@
.img-bg{
display: block;
width: 100%;
max-height: 160upx;
}
.absolute{
display: flex;
......@@ -602,11 +660,14 @@
.cu-btn{
padding: 0 20upx;
height: 40upx;
background: #FA561E;
border-radius: 20upx;
font-size: 24upx;
color: #ffffff;
}
.bg-pink{
background: #FA561E;
}
}
}
}
......
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