diff --git a/src/pages/merchant/food.vue b/src/pages/merchant/food.vue index 74cc97c..a7a3ef9 100644 --- a/src/pages/merchant/food.vue +++ b/src/pages/merchant/food.vue @@ -3,15 +3,13 @@ import { ref, reactive, computed, watch } from "vue" import { onLoad, onShow } from "@dcloudio/uni-app" import { isEmpty } from "radash" import dayjs from "dayjs" - import { hooks, router } from "@@/index" import { foodApi } from "@@/api" - import zTabs from "@@/components/other/z-tabs/z-tabs.vue" import CustomWaterfallsFlow from "@@/components/other/custom-waterfalls-flow/custom-waterfalls-flow.vue" import { filePath } from "@@/utils/file" -const data = { +const menus = { tabs: [ // { id: null, name: "全部", disabled: false }, { id: 1, name: "早餐", disabled: false }, @@ -26,7 +24,7 @@ const state = reactive({ pa: { merchantId: null, startTime: null, - hourType: data.tabs[0].id, + hourType: menus.tabs[0].id, }, }) @@ -55,12 +53,19 @@ const foodList = computed(() => { }) }) +watch( + () => pageHook.list, + (newValue) => { + console.log("xxx", newValue) + }, +) + const initDate = () => { const list: any = [] const now = new Date() for (let i = 0; i < 10; i++) { const date = dayjs(now).add(i, "d") - const weekDayStr = date.isSame(now, "day") ? "今天" : data.weekDays[date.day()] + const weekDayStr = date.isSame(now, "day") ? "今天" : menus.weekDays[date.day()] list.push({ weekDayStr, date: date.toDate(), @@ -80,13 +85,13 @@ const doDateItem = (v: any, i: any) => { } const doTab = (e: any) => { - const target = data.tabs[e] + const target = menus.tabs[e] state.pa.hourType = target.id pageRef.value.reload(true) } const doProduct = (v: any) => { - router.jump("/pages/merchant/product-detail", { id: v.spuId }) + // router.jump("/pages/merchant/product-detail", { id: v.spuId }) } @@ -97,7 +102,7 @@ const doProduct = (v: any) => { height="100%" :fixed="false" v-model="pageHook.list" - :default-page-size="5" + :default-page-size="8" safe-area-inset-bottom :loading-more-enabled="true" :show-scrollbar="false" @@ -124,7 +129,7 @@ const doProduct = (v: any) => { - +