feat(custom): \!
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-09-05 16:41:26 +08:00
parent 962d7a2b19
commit 94b6a9da10
23 changed files with 311 additions and 721 deletions

View File

@@ -1,85 +1,56 @@
<template>
<view>
<view class="head-wrapper" :style="{top: BarHeight + 'px'}">
<view class="head-wrapper" :style="{ top: BarHeight + 'px' }">
<view class="head-menu">
<Left class="iconfont" @click="returns" />
<Home class="iconfont" @click="goHome" />
</view>
</view>
<!-- 幻灯片 -->
<nut-swiper
:init-page="0"
:pagination-visible="false"
pagination-color="red"
auto-play="3000">
<nut-swiper :init-page="0" :pagination-visible="false" pagination-color="red" auto-play="3000">
<nut-swiper-item v-for="(itm, idx) in swiperList" :key="idx">
<img
style="width: 100%; height: 100%"
:src="itm"
:alt="idx.toString()" />
<img style="width: 100%; height: 100%" :src="itm" :alt="idx.toString()" />
</nut-swiper-item>
</nut-swiper>
<!-- 商家信息 -->
<view class="infoBox">
<view class="title text-[#333333]">{{ mer_info.name }}</view>
<view class="flex items-center justify-between mt-3">
<nut-rate
spacing="1"
active-color="rgba(252, 207, 10, 1)"
v-model="mer_info.rate" />
<nut-rate spacing="1" active-color="rgba(252, 207, 10, 1)" v-model="mer_info.rate" />
<view class="text-[#9E9E9E] text-[25px]">销量10000</view>
<view class="text-[#9E9E9E] text-[25px]"
>营业时间{{ mer_info.week_start }}-{{ mer_info.week_end }}
<view class="text-[#9E9E9E] text-[25px]">营业时间{{ mer_info.week_start }}-{{ mer_info.week_end }}
</view>
</view>
<view class="line"></view>
<view class="bom">
<view
class="iconfont icon-dizhi text-[#C4C4C4]"
style="width: 15px; height: 15px; margin-right: 15px"></view>
<view class="iconfont icon-dizhi text-[#C4C4C4]" style="width: 15px; height: 15px; margin-right: 15px"></view>
<view class="left">
<view>{{ mer_info.address || '暂无商家地址' }}</view>
<view class="sub mt-1"
>距离您{{
calculateDistance(
userLocalNum.t,
userLocalNum.l,
Number(mer_info.lat),
Number(mer_info.lon),
)
}}
<view class="sub mt-1">距离您{{
calculateDistance(
userLocalNum.t,
userLocalNum.l,
Number(mer_info.lat),
Number(mer_info.lon),
)
}}
</view>
</view>
<view class="right">
<view @click="clickMap">
<image
class="w-[50px] h-[50px]"
src="http://p1.meituan.net/csc/92ee8512c90527169b44e07fd11d250d924.png" />
<image class="w-[50px] h-[50px]" src="http://p1.meituan.net/csc/92ee8512c90527169b44e07fd11d250d924.png" />
</view>
<view @click="clickPhone">
<image
class="w-[50px] h-[50px]"
src="http://p0.meituan.net/csc/ab0493b124a6bb858bf82a2340767c0d919.png" />
<image class="w-[50px] h-[50px]" src="http://p0.meituan.net/csc/ab0493b124a6bb858bf82a2340767c0d919.png" />
</view>
</view>
</view>
</view>
<!-- 商品列表 -->
<view class="good-class" v-if="class_list.length > 0">
<nut-tabs
v-model="value"
title-scroll
size="large"
direction="vertical"
title-gutter="5"
animated-time="0"
type=""
name="tabName">
<nut-tab-pane
v-for="(itm, index) in good_list"
:key="index"
:title="itm.name"
:pane-key="index">
<nut-tabs v-model="value" title-scroll size="large" direction="vertical" title-gutter="5" animated-time="0"
type="" name="tabName">
<nut-tab-pane v-for="(itm, index) in good_list" :key="index" :title="itm.name" :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)">
@@ -88,25 +59,18 @@
<view class="name">{{ item.name }}</view>
<view class="bom">
<view class="price">
<text style="font-size: 15px"
>{{ item.number }}
<text style="font-size: 15px" v-if="item.exchange"
>+{{ item.exchange }}积分
<text style="font-size: 15px">{{ item.discount_price }}
<text style="font-size: 15px" v-if="item.exchange">+{{ item.exchange }}积分
</text>
</text>
</view>
</view>
<view class="bom">
<view>
<view class="stock text-[25px]"
>剩余:{{ item.stock }}</view
>
<view class="stock text-[25px]">剩余:{{ item.stock }}</view>
</view>
<view class="flex items-center justify-between">
<view
v-if="item.cartNum > 0"
class="btn"
@click.stop="add_cart(item, 1)">
<view v-if="item.cartNum > 0" class="btn" @click.stop="add_cart(item, 1)">
<Minus />
</view>
<view v-if="item.cartNum > 0" style="margin: 0 10px">
@@ -134,10 +98,10 @@
<script setup lang="ts">
import Taro from '@tarojs/taro';
import {Left, Home, Plus, Minus} from '@nutui/icons-vue-taro';
import {Ref, ref} from 'vue';
import {calculateDistance} from '@/utils';
import {getGoodList, getMerCategory, getMerDetail} from '@/api/goods';
import { Left, Home, Plus, Minus } from '@nutui/icons-vue-taro';
import { Ref, ref } from 'vue';
import { calculateDistance } from '@/utils';
import { getGoodList, getMerCategory, getMerDetail } from '@/api/goods';
import Cart from '@/components/Cart.vue';
const statusBarHeight = Taro.getSystemInfoSync()?.statusBarHeight;
@@ -236,6 +200,7 @@ interface GoodsType {
cover: string;
name: string;
number: number;
discount_price: number;
stock: number;
cartNum: number;
exchange: number;