张延森 3 years ago
parent
commit
ecbe79d1fd
1 changed files with 16 additions and 0 deletions
  1. 16
    0
      src/pages/Honghe.vue

+ 16
- 0
src/pages/Honghe.vue View File

@@ -35,6 +35,7 @@ import { useModel } from '@/store'
35 35
 import { drawLottery, getPrizeList } from '@/services/person'
36 36
 import { rand, shuffle } from '@/utils/math'
37 37
 import { hideLoading } from '@/utils'
38
+import { share } from 'src/utils/wx'
38 39
 
39 40
 /**
40 41
  * 月份信息
@@ -198,6 +199,21 @@ export default {
198 199
   },
199 200
   created() {
200 201
     this.getPrizes()
202
+
203
+    // 设置微信分享
204
+    share({ title: '抽取幸运签,解锁隐藏福利', desc: '每月都有欢乐发生' })
205
+  },
206
+  watch: {
207
+    showMyWinning(newValue, oldValue) {
208
+      // 微信分享
209
+      // 1、正常情况下, 分享主题是 抽取幸运签,解锁隐藏福利
210
+      // 2、中奖弹出情况下, 分享主题是 我中奖啦! 来试试你的运气吧
211
+      if (newValue && !oldValue) {
212
+        share({ title: '我中奖啦! 来试试你的运气吧', desc: '抽取幸运签,解锁隐藏福利' })
213
+      } else if (newValue !== oldValue) {
214
+        share({ title: '抽取幸运签,解锁隐藏福利', desc: '每月都有欢乐发生' })
215
+      }
216
+    }
201 217
   },
202 218
   methods: {
203 219
     //关闭