增加临时菜页面
This commit is contained in:
parent
f99fcad9bf
commit
704fee1e2d
|
|
@ -43,17 +43,12 @@
|
|||
<uni-easyinput :paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
|
||||
:inputBorder="inputBorder" v-model="FormData.name" placeholder="请输入商品名称" />
|
||||
</uni-forms-item>
|
||||
<view class="">
|
||||
<uni-forms-item label="商品描述">
|
||||
<uni-easyinput :paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
|
||||
type="textarea" v-model="FormData.shortTitle" placeholder="请填写商品简述" />
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
|
||||
<template v-if="FormData.typeEnum!='group'">
|
||||
<view class="u-relative">
|
||||
<uni-forms-item label="所属分类" required showRequired name="categoryId">
|
||||
<uni-forms-item label="商品分类" required showRequired name="categoryId">
|
||||
<uni-data-picker :clear-icon="false" :map="{text:'name',value:'id'}"
|
||||
placeholder="请选择分类" popup-title="请选择分类" :localdata="pageData.category"
|
||||
placeholder="请选择商品分类" popup-title="请选择商品分类" :localdata="pageData.category"
|
||||
v-model="FormData.categoryId">
|
||||
</uni-data-picker>
|
||||
</uni-forms-item>
|
||||
|
|
@ -64,11 +59,8 @@
|
|||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
<view class="border-top-0">
|
||||
<uni-forms-item label="单位" required showRequired name="categoryId">
|
||||
<uni-forms-item label="单位" required showRequired name="units">
|
||||
|
||||
<uni-data-picker :clear-icon="false" @change="unitIdChange"
|
||||
:map="{text:'name',value:'id'}" placeholder="请选择单位" popup-title="请选择单位"
|
||||
|
|
@ -77,6 +69,14 @@
|
|||
</uni-forms-item>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="">
|
||||
<uni-forms-item label="商品描述">
|
||||
<uni-easyinput :paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
|
||||
type="textarea" v-model="FormData.shortTitle" placeholder="请填写商品简述" />
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
|
||||
<template v-if="FormData.typeEnum==='group'">
|
||||
<view class="border-top-0">
|
||||
<uni-forms-item label="团购券分类" required showRequired name="categoryId">
|
||||
|
|
|
|||
|
|
@ -30,7 +30,8 @@
|
|||
<view class="u-p-l-30 u-p-r-30">
|
||||
<view class="u-flex u-row-between no-wrap">
|
||||
<view>
|
||||
<my-radio @change="radioAllChange" v-model="goods.allChecked" shape="square" :size="20"></my-radio>
|
||||
<my-radio @change="radioAllChange" v-model="goods.allChecked" shape="square"
|
||||
:size="20"></my-radio>
|
||||
</view>
|
||||
<view>商品信息</view>
|
||||
<view>规格</view>
|
||||
|
|
@ -62,7 +63,8 @@
|
|||
</view>
|
||||
</scroll-view>
|
||||
<view class="u-p-30">
|
||||
<my-pagination :totalElements="goods.totalElements" :size="goods.query.size" @change="pageChange"></my-pagination>
|
||||
<my-pagination :totalElements="goods.totalElements" :size="goods.query.size"
|
||||
@change="pageChange"></my-pagination>
|
||||
<view class="u-m-t-20 u-flex">
|
||||
<view class="u-flex-1 u-p-r-16">
|
||||
<my-button type="cancel" plain @tap="close">取消</my-button>
|
||||
|
|
@ -81,7 +83,7 @@
|
|||
import myRadio from '@/components/my-components/my-radio';
|
||||
import myPagination from '@/components/my-components/my-pagination'
|
||||
import {
|
||||
$tbProduct
|
||||
$tbProductV2
|
||||
} from '@/http/yskApi/goods.js';
|
||||
import {
|
||||
reactive,
|
||||
|
|
@ -140,8 +142,12 @@
|
|||
const emits = defineEmits(['update:modelValue', 'confirm'])
|
||||
|
||||
const $quey = {
|
||||
categoryId: '',
|
||||
name: '',
|
||||
categoryId: "",
|
||||
createdAt: [],
|
||||
id: "",
|
||||
name: "",
|
||||
sort: "createdAt,desc",
|
||||
type: "",
|
||||
page: 0,
|
||||
size: 10,
|
||||
}
|
||||
|
|
@ -156,10 +162,14 @@
|
|||
...$quey
|
||||
}
|
||||
})
|
||||
|
||||
function getGoods() {
|
||||
$tbProduct(goods.query).then(res=>{
|
||||
$tbProductV2(goods.query).then(res => {
|
||||
goods.list = res.content.map(v => {
|
||||
return {...v,checked:false}
|
||||
return {
|
||||
...v,
|
||||
checked: false
|
||||
}
|
||||
})
|
||||
goods.allChecked = false
|
||||
goods.totalElements = res.totalElements
|
||||
|
|
@ -171,17 +181,25 @@
|
|||
goods.query.page = page - 1
|
||||
getGoods()
|
||||
}
|
||||
|
||||
function radioChange(newval) {
|
||||
goods.allChecked = goods.list.filter(v => v.checked).length != 0
|
||||
}
|
||||
|
||||
function radioAllChange(newval) {
|
||||
goods.list.forEach(i=>{i.checked=newval})
|
||||
goods.list.forEach(i => {
|
||||
i.checked = newval
|
||||
})
|
||||
}
|
||||
|
||||
function confrim() {
|
||||
const arr = goods.list.filter(v => v.checked)
|
||||
emits('confirm', arr)
|
||||
}
|
||||
defineExpose({open,close})
|
||||
defineExpose({
|
||||
open,
|
||||
close
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
@ -189,6 +207,7 @@
|
|||
background: rgba(51, 51, 51, 0.5);
|
||||
z-index: 900;
|
||||
}
|
||||
|
||||
.coverImg {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
|
|
|
|||
Loading…
Reference in New Issue