From df698fb979db6f1d571f548f40744a19e8c21ac2 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 21 九月 2023 17:48:12 +0800
Subject: [PATCH] 属性对比
---
h5/pages/index/index.vue | 92 +++++++++++++++++++++++++++++++--------------
1 files changed, 63 insertions(+), 29 deletions(-)
diff --git a/h5/pages/index/index.vue b/h5/pages/index/index.vue
index 2df63d8..0e00306 100644
--- a/h5/pages/index/index.vue
+++ b/h5/pages/index/index.vue
@@ -2,8 +2,8 @@
<view class="box">
<view class="box_bg" :style="{backgroundImage: 'url(' + Config.resourcePath + Config.bgImg + ')'}"></view>
<view class="box_user">
- <text>娆㈣繋{{User.username}}鐧诲綍</text>
- <view class="box_user_btn" @click="loginOut">閫�鍑虹櫥褰�</view>
+ <text>{{User.username}}</text>
+ <image src="@/static/ic_logout@2x.png" mode="widthFix" @click="loginOut"></image>
</view>
<view class="box_content" :style="{maxWidth: Config.rangeSize + 'px', minWidth: Config.rangeSize + 'px'}">
<!-- 骞垮憡鍥� -->
@@ -230,7 +230,12 @@
</view>
</view>
<view class="productPage_parameter_item_content_nr">
- <view class="item" v-for="(child, i) in item.goodsParamList" :key="i">
+ <view class="item" v-if="item.param1" v-for="(child, i) in item.param1" :key="child.index">
+ <view class="label">{{child.name}}锛�</view>
+ <view class="value">{{child.val}}</view>
+ </view>
+ <view v-if="item.param2.length>0" class="paramline"></view>
+ <view class="item" v-if="item.param2" v-for="(child, j) in item.param2" :key="child.index">
<view class="label">{{child.name}}锛�</view>
<view class="value">{{child.val}}</view>
</view>
@@ -240,16 +245,6 @@
</view>
</view>
</template>
-
- <!-- 鏌ョ湅澶у浘 -->
- <bigImg
- ref="bigImg"
- :imgList="imgList"/>
- <!-- 鏌ョ湅澶у浘 -->
- <bigImg1
- ref="bigImg1"
- :imgList="imgList"/>
- <!-- 鎼滅储 -->
<!-- 鎼滅储缁勪欢 -->
<search
@@ -265,8 +260,6 @@
</template>
<script>
- import bigImg from '@/components/bigImg.vue'
- import bigImg1 from '@/components/bigImg1.vue'
import search from '@/components/search.vue'
import noData from '@/components/noData.vue'
import { mapState } from 'vuex'
@@ -347,7 +340,7 @@
page: 1
}
},
- components: { bigImg, search, noData, bigImg1 },
+ components: { search, noData },
onLoad() {
var that = this
// 鐩戝惉閿洏缁勫悎閿�
@@ -858,6 +851,51 @@
this.leftShop = JSON.parse(JSON.stringify(val))
} else if (this.$refs.search.typeName === 'right') {
this.rightShop = JSON.parse(JSON.stringify(val))
+ let leftParamList = this.leftShop.goodsParamList;
+ let rightParamList = this.rightShop.goodsParamList;
+ let leftList1 = new Array();
+ let leftList2 = new Array();
+ let rightList1 = new Array();
+ let rightList2 = new Array();
+ if(leftParamList && leftParamList.length>0){
+ leftParamList.forEach(item => {
+ let flag =0;
+ let rightTemp = null;
+ if(rightParamList && rightParamList.length>0){
+ rightParamList.forEach(item1 => {
+ if (item.name === item1.name ) {
+ flag =1;
+ rightTemp = item1;
+ return;
+ }
+ })
+ }
+ if(flag === 1){
+ leftList1.push(item);
+ rightList1.push(rightTemp);
+ }else{
+ leftList2.push(item);
+ }
+ })
+ }
+ if(rightParamList && rightParamList.length>0){
+ rightParamList.forEach(item=> {
+ let flag1 = 0;
+ rightList1.forEach(item1 => {
+ if (item.name === item1.name ) {
+ flag1 =1;
+ //return;
+ }
+ })
+ if(flag1 === 0){
+ rightList2.push(item);
+ }
+ })
+ }
+ Reflect.set(this.leftShop, "param1",leftList1);
+ Reflect.set(this.leftShop, "param2",leftList2);
+ Reflect.set(this.rightShop, "param1",rightList1);
+ Reflect.set(this.rightShop, "param2",rightList2);
} else {
this.shopList.push(JSON.parse(JSON.stringify(val)))
}
@@ -1060,7 +1098,7 @@
background-size: 100% 100%;
}
.box_user {
- z-index: 99;
+ z-index: 9;
position: fixed;
top: 30px;
right: 40px;
@@ -1072,19 +1110,11 @@
font-weight: 500;
color: #FFFFFF;
}
- .box_user_btn {
- width: 80px;
- height: 34px;
- line-height: 34px;
- text-align: center;
- border-radius: 8px;
- border: 2px solid #FFFFFF;
- font-size: 16px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #FFFFFF;
- margin-left: 22px;
+ image {
+ width: 18px;
+ height: 18px;
cursor: pointer;
+ margin-left: 10px;
}
}
.box_content {
@@ -1805,6 +1835,10 @@
margin-top: 12px;
display: flex;
flex-direction: column;
+ .paramline{
+ border-bottom: #c7c9ce 2px dashed;
+ margin-bottom: 15px;
+ }
.item {
display: flex;
align-items: flex-start;
--
Gitblit v1.9.3