| xqd
@@ -117,6 +117,32 @@
|
|
|
</view>
|
|
|
<image src="/static/image/cart/can-be-added.png"
|
|
|
class="block box-grow-0 cross-center main-center" @click="numberAdd"></image>
|
|
|
+ </view>
|
|
|
+ <view class="service"
|
|
|
+ v-if="service_screen&&service_screen.screenList&&service_screen.screenList.length>0">
|
|
|
+ <view class="service_title">全优汇服务</view>
|
|
|
+ <view class="service_item" style="align-items: center;">
|
|
|
+ <image style="width: 26upx;height:26upx;"
|
|
|
+ src="https://t12.9026.com/web/statics/icon1/sp.png"> </image>
|
|
|
+
|
|
|
+ <view style="flex: 1;">
|
|
|
+ <view style="float: left;">碎屏险</view>
|
|
|
+ <view class="slh">{{screenDescription}}</view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view style="color: red;" @click="gotoSpDetail">服务说明
|
|
|
+ <image style="width: 26upx;height:26upx;"
|
|
|
+ src="https://t12.9026.com/web/statics/icon1/问号.png"> </image>
|
|
|
+ </view>
|
|
|
+ <!-- <view>{{service_screen.screenList.intro}}</view> -->
|
|
|
+ </view>
|
|
|
+ <view class="service_value">
|
|
|
+ <view class="service_block" v-for="(item,index) of service_screen.screenList"
|
|
|
+ :key="index" :class="{service_block_active:index == serviceId}"
|
|
|
+ @click="select_service(index)">
|
|
|
+ {{item.name}} ¥{{item.price}}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view v-if="sign =='wholesale'" class="total">已选<text>{{totalNumber}}</text>件
|
| xqd
@@ -239,13 +265,21 @@
|
|
|
// 商品批发
|
|
|
activeAttr: [],
|
|
|
goodsAttr: [],
|
|
|
- service_screen:null
|
|
|
+ service_screen: null, //碎屏险
|
|
|
+ service_label: null, //当前对屏对象
|
|
|
+ serviceId: null, //碎屏险ID
|
|
|
+ card_id: null,
|
|
|
+ screenDescription: '',
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
show() {
|
|
|
if (this.display === 'block') {
|
|
|
- this.selectAttr = null;
|
|
|
+ this.selectAttr = null;
|
|
|
+ this.serviceId = null
|
|
|
+ this.screenDescription = ""
|
|
|
+ this.service_label = null
|
|
|
+ this.card_id = null
|
|
|
this.close();
|
|
|
} else if (this.display === 'none') {
|
|
|
this.alert();
|
| xqd
@@ -314,7 +348,20 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- methods: {
|
|
|
+ methods: {
|
|
|
+ select_service(index) {
|
|
|
+ if (this.serviceId == index) {
|
|
|
+ this.serviceId = null
|
|
|
+ this.screenDescription = ""
|
|
|
+ this.service_label = null
|
|
|
+ this.card_id = null
|
|
|
+ } else {
|
|
|
+ this.serviceId = index
|
|
|
+ this.screenDescription = this.service_screen.screenList[index]['description'] || ''
|
|
|
+ this.service_label = this.service_screen.screenList[index]
|
|
|
+ this.card_id = this.service_screen.screenList['card_id']
|
|
|
+ }
|
|
|
+ },
|
|
|
alert() {
|
|
|
|
|
|
if (this.attrGroupList.length === 0) {
|
| xqd
@@ -357,9 +404,14 @@
|
|
|
}
|
|
|
// this.getservice()
|
|
|
this.display = 'block';
|
|
|
+ },
|
|
|
+ gotoSpDetail() {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pages/goods/spDetail"
|
|
|
+ })
|
|
|
},
|
|
|
getservice(select_val) {
|
|
|
- console.log(select_val)
|
|
|
+ if(select_val.length<=1) return false
|
|
|
this.goods.attr.forEach((item, index) => {
|
|
|
let select_item_list = []
|
|
|
let select_item_value = ''
|
| xqd
@@ -368,8 +420,7 @@
|
|
|
select_item_value = value.attr_group_id + '-' + value.attr_id
|
|
|
select_item_list.push(select_item_value)
|
|
|
})
|
|
|
- if (JSON.stringify(select_val) == JSON.stringify(select_item_list)) {
|
|
|
- console.log("进来了")
|
|
|
+ if (JSON.stringify(select_val) == JSON.stringify(select_item_list)) {
|
|
|
this.service_screen = item
|
|
|
}
|
|
|
console.log(this.service_screen, "oooooooooooooooo")
|
| xqd
@@ -471,16 +522,11 @@
|
|
|
for (let j in attr_group_list[i].attr_list) {
|
|
|
let temp = attr_group_list[i].attr_list[j];
|
|
|
if (parseInt(attr_group_list[i].attr_group_id) == parseInt(attr_group_id)) {
|
|
|
- if (parseInt(temp.attr_id) === parseInt(attr_id)) {
|
|
|
-
|
|
|
+ if (parseInt(temp.attr_id) === parseInt(attr_id)) {
|
|
|
if (temp.checked) {
|
|
|
temp.checked = false;
|
|
|
} else {
|
|
|
- temp.checked = true;
|
|
|
- select_num.push(
|
|
|
- `${attr_group_list[i].attr_group_id}-${temp.attr_id}`
|
|
|
- )
|
|
|
- this.getservice(select_num)
|
|
|
+ temp.checked = true;
|
|
|
}
|
|
|
if (temp.attr_num_0) {
|
|
|
return;
|
| xqd
@@ -496,7 +542,8 @@
|
|
|
checkedAttr.push(attr_group_list[i].attr_group_id + '-' + temp.attr_id);
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
+ this.getservice(checkedAttr)
|
|
|
|
|
|
function inArray(val, arr) {
|
|
|
return arr.some(function(v) {
|
| xqd
@@ -747,12 +794,10 @@
|
|
|
} else if (res.cancel) {
|
|
|
console.log('用户点击取消');
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
})
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
if (!this.submit()) return false;
|
|
|
if (this.noPay) {
|
| xqd
@@ -761,7 +806,8 @@
|
|
|
}
|
|
|
if (this.buyClick) {
|
|
|
this.display = 'none';
|
|
|
- this.selectAttr.number = this.number;
|
|
|
+ this.selectAttr.number = this.number;
|
|
|
+ this.selectAttr.service_label = this.service_label
|
|
|
this.$emit('buyClick', this.selectAttr);
|
|
|
return false;
|
|
|
}
|
| xqd
@@ -1265,5 +1311,59 @@
|
|
|
left: 0;
|
|
|
width: 100%;
|
|
|
background-color: #ffffff;
|
|
|
+ }
|
|
|
+ .service{
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+ }
|
|
|
+ .service_title {
|
|
|
+ padding-top: 10px;
|
|
|
+ margin: 14px 10px 10px;
|
|
|
+ font-weight: 700;
|
|
|
+ font-size: 13px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .service_item {
|
|
|
+ margin: 14px 0px 0px;
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #666;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ }
|
|
|
+
|
|
|
+ .service_value {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ padding: 0px 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .service_block {
|
|
|
+ min-width: 46%;
|
|
|
+ height: 28px;
|
|
|
+ line-height: 26px;
|
|
|
+ border: 1px solid #f5f5f5;
|
|
|
+ border-radius: 16px;
|
|
|
+ text-align: center;
|
|
|
+ margin-right: 10px;
|
|
|
+ margin-top: 10px;
|
|
|
+ font-size: 12px;
|
|
|
+ background-color: #f5f5f5;
|
|
|
+ position: relative;
|
|
|
+ }
|
|
|
+
|
|
|
+ .service_block_active {
|
|
|
+ color: #f21c1c;
|
|
|
+ border: 1px solid #f21c1c;
|
|
|
+ }
|
|
|
+
|
|
|
+ .slh {
|
|
|
+ margin-left: 5upx;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ width: 460upx;
|
|
|
+ white-space: nowrap;
|
|
|
+ float: left;
|
|
|
+ /* display: -webkit-box;
|
|
|
+ -webkit-line-clamp: 1;
|
|
|
+ -webkit-box-orient: vertical; */
|
|
|
}
|
|
|
</style>
|