调整分享部分方法,修改点餐页分享

This commit is contained in:
2026-01-21 15:11:01 +08:00
parent 654ed39854
commit 8f1b21bf00
7 changed files with 200 additions and 72 deletions

View File

@@ -31,8 +31,9 @@
<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" @click="toggleLayout">
<view class="u-flex gap-20" @click="toggleLayout">
<image :src="layout === 'block' ? imgs.layout_block : imgs.layout" class="layout" />
<ymfShare size="40rpx" color="#9C571F"></ymfShare>
</view>
</view>
<goodsList :pointsUser="pointsUser" :layout="layout" :list="list" @exchange="exchange"></goodsList>
@@ -44,6 +45,7 @@
</view>
</template>
<script setup>
import ymfShare from '@/components/ymf-components/ymf-share.vue'
import * as pointGoodsApi from "@/common/api/order/pointGoods.js";
import goodsList from "./components/goods-list.vue";
import {
@@ -87,12 +89,13 @@
// }
function toDetail() {
if(!pointsUser.value||!pointsUser.value.id){
return
if (!pointsUser.value || !pointsUser.value.id) {
return
}
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 || ''
})
watch(() => tabActive.value, (newval, oldval) => {
@@ -151,8 +168,19 @@
query.page++
getList();
})
onShow(() => {
refresh()
import {
productStore
} from '@/stores/user.js';
const storeuser = productStore();
onShow(async () => {
if (!storeuser.isHasLogin) {
await handleMixinOnLoad(options)
refresh()
} else {
refresh()
}
});
</script>
<style scoped lang="scss">
@@ -163,7 +191,9 @@
flex-direction: column;
justify-content: flex-end;
}
.gap-20{
gap: 20rpx;
}
.top {
padding: 138rpx 26rpx 48rpx 42rpx;
display: flex;