增加临时菜页面
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
</uni-data-picker>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="u-m-t-32 u-flex u-row-right">
|
||||
<view class="u-flex-1 u-p-r-16">
|
||||
<my-button type="cancel" plain @tap="resetQuery">重置</my-button>
|
||||
@@ -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>
|
||||
@@ -53,16 +54,17 @@
|
||||
¥{{ item.lowPrice }}
|
||||
</view>
|
||||
<view>
|
||||
{{ item.realSalesNumber }}/{{ item.stockNumber }}
|
||||
{{ item.realSalesNumber }}/{{ item.stockNumber }}
|
||||
</view>
|
||||
<view>
|
||||
{{item.categoryName}}
|
||||
{{item.categoryName}}
|
||||
</view>
|
||||
</view>
|
||||
</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,
|
||||
@@ -114,20 +116,20 @@
|
||||
|
||||
function open(arr) {
|
||||
show.value = true
|
||||
if(arr){
|
||||
for(let i in goods.list){
|
||||
if (arr) {
|
||||
for (let i in goods.list) {
|
||||
console.log(arr.includes(goods.list[i].id));
|
||||
goods.list[i].checked=arr.includes(goods.list[i].id)
|
||||
goods.list[i].checked = arr.includes(goods.list[i].id)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function close() {
|
||||
show.value = false
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function resetQuery() {
|
||||
Object.assign(goods.query, $quey)
|
||||
@@ -137,51 +139,67 @@
|
||||
return `height:${typeof props.height==='string'?props.height:props.height+'rpx'};`
|
||||
}
|
||||
|
||||
const emits = defineEmits(['update:modelValue','confirm'])
|
||||
|
||||
const emits = defineEmits(['update:modelValue', 'confirm'])
|
||||
|
||||
const $quey = {
|
||||
categoryId: '',
|
||||
name: '',
|
||||
categoryId: "",
|
||||
createdAt: [],
|
||||
id: "",
|
||||
name: "",
|
||||
sort: "createdAt,desc",
|
||||
type: "",
|
||||
page: 0,
|
||||
size: 10,
|
||||
}
|
||||
const query = reactive({
|
||||
...$quey
|
||||
})
|
||||
const goods=reactive({
|
||||
list:[],
|
||||
allChecked:false,
|
||||
totalElements:0,
|
||||
query:{
|
||||
const goods = reactive({
|
||||
list: [],
|
||||
allChecked: false,
|
||||
totalElements: 0,
|
||||
query: {
|
||||
...$quey
|
||||
}
|
||||
})
|
||||
|
||||
function getGoods() {
|
||||
$tbProduct(goods.query).then(res=>{
|
||||
goods.list=res.content.map(v=>{
|
||||
return {...v,checked:false}
|
||||
$tbProductV2(goods.query).then(res => {
|
||||
goods.list = res.content.map(v => {
|
||||
return {
|
||||
...v,
|
||||
checked: false
|
||||
}
|
||||
})
|
||||
goods.allChecked=false
|
||||
goods.totalElements=res.totalElements
|
||||
goods.allChecked = false
|
||||
goods.totalElements = res.totalElements
|
||||
})
|
||||
}
|
||||
getGoods()
|
||||
|
||||
function pageChange(page){
|
||||
goods.query.page=page-1
|
||||
|
||||
function pageChange(page) {
|
||||
goods.query.page = page - 1
|
||||
getGoods()
|
||||
}
|
||||
function radioChange(newval){
|
||||
goods.allChecked=goods.list.filter(v=>v.checked).length!=0
|
||||
|
||||
function radioChange(newval) {
|
||||
goods.allChecked = goods.list.filter(v => v.checked).length != 0
|
||||
}
|
||||
function radioAllChange(newval){
|
||||
goods.list.forEach(i=>{i.checked=newval})
|
||||
|
||||
function radioAllChange(newval) {
|
||||
goods.list.forEach(i => {
|
||||
i.checked = newval
|
||||
})
|
||||
}
|
||||
function confrim(){
|
||||
const arr= goods.list.filter(v=>v.checked)
|
||||
emits('confirm',arr)
|
||||
|
||||
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,7 +207,8 @@
|
||||
background: rgba(51, 51, 51, 0.5);
|
||||
z-index: 900;
|
||||
}
|
||||
.coverImg{
|
||||
|
||||
.coverImg {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 10rpx;
|
||||
|
||||
Reference in New Issue
Block a user