订单接口调取
This commit is contained in:
parent
44715933d0
commit
bdba2223a5
|
|
@ -1,12 +1,12 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* @data 获取
|
||||
* @data 获取订单列表
|
||||
*/
|
||||
export function getWeekCookbookAPI(data) {
|
||||
export function getOrderInfoListAPI(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/week/recipe/detail',
|
||||
method: 'post',
|
||||
data
|
||||
url: '/smart-canteen/order_info/list',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,13 +19,13 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div style="padding: 0 16px;">
|
||||
<div style="padding: 0 16px">
|
||||
<Tabs :tabList="tabList" @changeTab="changeTab" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="height: 56px;"></div>
|
||||
<div style="padding: 0 16px;">
|
||||
<div style="height: 56px"></div>
|
||||
<div style="padding: 0 16px">
|
||||
<div class="order-list" v-for="(item, index) in tableList" :key="index">
|
||||
<div class="flex justify-between">
|
||||
<div class="order-source">订单来源:{{ item.sourceType }}</div>
|
||||
|
|
@ -69,14 +69,8 @@
|
|||
<u-empty icon="../../static/images/not_order.png" text="暂无相关订单" textColor="#000" />
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 筛选部分-->
|
||||
<u-popup
|
||||
:show="localShow"
|
||||
@close="closePopup"
|
||||
mode="bottom"
|
||||
round="20"
|
||||
>
|
||||
<u-popup :show="localShow" @close="closePopup" mode="bottom" round="20">
|
||||
<view class="filter-popup">
|
||||
<!-- 订单日期 -->
|
||||
<view class="section">
|
||||
|
|
@ -109,19 +103,9 @@
|
|||
<!-- 订单类型 -->
|
||||
<view class="section">
|
||||
<view class="section-title">订单类型</view>
|
||||
<u-grid
|
||||
:border="false"
|
||||
col="3"
|
||||
>
|
||||
<u-grid-item
|
||||
v-for="(item, index) in orderTypes"
|
||||
:key="index"
|
||||
@click="selectOrderType(index)"
|
||||
>
|
||||
<view
|
||||
class="order-type-item"
|
||||
:class="{ active: selectedOrderTypes.includes(index) }"
|
||||
>
|
||||
<u-grid :border="false" col="3">
|
||||
<u-grid-item v-for="(item, index) in orderTypes" :key="index" @click="selectOrderType(index)">
|
||||
<view class="order-type-item" :class="{ active: selectedOrderTypes.includes(index) }">
|
||||
{{ item }}
|
||||
</view>
|
||||
</u-grid-item>
|
||||
|
|
@ -175,6 +159,7 @@
|
|||
import { getOrderList } from '@/api/dining-hall'
|
||||
import Tabs from '@/pages/components/Tabs.vue'
|
||||
import { getDate } from '../../uni_modules/uni-datetime-picker/components/uni-datetime-picker/util'
|
||||
import { getOrderInfoListAPI } from '../../api/order/index'
|
||||
|
||||
export default {
|
||||
components: { Tabs },
|
||||
|
|
@ -241,7 +226,7 @@ export default {
|
|||
],
|
||||
localShow: this.show,
|
||||
monthNum: 12,
|
||||
minData:getDate(new Date()),
|
||||
minData: getDate(new Date()),
|
||||
dateOptions: [
|
||||
{ label: '近1个月', value: 1 },
|
||||
{ label: '近3个月', value: 3 },
|
||||
|
|
@ -252,23 +237,13 @@ export default {
|
|||
endDate: '',
|
||||
showStartCalendar: false,
|
||||
showEndCalendar: false,
|
||||
orderTypes: [
|
||||
'当餐点餐',
|
||||
'预订餐',
|
||||
'报餐',
|
||||
'自助餐',
|
||||
'商城',
|
||||
'设备',
|
||||
'收款码',
|
||||
'美团-到店',
|
||||
'美团-外卖'
|
||||
],
|
||||
orderTypes: ['当餐点餐', '预订餐', '报餐', '自助餐', '商城', '设备', '收款码', '美团-到店', '美团-外卖'],
|
||||
selectedOrderTypes: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
show(newVal) {
|
||||
this.localShow = newVal; // 监听 prop 变化并更新本地数据属性
|
||||
this.localShow = newVal // 监听 prop 变化并更新本地数据属性
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -335,11 +310,11 @@ export default {
|
|||
},
|
||||
|
||||
openPopup() {
|
||||
this.localShow = true;
|
||||
this.localShow = true
|
||||
},
|
||||
|
||||
closePopup() {
|
||||
this.localShow = false;
|
||||
this.localShow = false
|
||||
},
|
||||
selectDateOption(index) {
|
||||
this.currentDateOption = index
|
||||
|
|
@ -404,7 +379,16 @@ export default {
|
|||
uni.navigateTo({
|
||||
url: `/pages/work/details?params=${JSON.stringify(item)}`
|
||||
})
|
||||
},
|
||||
|
||||
// 获取订单
|
||||
async getOrderInfoListData() {
|
||||
const res = await getOrderInfoListAPI()
|
||||
console.log(res, '获取订单信息')
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getOrderInfoListData()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue