From 5b6df4cd53a3bf1cb015694a8e8a23acb946014e Mon Sep 17 00:00:00 2001 From: WXD-SEASON\season Date: Tue, 12 Jul 2022 14:35:15 +0800 Subject: [PATCH] OA单相关优化 --- packageD/pages/user/deposit/deposit.js | 9 +++++++++ packageD/pages/user/deposit/deposit.wxml | 2 +- packageD/pages/user/deposit/filter.wxs | 15 +++++++++++++++ packageD/pages/user/deposit/query/index.js | 219 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ packageD/pages/user/deposit/query/index.json | 1 + packageD/pages/user/deposit/query/index.wxml | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ packageD/pages/user/deposit/query/index.wxss | 324 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/giftpack/evaluategift/evaluategift.js | 2 +- pages/giftpack/giftpacklist/giftpacklist.js | 9 ++++++++- pages/giftpack/giftpacklist/giftpacklist.wxml | 3 +++ pages/user/index/filter.wxs | 1 + 11 files changed, 637 insertions(+), 3 deletions(-) create mode 100644 packageD/pages/user/deposit/filter.wxs create mode 100644 packageD/pages/user/deposit/query/index.js create mode 100644 packageD/pages/user/deposit/query/index.json create mode 100644 packageD/pages/user/deposit/query/index.wxml create mode 100644 packageD/pages/user/deposit/query/index.wxss diff --git a/packageD/pages/user/deposit/deposit.js b/packageD/pages/user/deposit/deposit.js index c4f0bd2..2092b7c 100644 --- a/packageD/pages/user/deposit/deposit.js +++ b/packageD/pages/user/deposit/deposit.js @@ -89,4 +89,13 @@ Page({ onLoad: function (options) { }, + + goto_nav: function (e) { + var th = this; + var itemid = e.currentTarget.dataset.itemid; + var url="query/index?itemid="+itemid; + console.log(url); + getApp().goto(url); + + }, }) diff --git a/packageD/pages/user/deposit/deposit.wxml b/packageD/pages/user/deposit/deposit.wxml index 4e81dd0..98c34ce 100644 --- a/packageD/pages/user/deposit/deposit.wxml +++ b/packageD/pages/user/deposit/deposit.wxml @@ -26,7 +26,7 @@ - + {{list.ItemName}} ¥{{list.Balance}} diff --git a/packageD/pages/user/deposit/filter.wxs b/packageD/pages/user/deposit/filter.wxs new file mode 100644 index 0000000..cb724f7 --- /dev/null +++ b/packageD/pages/user/deposit/filter.wxs @@ -0,0 +1,15 @@ +var numFr = { + getNum: function(x) { + var f = parseInt(x); + return f; + }, + getval: function(x,n) { + var f = parseFloat(x); + f=f.toFixed(n); + return f; + } +} +module.exports = { + getNum: numFr.getNum, + getval: numFr.getval, +} \ No newline at end of file diff --git a/packageD/pages/user/deposit/query/index.js b/packageD/pages/user/deposit/query/index.js new file mode 100644 index 0000000..8216b70 --- /dev/null +++ b/packageD/pages/user/deposit/query/index.js @@ -0,0 +1,219 @@ +var t = getApp(), + a = t.request, + o = t.globalData.setting, + os = o, + i = require("../../../../../utils/util.js"), + ut = i, + s = require("../../../../../utils/common.js"); +var regeneratorRuntime = require('../../../../../utils/runtime.js'); +Page({ + data: { + + val: false, + color: "", + details: [], //数据 + isBind: true, //控制清空时间日期的按钮 + isBinds: true, + select: false, //下拉框控制器 + datet: "", + dates: "", + result: [], + money: 0, + ItemInfo: "", + pageSize: 10, + page: 1, + current_page: 0, + //is_no_more: 0, + }, + + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function (options) { + wx.setNavigationBarTitle({ + title: "储值款明细", + }) + this.init(); + }, + //监听输入框显示清空按钮 + watchPassWord: function(event) { + console.log("监听输入框显示清空按钮"); + var val = event.detail.value; + console.log("是什么", val); + if (val != "" && val != null) { + var isBind = false; + this.setData({ + isBind: isBind + }); + + } + }, + /** + * 点击下拉框 + */ + bindShowMsg() { + console.log(!this.data.select); + this.setData({ + select: !this.data.select + }) + }, + /** + * 已选下拉框 + */ + mySelect(e) { + console.log(e) + var name = e.currentTarget.dataset.name + this.setData({ + grade_name: name, + select: false + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function(options) { + console.log(options); + // 设置日期选择器的结束时间为当前日期 + var now=new Date(); + var nowDate = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate(); + var date = new Date(now.getTime() - 7 * 24 * 3600 * 1000); + var startDate=date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate(); + this.setData({ + ItemInfo:options.itemid, + datet:startDate, + dates:nowDate, + }) + }, + //明细查询 + Gettime: function (e) { + var page = 0; + //开始获取时间 + var th = this; + var datet= th.data.datet; + var dates= th.data.dates; + console.log(datet, "开始结束", dates); + //删除字符中的—— + var datatk = datet.replace(/[-]/g, ""); + //转换类型 + var datak = parseInt(datatk); + //删除字符中的—— + var dataj = dates.replace(/[-]/g, ""); + //转换类型 + var dataj = parseInt(dataj); + + console.log("开始", datak, "结束", dataj); + //判断初始时间小于结束时间 + if (datak > dataj) { + console.log("开始时间", datak, '结束时间', dataj, "时间判断"); + getApp().showWarning("结束时间错误"); + this.setData({ details: [] }); + } else { + this.setData({ details: [] }); + console.log(datak, dataj, "时间判断2"); + console.log("有进来吗", datet, dates); + this.setData({ current_page: 0 }); + this.init(); + } + + }, + + async init() { + + var t=a; + this.data.current_page++; + var BeginDate = this.data.datet; + var EndDate = this.data.dates; + var user_id = getApp().globalData.user_id; + var store_id = os.stoid; + var tpye = this.data.grade_name; + console.log("ddd"+this.data.ItemInfo); + var e = this, + details = ""; + var get_data = { + user_id: user_id, store_id: store_id, + ItemInfo:encodeURIComponent(this.data.ItemInfo), + pageSize: 10, page: e.data.current_page + }; + + + if (EndDate != "" && EndDate != null) { + get_data.EndDate = EndDate; + } + + if (BeginDate != "" && BeginDate!= null) { + get_data.BeginDate = BeginDate; + } + var big_arr = this.data.details; + await getApp().request.promiseGet("/api/weshop/users/listAdvanceListSeek", { + data: get_data, isShowLoading: 1 + }).then(res => { + + + + var details = res.data; + if (details.code!=0) + { + getApp().showWarning("找不到相关数据"); + return false; + } + if (!details.data) { + getApp().showWarning("未找更多数据"); + return false; + } + var details = details.data; + + details.forEach(function (val, ind) { + big_arr.push(val); + }) + setTimeout(() => { + this.setData({ + details: big_arr + }); + }, 1500) + + + }) + }, + + + //起始时间 + bindDateChenge: function(e) { + console.log("是什么", e.detail.value); + var isBind = false; + this.setData({ + datet: e.detail.value, + isBind: isBind + }); + }, + // 结束时间 + bindDateChenges: function(e) { + console.log("是什么", e.detail.value); + var isBinds = false; + this.setData({ + dates: e.detail.value, + isBinds: isBinds + }); + }, + //catchtap阻止冒泡,点击清除开始时间的按钮 + eliminate: function() { + console.log("试试"); + var isBind = true; + var data = ""; + this.setData({ + datet: data, + isBind: isBind + }) + }, + //catchtap阻止冒泡,点击清除结束时间的按钮 + eliminates: function() { + console.log("试试"); + var isBinds = true; + var dates = ""; + this.setData({ + dates: dates, + isBinds: isBinds + }) + } + +}) \ No newline at end of file diff --git a/packageD/pages/user/deposit/query/index.json b/packageD/pages/user/deposit/query/index.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/packageD/pages/user/deposit/query/index.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/packageD/pages/user/deposit/query/index.wxml b/packageD/pages/user/deposit/query/index.wxml new file mode 100644 index 0000000..c9237a2 --- /dev/null +++ b/packageD/pages/user/deposit/query/index.wxml @@ -0,0 +1,55 @@ + + + +
+ + 日期: + + + + {{datet}} + + + + + + + + + {{dates}} + + + + + + + +
+ +
+ + + 项目 + 余额 + + + + + + + + {{details.BillName}} + {{details.BillDate}} + + + + {{(details.InSum>0)?"+"+filter.getNum(details.InSum):"-"+filter.getNum(details.OutSum)}}元 + + + + + \ No newline at end of file diff --git a/packageD/pages/user/deposit/query/index.wxss b/packageD/pages/user/deposit/query/index.wxss new file mode 100644 index 0000000..6e1efc1 --- /dev/null +++ b/packageD/pages/user/deposit/query/index.wxss @@ -0,0 +1,324 @@ +/* 大边框 */ +.big-rim{ + margin-top: 15rpx; + width: 100%; + height: 200rpx; + border-bottom: 8px solid #EEEEEE; +} +/* 单据时间 */ +.time{ + + font-size: 25rpx; + color: #999999; + width: 100%; +} +.min-rim{ +display: flex; +width: 100%; +height: auto; +margin-left: 30rpx; +} +/* 日期 */ +.rq{ + height: 25rpx; + font-size: 28rpx; + margin-top:12rpx; + font-family:'SimHei',Arial; +} +/* 日期控件 */ +.pi{ + width:200rpx; + height:auto; + margin-left:10rpx; + +} +.pis{ + width:200rpx; + height:auto; + margin-left:30rpx; +} +/* 日期边框 */ +.rq-rim{ +position:relative; +left:0; +top:0 +} +/* 开始时间边框*/ +.kssj{ +display: inline-block; +height: 50rpx; +padding: 4rpx; +background-color: #EEEEEE; +border: 1px solid #DADADA; +width:200rpx; +border-radius: 3px; +line-height:40rpx; +position:relative; +top:0rpx; +left:0rpx; + +} +/* 开始时间的文字 */ +.wz{ + display: inline-block; +font-size: 25rpx; +color: #333; +} +/* 开始清空按钮的 边框*/ +.qc-rim{ + position:absolute; + top:10rpx; + left:173rpx; + +} +/* 结束时间清空输入框的按钮的边框 */ +.end-rim{ +position: absolute; + top: 23rpx; + left:547rpx; + width: 25rpx; + height: 25rpx; +} +/* 查询内容 */ +.cxnr{ + margin-left:30rpx; + font-size:28rpx; + font-family: 'SimHei',Arial; +} +/* 至 */ +.zi{ + margin-top:14rpx; + font-weight:600; + font-size:28rpx; + font-family: 'SimHei',Arial; + margin-left:30rpx; +} +/* 结束时间 */ + +.jssj{ + padding-left: 10rpx; + margin-left: 30rpx; +padding-bottom: 10rpx; +height: 35rpx; +font-size: 25rpx; +color: #333; +background-color: #EEEEEE; +border: 1px solid #DADADA; +width:85%; +border-radius: 5px; + +} +/* 查询内容的备考的边框 */ +.xknr-rim{ + display: flex; + width: 100%; + height: 55rpx; + line-height:105rpx; + margin-top:20rpx; +} +/* 明细查询 */ +.botton{ + margin-left: 30rpx; + margin-top: 50rpx; + background-color: #C4182E; + width: 95%; + border-radius:10rpx; + text-align: center; + height: 70rpx; + line-height: 70rpx; + color: #FFF; + font-size: 29rpx; + border: none; + font-family: 'SimHei',Arial; + } + /* 底部边框线 + .bottom{ + width: 100%; + border-bottom: 20rpx solid #eeeeee; + } */ + +/*开始时间清空输入框的按钮*/ +.empty{ + width: 25rpx; + height: 25rpx; + border-radius:50%; + background: #767676; + color: #fff; + font-size: 25rpx; + text-align: center; + line-height:19rpx; +} +/*结束时间清空输入框的按钮*/ +.end{ + width: 25rpx; + height: 25rpx; + border-radius:50%; + background: #767676; + color: #fff; + font-size: 25rpx; + text-align: center; + line-height:19rpx; + +} + +/* 顶部 */ +.top{ + width: 170rpx; + height: 50rpx; + padding: 0 10rpx; + line-height: 50rpx; + font-size: 34rpx; + margin-top: 25rpx; + border-radius:3rpx; +} +.images{ + width:35rpx; +height:35rpx; +margin-left:-9rpx; +margin-top:6rpx; +} +.rim-images{ + width: 62rpx; + height: 46rpx; + line-height: 37rpx; + /* border-style: inset;padding:4rpx;text-align: center; */ + background: #f1f1f1; + border-color:#000000; + border-width: 1rpx; + transform:translateX(28%); + margin-top:-3rpx; +border-radius:5rpx; +} +/* 下拉框 */ +.top-selected{ + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; + border: 1px solid #ccc; + padding: 0 10rpx; + font-size: 30rpx; + background:#eeeeee; + height:50rpx; + border-radius:6rpx; + +} +.texts{ + margin:0 auto; + font-size: 25rpx; + +} +/* 下拉内容 */ +/* 下拉内容 */ +.select-box { + background-color: #eeeeee; + width:190rpx; + position: relative; + z-index:1; + overflow: hidden; + text-align: left; + animation: myfirst 0.5s; + font-size: 25rpx; + border: 1px solid #DADADA; +} +.select_one { + padding-left: 20rpx; + width: 100%; + height: 60rpx; + line-height: 60rpx; +} +/* 优惠券样式 */ +.body{ + text-align: center; + padding: 20rpx; + margin: 20rpx auto; + width: 80%; + max-width: 1000rpx; + font-size: 28rpx; + color: #333333; + border-bottom: 2rpx solid #EEEEEE; +} + +.b_iimg{ + background-color: red; + width: 400rpx; + height: 400rpx; +} + +.b_sz2{ + font-size: 40rpx; + color: #6fd137; + margin: 20rpx 0; + text-align: center; +} + +/* 注释 */ + .zs{ + margin-left: 30rpx; + font-size: 25rpx; + color: #999999; + font-family: 'SimHei',Arial; + margin-top: 42rpx; + margin-bottom: 30rpx; + } + /* 项目边框 */ + .db{ + display: flex; + width: 100%; + height: 85rpx; + border-bottom: 2rpx solid #e8e8e8; + line-height: 85rpx; +} +/* 项目 */ +.xm{ +margin-left: 30rpx; + height:50rpx; + font-size: 30rpx; +color: #999999; +width: 50%; +vertical-align: middle; +} +/* 金额 */ +.je{ +text-align: right; +padding-right:120rpx; +height: 50rpx; + font-size: 30rpx; +color: #999999; +width: 50%; +vertical-align: middle; + +} + +/*数据*/ +.data{ + display: flex; + width: 100%; + border-bottom: 1px solid #E8E8E8; + height: 95rpx; +} +/*左边的数据 */ +.left{ + width:90%; + height: 120rpx; +} +/* 单据单号 */ +.left-test{ + margin-left: 30rpx; + padding-top: 11rpx; + font-size: 25rpx; + color: #000000; + width: 100%; +} + +/* 流动资金的加减 */ +.val{ + padding-top:20rpx; + padding-right:10rpx; + height: 70rpx; + width: 220rpx; + font-size: 30rpx; + font-family: 'SimHei',Arial; + padding-left:67rpx; + +} \ No newline at end of file diff --git a/pages/giftpack/evaluategift/evaluategift.js b/pages/giftpack/evaluategift/evaluategift.js index 440ab7c..44c4a50 100644 --- a/pages/giftpack/evaluategift/evaluategift.js +++ b/pages/giftpack/evaluategift/evaluategift.js @@ -200,7 +200,7 @@ Page({ th.setData({ receiveState: 1 }) - getApp().my_warnning("领取成功", 1, th); + getApp().my_warnning("领取成功,同一个订单评价后只能兑换一份礼包!", 1, th); } else { getApp().my_warnning(res.data.msg, 0, th); } diff --git a/pages/giftpack/giftpacklist/giftpacklist.js b/pages/giftpack/giftpacklist/giftpacklist.js index 78e6092..ab9c63d 100644 --- a/pages/giftpack/giftpacklist/giftpacklist.js +++ b/pages/giftpack/giftpacklist/giftpacklist.js @@ -249,6 +249,10 @@ Page({ var t_date = new Date(t_endtime) / 1000; var t_now = ut.gettimestamp(); + var t_starttime = res.data.data.starTime; + t_starttime = t_starttime.replace(/-/g, '/'); + var t_sdate = new Date(t_starttime) / 1000; + if (res.data.data.goodsUseState) th.setData({ c_state: 1 }) @@ -256,7 +260,10 @@ Page({ th.setData({ c_state: 2 }) - + else if (t_sdate > t_now) + th.setData({ + c_state: -1 + }) th.setData({ giftDate: res.data.data.endTime, giftPosPrice: res.data.data.giftPosPrice, diff --git a/pages/giftpack/giftpacklist/giftpacklist.wxml b/pages/giftpack/giftpacklist/giftpacklist.wxml index f820b5d..5d0c711 100644 --- a/pages/giftpack/giftpacklist/giftpacklist.wxml +++ b/pages/giftpack/giftpacklist/giftpacklist.wxml @@ -183,6 +183,9 @@
+ + 兑换未开始 + 立即使用 diff --git a/pages/user/index/filter.wxs b/pages/user/index/filter.wxs index 855ef50..79461e9 100644 --- a/pages/user/index/filter.wxs +++ b/pages/user/index/filter.wxs @@ -18,6 +18,7 @@ var is_close = function (name,c_list) { map['充值有礼']="16"; map['幸运大转盘']="17"; map['幸运购']="18"; + map['套盒商品']="19"; map['AI测肤']="20"; map['附近门店']="21"; var index=map[name]; -- libgit2 0.21.4