tianyi 3 weeks ago
parent
commit
49b4ed0f28
  1. 4
      package1/myCenter/addGoods.vue
  2. 132
      package1/myCenter/goodsList.vue

4
package1/myCenter/addGoods.vue

@ -46,9 +46,9 @@
<input class="content-input" v-model="item.specNum" style="padding-right: 10px;" @click="changecount(index)" placeholder="商品库存"/>
<button @click="deldantiaoguige(index)" v-if="formData.attributeListPrice.length>1" style="width: 120px;height: 30px;line-height: 30px;color: red;border:none;background: #fff;">删除</button>
</view>
<view @click="checkSpec('guige')" style="margin-top: 5px;width: 80px;height: 30px;text-align: center;line-height: 30px;background: rgba(0, 35, 28, 1);border-radius: 30px;color: rgba(166, 255, 234, 1);">
<!-- <view @click="checkSpec('guige')" style="margin-top: 5px;width: 80px;height: 30px;text-align: center;line-height: 30px;background: rgba(0, 35, 28, 1);border-radius: 30px;color: rgba(166, 255, 234, 1);">
选择规格
</view>
</view> -->
</view>
</uni-forms-item>
<uni-forms-item label="拼团信息" name="productGroupBuyPrices">

132
package1/myCenter/goodsList.vue

@ -50,24 +50,24 @@
</view>
</view>
</view>
<view class="show-box" v-if="item.isShow">
<view class="show-box" v-show="item.isShow">
<view class="show-text" @tap="goDetail('goods',item)" style="border-right: 1px solid #fff;">
<uni-icons type="compose" size="18"></uni-icons>
编辑
</view>
<view class="show-text" style="border-right: 1px solid #fff;">
<view class="show-text" @tap="isPush('shopList',index,item,item.isPush==1?0:1)" style="border-right: 1px solid #fff;">
<uni-icons type="hand-up" size="18"></uni-icons>
设为推荐
{{item.isPush == 0?'设为推荐':'取消推荐'}}
</view>
<view class="show-text" style="border-right: 1px solid #fff;">
<view class="show-text" @tap="isMust('shopList',index,item,item.isMust==1?0:1)" style="border-right: 1px solid #fff;">
<uni-icons type="star" size="18"></uni-icons>
设为必点
{{item.isMust == 0?'设为必点':'取消必点'}}
</view>
<view class="show-text" style="border-right: 1px solid #fff;">
<view class="show-text" @tap="upDown('shopList',index,item,item.delFlag==1?0:1)" style="border-right: 1px solid #fff;">
<uni-icons type="upload" size="18"></uni-icons>
上架
{{item.delFlag == 1?'下架':'上架'}}
</view>
<view class="show-text">
<view class="show-text" @tap="remove(item)">
<uni-icons type="trash" size="18"></uni-icons>
删除
</view>
@ -103,20 +103,24 @@
</view>
</view>
</view>
<view class="show-box" v-if="item.isShow">
<view class="show-box" v-show="item.isShow">
<view class="show-text" @tap="goDetail('goods',item)" style="border-right: 1px solid #fff;">
编辑
</view>
<view class="show-text" style="border-right: 1px solid #fff;">
设为推荐
<view class="show-text" @tap="isPush('shopList1',index,item,item.isPush==1?0:1)" style="border-right: 1px solid #fff;">
<uni-icons type="hand-up" size="18"></uni-icons>
{{item.isPush == 0?'设为推荐':'取消推荐'}}
</view>
<view class="show-text" style="border-right: 1px solid #fff;">
设为必点
<view class="show-text" @tap="isMust('shopList1',index,item,item.isMust==1?0:1)" style="border-right: 1px solid #fff;">
<uni-icons type="star" size="18"></uni-icons>
{{item.isMust == 0?'设为必点':'取消必点'}}
</view>
<view class="show-text" style="border-right: 1px solid #fff;">
上架
<view class="show-text" @tap="upDown('shopList1',index,item,item.delFlag==1?0:1)" style="border-right: 1px solid #fff;">
<uni-icons type="upload" size="18"></uni-icons>
{{item.delFlag == 1?'下架':'上架'}}
</view>
<view class="show-text" style="border-right: 1px solid #fff;">
<view class="show-text" @tap="remove(item)" style="border-right: 1px solid #fff;">
<uni-icons type="trash" size="18"></uni-icons>
删除
</view>
</view>
@ -190,9 +194,101 @@
console.log("1111",type)
if(type == 'shopList'){
this.shopList[index].isShow = !this.shopList[index].isShow
console.log(this.shopList[index])
}else{
this.shopList1[index].isShow = !this.shopList1[index].isShow
console.log(this.shopList1[index])
}
this.$forceUpdate()
},
isPush(type,index,item,value) {
this.tui.request("/app/product/isPush", "POST", {
id: item.id,
isPush:value
}, false, true).then((res) => {
if (res.code == 200) {
if(type == 'shopList'){
this.shopList[index].isPush = value
}else{
this.shopList1[index].isPush = value
}
this.tui.toast('设置成功')
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
remove(v) {
let that = this;
uni.showModal({
title: '提示',
content: '确定要删除该商品吗?',
success: function (res) {
if (res.confirm) {
that.tui.request("/app/product/delById", "POST", {
id: v.id
}, false, true).then((res) => {
if (res.code == 200) {
that.getShareList()
that.tui.toast('删除成功')
} else {
that.tui.toast(res.message)
}
}).catch((res) => {})
}
}
});
},
isMust(type,index,item,value) {
this.tui.request("/app/product/isMust", "POST", {
id: item.id,
isMust:value
}, false, true).then((res) => {
if (res.code == 200) {
if(type == 'shopList'){
this.shopList[index].isMust = value
}else{
this.shopList1[index].isMust = value
}
this.tui.toast('设置成功')
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
upDown(type,index,item,value) {
if(value == 0){
this.tui.request("/app/product/down", "POST", {
id: item.id
}, false, true).then((res) => {
if (res.code == 200) {
if(type == 'shopList'){
this.shopList[index].delFlag = value
}else{
this.shopList1[index].delFlag = value
}
this.tui.toast('设置成功')
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
}else{
this.tui.request("/app/product/up", "POST", {
id: item.id
}, false, true).then((res) => {
if (res.code == 200) {
if(type == 'shopList'){
this.shopList[index].delFlag = value
}else{
this.shopList1[index].delFlag = value
}
this.tui.toast('设置成功')
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
}
},
goDetail(type,item){
let url=""
@ -237,7 +333,7 @@
this.shopList1 = [...this.shopList1, ...res.result.records]
}
for(let i=0;i<this.shopList1.length;i++){
this.shopList1[i].isShow = true
this.shopList1[i].isShow = false
}
this.pages = res.result.pages
} else {
@ -249,7 +345,7 @@
this.shopList = [...this.shopList, ...res.result.records]
}
for(let i=0;i<this.shopList.length;i++){
this.shopList[i].isShow = true
this.shopList[i].isShow = false
}
this.pages = res.result.pages
}

Loading…
Cancel
Save