Browse Source

供需分享

zhaoxiaohai 3 years ago
parent
commit
68cdd2f41c

+ 9 - 1
components/My_SupplyAndDemandList/index.js

@@ -19,7 +19,14 @@ Component({
      * 组件的初始数据
      */
     data: {
-
+        isLogin: false
+    },
+    pageLifetimes: {
+        show: function () {
+            this.setData({
+                isLogin: wx.getStorageSync('userData') ? true : false
+            })
+        },
     },
 
     /**
@@ -49,6 +56,7 @@ Component({
             this.record(2, id)
         },
         shareCall(e) {
+            if (!queryLogin()) return;
             let {
                 item
             } = e.currentTarget.dataset

+ 1 - 1
components/My_SupplyAndDemandList/index.wxml

@@ -27,7 +27,7 @@
     <Images attinfos='{{item.attinfos}}' />
     <view class="my-footer">
         <view>浏览{{item.freadtimes}}</view>
-        <van-button custom-class='shareBut' icon="share-o" open-type='share' data-item="{{item}}" type="info" catchtap="shareCall">
+        <van-button custom-class='shareBut' icon="share-o" open-type="{{isLogin ? 'share':''}}" data-item="{{item}}" type="info" catchtap="shareCall">
             分享
         </van-button>
     </view>