This commit is contained in:
2025-12-22 18:38:48 +08:00
49 changed files with 8687 additions and 1075 deletions

View File

@@ -5,28 +5,26 @@
<image class="bg" :src="shopExtend[0].value" mode="aspectFill"
v-if="!isJsonArrayString(shopExtend[0].value)"></image>
<swiper class="swiper" autoplay circular v-else>
<swiper-item class="swiper-item" v-for="item in JSON.parse(shopExtend[0].value)">
<swiper-item class="swiper-item" v-for="(item, index) in JSON.parse(shopExtend[0].value)"
:key="index">
<image class="swiper-bg" :src="item"></image>
</swiper-item>
</swiper>
</template>
</view>
<view class="userInfo u-flex">
<up-avatar size="61px" :default-url="imgs.defaultAvatar"></up-avatar>
<view class="u-flex-1 u-flex u-row-between u-p-l-16 u-p-r-16">
<view>
<view class="u-flex">
<view class="u-font-32 color-333 font-bold u-line-1" style="max-width: 320rpx;">HI欢迎回来</view>
<view class="u-font-32 color-333 font-bold u-line-1" style="max-width: 320rpx">HI欢迎回来</view>
<view class="vip" v-if="shopUserInfo.isVip">会员身份</view>
</view>
<view class="u-m-t-10 u-font-24 color-666">
<text>优惠券{{allConfig.couponNum}}</text>
<text class="u-m-l-22">积分{{allConfig.pointNum}}</text>
<text>优惠券{{ allConfig.couponNum }}</text>
<text class="u-m-l-22">积分{{ allConfig.pointNum }}</text>
</view>
</view>
<image :src="imgs.code" class="code"></image>
</view>
@@ -52,11 +50,9 @@
<view class="desc">-自助下单 快人一步-</view>
</view>
<image :src="imgs.big_orderFood" class="big_img"></image>
</view>
<view class="groupBuying" v-if="allConfig.group">
<view class="groupBuying" @click="toGroupBuying">
<view class="u-flex u-col-center">
<image class="img" :src="imgs.groupBuying"></image>
<view class="u-font-32 color-333 font-700 u-m-l-12">快乐拼单</view>
@@ -64,9 +60,10 @@
<view class="u-font-28 color-999">一键分享快速拼单</view>
</view>
</view>
<view class="points" @click="toIntegralMall" v-if="allConfig.pointsMall">
<view class="points" @click="toIntegralMall">
<view>
<view class="title">积分乐园</view>
<view class="desc">好物兑换 畅花积分</view>
@@ -74,6 +71,14 @@
<image class="img" :src="imgs.points"></image>
</view>
<view class="points taocan" @click="toTaocan">
<view>
<view class="title">套餐推广</view>
<view class="desc">邀好友助力套餐更优惠</view>
</view>
<image class="img" :src="imgs.taocan"></image>
</view>
<view class="bottom_menus">
<view class="item" @click="tomember">
<image :src="imgs.vip" class="img"></image>
@@ -85,15 +90,14 @@
<view class="title">充值</view>
<view class="desc">充值享更多优惠</view>
</view>
<view class="item" @click="toFenxiao" v-if="allConfig.distribution">
<view class="item" @click="toFenxiao">
<image :src="imgs.share" class="img"></image>
<view class="title">股东共享</view>
<view class="desc">邀请好友获得佣金</view>
</view>
</view>
<view style="height: 90px;"></view>
<view style="height: 90px"></view>
<u-popup :show="popupShow" :safe-area-inset-bottom="false" mode="center" @close="popupShow = false">
<view class="popup-content">
<view class="header-wrap">
@@ -112,27 +116,33 @@
</view>
</view>
</u-popup>
<!-- 私域引流弹窗 -->
<attractPopup type="home" ref="attractPopupRef" />
</view>
</template>
<script setup>
import attractPopup from '@/components/attract-popup.vue';
import {
homeData
} from '@/common/api/market/index.js'
} from '@/common/api/market/index.js';
import {
getMemberConfig,
getRechargeConfig,
} from "@/common/api/index/index.js";
getRechargeConfig
} from '@/common/api/index/index.js';
import {
ref,
reactive,
defineProps,
defineEmits,
onMounted
} from "vue";
} from 'vue';
import {
isJsonArrayString
} from "@/utils/util.js";
} from '@/utils/util.js';
const attractPopupRef = ref(null);
const imgs = {
recharge: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/2f22c0ced494497e8d6f981832b191c9.png',
share: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/bcb8d461e96d445ba40256079da775b3.png',
@@ -143,31 +153,38 @@
groupBuying: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/117745e0f3db48b489f9d4e5c5967043.png',
points: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/df0758f7b86449f89f882e50226e17c7.png',
code: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/044dcaf913054f03a9db7983f048b1e6.png',
defaultAvatar: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/b98d2c7110e847f996e8d7ba4342f0a5.png'
}
defaultAvatar: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/b98d2c7110e847f996e8d7ba4342f0a5.png',
taocan: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/1eb9aa9b865b47b39ab9d7ac404601a9.png'
};
// 定义接收的属性
const props = defineProps({
shopExtend: {
type: Array,
default: [],
},
default: []
}
});
function toGroupBuying() {
uni.navigateTo({
url: '/groupBuying/index/index'
})
}
function toFenxiao() {
uni.navigateTo({
url: "/distribution/shop-detail/index?shopId=" + uni.cache.get("shopId"),
url: '/distribution/shop-detail/index?shopId=' + uni.cache.get('shopId')
});
}
function toIntegralMall() {
uni.navigateTo({
url: "/scoreShop/index/index?shopId=" + uni.cache.get("shopId"),
url: '/scoreShop/index/index?shopId=' + uni.cache.get('shopId')
});
}
import {
productStore
} from "@/stores/user.js";
} from '@/stores/user.js';
import {
onShow
} from '@dcloudio/uni-app';
@@ -181,10 +198,10 @@
// 预点单
function beforehandOrderHandle() {
popupShow.value = false;
uni.cache.set("dinersNum", 1);
uni.cache.set("tableCode", shopUserInfo.id);
uni.cache.set('dinersNum', 1);
uni.cache.set('tableCode', shopUserInfo.id);
uni.navigateTo({
url: "/pages/product/index?type=beforehand",
url: '/pages/product/index?type=beforehand'
});
}
@@ -195,51 +212,57 @@
await store.scanCodeactions();
}
function toTaocan() {
uni.navigateTo({
url: '/userPackage/index/index'
})
}
const memberindex = (url) => {
uni.pro.navigateTo(url, {
shopId: uni.cache.get("shopId"),
type: "index",
shopId: uni.cache.get('shopId'),
type: 'index'
});
};
const shopUserInfo = reactive({})
Object.assign(shopUserInfo, uni.cache.get("shopUserInfo") || {})
const shopUserInfo = reactive({});
Object.assign(shopUserInfo, uni.cache.get('shopUserInfo') || {});
function tomember() {
if (isMember.value) {
const shopId = uni.cache.get("shopId");
const shopId = uni.cache.get('shopId');
if (!shopUserInfo.isVip) {
uni.navigateTo({
url: "/user/vip/buy-vip?shopId=" + shopId,
url: '/user/vip/buy-vip?shopId=' + shopId
});
return;
}
uni.navigateTo({
url: "/user/vip/vip?shopId=" + shopId,
url: '/user/vip/vip?shopId=' + shopId
});
} else {
uni.showToast({
title: "暂未开放",
icon: "none",
title: '暂未开放',
icon: 'none'
});
}
}
function toCharge() {
if (isCharge.value) {
const shopId = uni.cache.get("shopId");
const shopId = uni.cache.get('shopId');
uni.navigateTo({
url: "/pages/user/member/czzx?shopId=" + shopId,
url: '/pages/user/member/czzx?shopId=' + shopId
});
} else {
uni.showToast({
title: "暂未开放",
icon: "none",
title: '暂未开放',
icon: 'none'
});
}
}
const getQueryString = (url, name) => {
//解码
var reg = new RegExp("(^|&|/?)" + name + "=([^&|/?]*)(&|/?|$)", "i");
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i');
var r = url.substr(1).match(reg);
if (r != null) {
return r[2];
@@ -253,10 +276,10 @@
async function getVipConfig() {
try {
const res1 = await getMemberConfig({
shopId: uni.cache.get("shopId")
shopId: uni.cache.get('shopId')
});
const res2 = await getRechargeConfig({
shopId: uni.cache.get("shopId")
shopId: uni.cache.get('shopId')
});
isMember.value = +res1.memberConfig.isOpen;
@@ -266,7 +289,6 @@
}
}
const allConfig = reactive({
takeout: 0,
group: 0,
@@ -274,21 +296,22 @@
distribution: 0,
couponNum: 0,
pointNum: 0
})
});
function getHomeData() {
homeData().then(res => {
Object.assign(allConfig, res)
})
homeData().then((res) => {
Object.assign(allConfig, res);
imgs.defaultAvatar = res.userAvatar ? res.userAvatar : imgs.defaultAvatar
});
}
onMounted(() => {
updateData()
updateData();
});
function updateData() {
Object.assign(shopUserInfo, uni.cache.get("shopUserInfo") || {})
Object.assign(shopUserInfo, uni.cache.get('shopUserInfo') || {});
getVipConfig();
getHomeData()
getHomeData();
}
defineExpose({
updateData
@@ -469,11 +492,13 @@
align-items: center;
align-self: stretch;
border-radius: 24rpx;
background: #FFF;
transform: translateY(-36rpx);
background: #fff;
position: relative;
z-index: 99;
margin-top: -36rpx;
.vip {
background: #FA720A;
background: #fa720a;
font-size: 24rpx;
color: #ffffff;
padding: 6rpx 10rpx;
@@ -487,10 +512,8 @@
}
}
.new-menus-box {
margin: 0 16rpx 34rpx 16rpx;
margin: 0 16rpx 0 16rpx;
.new-menus {
display: flex;
@@ -518,7 +541,7 @@
.line {
width: 2rpx;
height: 156rpx;
background: #EDEDED;
background: #ededed;
}
.takeout {}
@@ -550,7 +573,7 @@
.groupBuying {
padding: 16rpx 38rpx;
border-top: 2rpx solid #EDEDED;
border-top: 2rpx solid #ededed;
background-color: #fff;
display: flex;
justify-content: space-between;
@@ -575,7 +598,7 @@
}
.points {
margin-top: 34rpx;
margin-top: 10px;
background-color: #fff;
padding: 16rpx 68rpx;
border-radius: 16rpx;
@@ -589,10 +612,17 @@
}
}
.taocan {
.img {
width: 117px;
height: 117px;
}
}
.bottom_menus {
display: flex;
gap: 14rpx;
margin-top: 34rpx;
margin-top: 10px;
.item {
flex: 1;
@@ -601,7 +631,7 @@
flex-direction: column;
align-items: center;
border-radius: 18rpx;
background: #FFF;
background: #fff;
.img {
width: 39px;

View File

@@ -2312,7 +2312,6 @@
}, onMessage);
console.log('onLoad:e', e);
cartStore.setOldOrder({
detailMap: {},
originAmount: 0
@@ -2499,9 +2498,12 @@
console.log('onMounted:限时折扣', cartStore.limitTimeDiscount);
}
onMounted(async () => {
// #ifdef MP-WEIXIN
await proxy.$onLaunched;
// #endif
// 获取当前页面栈
const pages = getCurrentPages();
// 获取当前页面实例
const currentPage = pages[pages.length - 1];
// 获取页面参数

File diff suppressed because it is too large Load Diff