分享问题修复
This commit is contained in:
@@ -94,34 +94,37 @@
|
||||
}
|
||||
const config = reactive({})
|
||||
async function getData(id) {
|
||||
const shopId = id||uni.cache.get('shopId')
|
||||
const pages = getCurrentPages();
|
||||
const currentPage = pages[pages.length - 1];
|
||||
const currentPath = currentPage.route;
|
||||
const currentOptions = currentPage.options;
|
||||
const path = `/${currentPath}`;
|
||||
|
||||
const shopId = id||currentOptions.shopId||uni.cache.get('shopId')
|
||||
// console.log('分享组件挂载完毕:shopId',shopId);
|
||||
if (!shopId) {
|
||||
return
|
||||
}
|
||||
shareConfig({
|
||||
shopId
|
||||
}).then(res => {
|
||||
// console.log('分享组件挂载完毕:shareConfig',res);
|
||||
// console.log('分享组件挂载完毕:currentOptions',currentOptions);
|
||||
if(res){
|
||||
Object.assign(config,res)
|
||||
if(res.sharedUserCouponId&&res.sharedUserCouponNum&&res.isSharedUserPopup){
|
||||
const pages = getCurrentPages();
|
||||
const currentPage = pages[pages.length - 1];
|
||||
const currentPath = currentPage.route;
|
||||
const currentOptions = currentPage.options;
|
||||
const path = `/${currentPath}`;
|
||||
|
||||
const pTag = returnPageTags(path)
|
||||
if(pTag&¤tOptions.fromUserId){
|
||||
show.value=true
|
||||
}
|
||||
|
||||
const pTag = returnPageTags(path)
|
||||
if(pTag&¤tOptions.fromUserId&&res.isSharedUserPopup){
|
||||
show.value=true
|
||||
}
|
||||
// if(res.sharedUserCouponId&&res.sharedUserCouponNum){
|
||||
// }
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
watch(()=>userStore.shopInfo.id,(newval)=>{
|
||||
if(newval){
|
||||
// getData()
|
||||
shareConfig({
|
||||
shopId:newval
|
||||
}).then(res => {
|
||||
|
||||
Reference in New Issue
Block a user