|
|
@@ -27,7 +27,7 @@
|
|
|
<text class="label">零售价</text>
|
|
|
<text class="old">¥{{product.otPrice}}</text>
|
|
|
</view>
|
|
|
- <view class="share-box">
|
|
|
+ <view class="share-box" @tap="handleOpenShare">
|
|
|
<text class="text">分享</text>
|
|
|
<u-icon name="share-fill" color="#FF233C" size="18"></u-icon>
|
|
|
</view>
|
|
|
@@ -186,14 +186,13 @@
|
|
|
<image src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/app/vip/share.png"></image>
|
|
|
<text class="text">加载中...</text>
|
|
|
</view>
|
|
|
- <CustomToast ref="customToast">
|
|
|
- </CustomToast>
|
|
|
+ <CustomToast ref="customToast" />
|
|
|
<!-- <u-modal :show="showModal" title="温馨提示" content="处方药须凭处方在药师指导下购买和使用" @confirm="hideModal()"></u-modal> -->
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {CustomToast} from '@/components/custom-toast.vue';
|
|
|
+import CustomToast from '@/components/custom-toast.vue';
|
|
|
|
|
|
import {
|
|
|
getDicts
|
|
|
@@ -213,7 +212,7 @@ import {CustomToast} from '@/components/custom-toast.vue';
|
|
|
components: {
|
|
|
item: {},
|
|
|
popupBottom,
|
|
|
- CustomToast
|
|
|
+ CustomToast
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -264,11 +263,6 @@ import {CustomToast} from '@/components/custom-toast.vue';
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
console.log("qxj options:",options);
|
|
|
- uni.showShareMenu({
|
|
|
- withShareTicket: true,
|
|
|
- //小程序的原生菜单中显示分享按钮,才能够让发送给朋友与分享到朋友圈两个按钮可以点击
|
|
|
- menus: ["shareAppMessage", "shareTimeline"] //不设置默认发送给朋友
|
|
|
- })
|
|
|
this.getDicts();
|
|
|
this.productId = options.productId;
|
|
|
this.companyUserId= options.companyUserId
|
|
|
@@ -283,6 +277,42 @@ import {CustomToast} from '@/components/custom-toast.vue';
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleOpenShare() {
|
|
|
+ //#ifdef H5
|
|
|
+ uni.showToast({
|
|
|
+ title: '请使用APP操作',
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ //#endif
|
|
|
+
|
|
|
+ //#ifdef APP-PLUS
|
|
|
+ uni.share({
|
|
|
+ provider: "weixin",
|
|
|
+ scene: 'WXSceneSession',
|
|
|
+ type: 5,
|
|
|
+ imageUrl: 'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/app/vip/share.png', //分享封面图片
|
|
|
+ title: this.product.productName, // 分享标题
|
|
|
+ miniProgram: {
|
|
|
+ id: getApp().globalData.miniprogamId,
|
|
|
+ path: '/pages_company/managerOrder/productDetails?productId=' + this.product.productId + "&userId=" + this.userinfo.userId +"&companyId="+this.companyId+"&companyUserId="+this.companyUserId,
|
|
|
+ type: 0, //0-正式版; 1-测试版; 2-体验版。 默认值为0。
|
|
|
+ webUrl: "http://uniapp.dcloud.io"
|
|
|
+ },
|
|
|
+ success: function(res) {
|
|
|
+ uni.showToast({
|
|
|
+ title: "分享成功",
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ },
|
|
|
+ fail: function(err) {
|
|
|
+ // 此处是调起微信分享失败的回调
|
|
|
+ },
|
|
|
+ complete: (e) => {
|
|
|
+ console.log("WXSceneSession", e)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //#endif
|
|
|
+ },
|
|
|
getuser() {
|
|
|
getUserInfo().then(
|
|
|
res => {
|