Commit b0408b22 by zhangzhen

功能优化

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