Commit f077555a6078b17aa791295c44ea86f1a405502b

Authored by WXD-SEASON\season
1 parent f8e7c23c

会员中心增加一个订阅消息函数,暂时先不用

Showing 1 changed file with 36 additions and 2 deletions
pages/user/index/index.js
@@ -187,6 +187,10 @@ Page({ @@ -187,6 +187,10 @@ Page({
187 } 187 }
188 }) 188 })
189 189
  190 +
  191 +
  192 +
  193 +
190 /*-----获取会员权益列表-----*/ 194 /*-----获取会员权益列表-----*/
191 rq.get("/api/weshop/users/grade/vipprivilegeinfo/page", { 195 rq.get("/api/weshop/users/grade/vipprivilegeinfo/page", {
192 data: { 196 data: {
@@ -426,7 +430,9 @@ Page({ @@ -426,7 +430,9 @@ Page({
426 }, 430 },
427 //--跳转到优惠券-- 431 //--跳转到优惠券--
428 coupon: function() { 432 coupon: function() {
  433 + var th = this;
429 if (!this.data.userInfo) return false; 434 if (!this.data.userInfo) return false;
  435 + // th.sendsm();
430 wx.navigateTo({ 436 wx.navigateTo({
431 url: '../coupons/coupons', 437 url: '../coupons/coupons',
432 }) 438 })
@@ -673,7 +679,7 @@ Page({ @@ -673,7 +679,7 @@ Page({
673 } 679 }
674 }) 680 })
675 }, 681 },
676 - 682 +
677 //导航跳转 683 //导航跳转
678 nav_goto:function(e){ 684 nav_goto:function(e){
679 var url=e.currentTarget.dataset.url; 685 var url=e.currentTarget.dataset.url;
@@ -711,6 +717,34 @@ Page({ @@ -711,6 +717,34 @@ Page({
711 success: function (res) {}, 717 success: function (res) {},
712 cancel: function (res) {} 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 })