diff --git a/app.json b/app.json index 92cd7c5..900da75 100644 --- a/app.json +++ b/app.json @@ -211,7 +211,9 @@ "pages/user/Detailed/Detailed", "pages/user/user_fw/user_fw", "pages/user/cardinfo/cardinfo", - "pages/user/nick_avatar/nick_avatar" + "pages/user/nick_avatar/nick_avatar", + "pages/user/slimming/slimming", + "pages/user/punchInhistory/punchInhistory" ] } diff --git a/packageE/pages/user/punchInhistory/punchInhistory.js b/packageE/pages/user/punchInhistory/punchInhistory.js new file mode 100644 index 0000000..6e2cbd8 --- /dev/null +++ b/packageE/pages/user/punchInhistory/punchInhistory.js @@ -0,0 +1,166 @@ +var e = getApp(), os = e.globalData.setting; +var utils = require('../../../../utils/util.js'); +var regeneratorRuntime = require('../../../../utils/runtime.js'); +const request = getApp().request; +let app = getApp(); + + +Page({ + + filters: { + toFix(val) { + if (val === undefined) return 0; + if (val === null) return 0; + if (isNaN(val)) return 0; + if (val === '') return 0; + return parseFloat(val).toFixed(2); + }, + //获取样式 + set_def: function (val, def, is_price) { + if (val == undefined) { + if (def) return def; + return "-" + } + if (is_price) { + return parseFloat(val + "").toFixed(2); + } + return val; + }, + }, + + + data:{ + imghost: app.globalData.setting.imghost, + keyword: '', + list: [], + list2:[], + diffweight:'', + standardweight:'', + howday:'', + }, + + onLoad(options) { + var that = this; + if (options.customerid != undefined && options.customerid != "" && options.customerid != null) { + + that.setData({ + customerid:options.customerid, + diffweight:options.diffweight, + standardweight:options.standardweight, + howday:options.howday + }) + } + + + var userInfo = getApp().globalData.userInfo; + if (userInfo) { + that.userInfo = userInfo; + that.loding = 1; + that.init_data(); + } + + + wx.getSystemInfo({ + success: function (res) { + var clientWidth = res.windowWidth; + var clientHeight = res.windowHeight; + var rpxR = 750 / clientWidth; + var calc = clientHeight * rpxR; + that.setData({ + calc:calc + }) + } + }) + + }, + + onShow: function () { + if (getApp().globalData.userInfo && !this.userInfo) { + this.setData({ + userInfo:userInfo + }) + + this.loding = 1; + this.init_data(); + } + }, + + + //初始化数据 + init_data() { + var that = this; + let userInfo = getApp().globalData.userInfo; + + let req = { + customerid: that.data.customerid, + store_id: userInfo.store_id, //用户id + //staffid: getApp().globalData.RoleData.StaffId, //商户编号 + ApiName: 'api.slimming.clock.registration.sum.query', + }; + + that.get_list(req); + }, + + + //获取门店报表 + get_list(req) { + var that = this; + if (that.loading) { + return false; + } + that.loading = 1; + + if (req) { + + that.setData({ + noMore:false, + list:[], + list2:[] + }) + } else { + if (that.noMore) { + that.loading = 0; + return false; + } + req = that.req; //如果不是全选的参数,就是page分页+1 + req.page++; + } + + //请求参数进行存储 + that.req = req; + + wx.showLoading({ + title: '加载中' + }); + + var url = '/api/weshop/delphiapi/pageErpApi?accdb='+getApp().globalData.config.erpid; + + getApp().request.promiseGet(url, { + data: req + }) + .then((res) => { + wx.hideLoading(); + that.loading = 0; + + if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length) { + + var list=that.data.list; + + for (let i = 0; i < res.data.data.pageData.length; i++) { + list.push(res.data.data.pageData[i]); + } + + that.setData({ + list:list + }) + + } else { + getApp().confirmBox(res.data.msg) + } + }); + }, + + +}) + + diff --git a/packageE/pages/user/punchInhistory/punchInhistory.json b/packageE/pages/user/punchInhistory/punchInhistory.json new file mode 100644 index 0000000..68c131d --- /dev/null +++ b/packageE/pages/user/punchInhistory/punchInhistory.json @@ -0,0 +1,8 @@ +{ + "navigationBarTitleText": "瘦身日记", + "usingComponents": { + "qr_code": "/components/qr_code/qr_code", + "warn": "/components/long_warn/long_warn", + "nodata": "/components/nodata/nodata" + } +} \ No newline at end of file diff --git a/packageE/pages/user/punchInhistory/punchInhistory.wxml b/packageE/pages/user/punchInhistory/punchInhistory.wxml new file mode 100644 index 0000000..e736cac --- /dev/null +++ b/packageE/pages/user/punchInhistory/punchInhistory.wxml @@ -0,0 +1,77 @@ + + + + + 总览 + + + + {{diffweight||"-"}} + 累计减重(斤) + + + + {{howday||"-"}} + 到店次数 + + + + {{standardweight||"-"}} + 目标体重(斤) + + + + + + + + + + + {{item.fyearmonth}} 减重 {{item.diffweight}} 斤 到店 {{ item.weightqty }} 次 + + + + + + + + + {{item2.billdate}} + + + {{item2.weight}}斤 + + + 减重 {{item2.diffweight}} + + + + + + + {{item2.remark}} + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packageE/pages/user/punchInhistory/punchInhistory.wxss b/packageE/pages/user/punchInhistory/punchInhistory.wxss new file mode 100644 index 0000000..3da3215 --- /dev/null +++ b/packageE/pages/user/punchInhistory/punchInhistory.wxss @@ -0,0 +1,379 @@ +page{ + background-color: #f2f2f2; +} + +.tab_sec_list { + background-color: #fff; + border-bottom: 1rpx solid #eee; + border-top: 1rpx solid #eee; + +} + +.tab_th { + background-color: #fff; + flex-shrink: 0; + height: 68rpx; + line-height: 68rpx; + width: 187rpx; + text-align: center; + position: relative; + font-size: 24rpx; + color: #A6A6A6FF; +} + +.coo { + color: rgba(56, 56, 56, 1); +} + +.h_line { + position: absolute; + left: 50%; + margin-left: -30rpx; + width: 44rpx; + height: 7rpx; + overflow: hidden; + background-color: rgba(254, 58, 98, 1); + display: none; + border-radius: 17rpx !important; + bottom: -4rpx; +} + +.tab_thactive { + background-color: #fff; + flex-shrink: 0; + height: 63rpx; + line-height: 63rpx; + width: 187rpx; + text-align: center; + /* border-bottom: 1rpx solid #eee; + border-top: 1rpx solid #eee; */ + position: relative; + font-weight: bolder; + color: rgba(254, 58, 98, 1); + font-size: 35rpx; +} + +.tab_thactive .h_line { + display: block !important; + border-radius: 8rpx !important; +} + +.container { + margin-top: 73rpx; +} + +/* 图表 */ +.chart_card { + position: relative; + display: flex; + background: rgba(255, 255, 255, 1); + border-radius: 17rpx; + margin: 20rpx 23rpx; +} + +.net4 { + height: 60rpx; + color: rgba(56, 56, 56, 1); + font-size: 35rpx; + text-align: center; + display: flex; + align-items: center; +} + +.charts-box { + /* width: 550rpx; */ + width: 100%; + height: 350rpx; + /* margin-left: 50rpx; */ +} + +.cont { + margin-top: 88rpx; + width: 100%; +} +.pl{ + max-width: 200rpx; + margin-right: 4rpx; + height: 40rpx; +} +/* 图表下面 */ +.box { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + box-sizing: border-box; + padding: 21rpx 26rpx; + margin: 20rpx 23rpx; + width: 705rpx; + height: 363rpx; + opacity: 1; + background: #FFFFFFFF; + border-radius: 17rpx; +} + +.box_item1 { + display: flex; + flex-direction: column; + width: 320rpx; + height: 147rpx; + background: #F9FAFE; + color: #333446; + text-align: center; + border-radius: 17rpx; + +} + +.box_item2 { + display: flex; + flex-direction: column; + width: 320rpx; + height: 147rpx; + background: #FFE3E9; + color: #FE3A62; + text-align: center; + border-radius: 17rpx; +} + +/* 门店报表 */ +.n_top { + display: flex; + flex-direction: column; + /* height: 224rpx; */ + /* background: #FFFFFFFF; */ + /* padding-bottom: 20rpx; */ + border-radius: 0 0 17rpx 17rpx; +} + +/* 搜索框 */ +.search-box { + display: flex; + align-items: center; + justify-content: center; + background: #FFFFFFFF; + padding-top: 20rpx; + padding-bottom: 20rpx; +} + +.btn_sear { + display: flex; + justify-content: center; + align-items: center; + color: #fff; + width: 107rpx; + height: 68rpx; + border-radius: 17rpx; + margin: 0 14rpx 0 18rpx; + background: linear-gradient(270deg, rgba(255, 24, 126, 1) 0%, rgba(255, 89, 64, 1) 100%); + letter-spacing: 4rpx; + text-indent: 4rpx; +} + +.inp_view { + background-color: rgb(249, 250, 254); + height: 82rpx; + width: 228rpx; + border-radius: 10rpx; + color: rgba(128, 128, 128, 1); +} + +.line { + height: 4rpx; + background: #C4C4C4; + margin: 0 15rpx; + width: 35rpx; +} + +.sign_tb { + width: 35rpx; + height: 35rpx; + margin-right: 10rpx; +} + +/* 搜索框下面 */ +.total_count { + width: 94%; + height: 180rpx; + margin: 3% 3% 0 3%; + background: white; + padding-bottom: 20rpx; + border-radius:17rpx; +} + +.total_box { + display: flex; + justify-content: space-between; + /* padding: 0 102rpx; */ + padding: 0 30rpx; +} + +.total_number { + width: 200rpx; + text-align: center; + display: flex; + flex-direction: column; + align-items: center; + font-size: 24rpx; + color: rgba(56, 56, 56, 1); +} + +.detail_number { + color: rgba(254, 58, 98, 1); + margin-top: 10rpx; + width: 200rpx; +} + +.inp_view3 { + background-color: rgb(249, 250, 254); + height: 82rpx; + width: 228rpx; + border-radius: 17rpx; + color: #A6A6A6FF; +} +.inp_view4 { + background-color: rgb(249, 250, 254); + height: 82rpx; + width: 250rpx; + border-radius: 17rpx; + color: #A6A6A6FF; +} +/* 门店数据 */ +.card_title { + display: flex; + align-items: center; + font-size: 32rpx; + color: rgba(0, 0, 0, 1); + height: 37rpx; + padding: 10rpx 0; +} + +.card_box { + background: #FFFFFFFF; + /* width: 750rpx; */ + width: 100%; + box-sizing: border-box; + padding-top: 21rpx; + margin-top: 10rpx; + font-size: 24rpx; + border-radius: 17rpx; +} + +.tiny_box1 { + display: flex; + flex-direction: column; + align-items: center; + width: 10%; + margin-left: 10rpx; +} +.tiny_box2 { + display: flex; + flex-direction: column; + width: 40%; +} +.tiny_box3 { + display: flex; + flex-direction: column; + /* align-items: ; */ + width: 50%; +} +.ellipsis-22 { + display: -webkit-box; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + white-space: normal; + word-break: break-all; + word-warp: break-word; +} + +.tiny_number { + color: rgba(254, 58, 98, 1); + margin-bottom: 10rpx; + height: 37rpx; + line-height: 37rpx; + width: 150rpx; + text-align: center; +} + +.line2 { + margin-top: 10rpx; + width: 2rpx; + height: 70rpx; + background: rgba(229, 229, 229, 1); +} + +/* 筛选弹窗 */ +.pp_title { + height: 93rpx; + line-height: 93rpx; + border-bottom: 1rpx solid #eee; + +} + +.close_btn { + width: 40rpx; + height: 40rpx; + float: right; + position: relative; + top: 20rpx; + margin-right: 20rpx; +} + +.saixuan_name { + height: 42rpx; + line-height: 42rpx; +} + +.inp_view { + width: 240rpx; + background-color: rgb(249, 250, 254); + height: 70rpx; + border-radius: 11rpx; + color: rgba(128, 128, 128, 1); + margin-right: 33rpx; + margin-left: 12rpx; +} + +.inp_view2 { + background-color: rgb(249, 250, 254); + height: 70rpx; + border-radius: 11rpx; + color: rgba(128, 128, 128, 1); +} + +.clear_inp { + position: absolute; + top: 22rpx; + right: 0; +} + +.btn_set { + margin: 20rpx auto; + width: 95%; + height: 93rpx; + border-radius: 20rpx; + color: #fff; + line-height: 93rpx; + background: linear-gradient(180deg, rgba(255, 24, 126, 1) 0%, rgba(255, 89, 64, 1) 100%); + letter-spacing: 4rpx; + text-indent: 4rpx; +} + +.line3 { + height: 1rpx; + background: rgba(128, 128, 128, 1); + width: 56rpx; + margin-right: 14rpx; +} + +/* 商品概况部分 */ +.search-box .inp { + background: #F9FAFE; + height: 82rpx; + border-radius: 16rpx; + width: 524rpx; + color: rgba(166, 166, 166, 1) !important; + position: relative; + margin-left: 4rpx; +} diff --git a/packageE/pages/user/slimming/g_filter.wxs b/packageE/pages/user/slimming/g_filter.wxs new file mode 100644 index 0000000..15e36ca --- /dev/null +++ b/packageE/pages/user/slimming/g_filter.wxs @@ -0,0 +1,14 @@ +//获取样式 +var toFixTwo = function(val) { + if (val === undefined) return "-"; + if (val === null) return "-"; + if (isNaN(val)) return "-"; + if (val === '') return "-"; + if (val === 0) return "-"; + return parseFloat(parseFloat(val).toFixed(2)) ; +} + +module.exports = { + toFixTwo: toFixTwo, + +} diff --git a/packageE/pages/user/slimming/slimming.js b/packageE/pages/user/slimming/slimming.js new file mode 100644 index 0000000..b1f08d8 --- /dev/null +++ b/packageE/pages/user/slimming/slimming.js @@ -0,0 +1,142 @@ +var e = getApp(), os = e.globalData.setting; +var utils = require('../../../../utils/util.js'); +var regeneratorRuntime = require('../../../../utils/runtime.js'); + +Page({ + /** + * 页面的初始数据 + */ + data: { + + userInfo:null, + iurl: os.imghost, + portrait_list: [], + loading: 0, + portrait_req: {}, + industry:'', + is_get:0 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + var that=this; + + this.setData({ + userInfo: getApp().globalData.userInfo + }) + + + getApp().getConfig(function (e){ + that.init_data(); + }) + + + }, + /** + * 生命周期函数--监听页面显示 + */ + onShow: async function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + init_data() { + + let userInfo = getApp().globalData.userInfo; + var portrait_req = { + ApiName:'api.slimming.member.portrait', + store_id: userInfo.store_id, + //StaffId: that.idd, + vipid: userInfo.erpvipid, + }; + this.get_service_portrait(portrait_req); + }, + + + get_service_portrait(portrait_req) { + + //var str='{"code":0,"msg":"操作成功!","data":[{"id":"a1ff01bc-b755-4a5c-8675-06b33354d5ec","customerno":"18650904780","customername":"心如水","sex":"女","mobiletel":"18650904780","birthday":"2000-11-23","age":22,"signingdate":"2022-11-22","weightlosscourse":4,"shapecourse":3,"weight":62,"targetweight":30,"subtracted":26,"advisername":"泉州万达纪莉(工号:07)","beautyconsultant":"泉州万达纪莉(工号:07)","diffweight":24,"minweight":100,"ideaweight":92,"tostoreqty":3,"dayweight":102,"previousweight":100,"lastweight":102,"actualweight":22,"ringratioweight":2,"undeduced":10,"standardweight":98}]}'; + //var res=JSON.parse(str); + //this.setData({portrait_list: res.data}); + //return false; + var that = this; + if (that.loading) { + return false; + } + that.loading = 1; + + if (portrait_req) { + that.setData({ + noMore: false, + portrait_list: [], + is_get: 0, + noMore: false + }) + + } else { + if (that.noMore) { + that.loading = 0; + return false; + } + portrait_req = that.portrait_req; //如果不是全选的参数,就是page分页+1 + portrait_req.page++; + } + + //请求参数进行存储 + that.portrait_req = portrait_req; + wx.showLoading({ + title: '加载中' + }); + + console.log(getApp().globalData.config,1111); + + + var url = '/api/weshop/delphiapi/pageErpApi?accdb='+getApp().globalData.config.erpid; + getApp().request.promiseGet(url, { + data: portrait_req + }) + .then((res) => { + wx.hideLoading(); + that.loading = 0; + + that.setData({is_get: 1}) + + if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length) { + + var list=res.data.data.pageData; + + list[0].weight = list[0].weight * 2 + if (list[0].tostoreqty == 0) { + list[0].undeduced = list[0].undeduced + list[0].actualweight + list[0].actualweight = 0 + list[0].ringratioweight = 0 + + } else if (list[0].tostoreqty == 1) { + list[0].ringratioweight = 0 + } + + that.setData({portrait_list: list}) + + } else { + that.setData({ + noMore:true + }) + } + }); + }, + + goto:function (e){ + var url=e.currentTarget.dataset.url; + getApp().goto(url); + } + + +}) \ No newline at end of file diff --git a/packageE/pages/user/slimming/slimming.json b/packageE/pages/user/slimming/slimming.json new file mode 100644 index 0000000..68c131d --- /dev/null +++ b/packageE/pages/user/slimming/slimming.json @@ -0,0 +1,8 @@ +{ + "navigationBarTitleText": "瘦身日记", + "usingComponents": { + "qr_code": "/components/qr_code/qr_code", + "warn": "/components/long_warn/long_warn", + "nodata": "/components/nodata/nodata" + } +} \ No newline at end of file diff --git a/packageE/pages/user/slimming/slimming.wxml b/packageE/pages/user/slimming/slimming.wxml new file mode 100644 index 0000000..5d4e05b --- /dev/null +++ b/packageE/pages/user/slimming/slimming.wxml @@ -0,0 +1,166 @@ + + + + + + + + + + {{item.customername || '-'}} + {{item.mobiletel || '-'}} + {{item.age || '-'}} + 岁 + + + + + 减重疗程数: + + {{item.weightlosscourse || '0'}} + + + 塑身疗程数: + {{item.shapecourse || '0'}} + + + + + 购买日期: + {{item.signingdate || '-'}} + + + + + + + + + 日常打卡 + 查看全部 + + + + + + + {{ g_filter.toFixTwo(item.dayweight ) }} + + + _ _ + + + + + + + 今日体重 + + + + + + + {{g_filter.toFixTwo(item.ringratioweight)}} + + + + + 环比重量 + + + + {{ g_filter.toFixTwo(item.actualweight)}} + + + 斤 + + + 实际减重 + + + + {{g_filter.toFixTwo(item.diffweight)}} + + + 斤 + + + 累计减重 + + + + + + + {{item.tostoreqty || '0'}} + + 次 + + + 累计到店 + + + + {{ g_filter.toFixTwo(item.undeduced)}} + + + 斤 + + + 未减斤数 + + + + {{g_filter.toFixTwo(item.minweight) }} + + + + 最低体重 + + + + + 初始体重{{ g_filter.toFixTwo(item.weight) }}斤 + + 标准体重{{ g_filter.toFixTwo(item.weight)}}斤 + + 应减斤数{{g_filter.toFixTwo(item.weight)}}斤 + + + + 减重顾问 + {{item.advisername || '-'}} + + + 减重美体师 + {{item.beautyconsultant || '-'}} + + + + + + + + diff --git a/packageE/pages/user/slimming/slimming.wxss b/packageE/pages/user/slimming/slimming.wxss new file mode 100644 index 0000000..26a34f5 --- /dev/null +++ b/packageE/pages/user/slimming/slimming.wxss @@ -0,0 +1,32 @@ +page{ + background-color: #f2f2f2; line-height: normal; +} + +.pd20 { + padding: 20rpx; +} +.fs26 { + font-size: 26rpx; +} +.fs28 { + font-size: 28rpx; +} +.fs30 { + font-size: 30rpx; +} +.fs32 { + font-size: 32rpx; +} + +.mgt20 { + margin-top: 20rpx !important; +} + +.card { + background-color: white; + border-radius: 16rpx; + overflow: hidden; +} +.txt-center{ + text-align: center; +} \ No newline at end of file