购物车
This commit is contained in:
1 parent
d5b4fcc18e
commit
e1902cbfae
7 files changed
+243
-212
No files matched your search
@@ -4,7 +4,6 @@ import { onLoad, onShow } from "@dcloudio/uni-app";
|
||||
|
||||
import { hooks, router } from "@@/index";
|
||||
import { merchantApi } from "@@/api";
|
||||
|
||||
import { filePath } from "@@/utils/file";
|
||||
|
||||
const state = reactive<any>({
|
||||
@@ -52,17 +51,8 @@ const toDetail = async (v: any) => {
|
||||
@scroll="pageHook.scroll"
|
||||
>
|
||||
<template #top> </template>
|
||||
<view
|
||||
class="flex-row card p-20rpx m-b-20rpx"
|
||||
v-for="(v, i) in pageHook.list"
|
||||
:key="i"
|
||||
@tap="toDetail(v)"
|
||||
>
|
||||
<image
|
||||
class="w-160rpx h-160rpx rounded-12rpx"
|
||||
:src="filePath(v.logoPic)"
|
||||
mode="aspectFill"
|
||||
/>
|
||||
<view class="flex-row card p-20rpx m-b-20rpx" v-for="(v, i) in pageHook.list" :key="i" @tap="toDetail(v)">
|
||||
<image class="w-160rpx h-160rpx rounded-12rpx" :src="filePath(v.logoPic)" mode="aspectFill" />
|
||||
<view class="flex-1 flex-col m-l-20rpx">
|
||||
<view class="flex-row items-center justify-between">
|
||||
<view class="flex-row-center sub-text-34">
|
||||
|
||||
+15
-12
@@ -4,11 +4,12 @@ import { onLoad, onShow } from "@dcloudio/uni-app";
|
||||
|
||||
import { hooks, router } from "@@/index";
|
||||
import { merchantApi } from "@@/api";
|
||||
import { filePath } from "@@/utils/file";
|
||||
|
||||
const state = reactive<any>({
|
||||
pa: {
|
||||
pagesize: 10,
|
||||
type: "canteen",
|
||||
type: "2",
|
||||
},
|
||||
});
|
||||
|
||||
@@ -20,10 +21,17 @@ onShow(() => {
|
||||
});
|
||||
|
||||
const pageRef = ref<any>(null);
|
||||
const pageHook = hooks.usePage(pageRef, merchantApi.page, null, "data.list");
|
||||
const pageHook = hooks.usePage(pageRef, merchantApi.page, null, "data.records");
|
||||
const query = (page: number, pagesize: number) => {
|
||||
pageHook.startPage(page, pagesize, false, state.pa);
|
||||
};
|
||||
|
||||
const toDetail = async (v: any) => {
|
||||
const isLogin = await hooks.useCheckLogin();
|
||||
if (isLogin) {
|
||||
router.jump("/pages/shop/detail", { id: v.id });
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -42,21 +50,16 @@ const query = (page: number, pagesize: number) => {
|
||||
:auto-scroll-to-top-when-reload="false"
|
||||
@scroll="pageHook.scroll"
|
||||
>
|
||||
<view
|
||||
class="flex-col card p-20rpx m-b-20rpx"
|
||||
v-for="(v, i) in pageHook.list"
|
||||
:key="i"
|
||||
@tap="router.jump('/pages/shop/detail', { id: v.id })"
|
||||
>
|
||||
<view class="flex-col card p-20rpx m-b-20rpx" v-for="(v, i) in pageHook.list" :key="i" @tap="toDetail(v)">
|
||||
<view class="flex-row-center">
|
||||
<image class="w-120rpx h-120rpx rounded-12rpx" :src="v.logo" mode="aspectFill" />
|
||||
<image class="w-120rpx h-120rpx rounded-12rpx" :src="filePath(v.logoPic)" mode="aspectFill" />
|
||||
<view class="flex-1 flex-col m-l-20rpx">
|
||||
<view class="flex-row items-center justify-between">
|
||||
<view class="flex-row-center sub-text-34">
|
||||
<text> {{ v.name }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<tm-tag size="s">{{ v.deptStr }}</tm-tag>
|
||||
<tm-tag size="s">{{ v.deptName }}</tm-tag>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex items-center">
|
||||
@@ -66,9 +69,9 @@ const query = (page: number, pagesize: number) => {
|
||||
<view class="m-t-10rpx second-text-28">
|
||||
<text>营业时间</text>
|
||||
<text class="m-l-10rpx">
|
||||
{{ hooks.useTime(v.applianceStartTime, "{h}:{i}") }}
|
||||
{{ v.jobStartTime }}
|
||||
~
|
||||
{{ hooks.useTime(v.applianceEndTime, "{h}:{i}") }}
|
||||
{{ v.jobEndTime }}
|
||||
</text>
|
||||
<text class="float-right">22km</text>
|
||||
</view>
|
||||
|
||||
Reference in new issue
Block a user