Commit 368474d98ae0b68550bc713f8f4eaf6657606459
Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev
Showing
8 changed files
with
45 additions
and
219 deletions
app.js
| @@ -110,26 +110,40 @@ App({ | @@ -110,26 +110,40 @@ App({ | ||
| 110 | var th=this; | 110 | var th=this; |
| 111 | var pages = getCurrentPages(); //获取加载的页面 | 111 | var pages = getCurrentPages(); //获取加载的页面 |
| 112 | var currentPage = pages[pages.length - 1]; //获取当前页面的对象 | 112 | var currentPage = pages[pages.length - 1]; //获取当前页面的对象 |
| 113 | - if(!currentPage || currentPage.route.indexOf('error/error')==-1){ | ||
| 114 | - var tt=this.globalData.wxapp_buy_obj; | ||
| 115 | - if (!tt){ | ||
| 116 | - this.get_isbuy(function (){ | ||
| 117 | - tt=th.globalData.wxapp_buy_obj; | ||
| 118 | - if (tt.isout == 1){ | ||
| 119 | - th.promiseGet('/api/weshop/store/get/'+t.stoid,{}).then(res=>{ | ||
| 120 | - wx.reLaunch({ | ||
| 121 | - url: "/pages/error/error?msg=该商城已到期,暂停浏览!\r\n可联系:"+res.data.data.store_tel, | ||
| 122 | - }); | ||
| 123 | - }) | ||
| 124 | - } | ||
| 125 | - else if (tt.isbuy == 0) | ||
| 126 | - wx.reLaunch({ | ||
| 127 | - url: "/pages/error/error?msg=还未购买小程序", | ||
| 128 | - }); | ||
| 129 | - }) | ||
| 130 | - } | ||
| 131 | - } | ||
| 132 | - | 113 | + var turl="/api/weshop/storeconfig/get/" + th.globalData.setting.stoid; |
| 114 | + | ||
| 115 | + th.promiseGet(turl,{}).then(res=>{ | ||
| 116 | + var o=res; | ||
| 117 | + if(o.data.code==0){ | ||
| 118 | + th.globalData.config2 = o.data.data; | ||
| 119 | + //有配置成要验证过期,因为过期的小程序没有办法审核 | ||
| 120 | + if(th.globalData.config2.is_overdue){ | ||
| 121 | + | ||
| 122 | + //要开始验证,小程序有没有购买和过期 | ||
| 123 | + if(!currentPage || currentPage.route.indexOf('error/error')==-1){ | ||
| 124 | + var tt=this.globalData.wxapp_buy_obj; | ||
| 125 | + if (!tt){ | ||
| 126 | + this.get_isbuy(function (){ | ||
| 127 | + tt=th.globalData.wxapp_buy_obj; | ||
| 128 | + if (tt.isout == 1){ | ||
| 129 | + th.promiseGet('/api/weshop/store/get/'+t.stoid,{}).then(res=>{ | ||
| 130 | + wx.reLaunch({ | ||
| 131 | + url: "/pages/error/error?msg=该商城已到期,暂停浏览!\r\n可联系:"+res.data.data.store_tel, | ||
| 132 | + }); | ||
| 133 | + }) | ||
| 134 | + } | ||
| 135 | + else if (tt.isbuy == 0) | ||
| 136 | + wx.reLaunch({ | ||
| 137 | + url: "/pages/error/error?msg=还未购买小程序", | ||
| 138 | + }); | ||
| 139 | + }) | ||
| 140 | + } | ||
| 141 | + } | ||
| 142 | + } | ||
| 143 | + } | ||
| 144 | + }) | ||
| 145 | + | ||
| 146 | + | ||
| 133 | }, | 147 | }, |
| 134 | 148 | ||
| 135 | //---初始化第三方---- | 149 | //---初始化第三方---- |
app.json
| @@ -30,7 +30,6 @@ | @@ -30,7 +30,6 @@ | ||
| 30 | "pages/activity/seckill_list/seckill_list", | 30 | "pages/activity/seckill_list/seckill_list", |
| 31 | "pages/activity/pind_list/pind_list", | 31 | "pages/activity/pind_list/pind_list", |
| 32 | "pages/togoin/togoin", | 32 | "pages/togoin/togoin", |
| 33 | - "pages/getphone/getphone", | ||
| 34 | "pages/team/team_success/team_success", | 33 | "pages/team/team_success/team_success", |
| 35 | "pages/team/team_show/team_show", | 34 | "pages/team/team_show/team_show", |
| 36 | "pages/team/team_ping/team_ping", | 35 | "pages/team/team_ping/team_ping", |
| @@ -97,7 +96,7 @@ | @@ -97,7 +96,7 @@ | ||
| 97 | ], | 96 | ], |
| 98 | "plugins": { | 97 | "plugins": { |
| 99 | "live-player-plugin": { | 98 | "live-player-plugin": { |
| 100 | - "version": "1.2.1", | 99 | + "version": "1.2.5", |
| 101 | "provider": "wx2b03c6e691cd7370" | 100 | "provider": "wx2b03c6e691cd7370" |
| 102 | } | 101 | } |
| 103 | }, | 102 | }, |
pages/getphone/getphone.js deleted
| 1 | -var t = require("../../utils/common.js");var os=getApp().globalData.setting; | ||
| 2 | -Page({ | ||
| 3 | - data:{ | ||
| 4 | - store:null, | ||
| 5 | - imghots: os.imghost, | ||
| 6 | - }, | ||
| 7 | - | ||
| 8 | - onLoad: function (options) { | ||
| 9 | - //--判断是否有接受到邀请人的ID-- | ||
| 10 | - if(options.first_leader){ | ||
| 11 | - this.setData({first_leader:options.first_leader}); | ||
| 12 | - } | ||
| 13 | - }, | ||
| 14 | - onShow:function(){ | ||
| 15 | - var th=this,app = getApp(); | ||
| 16 | - var sessionKey = getApp().globalData.sessionKey; | ||
| 17 | - var openid = getApp().globalData.openid; | ||
| 18 | - | ||
| 19 | - if (openid == "" || openid == null) { | ||
| 20 | - | ||
| 21 | - if (getApp().globalData.userInfo) | ||
| 22 | - openid = getApp().globalData.userInfo.weapp_openid; | ||
| 23 | - } | ||
| 24 | - var r = getApp().globalData.getu; | ||
| 25 | - | ||
| 26 | - if (openid == "" || openid == null || r==null ){ | ||
| 27 | - getApp().globalData.user_id=null; | ||
| 28 | - getApp().globalData.userInfo=null; | ||
| 29 | - getApp().goto('/pages/togoin/togoin') | ||
| 30 | - return false; | ||
| 31 | - } | ||
| 32 | - var user_info=getApp().globalData.userInfo; | ||
| 33 | - console.log("getphone"); | ||
| 34 | - | ||
| 35 | - if(user_info!=null && user_info.mobile!=undefined && user_info.mobile!="" && user_info.mobile!=null){ | ||
| 36 | - wx.navigateBack({ | ||
| 37 | - delta: 1 | ||
| 38 | - }) | ||
| 39 | - } | ||
| 40 | - | ||
| 41 | - app.getConfig(function(e){ | ||
| 42 | - th.setData({ store:e}); | ||
| 43 | - }) | ||
| 44 | - }, | ||
| 45 | - | ||
| 46 | - getphone: function(e) { | ||
| 47 | - var that = this; | ||
| 48 | - var app=getApp(),a=app; | ||
| 49 | - //此处授权得到userInfo | ||
| 50 | - console.log("getphone"); | ||
| 51 | - | ||
| 52 | - e=e.detail; | ||
| 53 | - console.log(e); | ||
| 54 | - //接下来写业务代码登录 | ||
| 55 | - //最后,记得返回刚才的页面 | ||
| 56 | - if (e.encryptedData==undefined){ | ||
| 57 | - /*--- | ||
| 58 | - wx.navigateTo({ | ||
| 59 | - url: '/pages/user/binding_info/binding_info', | ||
| 60 | - })--*/ | ||
| 61 | - return app.my_warnning("登录需要授权手机号码!", 0, that); | ||
| 62 | - return false; | ||
| 63 | - } | ||
| 64 | - var r=getApp().globalData.getu; | ||
| 65 | - var sessionKey = getApp().globalData.sessionKey; | ||
| 66 | - var openid = getApp().globalData.openid; | ||
| 67 | - | ||
| 68 | - console.log(sessionKey,openid); | ||
| 69 | - that.save_the_data(r,e,sessionKey,openid) | ||
| 70 | - | ||
| 71 | - }, | ||
| 72 | - | ||
| 73 | - save_the_data:function (r,e,sessionKey,openid) { | ||
| 74 | - var app=getApp(),a=app,th=this; | ||
| 75 | - var dd = { | ||
| 76 | - oauth: "miniapp", | ||
| 77 | - nickname:a.clear_word(r.nickName), | ||
| 78 | - head_pic: r.avatarUrl, | ||
| 79 | - sex: r.gender, | ||
| 80 | - terminal: "miniapp", | ||
| 81 | - sessionKey: sessionKey, | ||
| 82 | - openid:openid, | ||
| 83 | - encryptedData: e.encryptedData, | ||
| 84 | - iv: e.iv, | ||
| 85 | - store_id: getApp().globalData.setting.stoid, | ||
| 86 | - }; | ||
| 87 | - //--如果有邀请人的时候-- | ||
| 88 | - if(th.data.first_leader){ | ||
| 89 | - dd.first_leader=th.data.first_leader; | ||
| 90 | - } | ||
| 91 | - | ||
| 92 | - console.log(dd); | ||
| 93 | - app.request.get("/api/weshop/users/thirdLogin", { | ||
| 94 | - data: dd, | ||
| 95 | - success: function (e) { | ||
| 96 | - console.log("thirdLogin"); | ||
| 97 | - console.log(e); | ||
| 98 | - if (e.data.code == 0) { | ||
| 99 | - app.globalData.user_id = e.data.data.user_id; | ||
| 100 | - } else { | ||
| 101 | - return app.showWarning("授权登入失败!"+e.data.msg); | ||
| 102 | - } | ||
| 103 | - | ||
| 104 | - wx.setStorageSync("userinfo",e.data.data); | ||
| 105 | - wx.setStorageSync("isAuth", !0), app.globalData.userInfo = e.data.data, app.globalData.userInfo.head_pic = t.getFullUrl(a.globalData.userInfo.head_pic); | ||
| 106 | - wx.navigateBack({ delta: 1}) | ||
| 107 | - | ||
| 108 | - }, | ||
| 109 | - failStatus: function (t) { | ||
| 110 | - /*--- | ||
| 111 | - return "100" === t.data.result ? (i.goHome(), wx.navigateTo({ | ||
| 112 | - url: "/pages/user/binding_info/binding_info?nickName=" + r.nickName + "&userHeadPic=" + r.avatarUrl | ||
| 113 | - }), !1) : (i.clearAuth(), i.alertLoginErrorAndGoHome(t.data.msg), a.request.post("/api/user/logout", { | ||
| 114 | - isShowLoading: !1, | ||
| 115 | - data: { | ||
| 116 | - token: a.request.getToken() | ||
| 117 | - }, | ||
| 118 | - failStatus: function () { | ||
| 119 | - return !1; | ||
| 120 | - } | ||
| 121 | - }), !1);--*/ | ||
| 122 | - return app.my_warnning("授权登入失败,请稍后再试!", 0, that); | ||
| 123 | - }, | ||
| 124 | - fail: function (t) { | ||
| 125 | - return i.clearAuth(), i.alertLoginErrorAndGoHome(), !1; | ||
| 126 | - } | ||
| 127 | - }); | ||
| 128 | - }, | ||
| 129 | - | ||
| 130 | - cancle_bind: function () { | ||
| 131 | - getApp().goto('/pages/user/index/index'); | ||
| 132 | - } | ||
| 133 | - | ||
| 134 | - | ||
| 135 | - | ||
| 136 | -}); |
pages/getphone/getphone.json deleted
pages/getphone/getphone.wxml deleted
| 1 | -<view class="all_page"> | ||
| 2 | - <view class="content"> | ||
| 3 | - <view><image class='logo' src="{{imghots+store.store_logo}}"> </image></view> | ||
| 4 | - <view class="title">{{store.store_name}}</view> | ||
| 5 | - <view>{{store.store_desc}}</view> | ||
| 6 | - <button class="btn" open-type="getPhoneNumber" bindgetphonenumber="getphone">绑定会员</button> | ||
| 7 | - <text class="btn2" bindtap="cancle_bind">暂不绑定</text> | ||
| 8 | - </view> | ||
| 9 | -</view> | ||
| 10 | -<warn id="warn"></warn> | ||
| 11 | \ No newline at end of file | 0 | \ No newline at end of file |
pages/getphone/getphone.wxss deleted
| 1 | -.all_page{ | ||
| 2 | - position: fixed; | ||
| 3 | - height: 100%; | ||
| 4 | - width: 100%; | ||
| 5 | - background: #fff; | ||
| 6 | - justify-content: center;/*水平居中*/ | ||
| 7 | -} | ||
| 8 | -.all_page .content{ | ||
| 9 | - font-size: 30rpx; | ||
| 10 | - text-align: center; | ||
| 11 | - height: 400px; | ||
| 12 | - width: 100%; | ||
| 13 | - position: absolute; | ||
| 14 | - top: 50%; | ||
| 15 | - margin-top:-200px; | ||
| 16 | -} | ||
| 17 | -.logo{width: 140rpx; height: 140rpx; border-radius:50% } | ||
| 18 | -.all_page .content .title{ | ||
| 19 | - font-size: 36rpx; margin: 20rpx 0 | ||
| 20 | -} | ||
| 21 | - | ||
| 22 | -.all_page .btn{ | ||
| 23 | - height: 80rpx; | ||
| 24 | - line-height: 80rpx; | ||
| 25 | - width: 580rpx; | ||
| 26 | - background: #fc661f; | ||
| 27 | - color:#fff; | ||
| 28 | - font-size: 32rpx; | ||
| 29 | - margin-top: 100rpx; | ||
| 30 | - border-radius: 5rpx; | ||
| 31 | -} | ||
| 32 | -.all_page .btn2{ | ||
| 33 | - height: 80rpx; | ||
| 34 | - line-height: 80rpx; | ||
| 35 | - width: 580rpx; | ||
| 36 | - color:#999; | ||
| 37 | - font-size: 32rpx; | ||
| 38 | - border-radius: 5rpx; | ||
| 39 | - margin-top: 10rpx; | ||
| 40 | -} | ||
| 41 | \ No newline at end of file | 0 | \ No newline at end of file |
pages/index/index/index.js
| @@ -277,8 +277,11 @@ Page({ | @@ -277,8 +277,11 @@ Page({ | ||
| 277 | async init_load() { | 277 | async init_load() { |
| 278 | await getApp().getConfig_ays(); | 278 | await getApp().getConfig_ays(); |
| 279 | var th = this; | 279 | var th = this; |
| 280 | - await getApp().get_isbuy(); | ||
| 281 | - this.setappdata(getApp().globalData.wxapp_buy_obj); | 280 | + if(getApp().globalData.config2.is_overdue==1){ |
| 281 | + await getApp().get_isbuy(); | ||
| 282 | + this.setappdata(getApp().globalData.wxapp_buy_obj); | ||
| 283 | + } | ||
| 284 | + | ||
| 282 | 285 | ||
| 283 | 286 | ||
| 284 | //因为营销版本的功能包含了自定义模板的功能,是同时的 | 287 | //因为营销版本的功能包含了自定义模板的功能,是同时的 |
pages/user/index/index.js
| @@ -103,9 +103,11 @@ Page({ | @@ -103,9 +103,11 @@ Page({ | ||
| 103 | th = s, | 103 | th = s, |
| 104 | need_money = 0, | 104 | need_money = 0, |
| 105 | cur_g_num = 0; | 105 | cur_g_num = 0; |
| 106 | - | ||
| 107 | - //调用底部导航 | ||
| 108 | - getApp().get_isbuy(th.setappdata); | 106 | + |
| 107 | + if(getApp().globalData.config2.is_overdue==1){ | ||
| 108 | + //调用底部导航 | ||
| 109 | + getApp().get_isbuy(th.setappdata); | ||
| 110 | + } | ||
| 109 | setTimeout(function () { | 111 | setTimeout(function () { |
| 110 | if (getApp().globalData.user_id) getApp().requestCardNum(th); | 112 | if (getApp().globalData.user_id) getApp().requestCardNum(th); |
| 111 | },500) | 113 | },500) |