Commit a069cd42757458cd50271de492a16c3d970ce4c1

Authored by season
2 parents a713a241 e1edd79a

Merge branch 'qa' of http://git.vipzhuang.cn/wxd/MShopWeApp

... ... @@ -107,59 +107,59 @@ App({
107 107  
108 108 var app = this;
109 109 if (!app.globalData.userInfo) {
110   - var user = wx.getStorageSync("userinfo");
111   - if (user && user.user_id) {
112   -
113   - //--生成会员 --
114   - app.promiseGet("/api/weshop/users/get/" + user.store_id + "/" + user.user_id, {}).then(res => {
115   -
116   - app.globalData.is_get_login=1;
117   -
118   - if (res.data.code == 0) {
119   -
120   - user = res.data.data;
121   - //-- 小程序会员被解绑了,就要清空会员 --
122   - if (user['is_weappuser'] == 0) {
123   - user = null;
124   - app.globalData.userInfo = null;
125   - app.globalData.user_id = 0;
126   - } else {
127   - app.globalData.userInfo = user;
128   - app.globalData.user_id = user.user_id;
129   -
130   - //调用接口判断是不是会员
131   - app.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + user.user_id, {}).then(res => {
132   - if (res.data.code == 0) {
133   - getApp().globalData.guide_id = res.data.data.id;
134   - }
135   - })
136   - app.promiseGet("/api/weshop/users/getAndUpdateUser/" +user.store_id + "/" + user.user_id, {})
137   -
138   - }
139   - wx.setStorageSync("userinfo", user);
140   - } else {
141   - user = null;
142   - app.globalData.userInfo = null;
143   - app.globalData.user_id = 0;
144   - wx.setStorageSync("userinfo", null);
145   - }
146   - })
147   - }
148   - else if(app.globalData.user_id){ //-- 启用默认的user_id --
149   -
150   - app.promiseGet("/api/weshop/users/get/" + app.globalData.setting.stoid + "/" + app.globalData.user_id,{}).then(res=>{
151   - app.globalData.is_get_login=1;
152   - if(res.data.code==0){
153   - app.globalData.userInfo = res.data.data;
154   - wx.setStorageSync("userinfo",app.globalData.userInfo);
155   - //刷一下导购
156   - app.promiseGet("/api/weshop/users/getAndUpdateUser/" +app.globalData.setting.stoid + "/" + app.globalData.user_id, {})
157   - }
158   - })
159   - }
160   - else {
161   - //--拿下code--
162   - wx.login({
  110 + // var user = wx.getStorageSync("userinfo");
  111 + // if (user && user.user_id) {
  112 + //
  113 + // //--生成会员 --
  114 + // app.promiseGet("/api/weshop/users/get/" + user.store_id + "/" + user.user_id, {}).then(res => {
  115 + //
  116 + // app.globalData.is_get_login=1;
  117 + //
  118 + // if (res.data.code == 0) {
  119 + //
  120 + // user = res.data.data;
  121 + // //-- 小程序会员被解绑了,就要清空会员 --
  122 + // if (user['is_weappuser'] == 0) {
  123 + // user = null;
  124 + // app.globalData.userInfo = null;
  125 + // app.globalData.user_id = 0;
  126 + // } else {
  127 + // app.globalData.userInfo = user;
  128 + // app.globalData.user_id = user.user_id;
  129 + //
  130 + // //调用接口判断是不是会员
  131 + // app.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + user.user_id, {}).then(res => {
  132 + // if (res.data.code == 0) {
  133 + // getApp().globalData.guide_id = res.data.data.id;
  134 + // }
  135 + // })
  136 + // app.promiseGet("/api/weshop/users/getAndUpdateUser/" +user.store_id + "/" + user.user_id, {})
  137 + //
  138 + // }
  139 + // wx.setStorageSync("userinfo", user);
  140 + // } else {
  141 + // user = null;
  142 + // app.globalData.userInfo = null;
  143 + // app.globalData.user_id = 0;
  144 + // wx.setStorageSync("userinfo", null);
  145 + // }
  146 + // })
  147 + // }
  148 + // else if(app.globalData.user_id){ //-- 启用默认的user_id --
  149 + //
  150 + // app.promiseGet("/api/weshop/users/get/" + app.globalData.setting.stoid + "/" + app.globalData.user_id,{}).then(res=>{
  151 + // app.globalData.is_get_login=1;
  152 + // if(res.data.code==0){
  153 + // app.globalData.userInfo = res.data.data;
  154 + // wx.setStorageSync("userinfo",app.globalData.userInfo);
  155 + // //刷一下导购
  156 + // app.promiseGet("/api/weshop/users/getAndUpdateUser/" +app.globalData.setting.stoid + "/" + app.globalData.user_id, {})
  157 + // }
  158 + // })
  159 + // }
  160 + // else {
  161 + //--拿下code--
  162 + wx.login({
163 163 success: function (o) {
164 164 var dd = {
165 165 js_code: o.code,
... ... @@ -186,7 +186,8 @@ App({
186 186 app.globalData.openid = e.data.data.weapp_openid;
187 187 //把会员的信息存在内存
188 188 wx.setStorageSync("userinfo", e.data.data);
189   -
  189 + //刷一下导购
  190 + app.promiseGet("/api/weshop/users/getAndUpdateUser/" +app.globalData.setting.stoid + "/" + app.globalData.user_id, {})
190 191 //调用接口判断是不是会员
191 192 app.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + e.data.data.user_id, {}).then(res => {
192 193 if (res.data.code == 0) {
... ... @@ -202,7 +203,7 @@ App({
202 203 })
203 204 }
204 205 })
205   - }
  206 + //}
206 207  
207 208  
208 209 }
... ...
packageA/pages/profile/profile.js
... ... @@ -79,6 +79,11 @@ Page({
79 79 loading: 0,
80 80 oldBirtthDayLength:0, //生日日期个数
81 81 oldbirthday:'',//生日日期
  82 +
  83 + all_pick_list:null, //所有的门店的集合
  84 + old_all_sto:null,
  85 + keyword:'', //搜索门店的关键字
  86 + sec_i:-1
82 87 },
83 88 //通过路径跳转到其他页面
84 89 goto: function (e) {
... ... @@ -267,8 +272,8 @@ Page({
267 272 if (e.data.code == 0 && e.data.data && e.data.data.pageData && e.data.data.pageData.length > 0) {
268 273  
269 274 var ishas_cate = 0;
270   - for (let i in e) {
271   - let item = e[i];
  275 + for (let i in e.data.data.pageData) {
  276 + let item = e.data.data.pageData[i];
272 277 if (item.category_id > 0) {
273 278 ishas_cate = 1;
274 279 break;
... ... @@ -286,6 +291,10 @@ Page({
286 291 e.data.data.pageData.splice(0, 0, th.data.def_pick_store); //添加
287 292 }
288 293  
  294 + th.setData({
  295 + all_pick_list: e.data.data.pageData
  296 + });
  297 +
289 298 //单总量超出5个的时候
290 299 if (e.data.data.total > 10 && ishas_cate) {
291 300 i.get("/api/weshop/storagecategory/page", {
... ... @@ -465,7 +474,8 @@ Page({
465 474 sort_store: 0,
466 475 choice_sort_store: 1,
467 476 sec_sto: item,
468   - sec_pick_index: 0
  477 + sec_pick_index: 0,
  478 + sec_i: index,
469 479 });
470 480 },
471 481 // 返回按钮
... ... @@ -1547,5 +1557,106 @@ Page({
1547 1557 })
1548 1558 },
1549 1559  
  1560 + //获取搜索门店输入的值
  1561 + input_store: function (e) {
  1562 + this.setData({
  1563 + keyword: e.detail.value
  1564 + })
  1565 + },
  1566 +
  1567 + //搜索门店
  1568 + searchfn() {
  1569 + let choice_sort_store = this.data.choice_sort_store
  1570 + if (choice_sort_store == 0) { //全局搜索
  1571 + let all_pick_list = this.data.all_pick_list
  1572 + let def_pickpu_list = this.data.def_pickpu_list
  1573 + let keyword = this.data.keyword
  1574 + if (keyword) {
  1575 + let arr = all_pick_list.filter(item => {
  1576 + let i = item.pickup_name.indexOf(keyword)
  1577 + if (i > -1) {
  1578 + return true
  1579 + } else {
  1580 + return false
  1581 + }
  1582 + })
  1583 + if (arr && arr.length > 0) {
  1584 + if (this.data.is_show_sto_cat == 1) {
  1585 + this.setData({
  1586 + def_pickpu_list: arr
  1587 + })
  1588 + } else {
  1589 + this.setData({
  1590 + only_pk: arr
  1591 + })
  1592 + }
  1593 + } else {
  1594 + wx.showToast({
  1595 + title: '没有搜索到门店',
  1596 + icon: 'none',
  1597 + duration: 2000
  1598 + })
  1599 + }
  1600 + } else {
  1601 + if (this.data.is_show_sto_cat == 1) {
  1602 + this.setData({
  1603 + def_pickpu_list: all_pick_list.slice(0, 10)
  1604 + })
  1605 + } else {
  1606 + this.setData({
  1607 + only_pk: all_pick_list
  1608 + })
  1609 + }
  1610 +
  1611 + }
  1612 + } else { //分类下搜索
  1613 + let sec_i = this.data.sec_i
  1614 + let all_sto = this.data.all_sto
  1615 + let old_all_sto = this.data.old_all_sto
  1616 + if (!old_all_sto) {
  1617 + this.setData({
  1618 + old_all_sto:JSON.parse(JSON.stringify(all_sto))
  1619 + })
  1620 + }
  1621 + let sec_sto = this.data.sec_sto
  1622 + let sec_arr = this.data.old_all_sto[sec_i].s_arr
  1623 + let keyword = this.data.keyword
  1624 + let text = 'sec_sto.s_arr'
  1625 + if (keyword) {
  1626 + let arr = sec_arr.filter(item => {
  1627 + let i = item.pickup_name.indexOf(keyword)
  1628 + if (i > -1) {
  1629 + return true
  1630 + } else {
  1631 + return false
  1632 + }
  1633 + })
  1634 + if (arr && arr.length > 0) {
  1635 + this.setData({
  1636 + [text]: arr
  1637 + })
  1638 + } else {
  1639 + wx.showToast({
  1640 + title: '没有搜索到门店',
  1641 + icon: 'none',
  1642 + duration: 2000
  1643 + })
  1644 + }
  1645 + } else {
  1646 + if(this.data.old_all_sto){
  1647 + this.setData({
  1648 + [text]: this.data.old_all_sto[sec_i].s_arr
  1649 + })
  1650 + }else{
  1651 + this.setData({
  1652 + [text]: all_sto[sec_i].s_arr
  1653 + })
  1654 + }
  1655 + }
  1656 +
  1657 +
  1658 + }
  1659 + },
  1660 +
1550 1661  
1551 1662 });
1552 1663 \ No newline at end of file
... ...
packageA/pages/profile/profile.wxml
... ... @@ -232,6 +232,14 @@
232 232 </view>
233 233 </view>
234 234 </view>
  235 +
  236 + <view class="searchbar flex-vertical-between storeListpadd">
  237 + <input class="inputstore fs28" placeholder="输入要搜索的门店" value="{{keyword}}" placeholder-class="fs28" maxlength="16" bindinput="input_store" bindconfirm="searchfn" />
  238 + <view class="search flex-center" bindtap="searchfn">
  239 + <view class="fs28">搜索</view>
  240 + </view>
  241 + </view>
  242 +
235 243 <!-- 门店列表,最外层的门店列表,一开始 -->
236 244 <view class="store-list">
237 245 <!--如果还没有点击更多门店的时候 -->
... ...
packageA/pages/profile/profile.wxss
... ... @@ -723,3 +723,28 @@ checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
723 723 content: '*';
724 724 color: #C4182E;
725 725 }
  726 +
  727 +
  728 +.searchbar {
  729 + height: 95rpx;
  730 + border-bottom: 2rpx solid rgb(238, 238, 238);
  731 +}
  732 +.storeListpadd {
  733 + padding: 0rpx 31rpx;
  734 +}
  735 +.search {
  736 + width: 125rpx;
  737 + height: 45rpx;
  738 + line-height: 45rpx;
  739 + background-color: rgb(219, 27, 52);
  740 + border-radius: 30rpx;
  741 + color: rgb(255, 255, 255);
  742 +}
  743 +.inputstore {
  744 + width: 510rpx;
  745 + height: 43rpx;
  746 + line-height: 43rpx;
  747 + border-radius: 30rpx;
  748 + border: 2rpx solid rgb(238, 238, 238);
  749 + padding-left: 30rpx;
  750 +}
726 751 \ No newline at end of file
... ...
packageE/pages/cart/cart2/cart2.js
... ... @@ -186,6 +186,7 @@ Page({
186 186 can_use_ord_prom: {},
187 187 //存储订单促销的取价,按照门店进行索引
188 188 show_ord_prom: {},
  189 +
189 190 sameCityExp_off: 0, //未达到起送价
190 191 sameCityExp_info: '',//未达到起送价提示信息
191 192 first_entry: 0,//进入次数,如果是第一次进入,进行判断是否进行优惠券是否直接使用
... ... @@ -1001,6 +1002,8 @@ Page({
1001 1002 var new_arr = [];
1002 1003 for (var ir = 0; ir < carr.length; ir++) {
1003 1004  
  1005 + carr[ir].collocationList = null;
  1006 +
1004 1007 var c_ok = 1;
1005 1008 if (old_prom && (carr[ir].prom_type != old_prom.prom_type || carr[ir].prom_id != old_prom.prom_id)) {
1006 1009 c_ok = 0;
... ... @@ -1075,11 +1078,6 @@ Page({
1075 1078 }
1076 1079  
1077 1080 }
1078   -
1079   -
1080   - if (is_change) {
1081   - carr[iv].collocationList = null;
1082   - }
1083 1081 }
1084 1082 //-- 对商品的多促销进行判断 ---2024-2-1--
1085 1083 if (dug_cx_arr.length) {
... ... @@ -5614,6 +5612,21 @@ Page({
5614 5612 goods.prom_id = g_item.prom_id;
5615 5613 break;
5616 5614 case 3:
  5615 +
  5616 + //判断一个优惠促销商品用户参与的问题
  5617 + let grs= await getApp().request.promiseGet("/api/weshop/promgoods/getUser/" + oo.stoid + "/" + g_item.prom_id+"/"+ getApp().globalData.user_id, {});
  5618 + if(!grs || grs.data.code==-1){
  5619 + let error_ts=goods.goods_name + "未找到优惠促销活动";
  5620 + if(grs && grs.data.msg.indexOf('无权限')>-1){
  5621 + error_ts=goods.goods_name + "无权限参与优惠促销活动";
  5622 + }
  5623 +
  5624 + getApp().confirmBox(error_ts);
  5625 + th.data.is_summit_ing = 0;
  5626 + th.setData({ submit: 0 })
  5627 + return false;
  5628 + }
  5629 +
5617 5630 goods.prom_type = 3;
5618 5631 goods.prom_id = g_item.prom_id;
5619 5632 if (g_item.is_gift) {
... ...
packageG/pages/user/userinfo/userinfo.js
... ... @@ -81,6 +81,10 @@ Page({
81 81  
82 82 showvipcode:false,
83 83  
  84 + all_pick_list:null, //所有的门店的集合
  85 + old_all_sto:null,
  86 + keyword:'', //搜索门店的关键字
  87 + sec_i:-1
84 88 },
85 89 //通过路径跳转到其他页面
86 90 goto: function(e) {
... ... @@ -350,6 +354,11 @@ Page({
350 354 }
351 355 e.data.data.pageData.splice(0, 0, th.data.def_pick_store); //添加
352 356 }
  357 +
  358 +
  359 + th.setData({
  360 + all_pick_list: e.data.data.pageData
  361 + });
353 362  
354 363 //单总量超出5个的时候
355 364 if (e.data.data.total > 10) {
... ... @@ -527,7 +536,8 @@ Page({
527 536 sort_store: 0,
528 537 choice_sort_store: 1,
529 538 sec_sto: item,
530   - sec_pick_index: 0
  539 + sec_pick_index: 0,
  540 + sec_i: index,
531 541 });
532 542 },
533 543 // 返回按钮
... ... @@ -1111,7 +1121,108 @@ Page({
1111 1121 }
1112 1122 }
1113 1123 });
1114   - }
  1124 + },
  1125 +
  1126 + //获取搜索门店输入的值
  1127 + input_store: function (e) {
  1128 + this.setData({
  1129 + keyword: e.detail.value
  1130 + })
  1131 + },
  1132 +
  1133 + //搜索门店
  1134 + searchfn() {
  1135 + let choice_sort_store = this.data.choice_sort_store
  1136 + if (choice_sort_store == 0) { //全局搜索
  1137 + let all_pick_list = this.data.all_pick_list
  1138 + let def_pickpu_list = this.data.def_pickpu_list
  1139 + let keyword = this.data.keyword
  1140 + if (keyword) {
  1141 + let arr = all_pick_list.filter(item => {
  1142 + let i = item.pickup_name.indexOf(keyword)
  1143 + if (i > -1) {
  1144 + return true
  1145 + } else {
  1146 + return false
  1147 + }
  1148 + })
  1149 + if (arr && arr.length > 0) {
  1150 + if (this.data.is_show_sto_cat == 1) {
  1151 + this.setData({
  1152 + def_pickpu_list: arr
  1153 + })
  1154 + } else {
  1155 + this.setData({
  1156 + only_pk: arr
  1157 + })
  1158 + }
  1159 + } else {
  1160 + wx.showToast({
  1161 + title: '没有搜索到门店',
  1162 + icon: 'none',
  1163 + duration: 2000
  1164 + })
  1165 + }
  1166 + } else {
  1167 + if (this.data.is_show_sto_cat == 1) {
  1168 + this.setData({
  1169 + def_pickpu_list: all_pick_list.slice(0, 10)
  1170 + })
  1171 + } else {
  1172 + this.setData({
  1173 + only_pk: all_pick_list
  1174 + })
  1175 + }
  1176 +
  1177 + }
  1178 + } else { //分类下搜索
  1179 + let sec_i = this.data.sec_i
  1180 + let all_sto = this.data.all_sto
  1181 + let old_all_sto = this.data.old_all_sto
  1182 + if (!old_all_sto) {
  1183 + this.setData({
  1184 + old_all_sto:JSON.parse(JSON.stringify(all_sto))
  1185 + })
  1186 + }
  1187 + let sec_sto = this.data.sec_sto
  1188 + let sec_arr = this.data.old_all_sto[sec_i].s_arr
  1189 + let keyword = this.data.keyword
  1190 + let text = 'sec_sto.s_arr'
  1191 + if (keyword) {
  1192 + let arr = sec_arr.filter(item => {
  1193 + let i = item.pickup_name.indexOf(keyword)
  1194 + if (i > -1) {
  1195 + return true
  1196 + } else {
  1197 + return false
  1198 + }
  1199 + })
  1200 + if (arr && arr.length > 0) {
  1201 + this.setData({
  1202 + [text]: arr
  1203 + })
  1204 + } else {
  1205 + wx.showToast({
  1206 + title: '没有搜索到门店',
  1207 + icon: 'none',
  1208 + duration: 2000
  1209 + })
  1210 + }
  1211 + } else {
  1212 + if(this.data.old_all_sto){
  1213 + this.setData({
  1214 + [text]: this.data.old_all_sto[sec_i].s_arr
  1215 + })
  1216 + }else{
  1217 + this.setData({
  1218 + [text]: all_sto[sec_i].s_arr
  1219 + })
  1220 + }
  1221 + }
  1222 +
  1223 +
  1224 + }
  1225 + },
1115 1226  
1116 1227  
1117 1228 });
1118 1229 \ No newline at end of file
... ...
packageG/pages/user/userinfo/userinfo.wxml
... ... @@ -344,6 +344,14 @@
344 344 </view>
345 345 </view>
346 346 </view>
  347 +
  348 + <view class="searchbar flex-vertical-between storeListpadd">
  349 + <input class="inputstore fs28" placeholder="输入要搜索的门店" value="{{keyword}}" placeholder-class="fs28" maxlength="16" bindinput="input_store" bindconfirm="searchfn" />
  350 + <view class="search flex-center" bindtap="searchfn">
  351 + <view class="fs28">搜索</view>
  352 + </view>
  353 + </view>
  354 +
347 355 <!-- 门店列表,最外层的门店列表,一开始 -->
348 356 <view class="store-list">
349 357 <!--如果还没有点击更多门店的时候 -->
... ...
packageG/pages/user/userinfo/userinfo.wxss
... ... @@ -674,4 +674,29 @@ input {
674 674 align-items: center;
675 675 justify-content: center;
676 676 /* margin-top: 20rpx; */
  677 +}
  678 +
  679 +
  680 +.searchbar {
  681 + height: 95rpx;
  682 + border-bottom: 2rpx solid rgb(238, 238, 238);
  683 +}
  684 +.storeListpadd {
  685 + padding: 0rpx 31rpx;
  686 +}
  687 +.search {
  688 + width: 125rpx;
  689 + height: 45rpx;
  690 + line-height: 45rpx;
  691 + background-color: rgb(219, 27, 52);
  692 + border-radius: 30rpx;
  693 + color: rgb(255, 255, 255);
  694 +}
  695 +.inputstore {
  696 + width: 510rpx;
  697 + height: 43rpx;
  698 + line-height: 43rpx;
  699 + border-radius: 30rpx;
  700 + border: 2rpx solid rgb(238, 238, 238);
  701 + padding-left: 30rpx;
677 702 }
678 703 \ No newline at end of file
... ...
pages/activity/pind_list/pind_list.js
... ... @@ -120,25 +120,50 @@ Page({
120 120 var o = endTimeList[i];
121 121 var endTime = o.end_time;
122 122 if(th.data.type==0) endTime = o.start_time;
123   - let obj = null;
124   - // 如果活动未结束,对时间进行处理
125   - if (endTime - newTime > 0){
126   - let time = (endTime - newTime);
127   - // 获取天、时、分、秒
128   - let day = parseInt(time / (60 * 60 * 24));
129   - let hou = parseInt(time % (60 * 60 * 24) / 3600);
130   - let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
131   - let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
132   - obj = {
133   - day: this.timeFormat(day), hou: this.timeFormat(hou), min: this.timeFormat(min), sec: this.timeFormat(sec),hide:1
  123 +
  124 + // 创建查询对象
  125 + let query = wx.createSelectorQuery();
  126 + // 获取目标元素,并获取目标元素的信息
  127 + query.select("#kill-item"+i).boundingClientRect();
  128 + // 获取视口,并获取视口信息
  129 + query.selectViewport().boundingClientRect();
  130 + //-- 执行查询,元素要在显示中的才显示定时器 --
  131 + query.exec(([target, view]) => {
  132 +
  133 + if (!th.data.is_timer) return;
  134 + if (!target) return;
  135 + if (!target.id) return;
  136 + let idx= target.id.replace('kill-item','');
  137 + // 条件1:当目标顶部距离视口顶部距离小于视口的高度时
  138 + // 条件2:当目标底部距离视口顶部距离大于0时
  139 + // 当以上两个条件同时成立时,目标元素在视口中
  140 + if (target.top < view.height && target.bottom > 0) {
  141 +
  142 + let obj = null;
  143 + // 如果活动未结束,对时间进行处理
  144 + if (endTime - newTime > 0) {
  145 + let time = (endTime - newTime);
  146 + // 获取天、时、分、秒
  147 + let day = parseInt(time / (60 * 60 * 24));
  148 + let hou = parseInt(time % (60 * 60 * 24) / 3600);
  149 + let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
  150 + let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
  151 + obj = {
  152 + day: this.timeFormat(day),
  153 + hou: this.timeFormat(hou),
  154 + min: this.timeFormat(min),
  155 + sec: this.timeFormat(sec),
  156 + hide: 1
  157 + }
  158 + } else {
  159 + //活动已结束,全部设置为'00'
  160 + obj = {day: '00', hou: '00', min: '00', sec: '00'}
134 161 }
135   - }else{
136   - //活动已结束,全部设置为'00'
137   - obj = { day: '00', hou: '00', min: '00', sec: '00' }
138   - }
139   - var txt ="goodlist["+i+"].djs";
140   - th.setData({ [txt]: obj});
141   - }
  162 + var txt = "goodlist[" + idx + "].djs";
  163 + th.setData({[txt]: obj});
  164 + }
  165 + });
  166 + }
142 167 },
143 168  
144 169 //读取数据
... ...
pages/activity/pind_list/pind_list.wxml
... ... @@ -28,7 +28,7 @@
28 28  
29 29  
30 30 <view class="kill-list">
31   - <view class="kill-item" wx:for="{{goodlist}}" wx:if="{{item.djs.hide==1}}">
  31 + <view id="kill-item{{index}}" class="kill-item" wx:for="{{goodlist}}" >
32 32 <navigator class="kill-pic " url="{{!item.goods_type ? ('/pages/goods/goodsInfo/goodsInfo?prom_type=6&goods_id=' + item.goods_id+ '&prom_id=' + item.id):('/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo?prom_type=6&goods_id=' + item.goods_id + '&prom_id=' + item.id)}}">
33 33 <image class="wh100" src="{{url}}{{item.original_img}}" data-val="{{item.original_img}}"
34 34 data-errorimg="goodlist[{{index}}].original_img" binderror="bind_bnerr2" lazy-load="true"></image>
... ...
pages/cart/cart/cart.js
... ... @@ -497,7 +497,6 @@ Page({
497 497 th.setData({
498 498 requestData: [],
499 499 all_num: 0,
500   - is_load: 1,
501 500 is_edit: 0,
502 501 checkAllToggle:0
503 502 }),wx.stopPullDownRefresh();
... ... @@ -1038,7 +1037,7 @@ Page({
1038 1037 //获取秒杀
1039 1038 if(item.prom_type==1) {
1040 1039 await getApp().request.promiseGet('/api/ms/flash_sale/getNew/' + os.stoid + '/' + user_id + '/' + item.prom_id, {}).then(res => {
1041   - if (res.data.code == 0) {
  1040 + if (res.data.code == 0 && res.data.data) {
1042 1041 prom = res.data.data;
1043 1042 prom.price = prom.user_price;
1044 1043 }
... ... @@ -1085,7 +1084,7 @@ Page({
1085 1084 }
1086 1085 })
1087 1086 }
1088   - if (msNum && (msNum >= prom.buy_limit)) {
  1087 + if (msNum && (msNum >= prom.buy_limit && prom.buy_limit>0)) {
1089 1088 console.log('秒杀限购')
1090 1089 th.disInvalid({
1091 1090 ...item,
... ... @@ -2102,7 +2101,7 @@ Page({
2102 2101 //判断多门店,优惠促销次数的控制
2103 2102 async multiple_stores_pro(pitems, item) {
2104 2103  
2105   - if(!this.data.requestData || !this.data.requestData[pitems]) return false
  2104 + if(!this.data.requestData || !this.data.requestData[pitems] || !this.data.requestData[pitems].goods) return false
2106 2105  
2107 2106 let a = this.data.requestData[pitems].goods[item];
2108 2107 let th = this
... ... @@ -2317,7 +2316,7 @@ Page({
2317 2316 // return false;
2318 2317 // }
2319 2318  
2320   - var txt0 = "requestData[" + pitems + "].show_can_cx";
  2319 + var txt0 = "requestData[" + pitems + "].show_can_cx1";
2321 2320 e.setData({
2322 2321 [txt0]: {},
2323 2322 });
... ... @@ -2348,6 +2347,7 @@ Page({
2348 2347 title: the_res.msg,
2349 2348 icon: 'none',
2350 2349 });
  2350 + th.clear_clicking();
2351 2351 }
2352 2352 })
2353 2353  
... ... @@ -2624,7 +2624,6 @@ Page({
2624 2624 [txt]: prom_goodsbuynum
2625 2625 });
2626 2626  
2627   -
2628 2627 }
2629 2628 }
2630 2629 if (item[c].prom_type == 10) {
... ... @@ -2702,11 +2701,6 @@ Page({
2702 2701  
2703 2702  
2704 2703  
2705   -
2706   -
2707   -
2708   -
2709   -
2710 2704 //总的价格,把组合商品的价格拿出来
2711 2705 var zh_calc_res = zh_calc.calculate_zh(car, a, th);
2712 2706 console.log('.组合价-----------')
... ... @@ -3179,7 +3173,7 @@ Page({
3179 3173 var buylimit = 0
3180 3174 if(t.prom_type==1) {
3181 3175 await getApp().request.promiseGet("/api/ms/flash_sale/getNew/" + t.store_id + "/" + getApp().globalData.user_id + "/" + t.prom_id, {}).then(res => {
3182   - if (res.data.code == 0) {
  3176 + if (res.data.code == 0 && res.data.data) {
3183 3177 th.data.sele_g = res.data.data;
3184 3178 th.data.sele_g.viplimited = res.data.data.buy_limit;
3185 3179 buylimit = !res.data.data.buy_limit ? 0 : res.data.data.buy_limit;
... ... @@ -3812,6 +3806,7 @@ Page({
3812 3806 var et= {"prom_type":i_arr[j].prom_type,"prom_id":i_arr[j].prom_id,"goods_id":i_arr[j].goods_id};
3813 3807 glist.push(et);
3814 3808 }
  3809 +
3815 3810 ab = 1;
3816 3811  
3817 3812 //-- 获取促销活动是不是有参与 --
... ... @@ -4278,7 +4273,6 @@ Page({
4278 4273 var ky=val.goods_id + "-"+val.prom_type + "-"+val.prom_id;
4279 4274 var obj = map_limit.get(ky);
4280 4275 if (obj){
4281   - obj.g_num+=val.goods_num;
4282 4276 continue;
4283 4277 }
4284 4278 var promgoodsbuynum =val.promgoodsbuynum || 0;
... ... @@ -4293,8 +4287,7 @@ Page({
4293 4287 //try {
4294 4288 for (var ind in ddata) {
4295 4289 var val = ddata[ind];
4296   - var num = map.get(val.goods_id + "");
4297   -
  4290 +
4298 4291 var ky=val.goods_id + "-"+val.prom_type + "-"+val.prom_id;
4299 4292 var ky2=val.prom_type + "-"+val.prom_id;
4300 4293  
... ... @@ -4313,7 +4306,7 @@ Page({
4313 4306  
4314 4307 if (val.prom_type == 1 || val.prom_type == 2) {
4315 4308 var s_num=num;
4316   - if(th.data.sales_rules> 1) s_num=buyed;
  4309 + //if(th.data.sales_rules> 1) s_num=buyed;
4317 4310 if (s_num > val.store_count) {
4318 4311 isok = 0;
4319 4312 gname = val.goods_name;
... ... @@ -4328,7 +4321,7 @@ Page({
4328 4321 break;
4329 4322 }
4330 4323  
4331   - if(cur_buyed && buyed.g_num > val.goods_num - val.buy_num && val.goods_num) {
  4324 + if(cur_buyed && cur_buyed.g_num > val.goods_num - val.buy_num && val.goods_num) {
4332 4325 isok = 0;
4333 4326 gname = val.goods_name;
4334 4327 err="超出活动库存";
... ...
pages/goods/goodsInfo/goodsInfo.js
... ... @@ -403,8 +403,8 @@ Page({
403 403  
404 404 //判断活动
405 405 if (prom_type) {
406   - this.data.prom_type = prom_type;
407   - this.data.prom_id = prom_id;
  406 + this.data.prom_type = parseInt(prom_type);
  407 + this.data.prom_id = parseInt(prom_id);
408 408  
409 409 //-- 基础的活动类型 --
410 410 this.data.base_nor_prom_type = prom_type;
... ... @@ -5095,9 +5095,9 @@ Page({
5095 5095 if (em.data.data <= 0) ee.setData({
5096 5096 prom_r_null: 1
5097 5097 });
5098   - //拿取价格并且判断时间--
5099   - getApp().request.get("/api/weshop/teamlist/get/" +
5100   - os.stoid + "/" + prom_id, {
  5098 + //拿取价格并且判断时间,并判断会员的身分--
  5099 + getApp().request.get("/api/weshop/teamlist/getUser/" +
  5100 + os.stoid + "/" + prom_id+"/"+getApp().globalData.user_id, {
5101 5101 success: async function (t) {
5102 5102 if (t.data.code != 0) {
5103 5103 ee.get_normal(gid);
... ... @@ -5140,27 +5140,27 @@ Page({
5140 5140 }
5141 5141  
5142 5142 //判断拼团的---会员身份--
5143   - await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/2", {
5144   - data: {
5145   - store_id: os.stoid,
5146   - is_end: 0,
5147   - is_show: 1,
5148   - user_id: getApp().globalData.user_id,
5149   - pageSize: 1000
5150   - }
5151   - }).then(res => {
5152   - let pd_list = res.data.data.pageData;
5153   - if (res.data.code == 0 && pd_list.length > 0) {
5154   - flag = pd_list.some(pd => {
5155   - return pd.goods_id == gid
5156   - })
5157   - }
5158   - })
5159   - if (!flag) {
5160   - ee.get_normal(gid);
5161   - return false;
  5143 + // await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/2", {
  5144 + // data: {
  5145 + // store_id: os.stoid,
  5146 + // is_end: 0,
  5147 + // is_show: 1,
  5148 + // user_id: getApp().globalData.user_id,
  5149 + // pageSize: 1000
  5150 + // }
  5151 + // }).then(res => {
  5152 + // let pd_list = res.data.data.pageData;
  5153 + // if (res.data.code == 0 && pd_list.length > 0) {
  5154 + // flag = pd_list.some(pd => {
  5155 + // return pd.goods_id == gid
  5156 + // })
  5157 + // }
  5158 + // })
  5159 + // if (!flag) {
  5160 + // ee.get_normal(gid);
  5161 + // return false;
  5162 + // }
5162 5163  
5163   - }
5164 5164 //-------查看自己是不是有买过该团的商品,并还为支付,或者在进行中-------
5165 5165 await getApp().request.promiseGet("/api/weshop/order/page", {
5166 5166 data: {
... ... @@ -5770,7 +5770,7 @@ Page({
5770 5770 });
5771 5771  
5772 5772 // s.my_warnning('超出商品限购', 0, th);
5773   - var num = 0;//th.data.prom_buy_limit - th.data.prom_buy_num;
  5773 + var num = th.data.sele_g.viplimited - th.data.g_buy_num.get(th.data.sele_g.goods_id);
5774 5774 if (num <= 0) num = 1;
5775 5775 th.setData({
5776 5776 goodsInputNum: num
... ...
pages/goods/goodsList/goodsList.js
... ... @@ -45,9 +45,12 @@ Page({
45 45 gr_fir:0, //分组第一次
46 46 share_imgurl:'', //分享图片
47 47 add_purchase:false,
  48 +
  49 + pro_good:null, //优惠促销活动
  50 + pro_good_err:null, //优惠促销活动
48 51 },
49 52  
50   - onLoad: function(t) {
  53 + onLoad: async function(t) {
51 54 //----------商品分组自定义分享图片----------
52 55 if (t.gid || t.group_id) {
53 56 let id = t.gid || t.group_id
... ... @@ -75,31 +78,29 @@ Page({
75 78 var th=this;
76 79 var url = this.data.baseUrl;
77 80  
78   - //优惠活动的凑单
79   - if(t.prom_type==3){
80   - if (0 != t.prom_id && t.prom_id != undefined) { url += "&prom_id=" + t.prom_id; }
81   - if (0 != t.prom_type && t.prom_type != undefined) { url += "&prom_type=" + t.prom_type; }
82   - //-- 获取 --
83   - getApp().request.promiseGet("/api/weshop/promgoodslist/list",{
84   - data:{prom_id:t.prom_id }
85   - }).then(res=>{
86   - if(res.data.code==0){
87   - var arr= res.data.data;
88   - th.set_prom_list(arr);
89   - }
90   - })
91   - if (t.prom_id) {
92   - this.getprom(t.prom_id)
93   - }
94   - }
  81 + if (0 != t.prom_id && t.prom_id != undefined) { url += "&prom_id=" + t.prom_id; }
  82 + if (0 != t.prom_type && t.prom_type != undefined) { url += "&prom_type=" + t.prom_type; }
95 83  
96 84  
97 85 //先查看一下是不是系统会员
98   - getApp().waitfor_login(()=> {
  86 + getApp().waitfor_login(async ()=> {
99 87 if (!getApp().globalData.user_id) {
100 88 ut.new_user_go(oo.stoid, first_leader);
101 89 }
102 90  
  91 + await th.get_prom_act(t);
  92 + if(t.prom_type==3 && !th.data.pro_good){
  93 + if(th.data.pro_good_err.indexOf("无权限")>-1){
  94 + ut.m_toast('您无权限参与优惠促销活动');
  95 + }else{
  96 + ut.m_toast('未找到优惠促销活动');
  97 + }
  98 + setTimeout(()=>{
  99 + getApp().goto('/pages/index/index/index');
  100 + },1500)
  101 + return false
  102 + }
  103 +
103 104 this.data.is_new=t.is_new;
104 105 this.data.is_hot=t.is_hot;
105 106 if (0 != t.cat_id && t.cat_id != undefined) {
... ... @@ -257,6 +258,31 @@ Page({
257 258 })
258 259 },
259 260  
  261 +
  262 + async get_prom_act(t){
  263 + var th=this;
  264 + //优惠活动的凑单
  265 + if(t.prom_type==3){
  266 + if (t.prom_id) {
  267 + await this.getprom(t.prom_id);
  268 + if(!th.data.pro_good){
  269 + return false;
  270 + }
  271 + }
  272 +
  273 + //-- 获取 --
  274 + getApp().request.promiseGet("/api/weshop/promgoodslist/list",{
  275 + data:{prom_id:t.prom_id }
  276 + }).then(res=>{
  277 + if(res.data.code==0){
  278 + var arr= res.data.data;
  279 + th.set_prom_list(arr);
  280 + }
  281 + })
  282 +
  283 + }
  284 + },
  285 +
260 286 onShow:function () {
261 287 getApp().check_can_share();
262 288 },
... ... @@ -274,14 +300,20 @@ Page({
274 300 },
275 301 //获取优惠活动
276 302 async getprom(prom_id){
277   - await getApp().request.promiseGet("/api/weshop/promgoods/get/" + oo.stoid + "/" + prom_id, {}).then(res => {
  303 + let th=this;
  304 + var uid=getApp().globalData.user_id || 0;
  305 + await getApp().request.promiseGet("/api/weshop/promgoods/getUser/" + oo.stoid + "/" + prom_id+"/"+uid, {}).then(res => {
278 306 if (res.data.code == 0) {
279 307 let prom = res.data.data;
  308 + th.data.pro_good=prom;
280 309 let limit_num =prom.limit_num
281 310 this.setData({
282 311 limit_num
283 312 })
  313 + }else{
  314 + th.data.pro_good_err=res.data.msg;
284 315 }
  316 +
285 317 })
286 318 },
287 319 //设置优惠券的
... ...
pages/user/order_list/order_list.js
... ... @@ -137,6 +137,10 @@ Page({
137 137 onShow: function () {
138 138 wx.showLoading();
139 139 var th=this;
  140 + th.setData({
  141 + cardList:[],
  142 + list2:[]
  143 + });
140 144 //-- 读取会员的信息先 --,再app.js中有
141 145 this.check_user_storage(()=> {
142 146 //在界面显示
... ... @@ -989,7 +993,7 @@ Page({
989 993 }
990 994  
991 995 if (!r_data.promGoodsLists && good.prom_type == 3) {
992   - var content = good.goods_name + '未找到活动,请取消订单重新购买';
  996 + var content = good.goods_name + '未找到活动或您无权限参与该活动,请取消订单重新购买';
993 997 th.toast(content);
994 998 p_ok = 0;
995 999 }else if(r_data.promGoodsLists && good.prom_type == 3){
... ...