Commit f077555a6078b17aa791295c44ea86f1a405502b
1 parent
f8e7c23c
会员中心增加一个订阅消息函数,暂时先不用
Showing
1 changed file
with
36 additions
and
2 deletions
pages/user/index/index.js
... | ... | @@ -187,6 +187,10 @@ Page({ |
187 | 187 | } |
188 | 188 | }) |
189 | 189 | |
190 | + | |
191 | + | |
192 | + | |
193 | + | |
190 | 194 | /*-----获取会员权益列表-----*/ |
191 | 195 | rq.get("/api/weshop/users/grade/vipprivilegeinfo/page", { |
192 | 196 | data: { |
... | ... | @@ -426,7 +430,9 @@ Page({ |
426 | 430 | }, |
427 | 431 | //--跳转到优惠券-- |
428 | 432 | coupon: function() { |
433 | + var th = this; | |
429 | 434 | if (!this.data.userInfo) return false; |
435 | + // th.sendsm(); | |
430 | 436 | wx.navigateTo({ |
431 | 437 | url: '../coupons/coupons', |
432 | 438 | }) |
... | ... | @@ -673,7 +679,7 @@ Page({ |
673 | 679 | } |
674 | 680 | }) |
675 | 681 | }, |
676 | - | |
682 | + | |
677 | 683 | //导航跳转 |
678 | 684 | nav_goto:function(e){ |
679 | 685 | var url=e.currentTarget.dataset.url; |
... | ... | @@ -711,6 +717,34 @@ Page({ |
711 | 717 | success: function (res) {}, |
712 | 718 | cancel: function (res) {} |
713 | 719 | }); |
714 | - } | |
720 | + }, | |
721 | + | |
722 | + //订阅消息提醒 | |
723 | + sendsm:function() | |
724 | + { | |
725 | + var template_id = ""; | |
726 | + rq.get("/api/wx/weappSendlist/page", { | |
727 | + data: { | |
728 | + store_id: os.stoid, | |
729 | + typeid: "1020" | |
730 | + }, | |
731 | + success: function(res) { | |
732 | + if (res.data.code == 0 && res.data.data.pageData.length > 0) { | |
733 | + template_id = res.data.data.pageData[0].template_id; | |
734 | + // //授权订阅 | |
735 | + wx.requestSubscribeMessage({ | |
736 | + tmplIds: [template_id], | |
737 | + success(res) { | |
738 | + | |
739 | + }, | |
740 | + fail(res) { | |
741 | + | |
742 | + } | |
743 | + }) | |
744 | + } | |
745 | + } | |
746 | + }) | |
747 | + }, | |
748 | + | |
715 | 749 | |
716 | 750 | }) | ... | ... |