diff --git a/pages/user/index/index.js b/pages/user/index/index.js index 0176f4d..5bab8c8 100644 --- a/pages/user/index/index.js +++ b/pages/user/index/index.js @@ -187,6 +187,10 @@ Page({ } }) + + + + /*-----获取会员权益列表-----*/ rq.get("/api/weshop/users/grade/vipprivilegeinfo/page", { data: { @@ -426,7 +430,9 @@ Page({ }, //--跳转到优惠券-- coupon: function() { + var th = this; if (!this.data.userInfo) return false; + // th.sendsm(); wx.navigateTo({ url: '../coupons/coupons', }) @@ -673,7 +679,7 @@ Page({ } }) }, - + //导航跳转 nav_goto:function(e){ var url=e.currentTarget.dataset.url; @@ -711,6 +717,34 @@ Page({ success: function (res) {}, cancel: function (res) {} }); - } + }, + + //订阅消息提醒 + sendsm:function() + { + var template_id = ""; + rq.get("/api/wx/weappSendlist/page", { + data: { + store_id: os.stoid, + typeid: "1020" + }, + success: function(res) { + if (res.data.code == 0 && res.data.data.pageData.length > 0) { + template_id = res.data.data.pageData[0].template_id; + // //授权订阅 + wx.requestSubscribeMessage({ + tmplIds: [template_id], + success(res) { + + }, + fail(res) { + + } + }) + } + } + }) + }, + })