|
@@ -18,7 +18,7 @@
|
|
|
<view class="goodsPrice3">{{info.salePrice?info.salePrice:info.scribingPrice}}</view>
|
|
|
<view class="goodsPrice4" v-if="info.scribingPrice">¥{{info.scribingPrice}}</view>
|
|
|
</view>
|
|
|
- <view class="Sold">已售 {{info.saleQty}}</view>
|
|
|
+ <view class="Sold" v-if="info.showLabel&&info.showLabel.indexOf('3')!=-1">已售 {{info.saleQty}}</view>
|
|
|
</view>
|
|
|
<view class="goodsName">{{info.name}}</view>
|
|
|
<view class="goodsMd" v-if="info.sellingPoint">{{info.sellingPoint}}</view>
|
|
@@ -29,17 +29,17 @@
|
|
|
<view class="modelineLeft">配送方式</view>
|
|
|
<view class="modeLineRight">{{info.distributionType==1?'到店取货':'到店使用'}}</view>
|
|
|
</view>
|
|
|
- <view class="modeline">
|
|
|
+ <view class="modeline" v-if="info.oneQty">
|
|
|
<view class="modelineLeft">限购数量</view>
|
|
|
- <view class="modeLineRight" v-if="info.oneQty">{{info.oneQty}}</view>
|
|
|
+ <view class="modeLineRight" >{{info.oneQty}}</view>
|
|
|
</view>
|
|
|
- <view class="modeline">
|
|
|
+ <view class="modeline" v-if="info.afterService">
|
|
|
<view class="modelineLeft">售后服务</view>
|
|
|
<view class="modeLineRight">{{info.afterService}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 服务流程 -->
|
|
|
- <view class="fuwuliucBox">
|
|
|
+ <view class="fuwuliucBox" v-if="info.showLabel&&info.showLabel.indexOf('4')!=-1">
|
|
|
<view class="fwlcTitle">服务流程</view>
|
|
|
<view class="fwlcxian">
|
|
|
<view class="fwlcyuan"></view>
|
|
@@ -60,7 +60,7 @@
|
|
|
<!-- 套餐内容 -->
|
|
|
<view class="mealBox" v-if="info.bizType==3">
|
|
|
<view class="fwlcTitle">套餐内容</view>
|
|
|
- <view class="mealLine" v-for="(item,index) in 2">
|
|
|
+ <view class="mealLine" v-if="info.itemPackTimesDetails">
|
|
|
<view class="mealTop">
|
|
|
<view class="mealName">项目名称</view>
|
|
|
<view class="mealTopRight">
|
|
@@ -69,18 +69,30 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="itemlinebOX">
|
|
|
- <view class="itemline">
|
|
|
- <view class="itemname">这是项目名称长长长长长项目名称项目名称长长sss长长换行换</view>
|
|
|
- <view>20</view>
|
|
|
- <view>10个月</view>
|
|
|
+ <view class="itemline" v-for="(item,index) in info.itemPackTimesDetails">
|
|
|
+ <view class="itemname">{{item.flowName}}</view>
|
|
|
+ <view>{{item.flowQty}}</view>
|
|
|
+ <view v-if="expireNumber">{{expireNumber}}个月</view>
|
|
|
+ <view v-else>永久</view>
|
|
|
</view>
|
|
|
- <view class="itemline">
|
|
|
- <view class="itemname">这是项目名称</view>
|
|
|
- <view>200</view>
|
|
|
- <view>10个月</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="mealLine" v-if="info.goodsPackTimesDetails">
|
|
|
+ <view class="mealTop">
|
|
|
+ <view class="mealName">商品名称</view>
|
|
|
+ <view class="mealTopRight">
|
|
|
+ <view>数量</view>
|
|
|
+ <view style="padding-left: 44rpx;">有效期</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="itemlinebOX">
|
|
|
+ <view class="itemline" v-for="(item,index) in info.goodsPackTimesDetails">
|
|
|
+ <view class="itemname">{{item.flowName}}</view>
|
|
|
+ <view>{{item.flowQty}}</view>
|
|
|
+ <view v-if="expireNumber">{{expireNumber}}个月</view>
|
|
|
+ <view v-else>永久</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 商品详情 -->
|
|
@@ -100,7 +112,7 @@
|
|
|
<image src="../../static/timg/share.png" mode="" class="bottomImg"></image>
|
|
|
<view class="bottomTxt">分享</view>
|
|
|
</view>
|
|
|
- <view class="bottomBtn" @click="buyShow=true">立即购买</view>
|
|
|
+ <view class="bottomBtn" @click="ljbuy">立即购买</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
@@ -111,12 +123,12 @@
|
|
|
<view class="goodsBox">
|
|
|
<view class="hotGoodsLine" >
|
|
|
<view>
|
|
|
- <image :src="info.ImgList[0].url" mode="" v-if="info.ImgList.length>1" class="hotGoodsLineImg"></image>
|
|
|
+ <image :src="info.ImgList[0].url" mode="" v-if="info.ImgList.length>0" class="hotGoodsLineImg"></image>
|
|
|
<image src="../../static/timg/noimg.png" class="hotGoodsLineImg" v-else></image>
|
|
|
</view>
|
|
|
<view class="hotGoodsLineRIght">
|
|
|
<view class="goodsName2">{{info.name}}</view>
|
|
|
- <view class="Sold" v-if="item.showLabel&&item.showLabel.indexOf('2')!=-1">
|
|
|
+ <view class="Sold" v-if="info.showLabel&&info.showLabel.indexOf('3')!=-1">
|
|
|
已售 {{info.saleQty}}</view>
|
|
|
<view class="goodsPrice">
|
|
|
<view class="goodsPrice11" v-if="info.saleLabel">{{info.saleLabel}}</view>
|
|
@@ -155,7 +167,17 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
-
|
|
|
+ <!-- 手机号授权 -->
|
|
|
+ <view class="authorizBox" v-if="authorizShow" @click="authorizShow=false">
|
|
|
+ <view class="authorizCont" @click.stop="">
|
|
|
+ <view class="authorizName">{{wxOpenData.miniAppName}}</view>
|
|
|
+ <view class="authorizMs">您好,欢迎访问本店,授权手机号登录能获取我们最新的促销活动哦~</view>
|
|
|
+ <button class="authorizContbutton" type="default" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">授权</button>
|
|
|
+ </view>
|
|
|
+ <view style="text-align: center;padding-top: 56rpx;">
|
|
|
+ <image src="../../static/timg/icon_guanbi@2x.png" mode="" class="authorizCloseImg"></image>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
<!-- <view :style="{color:colorX}">asdfas</view> -->
|
|
|
</view>
|
|
|
</template>
|
|
@@ -176,15 +198,21 @@
|
|
|
shopName:'',
|
|
|
shopId:''
|
|
|
},
|
|
|
+ authorizShow:false,
|
|
|
+ code:'',
|
|
|
+ wxOpenData:'',
|
|
|
}
|
|
|
},
|
|
|
onLoad(opt) {
|
|
|
this.id=opt.id;
|
|
|
- this.userInfo = uni.getStorageSync("userInfo");
|
|
|
+ //this.userInfo = uni.getStorageSync("userInfo");
|
|
|
+ this.userInfo=this.$store.state.userInfo;
|
|
|
+ this.wxOpenData=this.$store.state.wxOpenData;
|
|
|
this.openGoodsDetailById();
|
|
|
},
|
|
|
onShow() {
|
|
|
this.shopInfo=this.$store.state.ckshopInfo;
|
|
|
+
|
|
|
console.log(this.shopInfo)
|
|
|
},
|
|
|
methods: {
|
|
@@ -202,20 +230,56 @@
|
|
|
if(this.info.details){
|
|
|
this.info.details = this.info.details.replace(/\<img/gi, '<img style="max-width:100%;height:auto" ');
|
|
|
}
|
|
|
- var item={
|
|
|
- shopId:this.info.shopId,
|
|
|
- shopName:this.info.shopName
|
|
|
- }
|
|
|
- this.shopInfo=item
|
|
|
- this.$store.commit('mutationsckshopInfo', item)
|
|
|
+ this.szShop()
|
|
|
+
|
|
|
})
|
|
|
},
|
|
|
+ ljbuy(){
|
|
|
+ if(!this.userInfo){
|
|
|
+ this.authorizShow=true
|
|
|
+ }else{
|
|
|
+ this.buyShow=true
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ szShop(){
|
|
|
+ if(this.userInfo){
|
|
|
+ this.$http('openMall/openStoreList', {
|
|
|
+ goodsId:this.id,
|
|
|
+ // lat: '',
|
|
|
+ // lng: '',
|
|
|
+ }, 'GET').then(res => {
|
|
|
+
|
|
|
+ var queryShopList = res.data
|
|
|
+ //console.log('list+=', this.queryShopList);
|
|
|
+ queryShopList.forEach(itme=>{
|
|
|
+ if(item.shopId==this.info.shopId){
|
|
|
+ var item={
|
|
|
+ shopId:this.info.shopId,
|
|
|
+ shopName:this.info.shopName
|
|
|
+ }
|
|
|
+ this.shopInfo=item
|
|
|
+ this.$store.commit('mutationsckshopInfo', item)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
goINdex(){
|
|
|
uni.switchTab({
|
|
|
url:'../index/index'
|
|
|
})
|
|
|
},
|
|
|
goBuy(){
|
|
|
+ if(!this.shopInfo.shopId){
|
|
|
+ uni.showToast({
|
|
|
+ title: '请选择服务门店',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 3000
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
var that=this;
|
|
|
uni.setStorage({
|
|
|
key: 'goodsDetail',
|
|
@@ -234,11 +298,42 @@
|
|
|
this.goodsnum--
|
|
|
}
|
|
|
}else{
|
|
|
- if(this.info.oneQty>this.goodsnum){
|
|
|
+ console.log("+++")
|
|
|
+ if(this.info.oneQty!=null){
|
|
|
+ if(this.info.oneQty>this.goodsnum){
|
|
|
+ this.goodsnum++
|
|
|
+ }
|
|
|
+ }else{
|
|
|
this.goodsnum++
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ decryptPhoneNumber: function(e) {
|
|
|
+ console.log(e);
|
|
|
+ this.code=e.detail.code
|
|
|
+ this.wxPhoneLogin()
|
|
|
+ this.authorizShow=false;
|
|
|
+ },
|
|
|
+ wxPhoneLogin(){
|
|
|
+ var that=this;
|
|
|
+ this.$http('miniApp2/sys/wxPhoneLogin', {
|
|
|
+ appId:'wx33053a645546ec31',
|
|
|
+ unionId:'EEADACCD-8A19-499D-8AD7-6975D2C93243',
|
|
|
+ code:this.code,
|
|
|
+ openId:this.wxOpenData.openid
|
|
|
+ },'POST').then(res => {
|
|
|
+ var data = res.data;
|
|
|
+ if(data.loginInfo){
|
|
|
+ this.userInfo=data.loginInfo.openUser;
|
|
|
+ this.wxOpenData=data.loginInfo;
|
|
|
+ this.$store.commit('mutationswxOpenData', data.loginInfo)
|
|
|
+ this.$store.commit('mutationsuserInfo', this.userInfo)
|
|
|
+
|
|
|
+ this.szShop()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -352,7 +447,7 @@
|
|
|
.buyNumBox{
|
|
|
padding: 30rpx;
|
|
|
padding-top: 10rpx;
|
|
|
- padding-top: 70rpx;
|
|
|
+ padding-bottom: 70rpx;
|
|
|
}
|
|
|
.buyContCh{
|
|
|
position: absolute;
|
|
@@ -652,4 +747,63 @@
|
|
|
color: #333333;
|
|
|
font-size: 26rpx;
|
|
|
}
|
|
|
+.authorizBox{
|
|
|
+ width: 100vw;
|
|
|
+ height: 100vh;
|
|
|
+ background: rgba(0, 0, 0, 0.5);
|
|
|
+ position: fixed;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ }
|
|
|
+ .authorizCont{
|
|
|
+ margin-top: 30vh;
|
|
|
+ width: 564rpx;
|
|
|
+ height: 408rpx;
|
|
|
+ background: #FFFFFF;
|
|
|
+ border-radius: 24rpx;
|
|
|
+ margin-left: 93rpx;
|
|
|
+ position: relative;
|
|
|
+ }
|
|
|
+ .authorizCloseImg{
|
|
|
+ width: 62rpx;
|
|
|
+ height: 62rpx;
|
|
|
+ }
|
|
|
+ .sqLogoBox{
|
|
|
+ width: 180rpx;
|
|
|
+ height: 180rpx;
|
|
|
+ background: #FFFFFF;
|
|
|
+ border-radius: 90rpx;
|
|
|
+ text-align: center;
|
|
|
+ position: absolute;
|
|
|
+ top: -50rpx;
|
|
|
+ left: 192rpx;
|
|
|
+ }
|
|
|
+ .authorizName{
|
|
|
+ color: #333333;
|
|
|
+ line-height: 42rpx;
|
|
|
+ font-size: 30rpx;
|
|
|
+ text-align: center;
|
|
|
+ padding-top: 58rpx;
|
|
|
+ }
|
|
|
+ .authorizMs{
|
|
|
+ color: #999999;
|
|
|
+ line-height: 36rpx;
|
|
|
+ font-size: 26rpx;
|
|
|
+ width: 452rpx;
|
|
|
+ padding-top: 24rpx;
|
|
|
+ text-align: center;
|
|
|
+ margin-left: 56rpx;
|
|
|
+ }
|
|
|
+ .authorizContbutton{
|
|
|
+ width: 422rpx;
|
|
|
+ height: 88rpx;
|
|
|
+ background: #D53533;
|
|
|
+ border-radius: 44rpx;
|
|
|
+ line-height: 88rpx;
|
|
|
+ text-align: center;
|
|
|
+ font-size:30rpx;
|
|
|
+ color: #FFFFFF;
|
|
|
+ margin-top: 62rpx;
|
|
|
+ margin-left:71rpx;
|
|
|
+ }
|
|
|
</style>
|