页面优化

main
syt 3 months ago
parent 860666c7e1
commit 408e6ed3fa
  1. 11
      pages/index/index.vue
  2. 11
      pages/mendainlist/mendainlist.vue
  3. 25
      pages/order/order.vue

@ -41,7 +41,7 @@
<view class="hy">会员套餐</view> <view class="hy">会员套餐</view>
<view class="btboxs"> <view class="btboxs">
<view class="btbox" v-for="(item,index) in viplist" :key="index" @click="taochan(item)"> <view class="btbox" v-for="(item,index) in viplist" :key="index" @click="taochan(item)">
<image :src="item.img.url" mode="" class="btimg"></image> <image :src="item.img.url" mode="aspectFill" class="btimg"></image>
<view class="bttitle">{{item.name}}</view> <view class="bttitle">{{item.name}}</view>
<view class="btwz" v-if="item.validity_day>0">期限{{item.validity_day}}</view> <view class="btwz" v-if="item.validity_day>0">期限{{item.validity_day}}</view>
<view class="btwz" v-if='item.validity_num>0'>次数{{item.validity_num}}</view> <view class="btwz" v-if='item.validity_num>0'>次数{{item.validity_num}}</view>
@ -98,7 +98,12 @@
} }
}, },
onLoad() { onLoad() {
this.top = uni.getSystemInfoSync().statusBarHeight const that = this;
this.top = uni.getSystemInfoSync().statusBarHeight;
uni.$on("changeStoreInfo",function(res){
that.tuijianlist = [res]
console.log(res)
})
}, },
onReady() { onReady() {
this.viplist=[] this.viplist=[]
@ -218,7 +223,7 @@
}, },
mendianlist() { mendianlist() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/mendainlist/mendainlist?item='+'shouye' url: '/pages/mendainlist/mendainlist?item='+'shouye'+'&id='+this.tuijianlist[0].id
}) })
}, },
tuanquan() { tuanquan() {

@ -37,12 +37,15 @@
iswanjie:false, iswanjie:false,
page:1, page:1,
isshouye:'', isshouye:'',
top: 0 top: 0,
id: ""
} }
}, },
onLoad(e) { onLoad(e) {
this.top = uni.getSystemInfoSync().statusBarHeight this.top = uni.getSystemInfoSync().statusBarHeight
this.isshouye=e.item this.isshouye=e.item
this.id = e.id
console.log(e)
}, },
onShow() { onShow() {
this.mendainlist=[] this.mendainlist=[]
@ -79,6 +82,9 @@
uni.setStorageSync('xzmd','') uni.setStorageSync('xzmd','')
uni.setStorageSync('xzmd',item) uni.setStorageSync('xzmd',item)
uni.navigateBack() uni.navigateBack()
}else{
uni.$emit("changeStoreInfo",item)
uni.navigateBack()
} }
}, },
previous() { previous() {
@ -90,6 +96,9 @@
}).then(res => { }).then(res => {
let arr = res.data.list let arr = res.data.list
this.mendainlist = [...this.mendainlist, ...arr] this.mendainlist = [...this.mendainlist, ...arr]
if(res.data.total >=1){
this.mendainlist.map(a=>a.id = a.store_id)
}
if(this.mendainlist.length>=res.data.total){ if(this.mendainlist.length>=res.data.total){
this.iswanjie=true this.iswanjie=true
} }

@ -77,7 +77,8 @@
mandianxinxi: {}, mandianxinxi: {},
vipxinxi: {}, vipxinxi: {},
yhxyactive: false, yhxyactive: false,
top: 0 top: 0,
userxixin: {}
} }
}, },
onLoad(option) { onLoad(option) {
@ -88,6 +89,7 @@
that.vipxinxi = vipxinxi that.vipxinxi = vipxinxi
that.mandianxinxi = tuijianlist that.mandianxinxi = tuijianlist
that.top = uni.getSystemInfoSync().statusBarHeight that.top = uni.getSystemInfoSync().statusBarHeight
this.memberInfo();
}, },
onShow() { onShow() {
var xzmd = uni.getStorageSync('xzmd') var xzmd = uni.getStorageSync('xzmd')
@ -104,6 +106,11 @@
url: '/pages/mendainlist/mendainlist' url: '/pages/mendainlist/mendainlist'
}) })
}, },
memberInfo() {
this.$api.memberInfo().then(res => {
this.userxixin = res.data
})
},
change(e) { change(e) {
console.log(123, e); console.log(123, e);
if (e.detail.value.length != 0) { if (e.detail.value.length != 0) {
@ -124,6 +131,22 @@
duration: 3000 duration: 3000
}); });
} else { } else {
if(!this.userxixin.face_id) {
uni.showModal({
title: "温馨提示",
content:"当前用户没有人脸识别,是否立即前往?",
confirmColor: "#F8A617",
confirmText: "前往",
success(res) {
if(res.confirm){
uni.navigateTo({
url: "/pages/face/face"
})
}
}
})
return ;
}
this.$api.cardBuy({ this.$api.cardBuy({
card_id: this.vipxinxi.card_id, card_id: this.vipxinxi.card_id,
store_id: this.mandianxinxi.id store_id: this.mandianxinxi.id

Loading…
Cancel
Save