Commit 0027ba62f789be4b286a969e27d2572eeacef859
1 parent
a34e19d2
Revert "Revert "1. 商品再加入购物车要判断是不是积分购。要is_integral_normal=1""
This reverts commit 15daee3addb350c55493e61e610deed8e4594a06.
Showing
4 changed files
with
99 additions
and
43 deletions
pages/goods/goodsInfo/goodsInfo.js
| ... | ... | @@ -929,6 +929,11 @@ Page({ |
| 929 | 929 | sku: o.sku, |
| 930 | 930 | }; |
| 931 | 931 | |
| 932 | + //如果是积分够,is_integral_normal就要有积分购普通购买字段 | |
| 933 | + if(o.prom_type==4){ | |
| 934 | + newd.is_integral_normal=1; | |
| 935 | + } | |
| 936 | + | |
| 932 | 937 | //-----如果是秒杀,团购,积分购,拼团----- |
| 933 | 938 | if (th.data.prom_type == 1) { |
| 934 | 939 | newd.goods_price = th.data.prom_price; | ... | ... |
pages/user/order_detail/order_detail.js
| ... | ... | @@ -289,7 +289,7 @@ Page({ |
| 289 | 289 | for(var i in order_goods){ |
| 290 | 290 | var good=order_goods[i]; |
| 291 | 291 | //如果不是小程序有的功能,直接提示要去3.0处理 |
| 292 | - if(good.prom_type==2 || good.prom_type==3 || good.prom_type==4 || good.prom_type==5){ | |
| 292 | + if(good.prom_type==2 || good.prom_type==4){ | |
| 293 | 293 | wx.showModal({ |
| 294 | 294 | title: '提示', |
| 295 | 295 | content: '小程序还未有该活动,请到3.0公众号支付' |
| ... | ... | @@ -330,8 +330,8 @@ Page({ |
| 330 | 330 | }); |
| 331 | 331 | return false; |
| 332 | 332 | } |
| 333 | - | |
| 334 | - if(good.prom_type==1 || good.prom_type==6){ | |
| 333 | + | |
| 334 | + if((good.prom_type==1 || good.prom_type==6 || good.prom_type==5 ) && !good.is_gift && !good.is_collocation){ | |
| 335 | 335 | if(gg.prom_type!=good.prom_type) { |
| 336 | 336 | wx.showModal({ |
| 337 | 337 | title: '提示', |
| ... | ... | @@ -339,6 +339,32 @@ Page({ |
| 339 | 339 | }); |
| 340 | 340 | return false; |
| 341 | 341 | } |
| 342 | + if(good.prom_type==3 || good.prom_type==5){ | |
| 343 | + await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+good.goods_id+"/0", {}).then(res => { | |
| 344 | + }).then(res=>{ | |
| 345 | + if(res.data.code==0){ | |
| 346 | + var r_data=res.data.data; | |
| 347 | + if(!r_data.collocationPromList && good.prom_type==5){ | |
| 348 | + wx.showModal({ | |
| 349 | + title: '提示', | |
| 350 | + content: good.goods_name+'未找到活动' | |
| 351 | + }); | |
| 352 | + } | |
| 353 | + if(!r_data.promGoodsLists && good.prom_type==3){ | |
| 354 | + wx.showModal({ | |
| 355 | + title: '提示', | |
| 356 | + content: good.goods_name+'未找到活动' | |
| 357 | + }); | |
| 358 | + } | |
| 359 | + }else{ | |
| 360 | + wx.showModal({ | |
| 361 | + title: '提示', | |
| 362 | + content: good.goods_name+'未找到活动' | |
| 363 | + }); | |
| 364 | + return false; | |
| 365 | + } | |
| 366 | + }) | |
| 367 | + } | |
| 342 | 368 | |
| 343 | 369 | }else{ |
| 344 | 370 | |
| ... | ... | @@ -374,24 +400,25 @@ Page({ |
| 374 | 400 | } |
| 375 | 401 | } |
| 376 | 402 | } |
| 377 | - | |
| 378 | - | |
| 379 | - var isok=1; | |
| 380 | - var card_field=th.data.card_field; | |
| 381 | - //如果会员是等级会员,商品有等级价,且不是活动商品 | |
| 382 | - if(card_field && gg[card_field]>0){ | |
| 383 | - if (good.goods_price != gg[card_field]) isok = 0; | |
| 384 | - }else{ | |
| 385 | - if (good.goods_price != gg.shop_price) isok = 0; | |
| 386 | - | |
| 387 | - } | |
| 388 | - if(!isok){ | |
| 389 | - wx.showModal({ | |
| 390 | - title: '提示', | |
| 391 | - content: gg.goods_name+'商品的价格发生了变化' | |
| 392 | - }); | |
| 393 | - return false; | |
| 394 | - } | |
| 403 | + | |
| 404 | + if(!good.is_gift && !good.is_collocation) { | |
| 405 | + var isok = 1; | |
| 406 | + var card_field = th.data.card_field; | |
| 407 | + //如果会员是等级会员,商品有等级价,且不是活动商品 | |
| 408 | + if (card_field && gg[card_field] > 0) { | |
| 409 | + if (good.goods_price != gg[card_field]) isok = 0; | |
| 410 | + } else { | |
| 411 | + if (good.goods_price != gg.shop_price) isok = 0; | |
| 412 | + | |
| 413 | + } | |
| 414 | + if (!isok) { | |
| 415 | + wx.showModal({ | |
| 416 | + title: '提示', | |
| 417 | + content: gg.goods_name + '商品的价格发生了变化' | |
| 418 | + }); | |
| 419 | + return false; | |
| 420 | + } | |
| 421 | + } | |
| 395 | 422 | |
| 396 | 423 | //--如果是线下库存的时候-- |
| 397 | 424 | if(th.data.conf.sales_rules==2){ | ... | ... |
pages/user/order_list/order_list.js
| ... | ... | @@ -380,7 +380,7 @@ Page({ |
| 380 | 380 | for(var i in order_goods){ |
| 381 | 381 | var good=order_goods[i]; |
| 382 | 382 | //如果不是小程序有的功能,直接提示要去3.0处理 |
| 383 | - if(good.prom_type==2 || good.prom_type==3 || good.prom_type==4 || good.prom_type==5){ | |
| 383 | + if(good.prom_type==2 || good.prom_type==4 ){ | |
| 384 | 384 | wx.showModal({ |
| 385 | 385 | title: '提示', |
| 386 | 386 | content: '小程序还未有该活动,请到3.0公众号支付' |
| ... | ... | @@ -422,10 +422,7 @@ Page({ |
| 422 | 422 | return false; |
| 423 | 423 | } |
| 424 | 424 | |
| 425 | - | |
| 426 | - console.log("-----------------111-------------------"); | |
| 427 | - | |
| 428 | - if(good.prom_type==1 || good.prom_type==6){ | |
| 425 | + if((good.prom_type==1 || good.prom_type==6 || good.prom_type==5 ) && !good.is_gift && !good.is_collocation){ | |
| 429 | 426 | if(gg.prom_type!=good.prom_type) { |
| 430 | 427 | wx.showModal({ |
| 431 | 428 | title: '提示', |
| ... | ... | @@ -433,9 +430,34 @@ Page({ |
| 433 | 430 | }); |
| 434 | 431 | return false; |
| 435 | 432 | } |
| 436 | - | |
| 433 | + if(good.prom_type==3 || good.prom_type==5){ | |
| 434 | + await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+good.goods_id+"/0", {}).then(res => { | |
| 435 | + }).then(res=>{ | |
| 436 | + if(res.data.code==0){ | |
| 437 | + var r_data=res.data.data; | |
| 438 | + if(!r_data.collocationPromList && good.prom_type==5){ | |
| 439 | + wx.showModal({ | |
| 440 | + title: '提示', | |
| 441 | + content: good.goods_name+'未找到活动' | |
| 442 | + }); | |
| 443 | + } | |
| 444 | + if(!r_data.promGoodsLists && good.prom_type==3){ | |
| 445 | + wx.showModal({ | |
| 446 | + title: '提示', | |
| 447 | + content: good.goods_name+'未找到活动' | |
| 448 | + }); | |
| 449 | + } | |
| 450 | + }else{ | |
| 451 | + wx.showModal({ | |
| 452 | + title: '提示', | |
| 453 | + content: good.goods_name+'未找到活动' | |
| 454 | + }); | |
| 455 | + return false; | |
| 456 | + } | |
| 457 | + }) | |
| 458 | + } | |
| 459 | + | |
| 437 | 460 | }else{ |
| 438 | - | |
| 439 | 461 | if(gg.prom_type==1 || gg.prom_type==6){ |
| 440 | 462 | var prom=null; |
| 441 | 463 | //---如果是活动的时候--- |
| ... | ... | @@ -468,24 +490,25 @@ Page({ |
| 468 | 490 | } |
| 469 | 491 | } |
| 470 | 492 | } |
| 471 | - | |
| 472 | - | |
| 493 | + //赠品和搭配购不判断商品金额 | |
| 473 | 494 | var isok=1; |
| 474 | 495 | var card_field=th.data.card_field; |
| 475 | 496 | //如果会员是等级会员,商品有等级价,且不是活动商品 |
| 476 | - if(card_field && gg[card_field]>0){ | |
| 477 | - if (good.goods_price != gg[card_field]) isok = 0; | |
| 478 | - }else{ | |
| 479 | - if (good.goods_price != gg.shop_price) isok = 0; | |
| 480 | - | |
| 481 | - } | |
| 482 | - if(!isok){ | |
| 483 | - wx.showModal({ | |
| 484 | - title: '提示', | |
| 485 | - content: gg.goods_name+'商品的价格发生了变化' | |
| 486 | - }); | |
| 487 | - return false; | |
| 488 | - } | |
| 497 | + if(!good.is_gift && !good.is_collocation) { | |
| 498 | + if (card_field && gg[card_field] > 0) { | |
| 499 | + if (good.goods_price != gg[card_field]) isok = 0; | |
| 500 | + } else { | |
| 501 | + if (good.goods_price != gg.shop_price) isok = 0; | |
| 502 | + | |
| 503 | + } | |
| 504 | + if (!isok) { | |
| 505 | + wx.showModal({ | |
| 506 | + title: '提示', | |
| 507 | + content: gg.goods_name + '商品的价格发生了变化' | |
| 508 | + }); | |
| 509 | + return false; | |
| 510 | + } | |
| 511 | + } | |
| 489 | 512 | |
| 490 | 513 | //--如果是线下库存的时候-- |
| 491 | 514 | if(th.data.conf.sales_rules==2){ | ... | ... |