Commit aec835abdccdd5c68173c17dc446b9e8a9dc49f8

Authored by yvan.ni
1 parent 72845461

组合购的 价格小 组合价格比较大的时候的计算bug

pages/cart/cart2/cart2.js
... ... @@ -2027,11 +2027,11 @@ Page({
2027 2027 }
2028 2028  
2029 2029 //--判断优惠活动的提交--
2030   - if (th.data.formData.cut_price > 0) {
  2030 + if (th.data.formData.cut_price > 0 ) {
2031 2031 order_prom_list.discount_amount = th.data.formData.cut_price.toFixed(2);
2032 2032 var ob = [{
2033 2033 "prom_id": th.data.bn_goods.prom_id,
2034   - "dis": th.data.formData.cut_price.toFixed(2),
  2034 + "dis": parseFloat(th.data.formData.cut_price).toFixed(2),
2035 2035 "ispt": 0
2036 2036 }]
2037 2037 order_prom_list.prom_pt_json = JSON.stringify(ob);
... ... @@ -2266,12 +2266,12 @@ Page({
2266 2266 order_prom_list.discount_amount =0;
2267 2267 //--判断优惠活动的提交--
2268 2268 if (t_item.cut_price > 0) {
2269   - order_prom_list.discount_amount += t_item.cut_price.toFixed(2);
  2269 + order_prom_list.discount_amount += t_item.cut_price;
2270 2270 order_prom_list.prom_pt_json = JSON.stringify(t_item.prom_pt_json);
2271 2271 }
2272 2272 //--判断组合优惠活动的提交--
2273   - if (t_item.zh_cut_price > 0) {
2274   - order_prom_list.discount_amount += t_item.zh_cut_price.toFixed(2);
  2273 + if (t_item.zh_cut_price > 0 || t_item.zh_cut_price<0) {
  2274 + order_prom_list.discount_amount += t_item.zh_cut_price;
2275 2275 order_prom_list.zh_pt_json = JSON.stringify(t_item.zh_pt_json);
2276 2276 }
2277 2277 if (t_item.s_intValue > 0) {
... ... @@ -2285,8 +2285,14 @@ Page({
2285 2285 order_prom_list.give_lb_id = t_item.s_libao;
2286 2286 order_prom_list.g_lb_num = JSON.stringify(t_item.g_lb_num);
2287 2287 }
2288   - if (Object.keys(order_prom_list).length > 0)
  2288 + if (Object.keys(order_prom_list).length > 0){
  2289 + if(order_prom_list.discount_amount)
  2290 + order_prom_list.discount_amount= parseFloat(order_prom_list.discount_amount).toFixed(2);
  2291 + if(order_prom_list.order_prom_amount)
  2292 + order_prom_list.order_prom_amount= parseFloat(order_prom_list.order_prom_amount).toFixed(2);
2289 2293 item.order_prom_list = order_prom_list;
  2294 + }
  2295 +
2290 2296  
2291 2297 //老会员成为分销下线需要的参数
2292 2298 if (getApp().globalData.first_leader && !getApp().globalData.userInfo.first_leader) {
... ...
pages/goods/goodsInfo/goodsInfo.js
... ... @@ -711,6 +711,11 @@ Page({
711 711 onShow: function() {
712 712 console.log('djfijsaoifjoisadjfoij');
713 713 var goods_list = null,th = this,that=this;
  714 + var show_prew_img= this.data.show_prew_img
  715 + if(show_prew_img){
  716 + show_prew_img=0;
  717 + return false;
  718 + }
714 719  
715 720 //优惠券要实时更新
716 721 getApp().getConfig2(function(e) {
... ... @@ -2061,6 +2066,7 @@ Page({
2061 2066 for(var i in b){
2062 2067 b[i] = this.data.iurl + e[i];
2063 2068 }
  2069 + this.data.show_prew_img=1;
2064 2070  
2065 2071 wx.previewImage({
2066 2072 current: b[t.currentTarget.dataset.id],
... ... @@ -2074,6 +2080,7 @@ Page({
2074 2080 for (var i in b) {
2075 2081 b[i] = this.data.iurl + e[i];
2076 2082 }
  2083 + this.data.show_prew_img=1;
2077 2084 wx.previewImage({
2078 2085 current: b[t.currentTarget.dataset.id],
2079 2086 urls: b
... ... @@ -2089,6 +2096,7 @@ Page({
2089 2096 current: a[t.currentTarget.dataset.id],
2090 2097 urls: a
2091 2098 });
  2099 + this.data.show_prew_img=1;
2092 2100 },
2093 2101 closePromModal: function() {
2094 2102 this.setData({
... ... @@ -5388,6 +5396,7 @@ Page({
5388 5396 },
5389 5397  
5390 5398 previewImage() {
  5399 + this.data.show_prew_img=1;
5391 5400 wx.previewImage({
5392 5401 //将图片预览出来
5393 5402 urls: [this.data.shareImgPath]
... ...
utils/wxParse/wxParse.js
... ... @@ -15,9 +15,10 @@ function t(e, t, a) {
15 15  
16 16 function a(e) {
17 17 var t = this, a = e.target.dataset.src, i = e.target.dataset.from;
  18 + t.data.show_prew_img=1;
18 19 void 0 !== i && i.length > 0 && wx.previewImage({
19 20 current: a,
20   - urls: t.data[i].imageUrls
  21 + urls: t.data[i].imageUrls,
21 22 });
22 23 }
23 24  
... ...
utils/wxParse/wxParse.wxml
... ... @@ -377,7 +377,7 @@
377 377 </view>
378 378 </template>
379 379 <template name="wxParseImg">
380   - <image bindload="wxParseImgLoad" bindtap="wxParseImgTap" class="{{item.classStr}} wxParse-{{item.tag}}" data-from="{{item.from}}" data-idx="{{item.imgIndex}}" data-src="{{item.attr.src}}" mode="widthFix" src="{{item.attr.src}}" style="width:100%;"></image>
  380 + <image bindload="wxParseImgLoad" bindtap="wxParseImgTap" class="{{item.classStr}} wxParse-{{item.tag}}" data-from="{{item.from}}" data-idx="{{item.imgIndex}}" data-src="{{item.attr.src}}" mode="widthFix" src="{{item.attr.src}}" style="width:{{item.width}}px;max-width:100%;"></image>
381 381 </template>
382 382 <template name="wxParseVideo">
383 383 <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}">
... ...