Explorar o código

套餐组合碎屏险

宇宙无敌M1处理器的MacBook Pro %!s(int64=4) %!d(string=hai) anos
pai
achega
1f92799a7e

+ 117 - 17
components/page-component/app-attr/app-attr.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd 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>件
@@ -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();
@@ -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) {
@@ -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 = ''
@@ -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")
@@ -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;
@@ -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) {
@@ -747,12 +794,10 @@
 								} else if (res.cancel) {
 									console.log('用户点击取消');
 								}
-
 							}
 						})
 						return;
 					}
-
 				}
 				if (!this.submit()) return false;
 				if (this.noPay) {
@@ -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;
 				}
@@ -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>

+ 0 - 3
components/page-component/goods/u-attr.vue

xqd xqd
@@ -212,7 +212,6 @@
 					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']
-
 				}
 				this.checked.service_label = this.service_label;
 				this.checked.card_id = this.card_id;
@@ -222,8 +221,6 @@
 				// 		this.service_screen.screenList.forEach((item,index)=>{
 
 				// 			this.screenDescription=this.service_screen.screenList[index]['description']||''
-
-
 				// 		})
 				// 	}else{
 				// 		this.service_label = null

+ 6 - 2
plugins/composition/detail/detail.vue

xqd xqd xqd
@@ -186,7 +186,8 @@
                                         id: that.list[i].goods_list[y].goods_id,
                                         num: 1,
                                         goods_attr_id: that.list[i].goods_list[y].choose_attr.goods_attr_id,
-                                        attr: attr
+                                        attr: attr,
+										service_label:that.list[i].goods_list[y].choose_attr.service_label
                                     })
                                 }
                             }
@@ -207,7 +208,8 @@
                                     id: that.list[i].host_list[0].goods_id,
                                     num: 1,
                                     goods_attr_id: that.list[i].host_list[0].choose_attr.goods_attr_id,
-                                    attr: attr
+                                    attr: attr,
+									
                                 })
                             }
                             let noChoose = true;
@@ -274,7 +276,9 @@
                 this.showNoAttr = false;
             },
             updateList(e) {
+				console.log(e)
                 this.list = e;
+				
             },
             update(e) {
                 this.noAttrList = e;

+ 4 - 4
siteinfo.js

xqd
@@ -1,9 +1,9 @@
 var siteinfo = {
     'acid': -1,
     'version': '4.3.57',
-	'siteroot': 'https://t12.9026.com/app/index.php',
-	'apiroot': 'https://t12.9026.com/web/index.php?_mall_id=21989',
-    // 'siteroot': 'https://quanyouhui.9026.com/app/index.php',
-    // 'apiroot': 'https://quanyouhui.9026.com/web/index.php?_mall_id=21989',
+	// 'siteroot': 'https://t12.9026.com/app/index.php',
+	// 'apiroot': 'https://t12.9026.com/web/index.php?_mall_id=21989',
+    'siteroot': 'https://quanyouhui.9026.com/app/index.php',
+    'apiroot': 'https://quanyouhui.9026.com/web/index.php?_mall_id=21989',
 };
 module.exports = siteinfo;