Commit e368a04004b4885b35777c95126721c8f08ceb4e

Authored by WXD-SEASON\season
2 parents 44655c26 3fc23ad0

Merge branch 'dev_oa_fu25' into dev

packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
@@ -1020,35 +1020,55 @@ Page({ @@ -1020,35 +1020,55 @@ Page({
1020 success: function (t) { 1020 success: function (t) {
1021 console.log(t); 1021 console.log(t);
1022 if (t.data.code == 0) { 1022 if (t.data.code == 0) {
  1023 +
  1024 + var p_fail=0;
  1025 +
1023 if (t.data.data.is_on_sale != 1) { 1026 if (t.data.data.is_on_sale != 1) {
  1027 + p_fail=1;
1024 wx.showModal({ 1028 wx.showModal({
1025 title: '商品已经下架', 1029 title: '商品已经下架',
1026 showCancel: !1, 1030 showCancel: !1,
1027 complete: function () { 1031 complete: function () {
1028 - wx.navigateBack(); 1032 + let pages = getCurrentPages();
  1033 + if (pages[pages.length - 2]) {
  1034 + wx.navigateBack();
  1035 + } else {
  1036 + getApp().goto('/pages/index/index/index')
  1037 + }
1029 } 1038 }
1030 }); 1039 });
  1040 +
1031 } 1041 }
1032 1042
1033 var timestamp = Date.parse(new Date()); 1043 var timestamp = Date.parse(new Date());
1034 timestamp = timestamp / 1000; 1044 timestamp = timestamp / 1000;
1035 - if (t.data.data.on_time > timestamp) { 1045 + if (t.data.data.on_time > timestamp && !p_fail) {
1036 wx.showModal({ 1046 wx.showModal({
1037 title: '商品还未上架', 1047 title: '商品还未上架',
1038 showCancel: !1, 1048 showCancel: !1,
1039 complete: function () { 1049 complete: function () {
1040 - wx.navigateBack(); 1050 + let pages = getCurrentPages();
  1051 + if (pages[pages.length - 2]) {
  1052 + wx.navigateBack();
  1053 + } else {
  1054 + getApp().goto('/pages/index/index/index')
  1055 + }
1041 } 1056 }
1042 }); 1057 });
1043 } 1058 }
1044 1059
1045 - if (t.data.data.down_time > 0) { 1060 + if (t.data.data.down_time > 0 && !p_fail) {
1046 if (t.data.data.down_time < timestamp) { 1061 if (t.data.data.down_time < timestamp) {
1047 wx.showModal({ 1062 wx.showModal({
1048 title: '商品已经到期下架', 1063 title: '商品已经到期下架',
1049 showCancel: !1, 1064 showCancel: !1,
1050 complete: function () { 1065 complete: function () {
1051 - wx.navigateBack(); 1066 + let pages = getCurrentPages();
  1067 + if (pages[pages.length - 2]) {
  1068 + wx.navigateBack();
  1069 + } else {
  1070 + getApp().goto('/pages/index/index/index')
  1071 + }
1052 } 1072 }
1053 }); 1073 });
1054 } 1074 }
packageC/pages/presell/goodsInfo/goodsInfo.js
@@ -761,34 +761,54 @@ Page({ @@ -761,34 +761,54 @@ Page({
761 success: function (t) { 761 success: function (t) {
762 console.log(t); 762 console.log(t);
763 if (t.data.code == 0) { 763 if (t.data.code == 0) {
  764 +
  765 + var p_fail=0;
  766 +
764 if (t.data.data.is_on_sale != 1) { 767 if (t.data.data.is_on_sale != 1) {
  768 +
  769 + p_fail=1;
765 wx.showModal({ 770 wx.showModal({
766 title: '商品已经下架', 771 title: '商品已经下架',
767 showCancel: !1, 772 showCancel: !1,
768 complete: function () { 773 complete: function () {
769 - wx.navigateBack(); 774 + let pages = getCurrentPages();
  775 + if (pages[pages.length - 2]) {
  776 + wx.navigateBack();
  777 + } else {
  778 + getApp().goto('/pages/index/index/index')
  779 + }
770 } 780 }
771 }); 781 });
772 } 782 }
773 var timestamp = Date.parse(new Date()); 783 var timestamp = Date.parse(new Date());
774 timestamp = timestamp / 1000; 784 timestamp = timestamp / 1000;
775 - if (t.data.data.on_time > timestamp) { 785 + if (t.data.data.on_time > timestamp && !p_fail) {
776 wx.showModal({ 786 wx.showModal({
777 title: '商品还未上架', 787 title: '商品还未上架',
778 showCancel: !1, 788 showCancel: !1,
779 complete: function () { 789 complete: function () {
780 - wx.navigateBack(); 790 + let pages = getCurrentPages();
  791 + if (pages[pages.length - 2]) {
  792 + wx.navigateBack();
  793 + } else {
  794 + getApp().goto('/pages/index/index/index')
  795 + }
781 } 796 }
782 }); 797 });
783 } 798 }
784 799
785 - if (t.data.data.down_time > 0) { 800 + if (t.data.data.down_time > 0 && !p_fail) {
786 if (t.data.data.down_time < timestamp) { 801 if (t.data.data.down_time < timestamp) {
787 wx.showModal({ 802 wx.showModal({
788 title: '商品已经到期下架', 803 title: '商品已经到期下架',
789 showCancel: !1, 804 showCancel: !1,
790 complete: function () { 805 complete: function () {
791 - wx.navigateBack(); 806 + let pages = getCurrentPages();
  807 + if (pages[pages.length - 2]) {
  808 + wx.navigateBack();
  809 + } else {
  810 + getApp().goto('/pages/index/index/index')
  811 + }
792 } 812 }
793 }); 813 });
794 } 814 }
pages/goods/goodsInfo/goodsInfo.js
@@ -1020,32 +1020,47 @@ Page({ @@ -1020,32 +1020,47 @@ Page({
1020 t.data.data.prom_type = 0 1020 t.data.data.prom_type = 0
1021 } 1021 }
1022 } 1022 }
1023 - if (t.data.data.is_on_sale != 1) { 1023 +
  1024 + var p_fail=0;
  1025 +
  1026 + if (t.data.data.is_on_sale != 1 ) {
  1027 + p_fail=1;
1024 wx.showModal({ 1028 wx.showModal({
1025 title: '商品已经下架', 1029 title: '商品已经下架',
1026 showCancel: !1, 1030 showCancel: !1,
1027 complete: function () { 1031 complete: function () {
1028 - wx.navigateBack(); 1032 + let pages = getCurrentPages();
  1033 + if (pages[pages.length - 2]) {
  1034 + wx.navigateBack();
  1035 + } else {
  1036 + getApp().goto('/pages/index/index/index')
  1037 + }
1029 } 1038 }
1030 }); 1039 });
  1040 +
1031 } 1041 }
1032 1042
1033 ee.init(gid); 1043 ee.init(gid);
1034 1044
1035 var timestamp = Date.parse(new Date()); 1045 var timestamp = Date.parse(new Date());
1036 timestamp = timestamp / 1000; 1046 timestamp = timestamp / 1000;
1037 - if (t.data.data.on_time > timestamp) { 1047 + if (t.data.data.on_time > timestamp && !p_fail) {
1038 wx.showModal({ 1048 wx.showModal({
1039 title: '商品还未上架', 1049 title: '商品还未上架',
1040 showCancel: !1, 1050 showCancel: !1,
1041 complete: function () { 1051 complete: function () {
1042 - wx.navigateBack(); 1052 + let pages = getCurrentPages();
  1053 + if (pages[pages.length - 2]) {
  1054 + wx.navigateBack();
  1055 + } else {
  1056 + getApp().goto('/pages/index/index/index')
  1057 + }
1043 } 1058 }
1044 }); 1059 });
1045 } 1060 }
1046 1061
1047 - if (t.data.data.down_time > 0) {  
1048 - if (t.data.data.down_time < timestamp) { 1062 + if (t.data.data.down_time > 0 && !p_fail) {
  1063 + if (t.data.data.down_time < timestamp ) {
1049 wx.showModal({ 1064 wx.showModal({
1050 title: '商品已经到期下架', 1065 title: '商品已经到期下架',
1051 showCancel: !1, 1066 showCancel: !1,
@@ -3927,7 +3942,10 @@ Page({ @@ -3927,7 +3942,10 @@ Page({
3927 //------------处理门店--------------- 3942 //------------处理门店---------------
3928 deal_pickup(e) { 3943 deal_pickup(e) {
3929 var th = this; 3944 var th = this;
3930 - if (!th.data.sele_g) return false 3945 + if (!th.data.sele_g){
  3946 + wx.hideLoading();
  3947 + return false
  3948 + }
3931 3949
3932 var g_distr_type = th.data.sele_g.distr_type; 3950 var g_distr_type = th.data.sele_g.distr_type;
3933 wx.hideLoading(); 3951 wx.hideLoading();
@@ -4127,7 +4145,10 @@ Page({ @@ -4127,7 +4145,10 @@ Page({
4127 deal_pickup_dline(e) { 4145 deal_pickup_dline(e) {
4128 var pkno = [], 4146 var pkno = [],
4129 th = this; 4147 th = this;
4130 - if (!th.data.sele_g) return false; 4148 + if (!th.data.sele_g){
  4149 + wx.hideLoading();
  4150 + return false;
  4151 + }
4131 4152
4132 if (this.data.def_pick_store) { 4153 if (this.data.def_pick_store) {
4133 pkno.push(this.data.def_pick_store.pickup_no); 4154 pkno.push(this.data.def_pick_store.pickup_no);
@@ -4601,7 +4622,7 @@ Page({ @@ -4601,7 +4622,7 @@ Page({
4601 //拿取价格并且判断时间-- 4622 //拿取价格并且判断时间--
4602 getApp().request.get("/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + prom_id, { 4623 getApp().request.get("/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + prom_id, {
4603 success: function (t) { 4624 success: function (t) {
4604 - if (t.data.code != 0) { 4625 + if (t.data.code != 0 || !t.data.data) {
4605 ee.get_normal(gid); 4626 ee.get_normal(gid);
4606 return false; 4627 return false;
4607 } 4628 }
@@ -8120,6 +8141,9 @@ Page({ @@ -8120,6 +8141,9 @@ Page({
8120 if (this.check_prom_custom(1) !== 3) { 8141 if (this.check_prom_custom(1) !== 3) {
8121 return false; 8142 return false;
8122 } 8143 }
  8144 +
  8145 + if(!this.data.sele_g) return false;
  8146 +
8123 var per_price = this.data.sele_g.shop_price 8147 var per_price = this.data.sele_g.shop_price
8124 if (this.data.card_field && this.data.sele_g[this.data.card_field] > 0) { 8148 if (this.data.card_field && this.data.sele_g[this.data.card_field] > 0) {
8125 per_price = this.data.sele_g[this.data.card_field]; 8149 per_price = this.data.sele_g[this.data.card_field];