Commit 1d3d92087a302146b76cab03d9e28307d39de76c

Authored by 后端研发-苏明海
2 parents 6bf1e62c 5191dfd9

Merge branch 'dev' into 'test'

Dev

See merge request !653
components/diy_advertising/diy_advertising.js
@@ -18,6 +18,23 @@ Component({ @@ -18,6 +18,23 @@ Component({
18 someData: {}, 18 someData: {},
19 max_sw_height:260, 19 max_sw_height:260,
20 }, 20 },
  21 +
  22 + ready: function () {
  23 + var data_arr=this.properties.object.data;
  24 + var is_show=0;
  25 + for(var i in data_arr){
  26 + var item=data_arr[i];
  27 + var now=new Date();
  28 + if((!item.beg_date || now>new Date(item.beg_date))
  29 + && (!item.end_date || now<new Date(item.end_date)))
  30 + {
  31 + this.setData({is_show:1});
  32 + break;
  33 + }
  34 + }
  35 +
  36 +
  37 + },
21 methods: { 38 methods: {
22 39
23 customMethod: function () { }, 40 customMethod: function () { },
components/diy_advertising/diy_advertising.wxml
@@ -398,7 +398,7 @@ @@ -398,7 +398,7 @@
398 </view> 398 </view>
399 399
400 <!--幻灯片--> 400 <!--幻灯片-->
401 -<block wx:if='{{object.style==4}}'> 401 +<block wx:if='{{object.style==4 && is_show}}'>
402 402
403 403
404 <swiper class="swiper" circular="true" autoplay="{{autoplay}}" current="{{object.sw_index}}" 404 <swiper class="swiper" circular="true" autoplay="{{autoplay}}" current="{{object.sw_index}}"
@@ -409,19 +409,21 @@ @@ -409,19 +409,21 @@
409 style="height:{{max_sw_height}}rpx" > 409 style="height:{{max_sw_height}}rpx" >
410 <block wx:for="{{object.data}}" wx:for-index="index" > 410 <block wx:for="{{object.data}}" wx:for-index="index" >
411 411
  412 + <block wx:if="{{(!item.begin_date || g_filter.beg_time(item.begin_date) ) && (!item.end_date || g_filter.end_time(item.end_date) )}}">
412 <navigator url="{{item.wxapp_imgurl}}" class="s1_gk_a1" style="height:{{max_sw_height}}rpx" wx:if="{{g_filter.has_char(item.wxapp_imgurl,'plugin')>=0}}"> 413 <navigator url="{{item.wxapp_imgurl}}" class="s1_gk_a1" style="height:{{max_sw_height}}rpx" wx:if="{{g_filter.has_char(item.wxapp_imgurl,'plugin')>=0}}">
413 <swiper-item> 414 <swiper-item>
414 <image src="{{item.src}}" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" lazy-load="true"/> 415 <image src="{{item.src}}" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" lazy-load="true"/>
415 - <view class="title" wx:if="{{title}}">{{item.title}}</view> 416 + <view class="title" wx:if="{{item.title}}">{{item.title}}</view>
416 </swiper-item> 417 </swiper-item>
417 </navigator> 418 </navigator>
418 419
419 <view data-url="{{item.wxapp_imgurl}}" class="s1_gk_a1" style="height:{{max_sw_height}}rpx" bindtap="go_url" wx:else> 420 <view data-url="{{item.wxapp_imgurl}}" class="s1_gk_a1" style="height:{{max_sw_height}}rpx" bindtap="go_url" wx:else>
420 <swiper-item> 421 <swiper-item>
421 <image src="{{item.src}}" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" lazy-load="true"/> 422 <image src="{{item.src}}" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" lazy-load="true"/>
422 - <view class="title" wx:if="{{title}}">{{item.title}}</view> 423 + <view class="title" wx:if="{{item.title}}">{{item.title}}</view>
423 </swiper-item> 424 </swiper-item>
424 </view> 425 </view>
  426 + </block>
425 427
426 </block> 428 </block>
427 </swiper> 429 </swiper>
components/diy_notice/g_filter.wxs
@@ -2,8 +2,28 @@ var g_filters = { @@ -2,8 +2,28 @@ var g_filters = {
2 has_char:function(url,key){ 2 has_char:function(url,key){
3 if(!url) return -1; 3 if(!url) return -1;
4 return url.indexOf(key); 4 return url.indexOf(key);
  5 + },
  6 + beg_time:function(beg_date){
  7 + var fmt1 = beg_date.substring(0, 19);
  8 + var reg = getRegExp("-", "g");
  9 + var fmt2 = fmt1.replace(reg, '/');
  10 + var t1 = getDate(fmt2);
  11 + var tnow=getDate();
  12 + if(t1<=tnow) return 1;
  13 + return 0;
  14 + },
  15 + end_time:function(end_date){
  16 + var fmt1 = end_date.substring(0, 19);
  17 + var reg = getRegExp("-", "g");
  18 + var fmt2 = fmt1.replace(reg, '/');
  19 + var t1 = getDate(fmt2);
  20 + var tnow=getDate();
  21 + if(t1>=tnow) return 1;
  22 + return 0;
5 } 23 }
6 } 24 }
7 module.exports = { 25 module.exports = {
8 - has_char: g_filters.has_char 26 + has_char: g_filters.has_char,
  27 + beg_time: g_filters.beg_time,
  28 + end_time: g_filters.end_time,
9 } 29 }
10 \ No newline at end of file 30 \ No newline at end of file
components/diy_scan/diy_scan.wxml
1 -<view class="scan_view" disable-scroll="true" bindtap='getScancode' style="top:{{top}}px;left:{{left}}px;" bindtouchmove="setTouchMove"> 1 +<block wx:if="{{object.bg_color}}">
  2 +<view class="scan_view" disable-scroll="true" bindtap='getScancode'
  3 + style="top:{{top}}px;left:{{left}}px; background-color:{{object.bg_color}}; opacity: 0.5 " bindtouchmove="setTouchMove">
2 <view style="text-align: center;"> 4 <view style="text-align: center;">
3 <image class="cs-img" src="{{object.img}}"></image> 5 <image class="cs-img" src="{{object.img}}"></image>
4 - <view class="s_title" wx:if="{{object.title!=''}}">{{object.title}}</view> 6 + <view class="s_title" wx:if="{{object.title!=''}}">
  7 + <text wx:if="{{object.word_color}}" style="color:{{object.word_color}}">{{object.title}}</text>
  8 + <text wx:else >{{object.title}}</text>
  9 + </view>
5 </view> 10 </view>
6 </view> 11 </view>
7 - 12 +</block>
  13 +
  14 +<block wx:else>
  15 +<view class="scan_view" disable-scroll="true" bindtap='getScancode' style="top:{{top}}px;left:{{left}}px;" bindtouchmove="setTouchMove">
  16 + <view style="text-align: center;">
  17 + <image class="cs-img" src="{{object.img}}"></image>
  18 + <view class="s_title" wx:if="{{object.title!=''}}">
  19 + <text wx:if="{{object.word_color}}" style="color:{{object.word_color}}">{{object.title}}</text>
  20 + <text wx:else>{{object.title}}</text>
  21 + </view>
  22 + </view>
  23 +</view>
  24 +</block>
pages/activity/pind_list/g_filter.wxs 0 → 100644
  1 +var g_filters = {
  2 + has_char:function(url,key){
  3 + if(!url) return -1;
  4 + return url.indexOf(key);
  5 + },
  6 + beg_time:function(beg_date){
  7 + var fmt1 = beg_date.substring(0, 19);
  8 + var reg = getRegExp("-", "g");
  9 + var fmt2 = fmt1.replace(reg, '/');
  10 + var t1 = getDate(fmt2);
  11 + var tnow=getDate();
  12 + if(t1<=tnow) return 1;
  13 + return 0;
  14 + },
  15 + end_time:function(end_date){
  16 + var fmt1 = end_date.substring(0, 19);
  17 + var reg = getRegExp("-", "g");
  18 + var fmt2 = fmt1.replace(reg, '/');
  19 + var t1 = getDate(fmt2);
  20 + var tnow=getDate();
  21 + if(t1>=tnow) return 1;
  22 + return 0;
  23 + }
  24 +}
  25 +module.exports = {
  26 + has_char: g_filters.has_char,
  27 + beg_time: g_filters.beg_time,
  28 + end_time: g_filters.end_time,
  29 +}
0 \ No newline at end of file 30 \ No newline at end of file
pages/activity/pind_list/pind_list.js
@@ -44,12 +44,17 @@ Page({ @@ -44,12 +44,17 @@ Page({
44 }).then(res => { 44 }).then(res => {
45 if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ 45 if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
46 var a = res.data.data.pageData; 46 var a = res.data.data.pageData;
47 - var tt = {  
48 - 'ad_code': os.imghost + a[0].ad_code,  
49 - 'media_link': '',  
50 - 'ad_weapplink':a[0].ad_weapplink  
51 - };  
52 - th.setData({ad_data:tt}); 47 + var narr=[];
  48 + for(var i in a){
  49 + var tt = {
  50 + 'ad_code': os.imghost + a[0].ad_code,
  51 + 'media_link': '',
  52 + 'ad_weapplink':a[0].ad_weapplink
  53 + };
  54 + narr.push(tt);
  55 + }
  56 +
  57 + th.setData({ad_data:narr});
53 } 58 }
54 }) 59 })
55 }, 60 },
pages/activity/pind_list/pind_list.wxml
  1 +<wxs module="g_filter" src="g_filter.wxs"></wxs>
1 <view class=" body_frame"> 2 <view class=" body_frame">
2 3
3 <block wx:if="{{ad_data}}"> 4 <block wx:if="{{ad_data}}">
4 - <image mode="widthFix" src="{{ad_data.ad_code}}" style="width: 100%;"></image> 5 + <swiper class="swiper" circular="true"
  6 + indicator-dots="true"
  7 + style="height:{{max_sw_height}}rpx" >
  8 + <block wx:for="{{ad_data}}">
  9 +
  10 + <navigator url="{{item.ad_weapplink}}" class="s1_gk_a1" wx:if="{{g_filter.has_char(item.ad_weapplink,'plugin')>=0}}">
  11 + <swiper-item>
  12 + <image src="{{item.ad_code}}" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" lazy-load="true"/>
  13 + </swiper-item>
  14 + </navigator>
  15 +
  16 + <view data-url="{{item.ad_weapplink}}" class="s1_gk_a1" bindtap="go_url" wx:else>
  17 + <swiper-item>
  18 + <image src="{{item.ad_code}}" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" lazy-load="true"/>
  19 + </swiper-item>
  20 + </view>
  21 +
  22 + </block>
  23 + </swiper>
5 </block> 24 </block>
6 <block wx:else> 25 <block wx:else>
7 <image class="xc-top-img" src="{{url}}/miniapp/images/team.jpg"></image> 26 <image class="xc-top-img" src="{{url}}/miniapp/images/team.jpg"></image>
pages/activity/pind_list/pind_list.wxss
@@ -3,7 +3,7 @@ page{ @@ -3,7 +3,7 @@ page{
3 } 3 }
4 .kill-list{ 4 .kill-list{
5 width: 95%; 5 width: 95%;
6 - margin-top: -50rpx; 6 + margin-top: -10rpx;
7 position:absolute; 7 position:absolute;
8 left: 2.5%; 8 left: 2.5%;
9 9
pages/activity/seckill_list/g_filter.wxs 0 → 100644
  1 +var g_filters = {
  2 + has_char:function(url,key){
  3 + if(!url) return -1;
  4 + return url.indexOf(key);
  5 + },
  6 + beg_time:function(beg_date){
  7 + var fmt1 = beg_date.substring(0, 19);
  8 + var reg = getRegExp("-", "g");
  9 + var fmt2 = fmt1.replace(reg, '/');
  10 + var t1 = getDate(fmt2);
  11 + var tnow=getDate();
  12 + if(t1<=tnow) return 1;
  13 + return 0;
  14 + },
  15 + end_time:function(end_date){
  16 + var fmt1 = end_date.substring(0, 19);
  17 + var reg = getRegExp("-", "g");
  18 + var fmt2 = fmt1.replace(reg, '/');
  19 + var t1 = getDate(fmt2);
  20 + var tnow=getDate();
  21 + if(t1>=tnow) return 1;
  22 + return 0;
  23 + }
  24 +}
  25 +module.exports = {
  26 + has_char: g_filters.has_char,
  27 + beg_time: g_filters.beg_time,
  28 + end_time: g_filters.end_time,
  29 +}
0 \ No newline at end of file 30 \ No newline at end of file
pages/activity/seckill_list/seckill_list.js
@@ -41,12 +41,16 @@ Page({ @@ -41,12 +41,16 @@ Page({
41 }).then(res => { 41 }).then(res => {
42 if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ 42 if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
43 var a = res.data.data.pageData; 43 var a = res.data.data.pageData;
44 - var tt = {  
45 - 'ad_code': os.imghost + a[0].ad_code,  
46 - 'media_link': '',  
47 - 'ad_weapplink':a[0].ad_weapplink  
48 - };  
49 - th.setData({ad_data:tt}); 44 + var narr=[];
  45 + for(var i in a){
  46 + var tt = {
  47 + 'ad_code': os.imghost + a[0].ad_code,
  48 + 'media_link': '',
  49 + 'ad_weapplink':a[0].ad_weapplink
  50 + };
  51 + narr.push(tt);
  52 + }
  53 + th.setData({ad_data:narr});
50 } 54 }
51 }) 55 })
52 56
pages/activity/seckill_list/seckill_list.wxml
1 <wxs module="filters" src="../../../utils/filter.wxs"></wxs> 1 <wxs module="filters" src="../../../utils/filter.wxs"></wxs>
2 - 2 +<wxs module="g_filter" src="g_filter.wxs"></wxs>
3 <view class=" body_frame"> 3 <view class=" body_frame">
4 4
5 <block wx:if="{{ad_data}}"> 5 <block wx:if="{{ad_data}}">
6 - <image mode="widthFix" src="{{ad_data.ad_code}}" style="width: 100%;"></image> 6 +
  7 + <swiper class="swiper" circular="true"
  8 + indicator-dots="true"
  9 + style="height:{{max_sw_height}}rpx" >
  10 + <block wx:for="{{ad_data}}">
  11 +
  12 + <navigator url="{{item.ad_weapplink}}" class="s1_gk_a1" wx:if="{{g_filter.has_char(item.ad_weapplink,'plugin')>=0}}">
  13 + <swiper-item>
  14 + <image src="{{item.ad_code}}" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" lazy-load="true"/>
  15 + </swiper-item>
  16 + </navigator>
  17 +
  18 + <view data-url="{{item.ad_weapplink}}" class="s1_gk_a1" bindtap="go_url" wx:else>
  19 + <swiper-item>
  20 + <image src="{{item.ad_code}}" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" lazy-load="true"/>
  21 + </swiper-item>
  22 + </view>
  23 +
  24 + </block>
  25 + </swiper>
  26 +
  27 +
7 </block> 28 </block>
8 <block wx:else> 29 <block wx:else>
9 <image class="xc-top-img" src="{{url}}/miniapp/images/seckill_top_img.jpg"></image> 30 <image class="xc-top-img" src="{{url}}/miniapp/images/seckill_top_img.jpg"></image>
pages/activity/seckill_list/seckill_list.wxss
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 /* overflow-y: scroll; */ 17 /* overflow-y: scroll; */
18 } 18 }
19 .seckill_list{ 19 .seckill_list{
20 -margin-top: -50rpx; 20 +margin-top: -10rpx;
21 left: 2%; 21 left: 2%;
22 } 22 }
23 .seckill{ 23 .seckill{
pages/cart/cart/cart.js
@@ -31,6 +31,7 @@ Page({ @@ -31,6 +31,7 @@ Page({
31 btn_click:1, 31 btn_click:1,
32 32
33 service_data:null, 33 service_data:null,
  34 + max_sw_height:200,
34 }, 35 },
35 onLoad: function() { 36 onLoad: function() {
36 var a = this,ee=a; 37 var a = this,ee=a;
@@ -100,12 +101,16 @@ Page({ @@ -100,12 +101,16 @@ Page({
100 }).then(res => { 101 }).then(res => {
101 if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ 102 if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
102 var a = res.data.data.pageData; 103 var a = res.data.data.pageData;
103 - var tt = {  
104 - 'ad_code': os.imghost + a[0].ad_code,  
105 - 'media_link': '',  
106 - 'ad_weapplink':a[0].ad_weapplink  
107 - };  
108 - th.setData({ad_data:tt}); 104 + var narr=[];
  105 + for(var i in a){
  106 + var tt = {
  107 + 'ad_code': os.imghost + a[i].ad_code,
  108 + 'media_link': '',
  109 + 'ad_weapplink':a[i].ad_weapplink
  110 + };
  111 + narr.push(tt);
  112 + }
  113 + th.setData({ad_data:narr});
109 }else{ 114 }else{
110 //--获取是否又秒杀活动-- 115 //--获取是否又秒杀活动--
111 getApp().request.promiseGet("/api/ms/flash_sale/spikepage", { 116 getApp().request.promiseGet("/api/ms/flash_sale/spikepage", {
@@ -2038,5 +2043,19 @@ Page({ @@ -2038,5 +2043,19 @@ Page({
2038 2043
2039 refresh_input:function(){ 2044 refresh_input:function(){
2040 this.data.btn_click=0; 2045 this.data.btn_click=0;
2041 - } 2046 + },
  2047 +
  2048 + imageLoad:function(e){
  2049 + var imgwidth = e.detail.width;
  2050 + var imgheight = e.detail.height;
  2051 + //宽高比
  2052 + var ratio = imgwidth / imgheight;
  2053 + //计算的高度值
  2054 + var viewHeight = 715 / ratio;
  2055 + var hei=this.data.max_sw_height;
  2056 +
  2057 + if (hei< viewHeight) {
  2058 + this.setData({ max_sw_height: viewHeight });
  2059 + }
  2060 + }
2042 }); 2061 });
2043 \ No newline at end of file 2062 \ No newline at end of file
pages/cart/cart/cart.wxml
  1 +<wxs module="g_filter" src="g_filter.wxs"></wxs>
1 <!-- <import src="../../tabbar/tabbar.wxml" /> 2 <!-- <import src="../../tabbar/tabbar.wxml" />
2 <template is="tabBar" data="{{tabBar}}" /> 3 <template is="tabBar" data="{{tabBar}}" />
3 --> 4 -->
@@ -7,9 +8,30 @@ @@ -7,9 +8,30 @@
7 <image mode="widthFix" class="picture" src="{{iurl}}miniapp/images/stores/Seckill.png"></image> 8 <image mode="widthFix" class="picture" src="{{iurl}}miniapp/images/stores/Seckill.png"></image>
8 </navigator> 9 </navigator>
9 10
10 -<navigator bindtap="nav_goto" class="picture" data-url="{{ad_data.ad_weapplink}}" wx:if="{{ad_data}}">  
11 - <image mode="widthFix" class="picture" src="{{ad_data.ad_code}}"></image>  
12 -</navigator> 11 +<block wx:if="{{ad_data}}">
  12 + <swiper class="swiper" circular="true"
  13 + indicator-dots="true"
  14 + style="height:{{max_sw_height}}rpx" >
  15 + <block wx:for="{{ad_data}}">
  16 +
  17 + <navigator url="{{item.ad_weapplink}}" class="s1_gk_a1" wx:if="{{g_filter.has_char(item.ad_weapplink,'plugin')>=0}}">
  18 + <swiper-item>
  19 + <image src="{{item.ad_code}}" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" lazy-load="true"/>
  20 + </swiper-item>
  21 + </navigator>
  22 +
  23 + <view data-url="{{item.ad_weapplink}}" class="s1_gk_a1" bindtap="go_url" wx:else>
  24 + <swiper-item>
  25 + <image src="{{item.ad_code}}" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" lazy-load="true"/>
  26 + </swiper-item>
  27 + </view>
  28 +
  29 + </block>
  30 + </swiper>
  31 +</block>
  32 +
  33 +
  34 +
13 35
14 36
15 37
pages/cart/cart/cart.wxss
@@ -353,3 +353,12 @@ page { @@ -353,3 +353,12 @@ page {
353 .quan_color{ background-color: #ff5306; height: 40rpx;color: #fff; padding: 0 10rpx; border-radius: 10rpx; margin-left: 10rpx} 353 .quan_color{ background-color: #ff5306; height: 40rpx;color: #fff; padding: 0 10rpx; border-radius: 10rpx; margin-left: 10rpx}
354 .red_c{color:#ff5306} 354 .red_c{color:#ff5306}
355 .title_show{ margin: 10rpx 0 10px 0;padding: 0 20rpx} 355 .title_show{ margin: 10rpx 0 10px 0;padding: 0 20rpx}
  356 +
  357 +
  358 +.swiper image {
  359 + height: auto;
  360 + width: 100%;
  361 + margin: 0;
  362 + padding: 0;
  363 + vertical-align: top;
  364 +}
pages/cart/cart/g_filter.wxs 0 → 100644
  1 +var g_filters = {
  2 + has_char:function(url,key){
  3 + if(!url) return -1;
  4 + return url.indexOf(key);
  5 + },
  6 + beg_time:function(beg_date){
  7 + var fmt1 = beg_date.substring(0, 19);
  8 + var reg = getRegExp("-", "g");
  9 + var fmt2 = fmt1.replace(reg, '/');
  10 + var t1 = getDate(fmt2);
  11 + var tnow=getDate();
  12 + if(t1<=tnow) return 1;
  13 + return 0;
  14 + },
  15 + end_time:function(end_date){
  16 + var fmt1 = end_date.substring(0, 19);
  17 + var reg = getRegExp("-", "g");
  18 + var fmt2 = fmt1.replace(reg, '/');
  19 + var t1 = getDate(fmt2);
  20 + var tnow=getDate();
  21 + if(t1>=tnow) return 1;
  22 + return 0;
  23 + }
  24 +}
  25 +module.exports = {
  26 + has_char: g_filters.has_char,
  27 + beg_time: g_filters.beg_time,
  28 + end_time: g_filters.end_time,
  29 +}
0 \ No newline at end of file 30 \ No newline at end of file
pages/cart/cart2/cart2.js
@@ -1118,6 +1118,7 @@ Page({ @@ -1118,6 +1118,7 @@ Page({
1118 } 1118 }
1119 //如果有设置不包邮区商品 1119 //如果有设置不包邮区商品
1120 if(by_qc.goods_list!="" && by_qc.goods_list!=undefined && by_qc!=null && freight_free>0){ 1120 if(by_qc.goods_list!="" && by_qc.goods_list!=undefined && by_qc!=null && freight_free>0){
  1121 + freight_free=0;
1121 no_ex_good=by_qc.goods_list; 1122 no_ex_good=by_qc.goods_list;
1122 } 1123 }
1123 } 1124 }
@@ -1210,24 +1211,34 @@ Page({ @@ -1210,24 +1211,34 @@ Page({
1210 continue; 1211 continue;
1211 } 1212 }
1212 1213
  1214 +
  1215 + var no_ex_good_arr=null;
  1216 + if(no_ex_good) no_ex_good_arr=no_ex_good.split(',');
  1217 +
1213 //----------------如果是选择了物流--------------------- 1218 //----------------如果是选择了物流---------------------
1214 - if(cart_item.exp_type == 0 && item[j].is_free_shipping==0){  
1215 - //如果地址不为空  
1216 - if (th.data.user_addr!=null){  
1217 - switch (item[j]['exp_sum_type']) {  
1218 - case 1:  
1219 - //统一运费  
1220 - o_shipping_price += item[j]['uniform_exp_sum'];break;  
1221 - case 2:  
1222 - if (goods_weight < 0) goods_weight = 0;  
1223 - //累积商品重量 每种商品的重量 * 数量  
1224 - goods_weight += item[j]['weight'] * item[j]['goods_num']; break;  
1225 - case 3:  
1226 - if (goods_piece < 0) goods_piece = 0;  
1227 - //累积商品数量  
1228 - goods_piece += item[j]['goods_num'];break;  
1229 - }  
1230 - } 1219 + if(cart_item.exp_type == 0 && item[j].is_free_shipping==0 && (!no_ex_good_arr || no_ex_good_arr.indexOf(item[j].goods_id+'')>-1 )){
  1220 +
  1221 +
  1222 + //如果地址不为空
  1223 + if (th.data.user_addr!=null){
  1224 + switch (item[j]['exp_sum_type']) {
  1225 + case 1:
  1226 + //统一运费
  1227 + o_shipping_price += item[j]['uniform_exp_sum'];break;
  1228 + case 2:+''
  1229 + if (goods_weight < 0) goods_weight = 0;
  1230 + //累积商品重量 每种商品的重量 * 数量
  1231 + goods_weight += item[j]['weight'] * item[j]['goods_num'];
  1232 +
  1233 + break;
  1234 + case 3:
  1235 + if (goods_piece < 0) goods_piece = 0;
  1236 + //累积商品数量
  1237 + goods_piece += item[j]['goods_num'];
  1238 + break;
  1239 + }
  1240 + }
  1241 +
1231 } 1242 }
1232 } 1243 }
1233 1244
utils/util.js
@@ -467,6 +467,21 @@ function convert_arr_key(list,key){ @@ -467,6 +467,21 @@ function convert_arr_key(list,key){
467 }) 467 })
468 return keyObs; 468 return keyObs;
469 } 469 }
  470 +
  471 +function ajax_ok(res){
  472 + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
  473 + return 1;
  474 + }
  475 + return 0;
  476 +}
  477 +function ajax_ok2(res){
  478 + if(res.data.code==0 && res.data.data && res.data.data.length>0){
  479 + return 1;
  480 + }
  481 + return 0;
  482 +}
  483 +
  484 +
470 module.exports = { 485 module.exports = {
471 formatTime: function(e, r) { 486 formatTime: function(e, r) {
472 var t = e ? new Date(1e3 * e) : new Date(), n = t.getFullYear(), o = t.getMonth() + 1, a = t.getDate(), u = t.getHours(), i = t.getMinutes(), f = t.getSeconds(), s = function(e) { 487 var t = e ? new Date(1e3 * e) : new Date(), n = t.getFullYear(), o = t.getMonth() + 1, a = t.getDate(), u = t.getHours(), i = t.getMinutes(), f = t.getSeconds(), s = function(e) {
@@ -574,5 +589,7 @@ module.exports = { @@ -574,5 +589,7 @@ module.exports = {
574 base64_encode:base64_encode, //64位加密 589 base64_encode:base64_encode, //64位加密
575 ob_to_parm:ob_to_parm ,//对象变成参数 590 ob_to_parm:ob_to_parm ,//对象变成参数
576 sha1:sha1, //sha1进行签名 591 sha1:sha1, //sha1进行签名
577 - convert_arr_key:convert_arr_key //将JS数组对象按其某个键值重组成Map对象 592 + convert_arr_key:convert_arr_key, //将JS数组对象按其某个键值重组成Map对象
  593 + ajax_ok:ajax_ok, //将JS数组对象按其某个键值重组成Map对象
  594 + ajax_ok2:ajax_ok2 //将JS数组对象按其某个键值重组成Map对象
578 }; 595 };