Commit 21dda5d3 by zhangzhen

功能优化

parent db1d5468
......@@ -120,14 +120,25 @@
</view>
</view>
<view v-if="userInfo && userInfo.secondaryCardList && userInfo.secondaryCardList.length" class="flex-3">
<text class="text-1">次卡</text>
<view v-if="monthlyCard.status || secondaryCard.status" class="flex-3">
<text class="text-2">权益会员专享</text>
<view class="flex-row">
<text class="text-3">还剩</text>
<text class="text-4">{{userInfo.secondaryCardList[0].number}}</text>
<text class="text-3"></text>
</view>
<view class="flex-1 flex-col">
<view v-if="secondaryCard.status" class="flex-row-center">
<text class="text-1">次卡</text>
<view class="flex-row">
<text class="text-3">还剩</text>
<text class="text-4">{{secondaryCard.number}}</text>
<text class="text-3"></text>
</view>
</view>
<view v-if="monthlyCard.status" class="flex-row-center">
<text class="text-1">月卡</text>
<view class="flex-row">
<text v-if="monthlyCard.status==1" class="text-3">今日待使用</text>
<text v-else-if="monthlyCard.status==2" class="text-3">明日待使用</text>
</view>
</view>
</view>
</view>
</view>
</view>
......@@ -484,6 +495,7 @@
equityMembersList,
createEquityMembers
} from "@/api/userInfo.js";
import moment from "../../common/moment";
export default {
components: {
......@@ -558,7 +570,14 @@
},
list:'',
consumerMemberStatus:false,
loginStatus: uni.getStorageSync('loginStatus') == 'login'? true: false
loginStatus: uni.getStorageSync('loginStatus') == 'login'? true: false,
monthlyCard:{
status: 0,
},
secondaryCard:{
status: 0,
number: 0
}
}
},
onShow() {
......@@ -566,7 +585,6 @@
this.onGetUserInfo();
},
onLoad(query) {
console.log(query,"页面传递过来的参数")
if (query.q) {
const q = decodeURIComponent(query.q)
let d = q.split('?')
......@@ -576,7 +594,6 @@
let l = item.split('=');
obj[l[0]] = l[1];
})
console.log(obj,"参数对象")
if (obj.uid) {
uni.setStorageSync("shareUserId", obj.uid)
}
......@@ -646,7 +663,32 @@
if(this.userInfo && this.userInfo.phone){
this.userName = this.userInfo.phone.slice(-4);
}
console.log(this.userInfo,999999)
if(this.userInfo.monthlyCardList && this.userInfo.monthlyCardList.length){
let obj = this.userInfo.monthlyCardList.find(item=>{
return moment().valueOf() < moment(item.expirationDate).valueOf()
})
if(obj){
this.monthlyCard.status = 1;
if(obj.freeDuration<=0){
this.monthlyCard.status = 2;
}
}
}
if(this.userInfo.secondaryCardList && this.userInfo.secondaryCardList.length){
let list = this.userInfo.secondaryCardList.filter(item=>{
return moment().valueOf() < moment(item.expirationDate).valueOf() && item.number>0
})
if(list && list.length){
this.secondaryCard.status = 1;
let num = 0;
list.forEach(val => {
num+=val.number
})
this.secondaryCard.number = num;
}
}
uni.setStorageSync('userInfo', this.userInfo)
this.$forceUpdate();
this.onGetOrderInfo();
......@@ -720,7 +762,6 @@
})
},
onNavToOrderRecord(val = 0){
console.log(val,9999)
let statusIndex = val ? val.value : 0;
uni.setStorageSync("statusIndex",statusIndex)
uni.switchTab({
......@@ -762,7 +803,6 @@
onNavByPath(pathName){
if(pathName === 'equityFundLog' && !(this.userInfo.consumerMember && this.userInfo.consumerMember.isRights)) return;
if(["levelDetail"].includes(pathName) && !this.loginStatus){
console.log(pathName,999999)
this.$refs.loginPop.open();
}else{
uni.navigateTo({
......@@ -884,7 +924,6 @@
})
},
qrR(r) {
console.log(r, "二维码路径")
this.qrPath = r;
},
onShareByQrcode(){
......@@ -1455,7 +1494,7 @@
display: flex;
align-items: center;
height: 100%;
padding-right: 20upx;
padding-right: 12upx;
.tag-icon{
display: block;
width: 120upx;
......@@ -1474,20 +1513,28 @@
border-radius: 14rpx;
border: 1px solid #FDD8B8;
margin-left: 20upx;
padding-left: 20upx;
.flex-row-center{
margin-top: 8upx;
justify-content: center;
}
.text-1{
font-weight: bolder;
font-size: 32rpx;
font-size: 26rpx;
font-style: italic;
color: #A3A3A3;
background: linear-gradient(47deg, #FD7C01 0%, #FCAB00 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
margin-right: 6upx;
}
.text-2{
font-size: 20rpx;
font-size: 24rpx;
color: #985E39;
margin-top: 4upx;
margin: 12upx 0 0 12upx;
}
.flex-1{
justify-content: center;
padding-bottom: 10upx;
}
.flex-row{
display: flex;
......@@ -1499,7 +1546,6 @@
background: #FFEED9;
border-radius: 4rpx;
border: 1px solid #E6A37F;
margin-top: 8upx;
.text-3{
font-size: 18rpx;
color: #985E39;
......
......@@ -220,7 +220,7 @@
<radio-group class="radio-group">
<label v-if="secondaryCardList.length" class="flex-between" @tap="onRadioChange('secondaryCard')">
<view class="flex-row-center">
<text>次卡(剩余{{secondaryCardList[0].number}}次)</text>
<text>次卡(剩余{{secondaryCard.number}}次)</text>
</view>
<view class="flex-row-center" >
<text>请选择</text>
......@@ -592,7 +592,11 @@
storeCleanDuration: getSysConfigValue('StoreCleanDuration')? Number(getSysConfigValue('StoreCleanDuration')):30,
radioChecked:'',
monthlyCardList:[],
secondaryCardList:[]
secondaryCardList:[],
secondaryCard:{
status: 0,
number: 0
}
};
},
filters: {
......@@ -1334,7 +1338,20 @@
}
if(this.userInfo.secondaryCardList && res.data.data && res.data.data.consumerSecondaryCard && res.data.data.consumerSecondaryCard.length){
this.secondaryCardList = this.userInfo.secondaryCardList.filter(item => res.data.data.consumerSecondaryCard.includes( item.id))
this.secondaryCardList = this.userInfo.secondaryCardList.filter(item => res.data.data.consumerSecondaryCard.includes( item.id));
let list = this.userInfo.secondaryCardList.filter(item=>{
return moment().valueOf() < moment(item.expirationDate).valueOf() && item.number>0
})
if(list && list.length){
this.secondaryCard.status = 1;
let num = 0;
list.forEach(val => {
num+=val.number
})
this.secondaryCard.number = num;
}
}else{
this.secondaryCardList = [];
}
......
......@@ -172,7 +172,7 @@
</template>
<script>
import {login,dictList} from "@/api/index.js";
import {login,dictList,getUserInfo} from "@/api/index.js";
import {getDictItem,getSysConfigValue} from "@/utils/tools.js"
import fNavbar from '@/components/module/f-navbar/f-navbar';
import {getOrderInfoByNo,orderRefund,openDoor,noLoginOpenDoor,noLoginGetOrderInfo} from "@/api/order.js"
......@@ -204,9 +204,8 @@
};
},
onLoad(option) {
this.userInfo = uni.getStorageSync('userInfo')
this.orderNo = option.orderNo;
this.onGetUserInfo();
if(option.share && option.share =="share"){
this.shareOrder = true
this.onGetOrderInfo()
......@@ -228,6 +227,17 @@
}
},
methods:{
onGetUserInfo() {
getUserInfo().then(res => {
if (res.data.code == 200) {
this.userInfo = {
...res.data.data,
consumerWallet: res.data.data.consumerWallet? res.data.data.consumerWallet: {remainingIntegral:0}
}
uni.setStorageSync('userInfo', this.userInfo)
}
})
},
onGetDicts() {
let dicts = []
if (uni.getStorageSync('dicts')) {
......
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