1
This commit is contained in:
1 parent
d8fd0cc320
commit
19649d305c
1 file changed
+14
-9
@@ -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<any>({
|
||||
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 })
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -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) => {
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="bg-white rounded-16rpx px-20rpx m-x-10rpx m-t-15rpx">
|
||||
<z-tabs :list="data.tabs" @change="doTab" />
|
||||
<z-tabs :list="menus.tabs" @change="doTab" />
|
||||
</view>
|
||||
</template>
|
||||
<view class="h-20rpx" />
|
||||
|
||||
Reference in new issue
Block a user