Commit 96afedd868c5d9c7f34121a9f4f74e8fc3a7ae88

Authored by yvan.ni
1 parent bcc9e65a

预售的购买的bug优化

packageC/pages/presell/cart/cart.js
@@ -2129,32 +2129,25 @@ Page({ @@ -2129,32 +2129,25 @@ Page({
2129 function () { 2129 function () {
2130 //---用余额支付--- 2130 //---用余额支付---
2131 getApp().my_warnning("支付成功", 1, th); 2131 getApp().my_warnning("支付成功", 1, th);
2132 -  
2133 -  
2134 - var send_time=th.data.pre_arr.delivery_date;  
2135 - if(th.data.pre_arr.delivery_type==2){  
2136 - send_time=th.data.pre_arr.delivery_daynum*3600;  
2137 - }  
2138 -  
2139 - setTimeout(function () {  
2140 - th.setData({isclose: 0,'order.order_status':1,'order.pay_status':1,'wait_wk':0,'presell.tail_pay_state':1,'wait_fh':1,send_time:send_time});  
2141 - }, 1000)  
2142 - 2132 + var send_time=th.data.pre_arr.delivery_date;
  2133 + if(th.data.pre_arr.delivery_type==2){
  2134 + send_time=th.data.pre_arr.delivery_daynum*3600;
  2135 + }
  2136 + th.setData({isclose: 0,'order.order_status':1,'order.pay_status':1,'wait_wk':0,'presell.tail_pay_state':1,'wait_fh':1,send_time:send_time});
  2137 +
2143 }, function () { 2138 }, function () {
2144 getApp().my_warnning("支付失败", 0, th); 2139 getApp().my_warnning("支付失败", 0, th);
2145 }) 2140 })
2146 } else { 2141 } else {
2147 if (t.data.code == 0) { 2142 if (t.data.code == 0) {
2148 -  
2149 var send_time=th.data.pre_arr.delivery_date; 2143 var send_time=th.data.pre_arr.delivery_date;
2150 if(th.data.pre_arr.delivery_type==2){ 2144 if(th.data.pre_arr.delivery_type==2){
2151 send_time=th.data.pre_arr.delivery_daynum*3600; 2145 send_time=th.data.pre_arr.delivery_daynum*3600;
2152 } 2146 }
2153 //---用余额支付--- 2147 //---用余额支付---
2154 - getApp().my_warnning("支付成功", 1, th);  
2155 - setTimeout(function () {  
2156 - th.setData({isclose: 0,'order.order_status':1,'order.pay_status':1,'wait_wk':0,'presell.tail_pay_state':1,'wait_fh':1,send_time:send_time});  
2157 - }, 1000) 2148 + getApp().my_warnning("支付成功", 1, th);
  2149 + th.setData({isclose: 0,'order.order_status':1,'order.pay_status':1,'wait_wk':0,'presell.tail_pay_state':1,'wait_fh':1,send_time:send_time});
  2150 +
2158 } else { 2151 } else {
2159 getApp().my_warnning(t.data.msg, 1, th); 2152 getApp().my_warnning(t.data.msg, 1, th);
2160 } 2153 }
packageC/pages/presell/goodsInfo/goodsInfo.js
@@ -1527,24 +1527,18 @@ Page({ @@ -1527,24 +1527,18 @@ Page({
1527 onShareAppMessage: function (t) { 1527 onShareAppMessage: function (t) {
1528 1528
1529 var th = this; 1529 var th = this;
1530 - var price = th.data.data.shop_price;  
1531 - if (th.data.prom_act) {  
1532 - price = th.data.prom_act.price;  
1533 -  
1534 - }  
1535 - var title = th.data.data.goods_name; 1530 + var price = th.data.pre_arr.presell_price;
1536 var img = th.data.data.original_img; 1531 var img = th.data.data.original_img;
1537 - if (th.data.prom_type == 6 || th.data.prom_type == 1 || th.data.prom_type == 4) {  
1538 - title = th.data.prom_act.share_title;  
1539 - if (!title) title = th.data.prom_act.title;  
1540 - if (th.data.prom_type == 4) title = th.data.prom_act.name; 1532 + var title = th.data.presellForm.share_title;
  1533 + if (!title) title = th.data.prom_act.title;
  1534 + if (th.data.prom_type == 4) title = th.data.prom_act.name;
1541 1535
1542 - if (th.data.prom_act.share_imgurl)  
1543 - img = th.data.iurl + th.data.prom_act.share_imgurl;  
1544 - } 1536 + if (th.data.presellForm.share_img)
  1537 + img = th.data.iurl + th.data.presellForm.share_img;
1545 1538
1546 1539
1547 - var url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid; 1540 +
  1541 + var url = "/packageC/pages/presell/goodsInfo/goodsInfo?goods_id=" + th.data.gid;
1548 if (getApp().globalData.user_id) { 1542 if (getApp().globalData.user_id) {
1549 url += "&first_leader=" + getApp().globalData.user_id; 1543 url += "&first_leader=" + getApp().globalData.user_id;
1550 } 1544 }
@@ -1562,26 +1556,10 @@ Page({ @@ -1562,26 +1556,10 @@ Page({
1562 path: url, 1556 path: url,
1563 imageUrl: img, 1557 imageUrl: img,
1564 }; 1558 };
1565 - if (th.data.prom_type == 6) {  
1566 - title += '\n' + th.data.prom_act.share_remark;  
1567 - ob.title = title;  
1568 - ob.desc = th.data.prom_act.share_remark;  
1569 - }  
1570 -  
1571 - //如果是积分购的时候  
1572 - if (th.data.prom_type == 4) {  
1573 - var name = th.data.prom_act.name;  
1574 - //-- 积分购的 --  
1575 - var pri0 = th.data.prom_act.addmoney;  
1576 - var integral = th.data.prom_act.integral;  
1577 - var text = "";  
1578 - if (integral) { text = integral + "积分"; }  
1579 - if (pri0 && integral) { text += "+"; }  
1580 - if (pri0) { text += "¥" + pri0; }  
1581 -  
1582 - ob.title = text + " " + name;  
1583 - } 1559 +
  1560 + ob.title += '\n' + th.data.presellForm.share_remark;
1584 1561
  1562 +
1585 return ob; 1563 return ob;
1586 1564
1587 }, 1565 },
@@ -1604,9 +1582,8 @@ Page({ @@ -1604,9 +1582,8 @@ Page({
1604 1582
1605 //----------装载同一活动中的商品---------- 1583 //----------装载同一活动中的商品----------
1606 async get_sku(stoid, gd, g_id, is_normal, func) { 1584 async get_sku(stoid, gd, g_id, is_normal, func) {
1607 - var tt = this, arrdata = null;  
1608 - var now = ut.gettimestamp();  
1609 - 1585 + var tt = this, arrdata = null;
  1586 + var now = ut.gettimestamp();
1610 var rq_data={ 1587 var rq_data={
1611 store_id: o.stoid, 1588 store_id: o.stoid,
1612 sku: gd.sku, 1589 sku: gd.sku,
@@ -1618,7 +1595,7 @@ Page({ @@ -1618,7 +1595,7 @@ Page({
1618 prom_type: 8, 1595 prom_type: 8,
1619 }; 1596 };
1620 1597
1621 - if(tt.data.presellForm && tt.data.presellForm.id){ 1598 + if(tt.data.presellForm && tt.data.presellForm.id){
1622 rq_data.prom_id=tt.data.presellForm.id; 1599 rq_data.prom_id=tt.data.presellForm.id;
1623 } 1600 }
1624 1601
@@ -2845,9 +2822,10 @@ Page({ @@ -2845,9 +2822,10 @@ Page({
2845 context.fillText(text, 38 * unit, 235 * unit); 2822 context.fillText(text, 38 * unit, 235 * unit);
2846 2823
2847 } 2824 }
2848 - console.log(th.data.share_goods_img);  
2849 - let share_goods_img=th.data.presellForm.share_img;  
2850 - share_goods_img?share_goods_img:th.data.data.share_goods_img; 2825 +
  2826 + //console.log(th.data.share_goods_img);
  2827 + //let share_goods_img=th.data.presellForm.share_img;
  2828 + //share_goods_img?share_goods_img:th.data.data.share_goods_img;
2851 //---中间大图--- 2829 //---中间大图---
2852 context.drawImage(th.data.share_goods_img, 70 * unit, 250 * unit, 408 * unit, 408 * unit); 2830 context.drawImage(th.data.share_goods_img, 70 * unit, 250 * unit, 408 * unit, 408 * unit);
2853 2831
@@ -3127,7 +3105,6 @@ Page({ @@ -3127,7 +3105,6 @@ Page({
3127 tt(); 3105 tt();
3128 return false; 3106 return false;
3129 } 3107 }
3130 -  
3131 // var img_url = ee.data.data.original_img; 3108 // var img_url = ee.data.data.original_img;
3132 var img_url = ee.data.presellForm.share_img; 3109 var img_url = ee.data.presellForm.share_img;
3133 img_url?img_url:ee.data.data.original_img; 3110 img_url?img_url:ee.data.data.original_img;