更新订单管理模块
This commit is contained in:
@@ -96,7 +96,8 @@
|
||||
}
|
||||
}
|
||||
goodsMapInit()
|
||||
watch(() => props.data.detailList, (newval) => {
|
||||
watch(() => props.data.detailList.length, (newval) => {
|
||||
goodsNumber.value=0
|
||||
goodsMapInit()
|
||||
})
|
||||
|
||||
@@ -111,8 +112,10 @@
|
||||
}
|
||||
|
||||
function sendTypeFilter(t) {
|
||||
console.log(t);
|
||||
if (t) {
|
||||
return orderEnum.sendType.find(item => item.key == t).label;
|
||||
const item=orderEnum.sendType.find(item => item.key == t)
|
||||
return item?item.label:'';
|
||||
} else {
|
||||
return t;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="list">
|
||||
<view v-for="(item,index) in list" :key="index">
|
||||
<order-item @printOrder="print" :data="item" :index="index"></order-item>
|
||||
<order-item @printOrder="print" :key="index" :data="item" :index="index"></order-item>
|
||||
</view>
|
||||
<view v-if="hasAjax&&!list.length">
|
||||
<my-img-empty tips="亲,你还没有订单哦~"></my-img-empty>
|
||||
|
||||
@@ -4,16 +4,18 @@
|
||||
<view class="search bg-fff u-p-t-32 u-p-l-28 u-p-r-28 u-p-b-32">
|
||||
<up-search v-bind="search" v-model="search.val"></up-search>
|
||||
</view>
|
||||
<filter-vue v-model:time="pageData.order.query.createdAt"></filter-vue>
|
||||
<filter-vue v-model:time="order.data.query.createdAt"></filter-vue>
|
||||
</view>
|
||||
<order-list @printOrder="onPrintOrder" :hasAjax="pageData.order.hasAjax" :list="pageData.order.list"></order-list>
|
||||
<my-pagination :totalElements="pageData.order.totalElements"></my-pagination>
|
||||
<order-list @printOrder="onPrintOrder" :hasAjax="order.data.hasAjax" :list="order.data.list"></order-list>
|
||||
<my-pagination @change="pageChange" :totalElements="order.data.total"></my-pagination>
|
||||
<view style="height: 100rpx;"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {onLoad,onShow,onPullDownRefresh} from '@dcloudio/uni-app'
|
||||
import * as Api from '@/http/yskApi/order.js'
|
||||
import LIST from '@/commons/class/list.js'
|
||||
import {$printOrder} from '@/http/yskApi/Instead.js'
|
||||
import filterVue from './compoents/filter.vue';
|
||||
import orderList from './compoents/order-list.vue';
|
||||
@@ -21,6 +23,7 @@
|
||||
import {
|
||||
reactive, watch
|
||||
} from 'vue';
|
||||
|
||||
const search = reactive({
|
||||
val: '',
|
||||
placeholder: '搜索单号/昵称/姓名/手机号码/商品名称',
|
||||
@@ -33,36 +36,47 @@
|
||||
}
|
||||
})
|
||||
|
||||
const pageData = reactive({
|
||||
order: {
|
||||
list: [],
|
||||
totalElements:0,
|
||||
hasAjax:false,
|
||||
query: {
|
||||
createdAt: [],
|
||||
id: "",
|
||||
orderNo: "",
|
||||
orderType: "0",
|
||||
page: 0,
|
||||
pageSize: 10,
|
||||
payType: "",
|
||||
productName: "",
|
||||
status: ""
|
||||
}
|
||||
const order=new LIST({
|
||||
list: [],
|
||||
query: {
|
||||
createdAt: [],
|
||||
id: "",
|
||||
orderNo: "",
|
||||
orderType: "0",
|
||||
page: 0,
|
||||
pageSize: 10,
|
||||
payType: "",
|
||||
productName: "",
|
||||
status: ""
|
||||
}
|
||||
})
|
||||
watch(()=>pageData.order.query.createdAt,(newval)=>{
|
||||
function pageChange(e){
|
||||
order.setVal('page',e)
|
||||
console.log(e);
|
||||
console.log(order.data.page);
|
||||
init()
|
||||
}
|
||||
|
||||
console.log(order.list);
|
||||
|
||||
watch(()=>order.data.query.createdAt,(newval)=>{
|
||||
init()
|
||||
})
|
||||
async function init() {
|
||||
const {content,totalElements}=await Api.tbOrderInfoData(pageData.order.query)
|
||||
pageData.order.hasAjax=true
|
||||
pageData.order.totalElements=totalElements
|
||||
pageData.order.list=content
|
||||
console.log(content);
|
||||
const {content,totalElements}=await Api.tbOrderInfoData({...order.data.query,page:order.data.page})
|
||||
uni.stopPullDownRefresh()
|
||||
order.setVal('list',content)
|
||||
console.log(order.data.list);
|
||||
order.setVal('total',totalElements)
|
||||
order.setVal('hasAjax',true)
|
||||
}
|
||||
init()
|
||||
onPullDownRefresh(()=>{
|
||||
pageData.order.query.page=0
|
||||
init()
|
||||
})
|
||||
|
||||
|
||||
onShow(init)
|
||||
async function printOrder(item){
|
||||
try{
|
||||
console.log(item);
|
||||
|
||||
Reference in New Issue
Block a user