修复分享问题
This commit is contained in:
@@ -27,7 +27,10 @@
|
||||
</view>
|
||||
<text class="text">剩余:{{item.quantity}}</text>
|
||||
</view>
|
||||
<view class="goods-name">{{item.goodsName}}</view>
|
||||
<view class="goods-name u-flex u-row-between">
|
||||
<text class="u-m-r-30" style="word-break: break-all;">{{item.goodsName}}</text>
|
||||
<ymfShare color="#333" />
|
||||
</view>
|
||||
<view class="bg-f7" style="height: 24rpx"></view>
|
||||
<view class="desc">
|
||||
<view class="u-flex">
|
||||
@@ -116,6 +119,7 @@
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import ymfShare from '@/components/ymf-components/ymf-share.vue'
|
||||
import {
|
||||
computed,
|
||||
reactive
|
||||
@@ -335,7 +339,7 @@
|
||||
|
||||
import {
|
||||
shareMixin,
|
||||
handleMixinOnLoad,wxShare,returnQuery
|
||||
handleMixinOnLoad,wxShare,returnQuery ,returnIndexBg,
|
||||
} from '@/utils/share.js'
|
||||
// defineOptions({
|
||||
// mixins: [shareMixin],
|
||||
@@ -343,12 +347,13 @@
|
||||
|
||||
onShareAppMessage(async(res)=>{
|
||||
const query=await returnQuery()
|
||||
const shopInfo=uni.cache.get('shopInfo')
|
||||
return wxShare({
|
||||
...res,
|
||||
title:item.goodsName,
|
||||
title:item.goodsName +'-'+shopInfo.shopName,
|
||||
path:'/scoreShop/detail/index'+'?'+query,
|
||||
query,
|
||||
imageUrl:item.goodsImageUrl||''
|
||||
imageUrl:item.goodsImageUrl||returnIndexBg()||''
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -31,10 +31,13 @@
|
||||
<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>
|
||||
<view class="u-flex gap-20" @click="toggleLayout">
|
||||
<image :src="layout === 'block' ? imgs.layout_block : imgs.layout" class="layout" />
|
||||
<view class="u-flex gap-20">
|
||||
<view @click="toggleLayout">
|
||||
<image :src="layout === 'block' ? imgs.layout_block : imgs.layout" class="layout" />
|
||||
</view>
|
||||
<ymfShare size="40rpx" color="#9C571F"></ymfShare>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<goodsList :pointsUser="pointsUser" :layout="layout" :list="list" @exchange="exchange"></goodsList>
|
||||
|
||||
@@ -73,17 +76,17 @@
|
||||
|
||||
function back() {
|
||||
const pages = getCurrentPages();
|
||||
if(pages.length<2){
|
||||
if (pages.length < 2) {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}else{
|
||||
} else {
|
||||
uni.navigateBack({
|
||||
delta: 1,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// function exchange(item) {
|
||||
@@ -148,12 +151,32 @@
|
||||
|
||||
import {
|
||||
shareMixin,
|
||||
handleMixinOnLoad
|
||||
handleMixinOnLoad,
|
||||
returnQuery,
|
||||
jsonToUrl,
|
||||
wxShare,returnIndexBg ,
|
||||
returnCommonQuery
|
||||
} from '@/utils/share.js'
|
||||
defineOptions({
|
||||
mixins: [shareMixin],
|
||||
});
|
||||
// defineOptions({
|
||||
// mixins: [shareMixin],
|
||||
// });
|
||||
|
||||
async function onShare() {
|
||||
const queryJson = await returnCommonQuery()
|
||||
let query = jsonToUrl(queryJson)
|
||||
let json = {}
|
||||
|
||||
json.title = '积分乐园,好物兑换'
|
||||
json.imageUrl = returnIndexBg()||uni.cache.get('shopInfo').logo || ''
|
||||
return wxShare({
|
||||
query,
|
||||
...json,
|
||||
path: '/scoreShop/index/index' + '?' + query
|
||||
})
|
||||
}
|
||||
|
||||
onShareAppMessage(onShare)
|
||||
onShareTimeline(onShare)
|
||||
const options = reactive({
|
||||
|
||||
})
|
||||
@@ -180,6 +203,10 @@
|
||||
import {
|
||||
productStore
|
||||
} from '@/stores/user.js';
|
||||
import {
|
||||
onShareAppMessage
|
||||
} from '@dcloudio/uni-app';
|
||||
import { onShareTimeline } from '@dcloudio/uni-app';
|
||||
const storeuser = productStore();
|
||||
|
||||
|
||||
@@ -200,9 +227,11 @@
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.gap-20{
|
||||
|
||||
.gap-20 {
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.top {
|
||||
padding: 138rpx 26rpx 48rpx 42rpx;
|
||||
display: flex;
|
||||
|
||||
Reference in New Issue
Block a user