feat(custom): 新增消息订阅
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-08-27 17:06:59 +08:00
parent f199320de0
commit 1d8532eccf
104 changed files with 2350 additions and 2477 deletions

View File

@@ -9,14 +9,12 @@
direction="vertical"
title-gutter="5"
animated-time="0"
name="tabName"
>
name="tabName">
<nut-tab-pane
v-for="(itm, index) in good_list"
:key="index"
:title="itm.name"
:pane-key="index"
>
:pane-key="index">
<view v-if="itm.Goods.length > 0">
<view class="list" v-for="(item, index) in itm.Goods" :key="index">
<view class="item" @click.stop="toGoodDetails(item.gid, 1)">
@@ -38,8 +36,7 @@
<nut-button
size="mini"
type="primary"
@click.stop="add_cart(item)"
>
@click.stop="add_cart(item)">
<template #icon>
<Cart2 />
</template>
@@ -56,16 +53,20 @@
</view>
<nut-empty v-else description="该商家暂无商品"></nut-empty>
<!-- 购物车 -->
<cart ref="cartRef" :mer-info="mer_info" @update-cart="updateCartNum" :IsPendingOrder="true" />
<cart
ref="cartRef"
:mer-info="mer_info"
@update-cart="updateCartNum"
:IsPendingOrder="true" />
</view>
</template>
<script setup lang="ts">
import { Ref, ref } from "vue";
import Taro from "@tarojs/taro";
import Cart from "../../../../components/Cart.vue";
import { Cart2 } from "@nutui/icons-vue-taro";
import { getGoodList, getMerCategory } from "../../../../api/goods";
import {Ref, ref} from 'vue';
import Taro from '@tarojs/taro';
import Cart from '../../../../components/Cart.vue';
import {Cart2} from '@nutui/icons-vue-taro';
import {getGoodList, getMerCategory} from '../../../../api/goods';
interface goodList {
ID: number;
@@ -94,7 +95,7 @@ interface CartItems {
exchange: number;
}
const value = ref("0");
const value = ref('0');
const good_list = ref<goodList[]>([]);
const class_list = ref<
Array<{
@@ -103,8 +104,8 @@ const class_list = ref<
}>
>([]);
Taro.useLoad(async (e) => {
mer_info.value = e
Taro.useLoad(async e => {
mer_info.value = e;
await get_class_list(e.bid);
await cartRef.value.get_cart_list();
});
@@ -119,7 +120,7 @@ const get_class_list = async (bid: string) => {
const get_good_list = async (id: number, bid: string) => {
Taro.showLoading({
title: "加载中",
title: '加载中',
mask: true,
});
const res = await getGoodList({
@@ -161,7 +162,7 @@ const updateCartNum = (cartItems: CartItems[]) => {
} else {
good_list.value.forEach((category: goodList) => {
category.Goods.forEach((good: GoodsType) => {
Reflect.deleteProperty(good, "cartNum");
Reflect.deleteProperty(good, 'cartNum');
});
});
}
@@ -169,5 +170,5 @@ const updateCartNum = (cartItems: CartItems[]) => {
</script>
<style lang="scss">
@import "./index.scss";
@import './index.scss';
</style>