调整分享部分方法,修改点餐页分享
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="relative">
|
<view class="relative">
|
||||||
<slot v-if="$slots.default" name="default"></slot>
|
<slot v-if="$slots.default" name="default"></slot>
|
||||||
<up-icon v-else name="share-square" bold color="#333" size="36rpx"></up-icon>
|
<up-icon v-else name="share-square" bold :color="color" :size="size"></up-icon>
|
||||||
<view class="absolute share-box">
|
<view class="absolute share-box">
|
||||||
<button open-type="share" @click="shareClick">分享</button>
|
<button open-type="share" @click="shareClick">分享</button>
|
||||||
</view>
|
</view>
|
||||||
@@ -10,6 +10,16 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
const emits = defineEmits(['shareClick'])
|
const emits = defineEmits(['shareClick'])
|
||||||
|
const props = defineProps({
|
||||||
|
size: {
|
||||||
|
type: String,
|
||||||
|
default: '36rpx'
|
||||||
|
},
|
||||||
|
color:{
|
||||||
|
type: String,
|
||||||
|
default: '#333'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
function shareClick() {
|
function shareClick() {
|
||||||
emits('shareClick')
|
emits('shareClick')
|
||||||
|
|||||||
@@ -364,15 +364,15 @@
|
|||||||
await handleMixinOnLoad(options)
|
await handleMixinOnLoad(options)
|
||||||
console.log('shopInfo', uni.cache.get('shopInfo'));
|
console.log('shopInfo', uni.cache.get('shopInfo'));
|
||||||
console.log('【页面】开始处理自身业务逻辑');
|
console.log('【页面】开始处理自身业务逻辑');
|
||||||
setTimeout(() => {
|
|
||||||
showPageLoading.value = false;
|
|
||||||
getUnReadMsgCount();
|
|
||||||
}, 800);
|
|
||||||
onPageShow()
|
onPageShow()
|
||||||
} else {
|
} else {
|
||||||
onPageShow()
|
onPageShow()
|
||||||
}
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
showPageLoading.value = false;
|
||||||
|
getUnReadMsgCount();
|
||||||
|
}, 800);
|
||||||
});
|
});
|
||||||
|
|
||||||
async function onPageShow() {
|
async function onPageShow() {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
</up-swiper>
|
</up-swiper>
|
||||||
<view class="shop_sku_name u-flex u-row-between">
|
<view class="shop_sku_name u-flex u-row-between">
|
||||||
<view class="u-line-1" style="max-width: 600rpx;">{{ goods.name }}</view>
|
<view class="u-line-1" style="max-width: 600rpx;">{{ goods.name }}</view>
|
||||||
<ymfShare />
|
<ymfShare @shareClick="shareClick" />
|
||||||
</view>
|
</view>
|
||||||
<view class="shop_sku_description" v-if="isSkuGoods">
|
<view class="shop_sku_description" v-if="isSkuGoods">
|
||||||
{{ goods.shortTitle ? goods.shortTitle : '' }}
|
{{ goods.shortTitle ? goods.shortTitle : '' }}
|
||||||
@@ -506,8 +506,10 @@
|
|||||||
swiperCurrent.value = e.current;
|
swiperCurrent.value = e.current;
|
||||||
}
|
}
|
||||||
|
|
||||||
const emits = defineEmits(['prveImgs', 'websocketsendMessage', 'close', 'modalAdd'])
|
const emits = defineEmits(['prveImgs', 'websocketsendMessage', 'close', 'modalAdd','shareClick'])
|
||||||
|
function shareClick(){
|
||||||
|
emits('shareClick',props.goods)
|
||||||
|
}
|
||||||
function prveImgs(images, currentUrl) {
|
function prveImgs(images, currentUrl) {
|
||||||
emits('prveImgs', images, currentUrl)
|
emits('prveImgs', images, currentUrl)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -574,14 +574,10 @@
|
|||||||
<ModalList></ModalList>
|
<ModalList></ModalList>
|
||||||
<recommendGoodsModal v-if="isDataLoaded" @onBuyClick="onBuyClick"></recommendGoodsModal>
|
<recommendGoodsModal v-if="isDataLoaded" @onBuyClick="onBuyClick"></recommendGoodsModal>
|
||||||
|
|
||||||
<view
|
<view v-for="(item,index) in goodsModalList" :key="index">
|
||||||
v-for="(item,index) in goodsModalList" :key="index"
|
<goodsModal :key="index" v-model="item.show" :goods="item.goods" @prveImgs="prveImgs"
|
||||||
>
|
@shareClick="shareClick" @close="goodsModalClose(index)" @websocketsendMessage="websocketsendMessage"
|
||||||
<goodsModal :key="index" v-model="item.show" :goods="item.goods" @prveImgs="prveImgs" @close="goodsModalClose(index)"
|
@modalAdd="modalAdd" :GoodsIDInCartNumMap="GoodsIDInCartNumMap"></goodsModal>
|
||||||
@websocketsendMessage="websocketsendMessage"
|
|
||||||
@modalAdd="modalAdd"
|
|
||||||
:GoodsIDInCartNumMap="GoodsIDInCartNumMap"
|
|
||||||
></goodsModal>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<xbSwiperPreview :visable="showPrveImg" :imgs="prveImgsList" @update:visable="updateShowPrveImg">
|
<xbSwiperPreview :visable="showPrveImg" :imgs="prveImgsList" @update:visable="updateShowPrveImg">
|
||||||
@@ -749,7 +745,9 @@
|
|||||||
useCartStore
|
useCartStore
|
||||||
} from '@/stores/order.js';
|
} from '@/stores/order.js';
|
||||||
import {
|
import {
|
||||||
computed, provide, reactive
|
computed,
|
||||||
|
provide,
|
||||||
|
reactive
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
const cartStore = useCartStore();
|
const cartStore = useCartStore();
|
||||||
/**
|
/**
|
||||||
@@ -874,7 +872,7 @@
|
|||||||
* 返回购物车对应的商品数量
|
* 返回购物车对应的商品数量
|
||||||
*/
|
*/
|
||||||
function returnGoodsImCartNum(goods) {
|
function returnGoodsImCartNum(goods) {
|
||||||
if(!goods){
|
if (!goods) {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
if (GoodsIDInCartNumMap.value.hasOwnProperty(goods.id)) {
|
if (GoodsIDInCartNumMap.value.hasOwnProperty(goods.id)) {
|
||||||
@@ -1370,12 +1368,13 @@
|
|||||||
prveImgs(res.images);
|
prveImgs(res.images);
|
||||||
}
|
}
|
||||||
|
|
||||||
const goodsModalList=ref([])
|
const goodsModalList = ref([])
|
||||||
|
|
||||||
function goodsModalClose(index){
|
function goodsModalClose(index) {
|
||||||
goodsModalList.value.splice(index,1)
|
goodsModalList.value.splice(index, 1)
|
||||||
}
|
}
|
||||||
function modalAdd(item){
|
|
||||||
|
function modalAdd(item) {
|
||||||
clickspecifications(item)
|
clickspecifications(item)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1395,8 +1394,8 @@
|
|||||||
|
|
||||||
if (item.isSoldStock == 1 || (item.isSaleTime == 0 && !item.isSaleTimeshow)) {
|
if (item.isSoldStock == 1 || (item.isSaleTime == 0 && !item.isSaleTimeshow)) {
|
||||||
return uni.showToast({
|
return uni.showToast({
|
||||||
title:'商品已下架或不在可售时间内',
|
title: '商品已下架或不在可售时间内',
|
||||||
icon:'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1444,11 +1443,12 @@
|
|||||||
specifications.item.amountcartNumber = 0;
|
specifications.item.amountcartNumber = 0;
|
||||||
// showShopsku.value = true;
|
// showShopsku.value = true;
|
||||||
goodsModalList.value.push({
|
goodsModalList.value.push({
|
||||||
show:true,
|
show: true,
|
||||||
goods:{
|
goods: {
|
||||||
...specifications.item,
|
...specifications.item,
|
||||||
/*过滤掉只有一个规格且下架的商品或者skuList为空的商品*/
|
/*过滤掉只有一个规格且下架的商品或者skuList为空的商品*/
|
||||||
relatedRecommendJson:(specifications.item.relatedRecommendJson||[]).filter(v=>v.skuList&&v.skuList.length)
|
relatedRecommendJson: (specifications.item.relatedRecommendJson || []).filter(v => v
|
||||||
|
.skuList && v.skuList.length)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
@@ -1692,13 +1692,13 @@
|
|||||||
const goodsSkuList = goods ? goods.skuList : []
|
const goodsSkuList = goods ? goods.skuList : []
|
||||||
const findSku = goodsSkuList.find(sku => sku.id == v.sku_id)
|
const findSku = goodsSkuList.find(sku => sku.id == v.sku_id)
|
||||||
const memberPrice = findSku ? findSku.memberPrice : 0
|
const memberPrice = findSku ? findSku.memberPrice : 0
|
||||||
const is_temporary=v.is_temporary||v.isTemporary
|
const is_temporary = v.is_temporary || v.isTemporary
|
||||||
const is_time_discount = limitUtils.canUseLimitTimeDiscount({
|
const is_time_discount = limitUtils.canUseLimitTimeDiscount({
|
||||||
...v,
|
...v,
|
||||||
memberPrice
|
memberPrice
|
||||||
}, cartStore.limitTimeDiscount, shopInfo,
|
}, cartStore.limitTimeDiscount, shopInfo,
|
||||||
shopUserInfo.value, 'product_id');
|
shopUserInfo.value, 'product_id');
|
||||||
if (!goods&&!is_temporary) {
|
if (!goods && !is_temporary) {
|
||||||
console.log('删除未匹配到的商品', {
|
console.log('删除未匹配到的商品', {
|
||||||
id: v.id,
|
id: v.id,
|
||||||
operate_type: "del",
|
operate_type: "del",
|
||||||
@@ -2195,7 +2195,7 @@
|
|||||||
// 列表请求
|
// 列表请求
|
||||||
const productqueryProduct = async () => {
|
const productqueryProduct = async () => {
|
||||||
cartStore.goodsIsloading = false;
|
cartStore.goodsIsloading = false;
|
||||||
allGoodsArr.value=[]
|
allGoodsArr.value = []
|
||||||
try {
|
try {
|
||||||
shopProductList.hots = await productminiApphotsquery();
|
shopProductList.hots = await productminiApphotsquery();
|
||||||
shopProductList.productInfo = await APIgroupquery();
|
shopProductList.productInfo = await APIgroupquery();
|
||||||
@@ -2238,7 +2238,7 @@
|
|||||||
// console.log('allGoodsArr', allGoodsArr);
|
// console.log('allGoodsArr', allGoodsArr);
|
||||||
// console.log('shopProductList', shopProductList);
|
// console.log('shopProductList', shopProductList);
|
||||||
console.log('cartStore.carts', cartStore.carts)
|
console.log('cartStore.carts', cartStore.carts)
|
||||||
cartStore.allGoodsArr=allGoodsArr.value
|
cartStore.allGoodsArr = allGoodsArr.value
|
||||||
if (cartStore.carts.length > 0) {
|
if (cartStore.carts.length > 0) {
|
||||||
cartInit(cartStore.carts);
|
cartInit(cartStore.carts);
|
||||||
}
|
}
|
||||||
@@ -2260,6 +2260,16 @@
|
|||||||
}, 1000);
|
}, 1000);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pageOptions.showGoodsId) {
|
||||||
|
const item = allGoodsArr.value.find(v => v.id == pageOptions.showGoodsId)
|
||||||
|
if (item) {
|
||||||
|
clickspecifications(item)
|
||||||
|
}
|
||||||
|
pageOptions.showGoodsId = null
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
provide('cartStore', cartStore);
|
provide('cartStore', cartStore);
|
||||||
@@ -2444,32 +2454,66 @@
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
shareMixin,
|
shareMixin,
|
||||||
handleMixinOnLoad,returnQuery
|
handleMixinOnLoad,
|
||||||
|
returnQuery,
|
||||||
|
jsonToUrl,
|
||||||
|
returnCommonQuery
|
||||||
} from '@/utils/share.js'
|
} from '@/utils/share.js'
|
||||||
defineOptions({
|
import { onShareTimeline } from '@dcloudio/uni-app';
|
||||||
mixins: [shareMixin],
|
// defineOptions({
|
||||||
});
|
// mixins: [shareMixin],
|
||||||
|
// });
|
||||||
|
|
||||||
onShareAppMessage((res)=>{
|
|
||||||
let query=returnQuery()
|
let isGoodsShare = ref(false)
|
||||||
query+='&type=beforehand'
|
|
||||||
return {
|
function shareClick() {
|
||||||
...res,
|
isGoodsShare.value = true
|
||||||
...query,
|
|
||||||
path: '/pages/product/index' + '?' + query,
|
|
||||||
query,
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
|
||||||
const pageOptions=reactive({})
|
async function onShare(){
|
||||||
|
const queryJson = await returnCommonQuery()
|
||||||
|
let query = jsonToUrl(queryJson)
|
||||||
|
query += '&type=beforehand'
|
||||||
|
let json={}
|
||||||
|
if (goodsModalList.value.length && isGoodsShare.value) {
|
||||||
|
const goods = goodsModalList.value[goodsModalList.value.length - 1].goods
|
||||||
|
query += '&showGoodsId=' + goods.id
|
||||||
|
json.title = goods.name
|
||||||
|
json.imageUrl = goods.coverImg
|
||||||
|
json.showGoodsId = goods.id
|
||||||
|
}else{
|
||||||
|
json.title=uni.cache.get('shopInfo').shopName||''
|
||||||
|
json.imageUrl=uni.cache.get('shopInfo').logo||''
|
||||||
|
}
|
||||||
|
console.log('onShareAppMessage', {
|
||||||
|
query,
|
||||||
|
...json,
|
||||||
|
path: '/pages/product/index' + '?' + query
|
||||||
|
});
|
||||||
|
return {
|
||||||
|
query,
|
||||||
|
...json,
|
||||||
|
path: '/pages/product/index' + '?' + query
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onShareAppMessage(onShare)
|
||||||
|
|
||||||
|
onShareTimeline(onShare)
|
||||||
|
|
||||||
|
const pageOptions = reactive({})
|
||||||
onLoad(async (e) => {
|
onLoad(async (e) => {
|
||||||
Object.assign(pageOptions,e)
|
Object.assign(pageOptions, e)
|
||||||
if (e.type) {
|
if (e.type) {
|
||||||
orderType.value = e.type;
|
orderType.value = e.type;
|
||||||
}
|
}
|
||||||
await handleMixinOnLoad(e)
|
await handleMixinOnLoad({
|
||||||
const userInfo= userStore.userInfo
|
...e,
|
||||||
const shopInfoRes=userStore.shopInfo
|
shopId: e.shopId || uni.cache.get('shopId')
|
||||||
|
})
|
||||||
|
const userInfo = userStore.userInfo
|
||||||
|
const shopInfoRes = userStore.shopInfo
|
||||||
// //获取用户信息
|
// //获取用户信息
|
||||||
// const userInfo = await APIshopUserInfo({
|
// const userInfo = await APIshopUserInfo({
|
||||||
// shopId: uni.cache.get('shopId')
|
// shopId: uni.cache.get('shopId')
|
||||||
@@ -2617,6 +2661,7 @@
|
|||||||
useSocket.setOnMessage(() => {});
|
useSocket.setOnMessage(() => {});
|
||||||
}
|
}
|
||||||
onHide(() => {
|
onHide(() => {
|
||||||
|
isGoodsShare.value=false
|
||||||
closeSocket();
|
closeSocket();
|
||||||
});
|
});
|
||||||
onUnload(() => {
|
onUnload(() => {
|
||||||
|
|||||||
@@ -31,8 +31,9 @@
|
|||||||
<view class="tab-item" :class="tabActive === 0 ? 'active' : ''" @click="tabActive = 0">优惠券</view>
|
<view class="tab-item" :class="tabActive === 0 ? 'active' : ''" @click="tabActive = 0">优惠券</view>
|
||||||
<view class="tab-item" :class="tabActive === 1 ? 'active' : ''" @click="tabActive = 1">其它商品</view>
|
<view class="tab-item" :class="tabActive === 1 ? 'active' : ''" @click="tabActive = 1">其它商品</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex" @click="toggleLayout">
|
<view class="u-flex gap-20" @click="toggleLayout">
|
||||||
<image :src="layout === 'block' ? imgs.layout_block : imgs.layout" class="layout" />
|
<image :src="layout === 'block' ? imgs.layout_block : imgs.layout" class="layout" />
|
||||||
|
<ymfShare size="40rpx" color="#9C571F"></ymfShare>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<goodsList :pointsUser="pointsUser" :layout="layout" :list="list" @exchange="exchange"></goodsList>
|
<goodsList :pointsUser="pointsUser" :layout="layout" :list="list" @exchange="exchange"></goodsList>
|
||||||
@@ -44,6 +45,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import ymfShare from '@/components/ymf-components/ymf-share.vue'
|
||||||
import * as pointGoodsApi from "@/common/api/order/pointGoods.js";
|
import * as pointGoodsApi from "@/common/api/order/pointGoods.js";
|
||||||
import goodsList from "./components/goods-list.vue";
|
import goodsList from "./components/goods-list.vue";
|
||||||
import {
|
import {
|
||||||
@@ -87,12 +89,13 @@
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
function toDetail() {
|
function toDetail() {
|
||||||
if(!pointsUser.value||!pointsUser.value.id){
|
if (!pointsUser.value || !pointsUser.value.id) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/user/member/billDetails?type=2&shopId=' + query.shopId + '&id=' + (pointsUser.value?pointsUser.value.id :
|
url: '/pages/user/member/billDetails?type=2&shopId=' + query.shopId + '&id=' + (pointsUser.value ?
|
||||||
|
pointsUser.value.id :
|
||||||
'')
|
'')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -132,7 +135,21 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
onLoad((opt) => {
|
|
||||||
|
|
||||||
|
import {
|
||||||
|
shareMixin,
|
||||||
|
handleMixinOnLoad
|
||||||
|
} from '@/utils/share.js'
|
||||||
|
defineOptions({
|
||||||
|
mixins: [shareMixin],
|
||||||
|
});
|
||||||
|
|
||||||
|
const options = reactive({
|
||||||
|
|
||||||
|
})
|
||||||
|
onLoad(async (opt) => {
|
||||||
|
Object.assign(options, opt)
|
||||||
query.shopId = opt.shopId || ''
|
query.shopId = opt.shopId || ''
|
||||||
})
|
})
|
||||||
watch(() => tabActive.value, (newval, oldval) => {
|
watch(() => tabActive.value, (newval, oldval) => {
|
||||||
@@ -151,8 +168,19 @@
|
|||||||
query.page++
|
query.page++
|
||||||
getList();
|
getList();
|
||||||
})
|
})
|
||||||
onShow(() => {
|
import {
|
||||||
|
productStore
|
||||||
|
} from '@/stores/user.js';
|
||||||
|
const storeuser = productStore();
|
||||||
|
|
||||||
|
|
||||||
|
onShow(async () => {
|
||||||
|
if (!storeuser.isHasLogin) {
|
||||||
|
await handleMixinOnLoad(options)
|
||||||
refresh()
|
refresh()
|
||||||
|
} else {
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@@ -163,7 +191,9 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
|
.gap-20{
|
||||||
|
gap: 20rpx;
|
||||||
|
}
|
||||||
.top {
|
.top {
|
||||||
padding: 138rpx 26rpx 48rpx 42rpx;
|
padding: 138rpx 26rpx 48rpx 42rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -547,12 +547,14 @@ export const productStore = defineStore("product", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async pageOnload() {
|
async pageOnload() {
|
||||||
|
console.log('开始加载必须数据')
|
||||||
//登录
|
//登录
|
||||||
await this.actionslogin()
|
await this.actionslogin()
|
||||||
//获取会员信息
|
//获取会员信息
|
||||||
await this.actionsproductqueryProduct()
|
await this.actionsproductqueryProduct()
|
||||||
//获取店铺信息
|
//获取店铺信息
|
||||||
await this.getShopInfo()
|
await this.getShopInfo()
|
||||||
|
console.log('必须数据加载完毕')
|
||||||
},
|
},
|
||||||
async getShopInfo(shopId) {
|
async getShopInfo(shopId) {
|
||||||
const shopRes = await APIusershopInfodetail({
|
const shopRes = await APIusershopInfodetail({
|
||||||
|
|||||||
@@ -62,7 +62,42 @@ export function wxShare(par) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function returnQuery(query) {
|
export async function returnCommonQuery() {
|
||||||
|
const shopId = uni.cache.get('shopId')
|
||||||
|
const shopUserInfo = uni.cache.get('shopUserInfo')
|
||||||
|
const shopInfo = uni.cache.get('shopInfo')
|
||||||
|
const inviteCode = await autoGetInviteCode({
|
||||||
|
shopId: shopId,
|
||||||
|
shopUserId: shopUserInfo.id
|
||||||
|
})
|
||||||
|
|
||||||
|
const queryJson = {
|
||||||
|
inviteCode: (inviteCode && inviteCode !== true) ? inviteCode : null,
|
||||||
|
shopId,
|
||||||
|
shopUserId: shopUserInfo.id,
|
||||||
|
}
|
||||||
|
return Promise.resolve(queryJson)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function jsonToUrl(json) {
|
||||||
|
let result = ''
|
||||||
|
for (let key in json) {
|
||||||
|
if (json[key]) {
|
||||||
|
if (result === '') {
|
||||||
|
result += `${key}=${json[key]}`
|
||||||
|
} else {
|
||||||
|
result += `&${key}=${json[key]}`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {Object} query 参数对象
|
||||||
|
* @param {Array} showkeys 需要显示的key不包括公共参数
|
||||||
|
*/
|
||||||
|
export async function returnQuery(query, showkeys) {
|
||||||
|
|
||||||
|
|
||||||
const shopId = uni.cache.get('shopId')
|
const shopId = uni.cache.get('shopId')
|
||||||
@@ -88,7 +123,11 @@ export async function returnQuery(query) {
|
|||||||
}
|
}
|
||||||
for (const key in currentOptions) {
|
for (const key in currentOptions) {
|
||||||
if (currentOptions.hasOwnProperty(key)) {
|
if (currentOptions.hasOwnProperty(key)) {
|
||||||
|
if (showkeys && Array.isArray(showkeys) && showkeys.includes(key)) {
|
||||||
queryJson[key] = encodeURIComponent(currentOptions[key])
|
queryJson[key] = encodeURIComponent(currentOptions[key])
|
||||||
|
} else {
|
||||||
|
queryJson[key] = encodeURIComponent(currentOptions[key])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
queryJson.shopId = shopId
|
queryJson.shopId = shopId
|
||||||
@@ -105,7 +144,7 @@ export async function returnQuery(query) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result
|
return Promise.resolve(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseQueryString(queryString) {
|
function parseQueryString(queryString) {
|
||||||
@@ -211,7 +250,7 @@ export const shareMixin = {
|
|||||||
// queryJson.inviteCode = (inviteCode && inviteCode !== true) ? inviteCode : null
|
// queryJson.inviteCode = (inviteCode && inviteCode !== true) ? inviteCode : null
|
||||||
// queryJson.shopUserId = shopUserInfo.id
|
// queryJson.shopUserId = shopUserInfo.id
|
||||||
|
|
||||||
const query = returnQuery()
|
const query =await returnQuery()
|
||||||
|
|
||||||
|
|
||||||
// 全局默认配置(可被页面覆盖)
|
// 全局默认配置(可被页面覆盖)
|
||||||
@@ -279,7 +318,7 @@ export const shareMixin = {
|
|||||||
// queryJson.inviteCode = (inviteCode && inviteCode !== true) ? inviteCode : null
|
// queryJson.inviteCode = (inviteCode && inviteCode !== true) ? inviteCode : null
|
||||||
// queryJson.shopUserId = shopUserInfo.id
|
// queryJson.shopUserId = shopUserInfo.id
|
||||||
|
|
||||||
const query = returnQuery()
|
const query = await returnQuery()
|
||||||
|
|
||||||
const defaultTimelineConfig = {
|
const defaultTimelineConfig = {
|
||||||
title: shopInfo.shopName,
|
title: shopInfo.shopName,
|
||||||
|
|||||||
Reference in New Issue
Block a user