Commit 288929572d426d18c844846c093b2e7956da670f

Authored by yvan.ni
1 parent e211cddc

积分购

pages/goods/goodsInfo/g_filter.wxs
@@ -93,18 +93,7 @@ var g_filters = { @@ -93,18 +93,7 @@ var g_filters = {
93 //折扣数值处理,小数位数为1时,只显示1位;小数位数为2时,才显示2位; 93 //折扣数值处理,小数位数为1时,只显示1位;小数位数为2时,才显示2位;
94 num: function(value) { 94 num: function(value) {
95 if(value != 0) { 95 if(value != 0) {
96 - var val = value.toFixed(2).toString();  
97 - if(val.indexOf('.') != -1) {  
98 - var arrval = val.split('.');  
99 - if(arrval[1].length == 1 && arrval[1][0] == 0) {  
100 - val = val.slice(0,-2);  
101 - };  
102 -  
103 - if(arrval[1].length == 2 && arrval[1][1] == 0) {  
104 - val = val.slice(0,-1);  
105 - };  
106 - };  
107 - return val; 96 + return parseFloat(value);
108 } else { 97 } else {
109 return value.toFixed(0); 98 return value.toFixed(0);
110 }; 99 };
pages/goods/goodsInfo/goodsInfo.wxml
@@ -242,14 +242,14 @@ @@ -242,14 +242,14 @@
242 <view class="goods-price"> 242 <view class="goods-price">
243 <!-- 价格显示 --> 243 <!-- 价格显示 -->
244 <view class="co-red" style="" > 244 <view class="co-red" style="" >
245 - <view class="market-price" style="overflow: hidden; height: 66rpx;"> 245 + <view class="market-price" style="overflow: hidden; height: 66rpx;display: flex;">
246 <image class="rel_img" src="{{iurl}}/miniapp/images/integral/integral_red.png"></image> 246 <image class="rel_img" src="{{iurl}}/miniapp/images/integral/integral_red.png"></image>
247 <block wx:if="{{prom_integral}}">{{prom_integral}} 247 <block wx:if="{{prom_integral}}">{{prom_integral}}
248 <text class="rel_txt">积分</text></block> 248 <text class="rel_txt">积分</text></block>
249 <text class="rel_txt" wx:if="{{prom_integral && prom_price}}">+</text> 249 <text class="rel_txt" wx:if="{{prom_integral && prom_price}}">+</text>
250 <text class="rel_txt" wx:if="{{prom_price}}" >{{filters.toFix(prom_price,2)}}元</text> 250 <text class="rel_txt" wx:if="{{prom_price}}" >{{filters.toFix(prom_price,2)}}元</text>
251 <text class="rel_txt" wx:if="{{!prom_integral && !prom_price}}">0积分</text> 251 <text class="rel_txt" wx:if="{{!prom_integral && !prom_price}}">0积分</text>
252 - <text class="rel_txt" decode="{{true}}" space="{{true}}" style="color: #999; text-decoration: line-through;">&nbsp;&nbsp;&nbsp;零售价:¥{{data.market_price}}</text> 252 + <text class="rel_txt fs22" decode="{{true}}" space="{{true}}" style="color: #999; text-decoration: line-through;">&nbsp;&nbsp;&nbsp;零售价:¥{{data.market_price}}</text>
253 </view> 253 </view>
254 </view> 254 </view>
255 255
@@ -266,8 +266,7 @@ @@ -266,8 +266,7 @@
266 266
267 <view class="goods-num"> 267 <view class="goods-num">
268 <view class="sales">销量:{{prom_act.buy_num}}件</view> 268 <view class="sales">销量:{{prom_act.buy_num}}件</view>
269 - <!-- <view class="stock">折扣:{{data.disc}}折</view> -->  
270 - <view class="stock">折扣:{{g_filters.num((prom_price?prom_price:0)*100/data.shop_price)}}折</view> 269 + <view class="stock">折扣:{{g_filters.num((prom_price?prom_price:0)*10/data.shop_price)}}折</view>
271 <view class="stock">{{categories3[0].num}}人评价</view> 270 <view class="stock">{{categories3[0].num}}人评价</view>
272 </view> 271 </view>
273 </view> 272 </view>
@@ -382,7 +381,6 @@ @@ -382,7 +381,6 @@
382 <view class="goods-num" wx:if="{{prom_type!=1}}"> 381 <view class="goods-num" wx:if="{{prom_type!=1}}">
383 <view class="sales">销量:{{data.sales_sum}}件</view> 382 <view class="sales">销量:{{data.sales_sum}}件</view>
384 <view class="stock">折扣:{{data.disc}}折</view> 383 <view class="stock">折扣:{{data.disc}}折</view>
385 - <!-- <view class="stock">折扣:{{filters.pInt((prom_price?prom_price:0)*100/data.shop_price)}}折</view> -->  
386 <view class="stock">{{categories3[0].num}}人评价</view> 384 <view class="stock">{{categories3[0].num}}人评价</view>
387 </view> 385 </view>
388 <view wx:if="{{prom_type==1}}"> 386 <view wx:if="{{prom_type==1}}">