diff --git a/common/css/common.scss b/common/css/common.scss index 425b73c..0957cdb 100644 --- a/common/css/common.scss +++ b/common/css/common.scss @@ -44,6 +44,9 @@ page, image { display: block; } + .relative{ + position: relative; + } .absolute{ position: absolute; } diff --git a/components/ymf-components/ymf-share.vue b/components/ymf-components/ymf-share.vue new file mode 100644 index 0000000..a0211e5 --- /dev/null +++ b/components/ymf-components/ymf-share.vue @@ -0,0 +1,28 @@ + + + + + \ No newline at end of file diff --git a/pages.json b/pages.json index 3189a1a..0e89a0e 100644 --- a/pages.json +++ b/pages.json @@ -2,6 +2,7 @@ "easycom": { "autoscan": true, "custom": { + "^my-(.*)": "@/components/ymf-components/ymf-$1.vue", "^u--(.*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue", "^up-(.*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue", "^u-([^-].*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue" diff --git a/pages/product/components/goods-modal.vue b/pages/product/components/goods-modal.vue index f4a3beb..a294441 100644 --- a/pages/product/components/goods-modal.vue +++ b/pages/product/components/goods-modal.vue @@ -13,8 +13,10 @@ - - {{ goods.name }} + + {{ goods.name }} + + {{ goods.shortTitle ? goods.shortTitle : '' }} @@ -308,6 +310,7 @@ import { useNavbarStore } from '@/stores/navbarStore'; + import ymfShare from '@/components/ymf-components/ymf-share.vue' const store = useNavbarStore(); const { showBack, @@ -479,11 +482,11 @@ const swiperCurrent = ref(0); function returnFirstSku(product) { - console.log('returnFirstSku', product.skuList[0]); + console.log('returnFirstSku', product); return { - ...product.skuList[0], - sku_id: product.skuList[0].id, - id: product.id, + ...product.skuList[0]||'', + sku_id: product.skuList[0].id||'', + id: product.id||'', } } //返回是否是多规格商品 @@ -831,7 +834,7 @@ padding: 0 28rpx; margin-top: 20rpx; font-weight: bold; - font-size: 32upx; + font-size: 32rpx; margin-bottom: 16rpx; } diff --git a/pages/product/index.vue b/pages/product/index.vue index 7e63d5c..734a1ea 100644 --- a/pages/product/index.vue +++ b/pages/product/index.vue @@ -1445,7 +1445,11 @@ // showShopsku.value = true; goodsModalList.value.push({ show:true, - goods:specifications.item + goods:{ + ...specifications.item, + /*过滤掉只有一个规格且下架的商品或者skuList为空的商品*/ + relatedRecommendJson:(specifications.item.relatedRecommendJson||[]).filter(v=>v.skuList&&v.skuList.length) + } }) }; // 判断商品是否在可售时间内 diff --git a/utils/share.js b/utils/share.js index 88e88af..26a7977 100644 --- a/utils/share.js +++ b/utils/share.js @@ -63,8 +63,8 @@ export function wxShare(par) { } export async function returnQuery(query) { - - + + const shopId = uni.cache.get('shopId') const shopUserInfo = uni.cache.get('shopUserInfo') const shopInfo = uni.cache.get('shopInfo') @@ -72,13 +72,13 @@ export async function returnQuery(query) { shopId: shopId, shopUserId: shopUserInfo.id }) - + const pages = getCurrentPages(); const currentPage = pages[pages.length - 1]; const currentPath = currentPage.route; const currentOptions = currentPage.options; - - + + let sharePath = `/${currentPath}`; const queryJson = { inviteCode: (inviteCode && inviteCode !== true) ? inviteCode : null, @@ -94,7 +94,7 @@ export async function returnQuery(query) { queryJson.shopId = shopId queryJson.inviteCode = (inviteCode && inviteCode !== true) ? inviteCode : null queryJson.shopUserId = shopUserInfo.id - + let result = '' for (let key in queryJson) { if (queryJson[key]) { @@ -240,10 +240,10 @@ export const shareMixin = { ...defaultShareConfig, ...pageShareConfig }) - return { + return wxShare({ ...defaultShareConfig, ...pageShareConfig - }; + }); }, @@ -289,9 +289,9 @@ export const shareMixin = { }; const pageTimelineConfig = this.$options.shareTimelineConfig || {}; - return { + return wxShare({ ...defaultTimelineConfig, ...pageTimelineConfig - }; + }); } }; \ No newline at end of file