From 5432e08d13fe7d8aa7738e856345337ecf247861 Mon Sep 17 00:00:00 2001 From: xpz2018 <107107461@qq.com> Date: Tue, 11 May 2021 15:28:10 +0800 Subject: [PATCH] =?UTF-8?q?2021=E5=B9=B45=E6=9C=8811=E6=97=A5=2015:28:08?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/loading/index.wxml | 15 ++++----------- components/refresh-view/index.js | 15 +++------------ components/refresh-view/scroll.wxs | 2 +- pages/process/index/index.js | 30 ++++++++++++++++++++++++++++-- pages/process/index/index.json | 2 +- pages/process/index/index.wxml | 15 ++++++++++++--- utils/storage.js | 2 -- utils/util.js | 23 +++++++---------------- 8 files changed, 56 insertions(+), 48 deletions(-) diff --git a/components/loading/index.wxml b/components/loading/index.wxml index e934288..5e97d63 100644 --- a/components/loading/index.wxml +++ b/components/loading/index.wxml @@ -1,18 +1,11 @@ - - + + - + \ No newline at end of file diff --git a/components/refresh-view/index.js b/components/refresh-view/index.js index e591a29..c20345c 100644 --- a/components/refresh-view/index.js +++ b/components/refresh-view/index.js @@ -10,7 +10,7 @@ Component({ }, threshold: { // 下拉刷新阈值,下拉距离超过该值触发刷新 type: Number, - value: 32 + value: 30 }, color: { // 下拉刷新进度条颜色 type: String, @@ -32,7 +32,6 @@ Component({ } } }, - /** * 组件的初始数据 */ @@ -49,7 +48,6 @@ Component({ this.setData({ progressBarHeight: this.rpx2px(80) }); } }, - /** * 组件的方法列表 */ @@ -58,16 +56,11 @@ Component({ // console.log(e); if (e.detail.scrollTop <= 50) { // 滚动到顶部 - this.setData({ - scrollTop: true - }); + this.setData({ scrollTop: true }); } else { - this.setData({ - scrollTop: false - }); + this.setData({ scrollTop: false }); } }, - /** * 滚动到底部 */ @@ -76,7 +69,6 @@ Component({ this.triggerEvent('loadmore'); } }, - /** * 设置刷新状态 */ @@ -89,7 +81,6 @@ Component({ this.setData({ triggered: refreshing }); } }, - /** * rpx转px */ diff --git a/components/refresh-view/scroll.wxs b/components/refresh-view/scroll.wxs index a11af49..0293f53 100644 --- a/components/refresh-view/scroll.wxs +++ b/components/refresh-view/scroll.wxs @@ -3,7 +3,7 @@ */ var startmark = 0; // 开始触摸屏幕的位置 var newmark = 0; // 当前移动到的位置 -var maxDistance = 80; // 下拉最大距离(单位px) +var maxDistance = 75; // 下拉最大距离(单位px) var triggered = false; // 当前下拉刷新状态,true表示下拉刷新已经被触发,false表示下拉刷新未被触发 /** diff --git a/pages/process/index/index.js b/pages/process/index/index.js index de84f57..fc368df 100644 --- a/pages/process/index/index.js +++ b/pages/process/index/index.js @@ -22,6 +22,12 @@ Component({ { status: 3, badge: '', name: '待付款', icon: '/assets/image/icon_payment.png' }, { status: 4, badge: '', name: '已完成', icon: '/assets/image/icon_finish.png' } ], + tabList1: [ + { status: 1, badge: '', name: '待收货', icon: '/assets/image/icon_pricing.png' }, + { status: 2, badge: '', name: '待定价', icon: '/assets/image/icon_checking.png' }, + { status: 3, badge: '', name: '待付款', icon: '/assets/image/icon_payment.png' }, + { status: 4, badge: '', name: '已完成', icon: '/assets/image/icon_finish.png' } + ], tabList2: [ { status: 1, badge: '', name: '磅单信息', icon: '/assets/image/icon_pound.png' }, { status: 2, badge: '', name: '出货审核', icon: '/assets/image/icon_outcheck.png' }, @@ -48,7 +54,14 @@ Component({ {id: '123242K78978KK', name: '河西路打包站'}, {id: '12313378978KK5', name: '成林道打包站'} ], - visible: false + visible: false, + actions: [ + { id: 1, name: '厂内收货' }, + { id: 2, name: '厂外收货' }, + { id: '', name: '全部' } + ], + sheetStr: '全部', + sheet: false }, lifetimes: { attached: function () { @@ -194,10 +207,14 @@ Component({ } }) }, - showSheet: function(){ + showCalendar: function(){ this.setData({ show: true }) this.triggerEvent("zIndex", -1) }, + showSheet: function(){ + this.setData({ sheet: true }) + this.triggerEvent("zIndex", -1) + }, onClose: function() { this.setData({ show: false }) this.trigEvent(9) @@ -231,6 +248,15 @@ Component({ setTimeout(() => { this.triggerEvent('zIndex', zIndex) }, 100); + }, + onCancel: function(){ + this.setData({ sheet: false }) + this.trigEvent(9) + }, + onAction: function({detail}){ + console.log(detail) + this.setData({ sheetStr: detail.name }) + } } }) \ No newline at end of file diff --git a/pages/process/index/index.json b/pages/process/index/index.json index 3329f39..cc23a0a 100644 --- a/pages/process/index/index.json +++ b/pages/process/index/index.json @@ -5,9 +5,9 @@ "van-grid-item": "/components/grid-item/index", "van-cell": "/components/cell/index", "van-cell-group": "/components/cell-group/index", - "van-info": "/components/info/index", "van-icon": "/components/icon/index", "van-popup": "/components/popup/index", + "van-action-sheet": "/components/action-sheet/index", "van-calendar": "/components/calendar/index" } } \ No newline at end of file diff --git a/pages/process/index/index.wxml b/pages/process/index/index.wxml index f118ba4..55a3e58 100644 --- a/pages/process/index/index.wxml +++ b/pages/process/index/index.wxml @@ -16,9 +16,15 @@ 收货统计 - + + --> + + + {{vdateString}} + + {{sheetStr}} + @@ -68,7 +74,7 @@ - + @@ -128,6 +134,9 @@ + + diff --git a/utils/storage.js b/utils/storage.js index 57eb42b..8296fd0 100644 --- a/utils/storage.js +++ b/utils/storage.js @@ -16,7 +16,6 @@ let value = wx.getStorageSync(key); return value ? value : def; } - /** * 设置缓存 * @param String $key key @@ -34,7 +33,6 @@ function put (key, value, timeout = 0) { } return value; } - function remove (key) { wx.removeStorageSync(key); wx.removeStorageSync(`${key}__separator__`); diff --git a/utils/util.js b/utils/util.js index cf713c5..f68ab3c 100644 --- a/utils/util.js +++ b/utils/util.js @@ -96,6 +96,9 @@ function playDing() { function showBackToast(content) { if (isEmpty(content)) { + setTimeout(function () { + wx.navigateBack() + }, 500) return } wx.showToast({ @@ -121,10 +124,7 @@ function checkId(id) { var format = /^(([1][1-5])|([2][1-3])|([3][1-7])|([4][1-6])|([5][0-4])|([6][1-5])|([7][1])|([8][1-2]))\d{4}(([1][9]\d{2})|([2]\d{3}))(([0][1-9])|([1][0-2]))(([0][1-9])|([1-2][0-9])|([3][0-1]))\d{3}[0-9xX]$/; //号码规则校验 if (!format.test(id)) { - return { - 'status': 0, - 'msg': '身份证号码不合规' - }; + return { 'status': 0, 'msg': '身份证号码不合规' } } //区位码校验 //出生年月日校验 前正则限制起始年份为1900; @@ -135,10 +135,7 @@ function checkId(id) { now_time = Date.parse(new Date()), //当前时间戳 dates = (new Date(year, month, 0)).getDate(); //身份证当月天数 if (time > now_time || date > dates) { - return { - 'status': 0, - 'msg': '出生日期不合规' - } + return { 'status': 0, 'msg': '出生日期不合规' } } //校验码判断 var c = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2); //系数 @@ -149,15 +146,9 @@ function checkId(id) { sum += parseInt(id_array[k]) * parseInt(c[k]); } if (id_array[17].toUpperCase() != b[sum % 11].toUpperCase()) { - return { - 'status': 0, - 'msg': '身份证校验码不合规' - } - } - return { - 'status': 1, - 'msg': '校验通过' + return { 'status': 0, 'msg': '身份证校验码不合规' } } + return { 'status': 1, 'msg': '校验通过' } } function combination(arr, m) {