进入首页调用获取用户信息接口、新增会员价开关、压缩静态图片、
parent
4eb1c2c258
commit
62b55ad099
|
@ -32,7 +32,7 @@
|
|||
</view>
|
||||
<view class="textA">
|
||||
<view class="money">
|
||||
¥{{item.price_text}}
|
||||
¥{{item.price}}
|
||||
</view>
|
||||
<view class="btn" v-if="item.customized==1">
|
||||
可定制
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
可定制
|
||||
</view>
|
||||
<view class="money" style="display: flex;">
|
||||
<text >¥</text>{{ commodityData.detail.price_text}}
|
||||
<text >¥</text>{{ commodityData.detail.price}}
|
||||
<view v-if="ifMember && ifMemberPrice && commodityData.detail.vip_price" style="margin-left: 40rpx;">会员价:<text >¥</text> {{ commodityData.detail.vip_price}}</view>
|
||||
</view>
|
||||
<view class="specification" @click="specificationFun()">
|
||||
|
@ -67,7 +67,7 @@
|
|||
</view>
|
||||
<view class="textA">
|
||||
<view class="money">
|
||||
<text >¥</text>{{item.price_text}}
|
||||
<text >¥</text>{{item.price}}
|
||||
</view>
|
||||
<view class="btn" v-if="item.customized==1">
|
||||
可定制
|
||||
|
@ -90,7 +90,7 @@
|
|||
<view class="popup" :class="popupState?'popupB':''">
|
||||
<image class="imgGb" @click="specificationFunState()" src="../../static/47.png" mode=""></image>
|
||||
<view class="popupTitle">
|
||||
<image class="img" @click="previewImg(commodityData.sku[current].picture)" :src="commodityData.sku[current].picture" mode="aspectFill"></image>
|
||||
<image class="img" @click="previewImg(commodityData.sku[current].picture || commodityData.detail.cover)" :src="commodityData.sku[current].picture || commodityData.detail.cover" mode="aspectFill"></image>
|
||||
<view class="money" v-if="money">
|
||||
<text >¥</text> {{money}}
|
||||
<view v-if="ifMember && ifMemberPrice && vip_price" style="margin-left: 40rpx;margin-bottom: 10rpx;">会员价:<text >¥</text> {{vip_price}}</view>
|
||||
|
@ -153,7 +153,7 @@
|
|||
},
|
||||
specificationFun(){
|
||||
this.popupState=true
|
||||
this.money=this.commodityData.sku[0].price_text
|
||||
this.money=this.commodityData.sku[0].price
|
||||
this.vip_price=this.commodityData.sku[0].vip_price
|
||||
for (var i = 0; i < this.commodityData.sku.length; i++) {
|
||||
this.commodityData.sku[i].state=false
|
||||
|
@ -178,7 +178,7 @@
|
|||
this.commodityData.sku[i].state=false
|
||||
}
|
||||
this.commodityData.sku[index].state =true
|
||||
this.money=this.commodityData.sku[index].price_text;
|
||||
this.money=this.commodityData.sku[index].price;
|
||||
this.vip_price = this.commodityData.sku[index].vip_price;
|
||||
this.current = index;
|
||||
this.commodityData.sku=[...this.commodityData.sku]
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
<view class="money">
|
||||
<view class="moneyNum" style="display: flex;">
|
||||
<text >¥</text>{{item.price_text}}
|
||||
<text >¥</text>{{item.price}}
|
||||
<view v-if="ifMember && ifMemberPrice && item.vip_price">
|
||||
<text style="margin-left: 40rpx;">会员价:¥</text>{{item.vip_price}}
|
||||
</view>
|
||||
|
@ -87,9 +87,11 @@
|
|||
this.ifMemberPrice = uni.getStorageSync('ifMemberPrice');
|
||||
},
|
||||
onLoad() {
|
||||
if(uni.getStorageSync('userData')) {
|
||||
this.getbannerData()
|
||||
this.getNavData()
|
||||
|
||||
}
|
||||
this.getUserData();
|
||||
|
||||
},
|
||||
onReachBottom() {
|
||||
|
@ -107,6 +109,37 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
getUserData(){
|
||||
if(!uni.getStorageSync('userData')) {
|
||||
uni.login({
|
||||
success:(res)=> {
|
||||
console.log(res);
|
||||
this.request({
|
||||
url: this.host + "/api/user/login",
|
||||
type:"POST",
|
||||
data: {
|
||||
code: res.code,
|
||||
},
|
||||
success:(data)=>{
|
||||
uni.setStorageSync('userData',data.data.data);
|
||||
this.requestToken({
|
||||
url: this.host + "/api/user/info",
|
||||
type: "post",
|
||||
success: (res) => {
|
||||
res.data.data.is_vip ? this.ifMember = true : this.ifMember = false;
|
||||
uni.setStorageSync('ifMember',this.ifMember);
|
||||
res.data.data.vip_switch ? this.ifSwitchMember = true : this.ifSwitchMember = false;
|
||||
uni.setStorageSync('ifMemberPrice',this.ifSwitchMember);
|
||||
}
|
||||
})
|
||||
this.getbannerData()
|
||||
this.getNavData()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
getHomeData() {
|
||||
this.moreState="loading"
|
||||
this.request({
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<view class="imgCon">
|
||||
<image class="img" :src="userInfo.headimgurl" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="name">
|
||||
<view class="name" v-if="userInfo.nickname">
|
||||
{{userInfo.nickname}}
|
||||
</view>
|
||||
<view class="Id" v-if="userInfo.vip_code">
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
</view>
|
||||
<view class="textA">
|
||||
<view class="money">
|
||||
<text >¥</text>{{item.price_text}}
|
||||
<text >¥</text>{{item.price}}
|
||||
</view>
|
||||
<view class="btn" v-if="item.customized==1">
|
||||
可定制
|
||||
|
|
Loading…
Reference in New Issue