hookehuyr

✨ feat(扫描二维码进入): 获取二维码参数

1 <!-- 1 <!--
2 * @Date: 2022-09-26 14:36:57 2 * @Date: 2022-09-26 14:36:57
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2022-11-02 10:52:00 4 + * @LastEditTime: 2022-11-03 11:46:08
5 * @FilePath: /swx/src/pages/activityDetail/index.vue 5 * @FilePath: /swx/src/pages/activityDetail/index.vue
6 * @Description: 活动详情页 6 * @Description: 活动详情页
7 --> 7 -->
...@@ -515,7 +515,7 @@ export default { ...@@ -515,7 +515,7 @@ export default {
515 mixins: [mixin.init], 515 mixins: [mixin.init],
516 async onShow () { 516 async onShow () {
517 // 获取活动详情 517 // 获取活动详情
518 - const id = pageQuery().id; 518 + const id = this.qr_id ? this.qr_id : pageQuery().id;
519 const { code, data } = await activityInfoAPI({ i: id }); 519 const { code, data } = await activityInfoAPI({ i: id });
520 if (code) { 520 if (code) {
521 this.activity = data.activity; 521 this.activity = data.activity;
...@@ -530,10 +530,18 @@ export default { ...@@ -530,10 +530,18 @@ export default {
530 // 活动状态判断显示 530 // 活动状态判断显示
531 this.activity_status = getCurrentPageParam().status ? getCurrentPageParam().status : ''; 531 this.activity_status = getCurrentPageParam().status ? getCurrentPageParam().status : '';
532 }, 532 },
533 + onLoad(options) {
534 + // 小程序码进入
535 + if (options.scene) {
536 + let qr_id = (decodeURIComponent(options.scene)).slice(2);
537 + this.qr_id = qr_id;
538 + }
539 + },
533 mounted() { 540 mounted() {
534 }, 541 },
535 data () { 542 data () {
536 return { 543 return {
544 + qr_id: '',
537 activity: { 545 activity: {
538 cover: '', 546 cover: '',
539 }, 547 },
......