Commit 6d9d99977188d19911c6b5ea66b1ca953a25225f
Merge branch 'test' into 'qa'
Test See merge request !294
Showing
3 changed files
with
95 additions
and
68 deletions
pages/goods/goodsInfo/goodsInfo.js
| @@ -8,7 +8,7 @@ var t = require("../../../utils/util.js"), | @@ -8,7 +8,7 @@ var t = require("../../../utils/util.js"), | ||
| 8 | oo = s.globalData, | 8 | oo = s.globalData, |
| 9 | o = s.globalData.setting, | 9 | o = s.globalData.setting, |
| 10 | os = o; | 10 | os = o; |
| 11 | -//评价加载更多 | 11 | +//评价加载更多 |
| 12 | var more = function(e) { | 12 | var more = function(e) { |
| 13 | return e && e.__esModule ? e : { | 13 | return e && e.__esModule ? e : { |
| 14 | default: e | 14 | default: e |
| @@ -285,21 +285,21 @@ Page({ | @@ -285,21 +285,21 @@ Page({ | ||
| 285 | ee.init(gid); | 285 | ee.init(gid); |
| 286 | //------几人评价------- | 286 | //------几人评价------- |
| 287 | //n.init(th, "", "comments"); | 287 | //n.init(th, "", "comments"); |
| 288 | - | 288 | + |
| 289 | th.requestCardNum(), wx.pageScrollTo && th.setData({ | 289 | th.requestCardNum(), wx.pageScrollTo && th.setData({ |
| 290 | supportPageScroll: !0 | 290 | supportPageScroll: !0 |
| 291 | }); | 291 | }); |
| 292 | - | 292 | + |
| 293 | //计算等级价相关 | 293 | //计算等级价相关 |
| 294 | var swithc_list=e.switch_list; | 294 | var swithc_list=e.switch_list; |
| 295 | var sw_arr=JSON.parse(swithc_list); | 295 | var sw_arr=JSON.parse(swithc_list); |
| 296 | //---如果后台又开等级卡的开关--- | 296 | //---如果后台又开等级卡的开关--- |
| 297 | if(sw_arr.rank_switch && sw_arr.rank_switch=="2"){ | 297 | if(sw_arr.rank_switch && sw_arr.rank_switch=="2"){ |
| 298 | - th.setData({rank_switch:true}); | ||
| 299 | - | 298 | + th.setData({rank_switch:true}); |
| 299 | + | ||
| 300 | //---回调卡的列表--- | 300 | //---回调卡的列表--- |
| 301 | th.getPlusCardType(function(ob){ | 301 | th.getPlusCardType(function(ob){ |
| 302 | - th.setData({card_list:ob.card_list}); | 302 | + th.setData({card_list:ob.card_list}); |
| 303 | var ti = setInterval(function () { | 303 | var ti = setInterval(function () { |
| 304 | var user = getApp().globalData.userInfo; | 304 | var user = getApp().globalData.userInfo; |
| 305 | if (!user) return false; | 305 | if (!user) return false; |
| @@ -309,22 +309,22 @@ Page({ | @@ -309,22 +309,22 @@ Page({ | ||
| 309 | var str = user['card_expiredate'].replace(/-/g, '/'); | 309 | var str = user['card_expiredate'].replace(/-/g, '/'); |
| 310 | var end = new Date(str); | 310 | var end = new Date(str); |
| 311 | end = Date.parse(end) / 1000; | 311 | end = Date.parse(end) / 1000; |
| 312 | - var now = ut.gettimestamp(); | 312 | + var now = ut.gettimestamp(); |
| 313 | //--- 判断是等级会员,且在有效期范围内 --- | 313 | //--- 判断是等级会员,且在有效期范围内 --- |
| 314 | if(user.card_field && now<end){ | 314 | if(user.card_field && now<end){ |
| 315 | - var card_name=ob.name_map.get(user.card_field); | 315 | + var card_name=ob.name_map.get(user.card_field); |
| 316 | if(card_name.length>5) card_name=card_name.substring(0,5); | 316 | if(card_name.length>5) card_name=card_name.substring(0,5); |
| 317 | - | 317 | + |
| 318 | var is_near_date=0; | 318 | var is_near_date=0; |
| 319 | if(end-now<60*60*30*24) is_near_date=1; //如果小于30天 | 319 | if(end-now<60*60*30*24) is_near_date=1; //如果小于30天 |
| 320 | - th.setData({card_field:user.card_field,card_name:card_name,card_list:ob.card_list,is_near_date:is_near_date}); | ||
| 321 | - } | 320 | + th.setData({card_field:user.card_field,card_name:card_name,card_list:ob.card_list,is_near_date:is_near_date}); |
| 321 | + } | ||
| 322 | } | 322 | } |
| 323 | - }, 500) | ||
| 324 | - }) | ||
| 325 | - | 323 | + }, 500) |
| 324 | + }) | ||
| 325 | + | ||
| 326 | } | 326 | } |
| 327 | - | 327 | + |
| 328 | }); | 328 | }); |
| 329 | 329 | ||
| 330 | //获取用户设备信息,屏幕宽度 | 330 | //获取用户设备信息,屏幕宽度 |
| @@ -508,7 +508,7 @@ Page({ | @@ -508,7 +508,7 @@ Page({ | ||
| 508 | var ui = setInterval(function () { | 508 | var ui = setInterval(function () { |
| 509 | goods_list = th.selectComponent("#goods_list"); | 509 | goods_list = th.selectComponent("#goods_list"); |
| 510 | if (goods_list) { | 510 | if (goods_list) { |
| 511 | - clearInterval(ui); | 511 | + clearInterval(ui); |
| 512 | goods_list.init(); | 512 | goods_list.init(); |
| 513 | return false | 513 | return false |
| 514 | } | 514 | } |
| @@ -650,8 +650,8 @@ Page({ | @@ -650,8 +650,8 @@ Page({ | ||
| 650 | this.data.enterAddressPage && (this.data.enterAddressPage = !1); | 650 | this.data.enterAddressPage && (this.data.enterAddressPage = !1); |
| 651 | 651 | ||
| 652 | 652 | ||
| 653 | - | ||
| 654 | - | 653 | + |
| 654 | + | ||
| 655 | 655 | ||
| 656 | 656 | ||
| 657 | }, | 657 | }, |
| @@ -851,24 +851,24 @@ Page({ | @@ -851,24 +851,24 @@ Page({ | ||
| 851 | newd.prom_type = 0; | 851 | newd.prom_type = 0; |
| 852 | newd.prom_id = 0; | 852 | newd.prom_id = 0; |
| 853 | } | 853 | } |
| 854 | - | 854 | + |
| 855 | //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------ | 855 | //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------ |
| 856 | if(o.prom_type!=1 && o.prom_type!=6){ | 856 | if(o.prom_type!=1 && o.prom_type!=6){ |
| 857 | var conf=th.data.bconfig; | 857 | var conf=th.data.bconfig; |
| 858 | if(conf.switch_list){ | 858 | if(conf.switch_list){ |
| 859 | var s_list=JSON.parse(conf.switch_list); | 859 | var s_list=JSON.parse(conf.switch_list); |
| 860 | //如果后台有开启等级价的功能 | 860 | //如果后台有开启等级价的功能 |
| 861 | - if(parseInt(s_list.rank_switch)==2){ | 861 | + if(parseInt(s_list.rank_switch)==2){ |
| 862 | var card_price=o[getApp().globalData.userInfo['card_field']]; | 862 | var card_price=o[getApp().globalData.userInfo['card_field']]; |
| 863 | //如果会员有等级价 | 863 | //如果会员有等级价 |
| 864 | - if(getApp().globalData.userInfo['card_field']!=undefined && getApp().globalData.userInfo['card_field']!=null | 864 | + if(getApp().globalData.userInfo['card_field']!=undefined && getApp().globalData.userInfo['card_field']!=null |
| 865 | && getApp().globalData.userInfo['card_field']!="" && card_price>0){ | 865 | && getApp().globalData.userInfo['card_field']!="" && card_price>0){ |
| 866 | - newd.goods_price=card_price; | 866 | + newd.goods_price=card_price; |
| 867 | } | 867 | } |
| 868 | } | 868 | } |
| 869 | } | 869 | } |
| 870 | } | 870 | } |
| 871 | - | 871 | + |
| 872 | 872 | ||
| 873 | //if (this.data.data.goods.is_virtual) return this.buyVirtualGoods(d); | 873 | //if (this.data.data.goods.is_virtual) return this.buyVirtualGoods(d); |
| 874 | if ("add" == t.currentTarget.dataset.action) { | 874 | if ("add" == t.currentTarget.dataset.action) { |
| @@ -1201,7 +1201,7 @@ Page({ | @@ -1201,7 +1201,7 @@ Page({ | ||
| 1201 | title=th.data.prom_act.share_title; | 1201 | title=th.data.prom_act.share_title; |
| 1202 | img=th.data.iurl+th.data.prom_act.share_imgurl; | 1202 | img=th.data.iurl+th.data.prom_act.share_imgurl; |
| 1203 | } | 1203 | } |
| 1204 | - | 1204 | + |
| 1205 | return { | 1205 | return { |
| 1206 | title: price + "元 " +title, | 1206 | title: price + "元 " +title, |
| 1207 | path: "/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid, | 1207 | path: "/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid, |
| @@ -1338,7 +1338,12 @@ Page({ | @@ -1338,7 +1338,12 @@ Page({ | ||
| 1338 | 1338 | ||
| 1339 | //如果有开启距离的功能,没有设置默认门店,要用最近的门店作为默认门店 | 1339 | //如果有开启距离的功能,没有设置默认门店,要用最近的门店作为默认门店 |
| 1340 | if(dd.lat && !th.data.def_pick_store){ | 1340 | if(dd.lat && !th.data.def_pick_store){ |
| 1341 | - th.setData({def_pick_store:e.data.data.pageData[0]}); | 1341 | + th.setData({ |
| 1342 | + def_pick_store:e.data.data.pageData[0], | ||
| 1343 | + sto_sele_name: e.data.data.pageData[0].pickup_name, | ||
| 1344 | + sto_sele_id: e.data.data.pageData[0].pickup_id, | ||
| 1345 | + sto_sele_distr: e.data.data.pageData[0].distr_type | ||
| 1346 | + }); | ||
| 1342 | } | 1347 | } |
| 1343 | 1348 | ||
| 1344 | //-- 如果有默认选择门店的时候,要把默认门店放在第一位 -- | 1349 | //-- 如果有默认选择门店的时候,要把默认门店放在第一位 -- |
| @@ -1478,7 +1483,12 @@ Page({ | @@ -1478,7 +1483,12 @@ Page({ | ||
| 1478 | }); | 1483 | }); |
| 1479 | //-----如果没有默认门店,要取第一个门店作为默认店------ | 1484 | //-----如果没有默认门店,要取第一个门店作为默认店------ |
| 1480 | if (!th.data.def_pick_store) { | 1485 | if (!th.data.def_pick_store) { |
| 1481 | - th.setData({def_pick_store:e.data.data.pageData[0]}) | 1486 | + th.setData({ |
| 1487 | + def_pick_store:e.data.data.pageData[0], | ||
| 1488 | + sto_sele_name: e.data.data.pageData[0].pickup_name, | ||
| 1489 | + sto_sele_id: e.data.data.pageData[0].pickup_id, | ||
| 1490 | + sto_sele_distr: e.data.data.pageData[0].distr_type | ||
| 1491 | + }) | ||
| 1482 | } | 1492 | } |
| 1483 | } | 1493 | } |
| 1484 | } | 1494 | } |
| @@ -1544,14 +1554,14 @@ Page({ | @@ -1544,14 +1554,14 @@ Page({ | ||
| 1544 | await getApp().request.promiseGet(t, { data: req_where}).then(res=>{ | 1554 | await getApp().request.promiseGet(t, { data: req_where}).then(res=>{ |
| 1545 | var tot = res.data.data.total; | 1555 | var tot = res.data.data.total; |
| 1546 | e.data.c_curr_p++; | 1556 | e.data.c_curr_p++; |
| 1547 | - e.setData({ | 1557 | + e.setData({ |
| 1548 | com_num: tot, //已经有加载 | 1558 | com_num: tot, //已经有加载 |
| 1549 | }); | 1559 | }); |
| 1550 | if (res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ | 1560 | if (res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ |
| 1551 | rs_data=res.data.data.pageData; | 1561 | rs_data=res.data.data.pageData; |
| 1552 | }else{ | 1562 | }else{ |
| 1553 | th.setData({comments_no_more:1,auto:1}); | 1563 | th.setData({comments_no_more:1,auto:1}); |
| 1554 | - } | 1564 | + } |
| 1555 | }) | 1565 | }) |
| 1556 | 1566 | ||
| 1557 | if (rs_data){ | 1567 | if (rs_data){ |
| @@ -1581,7 +1591,7 @@ Page({ | @@ -1581,7 +1591,7 @@ Page({ | ||
| 1581 | if (res.data.data.pageData && res.data.data.pageData.length > 0) { | 1591 | if (res.data.data.pageData && res.data.data.pageData.length > 0) { |
| 1582 | cda[ind].replay_list = res.data.data.pageData; | 1592 | cda[ind].replay_list = res.data.data.pageData; |
| 1583 | } | 1593 | } |
| 1584 | - }) | 1594 | + }) |
| 1585 | } | 1595 | } |
| 1586 | 1596 | ||
| 1587 | if (!com_data) com_data = cda; | 1597 | if (!com_data) com_data = cda; |
| @@ -1683,7 +1693,7 @@ Page({ | @@ -1683,7 +1693,7 @@ Page({ | ||
| 1683 | prom_start_time: prom_start_time, | 1693 | prom_start_time: prom_start_time, |
| 1684 | isshow: 1, | 1694 | isshow: 1, |
| 1685 | }); | 1695 | }); |
| 1686 | - | 1696 | + |
| 1687 | 1697 | ||
| 1688 | var newTime = ut.gettimestamp(); | 1698 | var newTime = ut.gettimestamp(); |
| 1689 | var endTime2 = t.data.data.end_time; | 1699 | var endTime2 = t.data.data.end_time; |
| @@ -2248,26 +2258,26 @@ Page({ | @@ -2248,26 +2258,26 @@ Page({ | ||
| 2248 | goods_sn: o.goods_sn, | 2258 | goods_sn: o.goods_sn, |
| 2249 | sku: o.sku, | 2259 | sku: o.sku, |
| 2250 | }; | 2260 | }; |
| 2251 | - | ||
| 2252 | - //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------ | ||
| 2253 | - | 2261 | + |
| 2262 | + //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------ | ||
| 2263 | + | ||
| 2254 | if(th.data.is_normal == 1){ | 2264 | if(th.data.is_normal == 1){ |
| 2255 | var conf=th.data.bconfig; | 2265 | var conf=th.data.bconfig; |
| 2256 | if(conf.switch_list){ | 2266 | if(conf.switch_list){ |
| 2257 | var s_list=JSON.parse(conf.switch_list); | 2267 | var s_list=JSON.parse(conf.switch_list); |
| 2258 | //如果后台有开启等级价的功能 | 2268 | //如果后台有开启等级价的功能 |
| 2259 | - if(parseInt(s_list.rank_switch)==2){ | 2269 | + if(parseInt(s_list.rank_switch)==2){ |
| 2260 | var card_price=o[getApp().globalData.userInfo['card_field']]; | 2270 | var card_price=o[getApp().globalData.userInfo['card_field']]; |
| 2261 | //如果会员有等级价 | 2271 | //如果会员有等级价 |
| 2262 | - if(getApp().globalData.userInfo['card_field']!=undefined && getApp().globalData.userInfo['card_field']!=null | 2272 | + if(getApp().globalData.userInfo['card_field']!=undefined && getApp().globalData.userInfo['card_field']!=null |
| 2263 | && getApp().globalData.userInfo['card_field']!="" && card_price>0){ | 2273 | && getApp().globalData.userInfo['card_field']!="" && card_price>0){ |
| 2264 | - newd.goods_price=card_price; | 2274 | + newd.goods_price=card_price; |
| 2265 | } | 2275 | } |
| 2266 | } | 2276 | } |
| 2267 | } | 2277 | } |
| 2268 | } | 2278 | } |
| 2269 | - | ||
| 2270 | - | 2279 | + |
| 2280 | + | ||
| 2271 | //-----如果是秒杀,团购,积分购,拼团,且不是普通购买----- | 2281 | //-----如果是秒杀,团购,积分购,拼团,且不是普通购买----- |
| 2272 | if (th.data.prom_type == 6 && th.data.is_normal!= 1) { | 2282 | if (th.data.prom_type == 6 && th.data.is_normal!= 1) { |
| 2273 | newd.goods_price = th.data.prom_price; | 2283 | newd.goods_price = th.data.prom_price; |
| @@ -2542,8 +2552,8 @@ Page({ | @@ -2542,8 +2552,8 @@ Page({ | ||
| 2542 | var cid = e.currentTarget.dataset.cid; | 2552 | var cid = e.currentTarget.dataset.cid; |
| 2543 | var index = e.currentTarget.dataset.ind; | 2553 | var index = e.currentTarget.dataset.ind; |
| 2544 | var item = this.data.quan_list[index]; | 2554 | var item = this.data.quan_list[index]; |
| 2545 | - | ||
| 2546 | - | 2555 | + |
| 2556 | + | ||
| 2547 | //--先判断会员状态-- | 2557 | //--先判断会员状态-- |
| 2548 | var user_info = getApp().globalData.userInfo; | 2558 | var user_info = getApp().globalData.userInfo; |
| 2549 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | 2559 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { |
| @@ -2552,9 +2562,9 @@ Page({ | @@ -2552,9 +2562,9 @@ Page({ | ||
| 2552 | }) | 2562 | }) |
| 2553 | return false; | 2563 | return false; |
| 2554 | } | 2564 | } |
| 2555 | - | ||
| 2556 | - | ||
| 2557 | - //如果券还在领取中,不能再点 | 2565 | + |
| 2566 | + | ||
| 2567 | + //如果券还在领取中,不能再点 | ||
| 2558 | if (item.linging == 1) { | 2568 | if (item.linging == 1) { |
| 2559 | getApp().my_warnning('领取中..', 0, this); | 2569 | getApp().my_warnning('领取中..', 0, this); |
| 2560 | return false; | 2570 | return false; |
| @@ -2604,11 +2614,11 @@ Page({ | @@ -2604,11 +2614,11 @@ Page({ | ||
| 2604 | //--先判断会员状态-- | 2614 | //--先判断会员状态-- |
| 2605 | var user_info = getApp().globalData.userInfo; | 2615 | var user_info = getApp().globalData.userInfo; |
| 2606 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | 2616 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { |
| 2607 | - //getApp().my_warnning("请先登录",0,this); | ||
| 2608 | - wx.navigateTo({ url: '/pages/getphone/getphone', }) | 2617 | + //getApp().my_warnning("请先登录",0,this); |
| 2618 | + wx.navigateTo({ url: '/pages/getphone/getphone', }) | ||
| 2609 | return false; | 2619 | return false; |
| 2610 | } | 2620 | } |
| 2611 | - | 2621 | + |
| 2612 | //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 | 2622 | //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 |
| 2613 | var type = this.data.prom_type; | 2623 | var type = this.data.prom_type; |
| 2614 | if (type == 6) type = 2; | 2624 | if (type == 6) type = 2; |
| @@ -3079,7 +3089,7 @@ Page({ | @@ -3079,7 +3089,7 @@ Page({ | ||
| 3079 | is_gps: "3" | 3089 | is_gps: "3" |
| 3080 | }); | 3090 | }); |
| 3081 | } | 3091 | } |
| 3082 | - | 3092 | + |
| 3083 | } | 3093 | } |
| 3084 | }) | 3094 | }) |
| 3085 | }else{ | 3095 | }else{ |
| @@ -3181,16 +3191,16 @@ Page({ | @@ -3181,16 +3191,16 @@ Page({ | ||
| 3181 | openSpecModal: !0, | 3191 | openSpecModal: !0, |
| 3182 | openSpecModal_ind: openindstore, | 3192 | openSpecModal_ind: openindstore, |
| 3183 | }); | 3193 | }); |
| 3184 | - } | 3194 | + } |
| 3185 | else if (openindstore == 4) { //4就是拼团 | 3195 | else if (openindstore == 4) { //4就是拼团 |
| 3186 | th.setData({ | 3196 | th.setData({ |
| 3187 | - openSpecModal_pt: 1, //打开拼团购买界面 | 3197 | + openSpecModal_pt: 1, //打开拼团购买界面 |
| 3188 | store: 0, //关闭门店 | 3198 | store: 0, //关闭门店 |
| 3189 | choice_sort_store: 0, //关闭门店2级 | 3199 | choice_sort_store: 0, //关闭门店2级 |
| 3190 | sort_store: 0, //关闭门店2级 | 3200 | sort_store: 0, //关闭门店2级 |
| 3191 | }); | 3201 | }); |
| 3192 | } | 3202 | } |
| 3193 | - | 3203 | + |
| 3194 | else { | 3204 | else { |
| 3195 | th.setData({ | 3205 | th.setData({ |
| 3196 | store: 0, | 3206 | store: 0, |
| @@ -3282,13 +3292,13 @@ Page({ | @@ -3282,13 +3292,13 @@ Page({ | ||
| 3282 | } | 3292 | } |
| 3283 | else if (openindstore == 4) { //4就是拼团 | 3293 | else if (openindstore == 4) { //4就是拼团 |
| 3284 | th.setData({ | 3294 | th.setData({ |
| 3285 | - openSpecModal_pt: 1, //打开拼团购买界面 | ||
| 3286 | - store: 0, //关闭门店 | 3295 | + openSpecModal_pt: 1, //打开拼团购买界面 |
| 3296 | + store: 0, //关闭门店 | ||
| 3287 | choice_sort_store: 0, //关闭门店2级 | 3297 | choice_sort_store: 0, //关闭门店2级 |
| 3288 | - sort_store: 0, //关闭门店2级 | 3298 | + sort_store: 0, //关闭门店2级 |
| 3289 | }); | 3299 | }); |
| 3290 | } | 3300 | } |
| 3291 | - | 3301 | + |
| 3292 | else { | 3302 | else { |
| 3293 | th.setData({ | 3303 | th.setData({ |
| 3294 | store: 0, | 3304 | store: 0, |
| @@ -3367,7 +3377,7 @@ Page({ | @@ -3367,7 +3377,7 @@ Page({ | ||
| 3367 | comments: that.data.comments | 3377 | comments: that.data.comments |
| 3368 | }) | 3378 | }) |
| 3369 | }, | 3379 | }, |
| 3370 | - | 3380 | + |
| 3371 | //--- 获取卡类列表 --- | 3381 | //--- 获取卡类列表 --- |
| 3372 | getPlusCardType: function (func) { | 3382 | getPlusCardType: function (func) { |
| 3373 | var storid = os.stoid; | 3383 | var storid = os.stoid; |
| @@ -3377,16 +3387,16 @@ Page({ | @@ -3377,16 +3387,16 @@ Page({ | ||
| 3377 | var arr = [1219, 2089, 3031]; | 3387 | var arr = [1219, 2089, 3031]; |
| 3378 | var new_arr = new Array(); | 3388 | var new_arr = new Array(); |
| 3379 | var card_name_map=new Map(); | 3389 | var card_name_map=new Map(); |
| 3380 | - for (var i = 0; i < plusCard.length; i++) { | 3390 | + for (var i = 0; i < plusCard.length; i++) { |
| 3381 | var name="card"+plusCard[i].CorrPrice.toLowerCase(); | 3391 | var name="card"+plusCard[i].CorrPrice.toLowerCase(); |
| 3382 | - card_name_map.set(name,plusCard[i].CardName); | 3392 | + card_name_map.set(name,plusCard[i].CardName); |
| 3383 | } | 3393 | } |
| 3384 | - | 3394 | + |
| 3385 | var ob={"card_list":plusCard,"name_map":card_name_map}; | 3395 | var ob={"card_list":plusCard,"name_map":card_name_map}; |
| 3386 | - func(ob); | 3396 | + func(ob); |
| 3387 | }) | 3397 | }) |
| 3388 | }, | 3398 | }, |
| 3389 | - | 3399 | + |
| 3390 | go_plus:function(){ | 3400 | go_plus:function(){ |
| 3391 | getApp().goto("/pages/user/plus/plus"); | 3401 | getApp().goto("/pages/user/plus/plus"); |
| 3392 | }, | 3402 | }, |
| @@ -3395,4 +3405,4 @@ Page({ | @@ -3395,4 +3405,4 @@ Page({ | ||
| 3395 | } | 3405 | } |
| 3396 | 3406 | ||
| 3397 | 3407 | ||
| 3398 | -}); | ||
| 3399 | \ No newline at end of file | 3408 | \ No newline at end of file |
| 3409 | +}); |
pages/user/Change_phone/Change_phone.js
| @@ -11,7 +11,7 @@ Page({ | @@ -11,7 +11,7 @@ Page({ | ||
| 11 | */ | 11 | */ |
| 12 | data: { | 12 | data: { |
| 13 | iurl: r.imghost, | 13 | iurl: r.imghost, |
| 14 | - inputxphone: 0, | 14 | + inputxphone: 1, |
| 15 | mobile: null, //旧手机号码 | 15 | mobile: null, //旧手机号码 |
| 16 | currentTime: "", //验证码发送倒计时 | 16 | currentTime: "", //验证码发送倒计时 |
| 17 | getvcode: "获取验证码", //显示文字 | 17 | getvcode: "获取验证码", //显示文字 |
| @@ -53,12 +53,22 @@ Page({ | @@ -53,12 +53,22 @@ Page({ | ||
| 53 | var isver = th.data.isver; | 53 | var isver = th.data.isver; |
| 54 | var send = th.data.send; | 54 | var send = th.data.send; |
| 55 | var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1}))+\d{8})$/; | 55 | var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1}))+\d{8})$/; |
| 56 | - if (mobile.length < 11) { | ||
| 57 | - getApp().my_warnning("请输入11位的手机号码", 0, th); | ||
| 58 | - } else if (!myreg.test(mobile)) { | ||
| 59 | - getApp().my_warnning("手机号有误", 0, th); | ||
| 60 | - return false; | 56 | + if(change_phone){ |
| 57 | + if (change_phone.length < 11) { | ||
| 58 | + getApp().my_warnning("请输入11位的手机号码", 0, th); | ||
| 59 | + } else if (!myreg.test(change_phone)) { | ||
| 60 | + getApp().my_warnning("手机号有误", 0, th); | ||
| 61 | + return false; | ||
| 62 | + } | ||
| 63 | + }else{ | ||
| 64 | + if (mobile.length < 11) { | ||
| 65 | + getApp().my_warnning("请输入11位的手机号码", 0, th); | ||
| 66 | + } else if (!myreg.test(mobile)) { | ||
| 67 | + getApp().my_warnning("手机号有误", 0, th); | ||
| 68 | + return false; | ||
| 69 | + } | ||
| 61 | } | 70 | } |
| 71 | + | ||
| 62 | if (change_phone == mobile) { | 72 | if (change_phone == mobile) { |
| 63 | getApp().my_warnning("新手机号码和旧手机号码不能一样", 0, th); | 73 | getApp().my_warnning("新手机号码和旧手机号码不能一样", 0, th); |
| 64 | return false; | 74 | return false; |
| @@ -122,6 +132,12 @@ Page({ | @@ -122,6 +132,12 @@ Page({ | ||
| 122 | if (change_phone.length > 1) { | 132 | if (change_phone.length > 1) { |
| 123 | mobile = change_phone | 133 | mobile = change_phone |
| 124 | } | 134 | } |
| 135 | + if(!change_phone){ | ||
| 136 | + return getApp().my_warnning("请输入手机号", 0, th); | ||
| 137 | + } | ||
| 138 | + if(!code){ | ||
| 139 | + return getApp().my_warnning("请输入验证码", 0, th); | ||
| 140 | + } | ||
| 125 | getApp().request.put("/api/weshop/users/updateMobile/" + r.stoid + '/' + o.user_id + '/' + code + '/' + mobile, { | 141 | getApp().request.put("/api/weshop/users/updateMobile/" + r.stoid + '/' + o.user_id + '/' + code + '/' + mobile, { |
| 126 | success: function(res) { | 142 | success: function(res) { |
| 127 | if (res.data.code == 0) { | 143 | if (res.data.code == 0) { |
| @@ -230,4 +246,4 @@ Page({ | @@ -230,4 +246,4 @@ Page({ | ||
| 230 | onShareAppMessage: function() { | 246 | onShareAppMessage: function() { |
| 231 | 247 | ||
| 232 | } | 248 | } |
| 233 | -}) | ||
| 234 | \ No newline at end of file | 249 | \ No newline at end of file |
| 250 | +}) |
pages/user/assistance/friend_assistance.js
| @@ -54,6 +54,7 @@ Page({ | @@ -54,6 +54,7 @@ Page({ | ||
| 54 | * 生命周期函数--监听页面显示 | 54 | * 生命周期函数--监听页面显示 |
| 55 | */ | 55 | */ |
| 56 | onShow: function() { | 56 | onShow: function() { |
| 57 | + var th=this; | ||
| 57 | if (this.data.tasking != null && this.data.tasking != 'undefined' && this.data.tasking != "" && this.data.tasking != | 58 | if (this.data.tasking != null && this.data.tasking != 'undefined' && this.data.tasking != "" && this.data.tasking != |
| 58 | 0) { | 59 | 0) { |
| 59 | 60 |