yindongqi b09939848c feat: 新增发票申请功能并优化多个页面
- 新增发票申请页面,支持企业和个人发票类型
- 优化订单页面,增加取消订单功能
- 修改分享标题为"爱愈膳汤铺"
- 调整首页布局和样式,新增弹窗功能
- 修复购物车数据存储问题
- 优化优惠券领取逻辑,过滤已领取优惠券
- 调整支付页面打包费选项和配送费显示
- 新增小程序更新检查功能
- 优化店铺选择逻辑,切换店铺时清空购物车
- 调整图片资源和样式细节
2025-05-26 19:44:04 +08:00

227 lines
6.0 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<layout>
<uv-sticky bg-color="#F5F5F5" offset-top="0" customNavHeight="0">
<!-- <uv-navbar
:fixed="false"
:safeAreaInsetTop="true"
height="0"
bgColor="transparent"
leftIcon=""
/> -->
<!-- #ifndef MP -->
<blank size="0"></blank>
<!-- #endif -->
<blank size="0"></blank>
</uv-sticky>
<blank size="0"></blank>
<view class="page flex-col">
<view class="group_6 flex-row">
<view class="group_7 flex-col">
<view class="group_8 flex-row justify-between">
<view class="group_9 flex-col" @tap="takein">
<image class="image_1" referrerpolicy="no-referrer"
src="/static/images/index/store_pickup.png" mode="widthFix" />
<view class="text-group_13 flex-col justify-between">
<text class="text_1">到店自取</text>
<text class="text_2">下单免排队</text>
</view>
</view>
<view class="image-text_7 flex-col" @tap="takeout">
<image class="image_2" referrerpolicy="no-referrer"
src="/static/images/index/delivery.png" />
<view class="text-group_14 flex-col justify-between">
<text class="text_3">外卖外送</text>
<text class="text_4">美食送到家</text>
</view>
</view>
</view>
<!-- <view class="text-wrapper_3 flex-row justify-between">
<text class="text_2">下单免排队</text>
<text class="text_4">美食送到家</text>
</view> -->
<view class="block_5 flex-row" @tap="coupons">
<view class="image-text_8 flex-row justify-between">
<image class="label_3" referrerpolicy="no-referrer"
src="/static/images/index/coupons.png" />
<text class="text-group_9">我的卡券</text>
</view>
<view class="image-text_9 flex-row justify-between">
<text class="text-group_10">去领取</text>
<view class="iconfont iconarrow-right line-height-100 green flex-fill"></view>
<!-- <view class="section_2 flex-col"></view> -->
</view>
</view>
</view>
</view>
<view class="group_2 flex-col">
<view class="box_3 flex-col">
<view class="block_6 flex-row"></view>
<view class="image-wrapper_7 flex-row"></view>
</view>
<view class="box_6 flex-row">
<view class="image-wrapper_3 flex-col">
<image class="image_10" referrerpolicy="no-referrer"
:src="isLogin && member.avatar ? member.avatar : '/static/images/index/user.png'" />
</view>
<view class="text-group_15 flex-col justify-between">
<text class="text_6">Hi,{{ isLogin ? member.nickname : '新朋友' }}</text>
<text class="text_7">爱愈膳汤铺随时欢迎您回家</text>
</view>
<!-- <view class="text-group_16 flex-col justify-between">
<text class="text_8">积分</text>
<text class="text_9">1000</text>
</view> -->
</view>
</view>
</view>
<!-- 新增弹窗遮罩层 -->
<view class="popup-mask" v-if="showPopup" @tap="closePopup">
<view class="popup-content" @tap.stop>
<image class="close-icon" src="https://file.aiyushantp.com/file/c6e67d802e15b81e979106492db02723b26c1e9c3112c4f21ce3d22f6cba0668.png" mode="widthFix" @tap="closePopup" />
<image class="popup-image" src="https://file.aiyushantp.com/file/cb5c3b28270cf94771b21e517deb1e50aea6789d1c31310b99a289d94d5368c6.png" mode="widthFix" />
</view>
</view>
</layout>
</template>
<script setup>
import {
ref
} from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import {
menuAds
} from '@/api/market'
import { storeToRefs } from 'pinia'
import { useMainStore } from '@/store/store'
//
const main = useMainStore()
const { member, store, isLogin } = storeToRefs(main)
//const store = ref(main.store)
const listAds = ref([])
// const isLogin = ref(main.isLogin)
const handGetListAds = async () => {
let shop_id = store.id ? store.id : 0;
let data = await menuAds({
shop_id: shop_id
});
if (data) {
listAds.value = data.list;
console.log('listAds:', listAds.value)
uni.setStorage({
key: 'isActive',
data: data.isActive
});
if (data.list.length > 0) {
uni.setStorage({
key: 'shopAd',
data: data.list[0].image
});
}
}
}
const takein = () => {
main.SET_ORDER_TYPE('takein')
uni.switchTab({
url: '/pages/menu/menu'
})
}
const takeout = () => {
main.SET_ORDER_TYPE('takeout')
uni.switchTab({
url: '/pages/menu/menu'
})
}
const coupons = () => {
console.log("--> % orderType:\n", main.orderType)
console.log("--> % isLogin:\n", main.isLogin)
if (!main.isLogin) {
uni.navigateTo({ url: '/pages/components/pages/login/login' })
return
}
uni.navigateTo({
url: '/pages/components/pages/coupons/coupons'
})
}
const goScore = () => {
uni.navigateTo({
url: '/pages/components/pages/scoreproduct/list'
})
}
const showPopup = ref(false)
const closePopup = () => {
showPopup.value = false
}
onLoad(() => {
handGetListAds()
})
const onShareAppMessage = (res) => {
return {
title: '爱愈膳汤铺', // 分享卡片标题
path: '/pages/index/index', // 分享后打开的页面路径(可携带参数)
imageUrl: 'https://file.aiyushantp.com/file/b22aa4e4625714e2747b15cfa174ea2351e59df4bacec69d338f9c87c7dae5ca.png' // 分享卡片图片建议300x300像素
}
}
const onShareTimeline = () => {
return {
title: '爱愈膳汤铺', // 分享卡片标题
imageUrl: 'https://file.aiyushantp.com/file/b22aa4e4625714e2747b15cfa174ea2351e59df4bacec69d338f9c87c7dae5ca.png' // 分享卡片图片建议300x300像素
}
}
</script>
<style lang="scss">
@import '../../static/style/common.css';
@import './index.rpx.css';
/* 新增弹窗样式 */
.popup-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.7);
display: flex;
justify-content: center;
align-items: center;
z-index: 999;
}
.popup-content {
position: relative;
width: 80%;
}
.close-icon {
position: absolute;
top: -20px;
left: -20px;
width: 40px;
height: 40px;
z-index: 1000;
}
.popup-image {
width: 100%;
border-radius: 10px;
}
</style>