更新商品管理模块

This commit is contained in:
2024-09-28 15:07:09 +08:00
parent 3c7918211e
commit 587965020b
11 changed files with 642 additions and 532 deletions

View File

@@ -21,7 +21,7 @@
</view>
<view class=" u-flex u-row-between u-m-t-30">
<view>售罄</view>
<up-switch :size="20" @change="isPauseSaleChange" v-model="isPauseSale"></up-switch>
<up-switch :activeValue="1" :inactiveValue="0" :size="20" @change="isPauseSaleChange" v-model="isPauseSale"></up-switch>
</view>
</view>
</view>
@@ -40,7 +40,9 @@
returnCategory
} from '@/pageProduct/util.js'
import {
$updateGrounding, $updateProductStatus
$updateGrounding,
$updateProductStatus,$updateProductData,
$tbProskuConV2
} from '@/http/yskApi/goods.js'
import infoBox from '@/commons/utils/infoBox.js'
const props = defineProps({
@@ -73,7 +75,7 @@
// 是否上架
const isGrounding = ref(1)
const data = ref(props.goods)
const emits = defineEmits(['update:show', 'save', 'isGroundingChange','isPauseSaleChange'])
const emits = defineEmits(['update:show', 'save', 'isGroundingChange', 'isPauseSaleChange'])
const form = reactive({
note: ''
})
@@ -102,21 +104,30 @@
function save() {
emits('save')
}
function upDateGoods(par) {
return $updateProductData([{
id: data.value.id,
isSku: 1,
shopId: uni.getStorageSync('shopId'),
...par
}])
}
async function isGroundingChange(e) {
console.log(e);
await $updateGrounding({
isGrounding: e ? true : false,
skuId: props.goods.id
await upDateGoods({
key:'grounding',
value: e
})
emits('isGroundingChange', e)
infoBox.showToast('更新成功')
}
async function isPauseSaleChange(e) {
console.log(e);
await $updateProductStatus({
targetId: props.goods.id,
updateKey: "pauseSaleSku",
updateValue: e?1:0
await upDateGoods({
key:'pauseSale',
value: e
})
emits('isPauseSaleChange', e)
infoBox.showToast('更新成功')