Ver código fonte

助力功能实现

liuyao 1 ano atrás
pai
commit
fbbe0f5590

+ 10 - 3
package-basic-data/pages/share-power/share-power.js

@@ -2,6 +2,7 @@
 const Constants = require('@/utils/Constants.js');
 const mixins = require('@/mixins/index.js');
 const app = getApp()
+const util = require('@/utils/util.js')
 const api = require('@/utils/api.js');
 Page({
   mixins: [mixins],
@@ -12,7 +13,8 @@ Page({
     needHelpUserNumber: 5,
     powerModelShowFlag: true,
     menuButtonTop: 48,
-    params: {}
+    params: {},
+    helpFlag: true
   },
 
   /**
@@ -123,14 +125,19 @@ Page({
     console.log('helpMe');
     _this.wxlogin().then(res => {
       _this.getopenid({ code: res.code }).then(res => {
-        console.log('res', res);
         if (res.data.code == Constants.SUCESS_CODE) {
           const openid = res.data.data.openid
           let service = app.globalData['couponReceiveService']
           const params = _this.data.params
           params.userWxid = openid
           _this.excute(service, 'insert_coupon_send', params).then(res => {
-
+            if (res.data.code == Constants.SUCESS_CODE) {
+              util.showToast('助力成功!')
+              this.setData({
+                helpFlag: false,
+                powerModelShowFlag: false
+              })
+            }
           })
         }
       })

+ 1 - 1
package-basic-data/pages/share-power/share-power.wxml

@@ -41,7 +41,7 @@
         </view>
       </view>
       <view class="button-view">
-        <van-button size="normal" wx:if="{{true}}" color="#FF7B1A" custom-style="width:100%;margin-top:30rpx;border-radio:50rpx;" bind:tap="helpMe">帮我点一下
+        <van-button size="normal" wx:if="{{helpFlag}}" color="#FF7B1A" custom-style="width:100%;margin-top:30rpx;border-radio:50rpx;" bind:tap="helpMe">帮我点一下
         </van-button>
         <van-button size="normal" wx:else color="#FF7B1A" custom-style="width:100%;margin-top:30rpx;border-radio:50rpx;">我也想使用软件
         </van-button>