Commit 70c97451bde26021407f81ebc391abf4531bd00e

Authored by 后端研发-苏明海
2 parents 2e459ecb 53c48fd3

Merge branch 'dev' into 'test'

Dev

See merge request !958
packageB/pages/AI-test-skin/history_record/history_record.js
1 1 // packageB/pages/AI-test-skin/history_record/history_record.js
  2 +import * as echarts from '../../../components/ec-canvas/echarts';
  3 +
  4 +const app = getApp();
  5 +const request = app.request;
  6 +const os = app.globalData;
  7 +const setting = os.setting;
  8 +const ut = require('../../../../utils/util');
  9 +let initChart = null;
  10 +const option = {
  11 + backgroundColor: 'white',
  12 + tooltip: {},
  13 + grid:{
  14 + // left:'20%',
  15 + top:'30%',
  16 + // right:'10%'
  17 + },
  18 + legend: {
  19 + icon: 'circle',
  20 + itemWidth: 5,
  21 + itemHeight: 5,
  22 + selected: {
  23 + '综合': true,
  24 + '毛孔': false,
  25 + '黑头': false,
  26 + '色斑': false,
  27 + '皱纹': false,
  28 + '痤疮': false,
  29 + '敏感度': false,
  30 + '黑眼圈': false,
  31 + },
  32 + padding:[20,50],
  33 + data: [
  34 + {
  35 + name: '综合',
  36 + // textStyle: {
  37 + // backgroundColor: "#999",
  38 + // }
  39 + },
  40 + {
  41 + name: '毛孔',
  42 + }, {
  43 + name: '黑头',
  44 + },
  45 + {
  46 + name: '色斑',
  47 + },
  48 + {
  49 + name: '皱纹',
  50 + },
  51 + {
  52 + name: '痤疮',
  53 + },
  54 + {
  55 + name: '敏感度',
  56 + },
  57 + {
  58 + name: '黑眼圈',
  59 + },
  60 + ]
  61 + },
  62 + xAxis: {
  63 + type: 'category',
  64 + data: ["02/11", "02/16", "02/17"]
  65 + },
  66 + yAxis: {
  67 + type: 'value',
  68 + min: 0,
  69 + max: 100,
  70 + splitNumber: 4,
  71 + interval: 25,
  72 + },
  73 + series: [
  74 + {
  75 + name: '综合',
  76 + type: 'bar',
  77 + itemStyle: {
  78 + color: '#84e1eb',
  79 + borderRadius: 3,
  80 + },
  81 + barWidth: 8,
  82 + data: [5, 20, 36, 10, 10, 20]
  83 + },
  84 + {
  85 + name: '毛孔',
  86 + type: 'line',
  87 + lineStyle: {
  88 + color: "#fbb11f"
  89 + },
  90 + itemStyle: {
  91 + color: '#fbb11f',
  92 + },
  93 + data: [5, 20, 36, 10, 10, 20]
  94 + },
  95 + {
  96 + name: '黑头',
  97 + type: 'line',
  98 + lineStyle: {
  99 + color: "#e9552b"
  100 + },
  101 + itemStyle: {
  102 + color: '#e9552b',
  103 + },
  104 + data: [50, 60, 70]
  105 + },
  106 + {
  107 + name: '色斑',
  108 + type: 'line',
  109 + lineStyle: {
  110 + color: "#38ce87"
  111 + },
  112 + itemStyle: {
  113 + color: '#38ce87',
  114 + },
  115 + data: [50, 55, 60]
  116 + },
  117 + {
  118 + name: '皱纹',
  119 + type: 'line',
  120 + lineStyle: {
  121 + color: "#d67bf0"
  122 + },
  123 + itemStyle: {
  124 + color: '#d67bf0',
  125 + },
  126 + data: [80, 85, 90]
  127 + },
  128 + {
  129 + name: '痤疮',
  130 + type: 'line',
  131 + lineStyle: {
  132 + color: "#f85b95"
  133 + },
  134 + itemStyle: {
  135 + color: '#f85b95',
  136 + },
  137 + data: [30, 35, 40]
  138 + },
  139 + {
  140 + name: '敏感度',
  141 + type: 'line',
  142 + lineStyle: {
  143 + color: "#af78fc"
  144 + },
  145 + itemStyle: {
  146 + color: '#af78fc',
  147 + },
  148 + data: [20, 26, 10]
  149 + },
  150 + {
  151 + name: '黑眼圈',
  152 + type: 'line',
  153 + lineStyle: {
  154 + color: "#688eff"
  155 + },
  156 + itemStyle: {
  157 + color: '#688eff',
  158 + },
  159 + data: [50, 60, 20]
  160 + }
  161 + ]
  162 +};
2 163 Page({
3 164  
4 165 /**
5 166 * 页面的初始数据
6 167 */
7 168 data: {
8   -
  169 + arr1: ['综合', '毛孔', '黑头', '色斑', '皱纹', '痤疮', '敏感度', '黑眼圈'],
  170 + ec: {
  171 + onInit: function (canvas, width, height) {
  172 + initChart = echarts.init(canvas, null, {
  173 + width: width,
  174 + height: height,
  175 + });
  176 + canvas.setChart(initChart);
  177 + return initChart;
  178 + }
  179 + },
9 180 },
10 181  
11 182 /**
... ... @@ -21,12 +192,16 @@ Page({
21 192 onReady: function () {
22 193  
23 194 },
24   -
  195 + initChartOption() {
  196 + initChart.setOption(option);
  197 + },
25 198 /**
26 199 * 生命周期函数--监听页面显示
27 200 */
28 201 onShow: function () {
29   -
  202 + setTimeout(() => {
  203 + initChart.setOption(option);
  204 + }, 1000);
30 205 },
31 206  
32 207 /**
... ...
packageB/pages/AI-test-skin/history_record/history_record.json
1 1 {
2   - "usingComponents": {}
  2 + "navigationBarTitleText": "历史变化",
  3 + "usingComponents": {
  4 + "ec-canvas": "../../../components/ec-canvas/ec-canvas"
  5 + }
3 6 }
4 7 \ No newline at end of file
... ...
packageB/pages/AI-test-skin/history_record/history_record.wxml
1   -<!--packageB/pages/AI-test-skin/history_record/history_record.wxml-->
2   -<text>packageB/pages/AI-test-skin/history_record/history_record.wxml</text>
  1 +<view class="content">
  2 + <view style="margin-bottom: 5%;">历史分析</view>
  3 + <view class="echarts" style="border-radius: 30rpx;">
  4 + <view class="tubiao">
  5 + <ec-canvas id="mychart" canvas-id="mychart-bar" ec="{{ec}}"></ec-canvas>
  6 + </view>
  7 + <text class="fs24" style="position:absolute;bottom:25px;color: #333;">
  8 + 注:请确保多次拍摄姿态和环境光线一致。拍摄姿态的偏移、环境光线变化或者皮肤状态变化都可能导致分数较大波动。
  9 + </text>
  10 + </view>
  11 + <view class="mgv5">历史报告</view>
  12 +
  13 + <view class="history_list">
  14 + <view class="history_list_month">
  15 + <view style="color:#333;font-size:26rpx;margin-top: 30rpx">2022年02月</view>
  16 + <view class="souce">
  17 + <view style="font-weight: 600;">2022/02/19 15:35</view>
  18 + <view style="color:#fbb11f;">73分</view>
  19 + </view>
  20 + <view class="souce">
  21 + <view style="font-weight: 600;">2022/02/19 15:35</view>
  22 + <view style="color:#fbb11f;">73分</view>
  23 + </view>
  24 + <view class="souce">
  25 + <view style="font-weight: 600;">2022/02/19 15:35</view>
  26 + <view style="color:#fbb11f;">73分</view>
  27 + </view>
  28 + <view class="souce">
  29 + <view style="font-weight: 600;">2022/02/19 15:35</view>
  30 + <view style="color:#fbb11f;">73分</view>
  31 + </view>
  32 + <view class="souce">
  33 + <view style="font-weight: 600;">2022/02/19 15:35</view>
  34 + <view style="color:#fbb11f;">73分</view>
  35 + </view>
  36 + <view class="souce">
  37 + <view style="font-weight: 600;">2022/02/19 15:35</view>
  38 + <view style="color:#fbb11f;">73分</view>
  39 + </view>
  40 + <view class="souce">
  41 + <view style="font-weight: 600;">2022/02/19 15:35</view>
  42 + <view style="color:#fbb11f;">73分</view>
  43 + </view>
  44 + <view class="souce">
  45 + <view style="font-weight: 600;">2022/02/19 15:35</view>
  46 + <view style="color:#fbb11f;">73分</view>
  47 + </view>
  48 + <view class="souce">
  49 + <view style="font-weight: 600;">2022/02/19 15:35</view>
  50 + <view style="color:#fbb11f;">73分</view>
  51 + </view>
  52 + </view>
  53 + <view class="history_list_month">
  54 + <view style="color:#333;font-size:26rpx;margin-top: 30rpx">2022年02月</view>
  55 + <view class="souce">
  56 + <view style="font-weight: 600;">2022/02/19 15:35</view>
  57 + <view style="color:#fbb11f;">73分</view>
  58 + </view>
  59 + </view>
  60 + <view class="history_list_month">
  61 + <view style="color:#333;font-size:26rpx;margin-top: 30rpx">2022年02月</view>
  62 + <view class="souce">
  63 + <view style="font-weight: 600;">2022/02/19 15:35</view>
  64 + <view style="color:#fbb11f;">73分</view>
  65 + </view>
  66 + </view>
  67 + </view>
  68 +</view>
3 69 \ No newline at end of file
... ...
packageB/pages/AI-test-skin/history_record/history_record.wxss
... ... @@ -2,8 +2,52 @@
2 2 page {
3 3 width: 100vw;
4 4 height: 100%;
5   - padding: 20rpx;
6   - padding-top: 40rpx;
  5 +}
  6 +
  7 +.mgv5 {
  8 + margin-top: 5%;
  9 + margin-bottom: 5%;
  10 +}
  11 +
  12 +.content {
  13 + padding: 5%;
  14 + height: 100%;
  15 + width: 100%;
7 16 box-sizing: border-box;
8 17 background-color: #e7f5fb;
  18 +}
  19 +
  20 +.item {
  21 + padding: 10rpx 40rpx;
  22 + color: red;
  23 +}
  24 +
  25 +.echarts {
  26 + position: relative;
  27 + height: 60%;
  28 + padding: 20rpx;
  29 + background-color: #fff;
  30 +}
  31 +
  32 +.tubiao {
  33 + position: absolute;
  34 + top: 3%;
  35 + left: 50%;
  36 + transform: translateX(-50%);
  37 + height: 80%;
  38 + width: 100%;
  39 +}
  40 +
  41 +.history_list {
  42 + border-radius: 30rpx;
  43 + padding: 20rpx;
  44 + background-color: #fff;
  45 +}
  46 +
  47 +.souce {
  48 + display: flex;
  49 + justify-content: space-between;
  50 + font-size: 28rpx;
  51 + padding: 30rpx 0;
  52 + border-bottom: 2rpx solid #ccc;
9 53 }
10 54 \ No newline at end of file
... ...
packageB/pages/AI-test-skin/success_result/acne/acne.wxml
1   -<view class="mb_b5" bindtap="clickTab" id="hei_yan_quan">
  1 +<view class="mb_b5" id="cuo_chuang">
2 2 <view class="analyse_classify bg_white">
3 3 <view class="analyse_classify_header">
4 4 <view>
... ...
packageB/pages/AI-test-skin/success_result/blackhead/blackhead.wxml
1   -<view class="mb_b5">
  1 +<view class="mb_b5" id="hei_tou">
2 2 <view class="analyse_classify bg_white">
3 3 <view class="analyse_classify_header">
4 4 <view>
... ...
packageB/pages/AI-test-skin/success_result/dark/dark.wxml
1   -<view class="mb_b5">
  1 +<view class="mb_b5" id="hei_yan_quan">
2 2 <view class="analyse_classify bg_white">
3 3 <view class="analyse_classify_header">
4 4 <view>
... ...
packageB/pages/AI-test-skin/success_result/pore/pore.wxml
1   -<view class="mb_b5">
  1 +<view class="mb_b5" id="mao_kong">
2 2 <view class="analyse_classify bg_white">
3 3 <view class="analyse_classify_header">
4 4 <view>
... ...
packageB/pages/AI-test-skin/success_result/speckle/speckle.wxml
1   -<view class="mb_b5">
  1 +<view class="mb_b5" id="se_ban">
2 2 <view class="analyse_classify bg_white">
3 3 <view class="analyse_classify_header">
4 4 <view>
... ...
packageB/pages/AI-test-skin/success_result/success_result.js
1 1 /*
2 2 * @Author: abson
3 3 * @Date: 2022-02-16 15:36:47
4   - * @LastEditTime: 2022-02-18 18:02:00
  4 + * @LastEditTime: 2022-02-21 16:07:09
5 5 * @LastEditors: Please set LastEditors
6 6 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
7 7 * @FilePath: \MShopWeApp\packageB\pages\AI-test-skin\success_result\success_result.js
... ... @@ -96,21 +96,8 @@ Page({
96 96 if(acne_num>-0)
97 97 acne.get_goods(th,setting.stoid);
98 98 })
99   -
100   -
101   -
102   -
103   - },
104   - lo(){
105   - this.setData({
106   - oo:"hei_tou"
107   - })
108   - },
109   - lo1(){
110   - this.setData({
111   - oo:"zong_he"
112   - })
113 99 },
  100 +
114 101  
115 102 //-- 初始等级卡 --
116 103 init: function () {
... ...
packageB/pages/AI-test-skin/success_result/success_result.wxml
1 1 <wxs module="s_filter" src="s_filter.wxs"></wxs>
2 2  
3 3 <view style="height: 100rpx;">
4   - <scroll-view enable-flex scroll-into-view="{{tab_id}}" scroll-x class="tab_scroll">
  4 + <scroll-view enable-flex scroll-into-view="{{tab_id}}" scroll-with-animation scroll-x class="tab_scroll">
5 5 <view class="flex" style="height: 100%;">
6 6 <view wx:for="{{tab}}" wx:key="id" id="{{item.id}}" bindtap="clickTab" data-tab_id="{{item.id}}" data-index="{{index}}" class="tab_scroll_item {{currentIndex==index?'active':''}}">
7 7 {{item.name}}
... ... @@ -10,7 +10,7 @@
10 10 </scroll-view>
11 11 </view>
12 12  
13   -<scroll-view enable-flex scroll-into-view="{{oo}}">
  13 +<scroll-view enable-flex scroll-into-view="{{tab_id}}" scroll-with-animation scroll-y style="height: 100%;">
14 14 <view bindtap="lo" class="analyse_by_people" id="zong_he" >
15 15 <view class="analyse">
16 16 <view class="analyse_left">
... ... @@ -90,7 +90,8 @@
90 90 <block wx:if="{{acne_num}}">
91 91 <include src="acne/acne.wxml" />
92 92 </block>
93   -
  93 + <!-- 敏感度 -->
  94 + <include src="acne/acne.wxml" />
94 95 </view>
95 96 </scroll-view>
96 97  
... ...
packageB/pages/AI-test-skin/success_result/wrinkle/wrinkle.wxml
1   -<view class="mb_b5">
  1 +<view class="mb_b5" id="zhou_wen">
2 2 <view class="analyse_classify bg_white">
3 3 <view class="analyse_classify_header">
4 4 <view>
... ...
packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js
... ... @@ -1891,7 +1891,7 @@ Page({
1891 1891  
1892 1892  
1893 1893 //有不包邮区域,且不免运费
1894   - if (no_ex_id && freight_free > 0 && freight_free <= parseFloat(allpice) - cut_price - quan_price) {
  1894 + if (no_ex_id && freight_free > 0 && freight_free <= parseFloat(allpice)) {
1895 1895 //-----------获取不包邮区域,不包邮商品-------
1896 1896 await getApp().request.promiseGet("/api/weshop/areaFeemail/getAreaGoods", {
1897 1897 data: { store_id: os.stoid, id: no_ex_id }
... ...
packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js
... ... @@ -577,7 +577,7 @@ Page({
577 577 }
578 578 var shipping_price =
579 579 th.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
580   - goods_piece, th.data.user_addr, freight_free, allpice, rs);
  580 + goods_piece, th.data.user_addr, freight_free, allpice, rs,th.data.bn_pick);
581 581  
582 582 shipping_price = parseFloat(shipping_price).toFixed(2);
583 583 var wl_txt = "formData.shipping_price";
... ... @@ -1075,7 +1075,7 @@ Page({
1075 1075  
1076 1076 //-------------------计算物流---------------
1077 1077 calculatewuliu: function (code, o_shipping_price, goods_weight, out_of_weight,
1078   - goods_piece, user_addr, freight_free, o_price, rs) {
  1078 + goods_piece, user_addr, freight_free, o_price, rs,pickid) {
1079 1079 var price = 0,
1080 1080 th = this;
1081 1081 price += parseFloat(o_shipping_price);
... ...
packageC/pages/presell/cart/cart.js
... ... @@ -1522,7 +1522,7 @@ Page({
1522 1522  
1523 1523 //检查立即购买的商品是不是不包邮
1524 1524 check_good: function (arr, goods_id) {
1525   - if (!goods_id) goods_id = this.data.bn_goods.goods_id;
  1525 + if (!goods_id) goods_id = this.data.goods.goods_id;
1526 1526 for (var i in arr) {
1527 1527 var item = arr[i];
1528 1528 if (goods_id == item) return 0;
... ... @@ -1663,7 +1663,7 @@ Page({
1663 1663  
1664 1664 var t_shipping_price =
1665 1665 this.calculatewuliu(code, gift_shipping_price, goods_weight, out_of_weight,
1666   - goods_piece, user_addr, gift_freight_free, allpice, rs,th.data.bn_pick);
  1666 + goods_piece, user_addr, gift_freight_free, allpice, rs, th.data.bn_pick);
1667 1667 return t_shipping_price;
1668 1668  
1669 1669 },
... ... @@ -1725,14 +1725,25 @@ Page({
1725 1725 good = th.data.goods,
1726 1726 quan_price = 0,
1727 1727 exp_price = 0;
1728   -
  1728 + var no_ex_id = ee.no_ex_id;
1729 1729 var quan_no = null;
1730 1730 var bn_pick = th.data.pickup.pickup_id;
1731 1731 var allpice = th.data.all_price;
1732 1732 var out_of_weight = null; //超出多少重量
1733 1733 var freight_free = ee.freight_free; //全场满多少包邮
1734 1734 var weight_free = ee.weight_free; //多少kg内包邮
1735   -
  1735 + var no_ex_good = null;
  1736 + var by_qc = {};
  1737 + if (no_ex_id && freight_free > 0) {
  1738 + //-----------获取不包邮区域,不包邮商品-------
  1739 + await getApp().request.promiseGet("/api/weshop/areaFeemail/getAreaGoods", {
  1740 + data: { store_id: os.stoid, id: no_ex_id }
  1741 + }).then(res => {
  1742 + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) {
  1743 + by_qc = res.data.data[0];
  1744 + }
  1745 + })
  1746 + };
1736 1747 if (th.data.using_quan[bn_pick] != null && th.data.using_quan[bn_pick] != undefined)
1737 1748 quan_no = th.data.using_quan[bn_pick].coupon_no;
1738 1749  
... ... @@ -1824,9 +1835,38 @@ Page({
1824 1835 }
1825 1836  
1826 1837 var code = th.data.wu_arr[th.data.index].code;
  1838 + th.data.is_no_by[th.data.bn_pick] = 0;
  1839 + var no_by_data = null;
  1840 + //有不包邮区域,且不免运费
  1841 + if (no_ex_id && freight_free > 0 && freight_free <= parseFloat(allpice)) {
  1842 + //-----------获取不包邮区域,不包邮商品-------
  1843 + await getApp().request.promiseGet("/api/weshop/areaFeemail/getAreaGoods", {
  1844 + data: { store_id: os.stoid, id: no_ex_id }
  1845 + }).then(res => {
  1846 + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) {
  1847 + no_by_data = res.data.data[0];
  1848 + //如果有设置不包邮区域的时候
  1849 + if (res.data.data[0].region_list) {
  1850 + if (th.check_by_area(res.data.data[0].region_list)) {
  1851 + freight_free = 0;
  1852 + // out_of_weight = 0;
  1853 + th.data.is_no_by[th.data.bn_pick] = 1;
  1854 + }
  1855 + }
  1856 + //如果有设置不包邮商品
  1857 + if (res.data.data[0].goods_list && freight_free) {
  1858 + if (th.check_by_goods(res.data.data[0].goods_list)) {
  1859 + freight_free = 0;
  1860 + // out_of_weight = 0;
  1861 + th.data.is_no_by[th.data.bn_pick] = 1;
  1862 + }
  1863 + }
  1864 + }
  1865 + })
  1866 + }
1827 1867 var shipping_price =
1828 1868 th.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
1829   - goods_piece, th.data.user_addr, freight_free, allpice, rs);
  1869 + goods_piece, th.data.user_addr, freight_free, allpice, rs,th.data.bn_pick);
1830 1870 exp_price = parseFloat(shipping_price).toFixed(2);
1831 1871 }
1832 1872 th.wuliu_next(allpice, quan_price, exp_price);
... ...
pages/cart/cart2_pt/cart2_pt.js
... ... @@ -33,7 +33,7 @@ Page({
33 33 couponCode: "",//使用优惠券(多单就用逗号隔开)
34 34 shipping_price: 0,//物流费用
35 35 },
36   -
  36 + is_no_by:{},
37 37 /*----------------立即购买---------------------*/
38 38 is_b_now: 0, //0是购物车结算 1立即购买
39 39 bn_goods: null, //立即购买时候的调用商品
... ... @@ -404,13 +404,26 @@ Page({
404 404 console.log(th.data.formData);
405 405  
406 406 to.getConfig2(function (ee) {
407   - to.getwuliuprice(function (rs) {
  407 + to.getwuliuprice(async function (rs) {
408 408 console.log('calculatePrice2222');
409 409 console.log(rs);
410 410 var o_shipping_price = 0, goods_weight = -1, goods_piece = -1;
411 411 var out_of_weight = null; //超出多少重量
412 412 var freight_free = ee.freight_free; //全场满多少包邮
413 413 var weight_free = ee.weight_free; //多少kg内包邮
  414 + var no_ex_id = ee.no_ex_id;
  415 + var no_ex_good = null;
  416 + var by_qc = {};
  417 + if (no_ex_id && freight_free > 0) {
  418 + //-----------获取不包邮区域,不包邮商品-------
  419 + await getApp().request.promiseGet("/api/weshop/areaFeemail/getAreaGoods", {
  420 + data: { store_id: os.stoid, id: no_ex_id }
  421 + }).then(res => {
  422 + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) {
  423 + by_qc = res.data.data[0];
  424 + }
  425 + })
  426 + };
414 427 //-----------当地址不为空,且是物流时,计算物流费用,同时阶梯团不计算拼团价格----------
415 428 if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_free_shipping == 0 && (th.data.kt_type != 3 || th.data.bn_goods.is_normal == 1)) {
416 429 switch (good['exp_sum_type']) {
... ... @@ -430,14 +443,42 @@ Page({
430 443 //累积商品数量
431 444 goods_piece += good['buynum']; break;
432 445 }
433   -
434   - console.log(o_shipping_price + ":" + goods_weight + ":" + goods_piece);
  446 +
435 447 console.log(th.data.wu_arr);
436 448 var code = th.data.wu_arr[th.data.index].code;
437   - var freight_free = ee.freight_free; //全场满多少包邮
  449 + th.data.is_no_by[th.data.bn_pick] = 0;
  450 + var no_by_data = null;
  451 + //--全部金额--
  452 + //有不包邮区域,且不免运费
  453 + if (no_ex_id && freight_free > 0 && freight_free <= parseFloat(allpice)) {
  454 + //-----------获取不包邮区域,不包邮商品-------
  455 + await getApp().request.promiseGet("/api/weshop/areaFeemail/getAreaGoods", {
  456 + data: { store_id: os.stoid, id: no_ex_id }
  457 + }).then(res => {
  458 + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) {
  459 + no_by_data = res.data.data[0];
  460 + //如果有设置不包邮区域的时候
  461 + if (res.data.data[0].region_list) {
  462 + if (th.check_by_area(res.data.data[0].region_list)) {
  463 + freight_free = 0;
  464 + // out_of_weight = 0;
  465 + th.data.is_no_by[th.data.bn_pick] = 1;
  466 + }
  467 + }
  468 + //如果有设置不包邮商品
  469 + if (res.data.data[0].goods_list && freight_free) {
  470 + if (th.check_by_goods(res.data.data[0].goods_list)) {
  471 + freight_free = 0;
  472 + // out_of_weight = 0;
  473 + th.data.is_no_by[th.data.bn_pick] = 1;
  474 + }
  475 + }
  476 + }
  477 + })
  478 + }
438 479 var shipping_price =
439 480 th.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
440   - goods_piece, th.data.user_addr, freight_free, allpice, rs);
  481 + goods_piece, th.data.user_addr, freight_free, allpice, rs,th.data.bn_pick);
441 482  
442 483 shipping_price = parseFloat(shipping_price).toFixed(2);
443 484 var wl_txt = "formData.shipping_price";
... ... @@ -728,6 +769,39 @@ Page({
728 769 url: "/pages/user/checkcoupon/checkcoupon?" + s.Obj2Str(a)
729 770 });
730 771 },
  772 + //检查区域是不是包邮
  773 + check_area: function (arr) {
  774 + var user_addr = this.data.user_addr;
  775 + if (!user_addr) return 0;
  776 + for (var i in arr) {
  777 + var item = arr[i];
  778 + if (user_addr.twon == item || user_addr.district == item
  779 + || user_addr.city == item || user_addr.province == item) {
  780 + return 0;
  781 + }
  782 + }
  783 + return 1;
  784 + },
  785 +
  786 + //检查立即购买的商品是不是不包邮
  787 + check_good: function (arr, goods_id) {
  788 + if (!goods_id) goods_id = this.data.goods.goods_id;
  789 + for (var i in arr) {
  790 + var item = arr[i];
  791 + if (goods_id == item) return 0;
  792 + }
  793 + return 1;
  794 + },
  795 + check_by_area: function (region_list) {
  796 + var arr = region_list.split(",");
  797 + var check = this.check_area(arr);
  798 + return !check;
  799 + },
  800 + check_by_goods: function (goods_list, goods_id) {
  801 + var arr = goods_list.split(",");
  802 + var check = this.check_good(arr, goods_id);
  803 + return !check;
  804 + },
731 805 enterAddressPage: function () {
732 806 getApp().globalData.is_cart_old = 1;
733 807 this.data.enterAddressPage = !0, wx.navigateTo({
... ... @@ -808,15 +882,15 @@ Page({
808 882 }
809 883 }
810 884 //------超出重量----------
811   - if (out_of_weight < 0 && o_price >= freight_free) {
  885 + if (out_of_weight < 0 && o_price >= freight_free && !th.data.is_no_by[pickid]) {
812 886 fw_price = parseFloat(item['money']);
813 887 var out_of_weight = Math.abs(out_of_weight);
814 888 if (out_of_weight > item['first_weight']) {
815   - var fw = out_of_weight - item['first_weight'];
816   - var n = Math.ceil(fw / item['second_weight'])
817   - fw_price = fw_price + n * parseFloat(item['add_money']);
  889 + var fw = out_of_weight - item['first_weight'];
  890 + var n = Math.ceil(fw / item['second_weight'])
  891 + fw_price = fw_price + n * parseFloat(item['add_money']);
818 892 }
819   - }
  893 + }
820 894 //------按件数----------
821 895 if (goods_piece > 0) {
822 896 fp_price = parseFloat(item['piecemoney']);
... ...
pages/cart/cart_wk/cart_wk.js
... ... @@ -527,7 +527,7 @@ Page({
527 527 }
528 528 var shipping_price =
529 529 th.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
530   - goods_piece, th.data.user_addr, freight_free, allpice, rs);
  530 + goods_piece, th.data.user_addr, freight_free, allpice, rs,th.data.bn_pick);
531 531 var exp_price = parseFloat(shipping_price).toFixed(2);
532 532 allpice = parseFloat(exp_price) + parseFloat(allpice);
533 533 allpice = allpice.toFixed(2);
... ... @@ -545,7 +545,7 @@ Page({
545 545  
546 546 //----------------计算物流---------------
547 547 calculatewuliu: function (code, o_shipping_price, goods_weight, out_of_weight,
548   - goods_piece, user_addr, freight_free, o_price, rs) {
  548 + goods_piece, user_addr, freight_free, o_price, rs,pickid) {
549 549 var price = 0, th = this;
550 550 price += parseFloat(o_shipping_price);
551 551 //如果是包邮
... ...