删除冗余代码
This commit is contained in:
BIN
pages/store/.DS_Store
vendored
Normal file
BIN
pages/store/.DS_Store
vendored
Normal file
Binary file not shown.
@@ -3,33 +3,34 @@
|
||||
<!-- 产品封面 -->
|
||||
<view class="goods-swiper">
|
||||
<swiper :indicator-dots="false" @change="current = $event.detail.current + 1">
|
||||
<swiper-item v-for="(item, index) in goods.pictures" :key="index">
|
||||
<swiper-item v-for="(item, index) in goods.pictures" :key="index+1">
|
||||
<view class="swiper-cover">
|
||||
<image :src="item" mode="aspectFill" />
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<view class="swiper-pages"> {{current}}/{{goods.pictures.length}}</view>
|
||||
<view class="swiper-pages"> {{current}}/{{goods.pictures.length}}</view>
|
||||
<!-- vip 商品提示 -->
|
||||
<view class="vipGoodsInfo" v-if="shop_vip.status" >{{shop_vip.message}} </view>
|
||||
<view class="vipGoodsInfo" v-if="shop_vip.status">{{shop_vip.message}} </view>
|
||||
<!-- 拼团 商品标题上面提示 -->
|
||||
<view class="vipGoodsInfo" v-if="goods.is_active " >拼团商品</view>
|
||||
<view class="vipGoodsInfo" v-if="goods.is_active ">拼团商品</view>
|
||||
</view>
|
||||
<!-- 详情 -->
|
||||
<view class="main">
|
||||
<view class="title"> {{goods.name}} </view>
|
||||
<view class="sub-title">
|
||||
<!-- vip 商品前边 tags -->
|
||||
<span class='vipType' v-if="shop_vip.messageTitle != ''">{{shop_vip.messageTitle}}</span>{{goods.description}}
|
||||
<view class="sub-title">
|
||||
<!-- vip 商品前边 tags -->
|
||||
<span class='vipType'
|
||||
v-if="shop_vip.messageTitle != ''">{{shop_vip.messageTitle}}</span>{{goods.description}}
|
||||
</view>
|
||||
<view class="box-flex">
|
||||
<view class="box-flex">
|
||||
<!-- vip 商品展示原价 -->
|
||||
<view class="price">
|
||||
<view class="price">
|
||||
{{goods.price.show}}<text>DT积分</text>
|
||||
<span class ='del' v-if="shop_vip.status">{{goods.original_price}} DT积分</span>
|
||||
</view>
|
||||
<span class='del' v-if="shop_vip.status">{{goods.original_price}} DT积分</span>
|
||||
</view>
|
||||
<!-- vip 商品及普通商品展示库存量 -->
|
||||
<view class="sales" v-if="goods.skus && !goods.is_active">库存量{{goods.skus[0].stock}}件</view>
|
||||
<view class="sales" v-if="goods.skus && !goods.is_active">库存量{{goods.skus[0].stock}}件</view>
|
||||
<!-- 拼团商品展示已拼数量及参团数 -->
|
||||
<view class="_pin" v-if="goods.is_active">
|
||||
<view class="_has" v-if="goods.active.count>0">
|
||||
@@ -47,7 +48,7 @@
|
||||
<view class=" des"> {{shop_vip.card.description}} </view>
|
||||
</view>
|
||||
<view class="btn" @click="toVip">
|
||||
<!-- 1 开通 2续费 3升级 number 类型 -->
|
||||
<!-- 1 开通 2续费 3升级 number 类型 -->
|
||||
查看详情
|
||||
<!-- {{shop_vip.card.state === 1 ?'立即开通':shop_vip.card.state === 2 ?'立即续费':'立即升级'}} -->
|
||||
</view>
|
||||
@@ -59,7 +60,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 可拼团列表 -->
|
||||
<view class="is_active" v-if="goods.is_active && collages.length>0">
|
||||
<view class="is_active" v-if="goods.is_active && collages.length>0 && shareId == ''">
|
||||
<view class="title" v-if="collages.length > 2">
|
||||
这些人刚刚拼单成功,可参与拼单
|
||||
<span @click="getMorePin = true">查看更多
|
||||
@@ -74,7 +75,8 @@
|
||||
<u-avatar-group :urls="item.covers" size="34" gap="0.6" class="avatar-group" />
|
||||
<view class="nickname"> {{item.names}}</view>
|
||||
</view>
|
||||
<view class="btn" v-if="goods.active.can_join || item.can_share" @click="toPin(item)">{{ item.can_share?'去分享':'去拼单'}}</view>
|
||||
<view class="btn" v-if="goods.active.can_join || item.can_share" @click="toPin(item)">
|
||||
{{ item.can_share?'去分享':'去拼单'}}</view>
|
||||
<view class="noneBtn" v-else @click="showPinToast">去拼单</view>
|
||||
</view>
|
||||
</block>
|
||||
@@ -100,7 +102,7 @@
|
||||
|
||||
<!-- 商品详情 -->
|
||||
<view class="imgs">
|
||||
<u-notice-bar v-if="shop_vip.status" text="戒指尺寸有大小,请购买戒指时参照详情介绍,备注所选尺寸" fontSize='14' />
|
||||
<u-notice-bar v-if="shop_vip.status" text="戒指尺寸有大小,请在购买戒指时参照详情介绍备注所选尺寸" fontSize='14' />
|
||||
<block v-for="(item, index) in goods.content" :key="index">
|
||||
<image :src="item" mode="widthFix" />
|
||||
</block>
|
||||
@@ -109,12 +111,14 @@
|
||||
|
||||
<!-- 立即购买 shop_vip.status 区分是否是 vip 商品 否则的就却分是拼团商品还是普通商品 -->
|
||||
<view class="footer">
|
||||
<view @click="toShop(goods.shop.shop_id)" class="shop"> <uni-icons type="shop" size="26" color="grey" />店铺 </view>
|
||||
<view @click="toShop(goods.shop.shop_id)" class="shop">
|
||||
<uni-icons type="shop" size="26" color="grey" />店铺
|
||||
</view>
|
||||
<!-- vip 规格弹窗立即领取 -->
|
||||
<button type="default" v-if="shop_vip.status" hover-class="none" @click="vipBuy">立即领取</button>
|
||||
<!-- 非vip 规格弹窗 普通商品立即购买,拼单商品立即拼单 -->
|
||||
<block v-else>
|
||||
<block v-if="goods.is_active">
|
||||
<block v-if="goods.is_active">
|
||||
<button type="default" v-if="goods.active.can_join" hover-class="none" @click="buy"> 立即拼单 </button>
|
||||
<button type="default" v-else hover-class="none" @click="share"> 立即分享 </button>
|
||||
</block>
|
||||
@@ -132,7 +136,8 @@
|
||||
<u-avatar-group :urls="item.covers" size="34" gap="0.6" class="avatar-group" />
|
||||
<view class="nickname"> {{item.names}}</view>
|
||||
</view>
|
||||
<view class="btn" v-if="goods.active.can_join || item.can_share" @click="toPin(item)">{{ item.can_share?'去分享':'去拼单'}}</view>
|
||||
<view class="btn" v-if="goods.active.can_join || item.can_share" @click="toPin(item)">
|
||||
{{ item.can_share?'去分享':'去拼单'}}</view>
|
||||
<view class="noneBtn" v-else @click="showPinToast">去拼单</view>
|
||||
</view>
|
||||
</block>
|
||||
@@ -145,7 +150,7 @@
|
||||
<view scroll-y="true" class="content-2">
|
||||
<view class="title"> 参与{{collageitem.names}}的拼单 </view>
|
||||
<view class="number">仅剩<span>{{collageitem.surplus}}</span>个名额</view>
|
||||
<view class="avatars" v-for="(item,index) in collageitem.details" :key='index' >
|
||||
<view class="avatars" v-for="(item,index) in collageitem.details" :key='index'>
|
||||
<image :class="['avatar',item.master?'pin':'']" :src="item.cover" mode="aspectFill" />
|
||||
<image class="wen" src="/static/book/wen.png" mode="aspectFill" />
|
||||
</view>
|
||||
@@ -171,8 +176,9 @@
|
||||
<view class="sku-title">{{item.name}}</view>
|
||||
<view class="sku-list">
|
||||
<block v-for="it in item.values" :key='it.value_id'>
|
||||
<view :class="['sku-item',specselect[index] == it.value_id ? 'sku-active':'']" @click="clickSkus(index,it.value_id)">
|
||||
{{it.value}}
|
||||
<view :class="['sku-item',specselect[index] == it.value_id ? 'sku-active':'']"
|
||||
@click="clickSkus(index,it.value_id)">
|
||||
{{it.value}}
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
@@ -180,7 +186,8 @@
|
||||
|
||||
<view class="buy-number">
|
||||
<view class="buy-title">数量</view>
|
||||
<uni-number-box :min="1" :max="selectSkusValues.stock" :disabled="selectSkusValues.stock == 0" @change="qty = $event" />
|
||||
<uni-number-box :min="1" :max="selectSkusValues.stock" :disabled="selectSkusValues.stock == 0"
|
||||
@change="qty = $event" />
|
||||
</view>
|
||||
|
||||
<!-- 立即购买 shop_vip.status 区分是否是 vip 商品 只支持单规格php 规定不支持多规格 否则的就却分是拼团商品还是普通商品 -->
|
||||
@@ -189,10 +196,16 @@
|
||||
@click="vipBuy">立即领取</button>
|
||||
<!-- 非vip 规格弹窗 普通商品立即购买,拼单商品立即拼单 -->
|
||||
<block v-else>
|
||||
<button class="now-buy" type="default" hover-class="none" @click="buy2(selectSkusValues)">立即购买</button>
|
||||
<button class="now-buy" type="default" hover-class="none"
|
||||
@click="buy2(selectSkusValues)">立即购买</button>
|
||||
</block>
|
||||
</scroll-view>
|
||||
</u-popup>
|
||||
|
||||
<!-- 分享 -->
|
||||
<uni-popup ref="popupShare" type="share" background-color="#fff">
|
||||
<uni-popup-share title="立即分享到" @select="select" />
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -231,11 +244,16 @@
|
||||
// "is_receive": false // 当前会员是否已领取过 false 未领取 true 已领取
|
||||
},
|
||||
// collageid:'' ,// 拼团 id
|
||||
collageitem:'',// 已选择的拼团的 item
|
||||
collageitem: '', // 已选择的拼团的 item
|
||||
shareId: '', // 从分享页带过来的 id 区分是否能展示可拼团列表及底部按钮直接拼!
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
this.getGoods()
|
||||
if (this.$Route.query.shareId) {
|
||||
this.shareId = this.$Route.query.shareId;
|
||||
console.log(this.shareId)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getGoods() {
|
||||
@@ -263,31 +281,81 @@
|
||||
this.getMorePin = false
|
||||
this.pinShow = false
|
||||
this.qty = 1;
|
||||
// this.specselect = this.skus[0].unit.split('|')
|
||||
// this.selectSkusValues = this.skus[0]
|
||||
// this.specselect = this.skus[0].unit.split('|')
|
||||
// this.selectSkusValues = this.skus[0]
|
||||
},
|
||||
// 去拼单
|
||||
toPin(item) {
|
||||
console.log(item);
|
||||
this.close();
|
||||
if(item.can_share){
|
||||
this.share()
|
||||
}else{
|
||||
this.collageitem = item
|
||||
if (item.can_share) {
|
||||
this.share(item)
|
||||
} else {
|
||||
this.pinShow = true;
|
||||
this.collageitem = item
|
||||
}
|
||||
},
|
||||
// 分享
|
||||
share(){
|
||||
console.log(' 分享。。。')
|
||||
share() {
|
||||
this.$refs.popupShare.open();
|
||||
},
|
||||
// 分享
|
||||
onShare() {},
|
||||
|
||||
// 分享选项
|
||||
select(e) {
|
||||
console.log(this.collageitem)
|
||||
switch (e.item.name) {
|
||||
case 'wxchum':
|
||||
uni.share({
|
||||
provider: 'weixin',
|
||||
scene: 'WXSceneSession',
|
||||
type: 0,
|
||||
href: this.collageitem.url + this.collageitem.collage_id + 'invitation' + this
|
||||
.collageitem.invite,
|
||||
title: '【仅剩' + this.collageitem.surplus + '个名额】邀请您一起拼团',
|
||||
summary: '好货不用一分钱,点点就能带回家【 ' + this.goods.name + '】',
|
||||
imageUrl: this.goods.cover,
|
||||
fail: (err) => {
|
||||
uni.showToast({
|
||||
title: err.errMsg,
|
||||
icon: 'none'
|
||||
})
|
||||
},
|
||||
success: (res) => {
|
||||
this.collageitem = {}
|
||||
}
|
||||
})
|
||||
break;
|
||||
case 'wxcircle':
|
||||
uni.share({
|
||||
provider: 'weixin',
|
||||
scene: 'WXSceneTimeline',
|
||||
type: 0,
|
||||
href: this.collageitem.url + this.collageitem.collage_id + 'invitation' + this
|
||||
.collageitem.invite,
|
||||
summary: '好货不用一分钱,点点就能带回家【 ' + this.goods.name + '】',
|
||||
imageUrl: this.goods.cover,
|
||||
fail: (err) => {
|
||||
uni.showToast({
|
||||
title: err.errMsg,
|
||||
icon: 'none'
|
||||
})
|
||||
},
|
||||
success: (res) => {
|
||||
this.collageitem = {}
|
||||
}
|
||||
})
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
// 弹出 拼团不可点
|
||||
showPinToast(){
|
||||
uni.showToast({
|
||||
title:this.goods.active.message,
|
||||
icon:'none',
|
||||
mask:true,
|
||||
})
|
||||
showPinToast() {
|
||||
uni.showToast({
|
||||
title: this.goods.active.message,
|
||||
icon: 'none',
|
||||
mask: true,
|
||||
})
|
||||
},
|
||||
clickSkus(index, id) {
|
||||
this.skuid = ''
|
||||
@@ -331,23 +399,23 @@
|
||||
if (this.shop_vip.is_receive) {
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: this.shop_vip.alert_text+'请联系线下商家:' + this.goods.shop.mobile,
|
||||
content: this.shop_vip.alert_text + '请联系线下商家:' + this.goods.shop.mobile,
|
||||
cancelText: '再看看',
|
||||
cancelColor: '#999',
|
||||
showCancel:false,
|
||||
showCancel: false,
|
||||
confirmColor: '#34ce98',
|
||||
confirmText: ' 知道了',
|
||||
success: (res) => {
|
||||
// if (res.confirm) {
|
||||
// //#ifdef MP-WEIXIN
|
||||
// uni.makePhoneCall({
|
||||
// phoneNumber: '18354789632'
|
||||
// });
|
||||
// //#endif
|
||||
// //#ifdef APP-PLUS
|
||||
// plus.device.dial('18354789632', true);
|
||||
// //#endif
|
||||
// }
|
||||
// if (res.confirm) {
|
||||
// //#ifdef MP-WEIXIN
|
||||
// uni.makePhoneCall({
|
||||
// phoneNumber: '18354789632'
|
||||
// });
|
||||
// //#endif
|
||||
// //#ifdef APP-PLUS
|
||||
// plus.device.dial('18354789632', true);
|
||||
// //#endif
|
||||
// }
|
||||
}
|
||||
})
|
||||
} else {
|
||||
@@ -366,7 +434,8 @@
|
||||
if (res.confirm) {
|
||||
this.close();
|
||||
uni.navigateTo({
|
||||
url: '/pages/store/vip/index/index?id=' + this.goods.shop.shop_id
|
||||
url: '/pages/store/vip/index/index?id=' + this.goods.shop
|
||||
.shop_id
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -407,14 +476,17 @@
|
||||
skuId: this.skuid,
|
||||
qty: this.qty
|
||||
}
|
||||
if(this.goods.is_active){
|
||||
params.type ='pin';
|
||||
params.collageid = this.collageitem.collage_id || '';
|
||||
if (this.goods.is_active) {
|
||||
params.type = 'pin';
|
||||
params.collageid = this.collageitem.collage_id || '';
|
||||
}
|
||||
if (this.shareId != '') {
|
||||
params.collageid = this.shareId || '';
|
||||
}
|
||||
console.log(params)
|
||||
this.$Router.push({
|
||||
name: 'StoreBuy',
|
||||
params:params
|
||||
params: params
|
||||
})
|
||||
this.close()
|
||||
},
|
||||
@@ -479,7 +551,8 @@
|
||||
font-size: $title-size-m;
|
||||
text-shadow: 0 5rpx 5rpx rgba($color: #000000, $alpha: .02);
|
||||
}
|
||||
.vipGoodsInfo{
|
||||
|
||||
.vipGoodsInfo {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
@@ -488,7 +561,7 @@
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
padding: 4rpx 30rpx;
|
||||
border-radius: 0 0 40rpx 0;
|
||||
border-radius: 0 0 40rpx 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -501,14 +574,16 @@
|
||||
border-radius: $radius $radius 0 0;
|
||||
box-shadow: 0 0 10rpx 10rpx rgba($color: #000000, $alpha: .02);
|
||||
padding-bottom: ($padding*2) + 90;
|
||||
.vipType{
|
||||
|
||||
.vipType {
|
||||
color: #fff;
|
||||
font-size:28rpx;
|
||||
margin-right:10rpx;
|
||||
font-size: 28rpx;
|
||||
margin-right: 10rpx;
|
||||
padding: 2rpx 20rpx;
|
||||
background-color: #e5c175;
|
||||
border-radius: 20rpx 0 20rpx 0;
|
||||
}
|
||||
|
||||
.hr {
|
||||
position: relative;
|
||||
min-height: 1rpx;
|
||||
@@ -568,11 +643,12 @@
|
||||
font-size: 60%;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
.del{
|
||||
|
||||
.del {
|
||||
text-decoration: line-through;
|
||||
margin-left: 20rpx;
|
||||
font-size: 26rpx;
|
||||
color:#999;
|
||||
color: #999;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
@@ -737,7 +813,8 @@
|
||||
padding: 6rpx 20rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.noneBtn{
|
||||
|
||||
.noneBtn {
|
||||
border: #999 1rpx solid;
|
||||
color: #999;
|
||||
padding: 6rpx 20rpx;
|
||||
@@ -914,7 +991,7 @@
|
||||
height: 90rpx;
|
||||
margin: 10rpx 20rpx;
|
||||
border-radius: 50%;
|
||||
border:solid 2rpx #f9f9f9;
|
||||
border: solid 2rpx #f9f9f9;
|
||||
}
|
||||
|
||||
.me {
|
||||
@@ -1013,7 +1090,8 @@
|
||||
padding: 6rpx 20rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.noneBtn{
|
||||
|
||||
.noneBtn {
|
||||
border: #999 1rpx solid;
|
||||
color: #999;
|
||||
padding: 6rpx 20rpx;
|
||||
@@ -1150,4 +1228,4 @@
|
||||
margin-top: $margin;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -25,8 +25,13 @@
|
||||
<view class="classify-item-title">{{item.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-scroll-list>
|
||||
|
||||
</u-scroll-list>
|
||||
|
||||
<!-- 拼团广告图 -->
|
||||
<view class="collage" v-if="collage_banner!=''">
|
||||
<image @click="goCollage" :src="collage_banner" mode="widthFix" />
|
||||
</view>
|
||||
|
||||
<!-- 每日上新 -->
|
||||
<view class="new-box">
|
||||
<view class="title">上新精选<text class="title-des"> | 精品上新新品推荐</text></view>
|
||||
@@ -40,11 +45,11 @@
|
||||
<view class="news-price nowrap">{{item.price.price_min}} <text>DT积分</text></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- VIP换购 -->
|
||||
<view class="new-box" style="margin-top: 30rpx;" v-if="vips.length>0">
|
||||
<view class="title">VIP换购 <view class="more"><text class="title-des"> | 千款商品任意换购</text> <text
|
||||
<view class="title">VIP换购 <view class="more"><text class="title-des"> | 百款商品任意换购</text> <text
|
||||
class="more-txt" @click="$Router.push({name: 'VipList'})">更多 ></text></view>
|
||||
</view>
|
||||
<view class="news">
|
||||
@@ -116,7 +121,8 @@
|
||||
goodsArr: [],
|
||||
meals: [],
|
||||
shops: [],
|
||||
vips:[]
|
||||
vips:[],
|
||||
collage_banner:''
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
@@ -131,12 +137,17 @@
|
||||
this.goodTabs = res.categories
|
||||
this.meals = res.meals
|
||||
this.shops = res.shops
|
||||
this.vips = res.vips
|
||||
this.vips = res.vips
|
||||
this.collage_banner = res.collage_banner
|
||||
uni.stopPullDownRefresh()
|
||||
})
|
||||
},
|
||||
goCollage(){
|
||||
uni.navigateTo({
|
||||
url:'/pages/group-book/index'
|
||||
})
|
||||
},
|
||||
goBook(item) {
|
||||
console.log(item)
|
||||
if (item.url) {
|
||||
if (item.url.openType === 'navigateTo') {
|
||||
if (item.url.params != '') {
|
||||
@@ -302,6 +313,14 @@
|
||||
&-item:nth-child(2) {
|
||||
background: #c9ead9;
|
||||
}
|
||||
}
|
||||
// 全民拼团
|
||||
.collage{
|
||||
box-sizing: border-box;
|
||||
image{
|
||||
width: 100%;
|
||||
height: 0;
|
||||
}
|
||||
}
|
||||
|
||||
// 上新精选
|
||||
|
||||
Reference in New Issue
Block a user