Merge branch 'dev' into test
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-05-17 15:34:24 +08:00
6 changed files with 86 additions and 9 deletions

1
components.d.ts vendored
View File

@@ -50,6 +50,7 @@ declare module '@vue/runtime-core' {
Pay: typeof import('./src/components/Pay.vue')['default']
Popup: typeof import('./src/components/Popup.vue')['default']
RichEditor: typeof import('./src/components/RichEditor.vue')['default']
StoreList: typeof import('./src/components/StoreList.vue')['default']
Ucharts: typeof import('./src/components/Ucharts.vue')['default']
Upload: typeof import('./src/components/Upload.vue')['default']
UserModal: typeof import('./src/components/UserModal.vue')['default']

View File

@@ -0,0 +1,60 @@
<template>
<view>
<view class="flex justify-center">
<view
class="bg-white rounded-[15px] mt-3 p-2 w-[95%] flex items-center"
v-for="(item, index) in storeList"
:key="index"
@click="goDetail(item)">
<image
class="w-[200px] h-[200px] rounded-[15px] mr-2"
:src="item.head_photo" />
<view class="flex-1">
<view class="text-[#333333] text-[30px] font-bold">{{
item.name
}}</view>
<nut-rate
spacing="1"
active-color="rgba(252, 207, 10, 1)"
v-model="item.rate" />
<view class="text-[#9E9E9E] text-[25px]">销量10000</view>
<view class="text-[#9E9E9E] text-[25px]"
>营业时间{{ item.week_start }}-{{ item.week_end }}</view
>
<view class="text-[#999999] text-[23px]">{{ item.address }}</view>
</view>
</view>
</view>
</view>
</template>
<script setup lang="ts">
import {getStoreList} from '@/api/home';
import Taro from '@tarojs/taro';
import {ref} from 'vue';
const name = defineModel({
default: '',
});
const storeList = ref<any>([]);
Taro.useLoad(() => {
getList();
});
const getList = async () => {
const res = await getStoreList({
name: name.value,
});
storeList.value = res.data.data;
};
const goDetail = item => {
Taro.setStorageSync('mer_info', item);
Taro.navigateTo({
url: `/pages/mer/mer_detail/index`,
});
};
</script>
<style lang="scss"></style>

View File

@@ -43,7 +43,7 @@
<script setup lang="ts">
import Taro from '@tarojs/taro';
import {ref} from 'vue';
import {getHomeList} from '@/api/home';
import {getHomeList, getStoreList} from '@/api/home';
import MerList from '@/components/MerList.vue';
import {showTips} from '@/utils';
@@ -74,10 +74,13 @@ const clickSearch = () => {
title: '请输入商家名称再搜索',
icon: 'none',
});
Taro.navigateTo({
url: `/pages/search/index?name=${searchVal.value}`,
});
searchVal.value = '';
};
Taro.useLoad(() => {
Taro.useLoad(async () => {
getNavLists();
getUserLocal();
});

View File

@@ -130,7 +130,7 @@
<script setup lang="ts">
import Taro from '@tarojs/taro';
import {Cart2, Left, Home, Uploader, Plus, Minus} from '@nutui/icons-vue-taro';
import {Left, Home, Plus, Minus} from '@nutui/icons-vue-taro';
import {Ref, ref} from 'vue';
import {calculateDistance} from '@/utils';
import {getGoodList, getMerCategory} from '@/api/goods';

View File

@@ -2,20 +2,33 @@
import {ref, onMounted} from 'vue';
import Taro from '@tarojs/taro';
import MerList from '@/components/MerList.vue';
import Storelist from '@/components/StoreList.vue';
const classId = ref();
const name = ref('');
onMounted(() => {
const e = Taro.getCurrentInstance().router?.params as any;
Taro.setNavigationBarTitle({
title: e.name,
});
classId.value = Number(e.id);
if (e.id) {
Taro.setNavigationBarTitle({
title: e.name,
});
classId.value = Number(e.id);
} else {
Taro.setNavigationBarTitle({
title: '搜索列表',
});
name.value = e.name;
}
});
</script>
<template>
<MerList v-model="classId" />
<view>
<MerList v-if="classId" v-model="classId" />
<Storelist v-else v-model="name" />
</view>
</template>
<style lang="scss"></style>

View File

@@ -338,9 +338,9 @@ const closePay = () => {
const t_id = ref();
const openCode = () => {
if (goodInfo.value.status === 2) return;
url.value = `https://api.pwmqr.com/qrcode/create?url=${goodInfo.value.oid}`;
isShowCode.value = true;
if (goodInfo.value.status === 2) return;
t_id.value = setInterval(() => {
getOrderDetail();
}, 1000);