Commit 6b3a4638c606d9eb0f9519d3f12493b96110646f

Authored by 泉州测试
1 parent 0d798320

增加文件注释

packageA/pages/goodsInfo/goodsInfo.js
... ... @@ -889,7 +889,7 @@ Page({
889 889 return false;
890 890 }
891 891  
892   - // 获取购物车同数量 判断是否超库存
  892 + // 获取购物车同数量 判断是否超库存
893 893 var cartGoodsNum = 0;
894 894 await getApp().request.promiseGet("/api/weshop/cartService/page?store_id="+os.stoid+"&user_id="+oo.user_id+"&service_id="+th.data.data.id+"&pick_id="+th.data.sto_sele_id,
895 895 { }).then(res => {
... ... @@ -900,9 +900,10 @@ Page({
900 900  
901 901 });
902 902  
903   - // 跳过<立即购买>
  903 + // 跳过<立即购买> 购物车
904 904 if(action !="buy"){
905 905  
  906 + // 输入的数量 + 购物车同款商品的数量
906 907 var maxNum = parseInt(t) + parseInt(cartGoodsNum);
907 908  
908 909 if (maxNum > redisNum) {
... ... @@ -912,7 +913,7 @@ Page({
912 913 return false;
913 914 }
914 915  
915   - // 是否开启限购
  916 + // 是否开启个人限购
916 917 if (th.data.sele_g.viplimited > 0) {
917 918  
918 919 if (maxNum + th.data.sele_g.buy_num > th.data.sele_g.buy_limit) {
... ... @@ -928,6 +929,7 @@ Page({
928 929  
929 930 }
930 931  
  932 + // 以下为立即购买
931 933 // 每人限购数
932 934 th.data.sele_g.viplimited = th.data.sele_g.buy_limit;
933 935  
... ... @@ -960,7 +962,7 @@ Page({
960 962  
961 963  
962 964  
963   - if(action=="buy"){ // 直接购买
  965 + if(action=="buy"){ // 立即购买
964 966 //--------------此时操作的数据------------
965 967 var newd = {
966 968 id: th.data.data.id,
... ...