feat(custom): 新增商品详情分享

This commit is contained in:
2023-12-21 21:10:07 +08:00
parent d58d468dd1
commit 79990aeca1
3 changed files with 24 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "jdt-user", "name": "jdt-user",
"version": "3.0.9", "version": "3.0.10",
"private": true, "private": true,
"description": "", "description": "",
"templateInfo": { "templateInfo": {
@@ -9,7 +9,7 @@
"css": "sass" "css": "sass"
}, },
"taroConfig": { "taroConfig": {
"version": "3.0.9" "version": "3.0.10"
}, },
"scripts": { "scripts": {
"build:weapp": "taro build --type weapp", "build:weapp": "taro build --type weapp",

View File

@@ -1,4 +1,5 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: "商品详情", navigationBarTitleText: "商品详情",
navigationStyle: "custom", navigationStyle: "custom",
enableShareAppMessage: true,
}); });

View File

@@ -39,11 +39,17 @@
</view> </view>
<view class="title">{{ goodInfo.name }}</view> <view class="title">{{ goodInfo.name }}</view>
<view class="sub">{{ goodInfo.profile }}</view> <view class="sub">{{ goodInfo.profile }}</view>
<nut-button size="small" type="primary" @click.stop="add_cart(goodInfo)"> <view class="cartBox">
<template #icon> <nut-button
<Cart2 /> size="small"
</template> type="primary"
</nut-button> @click.stop="add_cart(goodInfo)"
>
<template #icon>
<Cart2 />
</template>
</nut-button>
</view>
</view> </view>
<!-- 产品介绍 --> <!-- 产品介绍 -->
<view class="rich-box"> <view class="rich-box">
@@ -100,6 +106,12 @@ Taro.useLoad(async (options) => {
}); });
}); });
Taro.useShareAppMessage(() => ({
title: `捷兑通-${goodInfo.value.name}`,
path: `/pages/goods/goods_detail/index?gid=${goodInfo.value.gid}&type=1`,
imageUrl: `https://${goodInfo.value.cover}`,
}));
const get_good_detail = async (gid: string) => { const get_good_detail = async (gid: string) => {
try { try {
const res = await getActiveGoodsDetail({ gid: gid }); const res = await getActiveGoodsDetail({ gid: gid });
@@ -236,11 +248,10 @@ page {
color: #999; color: #999;
} }
.nut-button { .cartBox {
// margin: 10px; display: flex;
position: absolute; justify-content: flex-end;
right: 40rpx; align-items: center;
bottom: 20rpx;
} }
} }