Commit ea78f162f7ceca71ae72bbf0fae71243b53550cc
1 parent
70ab9458
预售商品详情页
Showing
2 changed files
with
34 additions
and
4 deletions
packageC/pages/presell/goodsInfo/goodsInfo.js
| @@ -3942,12 +3942,35 @@ Page({ | @@ -3942,12 +3942,35 @@ Page({ | ||
| 3942 | 3942 | ||
| 3943 | 3943 | ||
| 3944 | if (!presell_id) { | 3944 | if (!presell_id) { |
| 3945 | - wx.showToast({ title: "未找到活动商品", icon: 'none', duration: 3000 }) | 3945 | + wx.showToast({ title: "未找到活动商品", icon: 'none', duration: 3000 }); |
| 3946 | + ut.wx_back(); | ||
| 3946 | return false; | 3947 | return false; |
| 3947 | } | 3948 | } |
| 3948 | //------获取预售主表---------- | 3949 | //------获取预售主表---------- |
| 3949 | await getApp().request.promiseGet(`/api/weshop/marketing/marketingPresellForm/get/${os.stoid}/${presell_id}`, {}).then(res => { | 3950 | await getApp().request.promiseGet(`/api/weshop/marketing/marketingPresellForm/get/${os.stoid}/${presell_id}`, {}).then(res => { |
| 3950 | if (res.data.code == 0 && res.data.data) { | 3951 | if (res.data.code == 0 && res.data.data) { |
| 3952 | + var act_data=res.data.data; | ||
| 3953 | + if(act_data.is_end){ | ||
| 3954 | + wx.showToast({ title: "活动已经结束", icon: 'none', duration: 3000 }); | ||
| 3955 | + ut.wx_back(); | ||
| 3956 | + return false; | ||
| 3957 | + } | ||
| 3958 | + if(act_data.isuse==0){ | ||
| 3959 | + wx.showToast({ title: "活动未启用", icon: 'none', duration: 3000 }); | ||
| 3960 | + ut.wx_back(); | ||
| 3961 | + return false; | ||
| 3962 | + } | ||
| 3963 | + | ||
| 3964 | + var end_time=act_data.pay_enddate; | ||
| 3965 | + if(act_data.presell_type==1){ | ||
| 3966 | + end_time=act_data.end_time; | ||
| 3967 | + } | ||
| 3968 | + if(end_time<ut.gettimestamp()){ | ||
| 3969 | + wx.showToast({ title: "活动已经结束", icon: 'none', duration: 3000 }); | ||
| 3970 | + ut.wx_back(); | ||
| 3971 | + return false; | ||
| 3972 | + } | ||
| 3973 | + | ||
| 3951 | th.setData({ | 3974 | th.setData({ |
| 3952 | presellForm: res.data.data, | 3975 | presellForm: res.data.data, |
| 3953 | }); | 3976 | }); |
| @@ -3972,8 +3995,6 @@ Page({ | @@ -3972,8 +3995,6 @@ Page({ | ||
| 3972 | pre_arr = e.data.data.pageData[idx]; | 3995 | pre_arr = e.data.data.pageData[idx]; |
| 3973 | th.setData({ pre_arr: pre_arr }) | 3996 | th.setData({ pre_arr: pre_arr }) |
| 3974 | th.data.prom_buy_limit=pre_arr.vip_butyqty; | 3997 | th.data.prom_buy_limit=pre_arr.vip_butyqty; |
| 3975 | - | ||
| 3976 | - | ||
| 3977 | } | 3998 | } |
| 3978 | }) | 3999 | }) |
| 3979 | if (!pre_arr) { | 4000 | if (!pre_arr) { |
utils/util.js
| @@ -481,6 +481,14 @@ function ajax_ok2(res){ | @@ -481,6 +481,14 @@ function ajax_ok2(res){ | ||
| 481 | return 0; | 481 | return 0; |
| 482 | } | 482 | } |
| 483 | 483 | ||
| 484 | +function wx_back() { | ||
| 485 | + var arr=getCurrentPages(); | ||
| 486 | + if(arr.length<=2){ | ||
| 487 | + getApp().goto("/pages/index/index/index"); | ||
| 488 | + }else{ | ||
| 489 | + wx.navigateBack(); | ||
| 490 | + } | ||
| 491 | +} | ||
| 484 | 492 | ||
| 485 | module.exports = { | 493 | module.exports = { |
| 486 | formatTime: function(e, r) { | 494 | formatTime: function(e, r) { |
| @@ -591,5 +599,6 @@ module.exports = { | @@ -591,5 +599,6 @@ module.exports = { | ||
| 591 | sha1:sha1, //sha1进行签名 | 599 | sha1:sha1, //sha1进行签名 |
| 592 | convert_arr_key:convert_arr_key, //将JS数组对象按其某个键值重组成Map对象 | 600 | convert_arr_key:convert_arr_key, //将JS数组对象按其某个键值重组成Map对象 |
| 593 | ajax_ok:ajax_ok, //将JS数组对象按其某个键值重组成Map对象 | 601 | ajax_ok:ajax_ok, //将JS数组对象按其某个键值重组成Map对象 |
| 594 | - ajax_ok2:ajax_ok2 //将JS数组对象按其某个键值重组成Map对象 | 602 | + ajax_ok2:ajax_ok2, //将JS数组对象按其某个键值重组成Map对象 |
| 603 | + wx_back:wx_back | ||
| 595 | }; | 604 | }; |