本地商品上下架之后只能修改价格

This commit is contained in:
wangxiaowei 2024-09-05 17:38:04 +08:00
parent d19edba258
commit 5f62d1aef5

@ -43,8 +43,11 @@
<view class="flex row-center">
<button class="primary-btn white flex row-center" @click="formSubmit" v-if="order_type == 4">提交</button>
<button class="primary-btn white flex row-center" @click="editPrice" v-if="order_type == 1 || order_type == 2">修改价格</button>
<button class="info-btn white flex row-center" @click="setState" v-if="order_type == 1 || order_type == 2">{{btnText}}</button>
</view>
<view class="text-center bold p-b-20 m-t-20">*上下架商品只能修改商品价格</view>
</view>
<u-popup v-model="showPopup" mode="top">
@ -61,7 +64,8 @@
import {
getLocalGoodsShopDetails,
saveLocalShopGoods,
setLocalShopState
setLocalShopState,
editLocalShopPrice
} from '@/api/store'
import {
trottle
@ -197,6 +201,43 @@
}
})
},
// 上下架的商品只能修改价格
async editPrice() {
let {
price,
} = this.formData;
if (!this.$u.test.amount(price)) {
this.$toast({
title: "商品价格格式错误"
});
return false;
}
uni.showLoading({
title: '上传中请稍后',
mask: true
})
const {data, code} = await editLocalShopPrice({
id: this.id,
price,
type: 'price'
})
if (code == 1) {
this.$toast({
title: '修改成功'
});
} else {
this.$toast({
title: '修改失败'
});
}
uni.hideLoading()
},
async formSubmit() {
const url = this.shop_pic.map((item) => {
if (item.lsg_id && item.url) {