|
|
@ -7,7 +7,8 @@ |
|
|
<view class="content-left"> |
|
|
<view class="content-left"> |
|
|
<view class="left-box" v-for="(item, index) in indexList" :key="index" |
|
|
<view class="left-box" v-for="(item, index) in indexList" :key="index" |
|
|
:class="item.parentId ? 'left-box-hover':''" @tap="clickLeftBtn(index)"> |
|
|
:class="item.parentId ? 'left-box-hover':''" @tap="clickLeftBtn(index)"> |
|
|
<text style="width: 100%;height: 90rpx;line-height: 90rpx;display: inline-block;overflow: hidden;" :class="item.parentId ? 'red' :''">{{item.categoryName}}</text> |
|
|
<text style="width: 100%;height: 90rpx;line-height: 90rpx;display: inline-block;overflow: hidden;" |
|
|
|
|
|
:class="item.parentId ? 'red' :''">{{item.categoryName}}</text> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="content-right"> |
|
|
<view class="content-right"> |
|
|
@ -71,7 +72,8 @@ |
|
|
<view v-for="(item,index) in gwcList" style="position: relative;" :key="index"> |
|
|
<view v-for="(item,index) in gwcList" style="position: relative;" :key="index"> |
|
|
<view class="popup-title"> |
|
|
<view class="popup-title"> |
|
|
<view class="popup-title-left"> |
|
|
<view class="popup-title-left"> |
|
|
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/c09dfa8c61c949f8b0dbb8f041d5a501.png" alt=""> |
|
|
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/c09dfa8c61c949f8b0dbb8f041d5a501.png" |
|
|
|
|
|
alt=""> |
|
|
</view> |
|
|
</view> |
|
|
<view class="popup-title-right"> |
|
|
<view class="popup-title-right"> |
|
|
<view class="popup-title-right-box" style="color: #088FEB;">{{item.productName}}</view> |
|
|
<view class="popup-title-right-box" style="color: #088FEB;">{{item.productName}}</view> |
|
|
@ -107,17 +109,17 @@ |
|
|
pageNum: 1, //分页的页码 |
|
|
pageNum: 1, //分页的页码 |
|
|
shopList: [], |
|
|
shopList: [], |
|
|
info: 0, |
|
|
info: 0, |
|
|
goodsList:[], |
|
|
goodsList: [], |
|
|
categoryId: '', //分类id |
|
|
categoryId: '', //分类id |
|
|
searchName: '', //搜索框输入值 |
|
|
searchName: '', //搜索框输入值 |
|
|
shopId: '', //店铺id, |
|
|
shopId: '', //店铺id, |
|
|
checkbox: '', //需要分享的商品id |
|
|
checkbox: '', //需要分享的商品id |
|
|
id: '', |
|
|
id: '', |
|
|
carList:[], |
|
|
carList: [], |
|
|
carNum:0, |
|
|
carNum: 0, |
|
|
carType:0, |
|
|
carType: 0, |
|
|
type:'', |
|
|
type: '', |
|
|
gwcList:[] |
|
|
gwcList: [] |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
|
@ -181,9 +183,9 @@ |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
//未入库遮罩 |
|
|
//未入库遮罩 |
|
|
clickMask(item){ |
|
|
clickMask(item) { |
|
|
let title = '' |
|
|
let title = '' |
|
|
if(item.delFlag == 0){ |
|
|
if (item.delFlag == 0) { |
|
|
title = '请将商品上架后再操作!' |
|
|
title = '请将商品上架后再操作!' |
|
|
} |
|
|
} |
|
|
// else if(item.delFlag == 1){ |
|
|
// else if(item.delFlag == 1){ |
|
|
@ -210,20 +212,20 @@ |
|
|
checkboxChange(item) { |
|
|
checkboxChange(item) { |
|
|
console.log(item) |
|
|
console.log(item) |
|
|
item.checked = !item.checked |
|
|
item.checked = !item.checked |
|
|
if(this.carList.indexOf(item.id) != -1){ |
|
|
if (this.carList.indexOf(item.id) != -1) { |
|
|
this.carList.splice(this.carList.indexOf(item.id),1) |
|
|
this.carList.splice(this.carList.indexOf(item.id), 1) |
|
|
}else{ |
|
|
} else { |
|
|
this.carList.push(item.id) |
|
|
this.carList.push(item.id) |
|
|
} |
|
|
} |
|
|
if(this.gwcList.length==0){ |
|
|
if (this.gwcList.length == 0) { |
|
|
this.gwcList.push(item) |
|
|
this.gwcList.push(item) |
|
|
}else{ |
|
|
} else { |
|
|
for(let i=0;i<this.gwcList.length;i++){ |
|
|
for (let i = 0; i < this.gwcList.length; i++) { |
|
|
if(this.gwcList[i].id==item.id){ |
|
|
if (this.gwcList[i].id == item.id) { |
|
|
console.log('这里') |
|
|
console.log('这里') |
|
|
this.gwcList.splice(i,1) |
|
|
this.gwcList.splice(i, 1) |
|
|
}else{ |
|
|
} else { |
|
|
if(this.gwcList.length == (i+1)){ |
|
|
if (this.gwcList.length == (i + 1)) { |
|
|
console.log('是不是那里') |
|
|
console.log('是不是那里') |
|
|
this.gwcList.push(item) |
|
|
this.gwcList.push(item) |
|
|
return |
|
|
return |
|
|
@ -233,7 +235,7 @@ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
console.log('gwcList',this.gwcList) |
|
|
console.log('gwcList', this.gwcList) |
|
|
}, |
|
|
}, |
|
|
//点击分享按钮 |
|
|
//点击分享按钮 |
|
|
clickShareBtn(e) { |
|
|
clickShareBtn(e) { |
|
|
@ -283,7 +285,6 @@ |
|
|
}, |
|
|
}, |
|
|
//弹出购物车或者商品规格选择弹窗 |
|
|
//弹出购物车或者商品规格选择弹窗 |
|
|
toggle(type, item) { |
|
|
toggle(type, item) { |
|
|
this.type = type |
|
|
|
|
|
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 |
|
|
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 |
|
|
if (type == 'carPopup') { |
|
|
if (type == 'carPopup') { |
|
|
this.$refs.carPopup.open('bottom') |
|
|
this.$refs.carPopup.open('bottom') |
|
|
@ -294,28 +295,36 @@ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
//删除整条商品 |
|
|
//删除整条商品 |
|
|
delShop(id){ |
|
|
delShop(id) { |
|
|
var that = this; |
|
|
var that = this; |
|
|
for (let i=0;i<this.shopList.length;i++) { |
|
|
|
|
|
if(this.shopList[i].id == id){ |
|
|
|
|
|
uni.showModal({ |
|
|
uni.showModal({ |
|
|
title: "提示", |
|
|
title: "提示", |
|
|
content: "确定删除此条商品吗?", |
|
|
content: "确定删除此条商品吗?", |
|
|
success: function(res) { |
|
|
success: function(res) { |
|
|
that.carList.splice(that.carList.indexOf(id),1) |
|
|
if (res.confirm) { |
|
|
|
|
|
for (let i = 0; i < that.gwcList.length; i++) { |
|
|
|
|
|
console.log('匹配吗?',that.goodsList) |
|
|
|
|
|
if (that.gwcList[i].id == id) { |
|
|
|
|
|
that.carList.splice(that.carList.indexOf(id), 1) |
|
|
that.carType = that.carList.length |
|
|
that.carType = that.carList.length |
|
|
that.$set(that.shopList[i], 'checked', !that.shopList[i].checked) |
|
|
that.gwcList.splice(i, 1) |
|
|
|
|
|
for(let m= 0;m < that.goodsList.length;m++){ |
|
|
|
|
|
if(that.goodsList[m].id == id){ |
|
|
|
|
|
that.$set(that.goodsList[m], 'checked', !that.goodsList[m].checked) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
console.log(that.carList.length) |
|
|
|
|
|
console.log(that.carList) |
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
//关闭购物车弹窗 |
|
|
//关闭购物车弹窗 |
|
|
closeCar(){ |
|
|
closeCar() { |
|
|
this.$refs.carPopup.close() |
|
|
this.$refs.carPopup.close() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -542,6 +551,7 @@ |
|
|
border-bottom: 1px solid #eee; |
|
|
border-bottom: 1px solid #eee; |
|
|
margin-top: 20rpx; |
|
|
margin-top: 20rpx; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.popup-bottom { |
|
|
.popup-bottom { |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
height: 100rpx; |
|
|
height: 100rpx; |
|
|
@ -572,6 +582,7 @@ |
|
|
border-radius: 70rpx; |
|
|
border-radius: 70rpx; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.shop-mask { |
|
|
.shop-mask { |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
height: 190rpx; |
|
|
height: 190rpx; |
|
|
|