diff --git a/public/appmini/old/alipay/app.js b/public/appmini/old/alipay/app.js index 7ca29257a2ba0d7f29af822f22544ef9f0907592..e4b3c9242b2291d984dfbf3fdf1ce6ce99b3d33b 100644 --- a/public/appmini/old/alipay/app.js +++ b/public/appmini/old/alipay/app.js @@ -220,6 +220,22 @@ App({ return user.data; }, + /** + * 用户登录 + * object 回调操作对象 + * method 回调操作对象的函数 + * auth_data 授权数据 + */ + user_auth_login(object, method, auth_data) { + var openid = my.getStorageSync({key: this.data.cache_user_login_key}); + if ((openid.data || null) == null) + { + this.user_login(object, method); + } else { + this.get_user_login_info(object, method, openid.data, auth_data); + } + }, + /** * 用户授权 * object 回调操作对象 @@ -309,22 +325,6 @@ App({ }); }, - /** - * 用户登录 - * object 回调操作对象 - * method 回调操作对象的函数 - * auth_data 授权数据 - */ - user_auth_login(object, method, auth_data) { - var openid = my.getStorageSync({key: this.data.cache_user_login_key}); - if ((openid.data || null) == null) - { - this.user_login(object, method); - } else { - this.get_user_login_info(object, method, openid.data, auth_data); - } - }, - /** * 获取用户授权信息 * object 回调操作对象 diff --git a/public/appmini/old/alipay/pages/coupon/coupon.js b/public/appmini/old/alipay/pages/coupon/coupon.js index 2dfca52d4de27688c0da0ae2e48c821f7ad9e27f..fafd4aa9586e43028a01595b36b68f9002774b4b 100644 --- a/public/appmini/old/alipay/pages/coupon/coupon.js +++ b/public/appmini/old/alipay/pages/coupon/coupon.js @@ -6,6 +6,10 @@ Page({ data_list_loding_msg: '', data_list: [], data_base: null, + + // 优惠劵领取 + temp_coupon_receive_index: null, + temp_coupon_receive_value: null, }, onLoad(params) { @@ -82,45 +86,59 @@ Page({ // 优惠劵领取事件 coupon_receive_event(e) { - var user = app.get_user_info(this, "coupon_receive_event"); - // 用户未绑定用户则转到登录页面 - if (app.user_is_need_login(user)) { - my.redirectTo({ - url: "/pages/login/login?event_callback=coupon_receive_event" - }); - return false; + // 参数处理 + if((e || null) == null) + { + var index = this.data.temp_coupon_receive_index; + var value = this.data.temp_coupon_receive_value; } else { - var self = this; var index = e.currentTarget.dataset.index; var value = e.currentTarget.dataset.value; - var temp_list = this.data.data_list; - if (temp_list[index]['is_operable'] != 0) { - my.showLoading({ title: "处理中..." }); - my.request({ - url: app.get_request_url("receive", "coupon"), - method: "POST", - data: { "coupon_id": value }, - dataType: "json", - header: { 'content-type': 'application/x-www-form-urlencoded' }, - success: res => { - my.hideLoading(); - if (res.data.code == 0) { - app.showToast(res.data.msg, "success"); - if (self.data.data_base != null && self.data.data_base.is_repeat_receive != 1) - { - temp_list[index]['is_operable'] = 0; - temp_list[index]['is_operable_name'] = '已领取'; - self.setData({ data_list: temp_list }); + this.setData({temp_coupon_receive_index: index, temp_coupon_receive_value: value}); + } + + // 登录校验 + var user = app.get_user_info(this, 'coupon_receive_event'); + if (user != false) { + // 用户未绑定用户则转到登录页面 + if (app.user_is_need_login(user)) { + my.navigateTo({ + url: "/pages/login/login?event_callback=coupon_receive_event" + }); + return false; + } else { + var self = this; + var temp_list = this.data.data_list; + if (temp_list[index]['is_operable'] != 0) { + my.showLoading({ title: "处理中..." }); + my.request({ + url: app.get_request_url("receive", "coupon"), + method: "POST", + data: { "coupon_id": value }, + dataType: "json", + header: { 'content-type': 'application/x-www-form-urlencoded' }, + success: res => { + my.hideLoading(); + if (res.data.code == 0) { + app.showToast(res.data.msg, "success"); + if (self.data.data_base != null && self.data.data_base.is_repeat_receive != 1) + { + temp_list[index]['is_operable'] = 0; + temp_list[index]['is_operable_name'] = '已领取'; + self.setData({ data_list: temp_list }); + } + } else { + if (app.is_login_check(res.data, self, 'coupon_receive_event')) { + app.showToast(res.data.msg); + } } - } else { - app.showToast(res.data.msg); + }, + fail: () => { + my.hideLoading(); + app.showToast("服务器请求出错"); } - }, - fail: () => { - my.hideLoading(); - app.showToast("服务器请求出错"); - } - }); + }); + } } } }, diff --git a/public/appmini/old/alipay/pages/extraction-address/extraction-address.js b/public/appmini/old/alipay/pages/extraction-address/extraction-address.js index 15302d539d99c97f3d719550676ae0d8fb43e145..babff0b665a3555d7a82338ee036c38ce04615f5 100644 --- a/public/appmini/old/alipay/pages/extraction-address/extraction-address.js +++ b/public/appmini/old/alipay/pages/extraction-address/extraction-address.js @@ -20,15 +20,22 @@ Page({ // 初始化 init() { var user = app.get_user_info(this, "init"); - // 用户未绑定用户则转到登录页面 - if (app.user_is_need_login(user)) { - my.redirectTo({ - url: "/pages/login/login?event_callback=init" - }); - return false; + if (user != false) { + // 用户未绑定用户则转到登录页面 + if (app.user_is_need_login(user)) { + my.redirectTo({ + url: "/pages/login/login?event_callback=init" + }); + return false; + } else { + // 获取数据 + this.get_data_list(); + } } else { - // 获取数据 - this.get_data_list(); + this.setData({ + data_list_loding_status: 0, + data_bottom_line_status: false, + }); } }, diff --git a/public/appmini/old/alipay/pages/goods-detail/goods-detail.js b/public/appmini/old/alipay/pages/goods-detail/goods-detail.js index 9645f62db71881230f1446e497c290e81628e60e..946c5a83e57b6c25e8615c9fd4575ee4c55b2c53 100644 --- a/public/appmini/old/alipay/pages/goods-detail/goods-detail.js +++ b/public/appmini/old/alipay/pages/goods-detail/goods-detail.js @@ -58,6 +58,10 @@ Page({ // 站点类型 common_site_type: 0, customer_service_tel: null, + + // 优惠劵领取 + temp_coupon_receive_index: null, + temp_coupon_receive_value: null, }, onLoad(params) { @@ -772,44 +776,60 @@ Page({ // 优惠劵领取事件 coupon_receive_event(e) { - var user = app.get_user_info(this, "coupon_receive_event"); - // 用户未绑定用户则转到登录页面 - if (app.user_is_need_login(user)) { - my.redirectTo({ - url: "/pages/login/login?event_callback=coupon_receive_event" - }); - return false; + // 参数处理 + if((e || null) == null) + { + var index = this.data.temp_coupon_receive_index; + var value = this.data.temp_coupon_receive_value; } else { - var self = this; var index = e.currentTarget.dataset.index; var value = e.currentTarget.dataset.value; - var temp_list = this.data.plugins_coupon_data.data; - if (temp_list[index]['is_operable'] != 0) { - my.showLoading({ title: "处理中..." }); - my.request({ - url: app.get_request_url("receive", "coupon"), - method: "POST", - data: { "coupon_id": value }, - dataType: "json", - header: { 'content-type': 'application/x-www-form-urlencoded' }, - success: res => { - my.hideLoading(); - if (res.data.code == 0) { - app.showToast(res.data.msg, "success"); - if (self.data.plugins_coupon_data.base != null && self.data.plugins_coupon_data.base.is_repeat_receive != 1) { - temp_list[index]['is_operable'] = 0; - temp_list[index]['is_operable_name'] = '已领取'; - self.setData({ 'plugins_coupon_data.data': temp_list }); + this.setData({temp_coupon_receive_index: index, temp_coupon_receive_value: value}); + } + + // 登录校验 + var user = app.get_user_info(this, 'coupon_receive_event'); + if (user != false) { + // 用户未绑定用户则转到登录页面 + if (app.user_is_need_login(user)) { + my.navigateTo({ + url: "/pages/login/login?event_callback=coupon_receive_event" + }); + return false; + } else { + var self = this; + var index = e.currentTarget.dataset.index; + var value = e.currentTarget.dataset.value; + var temp_list = this.data.plugins_coupon_data.data; + if (temp_list[index]['is_operable'] != 0) { + my.showLoading({ title: "处理中..." }); + my.request({ + url: app.get_request_url("receive", "coupon"), + method: "POST", + data: { "coupon_id": value }, + dataType: "json", + header: { 'content-type': 'application/x-www-form-urlencoded' }, + success: res => { + my.hideLoading(); + if (res.data.code == 0) { + app.showToast(res.data.msg, "success"); + if (self.data.plugins_coupon_data.base != null && self.data.plugins_coupon_data.base.is_repeat_receive != 1) { + temp_list[index]['is_operable'] = 0; + temp_list[index]['is_operable_name'] = '已领取'; + self.setData({ 'plugins_coupon_data.data': temp_list }); + } + } else { + if (app.is_login_check(res.data, self, 'coupon_receive_event')) { + app.showToast(res.data.msg); + } } - } else { - app.showToast(res.data.msg); + }, + fail: () => { + my.hideLoading(); + app.showToast("服务器请求出错"); } - }, - fail: () => { - my.hideLoading(); - app.showToast("服务器请求出错"); - } - }); + }); + } } } }, diff --git a/public/appmini/old/alipay/pages/user-coupon/user-coupon.js b/public/appmini/old/alipay/pages/user-coupon/user-coupon.js index 2901f4f380f910d965f87400b8e97e0314a56c62..f4ac181cb900723aa4445ce3214259d5330a3141 100644 --- a/public/appmini/old/alipay/pages/user-coupon/user-coupon.js +++ b/public/appmini/old/alipay/pages/user-coupon/user-coupon.js @@ -24,15 +24,22 @@ Page({ init() { var user = app.get_user_info(this, "init"); - // 用户未绑定用户则转到登录页面 - if (app.user_is_need_login(user)) { - my.redirectTo({ - url: "/pages/login/login?event_callback=init" - }); - return false; + if (user != false) { + // 用户未绑定用户则转到登录页面 + if (app.user_is_need_login(user)) { + my.redirectTo({ + url: "/pages/login/login?event_callback=init" + }); + return false; + } else { + // 获取数据 + this.get_data_list(); + } } else { - // 获取数据 - this.get_data_list(); + this.setData({ + data_list_loding_status: 0, + data_bottom_line_status: false, + }); } }, diff --git a/public/appmini/old/weixin/app.js b/public/appmini/old/weixin/app.js index f680fd6449834f5d14cf51bd1c5baec22e189906..80e384d2e71177c1834308fc6b6c51b57264bfcd 100755 --- a/public/appmini/old/weixin/app.js +++ b/public/appmini/old/weixin/app.js @@ -164,7 +164,7 @@ App({ var user = this.get_user_cache_info(); if (user == false) { // 唤醒用户授权 - this.user_auth_login(object, method); + this.user_login(object, method); return false; } else { @@ -187,23 +187,21 @@ App({ * 用户登录 * object 回调操作对象 * method 回调操作对象的函数 - * auth_data 授权数据 */ user_auth_login(object, method, auth_data) { - wx.showLoading({ title: "授权中..." }); var self = this; wx.checkSession({ success: function () { var openid = wx.getStorageSync(self.data.cache_user_login_key) || null; if (openid == null) { - self.user_login(object, method, auth_data); + self.user_login(object, method); } else { self.get_user_login_info(object, method, openid, auth_data); } }, fail: function () { - self.user_login(object, method, auth_data); + self.user_login(object, method); } }); }, @@ -214,58 +212,86 @@ App({ * method 回调操作对象的函数 * auth_data 授权数据 */ - user_login(object, method, auth_data) { - var self = this; - wx.login({ - success: (res) => { - if (res.code) { - wx.request({ - url: self.get_request_url('wechatuserauth', 'user'), - method: 'POST', - data: { authcode: res.code }, - dataType: 'json', - header: { 'content-type': 'application/x-www-form-urlencoded' }, - success: (res) => { - if (res.data.code == 0) { - var data = res.data.data; - if ((data.is_alipay_user_exist || 0) == 1) { - wx.hideLoading(); - wx.setStorage({ - key: self.data.cache_user_info_key, - data: data, - success: (res) => { - if (typeof object === 'object' && (method || null) != null) { - object[method](); + user_login(object, method) { + var openid = wx.getStorageSync(this.data.cache_user_login_key) || null; + if (openid == null) + { + var self = this; + // 加载loding + wx.showLoading({ title: "授权中..." }); + + wx.login({ + success: (res) => { + if (res.code) { + wx.request({ + url: self.get_request_url('wechatuserauth', 'user'), + method: 'POST', + data: { authcode: res.code }, + dataType: 'json', + header: { 'content-type': 'application/x-www-form-urlencoded' }, + success: (res) => { + wx.hideLoading(); + if (res.data.code == 0) { + var data = res.data.data; + if ((data.is_alipay_user_exist || 0) == 1) { + wx.setStorage({ + key: self.data.cache_user_info_key, + data: data, + success: (res) => { + if (typeof object === 'object' && (method || null) != null) { + object[method](); + } + }, + fail: () => { + self.showToast('用户信息缓存失败'); } - }, - fail: () => { - self.showToast('用户信息缓存失败'); - } - }); + }); + } else { + wx.setStorage({ + key: self.data.cache_user_login_key, + data: data.openid + }); + self.login_to_auth(); + } } else { - wx.setStorage({ - key: self.data.cache_user_login_key, - data: data - }); - self.get_user_login_info(object, method, data, auth_data); + wx.hideLoading(); + self.showToast(res.data.msg); } - } else { + }, + fail: () => { wx.hideLoading(); - self.showToast(res.data.msg); - } - }, - fail: () => { - wx.hideLoading(); - self.showToast('服务器请求出错'); - }, - }); + self.showToast('服务器请求出错'); + }, + }); + } + }, + fail: (e) => { + wx.hideLoading(); + self.showToast('授权失败'); } - }, - fail: (e) => { - wx.hideLoading(); - self.showToast('授权失败'); - } - }); + }); + } else { + this.login_to_auth(); + } + }, + + /** + * 跳转到登录页面授权 + */ + login_to_auth() { + wx.showModal({ + title: '温馨提示', + content: '授权用户信息', + confirmText: '确认', + cancelText: '暂不', + success: (result) => { + if (result.confirm) { + wx.navigateTo({ + url: "/pages/login/login" + }); + } + } + }); }, /** @@ -281,6 +307,7 @@ App({ var referrer = (params == null) ? 0 : (params.referrer || 0); // 远程解密数据 + wx.showLoading({ title: "授权中..." }); var self = this; wx.request({ url: self.get_request_url('wechatuserinfo', 'user'), diff --git a/public/appmini/old/weixin/pages/coupon/coupon.js b/public/appmini/old/weixin/pages/coupon/coupon.js index 8f34492fa53af6735b78a334efd50eb521929b50..1971c9519ba129330e3f6c5d5daad31f451fbbbc 100644 --- a/public/appmini/old/weixin/pages/coupon/coupon.js +++ b/public/appmini/old/weixin/pages/coupon/coupon.js @@ -6,6 +6,10 @@ Page({ data_list_loding_msg: '', data_list: [], data_base: null, + + // 优惠劵领取 + temp_coupon_receive_index: null, + temp_coupon_receive_value: null, }, onLoad(params) { @@ -80,45 +84,59 @@ Page({ // 优惠劵领取事件 coupon_receive_event(e) { - var user = app.get_user_info(this, "coupon_receive_event"); - // 用户未绑定用户则转到登录页面 - if (app.user_is_need_login(user)) { - wx.redirectTo({ - url: "/pages/login/login?event_callback=coupon_receive_event" - }); - return false; + // 参数处理 + if((e || null) == null) + { + var index = this.data.temp_coupon_receive_index; + var value = this.data.temp_coupon_receive_value; } else { - var self = this; var index = e.currentTarget.dataset.index; var value = e.currentTarget.dataset.value; - var temp_list = this.data.data_list; - if (temp_list[index]['is_operable'] != 0) { - wx.showLoading({ title: "处理中..." }); - wx.request({ - url: app.get_request_url("receive", "coupon"), - method: "POST", - data: { "coupon_id": value }, - dataType: "json", - header: { 'content-type': 'application/x-www-form-urlencoded' }, - success: res => { - wx.hideLoading(); - if (res.data.code == 0) { - app.showToast(res.data.msg, "success"); - if (self.data.data_base != null && self.data.data_base.is_repeat_receive != 1) - { - temp_list[index]['is_operable'] = 0; - temp_list[index]['is_operable_name'] = '已领取'; - self.setData({ data_list: temp_list }); + this.setData({temp_coupon_receive_index: index, temp_coupon_receive_value: value}); + } + + // 登录校验 + var user = app.get_user_info(this, 'coupon_receive_event'); + if (user != false) { + // 用户未绑定用户则转到登录页面 + if (app.user_is_need_login(user)) { + wx.navigateTo({ + url: "/pages/login/login?event_callback=coupon_receive_event" + }); + return false; + } else { + var self = this; + var temp_list = this.data.data_list; + if (temp_list[index]['is_operable'] != 0) { + wx.showLoading({ title: "处理中..." }); + wx.request({ + url: app.get_request_url("receive", "coupon"), + method: "POST", + data: { "coupon_id": value }, + dataType: "json", + header: { 'content-type': 'application/x-www-form-urlencoded' }, + success: res => { + wx.hideLoading(); + if (res.data.code == 0) { + app.showToast(res.data.msg, "success"); + if (self.data.data_base != null && self.data.data_base.is_repeat_receive != 1) + { + temp_list[index]['is_operable'] = 0; + temp_list[index]['is_operable_name'] = '已领取'; + self.setData({ data_list: temp_list }); + } + } else { + if (app.is_login_check(res.data, self, 'coupon_receive_event')) { + app.showToast(res.data.msg); + } } - } else { - app.showToast(res.data.msg); + }, + fail: () => { + wx.hideLoading(); + app.showToast("服务器请求出错"); } - }, - fail: () => { - wx.hideLoading(); - app.showToast("服务器请求出错"); - } - }); + }); + } } } }, diff --git a/public/appmini/old/weixin/pages/extraction-address/extraction-address.js b/public/appmini/old/weixin/pages/extraction-address/extraction-address.js index 610d654fba0549cbc3add0ae9e3d8c53a757c9ac..49495dfd96b8c5de242bbe7150ed3444cc33c3d3 100644 --- a/public/appmini/old/weixin/pages/extraction-address/extraction-address.js +++ b/public/appmini/old/weixin/pages/extraction-address/extraction-address.js @@ -20,15 +20,22 @@ Page({ // 初始化 init() { var user = app.get_user_info(this, "init"); - // 用户未绑定用户则转到登录页面 - if (app.user_is_need_login(user)) { - wx.redirectTo({ - url: "/pages/login/login?event_callback=init" - }); - return false; + if (user != false) { + // 用户未绑定用户则转到登录页面 + if (app.user_is_need_login(user)) { + wx.redirectTo({ + url: "/pages/login/login?event_callback=init" + }); + return false; + } else { + // 获取数据 + this.get_data_list(); + } } else { - // 获取数据 - this.get_data_list(); + this.setData({ + data_list_loding_status: 0, + data_bottom_line_status: false, + }); } }, diff --git a/public/appmini/old/weixin/pages/goods-detail/goods-detail.js b/public/appmini/old/weixin/pages/goods-detail/goods-detail.js index 920cdf1198711711dde83ca3d941d690d303a402..0d15801d231590a0436a320f601c520ee471cf8f 100755 --- a/public/appmini/old/weixin/pages/goods-detail/goods-detail.js +++ b/public/appmini/old/weixin/pages/goods-detail/goods-detail.js @@ -69,6 +69,10 @@ Page({ // 站点模式 common_site_type: 0, customer_service_tel: null, + + // 优惠劵领取 + temp_coupon_receive_index: null, + temp_coupon_receive_value: null, }, onLoad(params) { @@ -785,71 +789,31 @@ Page({ // 商品海报分享 poster_event() { var user = app.get_user_info(this, 'poster_event'); - // 用户未绑定用户则转到登录页面 - if (app.user_is_need_login(user)) { - wx.navigateTo({ - url: "/pages/login/login?event_callback=init" - }); - return false; - } else { - wx.showLoading({ title: '生成中...' }); - wx.request({ - url: app.get_request_url('poster', 'goods'), - method: 'POST', - data: { "goods_id": this.data.goods.id }, - dataType: 'json', - success: (res) => { - wx.hideLoading(); - if (res.data.code == 0) { - wx.previewImage({ - current: res.data.data, - urls: [res.data.data] - }); - } else { - app.showToast(res.data.msg); - } - }, - fail: () => { - wx.hideLoading(); - app.showToast("服务器请求出错"); - } - }); - } - }, - - // 优惠劵领取事件 - coupon_receive_event(e) { - var user = app.get_user_nifo(this, "coupon_receive_event"); - // 用户未绑定用户则转到登录页面 - if (app.user_is_need_login(user)) { - my.redirectTo({ - url: "/pages/login/login?event_callback=coupon_receive_event" - }); - return false; - } else { - var self = this; - var index = e.currentTarget.dataset.index; - var value = e.currentTarget.dataset.value; - var temp_list = this.data.plugins_coupon_data.data; - if (temp_list[index]['is_operable'] != 0) { - wx.showLoading({ title: "处理中..." }); + if (user != false) { + // 用户未绑定用户则转到登录页面 + if (app.user_is_need_login(user)) { + wx.navigateTo({ + url: "/pages/login/login?event_callback=poster_event" + }); + return false; + } else { + wx.showLoading({ title: '生成中...' }); wx.request({ - url: app.get_request_url("receive", "coupon"), - method: "POST", - data: { "coupon_id": value }, - dataType: "json", - header: { 'content-type': 'application/x-www-form-urlencoded' }, - success: res => { + url: app.get_request_url('poster', 'goods'), + method: 'POST', + data: { "goods_id": this.data.goods.id }, + dataType: 'json', + success: (res) => { wx.hideLoading(); if (res.data.code == 0) { - app.showToast(res.data.msg, "success"); - if (self.data.plugins_coupon_data.base != null && self.data.plugins_coupon_data.base.is_repeat_receive != 1) { - temp_list[index]['is_operable'] = 0; - temp_list[index]['is_operable_name'] = '已领取'; - self.setData({ 'plugins_coupon_data.data': temp_list }); - } + wx.previewImage({ + current: res.data.data, + urls: [res.data.data] + }); } else { - app.showToast(res.data.msg); + if (app.is_login_check(res.data, this, 'poster_event')) { + app.showToast(res.data.msg); + } } }, fail: () => { @@ -861,6 +825,64 @@ Page({ } }, + // 优惠劵领取事件 + coupon_receive_event(e) { + // 参数处理 + if((e || null) == null) + { + var index = this.data.temp_coupon_receive_index; + var value = this.data.temp_coupon_receive_value; + } else { + var index = e.currentTarget.dataset.index; + var value = e.currentTarget.dataset.value; + this.setData({temp_coupon_receive_index: index, temp_coupon_receive_value: value}); + } + + // 登录校验 + var user = app.get_user_info(this, 'coupon_receive_event'); + if (user != false) { + // 用户未绑定用户则转到登录页面 + if (app.user_is_need_login(user)) { + wx.navigateTo({ + url: "/pages/login/login?event_callback=coupon_receive_event" + }); + return false; + } else { + var self = this; + var temp_list = this.data.plugins_coupon_data.data; + if (temp_list[index]['is_operable'] != 0) { + wx.showLoading({ title: "处理中..." }); + wx.request({ + url: app.get_request_url("receive", "coupon"), + method: "POST", + data: { "coupon_id": value }, + dataType: "json", + header: { 'content-type': 'application/x-www-form-urlencoded' }, + success: res => { + wx.hideLoading(); + if (res.data.code == 0) { + app.showToast(res.data.msg, "success"); + if (self.data.plugins_coupon_data.base != null && self.data.plugins_coupon_data.base.is_repeat_receive != 1) { + temp_list[index]['is_operable'] = 0; + temp_list[index]['is_operable_name'] = '已领取'; + self.setData({ 'plugins_coupon_data.data': temp_list }); + } + } else { + if (app.is_login_check(res.data, self, 'coupon_receive_event')) { + app.showToast(res.data.msg); + } + } + }, + fail: () => { + wx.hideLoading(); + app.showToast("服务器请求出错"); + } + }); + } + } + } + }, + // 展示型事件 exhibition_submit_event(e) { app.call_tel(this.data.customer_service_tel); diff --git a/public/appmini/old/weixin/pages/user-coupon/user-coupon.js b/public/appmini/old/weixin/pages/user-coupon/user-coupon.js index 1ea6dc3b06352dc8397510802bbd47343f8a9470..300fe76c0ab8aa65745bc4cc072968a7fff2822c 100644 --- a/public/appmini/old/weixin/pages/user-coupon/user-coupon.js +++ b/public/appmini/old/weixin/pages/user-coupon/user-coupon.js @@ -24,15 +24,22 @@ Page({ init() { var user = app.get_user_info(this, "init"); - // 用户未绑定用户则转到登录页面 - if (app.user_is_need_login(user)) { - wx.redirectTo({ - url: "/pages/login/login?event_callback=init" - }); - return false; + if (user != false) { + // 用户未绑定用户则转到登录页面 + if (app.user_is_need_login(user)) { + wx.redirectTo({ + url: "/pages/login/login?event_callback=init" + }); + return false; + } else { + // 获取数据 + this.get_data_list(); + } } else { - // 获取数据 - this.get_data_list(); + this.setData({ + data_list_loding_status: 0, + data_bottom_line_status: false, + }); } },