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

View File

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