bobo 3 anni fa
parent
commit
bd349025eb
3 ha cambiato i file con 30 aggiunte e 7 eliminazioni
  1. 17 5
      pages/luckDraw/detail.js
  2. 8 2
      pages/luckDraw/detail.wxml
  3. 5 0
      pages/luckDraw/detail.wxss

+ 17 - 5
pages/luckDraw/detail.js

@@ -155,6 +155,7 @@ Page({
             remainNum = 0
         }
         this.setData({ remainNum })
+        this.setRemainNumSplits()
         // 开始动画,开始是快阶段
         this.data.duration = 80
         this.data.hitPos = -1
@@ -344,9 +345,7 @@ Page({
             if (res.code == 200) {
                 this.setHitRecordDataMap(res.data)
             }
-        }).catch(_ => {
-
-        })
+        }).catch(_ => {})
     },
     setHitRecordDataMap: function(hitRecordList) {
         this.setData({
@@ -399,8 +398,16 @@ Page({
     /**
      * 用户点击右上角分享
      */
-    onShareAppMessage: function () {
-
+    onShareAppMessage: function (res) {
+        LuckDraw.shareActivity(this.data.activityId, getMobileCache()).then(res => {
+            if (res.code == 200) {
+                this.getDrawTimes()
+            }
+        }).catch(_ => {})
+        return {
+            title: this.data.activityTitle,
+            path: "/pages/luckDraw/detail?id=" + this.data.activityId
+        }
     },
 
     setRemainNumSplits: function() {
@@ -415,5 +422,10 @@ Page({
             showNoHitPrizeDlg: false,
             showNeedShareDlg: false,
         })
+    },
+
+    toExchangePlatform: function() {
+
     }
+    
 })

+ 8 - 2
pages/luckDraw/detail.wxml

@@ -95,7 +95,13 @@
         <view class="prize-tip">{{hitResult.goodsName}}</view>
         <view class="btns">
             <view class="_btn _confirm" catchtap="closeDlg">确定</view>
-            <view class="_btn _exchange">去兑换</view>
+            <navigator class="_btn _exchange" 
+            target = "miniProgram" 
+            app-id="wxd92a2d29f8022f40"
+            path="page/index/index"
+            open-type='navigate'>
+                去兑换
+            </navigator>
         </view>
         <image class="_bg" src="/images/luck-draw/hitdlgbg.png" />
     </view>
@@ -136,7 +142,7 @@
         </view>
         <view class="prize-tip">分享可获得更多抽奖机会!</view>
         <view class="btns">
-            <view class="_btn _share">分享</view>
+            <button class="_btn _share" open-type="share">分享</button>
         </view>
         <image class="_bg" src="/images/luck-draw/hitdlgbg.png" />
     </view>

+ 5 - 0
pages/luckDraw/detail.wxss

@@ -381,6 +381,11 @@ page {
 .dlg ._share {
     width: 400rpx;
 }
+.dlg button._share {
+    padding: 0;
+    margin: 0;
+}
+
 .dlg ._layer {
     width: 100vw;
     height: 100vh;