diff --git a/packageB/pages/AI-test-skin/history_record/history_record.js b/packageB/pages/AI-test-skin/history_record/history_record.js index 3f973fe..60e8503 100644 --- a/packageB/pages/AI-test-skin/history_record/history_record.js +++ b/packageB/pages/AI-test-skin/history_record/history_record.js @@ -1,11 +1,182 @@ // packageB/pages/AI-test-skin/history_record/history_record.js +import * as echarts from '../../../components/ec-canvas/echarts'; + +const app = getApp(); +const request = app.request; +const os = app.globalData; +const setting = os.setting; +const ut = require('../../../../utils/util'); +let initChart = null; +const option = { + backgroundColor: 'white', + tooltip: {}, + grid:{ + // left:'20%', + top:'30%', + // right:'10%' + }, + legend: { + icon: 'circle', + itemWidth: 5, + itemHeight: 5, + selected: { + '综合': true, + '毛孔': false, + '黑头': false, + '色斑': false, + '皱纹': false, + '痤疮': false, + '敏感度': false, + '黑眼圈': false, + }, + padding:[20,50], + data: [ + { + name: '综合', + // textStyle: { + // backgroundColor: "#999", + // } + }, + { + name: '毛孔', + }, { + name: '黑头', + }, + { + name: '色斑', + }, + { + name: '皱纹', + }, + { + name: '痤疮', + }, + { + name: '敏感度', + }, + { + name: '黑眼圈', + }, + ] + }, + xAxis: { + type: 'category', + data: ["02/11", "02/16", "02/17"] + }, + yAxis: { + type: 'value', + min: 0, + max: 100, + splitNumber: 4, + interval: 25, + }, + series: [ + { + name: '综合', + type: 'bar', + itemStyle: { + color: '#84e1eb', + borderRadius: 3, + }, + barWidth: 8, + data: [5, 20, 36, 10, 10, 20] + }, + { + name: '毛孔', + type: 'line', + lineStyle: { + color: "#fbb11f" + }, + itemStyle: { + color: '#fbb11f', + }, + data: [5, 20, 36, 10, 10, 20] + }, + { + name: '黑头', + type: 'line', + lineStyle: { + color: "#e9552b" + }, + itemStyle: { + color: '#e9552b', + }, + data: [50, 60, 70] + }, + { + name: '色斑', + type: 'line', + lineStyle: { + color: "#38ce87" + }, + itemStyle: { + color: '#38ce87', + }, + data: [50, 55, 60] + }, + { + name: '皱纹', + type: 'line', + lineStyle: { + color: "#d67bf0" + }, + itemStyle: { + color: '#d67bf0', + }, + data: [80, 85, 90] + }, + { + name: '痤疮', + type: 'line', + lineStyle: { + color: "#f85b95" + }, + itemStyle: { + color: '#f85b95', + }, + data: [30, 35, 40] + }, + { + name: '敏感度', + type: 'line', + lineStyle: { + color: "#af78fc" + }, + itemStyle: { + color: '#af78fc', + }, + data: [20, 26, 10] + }, + { + name: '黑眼圈', + type: 'line', + lineStyle: { + color: "#688eff" + }, + itemStyle: { + color: '#688eff', + }, + data: [50, 60, 20] + } + ] +}; Page({ /** * 页面的初始数据 */ data: { - + arr1: ['综合', '毛孔', '黑头', '色斑', '皱纹', '痤疮', '敏感度', '黑眼圈'], + ec: { + onInit: function (canvas, width, height) { + initChart = echarts.init(canvas, null, { + width: width, + height: height, + }); + canvas.setChart(initChart); + return initChart; + } + }, }, /** @@ -21,12 +192,16 @@ Page({ onReady: function () { }, - + initChartOption() { + initChart.setOption(option); + }, /** * 生命周期函数--监听页面显示 */ onShow: function () { - + setTimeout(() => { + initChart.setOption(option); + }, 1000); }, /** diff --git a/packageB/pages/AI-test-skin/history_record/history_record.json b/packageB/pages/AI-test-skin/history_record/history_record.json index 8835af0..3ea23fa 100644 --- a/packageB/pages/AI-test-skin/history_record/history_record.json +++ b/packageB/pages/AI-test-skin/history_record/history_record.json @@ -1,3 +1,6 @@ { - "usingComponents": {} + "navigationBarTitleText": "历史变化", + "usingComponents": { + "ec-canvas": "../../../components/ec-canvas/ec-canvas" + } } \ No newline at end of file diff --git a/packageB/pages/AI-test-skin/history_record/history_record.wxml b/packageB/pages/AI-test-skin/history_record/history_record.wxml index 94d50bb..3faa719 100644 --- a/packageB/pages/AI-test-skin/history_record/history_record.wxml +++ b/packageB/pages/AI-test-skin/history_record/history_record.wxml @@ -1,2 +1,68 @@ - -packageB/pages/AI-test-skin/history_record/history_record.wxml + + 历史分析 + + + + + + 注:请确保多次拍摄姿态和环境光线一致。拍摄姿态的偏移、环境光线变化或者皮肤状态变化都可能导致分数较大波动。 + + + 历史报告 + + + + 2022年02月 + + 2022/02/19 15:35 + 73分 + + + 2022/02/19 15:35 + 73分 + + + 2022/02/19 15:35 + 73分 + + + 2022/02/19 15:35 + 73分 + + + 2022/02/19 15:35 + 73分 + + + 2022/02/19 15:35 + 73分 + + + 2022/02/19 15:35 + 73分 + + + 2022/02/19 15:35 + 73分 + + + 2022/02/19 15:35 + 73分 + + + + 2022年02月 + + 2022/02/19 15:35 + 73分 + + + + 2022年02月 + + 2022/02/19 15:35 + 73分 + + + + \ No newline at end of file diff --git a/packageB/pages/AI-test-skin/history_record/history_record.wxss b/packageB/pages/AI-test-skin/history_record/history_record.wxss index 2853cd7..a7a41fd 100644 --- a/packageB/pages/AI-test-skin/history_record/history_record.wxss +++ b/packageB/pages/AI-test-skin/history_record/history_record.wxss @@ -2,8 +2,52 @@ page { width: 100vw; height: 100%; - padding: 20rpx; - padding-top: 40rpx; +} + +.mgv5 { + margin-top: 5%; + margin-bottom: 5%; +} + +.content { + padding: 5%; + height: 100%; + width: 100%; box-sizing: border-box; background-color: #e7f5fb; +} + +.item { + padding: 10rpx 40rpx; + color: red; +} + +.echarts { + position: relative; + height: 60%; + padding: 20rpx; + background-color: #fff; +} + +.tubiao { + position: absolute; + top: 3%; + left: 50%; + transform: translateX(-50%); + height: 80%; + width: 100%; +} + +.history_list { + border-radius: 30rpx; + padding: 20rpx; + background-color: #fff; +} + +.souce { + display: flex; + justify-content: space-between; + font-size: 28rpx; + padding: 30rpx 0; + border-bottom: 2rpx solid #ccc; } \ No newline at end of file diff --git a/packageB/pages/AI-test-skin/success_result/acne/acne.wxml b/packageB/pages/AI-test-skin/success_result/acne/acne.wxml index 6fea6ea..d3be73a 100644 --- a/packageB/pages/AI-test-skin/success_result/acne/acne.wxml +++ b/packageB/pages/AI-test-skin/success_result/acne/acne.wxml @@ -1,4 +1,4 @@ - + diff --git a/packageB/pages/AI-test-skin/success_result/blackhead/blackhead.wxml b/packageB/pages/AI-test-skin/success_result/blackhead/blackhead.wxml index 22be09b..d482415 100644 --- a/packageB/pages/AI-test-skin/success_result/blackhead/blackhead.wxml +++ b/packageB/pages/AI-test-skin/success_result/blackhead/blackhead.wxml @@ -1,4 +1,4 @@ - + diff --git a/packageB/pages/AI-test-skin/success_result/dark/dark.wxml b/packageB/pages/AI-test-skin/success_result/dark/dark.wxml index 52c2b65..6490c0c 100644 --- a/packageB/pages/AI-test-skin/success_result/dark/dark.wxml +++ b/packageB/pages/AI-test-skin/success_result/dark/dark.wxml @@ -1,4 +1,4 @@ - + diff --git a/packageB/pages/AI-test-skin/success_result/pore/pore.wxml b/packageB/pages/AI-test-skin/success_result/pore/pore.wxml index cc860e5..ba04684 100644 --- a/packageB/pages/AI-test-skin/success_result/pore/pore.wxml +++ b/packageB/pages/AI-test-skin/success_result/pore/pore.wxml @@ -1,4 +1,4 @@ - + diff --git a/packageB/pages/AI-test-skin/success_result/speckle/speckle.wxml b/packageB/pages/AI-test-skin/success_result/speckle/speckle.wxml index ce00cb5..0aed973 100644 --- a/packageB/pages/AI-test-skin/success_result/speckle/speckle.wxml +++ b/packageB/pages/AI-test-skin/success_result/speckle/speckle.wxml @@ -1,4 +1,4 @@ - + diff --git a/packageB/pages/AI-test-skin/success_result/success_result.js b/packageB/pages/AI-test-skin/success_result/success_result.js index e0254b6..858e587 100644 --- a/packageB/pages/AI-test-skin/success_result/success_result.js +++ b/packageB/pages/AI-test-skin/success_result/success_result.js @@ -1,7 +1,7 @@ /* * @Author: abson * @Date: 2022-02-16 15:36:47 - * @LastEditTime: 2022-02-18 18:02:00 + * @LastEditTime: 2022-02-21 16:07:09 * @LastEditors: Please set LastEditors * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @FilePath: \MShopWeApp\packageB\pages\AI-test-skin\success_result\success_result.js @@ -96,21 +96,8 @@ Page({ if(acne_num>-0) acne.get_goods(th,setting.stoid); }) - - - - - }, - lo(){ - this.setData({ - oo:"hei_tou" - }) - }, - lo1(){ - this.setData({ - oo:"zong_he" - }) }, + //-- 初始等级卡 -- init: function () { diff --git a/packageB/pages/AI-test-skin/success_result/success_result.wxml b/packageB/pages/AI-test-skin/success_result/success_result.wxml index 54b6a84..3fe22e9 100644 --- a/packageB/pages/AI-test-skin/success_result/success_result.wxml +++ b/packageB/pages/AI-test-skin/success_result/success_result.wxml @@ -1,7 +1,7 @@ - + {{item.name}} @@ -10,7 +10,7 @@ - + @@ -90,7 +90,8 @@ - + + diff --git a/packageB/pages/AI-test-skin/success_result/wrinkle/wrinkle.wxml b/packageB/pages/AI-test-skin/success_result/wrinkle/wrinkle.wxml index 55ca7ff..834db10 100644 --- a/packageB/pages/AI-test-skin/success_result/wrinkle/wrinkle.wxml +++ b/packageB/pages/AI-test-skin/success_result/wrinkle/wrinkle.wxml @@ -1,4 +1,4 @@ - + diff --git a/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js b/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js index b72c56d..56db163 100644 --- a/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js +++ b/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js @@ -1891,7 +1891,7 @@ Page({ //有不包邮区域,且不免运费 - if (no_ex_id && freight_free > 0 && freight_free <= parseFloat(allpice) - cut_price - quan_price) { + if (no_ex_id && freight_free > 0 && freight_free <= parseFloat(allpice)) { //-----------获取不包邮区域,不包邮商品------- await getApp().request.promiseGet("/api/weshop/areaFeemail/getAreaGoods", { data: { store_id: os.stoid, id: no_ex_id } diff --git a/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js b/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js index f33d5da..579e944 100644 --- a/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js +++ b/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js @@ -577,7 +577,7 @@ Page({ } var shipping_price = th.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight, - goods_piece, th.data.user_addr, freight_free, allpice, rs); + goods_piece, th.data.user_addr, freight_free, allpice, rs,th.data.bn_pick); shipping_price = parseFloat(shipping_price).toFixed(2); var wl_txt = "formData.shipping_price"; @@ -1075,7 +1075,7 @@ Page({ //-------------------计算物流--------------- calculatewuliu: function (code, o_shipping_price, goods_weight, out_of_weight, - goods_piece, user_addr, freight_free, o_price, rs) { + goods_piece, user_addr, freight_free, o_price, rs,pickid) { var price = 0, th = this; price += parseFloat(o_shipping_price); diff --git a/packageC/pages/presell/cart/cart.js b/packageC/pages/presell/cart/cart.js index 01e447f..9fdfdd2 100644 --- a/packageC/pages/presell/cart/cart.js +++ b/packageC/pages/presell/cart/cart.js @@ -1522,7 +1522,7 @@ Page({ //检查立即购买的商品是不是不包邮 check_good: function (arr, goods_id) { - if (!goods_id) goods_id = this.data.bn_goods.goods_id; + if (!goods_id) goods_id = this.data.goods.goods_id; for (var i in arr) { var item = arr[i]; if (goods_id == item) return 0; @@ -1663,7 +1663,7 @@ Page({ var t_shipping_price = this.calculatewuliu(code, gift_shipping_price, goods_weight, out_of_weight, - goods_piece, user_addr, gift_freight_free, allpice, rs,th.data.bn_pick); + goods_piece, user_addr, gift_freight_free, allpice, rs, th.data.bn_pick); return t_shipping_price; }, @@ -1725,14 +1725,25 @@ Page({ good = th.data.goods, quan_price = 0, exp_price = 0; - + var no_ex_id = ee.no_ex_id; var quan_no = null; var bn_pick = th.data.pickup.pickup_id; var allpice = th.data.all_price; var out_of_weight = null; //超出多少重量 var freight_free = ee.freight_free; //全场满多少包邮 var weight_free = ee.weight_free; //多少kg内包邮 - + var no_ex_good = null; + var by_qc = {}; + if (no_ex_id && freight_free > 0) { + //-----------获取不包邮区域,不包邮商品------- + await getApp().request.promiseGet("/api/weshop/areaFeemail/getAreaGoods", { + data: { store_id: os.stoid, id: no_ex_id } + }).then(res => { + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) { + by_qc = res.data.data[0]; + } + }) + }; if (th.data.using_quan[bn_pick] != null && th.data.using_quan[bn_pick] != undefined) quan_no = th.data.using_quan[bn_pick].coupon_no; @@ -1824,9 +1835,38 @@ Page({ } var code = th.data.wu_arr[th.data.index].code; + th.data.is_no_by[th.data.bn_pick] = 0; + var no_by_data = null; + //有不包邮区域,且不免运费 + if (no_ex_id && freight_free > 0 && freight_free <= parseFloat(allpice)) { + //-----------获取不包邮区域,不包邮商品------- + await getApp().request.promiseGet("/api/weshop/areaFeemail/getAreaGoods", { + data: { store_id: os.stoid, id: no_ex_id } + }).then(res => { + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) { + no_by_data = res.data.data[0]; + //如果有设置不包邮区域的时候 + if (res.data.data[0].region_list) { + if (th.check_by_area(res.data.data[0].region_list)) { + freight_free = 0; + // out_of_weight = 0; + th.data.is_no_by[th.data.bn_pick] = 1; + } + } + //如果有设置不包邮商品 + if (res.data.data[0].goods_list && freight_free) { + if (th.check_by_goods(res.data.data[0].goods_list)) { + freight_free = 0; + // out_of_weight = 0; + th.data.is_no_by[th.data.bn_pick] = 1; + } + } + } + }) + } var shipping_price = th.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight, - goods_piece, th.data.user_addr, freight_free, allpice, rs); + goods_piece, th.data.user_addr, freight_free, allpice, rs,th.data.bn_pick); exp_price = parseFloat(shipping_price).toFixed(2); } th.wuliu_next(allpice, quan_price, exp_price); diff --git a/pages/cart/cart2_pt/cart2_pt.js b/pages/cart/cart2_pt/cart2_pt.js index fd3f517..0995f91 100644 --- a/pages/cart/cart2_pt/cart2_pt.js +++ b/pages/cart/cart2_pt/cart2_pt.js @@ -33,7 +33,7 @@ Page({ couponCode: "",//使用优惠券(多单就用逗号隔开) shipping_price: 0,//物流费用 }, - + is_no_by:{}, /*----------------立即购买---------------------*/ is_b_now: 0, //0是购物车结算 1立即购买 bn_goods: null, //立即购买时候的调用商品 @@ -404,13 +404,26 @@ Page({ console.log(th.data.formData); to.getConfig2(function (ee) { - to.getwuliuprice(function (rs) { + to.getwuliuprice(async function (rs) { console.log('calculatePrice2222'); console.log(rs); var o_shipping_price = 0, goods_weight = -1, goods_piece = -1; var out_of_weight = null; //超出多少重量 var freight_free = ee.freight_free; //全场满多少包邮 var weight_free = ee.weight_free; //多少kg内包邮 + var no_ex_id = ee.no_ex_id; + var no_ex_good = null; + var by_qc = {}; + if (no_ex_id && freight_free > 0) { + //-----------获取不包邮区域,不包邮商品------- + await getApp().request.promiseGet("/api/weshop/areaFeemail/getAreaGoods", { + data: { store_id: os.stoid, id: no_ex_id } + }).then(res => { + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) { + by_qc = res.data.data[0]; + } + }) + }; //-----------当地址不为空,且是物流时,计算物流费用,同时阶梯团不计算拼团价格---------- 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)) { switch (good['exp_sum_type']) { @@ -430,14 +443,42 @@ Page({ //累积商品数量 goods_piece += good['buynum']; break; } - - console.log(o_shipping_price + ":" + goods_weight + ":" + goods_piece); + console.log(th.data.wu_arr); var code = th.data.wu_arr[th.data.index].code; - var freight_free = ee.freight_free; //全场满多少包邮 + th.data.is_no_by[th.data.bn_pick] = 0; + var no_by_data = null; + //--全部金额-- + //有不包邮区域,且不免运费 + if (no_ex_id && freight_free > 0 && freight_free <= parseFloat(allpice)) { + //-----------获取不包邮区域,不包邮商品------- + await getApp().request.promiseGet("/api/weshop/areaFeemail/getAreaGoods", { + data: { store_id: os.stoid, id: no_ex_id } + }).then(res => { + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) { + no_by_data = res.data.data[0]; + //如果有设置不包邮区域的时候 + if (res.data.data[0].region_list) { + if (th.check_by_area(res.data.data[0].region_list)) { + freight_free = 0; + // out_of_weight = 0; + th.data.is_no_by[th.data.bn_pick] = 1; + } + } + //如果有设置不包邮商品 + if (res.data.data[0].goods_list && freight_free) { + if (th.check_by_goods(res.data.data[0].goods_list)) { + freight_free = 0; + // out_of_weight = 0; + th.data.is_no_by[th.data.bn_pick] = 1; + } + } + } + }) + } var shipping_price = th.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight, - goods_piece, th.data.user_addr, freight_free, allpice, rs); + goods_piece, th.data.user_addr, freight_free, allpice, rs,th.data.bn_pick); shipping_price = parseFloat(shipping_price).toFixed(2); var wl_txt = "formData.shipping_price"; @@ -728,6 +769,39 @@ Page({ url: "/pages/user/checkcoupon/checkcoupon?" + s.Obj2Str(a) }); }, + //检查区域是不是包邮 + check_area: function (arr) { + var user_addr = this.data.user_addr; + if (!user_addr) return 0; + for (var i in arr) { + var item = arr[i]; + if (user_addr.twon == item || user_addr.district == item + || user_addr.city == item || user_addr.province == item) { + return 0; + } + } + return 1; + }, + + //检查立即购买的商品是不是不包邮 + check_good: function (arr, goods_id) { + if (!goods_id) goods_id = this.data.goods.goods_id; + for (var i in arr) { + var item = arr[i]; + if (goods_id == item) return 0; + } + return 1; + }, + check_by_area: function (region_list) { + var arr = region_list.split(","); + var check = this.check_area(arr); + return !check; + }, + check_by_goods: function (goods_list, goods_id) { + var arr = goods_list.split(","); + var check = this.check_good(arr, goods_id); + return !check; + }, enterAddressPage: function () { getApp().globalData.is_cart_old = 1; this.data.enterAddressPage = !0, wx.navigateTo({ @@ -808,15 +882,15 @@ Page({ } } //------超出重量---------- - if (out_of_weight < 0 && o_price >= freight_free) { + if (out_of_weight < 0 && o_price >= freight_free && !th.data.is_no_by[pickid]) { fw_price = parseFloat(item['money']); var out_of_weight = Math.abs(out_of_weight); if (out_of_weight > item['first_weight']) { - var fw = out_of_weight - item['first_weight']; - var n = Math.ceil(fw / item['second_weight']) - fw_price = fw_price + n * parseFloat(item['add_money']); + var fw = out_of_weight - item['first_weight']; + var n = Math.ceil(fw / item['second_weight']) + fw_price = fw_price + n * parseFloat(item['add_money']); } - } + } //------按件数---------- if (goods_piece > 0) { fp_price = parseFloat(item['piecemoney']); diff --git a/pages/cart/cart_wk/cart_wk.js b/pages/cart/cart_wk/cart_wk.js index c66fbcc..3ac786a 100644 --- a/pages/cart/cart_wk/cart_wk.js +++ b/pages/cart/cart_wk/cart_wk.js @@ -527,7 +527,7 @@ Page({ } var shipping_price = th.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight, - goods_piece, th.data.user_addr, freight_free, allpice, rs); + goods_piece, th.data.user_addr, freight_free, allpice, rs,th.data.bn_pick); var exp_price = parseFloat(shipping_price).toFixed(2); allpice = parseFloat(exp_price) + parseFloat(allpice); allpice = allpice.toFixed(2); @@ -545,7 +545,7 @@ Page({ //----------------计算物流--------------- calculatewuliu: function (code, o_shipping_price, goods_weight, out_of_weight, - goods_piece, user_addr, freight_free, o_price, rs) { + goods_piece, user_addr, freight_free, o_price, rs,pickid) { var price = 0, th = this; price += parseFloat(o_shipping_price); //如果是包邮