|
|
|
@ -12,7 +12,7 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="content-right"> |
|
|
|
<view class="right-box" v-for="item in shopList" :key="item"> |
|
|
|
<view class="right-box" v-for="item in shopList" :key="item" @tap="toggle('bottom',item)"> |
|
|
|
<view class="box-left"> |
|
|
|
<img :src="item.productPicture" alt=""> |
|
|
|
</view> |
|
|
|
@ -38,11 +38,11 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<checkbox-group @change="checkboxChange"> |
|
|
|
<!-- <checkbox-group @change="checkboxChange"> |
|
|
|
<label> |
|
|
|
<checkbox :value="item.id" class="checkbox" /> |
|
|
|
</label> |
|
|
|
</checkbox-group> |
|
|
|
</checkbox-group> --> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -53,7 +53,7 @@ |
|
|
|
<text class="uni-tab__text">已选择</text> |
|
|
|
</view> |
|
|
|
<text style="background-color:#ff0000;color:#fff;position: absolute;top: 0;right: 10rpx;" |
|
|
|
class="uni-tab__dot">{{ info }}</text> |
|
|
|
class="uni-tab__dot">{{carList.length}}</text> |
|
|
|
</view> |
|
|
|
<view class="bottom-right"> |
|
|
|
<view class="bottom-btn" open-type="share" @tap="toggle('bottom')">选好了</view> |
|
|
|
@ -68,43 +68,44 @@ |
|
|
|
<img src="/static/images/logo.png" alt=""> |
|
|
|
</view> |
|
|
|
<view class="popup-title-right"> |
|
|
|
<view class="popup-title-right-box" style="color: #088FEB;">创意小众单肩包</view> |
|
|
|
<view class="popup-title-right-box">QS2023101001</view> |
|
|
|
<view class="popup-title-right-box" style="color: #088FEB;">{{goodsDetail.productName}} |
|
|
|
</view> |
|
|
|
<view class="popup-title-right-box">{{goodsDetail.barcode}}</view> |
|
|
|
<view class="popup-title-right-box" style="color: darkorange;" @tap="inputDialogToggle"> |
|
|
|
<text style="margin-right:20rpx;">¥0.00</text> |
|
|
|
<uni-icons color="#088FEB" type="compose" size="16" style="color:#088FEB"></uni-icons> |
|
|
|
<text style="margin-right:20rpx;">¥{{goodsDetail.price}}</text> |
|
|
|
<text style="color:blue;">临时改价</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="popup-container"> |
|
|
|
<ul> |
|
|
|
<!-- <li v-for="items in attrList" :key="items.id"> --> |
|
|
|
<li> |
|
|
|
<li v-for="(items,index) in goodsDetail.attributeList" :key="index"> |
|
|
|
<view class="title-fur"> |
|
|
|
<view class="name">男装</view> |
|
|
|
<view class="name">{{items.name}}</view> |
|
|
|
</view> |
|
|
|
<view class="content-fur"> |
|
|
|
<!-- <view class="content-low" v-for="item in items.attributeValue" :key="item.id" @tap="delItem(item, 'attrNameDel')">男装</view> --> |
|
|
|
<view class="content-low">男装</view> |
|
|
|
<view class="attrs"> |
|
|
|
<uni-data-checkbox v-model="value" :localdata="range" |
|
|
|
@change="change"></uni-data-checkbox> |
|
|
|
<text v-for="(itemTag, index1) in items.value" :key="index1" |
|
|
|
@tap.stop="attrNameChange(index,index1) " |
|
|
|
:class="itemTag.isChecked ? 'checkedText' : '' "> {{itemTag.value}}</text> |
|
|
|
</view> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
<view class="checkList"> |
|
|
|
<view class="checkList" v-for="item in temporaryList"> |
|
|
|
<view class="checkList-box"> |
|
|
|
<text>女装</text> |
|
|
|
<text>S码</text> |
|
|
|
<text>黄色</text> |
|
|
|
{{item.name}} |
|
|
|
</view> |
|
|
|
<uni-number-box :value="numberValue" @change="change" /> |
|
|
|
<uni-number-box :value="item.temporaryNum" @change="temporaryChange" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="popup-bottom"> |
|
|
|
<view class="popup-bottom" v-for="item in temporaryList"> |
|
|
|
<view class="popup-bottom-left"> |
|
|
|
<text>2 款 9 件</text> |
|
|
|
<text>¥2952.00</text> |
|
|
|
<text>{{item.num}} 件</text> |
|
|
|
<text>¥{{item.num * item.price}}</text> |
|
|
|
</view> |
|
|
|
<view class="popup-bottom-right"> |
|
|
|
<view class="bottom-btn" @tap="">选好了</view> |
|
|
|
<view class="bottom-btn" @tap="temporaryCheck">选好了</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -113,84 +114,46 @@ |
|
|
|
<!-- 弹出输入框 --> |
|
|
|
<uni-popup ref="inputDialog" type="dialog"> |
|
|
|
<uni-popup-dialog ref="inputClose" mode="input" title="临时改价" placeholder="请输入临时售价" |
|
|
|
@confirm="dialogInputConfirm"></uni-popup-dialog> |
|
|
|
@confirm="changePrice"></uni-popup-dialog> |
|
|
|
</uni-popup> |
|
|
|
<!-- 购物车弹出层 --> |
|
|
|
<uni-popup ref="carPopup" background-color="#fff" @change="change"> |
|
|
|
<view class="popup-content"> |
|
|
|
<view class="popup-title"> |
|
|
|
<view class="popup-title-left"> |
|
|
|
<img src="/static/images/logo.png" alt=""> |
|
|
|
</view> |
|
|
|
<view class="popup-title-right"> |
|
|
|
<view class="popup-title-right-box" style="color: #088FEB;">创意小众单肩包</view> |
|
|
|
<view class="popup-title-right-box">QS2023101001</view> |
|
|
|
<view class="popup-title-right-box" style="color: darkorange;" @tap="inputDialogToggle"> |
|
|
|
<text style="margin-right:20rpx;">¥0.00</text> |
|
|
|
<uni-icons color="#088FEB" type="compose" size="16"></uni-icons> |
|
|
|
<view style="position: absolute;top: 30rpx;right: 30rpx;"> |
|
|
|
<uni-icons color="red" type="trash" size="26"></uni-icons> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view v-for="item in carList"> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="popup-container"> |
|
|
|
<view class="checkList"> |
|
|
|
<view style="margin-right:5%;"> |
|
|
|
<uni-icons color="red" type="minus" size="26"></uni-icons> |
|
|
|
</view> |
|
|
|
<view class="checkList-box"> |
|
|
|
<text>女装</text> |
|
|
|
<text>S码</text> |
|
|
|
<text>黄色</text> |
|
|
|
|
|
|
|
<view class="popup-title"> |
|
|
|
<view class="popup-title-left"> |
|
|
|
<img src="/static/images/logo.png" alt=""> |
|
|
|
</view> |
|
|
|
<uni-number-box :value="numberValue" @change="change" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="popup-title"> |
|
|
|
<view class="popup-title-left"> |
|
|
|
<img src="/static/images/logo.png" alt=""> |
|
|
|
</view> |
|
|
|
<view class="popup-title-right"> |
|
|
|
<view class="popup-title-right-box" style="color: #088FEB;">创意小众单肩包</view> |
|
|
|
<view class="popup-title-right-box">QS2023101001</view> |
|
|
|
<view class="popup-title-right-box" style="color: darkorange;" @tap="inputDialogToggle"> |
|
|
|
<text style="margin-right:20rpx;">¥0.00</text> |
|
|
|
<uni-icons color="#088FEB" type="compose" size="16"></uni-icons> |
|
|
|
<view style="position: absolute;top: 30rpx;right: 30rpx;"> |
|
|
|
<uni-icons color="red" type="trash" size="26"></uni-icons> |
|
|
|
<view class="popup-title-right"> |
|
|
|
<view class="popup-title-right-box" style="color: #088FEB;">{{item.productName}}</view> |
|
|
|
<view class="popup-title-right-box">{{item.productSn}}</view> |
|
|
|
<view class="popup-title-right-box" style="color: darkorange;" @tap="inputDialogToggle"> |
|
|
|
<text style="margin-right:20rpx;">¥{{item.price}}</text> |
|
|
|
<uni-icons color="#088FEB" type="compose" size="16"></uni-icons> |
|
|
|
<view style="position: absolute;top: 30rpx;right: 30rpx;"> |
|
|
|
<uni-icons color="red" type="trash" size="26"></uni-icons> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="popup-container"> |
|
|
|
<view class="checkList"> |
|
|
|
<view style="margin-right:5%;"> |
|
|
|
<uni-icons color="red" type="minus" size="26"></uni-icons> |
|
|
|
</view> |
|
|
|
<view class="checkList-box"> |
|
|
|
<text>女装</text> |
|
|
|
<text>S码</text> |
|
|
|
<text>黄色</text> |
|
|
|
</view> |
|
|
|
<uni-number-box :value="numberValue" @change="change" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="popup-container"> |
|
|
|
<view class="checkList"> |
|
|
|
<view style="margin-right:5%;"> |
|
|
|
<uni-icons color="red" type="minus" size="26"></uni-icons> |
|
|
|
</view> |
|
|
|
<view class="checkList-box"> |
|
|
|
<text>女装</text> |
|
|
|
<text>S码</text> |
|
|
|
<text>黄色</text> |
|
|
|
<view class="popup-container"> |
|
|
|
<view class="checkList"> |
|
|
|
<view style="margin-right:5%;"> |
|
|
|
<uni-icons color="red" type="minus" size="26"></uni-icons> |
|
|
|
</view> |
|
|
|
<view class="checkList-box"> |
|
|
|
<text>女装</text> |
|
|
|
<text>S码</text> |
|
|
|
<text>黄色</text> |
|
|
|
</view> |
|
|
|
<uni-number-box :value="numberValue" @change="change" /> |
|
|
|
</view> |
|
|
|
<uni-number-box :value="numberValue" @change="change" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="popup-bottom"> |
|
|
|
<view class="popup-bottom-left"> |
|
|
|
<text>2 款 9 件</text> |
|
|
|
@ -218,7 +181,11 @@ |
|
|
|
searchName: '', //搜索框输入值 |
|
|
|
shopId: '', //店铺id, |
|
|
|
checkbox: [], //需要分享的商品id |
|
|
|
numberValue: 0, |
|
|
|
temporaryNum: 0, |
|
|
|
goodsDetail: [], |
|
|
|
attrNameList: [], |
|
|
|
temporaryList: [], |
|
|
|
carList: [] |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
@ -243,14 +210,45 @@ |
|
|
|
} else {} |
|
|
|
}).catch((res) => {}) |
|
|
|
}, |
|
|
|
attrNameChange(index, index1) { |
|
|
|
this.goodsDetail.attributeList[index].value.forEach(item => { |
|
|
|
item.isChecked = false; |
|
|
|
}) |
|
|
|
this.goodsDetail.attributeList[index].isChecked = true; |
|
|
|
this.goodsDetail.attributeList[index].value[index1].isChecked = true; |
|
|
|
console.log(this.goodsDetail) |
|
|
|
var name = ''; |
|
|
|
for (var i = 0; i < this.goodsDetail.attributeList.length; i++) { |
|
|
|
for (var m = 0, Ien = this.goodsDetail.attributeList[i].value; m < Ien.length; m++) { |
|
|
|
console.log(Ien[m]) |
|
|
|
if (Ien[m].isChecked == true) { |
|
|
|
name += Ien[m].value |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.temporaryList = [{ |
|
|
|
id: this.goodsDetail.id, |
|
|
|
barcode: this.goodsDetail.barcode, |
|
|
|
price: this.goodsDetail.price, |
|
|
|
name: name, |
|
|
|
num: this.temporaryNum, |
|
|
|
productName: this.goodsDetail.productName, |
|
|
|
productSn: this.goodsDetail.productSn |
|
|
|
}] |
|
|
|
}, |
|
|
|
temporaryChange(val) { |
|
|
|
console.log(val) |
|
|
|
this.temporaryList[0].num = val |
|
|
|
|
|
|
|
}, |
|
|
|
//点击分类获取商品列表 |
|
|
|
getShareList(id) { |
|
|
|
this.tui.request("/app/product/getShareList", "POST", { |
|
|
|
shopId: '002', |
|
|
|
// categoryId:id || '1695090289036890112', |
|
|
|
categoryId: '1695090289036890112', |
|
|
|
// supplierName:this.searchName || '测试', |
|
|
|
supplierName: '测试', |
|
|
|
categoryId: id, |
|
|
|
// categoryId: '1695090289036890112', |
|
|
|
supplierName: this.searchName, |
|
|
|
// supplierName: '测试', |
|
|
|
pageNum: this.pageNum, |
|
|
|
pageSize: '10' |
|
|
|
}, false, true).then((res) => { |
|
|
|
@ -264,13 +262,15 @@ |
|
|
|
change(e) { |
|
|
|
console.log('当前模式:' + e.type + ',状态:' + e.show); |
|
|
|
}, |
|
|
|
//弹出商品规格选择 |
|
|
|
toggle(type) { |
|
|
|
//弹出购物车或者商品规格选择弹窗 |
|
|
|
toggle(type, item) { |
|
|
|
|
|
|
|
this.type = type |
|
|
|
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 |
|
|
|
if (type == 'carPopup') { |
|
|
|
this.$refs.carPopup.open('bottom') |
|
|
|
} else { |
|
|
|
this.checkGoods(item); |
|
|
|
this.$refs.popup.open('bottom') |
|
|
|
} |
|
|
|
|
|
|
|
@ -282,6 +282,34 @@ |
|
|
|
// icon: 'none' |
|
|
|
// }) |
|
|
|
// }, |
|
|
|
//选择商品查询商品规格 |
|
|
|
checkGoods(item) { |
|
|
|
this.goodsDetail = item |
|
|
|
if (typeof(this.goodsDetail.attributeList) == 'string') { |
|
|
|
let newObj = JSON.parse(this.goodsDetail.attributeList) |
|
|
|
let newArr = [] |
|
|
|
for (let val in newObj) { |
|
|
|
let valueObj = []; |
|
|
|
for (var i = 0; i < newObj[val].length; i++) { |
|
|
|
valueObj.push({ |
|
|
|
value: newObj[val][i], |
|
|
|
isChecked: false |
|
|
|
}) |
|
|
|
this.attrNameList.push({ |
|
|
|
value: newObj[val][i], |
|
|
|
name: val, |
|
|
|
isChecked: false |
|
|
|
}) |
|
|
|
} |
|
|
|
newArr.push({ |
|
|
|
name: val, |
|
|
|
value: valueObj |
|
|
|
}) |
|
|
|
} |
|
|
|
this.goodsDetail.attributeList = newArr; |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
//底部右侧两个分享按钮 |
|
|
|
buttonClick(e) { |
|
|
|
|
|
|
|
@ -343,6 +371,20 @@ |
|
|
|
inputDialogToggle() { |
|
|
|
this.$refs.inputDialog.open() |
|
|
|
}, |
|
|
|
//临时改价 |
|
|
|
changePrice(val) { |
|
|
|
this.goodsDetail.price = this.temporaryList[0].price = val |
|
|
|
}, |
|
|
|
//弹窗选择规格后,点击弹窗中选好了按钮 |
|
|
|
temporaryCheck() { |
|
|
|
this.carList.push(this.temporaryList[0]); |
|
|
|
this.$refs.popup.close() |
|
|
|
// for (var i =0;i<this.shopList.length;i++) { |
|
|
|
// if(this.shopList[i].id == this.temporaryList[0].id){ |
|
|
|
// this.shopList[i].temporaryList = this.temporaryList[0] |
|
|
|
// } |
|
|
|
// } |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
@ -636,4 +678,23 @@ |
|
|
|
border-radius: 70rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.attrs { |
|
|
|
text { |
|
|
|
display: inline-block; |
|
|
|
border: 1px solid #5fd9ee; |
|
|
|
margin: 20rpx; |
|
|
|
background-color: #fff; |
|
|
|
color: #5fd9ee; |
|
|
|
width: 100rpx; |
|
|
|
line-height: 70rpx; |
|
|
|
height: 70rpx; |
|
|
|
text-align: center; |
|
|
|
} |
|
|
|
|
|
|
|
.checkedText { |
|
|
|
background-color: $u-primary; |
|
|
|
color: #fff; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |