This commit is contained in:
zmj 2024-06-18 11:17:39 +08:00
parent 20c1ce7a42
commit abc37a23b7
2 changed files with 15 additions and 16 deletions

View File

@ -223,32 +223,31 @@
import useUserStore from "@/store/user";
const userStore = useUserStore();
const STORE_INFO = reactive({})
const STORE_INFO = ref({
name: '',
id: 5,
detailed_address: '',
image: ''
});
const test = () => {
uni.navigateTo({
url: '/pageQuota/quotation/index'
})
const getStoreInfo = () => {
if (uni.getStorageSync('STORE_INFO')) {
let data = JSON.parse(uni.getStorageSync('STORE_INFO'))
for (let key in data) {
STORE_INFO[key] = data[key]
}
}
}
getStoreInfo()
//
onShareAppMessage(() => {
let shareStr = '?id=' + STORE_INFO.value.id;
let shareStr = '?id=' + STORE_INFO.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,
title: STORE_INFO.store_name,
path: '/pages/index/index' + shareStr,
imageUrl: STORE_INFO.value.image,
imageUrl: STORE_INFO.image || '',
success() {
uni.$u.toast('分享成功');
},
@ -550,6 +549,7 @@
left: 0
});
//
const shareInfo = ref({
uid: '',
@ -573,7 +573,6 @@
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 {
//

View File

@ -177,8 +177,8 @@
const logout = () => {
userStore.setToken('');
userStore.setUserInfo({});
uni.removeStorageSync('SHARE_INFO');
uni.setStorageSync("STORE_INFO", '')
uni.reLaunch({
url: '/pages/login/login'
})