增加商品规格权限验证
This commit is contained in:
parent
703da8e683
commit
8329d9cfad
|
|
@ -4,19 +4,16 @@
|
|||
"version" : "0.0",
|
||||
"configurations" : [
|
||||
{
|
||||
"app-plus" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"default" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"mp-weixin" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"type" : "uniCloud"
|
||||
"app-plus" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"default" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"mp-weixin" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"type" : "uniCloud"
|
||||
},
|
||||
{
|
||||
"playground" : "custom",
|
||||
|
|
|
|||
|
|
@ -10,18 +10,20 @@
|
|||
<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">
|
||||
<view class="u-flex u-relative">
|
||||
<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 class="u-absolute position-all" @click="hasShangXiajia(true)" v-if="!canShangXiaJia"></view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class=" u-flex u-row-between u-m-t-30">
|
||||
<view class=" u-flex u-row-between u-m-t-30 u-relative">
|
||||
<view>售罄</view>
|
||||
<up-switch :activeValue="1" :inactiveValue="0" :size="20" @change="isPauseSaleChange" v-model="isPauseSale"></up-switch>
|
||||
<view class="u-absolute position-all" @click="hasShouQing(true)" v-if="!canShouQing"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -44,6 +46,7 @@
|
|||
$updateProductStatus,$updateProductData,
|
||||
$tbProskuConV2
|
||||
} from '@/http/yskApi/goods.js'
|
||||
import {hasPermission} from '@/commons/utils/hasPermission.js'
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
const props = defineProps({
|
||||
show: {
|
||||
|
|
@ -98,7 +101,8 @@
|
|||
}
|
||||
|
||||
function open() {
|
||||
|
||||
hasShangXiajia()
|
||||
hasShouQing()
|
||||
}
|
||||
|
||||
function save() {
|
||||
|
|
@ -113,8 +117,20 @@
|
|||
...par
|
||||
}])
|
||||
}
|
||||
|
||||
|
||||
let canShangXiaJia=ref(false)
|
||||
async function hasShangXiajia(tips=false){
|
||||
canShangXiaJia.value=await hasPermission({text:'允许上下架商品',tips})
|
||||
}
|
||||
let canShouQing=ref(false)
|
||||
async function hasShouQing(tips=false){
|
||||
canShouQing.value=await hasPermission({text:'允许售罄商品',tips})
|
||||
}
|
||||
|
||||
async function isGroundingChange(e) {
|
||||
if(!canShangXiaJia.value){
|
||||
return
|
||||
}
|
||||
await upDateGoods({
|
||||
key:'grounding',
|
||||
value: e
|
||||
|
|
@ -124,6 +140,9 @@
|
|||
}
|
||||
|
||||
async function isPauseSaleChange(e) {
|
||||
if(!canShouQing.value){
|
||||
return
|
||||
}
|
||||
console.log(e);
|
||||
await upDateGoods({
|
||||
key:'pauseSale',
|
||||
|
|
|
|||
Loading…
Reference in New Issue