Merge branch 'master' of https://gitea.lihaink.cn/weipengfei/purchase-let
This commit is contained in:
commit
8b98d78dce
|
@ -90,7 +90,9 @@
|
|||
// 门店选择
|
||||
const onChooseShop = (item) => {
|
||||
currShop.value = item.id;
|
||||
uni.setStorageSync('STORE_INFO', JSON.stringify(item))
|
||||
uni.setStorageSync('STORE_INFO', JSON.stringify(item));
|
||||
// 如果选择了新店铺,删除之前的分享信息
|
||||
uni.removeStorageSync('SHARE_INFO');
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index?id=' + item.id,
|
||||
|
@ -108,6 +110,7 @@
|
|||
|
||||
// 搜索
|
||||
const handleSearch = () => {
|
||||
if (!queryParams.latitude || !queryParams.longitude) return;
|
||||
shopList.value = [];
|
||||
queryParams.page_no = 1;
|
||||
status.value = '';
|
||||
|
@ -182,7 +185,6 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #FAFAFA;
|
||||
|
|
|
@ -23,7 +23,8 @@
|
|||
<template #left>
|
||||
<view class="store-info" @click="navgo('/multipleShop/index/index')">
|
||||
<view style="display: flex;font-size: 30rpx;font-weight: bold;">
|
||||
{{STORE_INFO.name}}
|
||||
<text
|
||||
style="max-width: 400rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{shareInfo.real_name?(shareInfo.real_name + '-' + STORE_INFO.name):STORE_INFO.name}}</text>
|
||||
<up-icon name="arrow-right"></up-icon>
|
||||
</view>
|
||||
<view style="display: flex;font-size: 24rpx;color:#777777 ;">
|
||||
|
@ -222,6 +223,7 @@
|
|||
|
||||
import useUserStore from "@/store/user";
|
||||
const userStore = useUserStore();
|
||||
|
||||
const STORE_INFO = ref({
|
||||
name: '',
|
||||
id: '',
|
||||
|
@ -237,9 +239,15 @@
|
|||
|
||||
// 分享给好友
|
||||
onShareAppMessage(() => {
|
||||
let shareStr = '?id=' + STORE_INFO.value.id;
|
||||
if (userStore.userInfo.user_ship == 1) {
|
||||
shareStr = shareStr + '&spread_uid=' + userStore.userInfo.id + '&real_name=' + (userStore.userInfo
|
||||
.real_name || userStore.userInfo.nickname)
|
||||
}
|
||||
|
||||
let shareInfo = {
|
||||
title: STORE_INFO.value.name,
|
||||
path: '/pages/index/index?id=' + STORE_INFO.value.id,
|
||||
path: '/pages/index/index' + shareStr,
|
||||
imageUrl: STORE_INFO.value.image,
|
||||
success() {
|
||||
uni.$u.toast('分享成功');
|
||||
|
@ -273,7 +281,6 @@
|
|||
const show = ref(0);
|
||||
const topActive = ref(0);
|
||||
const changeOne = async (item, index) => {
|
||||
console.log(item)
|
||||
topActive.value = item.id;
|
||||
show.value = 0;
|
||||
goodClassTow.value = item?.children || [];
|
||||
|
@ -358,7 +365,6 @@
|
|||
}).then(res => {
|
||||
if (loadmore) goodList.value.push(...res.data.lists);
|
||||
else goodList.value = res.data.lists;
|
||||
|
||||
// 补充店铺信息
|
||||
if (!STORE_INFO.value.name || !STORE_INFO.value.detailed_address) {
|
||||
STORE_INFO.value.name = res.data.store.name;
|
||||
|
@ -548,20 +554,49 @@
|
|||
left: 0
|
||||
});
|
||||
|
||||
// 分享信息
|
||||
const shareInfo = ref({
|
||||
uid: '',
|
||||
real_name: '',
|
||||
store_id: ''
|
||||
});
|
||||
|
||||
onLoad(async (opt) => {
|
||||
// 店铺id
|
||||
if (opt.id) {
|
||||
where.value.store_id = opt.id;
|
||||
|
||||
const info = await shopDetailApi({
|
||||
store_id: opt.id
|
||||
});
|
||||
|
||||
STORE_INFO.value = info.data;
|
||||
uni.setStorageSync('STORE_INFO', JSON.stringify(info.data));
|
||||
|
||||
// 分享参数至当前用户参数
|
||||
if (opt.spread_uid) {
|
||||
shareInfo.value.uid = opt.spread_uid;
|
||||
shareInfo.value.real_name = opt.real_name;
|
||||
shareInfo.value.store_id = opt.id;
|
||||
console.log(shareInfo.value);
|
||||
uni.setStorageSync('SHARE_INFO', shareInfo.value);
|
||||
} else {
|
||||
// 分享信息
|
||||
const i = uni.getStorageSync('SHARE_INFO');
|
||||
if (i)
|
||||
shareInfo.value = i;
|
||||
}
|
||||
} else {
|
||||
// 店铺信息
|
||||
const info = uni.getStorageSync('STORE_INFO');
|
||||
if (info)
|
||||
if (info) {
|
||||
STORE_INFO.value = JSON.parse(info);
|
||||
where.value.store_id = STORE_INFO.value.id;
|
||||
}
|
||||
|
||||
// 分享信息
|
||||
const i = uni.getStorageSync('SHARE_INFO');
|
||||
if (i)
|
||||
shareInfo.value = i;
|
||||
}
|
||||
|
||||
getgoodClassList(0);
|
||||
|
|
|
@ -362,6 +362,7 @@
|
|||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #444;
|
||||
|
||||
image {
|
||||
|
|
|
@ -356,7 +356,10 @@
|
|||
const createOrder = () => {
|
||||
if (!pay_type.value) return uni.$u.toast('请选择支付方式');
|
||||
|
||||
let shareInfo = uni.getStorageSync('SHARE_INFO');
|
||||
|
||||
createOrderApi({
|
||||
spread_uid: (shareInfo && shareInfo.uid) ? shareInfo.uid : '',
|
||||
cart_id: cartStore.cartList,
|
||||
address_id: addressInfo.value.address_id,
|
||||
pay_type: pay_type.value,
|
||||
|
|
Loading…
Reference in New Issue