更新订单列表详情,更新商品管理,更新代客下单
This commit is contained in:
141
pageProduct/index/components/edit-guige.vue
Normal file
141
pageProduct/index/components/edit-guige.vue
Normal file
@@ -0,0 +1,141 @@
|
||||
<template>
|
||||
<up-popup :show="popShow" @close="close" @open="open" mode="center" :round="9">
|
||||
<view class="u-p-32 box u-font-28">
|
||||
<view class="u-flex u-relative u-row-center">
|
||||
<view class="u-font-32">{{data.specSnap}}</view>
|
||||
<view class="u-absolute close">
|
||||
<up-icon @click="close" :size="16" color="#000" name="close-circle-fill"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-m-t-48">
|
||||
<view class="u-flex u-row-between border-bottom u-p-b-30">
|
||||
<view>当前状态</view>
|
||||
<view class="u-flex">
|
||||
<up-radio-group v-model="isGrounding" placement="row" @change="isGroundingChange">
|
||||
<up-radio :customStyle="{marginRight: '10px'}" v-for="(item, index) in status.list"
|
||||
:key="index" :label="item.label" :name="item.name">
|
||||
</up-radio>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
|
||||
</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>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</up-popup>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
reactive,
|
||||
ref,
|
||||
watch
|
||||
} from 'vue';
|
||||
import {
|
||||
returnSkuSnap,
|
||||
returnTypeEnum,
|
||||
returnCategory
|
||||
} from '@/pageProduct/util.js'
|
||||
import {
|
||||
$updateGrounding, $updateProductStatus
|
||||
} from '@/http/yskApi/goods.js'
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
const props = defineProps({
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
category: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
goods: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
skuList: []
|
||||
}
|
||||
}
|
||||
})
|
||||
const status = reactive({
|
||||
list: [{
|
||||
name: 1,
|
||||
label: '上架中'
|
||||
}, {
|
||||
name: 0,
|
||||
label: '已下架'
|
||||
}],
|
||||
})
|
||||
// 是否售罄
|
||||
const isPauseSale = ref(false)
|
||||
// 是否上架
|
||||
const isGrounding = ref(1)
|
||||
const data = ref(props.goods)
|
||||
const emits = defineEmits(['update:show', 'save', 'isGroundingChange','isPauseSaleChange'])
|
||||
const form = reactive({
|
||||
note: ''
|
||||
})
|
||||
let popShow = ref(props.show)
|
||||
watch(() => props.show, (newval) => {
|
||||
popShow.value = newval
|
||||
if (newval) {
|
||||
console.log(props.goods);
|
||||
data.value = props.goods
|
||||
isPauseSale.value = props.goods.isPauseSale ? true : false
|
||||
isGrounding.value = props.goods.isGrounding
|
||||
}
|
||||
})
|
||||
watch(() => popShow.value, (newval) => {
|
||||
emits('update:show', newval)
|
||||
})
|
||||
|
||||
function close() {
|
||||
popShow.value = false
|
||||
}
|
||||
|
||||
function open() {
|
||||
|
||||
}
|
||||
|
||||
function save() {
|
||||
emits('save')
|
||||
}
|
||||
async function isGroundingChange(e) {
|
||||
console.log(e);
|
||||
await $updateGrounding({
|
||||
isGrounding: e ? true : false,
|
||||
skuId: props.goods.id
|
||||
})
|
||||
emits('isGroundingChange', e)
|
||||
infoBox.showToast('更新成功')
|
||||
}
|
||||
async function isPauseSaleChange(e) {
|
||||
console.log(e);
|
||||
await $updateProductStatus({
|
||||
targetId: props.goods.id,
|
||||
updateKey: "pauseSaleSku",
|
||||
updateValue: e?1:0
|
||||
})
|
||||
emits('isPauseSaleChange', e)
|
||||
infoBox.showToast('更新成功')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.box {
|
||||
width: 556rpx;
|
||||
border-radius: 18rpx 18rpx 18rpx 18rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.close {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.number {
|
||||
color: #EE4646;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user