新增首页、详情页分享、修改会员价颜色、修改分类列表样式bug

master
chen 2022-05-20 11:22:15 +08:00
parent 4cae7f7aef
commit a863748a1b
5 changed files with 86 additions and 76 deletions

View File

@ -19,5 +19,6 @@
min-height: 100vh;
background-color: #f5f5f5;
}
.colorff0{color: #FF0000;}
/*每个页面公共css */
</style>

View File

@ -70,16 +70,21 @@
this.customBar=customBar+100+"rpx"
console.log( this.customBar)
uni.setStorageSync('customBar',customBar+100);
}
})
},
methods: {
navigateBackFun(){
uni.navigateBack()
// uni.navigateBack()
uni.navigateBack({
delta:1,
success: (res) => {},fail: (err) => {
uni.reLaunch({
url:'/pages/index/index'
})
}
})
},

View File

@ -12,14 +12,11 @@
</view>
<view class="classifyCon">
<view class="navClassify">
<view class="navClassifyCon">
<view @click="navStateTow(index)" v-for="(item,index) in classifyConData" class="text"
:class="item.state?'on':''">
{{item.title}}
<scroll-view scroll-x>
<view style="width: 120rpx;display: flex;">
<view @click="navStateTow(index)" v-for="(item,index) in classifyConData" class="text" :class="item.state?'on':''">{{item.title}}</view>
</view>
</view>
</scroll-view>
</view>
<scroll-view scroll-y="true" lower-threshold="100rpx" class="classifyConList" @scrolltolower="lower">
<view class="classifyConListCon">
@ -39,7 +36,7 @@
</view>
</view>
<view class="memberPrice" v-if="ifMember && ifMemberPrice && item.vip_price">
会员价{{item.vip_price}}
会员价<text class="colorff0">{{item.vip_price}}</text>
</view>
</view>
</view>
@ -74,7 +71,8 @@
is_home: 0,
},
ifMember:false,
ifMemberPrice:false
ifMemberPrice:false,
windowWidth:uni.getSystemInfoSync().screenWidth - 80
}
},
onLoad() {
@ -204,7 +202,13 @@
</script>
<style>
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
.navList {
flex-shrink: 0;
width: 128rpx;
height: 88vh;
background-color: #FFFFFF;
@ -251,25 +255,22 @@
}
.classifyCon {
flex: 1;
width: 100%;
padding: 0 20rpx;
box-sizing: border-box;
position: relative;
}
.navClassify {
margin: auto;
overflow-x: auto;
padding-top: 30rpx;
z-index: 3;
padding-bottom: 30rpx;
position: absolute;
background-color: #f6f6f6;
}
.navClassifyCon {
display: flex;
overflow-x: auto;
/* overflow-x: auto; */
}
@ -304,11 +305,8 @@
.classifyConList {
height: 88vh;
overflow-x: auto;
padding-bottom: 119rpx;
box-sizing: border-box;
padding-top: 100rpx;
}
@ -321,7 +319,7 @@
.classifyConList .list {
width: 276rpx;
/* height: 373rpx; */
margin-top: 30rpx;
margin-bottom: 30rpx;
margin-right: 28rpx;
position: relative;
border-radius: 30rpx;

View File

@ -3,7 +3,7 @@
<page-head text="详情" navState="true"></page-head>
<swiper class="swiper" indicator-color="rgba(255,255,255,0.3)" indicator-active-color="rgba(255,255,255,1)"
:indicator-dots="indicatorDots">
<swiper-item v-for="(item,index) in commodityData.detail.images">
<swiper-item v-for="(item,index) in commodityData.detail.images" :key="index">
<view class="swiper-item uni-bg-red">
<image class="img" :src="item" mode="aspectFill"></image>
</view>
@ -50,9 +50,7 @@
<view class="p">面料材质其它 </view>
<view class="p">沙发骨架材质实木 是否带储物空间不带储物空间 沙发
</view> -->
</view>
</view>
<view class="similarity">
<view class="title">
@ -60,33 +58,18 @@
</view>
</view>
<view class="classifyConList">
<view class="list" v-for="(item,index) in commodityData.similarGoods" @click="details(item.id)">
<view class="list" v-for="(item,index) in commodityData.similarGoods" :key="index" @click="details(item.id)">
<image class="img" :src="item.cover" mode="aspectFill"></image>
<view class="text">
{{item.name}}
</view>
<view class="text">{{item.name}}</view>
<view class="textA">
<view class="money">
<text ></text>{{item.price}}
<view class="money"><text ></text>{{item.price}}</view>
<view class="btn" v-if="item.customized==1"></view>
</view>
<view class="btn" v-if="item.customized==1">
可定制
<view class="memberPrice" v-if="ifMember && ifMemberPrice && item.vip_price">{{item.vip_price}}</view>
</view>
</view>
<view class="memberPrice" v-if="ifMember && ifMemberPrice && item.vip_price">
会员价{{item.vip_price}}
</view>
</view>
</view>
<view class="subscriptionButton" @click="makePhoneCallFun()">
立即订购
</view>
<view class="make" :class="popupState?'makedis':''">
</view>
<view class="subscriptionButton" @click="makePhoneCallFun()"></view>
<view class="make" :class="popupState?'makedis':''"></view>
<view class="popup" :class="popupState?'popupB':''">
<image class="imgGb" @click="specificationFunState()" src="../../static/47.png" mode=""></image>
<view class="popupTitle">
@ -95,28 +78,15 @@
<text ></text> {{money}}
<view v-if="ifMember && ifMemberPrice && vip_price" style="margin-left: 40rpx;margin-bottom: 10rpx;"><text ></text> {{vip_price}}</view>
</view>
<view class="money textmoney" v-else>
暂无报价
<view class="money textmoney" v-else></view>
<view class="text">点击上方封面可查看大图</view>
</view>
<view class="text">
点击上方封面可查看大图
</view>
</view>
<view class="popupList">
<view class="tit">
规格
</view>
<view class="tit">规格</view>
<view class="" style="height: 460rpx;overflow: hidden;overflow-y: scroll;margin-top: 20rpx;">
<view class="list" @click="popupListFun(index)" :class="item.state?'on':''" v-for="(item,index) in commodityData.sku">
{{item.title}}
</view>
</view>
<view class="button" @click="makePhoneCallFun()">
立即订购
<view class="list" @click="popupListFun(index)" :class="item.state?'on':''" v-for="(item,index) in commodityData.sku" :key="index">{{item.title}}</view>
</view>
<view class="button" @click="makePhoneCallFun()"></view>
</view>
</view>
@ -134,7 +104,7 @@
popupState:false,
ifMember:false,
ifMemberPrice:false,
current:0
current:0,
}
},
onShow() {
@ -144,6 +114,41 @@
onLoad(option) {
this.id=option.id
this.getData()
if(!uni.getStorageSync('userData')) {
uni.login({
success:(res)=> {
this.request({
url: this.host + "/api/user/login",
type:"POST",
data: {
code: res.code,
},
success:(data)=>{
if(data.data.code!=4003) {
uni.setStorageSync('userData',data.data.data);
this.request({
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.ifMemberPrice = true : this.ifMemberPrice = false;
uni.setStorageSync('ifMemberPrice',this.ifMemberPrice);
}
})
}
}
})
}
})
}
},
onShareAppMessage() {
return {
title: this.commodityData.detail.name,
page: `/pages/commodity/commodity?id=${this.commodityData.detail.id}`,
image:''
}
},
methods: {
makePhoneCallFun(){

View File

@ -7,7 +7,7 @@
</navigator>
<swiper class="swiper" indicator-color="rgba(255,255,255,0.3)" indicator-active-color="rgba(255,255,255,1)"
:indicator-dots="indicatorDots">
<swiper-item v-for="(item,index) in bannerData ">
<swiper-item v-for="(item,index) in bannerData " :key="index">
<view @click="navD(item.spu_id)" class="swiper-item uni-bg-red">
<image class="img" :src="item.src" mode=""></image>
</view>
@ -21,14 +21,14 @@
<view class="navList">
<view class="navListCon">
<view v-for="(item,index) in navData" class="text" @click="navState(index)" :class="item.state?'on':''">
<view v-for="(item,index) in navData" :key="index" class="text" @click="navState(index)" :class="item.state?'on':''">
{{item.title}}
</view>
</view>
</view>
<view class="list">
<view class="listCon" v-for="(item,index) in HomeData" @click="details(item.id)">
<view class="listCon" v-for="(item,index) in HomeData" :key="index" @click="details(item.id)">
<image :src="item.cover" class="img" mode=""></image>
<view class="text">
{{item.name}}
@ -38,7 +38,7 @@
<view class="moneyNum" style="display: flex;">
<text ></text>{{item.price}}
<view v-if="ifMember && ifMemberPrice && item.vip_price">
<text style="margin-left: 40rpx;">会员价</text>{{item.vip_price}}
<text style="margin-left: 40rpx;">会员价</text> <text class="colorff0">{{item.vip_price}}</text>
</view>
</view>
<view class="btn" v-if="item.customized==1">
@ -79,7 +79,7 @@
is_home: 1,
},
ifMember:false,
ifMemberPrice:false
ifMemberPrice:false,
}
},
onShow() {
@ -104,9 +104,11 @@
this.moreState="no-more"
}
}else{
console.log(123)
this.moreState="no-more"
}
},
onShareAppMessage() {
},
methods: {
getUserData(){
@ -129,8 +131,7 @@
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);
uni.setStorageSync('ifMemberPrice',res.data.data.vip_switch ? true : false);
}
})
}