├── README.md ├── app.js ├── app.json ├── app.wxss ├── components ├── img_tip │ ├── img_tip.js │ ├── img_tip.json │ ├── img_tip.wxml │ └── img_tip.wxss ├── keyboard_component │ ├── keyboard_component.js │ ├── keyboard_component.json │ ├── keyboard_component.wxml │ └── keyboard_component.wxss └── simple_keyboard_component │ ├── simple_keyboard_component.js │ ├── simple_keyboard_component.json │ ├── simple_keyboard_component.wxml │ └── simple_keyboard_component.wxss ├── images ├── 0.png ├── 1.png ├── 2.png ├── 3.png ├── 4.png ├── 5.png ├── add_car.png ├── bottom.png ├── clear.png ├── collection.png ├── doubt.png ├── ico_home.png ├── ico_home1.png ├── index │ └── index_fail.png ├── index_bind.png ├── keyboard │ ├── cursor.gif │ ├── delete.png │ ├── energy.png │ └── hover.png ├── logo.png ├── my.png ├── my1.png ├── pay │ └── x.png ├── prompt.png ├── right.png ├── right2.png ├── right3.png ├── rule.png ├── sao.png ├── search.png ├── success.png ├── tap_right.png ├── tishi.png ├── tishi1.png ├── touxiang.png └── tu1.png ├── pages ├── index │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── index_fail │ ├── index_fail.js │ ├── index_fail.json │ ├── index_fail.wxml │ └── index_fail.wxss ├── logs │ ├── logs.js │ ├── logs.json │ ├── logs.wxml │ └── logs.wxss ├── w_index_rule │ ├── w_index_rule.js │ ├── w_index_rule.json │ ├── w_index_rule.wxml │ └── w_index_rule.wxss ├── w_my │ ├── w_my.js │ ├── w_my.json │ ├── w_my.wxml │ └── w_my.wxss ├── w_my_bind_member │ ├── w_my_bind_member.js │ ├── w_my_bind_member.json │ ├── w_my_bind_member.wxml │ └── w_my_bind_member.wxss ├── w_my_bind_platenumber │ ├── w_my_bind_platenumber.js │ ├── w_my_bind_platenumber.json │ ├── w_my_bind_platenumber.wxml │ └── w_my_bind_platenumber.wxss ├── w_my_bind_prompt │ ├── w_my_bind_prompt.js │ ├── w_my_bind_prompt.json │ ├── w_my_bind_prompt.wxml │ └── w_my_bind_prompt.wxss ├── w_my_businessman_coupon │ ├── w_my_businessman_coupon.js │ ├── w_my_businessman_coupon.json │ ├── w_my_businessman_coupon.wxml │ └── w_my_businessman_coupon.wxss ├── w_my_car │ ├── w_my_car.js │ ├── w_my_car.json │ ├── w_my_car.wxml │ └── w_my_car.wxss ├── w_my_park_coupon │ ├── w_my_park_coupon.js │ ├── w_my_park_coupon.json │ ├── w_my_park_coupon.wxml │ └── w_my_park_coupon.wxss ├── w_my_payment_record │ ├── w_my_payment_record.js │ ├── w_my_payment_record.json │ ├── w_my_payment_record.wxml │ └── w_my_payment_record.wxss ├── w_payment │ ├── w_payment.js │ ├── w_payment.json │ ├── w_payment.wxml │ └── w_payment.wxss └── w_payment_prompt │ ├── w_payment_prompt.js │ ├── w_payment_prompt.json │ ├── w_payment_prompt.wxml │ └── w_payment_prompt.wxss ├── project.config.json └── utils └── util.js /README.md: -------------------------------------------------------------------------------- 1 | 这是一个停车场收费小程序 2 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | //app.js 2 | App({ 3 | onLaunch: function () { 4 | // 展示本地存储能力 5 | var logs = wx.getStorageSync('logs') || [] 6 | logs.unshift(Date.now()) 7 | wx.setStorageSync('logs', logs) 8 | 9 | // 登录 10 | var that=this; 11 | wx.login({ 12 | success: res => { 13 | // 发送 res.code 到后台换取 openId, sessionKey, unionId 14 | if (res.code) { 15 | wx.request({ 16 | url: this.globalData.host + '/intapplet', 17 | data: { 18 | jscode: res.code 19 | }, 20 | header: { 21 | 'content-type': 'application/json', 22 | 'Cookie': 'NWRZPARKINGID=' + this.globalData.loginMess 23 | }, 24 | success: function (res) { 25 | console.log(res) 26 | if (res.data.code == 1001 || res.data.code == 1002) { 27 | that.globalData.loginMess = res.data.data.sessionid; 28 | for (var i = 0; i < res.data.data.history.length; i++) { 29 | var str = res.data.data.history[i]; 30 | var str2 = str.substring(0, 2) + "·" + str.substring(2); 31 | res.data.data.history[i] = str2; 32 | that.globalData.history = res.data.data.history; 33 | } 34 | 35 | //由于这里是网络请求,可能会在 Page.onLoad 之后才返回 36 | // 所以此处加入 callback 以防止这种情况 37 | if (that.memberReadyCallback) { 38 | that.memberReadyCallback(res); 39 | } 40 | } else if (res.data.code == 1004){ 41 | that.globalData.loginMess = res.data.data.sessionid; 42 | that.globalData.member = true; 43 | that.globalData.member_tel = res.data.data.vip.vipaccount; 44 | that.globalData.member_dengji = res.data.data.vip.levelname; 45 | that.globalData.member_jifen = res.data.data.vip.vippoint; 46 | for (var i = 0; i < res.data.data.history.length; i++) { 47 | var str = res.data.data.history[i]; 48 | var str2 = str.substring(0, 2) + "·" + str.substring(2); 49 | res.data.data.history[i] = str2; 50 | that.globalData.history = res.data.data.history; 51 | } 52 | 53 | //由于这里是网络请求,可能会在 Page.onLoad 之后才返回 54 | // 所以此处加入 callback 以防止这种情况 55 | if (that.memberReadyCallback) { 56 | that.memberReadyCallback(res); 57 | } 58 | }else{ 59 | wx.reLaunch({ 60 | url: '/pages/index_fail/index_fail' 61 | }) 62 | } 63 | }, 64 | fail: function (e) { 65 | // wx.reLaunch({ 66 | // url: '/pages/index_fail/index_fail' 67 | // }) 68 | }, 69 | }); 70 | } else { 71 | console.log('登录失败!' + res.errMsg) 72 | wx.reLaunch({ 73 | url: '/pages/index_fail/index_fail' 74 | }) 75 | } 76 | } 77 | }) 78 | // 获取用户信息 79 | wx.getSetting({ 80 | success: res => { 81 | if (res.authSetting['scope.userInfo']) { 82 | // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框 83 | wx.getUserInfo({ 84 | success: res => { 85 | // 可以将 res 发送给后台解码出 unionId 86 | this.globalData.userInfo = res.userInfo 87 | 88 | // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 89 | // 所以此处加入 callback 以防止这种情况 90 | if (this.userInfoReadyCallback) { 91 | this.userInfoReadyCallback(res) 92 | } 93 | } 94 | }) 95 | } 96 | } 97 | }) 98 | 99 | }, 100 | globalData: { 101 | userInfo: null, //用户信息,判断用户授没授权 102 | member: true, //是否是会员 103 | member_tel: "", //会员手机号,默认无 104 | member_dengji: "", //会员等级,默认无 105 | member_jifen: 0, //会员积分,默认0 106 | history: null, //历史记录,最多两位 107 | loginMess: '', //session,问刘哥 108 | // host: 'https://www.jnnewway.com/swsy/' 109 | // host: 'http://192.168.0.116', 110 | host: 'http://192.168.0.108', 111 | // host: 'https://awakall.com', 112 | // host: 'http://192.168.0.110', 113 | // host: 'http://192.168.0.105:8080', 114 | } 115 | }) -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages":[ 3 | "pages/index/index", 4 | "pages/index_fail/index_fail", 5 | "pages/logs/logs", 6 | "pages/w_my/w_my", 7 | "pages/w_index_rule/w_index_rule", 8 | "pages/w_my_bind_platenumber/w_my_bind_platenumber", 9 | "pages/w_my_bind_prompt/w_my_bind_prompt", 10 | "pages/w_payment/w_payment", 11 | "pages/w_payment_prompt/w_payment_prompt", 12 | "pages/w_my_payment_record/w_my_payment_record", 13 | "pages/w_my_car/w_my_car", 14 | "pages/w_my_park_coupon/w_my_park_coupon", 15 | "pages/w_my_bind_member/w_my_bind_member", 16 | "pages/w_my_businessman_coupon/w_my_businessman_coupon" 17 | ], 18 | "window":{ 19 | "backgroundTextStyle": "light", 20 | "navigationBarBackgroundColor": "#3e3f42", 21 | "navigationBarTitleText": "日照华润万象汇停车场", 22 | "navigationBarTextStyle": "white", 23 | "backgroundColor": "#ffffff" 24 | }, 25 | "tabBar": { 26 | "color":"white", 27 | "backgroundColor": "#3e3f42", 28 | "selectedColor": "#ffb900", 29 | "borderStyle": "black", 30 | "list": [ 31 | { 32 | "pagePath": "pages/index/index", 33 | "text": "订单缴费", 34 | "iconPath": "images/ico_home.png", 35 | "selectedIconPath": "images/ico_home1.png" 36 | }, 37 | { 38 | "pagePath": "pages/w_my/w_my", 39 | "text": "我的", 40 | "iconPath": "images/my.png", 41 | "selectedIconPath": "images/my1.png" 42 | } 43 | ] 44 | }, 45 | "networkTimeout":{ 46 | "request":15000 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app.wxss: -------------------------------------------------------------------------------- 1 | /**app.wxss**/ 2 | .container { 3 | height: 100%; 4 | display: flex; 5 | flex-direction: column; 6 | align-items: center; 7 | justify-content: space-between; 8 | padding: 200rpx 0; 9 | box-sizing: border-box; 10 | } 11 | -------------------------------------------------------------------------------- /components/img_tip/img_tip.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | properties: { 3 | img: { 4 | type: String, 5 | default: "", 6 | observer: function(t, i) { 7 | this.setData({ 8 | imgSrc: t 9 | }); 10 | } 11 | } 12 | }, 13 | data: { 14 | imgSrc: "" 15 | }, 16 | attached: function() { 17 | this.setData({ 18 | imgSrc: this.data.img 19 | }); 20 | }, 21 | methods: { 22 | hideTip: function() { 23 | this.triggerEvent("hideTip"); 24 | } 25 | } 26 | }); -------------------------------------------------------------------------------- /components/img_tip/img_tip.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /components/img_tip/img_tip.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /components/img_tip/img_tip.wxss: -------------------------------------------------------------------------------- 1 | .img-tip-container { 2 | width: 100%; 3 | height: 100vh; 4 | position: fixed; 5 | top: 0; 6 | left: 0; 7 | } 8 | 9 | .img-tip-cover { 10 | width: 100%; 11 | height: 100%; 12 | position: absolute; 13 | top: 0; 14 | left: 0; 15 | background: #000000; 16 | opacity: 0.6; 17 | z-index: 1000; 18 | } 19 | 20 | .tip-img { 21 | width: 530rpx; 22 | height: 356rpx; 23 | position: absolute; 24 | left: 0; 25 | right: 0; 26 | top: 0; 27 | bottom: 0; 28 | margin: auto; 29 | z-index: 1001; 30 | } -------------------------------------------------------------------------------- /components/keyboard_component/keyboard_component.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | properties: {}, 3 | data: { 4 | prefixListLine1: [ "京", "沪", "粤", "津", "冀", "豫", "云", "辽", "黑", "湘" ], 5 | prefixListLine2: [ "皖", "鲁", "新", "苏", "浙", "赣", "鄂", "桂", "甘" ], 6 | prefixListLine3: [ "晋", "蒙", "陕", "吉", "闽", "贵", "渝", "川" ], 7 | prefixListLine4: [ "青", "藏", "琼", "宁", "使" ], 8 | suffixListLine1: [ "1", "2", "3", "4", "5", "6", "7", "8", "9", "0" ], 9 | suffixListLine2: [ "Q", "W", "E", "R", "T", "Y", "U", "O", "P", "A" ], 10 | suffixListLine3: [ "S", "D", "F", "G", "H", "J", "K", "L", "X", "Z" ], 11 | suffixListLine4: [ "C", "V", "B", "N", "M" ], 12 | lastListLine: [ "港", "澳", "学" ], 13 | lpn: "", 14 | hoverImg: { 15 | width: "0", 16 | height: "0", 17 | lineHeight: "0", 18 | text: "", 19 | left: "0", 20 | top: "10rpx", 21 | zIndex: "-200", 22 | visibility: "hidden" 23 | }, 24 | keyWidth: 0, 25 | keyHeight: 0, 26 | keyLeft: 0, 27 | keyTop: 0, 28 | enableOKey: !1, 29 | enableNumKey: !1, 30 | enableLastKey: !1, 31 | showKeyboard: !1, 32 | showEnergyIcon: !1, 33 | showPlaceholder: !0, 34 | showCursor: !1, 35 | showPrefixKeyboard: !0, 36 | showSuffixKeyboard: !1, 37 | other: "" 38 | }, 39 | methods: { 40 | _keyPressHandler: function(e) { 41 | console.log(e); 42 | var t = this, n = e.currentTarget; 43 | if (!this._enableTap(n.dataset)) return !1; 44 | var i = wx.createSelectorQuery().in(this); 45 | i.select("#" + n.id).boundingClientRect(), i.exec(function(e) { 46 | console.log(e); 47 | var i = e[0]; 48 | t.setData({ 49 | keyWidth: i.width, 50 | keyHeight: i.height, 51 | keyLeft: n.offsetLeft, 52 | keyTop: n.offsetTop 53 | }), t._showHoverImg(n.offsetLeft, n.offsetTop, i.width, i.height, i.dataset.name); 54 | }); 55 | }, 56 | _keyUpHandler: function(e) { 57 | console.log(e), this._stopKeyEvent(e.currentTarget.dataset); 58 | }, 59 | _showHoverImg: function(e, t, n, i, s) { 60 | var a = n * (105 / 64), o = a * (192 / 102), h = e - (a - n) / 2 - .4, r = t + i - o + 1; 61 | this.setData({ 62 | hoverImg: { 63 | left: h + "px", 64 | top: r + "px", 65 | width: a + "px", 66 | height: o + "px", 67 | lineHeight: o - i + "px", 68 | text: s, 69 | zIndex: 200, 70 | visibility: "visible" 71 | } 72 | }); 73 | }, 74 | _hideHoverImg: function() { 75 | this.setData({ 76 | hoverImg: { 77 | visibility: "hidden", 78 | zIndex: -200 79 | } 80 | }); 81 | }, 82 | _inputLpnHandler: function(e) { 83 | var t = this, n = t.data.lpn; 84 | return !(n.length >= 8) && (!(n.indexOf("港") > 0 || n.indexOf("澳") > 0 || n.indexOf("学") > 0) && void t.setData({ 85 | lpn: n + e 86 | })); 87 | }, 88 | _deleteHandler: function(e) { 89 | var t = this.data.lpn; 90 | this.setData({ 91 | lpn: 0 == t.length ? "" : t.substring(0, t.length - 1) 92 | }), this._stopKeyEvent(e.currentTarget.dataset); 93 | }, 94 | _stopKeyEvent: function(e) { 95 | this._hideHoverImg() 96 | if (!this._enableTap(e)) return !1; 97 | this._inputLpnHandler(e && e.name ? e.name : ""); 98 | var t = this.data.lpn; 99 | return this.setData({ 100 | showPrefixKeyboard: t.length < 1, 101 | showSuffixKeyboard: t.length >= 1, 102 | showEnergyIcon: t.length > 7, 103 | enableNumKey: t.length > 1, 104 | enableOKey: 1 == t.length, 105 | enableLastKey: t.length >= 6 106 | }), console.log(this.data), this.triggerEvent("lpnChangeEvent", { 107 | lpn: t 108 | }), !0; 109 | }, 110 | _enableTap: function(e) { 111 | return null == e || null == e.keyEnable || e.keyEnable; 112 | }, 113 | show: function() { 114 | this.setData({ 115 | showCursor: !0, 116 | showKeyboard: !0, 117 | showPlaceholder: !1 118 | }), this.triggerEvent("keyboardStatus", { 119 | keyboardShow: !0 120 | }); 121 | }, 122 | hide: function() { 123 | var e = !1; 124 | 0 == this.data.lpn.length && (e = !0), this.setData({ 125 | showCursor: !1, 126 | showKeyboard: !1, 127 | showPlaceholder: e 128 | }), this.triggerEvent("keyboardStatus", { 129 | keyboardShow: !1 130 | }); 131 | }, 132 | getLpn: function() { 133 | return this.data.lpn; 134 | }, 135 | setDefaultLpn: function(e) { 136 | this.setData({ 137 | lpn: e, 138 | showPlaceholder: null == e || 0 == e.length 139 | }), this._stopKeyEvent(); 140 | }, 141 | clearInput: function() { 142 | this.setDefaultLpn(""), this.hide(); 143 | } 144 | } 145 | }); -------------------------------------------------------------------------------- /components/keyboard_component/keyboard_component.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /components/keyboard_component/keyboard_component.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 请输入车牌号码 4 | {{lpn}} 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | {{hoverImg.text}} 15 | 16 | 17 | 18 | 19 | 20 | {{item}} 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | {{item}} 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | {{item}} 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | {{item}} 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | {{hoverImg.text}} 95 | 96 | 97 | 98 | 99 | 100 | {{item}} 101 | 102 | 103 | 104 | 105 | 106 | 107 | {{item}} 108 | 109 | 110 | 111 | 112 | 113 | 114 | {{item}} 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | {{item}} 127 | 128 | 129 | 130 | 131 | {{item}} 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | -------------------------------------------------------------------------------- /components/keyboard_component/keyboard_component.wxss: -------------------------------------------------------------------------------- 1 | .flex_center { 2 | display: -webkit-box; 3 | display: -webkit-flex; 4 | display: -ms-flexbox; 5 | display: flex; 6 | -webkit-box-align: center; 7 | -ms-flex-align: center; 8 | align-items: center; 9 | } 10 | 11 | .flex_full { 12 | -webkit-box-flex: 1; 13 | flex: 1; 14 | } 15 | 16 | .flex_half { 17 | -webkit-box-flex: 0.5; 18 | flex: 0.5; 19 | } 20 | 21 | .flex_half_2 { 22 | -webkit-box-flex: 0.25; 23 | flex: 0.25; 24 | } 25 | 26 | .flex_half_3 { 27 | -webkit-box-flex: 0.75; 28 | flex: 0.75; 29 | } 30 | 31 | .flex_twice { 32 | -webkit-box-flex: 1.5; 33 | flex: 1.5; 34 | } 35 | 36 | .container { 37 | height: 100%; 38 | } 39 | 40 | .custom_input_box { 41 | position: relative; 42 | /* margin: 10rpx 0; */ 43 | line-height: 90rpx; 44 | font-size: 32rpx; 45 | } 46 | 47 | .custom_input_box .energy_icon { 48 | margin-right: 20rpx; 49 | width: 56rpx; 50 | height: 32rpx; 51 | } 52 | 53 | .custom_input_box .custom_placeholder { 54 | color: #888; 55 | } 56 | 57 | .custom_input_box .custom_lpn { 58 | color: #2c4358; 59 | letter-spacing: 4rpx; 60 | /* height: 100rpx; */ 61 | } 62 | 63 | .cursor:after { 64 | content: ""; 65 | width: 4rpx; 66 | height: 30rpx; 67 | background: url(data:image/gif;base64,R0lGODlhAgAaAIABADeX/v///yH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTM4IDc5LjE1OTgyNCwgMjAxNi8wOS8xNC0wMTowOTowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTcgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkNBNkQxNjZDMDc4RTExRTdBN0I4QzM2QjIzMDQwNzBFIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkNBNkQxNjZEMDc4RTExRTdBN0I4QzM2QjIzMDQwNzBFIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6Q0E2RDE2NkEwNzhFMTFFN0E3QjhDMzZCMjMwNDA3MEUiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6Q0E2RDE2NkIwNzhFMTFFN0E3QjhDMzZCMjMwNDA3MEUiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4B//79/Pv6+fj39vX08/Lx8O/u7ezr6uno5+bl5OPi4eDf3t3c29rZ2NfW1dTT0tHQz87NzMvKycjHxsXEw8LBwL++vby7urm4t7a1tLOysbCvrq2sq6qpqKempaSjoqGgn56dnJuamZiXlpWUk5KRkI+OjYyLiomIh4aFhIOCgYB/fn18e3p5eHd2dXRzcnFwb25tbGtqaWhnZmVkY2JhYF9eXVxbWllYV1ZVVFNSUVBPTk1MS0pJSEdGRURDQkFAPz49PDs6OTg3NjU0MzIxMC8uLSwrKikoJyYlJCMiISAfHh0cGxoZGBcWFRQTEhEQDw4NDAsKCQgHBgUEAwIBAAAh+QQJKAABACwAAAAAAgAaAAACBoSPqcu9BQAh+QQFKAABACwAAAAAAgAaAAACBoyPqcu9BQA7) center left no-repeat; 68 | background-size: 4rpx 28rpx; 69 | padding-left: 30rpx; 70 | } 71 | 72 | .keyboard_box { 73 | position: fixed; 74 | bottom: 0; 75 | left: 0; 76 | right: 0; 77 | background-color: #e1e3e7; 78 | text-align: center; 79 | box-shadow: 0 -6rpx 22rpx #e9e9e9; 80 | z-index: 100; 81 | line-height: 1!important; 82 | } 83 | 84 | .keyboard_box .bar { 85 | height: 66rpx; 86 | background-color: #fff; 87 | position: relative; 88 | } 89 | 90 | .keyboard_box .bar .k_close { 91 | color: #259cf5; 92 | font-size: 32rpx; 93 | text-align: right; 94 | float: right; 95 | border: none; 96 | height: 100%; 97 | line-height: 66rpx; 98 | } 99 | 100 | .keyboard { 101 | text-align: center; 102 | padding: 13rpx 8rpx; 103 | max-width: 1000rpx; 104 | margin: 0 auto; 105 | position: relative; 106 | } 107 | 108 | .keyboard .key_box { 109 | margin-bottom: 10rpx; 110 | } 111 | 112 | .keyboard .key_box:last-child { 113 | margin-bottom: 0; 114 | } 115 | 116 | .keyboard .key_box .key view { 117 | padding-bottom: 154%; 118 | background-color: #fff; 119 | display: inline-block; 120 | width: 100%; 121 | margin: 0; 122 | border-radius: 10rpx; 123 | font-size: 40rpx; 124 | position: relative; 125 | box-shadow: 0 4rpx 4rpx #d7d7d7; 126 | z-index: 50; 127 | } 128 | 129 | .keyboard .key_box .key view text { 130 | position: absolute; 131 | top: 50%; 132 | height: 5.2rpx; 133 | line-height: 5.2rpx; 134 | width: 100%; 135 | left: 0; 136 | margin-top: -2rpx; 137 | font-style: normal; 138 | color: #212121; 139 | } 140 | 141 | .keyboard .key_box .key { 142 | margin-right: 10rpx; 143 | font-size: 0; 144 | } 145 | 146 | .keyboard .key_box .key:last-child { 147 | margin-right: 0; 148 | } 149 | 150 | .keyboard .key_box .key.empty { 151 | margin-right: 6rpx; 152 | } 153 | 154 | .keyboard .key_box .key.m_r_none { 155 | margin-right: 0; 156 | } 157 | 158 | .keyboard .key_box .key.empty view,.keyboard .key_box .key.empty_2 view,.keyboard .key_box .key.empty_3 view { 159 | margin: 0; 160 | background-color: rgba(0,0,0,0); 161 | box-shadow: none; 162 | } 163 | 164 | .keyboard .key_box .key.del view { 165 | padding-bottom: 104%; 166 | background: #c4c8cf url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC8AAAAjCAMAAAAzO6PlAAAAeFBMVEUAAAAfHx8AAAAhISEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAhISEAAAAAAAAhISEAAAAAAAAAAAAhISEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAhISEAAAAAAAAAAAAAAAAAAAAhISFqaXi8AAAAJnRSTlMADt7p4vrqEakG81Yw0cqdcmkp19OtpJuLe0QgGha8WjjVt0lHNjgEeYMAAAEUSURBVDjLlZTZkoIwEEVvlATZFBEXNsfZrv//h1O+TBMiUH2eUqlzU1k6jQkPzuGuOQIq2s0MltxhQmdthzni3TQwpKywwIW5t4DjL5aIeYVgIrZYxqYyTk7MsEJE0fc8QuHf2UDhn3mT6bIwo2MVZegfeIBQP7fmX98+68C/8YwX4mxNMBS/4R0IA74u/pH7BG8Cont+xpPoXkD0kf/DSOb8gOji93Qx8D4guvgZW2j8gc5AsR98c5NAcd7XdQKK+0TDL2jeS6pnvR6kOkcUfr0VgQ//s5Sf43quS99f/4yhD+P40PiIU1YaH71lp/FR0fYrvnUYkTMdFP0NaOliRf8EMkZG0Z+BD6Yr/T8IzOEuOYA/UT8eew4Z9jsAAAAASUVORK5CYII=") no-repeat center center; 167 | background-size: 50%; 168 | } 169 | 170 | .keyboard .key_box .key.disable view { 171 | background-color: #e9edf1; 172 | } 173 | 174 | .keyboard .key_box .key view.float { 175 | z-index: 300; 176 | } 177 | 178 | .keyboard .click { 179 | position: absolute; 180 | top: -47rpx; 181 | left: 32rpx; 182 | z-index: -200; 183 | width: 60rpx; 184 | font-size: 0; 185 | } 186 | 187 | .keyboard .click .float_num { 188 | width: 100%; 189 | text-align: center; 190 | color: #212121; 191 | font-size: 56rpx; 192 | position: absolute; 193 | left: 0; 194 | top: 0; 195 | height: 60rpx; 196 | line-height: 60rpx; 197 | } 198 | 199 | .keyboard .click image { 200 | width: 100%; 201 | height: 100%; 202 | } 203 | 204 | .keyboard .click .cover { 205 | position: absolute; 206 | left: 0; 207 | top: 0; 208 | right: 0; 209 | bottom: 0; 210 | z-index: 10; 211 | } 212 | 213 | .clear-img { 214 | width: 40rpx; 215 | height: 40rpx; 216 | /* position: absolute; 217 | right: 20rpx; 218 | top: 30rpx; */ 219 | } -------------------------------------------------------------------------------- /components/simple_keyboard_component/simple_keyboard_component.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | options: { 3 | multipleSlots: !0 4 | }, 5 | properties: { 6 | placeholderText: { 7 | type: String, 8 | value: "请输入" 9 | } 10 | }, 11 | data: { 12 | suffixListLine1: [ "1", "2", "3", "4", "5", "6", "7", "8", "9", "0" ], 13 | suffixListLine2: [ "Q", "W", "E", "R", "T", "Y", "U", "O", "P", "A" ], 14 | suffixListLine3: [ "S", "D", "F", "G", "H", "J", "K", "L", "Z" ], 15 | suffixListLine4: [ "X", "C", "V", "B", "N", "M" ], 16 | content: "", 17 | hoverImg: { 18 | width: "0", 19 | height: "0", 20 | lineHeight: "0", 21 | text: "", 22 | left: "0", 23 | top: "10rpx", 24 | zIndex: "-200", 25 | visibility: "hidden" 26 | }, 27 | keyWidth: 0, 28 | keyHeight: 0, 29 | keyLeft: 0, 30 | keyTop: 0, 31 | showKeyboard: !1, 32 | showPlaceholder: !0, 33 | showCursor: !1, 34 | showSuffixKeyboard: !0, 35 | other: "" 36 | }, 37 | methods: { 38 | _keyPressHandler: function(t) { 39 | console.log(t); 40 | var e = this, n = t.currentTarget; 41 | if (!this._enableTap(n.dataset)) return !1; 42 | var i = wx.createSelectorQuery().in(this); 43 | i.select("#" + n.id).boundingClientRect(), i.exec(function(t) { 44 | console.log(t); 45 | var i = t[0]; 46 | e.setData({ 47 | keyWidth: i.width, 48 | keyHeight: i.height, 49 | keyLeft: n.offsetLeft, 50 | keyTop: n.offsetTop 51 | }), e._showHoverImg(n.offsetLeft, n.offsetTop, i.width, i.height, i.dataset.name); 52 | }); 53 | }, 54 | _keyUpHandler: function(t) { 55 | console.log(t), this._stopKeyEvent(t.currentTarget.dataset); 56 | }, 57 | _showHoverImg: function(t, e, n, i, o) { 58 | var s = n * (105 / 64), a = s * (192 / 102), h = t - (s - n) / 2 - .4, r = e + i - a + 1; 59 | this.setData({ 60 | hoverImg: { 61 | left: h + "px", 62 | top: r + "px", 63 | width: s + "px", 64 | height: a + "px", 65 | lineHeight: a - i + "px", 66 | text: o, 67 | zIndex: 200, 68 | visibility: "visible" 69 | } 70 | }); 71 | }, 72 | _hideHoverImg: function() { 73 | this.setData({ 74 | hoverImg: { 75 | visibility: "hidden", 76 | zIndex: -200 77 | } 78 | }); 79 | }, 80 | _inputContentHandler: function(t) { 81 | var e = this, n = e.data.content; 82 | e.setData({ 83 | content: n + t 84 | }); 85 | }, 86 | _deleteHandler: function(t) { 87 | var e = this.data.content; 88 | this.setData({ 89 | content: 0 == e.length ? "" : e.substring(0, e.length - 1) 90 | }), this._stopKeyEvent(t.currentTarget.dataset); 91 | }, 92 | _stopKeyEvent: function(t) { 93 | // 此处限制输入长度 94 | if (this.data.content.length>3){ 95 | // 关闭动画 96 | return this._hideHoverImg() 97 | } 98 | return !!this._enableTap(t) && (this._hideHoverImg(), this._inputContentHandler(t && t.name ? t.name : ""), 99 | console.log(this.data), !0); 100 | }, 101 | _enableTap: function(t) { 102 | return null == t || null == t.keyEnable || t.keyEnable; 103 | }, 104 | show: function() { 105 | this.setData({ 106 | showCursor: !0, 107 | showKeyboard: !0, 108 | showPlaceholder: !1 109 | }), this.triggerEvent("keyboardStatus", { 110 | keyboardShow: !0 111 | }); 112 | }, 113 | hide: function() { 114 | var t = !1; 115 | 0 == this.data.content.length && (t = !0), this.setData({ 116 | showCursor: !1, 117 | showKeyboard: !1, 118 | showPlaceholder: t 119 | }), this.triggerEvent("keyboardStatus", { 120 | keyboardShow: !1 121 | }); 122 | }, 123 | getContent: function() { 124 | return this.data.content; 125 | }, 126 | setDefaultContent: function(t) { 127 | this.setData({ 128 | content: t, 129 | showPlaceholder: null == t || 0 == t.length 130 | }), this._stopKeyEvent(); 131 | }, 132 | clearInput: function() { 133 | this.setDefaultContent(""), this.hide(); 134 | } 135 | } 136 | }); -------------------------------------------------------------------------------- /components/simple_keyboard_component/simple_keyboard_component.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /components/simple_keyboard_component/simple_keyboard_component.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{placeholderText}} 4 | {{content}} 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | {{hoverImg.text}} 15 | 16 | 17 | 18 | 19 | 20 | {{item}} 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | {{item}} 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | {{item}} 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | {{item}} 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /components/simple_keyboard_component/simple_keyboard_component.wxss: -------------------------------------------------------------------------------- 1 | .flex_center { 2 | display: -webkit-box; 3 | display: -webkit-flex; 4 | display: -ms-flexbox; 5 | display: flex; 6 | -webkit-box-align: center; 7 | -ms-flex-align: center; 8 | align-items: center; 9 | } 10 | 11 | .flex_full { 12 | -webkit-box-flex: 1; 13 | flex: 1; 14 | } 15 | 16 | .flex_half { 17 | -webkit-box-flex: 0.5; 18 | flex: 0.5; 19 | } 20 | 21 | .flex_half_2 { 22 | -webkit-box-flex: 0.25; 23 | flex: 0.25; 24 | } 25 | 26 | .flex_half_3 { 27 | -webkit-box-flex: 0.75; 28 | flex: 0.75; 29 | } 30 | 31 | .flex_twice { 32 | -webkit-box-flex: 1.5; 33 | flex: 1.5; 34 | } 35 | 36 | .container { 37 | height: 100%; 38 | } 39 | 40 | .custom_input_box { 41 | position: relative; 42 | /* margin: 10rpx 0; */ 43 | line-height: 98rpx; 44 | border-radius: 10rpx; 45 | padding: 0; 46 | font-size: 32rpx; 47 | } 48 | 49 | .custom_input_box .energy_icon { 50 | margin-right: 20rpx; 51 | width: 56rpx; 52 | height: 32rpx; 53 | } 54 | 55 | .custom_input_box .custom_placeholder { 56 | color: #888; 57 | } 58 | 59 | .custom_input_box .custom_lpn { 60 | color: #2c4358; 61 | letter-spacing: 4rpx; 62 | height: 100rpx; 63 | } 64 | 65 | .cursor:after { 66 | content: ""; 67 | width: 4rpx; 68 | height: 30rpx; 69 | background: url(data:image/gif;base64,R0lGODlhAgAaAIABADeX/v///yH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTM4IDc5LjE1OTgyNCwgMjAxNi8wOS8xNC0wMTowOTowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTcgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkNBNkQxNjZDMDc4RTExRTdBN0I4QzM2QjIzMDQwNzBFIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkNBNkQxNjZEMDc4RTExRTdBN0I4QzM2QjIzMDQwNzBFIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6Q0E2RDE2NkEwNzhFMTFFN0E3QjhDMzZCMjMwNDA3MEUiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6Q0E2RDE2NkIwNzhFMTFFN0E3QjhDMzZCMjMwNDA3MEUiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4B//79/Pv6+fj39vX08/Lx8O/u7ezr6uno5+bl5OPi4eDf3t3c29rZ2NfW1dTT0tHQz87NzMvKycjHxsXEw8LBwL++vby7urm4t7a1tLOysbCvrq2sq6qpqKempaSjoqGgn56dnJuamZiXlpWUk5KRkI+OjYyLiomIh4aFhIOCgYB/fn18e3p5eHd2dXRzcnFwb25tbGtqaWhnZmVkY2JhYF9eXVxbWllYV1ZVVFNSUVBPTk1MS0pJSEdGRURDQkFAPz49PDs6OTg3NjU0MzIxMC8uLSwrKikoJyYlJCMiISAfHh0cGxoZGBcWFRQTEhEQDw4NDAsKCQgHBgUEAwIBAAAh+QQJKAABACwAAAAAAgAaAAACBoSPqcu9BQAh+QQFKAABACwAAAAAAgAaAAACBoyPqcu9BQA7) center left no-repeat; 70 | background-size: 4rpx 28rpx; 71 | padding-left: 30rpx; 72 | } 73 | 74 | .keyboard_box { 75 | position: fixed; 76 | bottom: 0; 77 | left: 0; 78 | right: 0; 79 | background-color: #e1e3e7; 80 | text-align: center; 81 | box-shadow: 0 -6rpx 22rpx #e9e9e9; 82 | z-index: 100; 83 | line-height: 1!important; 84 | } 85 | 86 | .keyboard_box .bar { 87 | height: 66rpx; 88 | background-color: #fff; 89 | position: relative; 90 | } 91 | 92 | .keyboard_box .bar .k_close { 93 | color: #259cf5; 94 | font-size: 32rpx; 95 | text-align: right; 96 | float: right; 97 | border: none; 98 | height: 100%; 99 | line-height: 66rpx; 100 | } 101 | 102 | .keyboard { 103 | text-align: center; 104 | padding: 13rpx 8rpx; 105 | max-width: 1000rpx; 106 | margin: 0 auto; 107 | position: relative; 108 | } 109 | 110 | .keyboard .key_box { 111 | margin-bottom: 10rpx; 112 | } 113 | 114 | .keyboard .key_box:last-child { 115 | margin-bottom: 0; 116 | } 117 | 118 | .keyboard .key_box .key view { 119 | padding-bottom: 154%; 120 | background-color: #fff; 121 | display: inline-block; 122 | width: 100%; 123 | margin: 0; 124 | border-radius: 10rpx; 125 | font-size: 40rpx; 126 | position: relative; 127 | box-shadow: 0 4rpx 4rpx #d7d7d7; 128 | z-index: 50; 129 | } 130 | 131 | .keyboard .key_box .key view text { 132 | position: absolute; 133 | top: 50%; 134 | height: 5.2rpx; 135 | line-height: 5.2rpx; 136 | width: 100%; 137 | left: 0; 138 | margin-top: -2rpx; 139 | font-style: normal; 140 | color: #212121; 141 | } 142 | 143 | .keyboard .key_box .key { 144 | font-size: 0; 145 | } 146 | 147 | .keyboard .key_box .key,.keyboard .key_box .key.empty_3 { 148 | margin-right: 10rpx; 149 | } 150 | 151 | .keyboard .key_box .key:last-child { 152 | margin-right: 0; 153 | } 154 | 155 | .keyboard .key_box .key.empty { 156 | margin-right: 5rpx; 157 | } 158 | 159 | .keyboard .key_box .key.m_r_none { 160 | margin-right: 0; 161 | } 162 | 163 | .keyboard .key_box .key.empty view,.keyboard .key_box .key.empty_2 view,.keyboard .key_box .key.empty_3 view { 164 | margin: 0; 165 | background-color: rgba(0,0,0,0); 166 | box-shadow: none; 167 | } 168 | 169 | .keyboard .key_box .key.del view { 170 | padding-bottom: 104%; 171 | background: #c4c8cf url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC8AAAAjCAMAAAAzO6PlAAAAeFBMVEUAAAAfHx8AAAAhISEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAhISEAAAAAAAAhISEAAAAAAAAAAAAhISEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAhISEAAAAAAAAAAAAAAAAAAAAhISFqaXi8AAAAJnRSTlMADt7p4vrqEakG81Yw0cqdcmkp19OtpJuLe0QgGha8WjjVt0lHNjgEeYMAAAEUSURBVDjLlZTZkoIwEEVvlATZFBEXNsfZrv//h1O+TBMiUH2eUqlzU1k6jQkPzuGuOQIq2s0MltxhQmdthzni3TQwpKywwIW5t4DjL5aIeYVgIrZYxqYyTk7MsEJE0fc8QuHf2UDhn3mT6bIwo2MVZegfeIBQP7fmX98+68C/8YwX4mxNMBS/4R0IA74u/pH7BG8Cont+xpPoXkD0kf/DSOb8gOji93Qx8D4guvgZW2j8gc5AsR98c5NAcd7XdQKK+0TDL2jeS6pnvR6kOkcUfr0VgQ//s5Sf43quS99f/4yhD+P40PiIU1YaH71lp/FR0fYrvnUYkTMdFP0NaOliRf8EMkZG0Z+BD6Yr/T8IzOEuOYA/UT8eew4Z9jsAAAAASUVORK5CYII=") no-repeat center center; 172 | background-size: 50%; 173 | } 174 | 175 | .keyboard .key_box .key.disable view { 176 | background-color: #e9edf1; 177 | } 178 | 179 | .keyboard .key_box .key view.float { 180 | z-index: 300; 181 | } 182 | 183 | .keyboard .click { 184 | position: absolute; 185 | top: -47rpx; 186 | left: 32rpx; 187 | z-index: -200; 188 | width: 60rpx; 189 | font-size: 0; 190 | } 191 | 192 | .keyboard .click .float_num { 193 | width: 100%; 194 | text-align: center; 195 | color: #212121; 196 | font-size: 56rpx; 197 | position: absolute; 198 | left: 0; 199 | top: 0; 200 | height: 60rpx; 201 | line-height: 60rpx; 202 | } 203 | 204 | .keyboard .click image { 205 | width: 100%; 206 | height: 100%; 207 | } 208 | 209 | .keyboard .click .cover { 210 | position: absolute; 211 | left: 0; 212 | top: 0; 213 | right: 0; 214 | bottom: 0; 215 | z-index: 10; 216 | } 217 | 218 | .clear-img { 219 | width: 40rpx; 220 | height: 40rpx; 221 | position: absolute; 222 | right:10rpx; 223 | top: 30rpx; 224 | } -------------------------------------------------------------------------------- /images/0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/0.png -------------------------------------------------------------------------------- /images/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/1.png -------------------------------------------------------------------------------- /images/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/2.png -------------------------------------------------------------------------------- /images/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/3.png -------------------------------------------------------------------------------- /images/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/4.png -------------------------------------------------------------------------------- /images/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/5.png -------------------------------------------------------------------------------- /images/add_car.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/add_car.png -------------------------------------------------------------------------------- /images/bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/bottom.png -------------------------------------------------------------------------------- /images/clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/clear.png -------------------------------------------------------------------------------- /images/collection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/collection.png -------------------------------------------------------------------------------- /images/doubt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/doubt.png -------------------------------------------------------------------------------- /images/ico_home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/ico_home.png -------------------------------------------------------------------------------- /images/ico_home1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/ico_home1.png -------------------------------------------------------------------------------- /images/index/index_fail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/index/index_fail.png -------------------------------------------------------------------------------- /images/index_bind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/index_bind.png -------------------------------------------------------------------------------- /images/keyboard/cursor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/keyboard/cursor.gif -------------------------------------------------------------------------------- /images/keyboard/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/keyboard/delete.png -------------------------------------------------------------------------------- /images/keyboard/energy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/keyboard/energy.png -------------------------------------------------------------------------------- /images/keyboard/hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/keyboard/hover.png -------------------------------------------------------------------------------- /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/logo.png -------------------------------------------------------------------------------- /images/my.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/my.png -------------------------------------------------------------------------------- /images/my1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/my1.png -------------------------------------------------------------------------------- /images/pay/x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/pay/x.png -------------------------------------------------------------------------------- /images/prompt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/prompt.png -------------------------------------------------------------------------------- /images/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/right.png -------------------------------------------------------------------------------- /images/right2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/right2.png -------------------------------------------------------------------------------- /images/right3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/right3.png -------------------------------------------------------------------------------- /images/rule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/rule.png -------------------------------------------------------------------------------- /images/sao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/sao.png -------------------------------------------------------------------------------- /images/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/search.png -------------------------------------------------------------------------------- /images/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/success.png -------------------------------------------------------------------------------- /images/tap_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/tap_right.png -------------------------------------------------------------------------------- /images/tishi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/tishi.png -------------------------------------------------------------------------------- /images/tishi1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/tishi1.png -------------------------------------------------------------------------------- /images/touxiang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/touxiang.png -------------------------------------------------------------------------------- /images/tu1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wnnu/WeChat_park/47577a818dbb45452e4509f2784b7110dcd37fc8/images/tu1.png -------------------------------------------------------------------------------- /pages/index/index.js: -------------------------------------------------------------------------------- 1 | //index.js 2 | //获取应用实例 3 | const app = getApp() 4 | 5 | Page({ 6 | data: { 7 | imgUrls: [ 8 | '/images/tu1.png', 9 | ], 10 | indicatorDots: false, 11 | autoplay: true, 12 | interval: 3000, 13 | duration: 500, 14 | circular: true,//从data开始的值到此是轮播 15 | hasUserInfo: false,//是否已授权 16 | canIUse: wx.canIUse('button.open-type.getUserInfo'),//判断是否可用 17 | member:false,//是否是会员 18 | member_tel: "",//会员手机号,默认无 19 | member_dengji: "",//会员等级,默认无 20 | show:"",//卷码扫描值 21 | history: null,//历史记录值 22 | showModalStatus: false,//搜索面板显示,默认隐藏 23 | search_result: null,//搜索结果 24 | keyboardShow:null,//搜索车牌的值 25 | }, 26 | onLoad: function (options) { 27 | var that=this 28 | this.setData({ 29 | simpleKeyboard: this.selectComponent("#simpleKeyboard"),//获取传值 30 | }) 31 | // 此处判断是否是会员--https://www.jianshu.com/p/aaf65625fc9d 32 | if (app.globalData.member) { 33 | this.setData({ 34 | member: app.globalData.member, 35 | history: app.globalData.history, 36 | }) 37 | } else{ 38 | // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 39 | // 所以此处加入 callback 以防止这种情况 40 | app.memberReadyCallback = res => { 41 | that.shuju(); 42 | } 43 | } 44 | 45 | }, 46 | /** 47 | * 生命周期函数--监听页面初次渲染完成 48 | */ 49 | onReady: function () { 50 | 51 | }, 52 | /** 53 | * 生命周期函数--监听页面显示 54 | */ 55 | onShow: function () { 56 | this.shuju();//每次进入时数据渲染 57 | }, 58 | 59 | // 搜索查询 60 | toSearch: function (e) { 61 | this.data.simpleKeyboard.hide() 62 | var o = this.data.simpleKeyboard.getContent() 63 | let data; 64 | let localStorageValue = []; 65 | var that=this; 66 | if (o != '' && o.length>=4) { 67 | //调用API从本地缓存中获取数据 68 | // var searchData = wx.getStorageSync('searchData') || [] 69 | // searchData.push(this.data.inputValue) 70 | // wx.setStorageSync('searchData', searchData) 71 | 72 | 73 | wx.request({ 74 | url: app.globalData.host + '/wxpay/getparkingbykeyword',//这里填写后台给你的搜索接口 75 | data: { keyword:o}, 76 | header: { 77 | 'content-type': 'application/json', 78 | 'Cookie': 'NWRZPARKINGID=' + app.globalData.loginMess 79 | }, 80 | success: function (res) { 81 | console.log(res) 82 | if (res.data.code === 1200) { 83 | wx.showModal({ 84 | title: "提示", 85 | content: "" + res.data.msg, 86 | confirmColor: "#4fafc9", 87 | confirmText: "我知道了", 88 | showCancel: false, 89 | success: function (res) { 90 | if (res.confirm) { 91 | } 92 | } 93 | }) 94 | }else{ 95 | if (res.data.code === 1001) { 96 | for (var i = 0; i < res.data.data.data.length; i++) { 97 | var str = res.data.data.data[i].carnumber; 98 | var str2 = str.substring(0, 2) + "·" + str.substring(2); 99 | res.data.data.data[i].carnumber = str2; 100 | } 101 | that.setData({ 102 | search_result: res.data.data.data, 103 | }); 104 | that.showModal() 105 | console.log(that.data.search_result) 106 | } else { 107 | wx.showModal({ 108 | title: "搜索提示", 109 | content: "" + res.data.msg, 110 | confirmColor: "#4fafc9", 111 | confirmText: "我知道了", 112 | showCancel: false, 113 | success: function (res) { 114 | if (res.confirm) { 115 | } 116 | } 117 | }) 118 | } 119 | } 120 | }, 121 | fail: function (e) { 122 | wx.showToast({ 123 | title: '网络异常!', 124 | duration: 2000 125 | }); 126 | }, 127 | }); 128 | } else { 129 | wx.showModal({ 130 | title: "无法查询", 131 | content: "查询值不能为空或长度低于4位", 132 | confirmColor: "#4fafc9", 133 | confirmText: "我知道了", 134 | showCancel: false, 135 | }) 136 | } 137 | 138 | }, 139 | // 缴费规则 140 | tapRule: function (e) { 141 | wx.navigateTo({ 142 | url: "/pages/w_index_rule/w_index_rule" 143 | }) 144 | }, 145 | //绑定会员 146 | tapBindmember: function (e) { 147 | this.data.simpleKeyboard.hide() 148 | wx.navigateTo({ 149 | url: "/pages/w_my_bind_member/w_my_bind_member" 150 | }) 151 | }, 152 | 153 | //卷码扫描 154 | scan: function () { 155 | var that = this; 156 | var show; 157 | wx.scanCode({ 158 | success: (res) => { 159 | this.show = "--result:" + res.result 160 | that.setData({ 161 | show: this.show 162 | }) 163 | wx.showToast({ 164 | title: '成功', 165 | icon: 'success', 166 | duration: 2000 167 | }) 168 | //获取成功向后台保存获取的值 169 | }, 170 | fail: (res) => { 171 | wx.showModal({ 172 | title: "未获取成功", 173 | content: "未成功扫描二维码", 174 | confirmColor: "#4fafc9", 175 | confirmText: "我知道了", 176 | showCancel: false, 177 | }) 178 | // wx.showToast({ 179 | // title: '未获取成功', 180 | // image: '/images/tishi.png', 181 | // duration: 2000 182 | // }) 183 | }, 184 | complete: (res) => { 185 | } 186 | }) 187 | }, 188 | //显示对话框 189 | showModal: function () { 190 | // 显示遮罩层 191 | var animation = wx.createAnimation({ 192 | duration: 200, 193 | timingFunction: "linear", 194 | delay: 0 195 | }) 196 | this.animation = animation 197 | animation.translateY(300).step() 198 | this.setData({ 199 | animationData: animation.export(), 200 | showModalStatus: true 201 | }) 202 | setTimeout(function () { 203 | animation.translateY(0).step() 204 | this.setData({ 205 | animationData: animation.export() 206 | }) 207 | }.bind(this), 200) 208 | }, 209 | //隐藏对话框 210 | hideModal: function () { 211 | // 隐藏遮罩层 212 | var animation = wx.createAnimation({ 213 | duration: 200, 214 | timingFunction: "linear", 215 | delay: 0 216 | }) 217 | this.animation = animation 218 | animation.translateY(300).step() 219 | this.setData({ 220 | animationData: animation.export(), 221 | }) 222 | setTimeout(function () { 223 | animation.translateY(0).step() 224 | this.setData({ 225 | animationData: animation.export(), 226 | showModalStatus: false 227 | }) 228 | }.bind(this), 200) 229 | }, 230 | //搜索结果跳支付 231 | search_pay: function (e) { 232 | var str = e.currentTarget.dataset.text.replace("·", "") 233 | if (app.globalData.loginMess && app.globalData.loginMess!=""){ 234 | wx.request({ 235 | url: app.globalData.host + '/wxpay/getparkinginfo',//这里填写后台给你的搜索接口 236 | data: { carnumber: str }, 237 | header: { 238 | 'content-type': 'application/json', 239 | 'Cookie': 'NWRZPARKINGID=' + app.globalData.loginMess 240 | }, 241 | success: function (res) { 242 | console.log(res) 243 | if (res.data.code === 1200) { 244 | wx.showModal({ 245 | title: "提示", 246 | content: "" + res.data.msg, 247 | confirmColor: "#4fafc9", 248 | confirmText: "我知道了", 249 | showCancel: false, 250 | success: function (res) { 251 | if (res.confirm) { 252 | } 253 | } 254 | }) 255 | } else { 256 | if (res.data.code === 1001) { 257 | wx.showModal({ 258 | title: "提示", 259 | content: "" + res.data.msg, 260 | confirmColor: "#4fafc9", 261 | confirmText: "我知道了", 262 | showCancel: false, 263 | success: function (res) { 264 | if (res.confirm) { 265 | } 266 | } 267 | }) 268 | } else { 269 | wx.navigateTo({ 270 | url: "/pages/w_payment/w_payment?title=" + str 271 | }) 272 | } 273 | } 274 | }, 275 | fail: function (e) { 276 | wx.showToast({ 277 | title: '网络异常!', 278 | duration: 2000 279 | }); 280 | }, 281 | }); 282 | }else{ 283 | wx.showModal({ 284 | title: "提示", 285 | content: "当前网络延迟,未获取到相关信息,请重新尝试", 286 | confirmColor: "#4fafc9", 287 | confirmText: "我知道了", 288 | showCancel: false, 289 | success: function (res) { 290 | if (res.confirm) { 291 | } 292 | } 293 | }) 294 | } 295 | 296 | }, 297 | //每次进入时数据渲染 298 | shuju:function(){ 299 | var str2=""; 300 | if (app.globalData.member_tel){ 301 | var str = app.globalData.member_tel; 302 | str2 = str.substr(0, 3) + "****" + str.substr(7); 303 | } 304 | this.setData({ 305 | member: app.globalData.member, 306 | member_tel: str2, 307 | member_dengji: app.globalData.member_dengji, 308 | history: app.globalData.history, 309 | }) 310 | }, 311 | }) 312 | -------------------------------------------------------------------------------- /pages/index/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "backgroundColor": "#f0eff7", 3 | "usingComponents": { 4 | "simpleKeyboard": "/components/simple_keyboard_component/simple_keyboard_component" 5 | } 6 | } -------------------------------------------------------------------------------- /pages/index/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 券码扫描 18 | 19 | 20 | {{member_tel}} 21 | {{member_dengji}} 22 | 23 | 24 | 25 | 26 | 27 | 28 | 欢迎使用停车缴费系统 29 | 30 | 绑定会员尽享停车优惠 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 44 | 45 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 查询 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | {{item}} 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 缴费规则 79 | 80 | 81 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | {{item.carnumber}} 95 | 96 | -------------------------------------------------------------------------------- /pages/index/index.wxss: -------------------------------------------------------------------------------- 1 | /**index.wxss**/ 2 | page{ 3 | /* background: #f3f3f3; */ 4 | height:100%; 5 | } 6 | 7 | /*swiper*/ 8 | swiper{ 9 | width: 690rpx; 10 | height: 262rpx; 11 | margin: 0 auto; 12 | padding-top: 24rpx; 13 | 14 | } 15 | swiper image{ 16 | display: block; 17 | width: 100%; 18 | height: 100%; 19 | border-radius: 18rpx; 20 | } 21 | /*信息展示*/ 22 | .zhuti{ 23 | height: calc(100% - 286rpx); 24 | width: 100%; 25 | position: relative; 26 | background: #ececec; 27 | } 28 | .park-info{ 29 | overflow: hidden; 30 | width: 100%; 31 | background-color: white; 32 | position: relative; 33 | height: 134rpx; 34 | /* padding: 25rpx 0rpx; */ 35 | /* margin-bottom: 20rpx; */ 36 | box-sizing: border-box; 37 | padding: 25rpx 0 0; 38 | } 39 | .info{ 40 | float: left; 41 | width: 50%; 42 | box-sizing: border-box; 43 | border:1px solid #ccc; 44 | border-width:0 1px 0 0; 45 | 46 | } 47 | .info:last-child{ 48 | border-width:0; 49 | } 50 | .info text{ 51 | display: block; 52 | text-align: center; 53 | 54 | } 55 | .park-show{ 56 | color: #333; 57 | font-size:28rpx; 58 | } 59 | .park-sao{ 60 | width: 36rpx; 61 | height: 36rpx; 62 | display: block; 63 | text-align: center; 64 | margin: 0 auto; 65 | } 66 | .park-click{ 67 | width: 100%; 68 | text-align: center; 69 | height: 100%; 70 | 71 | } 72 | .park-desc{ 73 | color: #777; 74 | margin-top: 15rpx; 75 | font-size:24rpx; 76 | } 77 | .click-text1{ 78 | display: block; 79 | color:#333; 80 | font-size: 34rpx; 81 | margin-bottom: 10rpx; 82 | } 83 | .click-bind{ 84 | display: flex; 85 | flex-direction: row; 86 | align-items: center; 87 | text-align: center; 88 | justify-content:center; 89 | } 90 | .click-text2{ 91 | color:#777; 92 | display: flex; 93 | align-items: center; 94 | text-align: center; 95 | justify-content:center; 96 | font-size: 24rpx; 97 | } 98 | .bind-img{ 99 | display: flex; 100 | align-items: center; 101 | text-align: center; 102 | justify-content:center; 103 | width: 32rpx; 104 | height: 32rpx; 105 | box-sizing: border-box; 106 | margin-left: 16rpx; 107 | } 108 | 109 | 110 | /* .info::after{ 111 | position: absolute; 112 | right: 20rpx; 113 | top: 35rpx; 114 | content: ""; 115 | width: 5rpx; 116 | height: 40rpx; 117 | background: #ccc; 118 | } */ 119 | .label-shouquan{ 120 | width: 100%; 121 | height:100%; 122 | display: inline-block; 123 | } 124 | /* .geduan{ 125 | width: 100%; 126 | height: 20rpx; 127 | background: #f3f3f3; 128 | } */ 129 | /*搜索查询和支付*/ 130 | .park-query{ 131 | overflow: hidden; 132 | width: 100%; 133 | background-color: #ececec; 134 | position: relative; 135 | box-sizing: border-box; 136 | padding: 30rpx 0; 137 | } 138 | .park-search{ 139 | overflow: hidden; 140 | width: 100%; 141 | /* padding-bottom:20rpx; */ 142 | } 143 | .search-title{ 144 | overflow: hidden; 145 | width: 100%; 146 | margin-bottom: 20rpx; 147 | text-align: center; 148 | } 149 | 150 | .search-desc{ 151 | font-size:32rpx; 152 | } 153 | .search-input{ 154 | overflow: hidden; 155 | width: 686rpx; 156 | margin: 0 auto; 157 | height: 98rpx; 158 | border-radius: 8rpx; 159 | border: 1rpx solid #ffb900; 160 | background: white; 161 | position: relative; 162 | } 163 | /* .section-img{ 164 | display: inline-block; 165 | width: 10%; 166 | height: 80rpx; 167 | float: left; 168 | } 169 | .btn-detail{ 170 | width: 60rpx; 171 | height: 60rpx; 172 | float: left; 173 | margin-top: 10rpx; 174 | } */ 175 | .section-input{ 176 | display: inline-block; 177 | width: 511rpx; 178 | height: 98rpx; 179 | box-sizing: border-box; 180 | padding-left:30rpx; 181 | } 182 | .section-input input{ 183 | /* border: 1rpx solid #000; */ 184 | background: white; 185 | padding: 0 0 0 36rpx; 186 | box-sizing: border-box; 187 | font-size: 32rpx; 188 | width: 100%; 189 | height: 98rpx; 190 | border-top-left-radius: 8rpx; 191 | border-bottom-left-radius: 8rpx; 192 | } 193 | .section-input input:focus { 194 | border: 1px solid #3b99fc; 195 | outline: 0; 196 | box-shadow: 0 0 3px 0px #3b99fc; 197 | -webkit-box-shadow: 0 0 3px 0px #3b99fc; 198 | } 199 | 200 | #simpleKeyboard{ 201 | width: 100%; 202 | height: 100%; 203 | background: white; 204 | font-size: 32rpx; 205 | } 206 | 207 | 208 | 209 | .section-button{ 210 | display: inline-block; 211 | width: 175rpx; 212 | height: 98rpx; 213 | position: absolute; 214 | right: 0; 215 | top:0; 216 | } 217 | .section-button button::after{ 218 | border: 0rpx; 219 | } 220 | .section-button text{ 221 | width: 100%; 222 | height: 100%; 223 | color: #282828; 224 | font-size: 36rpx; 225 | background: #ffb900; 226 | text-align: center; 227 | display: flex; 228 | align-items: center; 229 | justify-content: center; 230 | letter-spacing:18rpx; 231 | text-indent: 18rpx; 232 | } 233 | 234 | /*快捷缴费 */ 235 | .pay-quick{ 236 | overflow: hidden; 237 | width: 100%; 238 | margin-top: 52rpx; 239 | text-align: center; 240 | } 241 | .vehicle_info{ 242 | width: 395rpx; 243 | margin: 0 auto 40rpx; 244 | height:108rpx; 245 | position: relative; 246 | border-radius: 15rpx; 247 | box-sizing: border-box; 248 | padding: 8rpx 10rpx; 249 | background: linear-gradient(#739dfb ,#346ef3); /*渐变*/ 250 | } 251 | .bg-car{ 252 | width: 100%; 253 | height: 100%; 254 | } 255 | .vehicle_info text:last-child{ 256 | position: absolute; 257 | width: 100%; 258 | height: 100%; 259 | top: 0; 260 | left: 0; 261 | right:0; 262 | margin: 0 auto; 263 | box-sizing: border-box; 264 | font-size: 48rpx; 265 | letter-spacing:5rpx; 266 | font-weight: 700; 267 | text-align: center; 268 | color: white; 269 | display: flex; 270 | flex-direction: row; 271 | align-items: center; 272 | justify-content:center; 273 | background: linear-gradient(#7099fb,#3871f4); /*渐变*/ 274 | border-radius: 15rpx; 275 | } 276 | 277 | 278 | /* 收费细则和提醒 */ 279 | .pay-info{ 280 | position: absolute; 281 | bottom: 62rpx; 282 | left: 0; 283 | width: 100%; 284 | text-align: center; 285 | overflow: hidden; 286 | justify-content: center; 287 | display: flex; 288 | flex-direction: column; 289 | align-items: center; 290 | } 291 | .pay-img{ 292 | display: flex; 293 | align-items: center; 294 | text-align: center; 295 | justify-content:center; 296 | width: 30rpx; 297 | height: 30rpx; 298 | box-sizing: border-box; 299 | margin-left: 8rpx; 300 | } 301 | .pay-desc{ 302 | display: flex; 303 | align-items: center; 304 | text-align: center; 305 | justify-content:center; 306 | color: #999; 307 | font-size: 24rpx; 308 | } 309 | /*提示 */ 310 | .search-prompt{ 311 | width: 100%; 312 | display: flex; 313 | flex-direction: row; 314 | align-items: center; 315 | text-align: center; 316 | justify-content:center; 317 | } 318 | .prompt-img{ 319 | width: 34rpx; 320 | height:34rpx; 321 | } 322 | .prompt-desc{ 323 | color:#999; 324 | font-size: 24rpx; 325 | } 326 | /*遮罩层搜索结果*/ 327 | /*使屏幕变暗 */ 328 | .commodity_screen { 329 | width: 100%; 330 | height: 100%; 331 | position: fixed; 332 | top: 0; 333 | left: 0; 334 | background: #000; 335 | opacity: 0.2; 336 | overflow: hidden; 337 | z-index: 1000; 338 | color: #fff; 339 | } 340 | /*对话框 */ 341 | .commodity_attr_box { 342 | height: 500rpx; 343 | width: 100%; 344 | overflow: hidden; 345 | position: fixed; 346 | bottom: 0; 347 | left: 0; 348 | z-index: 2000; 349 | background: #fff; 350 | /* padding-top: 20rpx; */ 351 | box-sizing: border-box; 352 | padding: 20rpx 40rpx; 353 | overflow-y:scroll; 354 | } 355 | .commodity_attr_box::-webkit-scrollbar-track-piece { 356 | background-color: rgba(0, 0, 0, 0); 357 | border-left: 1px solid rgba(0, 0, 0, 0); 358 | } 359 | .commodity_attr_box::-webkit-scrollbar { 360 | width: 5px; 361 | height: 13px; 362 | -webkit-border-radius: 5px; 363 | -moz-border-radius: 5px; 364 | border-radius: 5px; 365 | } 366 | .commodity_attr_box::-webkit-scrollbar-thumb { 367 | background-color: rgba(0, 0, 0, 0.5); 368 | background-clip: padding-box; 369 | -webkit-border-radius: 5px; 370 | -moz-border-radius: 5px; 371 | border-radius: 5px; 372 | min-height: 28px; 373 | } 374 | .commodity_attr_box::-webkit-scrollbar-thumb:hover { 375 | background-color: rgba(0, 0, 0, 0.5); 376 | -webkit-border-radius: 5px; 377 | -moz-border-radius: 5px; 378 | border-radius: 5px; 379 | } 380 | /*搜索结果 */ 381 | .search_result{ 382 | width: 100%; 383 | box-sizing: border-box; 384 | border-bottom: 1px solid #b2b2b2; 385 | height: 90rpx; 386 | line-height: 90rpx; 387 | font-size: 36rpx; 388 | text-align: center; 389 | letter-spacing:5rpx; 390 | color: #282828; 391 | } 392 | 393 | /* 模拟车牌 */ 394 | .moni2{ 395 | width: 100%; 396 | height: 100%; 397 | position: relative; 398 | border-radius: 15rpx; 399 | box-sizing: border-box; 400 | border: 2rpx solid white; 401 | background: linear-gradient(#7099fb,#3871f4); /*渐变*/ 402 | } 403 | .moni3{ 404 | background: white; 405 | width: 27rpx; 406 | height: 8.5rpx; 407 | position: absolute; 408 | top: -3rpx; 409 | left: 75rpx; 410 | border-radius: 5rpx; 411 | z-index: 10; 412 | } 413 | .moni4{ 414 | background: white; 415 | width: 27rpx; 416 | height: 8.5rpx; 417 | position: absolute; 418 | top: -3rpx; 419 | right: 75rpx; 420 | border-radius: 5rpx; 421 | z-index: 10; 422 | } -------------------------------------------------------------------------------- /pages/index_fail/index_fail.js: -------------------------------------------------------------------------------- 1 | // pages/index_fail/index_fail.js 2 | Page({ 3 | 4 | /** 5 | * 页面的初始数据 6 | */ 7 | data: { 8 | 9 | }, 10 | 11 | /** 12 | * 生命周期函数--监听页面加载 13 | */ 14 | onLoad: function (options) { 15 | 16 | }, 17 | 18 | /** 19 | * 生命周期函数--监听页面初次渲染完成 20 | */ 21 | onReady: function () { 22 | 23 | }, 24 | 25 | /** 26 | * 生命周期函数--监听页面显示 27 | */ 28 | onShow: function () { 29 | 30 | }, 31 | 32 | /** 33 | * 生命周期函数--监听页面隐藏 34 | */ 35 | onHide: function () { 36 | 37 | }, 38 | 39 | /** 40 | * 生命周期函数--监听页面卸载 41 | */ 42 | onUnload: function () { 43 | 44 | }, 45 | 46 | /** 47 | * 页面相关事件处理函数--监听用户下拉动作 48 | */ 49 | onPullDownRefresh: function () { 50 | 51 | }, 52 | 53 | /** 54 | * 页面上拉触底事件的处理函数 55 | */ 56 | onReachBottom: function () { 57 | 58 | }, 59 | }) -------------------------------------------------------------------------------- /pages/index_fail/index_fail.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "提示" 3 | } -------------------------------------------------------------------------------- /pages/index_fail/index_fail.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 因网络或其他相关原因,无法获取相关信息 5 | 请重新进入小程序尝试 6 | 7 | 8 | -------------------------------------------------------------------------------- /pages/index_fail/index_fail.wxss: -------------------------------------------------------------------------------- 1 | /* pages/index_fail/index_fail.wxss */ 2 | page{ 3 | background: #f2f3f4; 4 | height:100%; 5 | } 6 | .index-fail{ 7 | display: flex; 8 | flex-direction: column; 9 | align-content: center; 10 | justify-content: center; 11 | padding-top: 320rpx; 12 | } 13 | .index-fail-img{ 14 | width: 80rpx; 15 | height: 80rpx; 16 | margin: 0 auto; 17 | margin-bottom: 30rpx; 18 | } 19 | .index-fail-desc{ 20 | text-align: center; 21 | font-size: 34rpx; 22 | color: #282828; 23 | margin: 10rpx 0; 24 | } -------------------------------------------------------------------------------- /pages/logs/logs.js: -------------------------------------------------------------------------------- 1 | //logs.js 2 | const util = require('../../utils/util.js') 3 | 4 | Page({ 5 | data: { 6 | logs: [] 7 | }, 8 | onLoad: function () { 9 | this.setData({ 10 | logs: (wx.getStorageSync('logs') || []).map(log => { 11 | return util.formatTime(new Date(log)) 12 | }) 13 | }) 14 | } 15 | }) 16 | -------------------------------------------------------------------------------- /pages/logs/logs.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "查看启动日志" 3 | } -------------------------------------------------------------------------------- /pages/logs/logs.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{index + 1}}. {{log}} 5 | 6 | 7 | -------------------------------------------------------------------------------- /pages/logs/logs.wxss: -------------------------------------------------------------------------------- 1 | .log-list { 2 | display: flex; 3 | flex-direction: column; 4 | padding: 40rpx; 5 | } 6 | .log-item { 7 | margin: 10rpx; 8 | } 9 | -------------------------------------------------------------------------------- /pages/w_index_rule/w_index_rule.js: -------------------------------------------------------------------------------- 1 | // pages/rule/rule.js 2 | Page({ 3 | 4 | /** 5 | * 页面的初始数据 6 | */ 7 | data: { 8 | 9 | }, 10 | 11 | /** 12 | * 生命周期函数--监听页面加载 13 | */ 14 | onLoad: function (options) { 15 | 16 | }, 17 | 18 | /** 19 | * 生命周期函数--监听页面初次渲染完成 20 | */ 21 | onReady: function () { 22 | 23 | }, 24 | 25 | /** 26 | * 生命周期函数--监听页面显示 27 | */ 28 | onShow: function () { 29 | 30 | }, 31 | 32 | /** 33 | * 生命周期函数--监听页面隐藏 34 | */ 35 | onHide: function () { 36 | 37 | }, 38 | 39 | /** 40 | * 生命周期函数--监听页面卸载 41 | */ 42 | onUnload: function () { 43 | 44 | }, 45 | 46 | /** 47 | * 页面相关事件处理函数--监听用户下拉动作 48 | */ 49 | onPullDownRefresh: function () { 50 | 51 | }, 52 | 53 | /** 54 | * 页面上拉触底事件的处理函数 55 | */ 56 | onReachBottom: function () { 57 | 58 | }, 59 | }) -------------------------------------------------------------------------------- /pages/w_index_rule/w_index_rule.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "停车场缴费规则" 3 | } -------------------------------------------------------------------------------- /pages/w_index_rule/w_index_rule.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /pages/w_index_rule/w_index_rule.wxss: -------------------------------------------------------------------------------- 1 | /* pages/rule/rule.wxss */ 2 | .rule { 3 | display: block; 4 | width: 100%; 5 | } -------------------------------------------------------------------------------- /pages/w_my/w_my.js: -------------------------------------------------------------------------------- 1 | // pages/w_my/w_my.js 2 | //获取应用实例 3 | const app = getApp() 4 | 5 | Page({ 6 | 7 | /** 8 | * 页面的初始数据 9 | */ 10 | data: { 11 | userInfo:{}, 12 | member: false,//是否是会员 13 | memberjifen:0,//会员时积分数量 14 | memberdengji: "",//会员等级,默认无 15 | canIUse: wx.canIUse('button.open-type.getUserInfo'), 16 | 17 | first_jin:true,//是否是首次进入 18 | }, 19 | 20 | /** 21 | * 生命周期函数--监听页面加载 22 | */ 23 | onLoad: function () { 24 | if (app.globalData.member && app.globalData.member == true) { 25 | this.setData({ 26 | member: app.globalData.member, 27 | memberdengji: app.globalData.member_dengji, 28 | memberjifen: app.globalData.member_jifen, 29 | }) 30 | } else { 31 | wx.showModal({ 32 | title: "温馨提示", 33 | content: "您需要绑定会员后才能使用此功能", 34 | confirmColor: "#4fafc9", 35 | confirmText: "绑定会员", 36 | cancelText: "返回首页", 37 | mask: true, 38 | success: function (res) { 39 | if (res.confirm) { 40 | wx.navigateTo({ 41 | url: "/pages/w_my_bind_member/w_my_bind_member" 42 | }) 43 | } else if (res.cancel) { 44 | wx.reLaunch({ 45 | url: "/pages/index/index" 46 | }) 47 | } 48 | }, 49 | }) 50 | } 51 | }, 52 | 53 | /** 54 | * 生命周期函数--监听页面初次渲染完成 55 | */ 56 | onReady: function () { 57 | this.data.first_jin = false; 58 | }, 59 | 60 | /** 61 | * 生命周期函数--监听页面显示 62 | */ 63 | onShow: function () { 64 | // 判断是否是首次进入 65 | if (this.data.first_jin){ 66 | 67 | }else{ 68 | this.onLoad(); 69 | } 70 | }, 71 | 72 | /** 73 | * 生命周期函数--监听页面隐藏 74 | */ 75 | onHide: function () { 76 | 77 | }, 78 | 79 | /** 80 | * 生命周期函数--监听页面卸载 81 | */ 82 | onUnload: function () { 83 | 84 | }, 85 | 86 | /** 87 | * 页面相关事件处理函数--监听用户下拉动作 88 | */ 89 | onPullDownRefresh: function () { 90 | 91 | }, 92 | 93 | /** 94 | * 页面上拉触底事件的处理函数 95 | */ 96 | onReachBottom: function () { 97 | 98 | }, 99 | // 缴费记录 100 | my_list1: function (e) { 101 | if(this.data.member!=true){ 102 | this.onLoad(); 103 | }else{ 104 | wx.navigateTo({ 105 | url: "/pages/w_my_payment_record/w_my_payment_record" 106 | }) 107 | } 108 | }, 109 | // 我的爱车 110 | my_list2: function (e) { 111 | console.log(this.data.member) 112 | if (this.data.member != true) { 113 | this.onLoad(); 114 | } else { 115 | wx.navigateTo({ 116 | url: "/pages/w_my_car/w_my_car" 117 | }) 118 | } 119 | }, 120 | 121 | // 绑定会员 122 | // my_list3: function (e) { 123 | // wx.navigateTo({ 124 | // url: "/pages/w_my_bind_member/w_my_bind_member" 125 | // }) 126 | // }, 127 | // 停车优惠券 128 | my_list4: function (e) { 129 | if (this.data.member != true) { 130 | this.onLoad(); 131 | } else { 132 | wx.navigateTo({ 133 | url: "/pages/w_my_park_coupon/w_my_park_coupon" 134 | }) 135 | } 136 | }, 137 | // 商户优惠券 138 | // my_list5: function (e) { 139 | // wx.navigateTo({ 140 | // url: "/pages/w_my_businessman_coupon/w_my_businessman_coupon" 141 | // }) 142 | // }, 143 | }) -------------------------------------------------------------------------------- /pages/w_my/w_my.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "我的" 3 | } -------------------------------------------------------------------------------- /pages/w_my/w_my.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | {{memberdengji}} 10 | 积分:{{memberjifen}} 11 | 12 | 13 | 普通用户 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 缴费历史 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 我的爱车 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 61 | 62 | 63 | 64 | 65 | 66 | 停车优惠券 67 | 68 | 69 | 70 | 71 | 72 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /pages/w_my/w_my.wxss: -------------------------------------------------------------------------------- 1 | /* pages/w_my/w_my.wxss */ 2 | page{ 3 | background: white; 4 | } 5 | /*顶部个人信息 */ 6 | .top{ 7 | height: 360rpx; 8 | width: 100%; 9 | background: #FFc452; 10 | box-sizing: border-box; 11 | padding: 80rpx 20rpx 0; 12 | background: linear-gradient(to bottom right, #ffd054 , #f4b715); /*渐变*/ 13 | position: relative; 14 | overflow: hidden; 15 | z-index: 3; 16 | } 17 | .userinfo { 18 | display: flex; 19 | flex-direction: row; 20 | align-items: top; 21 | justify-content: left; 22 | margin-left: 100rpx; 23 | z-index: 10; 24 | } 25 | .login-info{ 26 | display: flex; 27 | flex-direction: row; 28 | align-items: center; 29 | justify-content: left; 30 | height: 100%; 31 | z-index: 10; 32 | } 33 | .userinfo-avatar { 34 | width: 180rpx; 35 | height: 180rpx; 36 | border-radius: 50%; 37 | z-index: 10; 38 | overflow:hidden; 39 | 40 | } 41 | .userinfo-info{ 42 | margin-left: 48rpx; 43 | display: flex; 44 | flex-direction: column; 45 | padding-top: 20rpx; 46 | box-sizing: border-box; 47 | } 48 | .userinfo-nickname { 49 | color: #000; 50 | font-size: 36rpx; 51 | font-weight: 700; 52 | z-index: 10; 53 | } 54 | .userinfo-member{ 55 | color: #000; 56 | font-size: 30rpx; 57 | margin-top: 35rpx; 58 | z-index: 10; 59 | } 60 | .userinfo-member1{ 61 | color: #000; 62 | font-size: 30rpx; 63 | margin-top: 35rpx; 64 | text-align: center; 65 | z-index: 10; 66 | } 67 | .userinfo-jifen{ 68 | color: #000; 69 | font-size: 30rpx; 70 | margin-top: 10rpx; 71 | z-index: 10; 72 | } 73 | .get-userinfo{ 74 | color: #000; 75 | background: #FFc452; 76 | margin: 0; 77 | padding: 0; 78 | border: none; 79 | font-size: 38rpx; 80 | } 81 | .get-userinfo::after{ 82 | border: 0; 83 | } 84 | .login-right{ 85 | width: 46rpx; 86 | height: 46rpx; 87 | } 88 | 89 | /* 列表 */ 90 | .person-list { 91 | display: flex; 92 | flex-direction: column; 93 | align-items: left; 94 | width: 100%; 95 | box-sizing: border-box; 96 | padding-top:30rpx; 97 | border-top-left-radius: 15rpx; 98 | border-top-right-radius: 15rpx; 99 | margin-top: -10rpx; 100 | background: white; 101 | z-index: 20; 102 | position: relative; 103 | } 104 | .list-item { 105 | display: flex; 106 | width: 100%; 107 | flex-direction: row; 108 | align-items: center; 109 | justify-content: space-between; 110 | height: 130rpx; 111 | /* background: white; */ 112 | /* margin: 60rpx 0 0; */ 113 | border-top: 1rpx solid #d4d4d4; 114 | } 115 | .list-item:first-child { 116 | border-top: 0; 117 | margin-top: 25rpx; 118 | } 119 | /* .member{ 120 | margin: 20rpx 0 0; 121 | } */ 122 | /* .stopcar{ 123 | margin-top: 20rpx; 124 | } */ 125 | .item1{ 126 | display: flex; 127 | flex-direction: row; 128 | align-items: center; 129 | } 130 | .item-image { 131 | width: 40rpx; 132 | height: 40rpx; 133 | margin: 20rpx; 134 | margin-left: 30rpx; 135 | } 136 | .item-text { 137 | font-size: 32rpx; 138 | /* margin-left: 30rpx; */ 139 | } 140 | .with_arrow { 141 | width: 15px; 142 | height: 15px; 143 | margin: 20rpx 30rpx; 144 | } 145 | .memberjifen{ 146 | font-size: 32rpx; 147 | margin-right: 20rpx; 148 | color: #777; 149 | } 150 | .person-line { 151 | width: 100%; 152 | height: 3rpx; 153 | background: lightgray; 154 | } 155 | .item2{ 156 | display: flex; 157 | flex-direction: row; 158 | align-items: center; 159 | } 160 | .car-number{ 161 | display: flex; 162 | align-items: center; 163 | font-size: 32rpx; 164 | color: blue; 165 | } 166 | 167 | /* 顶部透明背景 */ 168 | .bg1{ 169 | height: 70rpx; 170 | width: 200rpx; 171 | position: absolute; 172 | bottom: 0; 173 | left:-40rpx; 174 | transform: rotate(-46deg); 175 | background: #fed362; 176 | border-radius: 40rpx; 177 | z-index: 5; 178 | } 179 | .bg2{ 180 | height: 110rpx; 181 | width: 230rpx; 182 | position: absolute; 183 | top: 30rpx; 184 | right:-50rpx; 185 | transform: rotate(-46deg); 186 | background: #fbcb4d; 187 | border-radius: 50rpx; 188 | z-index: 5; 189 | } 190 | .bg3{ 191 | height: 24rpx; 192 | width: 230rpx; 193 | position: absolute; 194 | top: 220rpx; 195 | right:-40rpx; 196 | transform: rotate(-46deg); 197 | background: #fbcb4d; 198 | border-radius: 40rpx; 199 | z-index: 5; 200 | } 201 | .bg4{ 202 | height: 32rpx; 203 | width: 210rpx; 204 | position: absolute; 205 | top: -10rpx; 206 | left:80rpx; 207 | transform: rotate(-46deg); 208 | background: #fed362; 209 | border-radius: 40rpx; 210 | z-index: 5; 211 | } 212 | .bg5{ 213 | height: 30rpx; 214 | width: 30rpx; 215 | border-radius: 50%; 216 | position: absolute; 217 | top: 100rpx; 218 | left:65rpx; 219 | background: #fed362; 220 | z-index: 5; 221 | } -------------------------------------------------------------------------------- /pages/w_my_bind_member/w_my_bind_member.js: -------------------------------------------------------------------------------- 1 | // pages/bindmember/bindmember.js 2 | //获取应用实例 3 | const app = getApp() 4 | Page({ 5 | 6 | /** 7 | * 页面的初始数据 8 | */ 9 | data: { 10 | time: '获取验证码', //倒计时 11 | disabled:true,//获取验证码按钮属性 12 | disabled2: true,//确认绑定按钮属性 13 | currentTime: 60, 14 | phoneNum: '',//手机号 15 | code: '',//验证码 16 | phoneNum_true:false,//判断手机号输入框是否可输入 17 | 18 | }, 19 | 20 | /** 21 | * 生命周期函数--监听页面加载 22 | */ 23 | onLoad: function (options) { 24 | 25 | }, 26 | 27 | /** 28 | * 生命周期函数--监听页面初次渲染完成 29 | */ 30 | onReady: function () { 31 | 32 | }, 33 | 34 | /** 35 | * 生命周期函数--监听页面显示 36 | */ 37 | onShow: function () { 38 | 39 | }, 40 | 41 | /** 42 | * 生命周期函数--监听页面隐藏 43 | */ 44 | onHide: function () { 45 | 46 | }, 47 | 48 | /** 49 | * 生命周期函数--监听页面卸载 50 | */ 51 | onUnload: function () { 52 | // wx.reLaunch({ 53 | // url: "/pages/index/index" 54 | // }) 55 | }, 56 | 57 | /** 58 | * 页面相关事件处理函数--监听用户下拉动作 59 | */ 60 | onPullDownRefresh: function () { 61 | 62 | }, 63 | 64 | /** 65 | * 页面上拉触底事件的处理函数 66 | */ 67 | onReachBottom: function () { 68 | 69 | }, 70 | // 验证码倒计时 71 | getCode: function (options) { 72 | var that = this; 73 | var currentTime = that.data.currentTime 74 | var interval = setInterval(function () { 75 | currentTime--; 76 | that.setData({ 77 | time: currentTime + '秒', 78 | phoneNum_true:true 79 | }) 80 | if (currentTime <= 0) { 81 | clearInterval(interval) 82 | that.setData({ 83 | time: '重新获取', 84 | currentTime: 60, 85 | disabled: false, 86 | phoneNum_true: false 87 | }) 88 | } 89 | }, 1000) 90 | }, 91 | 92 | //手机号input 93 | inputPhoneNum: function (e) { 94 | let phoneNum = e.detail.value 95 | 96 | if (phoneNum.length === 11) { 97 | let checkedNum = this.checkPhoneNum(phoneNum) 98 | if (checkedNum){ 99 | this.setData({ 100 | disabled: false, 101 | phoneNum: phoneNum 102 | }) 103 | this.activeButton() 104 | } 105 | 106 | } else { 107 | this.setData({ 108 | phoneNum: '', 109 | disabled: true, 110 | }) 111 | this.activeButton() 112 | } 113 | }, 114 | //验证手机号格式 115 | checkPhoneNum: function (phoneNum) { 116 | let str = /^1\d{10}$/ 117 | if (str.test(phoneNum)) { 118 | return true 119 | } else { 120 | wx.showToast({ 121 | title: '手机号不正确', 122 | image: '/images/tishi.png', 123 | }) 124 | return false 125 | } 126 | }, 127 | // 验证码input 128 | addCode: function (e) { 129 | this.setData({ 130 | code: e.detail.value 131 | }) 132 | this.activeButton() 133 | }, 134 | // 验证码按钮 135 | sendMsg: function (phoneNum) { 136 | 137 | var that = this 138 | 139 | wx.request({ 140 | url: app.globalData.host + '/wxinfo/sendBindSMSText', 141 | data: { 142 | phone: that.data.phoneNum 143 | }, 144 | header: { 145 | 'content-type': 'application/json', 146 | 'Cookie': 'NWRZPARKINGID=' + app.globalData.loginMess 147 | }, 148 | success: function (res) { 149 | console.log(res) 150 | if(res.data.code==1001){ 151 | wx.showToast({ 152 | title: "验证码已发送,60秒后可重新获取", 153 | icon: 'success', 154 | duration: 1500, 155 | }) 156 | var currentTime = that.data.currentTime 157 | that.setData({ 158 | time: currentTime + '秒', 159 | disabled: true, 160 | // code:"123456", 161 | }) 162 | that.getCode(); 163 | }else{ 164 | wx.showModal({ 165 | title: "提示", 166 | content: "" + res.data.msg, 167 | confirmColor: "#4fafc9", 168 | confirmText: "我知道了", 169 | showCancel: false, 170 | success: function (res) { 171 | if (res.confirm) { 172 | } 173 | } 174 | }) 175 | } 176 | } 177 | }) 178 | }, 179 | // 确认按钮 180 | activeButton: function () { 181 | let { phoneNum, code } = this.data 182 | if (phoneNum && phoneNum.length === 11 && code ) { 183 | this.setData({ 184 | disabled2: false, 185 | }) 186 | } else { 187 | this.setData({ 188 | disabled2: true, 189 | }) 190 | } 191 | }, 192 | // 表单提交 193 | formSubmit: function (e) { 194 | // console.log('form发生了submit事件,携带数据为:', e.detail.value) 195 | var that = this 196 | wx.showLoading({ 197 | title: '正在绑定中', 198 | mask: true, 199 | }) 200 | wx.request({ 201 | url: app.globalData.host + '/wxinfo/authBindSMSText', 202 | data: { 203 | phone: e.detail.value.tel, 204 | verification: e.detail.value.identifying_code, 205 | }, 206 | header: { 207 | 'content-type': 'application/json', 208 | 'Cookie': 'NWRZPARKINGID=' + app.globalData.loginMess 209 | }, 210 | success: function (res) { 211 | console.log(res) 212 | wx.hideLoading() 213 | if ((parseInt(res.statusCode) === 200) && res.data.code === 1001) { 214 | wx.showToast({ 215 | title: '绑定成功', 216 | icon: 'success', 217 | success:function(res){ 218 | app.globalData.member=true; 219 | setTimeout(function () { 220 | wx.navigateTo({ 221 | url: "/pages/w_my_bind_platenumber/w_my_bind_platenumber", 222 | }) 223 | },1500) 224 | 225 | } 226 | }) 227 | } else { 228 | wx.showModal({ 229 | title: "绑定失败", 230 | content: ""+res.data.msg, 231 | confirmColor: "#4fafc9", 232 | confirmText: "我知道了", 233 | showCancel: false, 234 | }) 235 | } 236 | }, 237 | fail: function (res) { 238 | wx.hideLoading() 239 | console.log(res) 240 | wx.showModal({ 241 | title: "绑定失败", 242 | content: "请求超时或出现了其它未知错误,请您重新尝试", 243 | confirmColor: "#4fafc9", 244 | confirmText: "我知道了", 245 | showCancel: false, 246 | }) 247 | } 248 | }) 249 | }, 250 | formReset: function () { 251 | console.log('form发生了reset事件') 252 | }, 253 | }) -------------------------------------------------------------------------------- /pages/w_my_bind_member/w_my_bind_member.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "会员绑定" 3 | } -------------------------------------------------------------------------------- /pages/w_my_bind_member/w_my_bind_member.wxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | {{time}} 21 | 22 | 23 | {{time}} 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
33 |
34 | 35 | 36 | 37 | 温馨提示 38 | 只有会员用户的手机号才能获取到验证码短信哦, 39 | 40 | 普通用户需要先加入会员才能进行会员绑定,享受会员优惠哦。 41 | 42 | 43 | -------------------------------------------------------------------------------- /pages/w_my_bind_member/w_my_bind_member.wxss: -------------------------------------------------------------------------------- 1 | /* pages/bindmember/bindmember.wxss */ 2 | /*顶部logo */ 3 | .logo{ 4 | width: 100%; 5 | height:310rpx; 6 | box-sizing: border-box; 7 | padding-top: 76rpx; 8 | } 9 | .logo image{ 10 | display: block; 11 | width: 420rpx; 12 | height: 160rpx; 13 | margin-left: auto; 14 | margin-right: auto; 15 | } 16 | /*绑定提示 */ 17 | .bind-tishi{ 18 | width: 100%; 19 | position: absolute; 20 | bottom: 55rpx; 21 | box-sizing: border-box; 22 | } 23 | .search-prompt{ 24 | width: 670rpx; 25 | margin: 0 auto ; 26 | text-align:center; 27 | } 28 | .prompt-desc{ 29 | color:#a0a0a0; 30 | font-size: 24rpx; 31 | text-align: center; 32 | display: block; 33 | } 34 | .prompt-desc1{ 35 | padding-bottom: 20rpx; 36 | } 37 | .prompt-desc2{ 38 | padding-bottom: 10rpx; 39 | } 40 | /*绑定会员 */ 41 | .bind-info{ 42 | width: 670rpx; 43 | position: relative; 44 | box-sizing: border-box; 45 | margin: 0 auto; 46 | } 47 | .bind-title { 48 | height: 60rpx; 49 | line-height: 60rpx; 50 | text-align: center; 51 | display: flex; 52 | flex-direction: row; 53 | align-items: center; 54 | justify-content: center; 55 | } 56 | .bind-title .line { 57 | display: inline-block; 58 | width: 234rpx; 59 | border-top: 1rpx solid #ffb900 ; 60 | } 61 | .bind-title .bind-title-desc { 62 | color: #282828; 63 | font-size: 32rpx; 64 | margin: 0 36rpx; 65 | } 66 | 67 | /*表单 */ 68 | from{ 69 | width: 100%; 70 | } 71 | .section{ 72 | width: 100%; 73 | position: relative; 74 | } 75 | form input{ 76 | border-bottom: 1rpx solid #ffb900; 77 | background: white; 78 | padding: 20rpx 20rpx; 79 | padding-right: 170rpx; 80 | box-sizing: border-box; 81 | font-size: 32rpx; 82 | width: 100%; 83 | height: 102rpx; 84 | } 85 | form input[name="tel"]{ 86 | padding: 20rpx 20rpx; 87 | /* margin: 50rpx auto 0; */ 88 | } 89 | .buttonget{ 90 | position: absolute; 91 | top: 0; 92 | right: 0; 93 | width:190rpx; 94 | height:99rpx; 95 | background: white; 96 | line-height: 99rpx; 97 | font-size: 30rpx; 98 | text-align: right; 99 | } 100 | .show{ 101 | color: #ffb900; 102 | } 103 | .hide{ 104 | color: #ccc; 105 | } 106 | .btn-area button.btn-false{ 107 | width: 100%; 108 | height: 100rpx; 109 | line-height: 100rpx; 110 | margin: 160rpx auto ; 111 | font-size: 32rpx; 112 | background: #fff; 113 | color: #ccc; 114 | } 115 | button[class="btn-true"]::after { 116 | border: 0; 117 | } 118 | .btn-area button.btn-true{ 119 | width: 100%; 120 | height: 100rpx; 121 | line-height: 100rpx; 122 | margin: 160rpx auto ; 123 | font-size: 32rpx; 124 | background: #ffb900; 125 | color: #282828; 126 | border-radius: 50rpx; 127 | } 128 | -------------------------------------------------------------------------------- /pages/w_my_bind_platenumber/w_my_bind_platenumber.js: -------------------------------------------------------------------------------- 1 | // pages/bindplatenumber/bindplatenumber.js 2 | //获取应用实例 3 | const app = getApp() 4 | var e = getApp(); 5 | Page({ 6 | 7 | /** 8 | * 页面的初始数据 9 | */ 10 | data: { 11 | time: '获取验证码', //倒计时 12 | disabled: true,//获取验证码按钮属性 13 | disabled2: true,//确认绑定按钮属性 14 | currentTime: 60, 15 | 16 | // 虚拟键盘属性 17 | keyboard: null, 18 | }, 19 | 20 | /** 21 | * 生命周期函数--监听页面加载 22 | */ 23 | onLoad: function (options) { 24 | this.setData({ 25 | keyboard: this.selectComponent("#keyboardComponent"), 26 | }) 27 | }, 28 | 29 | /** 30 | * 生命周期函数--监听页面初次渲染完成 31 | */ 32 | onReady: function () { 33 | }, 34 | 35 | /** 36 | * 生命周期函数--监听页面显示 37 | */ 38 | onShow: function () { 39 | 40 | }, 41 | 42 | /** 43 | * 生命周期函数--监听页面隐藏 44 | */ 45 | onHide: function () { 46 | 47 | }, 48 | 49 | /** 50 | * 生命周期函数--监听页面卸载 51 | */ 52 | onUnload: function () { 53 | 54 | }, 55 | 56 | /** 57 | * 页面相关事件处理函数--监听用户下拉动作 58 | */ 59 | onPullDownRefresh: function () { 60 | 61 | }, 62 | 63 | /** 64 | * 页面上拉触底事件的处理函数 65 | */ 66 | onReachBottom: function () { 67 | 68 | }, 69 | // 表单提交 70 | formSubmit: function (e) { 71 | var that = this; 72 | // 获取输入的车牌号 73 | var t = this.data.keyboard.getLpn(); 74 | if (t.length < 6){ 75 | wx.showModal({ 76 | title: "车牌不正确", 77 | content: "请输入正确的车牌号", 78 | confirmColor: "#4fafc9", 79 | confirmText: "我知道了", 80 | showCancel: false, 81 | }) 82 | }else{ 83 | wx.showLoading({ 84 | title: '正在绑定中', 85 | mask: true, 86 | }) 87 | //向服务器发出绑定请求 88 | wx.request({ 89 | url: app.globalData.host + '/wxinfo/bindCarnumber', 90 | data: { 91 | carnumber: t, 92 | }, 93 | header: { 94 | 'content-type': 'application/json', 95 | 'Cookie': 'NWRZPARKINGID=' + app.globalData.loginMess 96 | }, 97 | success: function (res) { 98 | wx.hideLoading() 99 | console.log(res) 100 | if ((parseInt(res.statusCode) === 200) && res.data.code === 1001) { 101 | wx.navigateTo({ 102 | url: "/pages/w_my_bind_prompt/w_my_bind_prompt" 103 | }) 104 | } else { 105 | wx.hideLoading() 106 | wx.showModal({ 107 | title: "绑定失败", 108 | content: "" + res.data.msg, 109 | confirmColor: "#4fafc9", 110 | confirmText: "我知道了", 111 | showCancel: false, 112 | }) 113 | } 114 | }, 115 | fail: function (res) { 116 | wx.hideLoading() 117 | console.log(res) 118 | wx.showModal({ 119 | title: "绑定失败", 120 | content: "请求超时或出现了其它未知错误,请您重新尝试", 121 | confirmColor: "#4fafc9", 122 | confirmText: "我知道了", 123 | showCancel: false, 124 | }) 125 | } 126 | }) 127 | } 128 | }, 129 | formReset: function () { 130 | console.log('form发生了reset事件') 131 | }, 132 | tapindex: function (e) { 133 | wx.reLaunch({ 134 | url: "/pages/index/index" 135 | }) 136 | }, 137 | 138 | // 虚拟键盘 139 | keyboard1StatusHandler: function (e) { 140 | this.data.keyboard.getLpn(); 141 | }, 142 | 143 | }) -------------------------------------------------------------------------------- /pages/w_my_bind_platenumber/w_my_bind_platenumber.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "绑定车牌", 3 | "backgroundColor": "#f0eff7", 4 | "usingComponents": { 5 | "keyboard": "/components/keyboard_component/keyboard_component" 6 | } 7 | } -------------------------------------------------------------------------------- /pages/w_my_bind_platenumber/w_my_bind_platenumber.wxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 暂不绑定 25 | 26 |
27 |
28 | 29 | 30 | 温馨提示 31 | 请输入车牌号将车牌绑定到会员号,即可享受会员专属优惠。 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /pages/w_my_bind_platenumber/w_my_bind_platenumber.wxss: -------------------------------------------------------------------------------- 1 | /* pages/bindplatenumber/bindplatenumber.wxss */ 2 | /*顶部logo */ 3 | .logo{ 4 | width: 100%; 5 | height:310rpx; 6 | box-sizing: border-box; 7 | padding-top: 76rpx; 8 | } 9 | .logo image{ 10 | display: block; 11 | width: 420rpx; 12 | height: 160rpx; 13 | margin-left: auto; 14 | margin-right: auto; 15 | } 16 | /*绑定提示 */ 17 | .bind-tishi{ 18 | width: 670rpx; 19 | margin: 0 auto; 20 | position: absolute; 21 | left: 0; 22 | right: 0; 23 | bottom: 60rpx; 24 | box-sizing: border-box; 25 | } 26 | .search-prompt{ 27 | width: 670rpx; 28 | margin: 0 auto ; 29 | text-align:center; 30 | } 31 | .prompt-desc{ 32 | color:#a0a0a0; 33 | font-size: 24rpx; 34 | text-align: center; 35 | display: block; 36 | } 37 | .prompt-desc1{ 38 | padding-bottom: 20rpx; 39 | } 40 | /*绑定会员 */ 41 | .bind-info{ 42 | width: 670rpx; 43 | position: relative; 44 | box-sizing: border-box; 45 | margin: 0 auto; 46 | } 47 | .bind-title { 48 | height: 60rpx; 49 | line-height: 60rpx; 50 | text-align: center; 51 | } 52 | .bind-title .line { 53 | display: inline-block; 54 | width: 30%; 55 | border-top: 1rpx dashed #ccc ; 56 | } 57 | .bind-title .bind-title-desc { 58 | color: #686868; 59 | margin: 0 7%; 60 | vertical-align: -8rpx; 61 | } 62 | 63 | /*表单 */ 64 | .section{ 65 | width: 80%; 66 | margin: 0 auto; 67 | position: relative; 68 | } 69 | 70 | 71 | .btn-area button.btn-false{ 72 | width: 100%; 73 | height: 100rpx; 74 | line-height: 100rpx; 75 | margin: 160rpx auto 50rpx; 76 | font-size: 32rpx; 77 | background: #ffb900; 78 | color: #282828; 79 | border-radius: 50rpx; 80 | } 81 | 82 | .bind-back{ 83 | width: 100%; 84 | text-align: center; 85 | } 86 | .bind-back text{ 87 | font-size: 28rpx; 88 | color:#555; 89 | } 90 | button[class="btn-true"]::after { 91 | border: 0; 92 | } 93 | 94 | /* 输入车牌 */ 95 | .input-list { 96 | width: 670rpx; 97 | /* width: 80%; */ 98 | position: relative; 99 | margin: 50rpx auto 0; 100 | } 101 | #keyboardComponent{ 102 | width: 100%; 103 | height: 100%; 104 | background: white; 105 | box-sizing: border-box; 106 | padding: 0rpx 30rpx; 107 | font-size: 32rpx; 108 | } 109 | .input-item { 110 | width: 100%; 111 | height: 90rpx; 112 | border: 1rpx solid #dcdad6; 113 | display: flex; 114 | align-items: center; 115 | /* border-radius: 8rpx; */ 116 | } 117 | 118 | -------------------------------------------------------------------------------- /pages/w_my_bind_prompt/w_my_bind_prompt.js: -------------------------------------------------------------------------------- 1 | // pages/bindprompt/bindprompt.js 2 | //获取应用实例 3 | const app = getApp() 4 | Page({ 5 | 6 | /** 7 | * 页面的初始数据 8 | */ 9 | data: { 10 | time: '获取验证码', //倒计时 11 | disabled: true,//获取验证码按钮属性 12 | disabled2: true,//确认绑定按钮属性 13 | currentTime: 60, 14 | platenumber: '',//车牌号 15 | }, 16 | 17 | /** 18 | * 生命周期函数--监听页面加载 19 | */ 20 | onLoad: function (options) { 21 | 22 | }, 23 | 24 | /** 25 | * 生命周期函数--监听页面初次渲染完成 26 | */ 27 | onReady: function () { 28 | 29 | }, 30 | 31 | /** 32 | * 生命周期函数--监听页面显示 33 | */ 34 | onShow: function () { 35 | 36 | }, 37 | 38 | /** 39 | * 生命周期函数--监听页面隐藏 40 | */ 41 | onHide: function () { 42 | 43 | }, 44 | 45 | /** 46 | * 生命周期函数--监听页面卸载 47 | */ 48 | onUnload: function () { 49 | 50 | }, 51 | 52 | /** 53 | * 页面相关事件处理函数--监听用户下拉动作 54 | */ 55 | onPullDownRefresh: function () { 56 | 57 | }, 58 | 59 | /** 60 | * 页面上拉触底事件的处理函数 61 | */ 62 | onReachBottom: function () { 63 | 64 | }, 65 | // 验证码input 66 | addPlatenumber: function (e) { 67 | this.setData({ 68 | platenumber: e.detail.value 69 | }) 70 | }, 71 | // 表单提交 72 | formSubmit: function (e) { 73 | console.log('form发生了submit事件,携带数据为:', e.detail.value) 74 | 75 | 76 | // wx.request({ 77 | // url: `${config.api + '/addinfo'}`, 78 | // data: { 79 | // phoneNum: this.data.phoneNum, 80 | // code: this.data.code, 81 | // otherInfo: this.data.otherInfo 82 | // }, 83 | // header: { 84 | // 'content-type': 'application/json' 85 | // }, 86 | // method: 'POST', 87 | // success: function (res) { 88 | // console.log(res) 89 | // if ((parseInt(res.statusCode) === 200) && res.data.message === 'pass') { 90 | // wx.showToast({ 91 | // title: '验证成功', 92 | // icon: 'success' 93 | // }) 94 | // } else { 95 | // wx.showToast({ 96 | // title: res.data.message, 97 | // image: '../../images/fail.png' 98 | // }) 99 | // } 100 | // }, 101 | // fail: function (res) { 102 | // console.log(res) 103 | // } 104 | // }) 105 | }, 106 | formReset: function () { 107 | console.log('form发生了reset事件') 108 | }, 109 | tapindex: function (e) { 110 | wx.reLaunch({ 111 | url: "/pages/index/index" 112 | }) 113 | }, 114 | tapplatenumber: function (e) { 115 | wx.navigateTo({ 116 | url: "/pages/w_my_bind_platenumber/w_my_bind_platenumber" 117 | }) 118 | }, 119 | }) -------------------------------------------------------------------------------- /pages/w_my_bind_prompt/w_my_bind_prompt.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "绑定车牌" 3 | } -------------------------------------------------------------------------------- /pages/w_my_bind_prompt/w_my_bind_prompt.wxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 绑定成功 12 | 13 | 14 | 15 | 16 | 17 | 继续绑定 18 | 19 | 20 | 21 | 22 | 23 | 温馨提示 24 | 每位会员可绑定多个车牌,绑定后的车牌均可享受会员优惠,最多可绑定5个。 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /pages/w_my_bind_prompt/w_my_bind_prompt.wxss: -------------------------------------------------------------------------------- 1 | /* pages/bindprompt/bindprompt.wxss */ 2 | /*顶部logo */ 3 | .logo{ 4 | width: 100%; 5 | height:310rpx; 6 | box-sizing: border-box; 7 | padding-top: 76rpx; 8 | } 9 | .logo image{ 10 | display: block; 11 | width: 420rpx; 12 | height: 160rpx; 13 | margin-left: auto; 14 | margin-right: auto; 15 | } 16 | 17 | /*绑定会员 */ 18 | .bind-info{ 19 | width: 100%; 20 | position: relative; 21 | box-sizing: border-box; 22 | padding: 0 30rpx; 23 | } 24 | .bind-title { 25 | height: 60rpx; 26 | line-height: 60rpx; 27 | text-align: center; 28 | } 29 | .bind-title .line { 30 | display: inline-block; 31 | width: 30%; 32 | border-top: 1rpx dashed #ccc ; 33 | } 34 | .bind-title .bind-title-desc { 35 | color: #686868; 36 | margin: 0 7%; 37 | vertical-align: -8rpx; 38 | } 39 | 40 | /*绑定结果提示 */ 41 | .bind-prompt{ 42 | display: block; 43 | width: 670rpx; 44 | font-size: 48rpx; 45 | font-weight: 600; 46 | margin: 50rpx 0 0rpx; 47 | display: flex; 48 | align-items: center; 49 | justify-content: center; 50 | } 51 | .bind-prompt-img{ 52 | width: 54rpx; 53 | height: 54rpx; 54 | margin-right: 40rpx; 55 | } 56 | 57 | .btn-area button.btn-false{ 58 | width: 100%; 59 | height: 100rpx; 60 | line-height: 100rpx; 61 | margin: 160rpx auto 50rpx; 62 | font-size: 32rpx; 63 | background: #ffb900; 64 | color: #282828; 65 | border-radius: 50rpx; 66 | } 67 | 68 | .bind-back{ 69 | width: 100%; 70 | text-align: center; 71 | } 72 | .bind-back text{ 73 | font-size: 28rpx; 74 | color:#555; 75 | } 76 | /*温馨提示 */ 77 | .bind-tishi{ 78 | width: 670rpx; 79 | margin: 0 auto; 80 | position: absolute; 81 | left: 0; 82 | right: 0; 83 | bottom: 60rpx; 84 | box-sizing: border-box; 85 | } 86 | .search-prompt{ 87 | width: 670rpx; 88 | margin: 0 auto ; 89 | text-align:center; 90 | } 91 | .prompt-desc{ 92 | color:#a0a0a0; 93 | font-size: 24rpx; 94 | text-align: center; 95 | display: block; 96 | } 97 | .prompt-desc1{ 98 | padding-bottom: 20rpx; 99 | } 100 | .prompt-desc2{ 101 | line-height: 42rpx; 102 | } 103 | -------------------------------------------------------------------------------- /pages/w_my_businessman_coupon/w_my_businessman_coupon.js: -------------------------------------------------------------------------------- 1 | // pages/businessman_coupon/businessman_coupon.js 2 | //获取应用实例 3 | const app = getApp() 4 | Page({ 5 | 6 | /** 7 | * 页面的初始数据 8 | */ 9 | data: { 10 | coupon:true,//是否有优惠券,默认无 11 | coupon_info: "",//优惠券信息,默认无 12 | tar:"1",//顶部tar的标识 13 | ok_coupon:[ 14 | { 15 | name:"日照万象汇", 16 | time:"免费停车2小时", 17 | date:"2018.09.30", 18 | }, { 19 | name: "日照万象汇", 20 | time: "免费停车3小时", 21 | date: "2018.07.30", 22 | }, { 23 | name: "日照万象汇", 24 | time: "免费停车4小时", 25 | date: "2018.08.30", 26 | }, { 27 | name: "日照万象汇", 28 | time: "免费停车5小时", 29 | date: "2019.07.30", 30 | },],//未使用优惠券信息 31 | use_coupon: [],//已使用优惠券信息 32 | overdue_coupon: [],//已使用优惠券信息 33 | }, 34 | 35 | /** 36 | * 生命周期函数--监听页面加载 37 | */ 38 | onLoad: function (options) { 39 | 40 | }, 41 | 42 | /** 43 | * 生命周期函数--监听页面初次渲染完成 44 | */ 45 | onReady: function () { 46 | 47 | }, 48 | 49 | /** 50 | * 生命周期函数--监听页面显示 51 | */ 52 | onShow: function () { 53 | 54 | }, 55 | 56 | /** 57 | * 生命周期函数--监听页面隐藏 58 | */ 59 | onHide: function () { 60 | 61 | }, 62 | 63 | /** 64 | * 生命周期函数--监听页面卸载 65 | */ 66 | onUnload: function () { 67 | 68 | }, 69 | 70 | /** 71 | * 页面相关事件处理函数--监听用户下拉动作 72 | */ 73 | onPullDownRefresh: function () { 74 | 75 | }, 76 | 77 | /** 78 | * 页面上拉触底事件的处理函数 79 | */ 80 | onReachBottom: function () { 81 | 82 | }, 83 | // 顶部tar切换 84 | tar1: function () { 85 | this.setData({ 86 | tar: "1", 87 | }) 88 | }, 89 | tar2: function () { 90 | this.setData({ 91 | tar: "2", 92 | }) 93 | }, 94 | tar3: function () { 95 | this.setData({ 96 | tar: "3", 97 | }) 98 | }, 99 | }) -------------------------------------------------------------------------------- /pages/w_my_businessman_coupon/w_my_businessman_coupon.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "商户优惠券" 3 | } -------------------------------------------------------------------------------- /pages/w_my_businessman_coupon/w_my_businessman_coupon.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 竟然一点优惠券都没有 4 | "你有没有考虑过优惠券的感受" 5 | 6 | 7 | 8 | 9 | 未使用(5) 10 | 未使用(5) 11 | 使用记录(0) 12 | 使用记录(0) 13 | 已过期(0) 14 | 已过期(0) 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 您还没有可使用的优惠券 23 | 24 | 25 | 26 | 27 | 28 | {{item.name}} 29 | {{item.time}} 30 | 31 | 32 | 有效期至{{item.date}} 33 | 34 | 35 | 仅限日照万象汇停车场使用 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 您还没有可使用的优惠券 48 | 49 | 50 | 51 | 52 | 53 | {{item.name}} 54 | {{item.time}} 55 | 56 | 57 | 有效期至{{item.date}} 58 | 59 | 60 | 仅限日照万象汇停车场使用 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 您还没有可使用的优惠券 73 | 74 | 75 | 76 | 77 | 78 | {{item.name}} 79 | {{item.time}} 80 | 81 | 82 | 有效期至{{item.date}} 83 | 84 | 85 | 仅限日照万象汇停车场使用 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /pages/w_my_businessman_coupon/w_my_businessman_coupon.wxss: -------------------------------------------------------------------------------- 1 | /* pages/businessman_coupon/businessman_coupon.wxss */ 2 | page{ 3 | background: #efeff4; 4 | } 5 | /* 无优惠券显示 */ 6 | .no-coupon{ 7 | font-size: 34rpx; 8 | text-align: center; 9 | color: #333; 10 | margin-top: 450rpx; 11 | } 12 | .no-coupon text{ 13 | display: block; 14 | } 15 | .no-coupon text:last-child{ 16 | color: #999; 17 | font-size: 26rpx; 18 | margin-top: 15rpx; 19 | } 20 | /* 有优惠券时 */ 21 | .top-info{ 22 | width: 100%; 23 | height: 100rpx; 24 | border-bottom: 1rpx solid #909090; 25 | background: white; 26 | } 27 | .top-info text{ 28 | width: 33%; 29 | height: 100rpx; 30 | line-height: 100rpx; 31 | display: inline-block; 32 | text-align: center; 33 | font-size: 32rpx; 34 | color: #909090; 35 | } 36 | .top-info .active{ 37 | color: orange; 38 | } 39 | /* 优惠券样式 */ 40 | .coupon-info{ 41 | width: 690rpx; 42 | margin: 30rpx auto 0; 43 | box-sizing: border-box; 44 | padding: 20rpx 15rpx 10rpx; 45 | background: white; 46 | position: relative; 47 | } 48 | .coupon-info-name{ 49 | box-sizing: border-box; 50 | padding: 0 10rpx; 51 | font-size: 38rpx; 52 | overflow: hidden; 53 | } 54 | .coupon-info-name text:first-child{ 55 | float: left; 56 | color: #282828; 57 | } 58 | .coupon-info-name text:last-child{ 59 | float: right; 60 | color: #d68231; 61 | } 62 | .coupon-info-date{ 63 | margin-top: 12rpx; 64 | font-size: 30rpx; 65 | box-sizing: border-box; 66 | padding: 0 10rpx; 67 | margin-bottom: 25rpx; 68 | } 69 | .coupon-info-area{ 70 | box-sizing: border-box; 71 | padding: 0 10rpx; 72 | border-top: 1rpx dashed #909090; 73 | font-size: 26rpx; 74 | color: #909090; 75 | } 76 | .coupon-info-area text{ 77 | display: block; 78 | padding: 13rpx 0; 79 | } 80 | /* 左右半圆 */ 81 | .coupon-left{ 82 | width: 35rpx; 83 | height: 35rpx; 84 | border-radius: 50%; 85 | background: #f2f4f6; 86 | position: absolute; 87 | top: 82.5rpx; 88 | left:-12.5rpx; 89 | } 90 | .coupon-right{ 91 | width: 35rpx; 92 | height: 35rpx; 93 | border-radius: 50%; 94 | background: #f2f4f6; 95 | position: absolute; 96 | top: 82.5rpx; 97 | right:-12.5rpx; 98 | } -------------------------------------------------------------------------------- /pages/w_my_car/w_my_car.js: -------------------------------------------------------------------------------- 1 | // pages/w_my_car/w_my_car.js 2 | //获取应用实例 3 | const app = getApp() 4 | 5 | Page({ 6 | 7 | /** 8 | * 页面的初始数据 9 | */ 10 | data: { 11 | cars_number:[],//车牌号,默认无 12 | // { 13 | // carnumber: "鲁A·123456", 14 | // opdate: "2018-07-07 14:45:55" 15 | // }, { 16 | // carnumber: "鲁B·123456", 17 | // opdate: "2018-07-07 15:02:31" 18 | // }, 19 | first_jin: true,//是否是首次进入,默认是 20 | }, 21 | 22 | /** 23 | * 生命周期函数--监听页面加载 24 | */ 25 | onLoad: function (options) { 26 | var that = this; 27 | 28 | wx.showLoading({ 29 | title: '正在玩命加载中', 30 | mask: true, 31 | }) 32 | wx.request({ 33 | url: app.globalData.host + '/wxinfo/listBindCar', 34 | header: { 35 | 'content-type': 'application/json', 36 | 'Cookie': 'NWRZPARKINGID=' + app.globalData.loginMess 37 | }, 38 | success: function (res) { 39 | console.log(res) 40 | if ((parseInt(res.statusCode) === 200) && res.data.code === 1001) { 41 | for (var i = 0; i < res.data.data.list.length;i++){ 42 | var str = res.data.data.list[i].carnumber; 43 | var str2 = str.substring(0, 2) + "·" + str.substring(2); 44 | res.data.data.list[i].carnumber=str2; 45 | } 46 | that.setData({ 47 | cars_number: res.data.data.list, 48 | first_jin: false, 49 | }) 50 | wx.hideLoading() 51 | } else { 52 | wx.hideLoading() 53 | wx.showModal({ 54 | title: "获取信息出错", 55 | content: "" + res.data.msg, 56 | confirmColor: "#4fafc9", 57 | confirmText: "我知道了", 58 | showCancel: false, 59 | success: function (res) { 60 | if (res.confirm) { 61 | } 62 | } 63 | }) 64 | } 65 | }, 66 | fail: function (res) { 67 | wx.hideLoading() 68 | console.log(res) 69 | wx.showModal({ 70 | title: "获取信息出错", 71 | content: "请求超时或出现了其它未知错误,请您重新尝试", 72 | confirmColor: "#4fafc9", 73 | confirmText: "我知道了", 74 | showCancel: false, 75 | success: function (res) { 76 | if (res.confirm) { 77 | wx.reLaunch({ 78 | url: "/pages/index/index" 79 | }) 80 | } 81 | } 82 | }) 83 | } 84 | }) 85 | }, 86 | 87 | /** 88 | * 生命周期函数--监听页面初次渲染完成 89 | */ 90 | onReady: function () { 91 | 92 | }, 93 | 94 | /** 95 | * 生命周期函数--监听页面显示 96 | */ 97 | onShow: function () { 98 | // 判断是否是首次进入 99 | if (this.data.first_jin) { 100 | 101 | } else { 102 | // this.onLoad(); 103 | } 104 | }, 105 | 106 | /** 107 | * 生命周期函数--监听页面隐藏 108 | */ 109 | onHide: function () { 110 | 111 | }, 112 | 113 | /** 114 | * 生命周期函数--监听页面卸载 115 | */ 116 | onUnload: function () { 117 | }, 118 | 119 | /** 120 | * 页面相关事件处理函数--监听用户下拉动作 121 | */ 122 | onPullDownRefresh: function () { 123 | 124 | }, 125 | 126 | /** 127 | * 页面上拉触底事件的处理函数 128 | */ 129 | onReachBottom: function () { 130 | 131 | }, 132 | addPlatenumber:function(){ 133 | wx.navigateTo({ 134 | url: "/pages/w_my_bind_platenumber/w_my_bind_platenumber" 135 | }) 136 | }, 137 | //删除车牌 138 | delate: function (e) { 139 | var that=this; 140 | console.log(e) 141 | var vcid = e.currentTarget.dataset.vcid; 142 | wx.showModal({ 143 | title: '提示', 144 | content: '是否确认删除', 145 | success: function (res) { 146 | if (res.confirm) { 147 | wx.request({ 148 | url: app.globalData.host + '/wxinfo/unBindCarnumber', 149 | data:{ 150 | vcid: vcid, 151 | }, 152 | header: { 153 | 'content-type': 'application/json', 154 | 'Cookie': 'NWRZPARKINGID=' + app.globalData.loginMess 155 | }, 156 | success: function (res) { 157 | console.log(res) 158 | if ((parseInt(res.statusCode) === 200) && res.data.code === 1001) { 159 | wx.showToast({ 160 | title: '删除成功', 161 | icon: 'success', 162 | duration: 2000 163 | }) 164 | that.onLoad() 165 | } else { 166 | wx.showModal({ 167 | title: "删除出错", 168 | content: "" + res.data.msg, 169 | confirmColor: "#4fafc9", 170 | confirmText: "我知道了", 171 | showCancel: false, 172 | success: function (res) { 173 | if (res.confirm) { 174 | } 175 | } 176 | }) 177 | } 178 | }, 179 | fail: function (res) { 180 | console.log(res) 181 | wx.showModal({ 182 | title: "删除出错", 183 | content: "请求超时或出现了其它未知错误,请您重新尝试", 184 | confirmColor: "#4fafc9", 185 | confirmText: "我知道了", 186 | showCancel: false, 187 | success: function (res) { 188 | if (res.confirm) { 189 | that.onLoad() 190 | } 191 | } 192 | }) 193 | } 194 | }) 195 | } else if (res.cancel) { 196 | console.log('用户点击取消') 197 | } 198 | } 199 | }) 200 | }, 201 | //点击判断,看是否需要支付,不支付提示 202 | pay_judge:function(e){ 203 | var str = e.currentTarget.dataset.name.replace("·","") 204 | wx.showLoading({ 205 | title: '正在加载中', 206 | mask: true, 207 | }) 208 | wx.request({ 209 | url: app.globalData.host + '/wxpay/getparkinginfo',//这里填写后台给你的搜索接口 210 | data: { carnumber: str }, 211 | header: { 212 | 'content-type': 'application/json', 213 | 'Cookie': 'NWRZPARKINGID=' + app.globalData.loginMess 214 | }, 215 | success: function (res) { 216 | console.log(res) 217 | if (res.data.code === 1200) { 218 | wx.hideLoading() 219 | wx.showModal({ 220 | title: "提示", 221 | content: "" + res.data.msg, 222 | confirmColor: "#4fafc9", 223 | confirmText: "我知道了", 224 | showCancel: false, 225 | success: function (res) { 226 | if (res.confirm) { 227 | } 228 | } 229 | }) 230 | } else { 231 | if (res.data.code === 1001) { 232 | wx.hideLoading() 233 | wx.showModal({ 234 | title: "提示", 235 | content: "" + res.data.msg, 236 | confirmColor: "#4fafc9", 237 | confirmText: "我知道了", 238 | showCancel: false, 239 | success: function (res) { 240 | if (res.confirm) { 241 | } 242 | } 243 | }) 244 | } else { 245 | wx.hideLoading() 246 | wx.navigateTo({ 247 | url: "/pages/w_payment/w_payment?title=" + str 248 | }) 249 | } 250 | } 251 | }, 252 | fail: function (e) { 253 | wx.hideLoading() 254 | wx.showToast({ 255 | title: '网络异常!', 256 | duration: 2000 257 | }); 258 | }, 259 | }); 260 | } 261 | }) -------------------------------------------------------------------------------- /pages/w_my_car/w_my_car.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "我的爱车" 3 | } -------------------------------------------------------------------------------- /pages/w_my_car/w_my_car.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 这里还没有车辆,点击立刻添加 5 | 6 | 7 | 8 | 9 | 10 | 11 | {{item.carnumber}} 12 | 13 | 14 | 绑定时间:{{item.opdate}} 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 添加车辆 29 | -------------------------------------------------------------------------------- /pages/w_my_car/w_my_car.wxss: -------------------------------------------------------------------------------- 1 | /* pages/w_my_car/w_my_car.wxss */ 2 | page{ 3 | background: #f2f4f6; 4 | } 5 | /* 无车牌时样式 */ 6 | .no-car-info{ 7 | text-align: center; 8 | display: block; 9 | margin-top: 240rpx; 10 | font-size: 34rpx; 11 | color: #333; 12 | } 13 | 14 | 15 | /* 有车牌时样式 */ 16 | .list-car{ 17 | width: 100%; 18 | height: 192rpx; 19 | box-sizing: border-box; 20 | border-bottom: 4rpx solid #eaeaea; 21 | padding: 38rpx 54rpx; 22 | background: white; 23 | display: flex; 24 | flex-direction: row; 25 | align-items: center; 26 | justify-content:space-between; 27 | } 28 | .list-car:first-child{ 29 | margin-top: 32rpx; 30 | } 31 | .list-car:last-child{ 32 | border-bottom: 0; 33 | } 34 | .list-car-in{ 35 | display: flex; 36 | flex-direction: column; 37 | /* align-items: center; */ 38 | } 39 | .list-car-info{ 40 | overflow: hidden; 41 | } 42 | .list-car-number{ 43 | float: left; 44 | color:#282828; 45 | font-weight: 700; 46 | font-size: 38rpx; 47 | letter-spacing:5rpx; 48 | } 49 | .list-car-time{ 50 | float: left; 51 | color:#333; 52 | font-size: 32rpx; 53 | } 54 | .list-pay{ 55 | text-align: center; 56 | margin-top: 35rpx; 57 | height: 40rpx; 58 | line-height: 40rpx; 59 | } 60 | .list-pay text{ 61 | font-size: 28rpx; 62 | color: #909090; 63 | } 64 | .with_arrow { 65 | width: 60rpx; 66 | height: 60rpx; 67 | } 68 | /* 添加车牌 */ 69 | /* .add-car-info{ 70 | display: flex; 71 | justify-content: center; 72 | align-items: center; 73 | flex-direction: column; 74 | width: 200rpx; 75 | margin: 0 auto; 76 | margin-top: 100rpx; 77 | } 78 | .add-car-info image{ 79 | width: 100rpx; 80 | height: 100rpx; 81 | } 82 | .add-car-info text{ 83 | margin-top: 10rpx; 84 | text-align: center; 85 | font-size: 32rpx; 86 | color: #00aced; 87 | } */ 88 | .add-carinfo{ 89 | position: absolute; 90 | bottom: 62rpx; 91 | left: 0; 92 | right: 0; 93 | width: 670rpx; 94 | margin: 0 auto; 95 | text-align: center; 96 | background: #ffb900; 97 | color: #000; 98 | height: 90rpx; 99 | border-radius: 40rpx; 100 | } 101 | 102 | .add-carinfo text{ 103 | text-align: center; 104 | font-size: 36rpx; 105 | height: 90rpx; 106 | line-height: 90rpx; 107 | } -------------------------------------------------------------------------------- /pages/w_my_park_coupon/w_my_park_coupon.js: -------------------------------------------------------------------------------- 1 | // pages/parkcoupon/parkcoupon.js 2 | //获取应用实例 3 | const app = getApp() 4 | Page({ 5 | 6 | /** 7 | * 页面的初始数据 8 | */ 9 | data: { 10 | coupon: true,//是否有优惠券,默认无 11 | coupon_info: "",//优惠券信息,默认无 12 | tar: "1",//顶部tar的标识 13 | ok_coupon: [ 14 | { 15 | name: "停车券", 16 | desc: "停车满2小时可用", 17 | date: "2019.07.30-2018.09.30", 18 | }, { 19 | name: "日照万象汇", 20 | desc: "停车满2小时可用", 21 | date: "2019.07.30-2018.09.30", 22 | }, { 23 | name: "日照万象汇", 24 | desc: "停车满2小时可用", 25 | date: "2019.07.30-2018.09.30", 26 | }, { 27 | name: "日照万象汇", 28 | desc: "停车满2小时可用", 29 | date: "2019.07.30-2018.09.30", 30 | }],//未使用优惠券信息 31 | use_coupon: [{ 32 | name: "日照万象汇", 33 | desc: "停车满2小时可用", 34 | date: "2019.07.30-2018.09.30", 35 | }],//已使用优惠券信息 36 | overdue_coupon: [],//已使用优惠券信息 37 | }, 38 | 39 | /** 40 | * 生命周期函数--监听页面加载 41 | */ 42 | onLoad: function (options) { 43 | 44 | }, 45 | 46 | /** 47 | * 生命周期函数--监听页面初次渲染完成 48 | */ 49 | onReady: function () { 50 | 51 | }, 52 | 53 | /** 54 | * 生命周期函数--监听页面显示 55 | */ 56 | onShow: function () { 57 | 58 | }, 59 | 60 | /** 61 | * 生命周期函数--监听页面隐藏 62 | */ 63 | onHide: function () { 64 | 65 | }, 66 | 67 | /** 68 | * 生命周期函数--监听页面卸载 69 | */ 70 | onUnload: function () { 71 | 72 | }, 73 | 74 | /** 75 | * 页面相关事件处理函数--监听用户下拉动作 76 | */ 77 | onPullDownRefresh: function () { 78 | 79 | }, 80 | 81 | /** 82 | * 页面上拉触底事件的处理函数 83 | */ 84 | onReachBottom: function () { 85 | 86 | }, 87 | // 顶部tar切换 88 | tar1: function () { 89 | // 切换未使用,查询数据 90 | var that=this; 91 | this.setData({ 92 | tar: "1", 93 | }) 94 | 95 | wx.showLoading({ 96 | title: '正在加载中', 97 | mask: true, 98 | }) 99 | wx.request({ 100 | url: app.globalData.host + '/wxinfo/listBindCar', 101 | header: { 102 | 'content-type': 'application/json', 103 | 'Cookie': 'NWRZPARKINGID=' + app.globalData.loginMess 104 | }, 105 | success: function (res) { 106 | console.log(res) 107 | if ((parseInt(res.statusCode) === 200) && res.data.code === 1001) { 108 | that.setData({ 109 | ok_coupon: res.data.data.list 110 | }) 111 | wx.hideLoading() 112 | } else { 113 | wx.hideLoading() 114 | wx.showModal({ 115 | title: "获取信息出错", 116 | content: "" + res.data.msg, 117 | confirmColor: "#4fafc9", 118 | confirmText: "我知道了", 119 | showCancel: false, 120 | success: function (res) { 121 | if (res.confirm) { 122 | wx.navigateBack(); 123 | } 124 | } 125 | }) 126 | } 127 | }, 128 | fail: function (res) { 129 | wx.hideLoading() 130 | console.log(res) 131 | wx.showModal({ 132 | title: "获取信息出错", 133 | content: "请求超时或出现了其它未知错误,请您重新尝试", 134 | confirmColor: "#4fafc9", 135 | confirmText: "我知道了", 136 | showCancel: false, 137 | success: function (res) { 138 | if (res.confirm) { 139 | } 140 | } 141 | }) 142 | } 143 | }) 144 | }, 145 | tar2: function () { 146 | // 切换使用记录,查询数据 147 | this.setData({ 148 | tar: "2", 149 | }) 150 | }, 151 | tar3: function () { 152 | // 切换已过期,查询数据 153 | this.setData({ 154 | tar: "3", 155 | }) 156 | }, 157 | }) -------------------------------------------------------------------------------- /pages/w_my_park_coupon/w_my_park_coupon.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "停车优惠券" 3 | } -------------------------------------------------------------------------------- /pages/w_my_park_coupon/w_my_park_coupon.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 竟然一点优惠券都没有 4 | "你有没有考虑过优惠券的感受" 5 | 6 | 7 | 8 | 9 | 10 | 11 | 未使用(4) 12 | 13 | 未使用(4) 14 | 15 | 16 | 17 | 使用记录(0) 18 | 19 | 使用记录(0) 20 | 21 | 22 | 23 | 已过期(0) 24 | 25 | 已过期(0) 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 您还没有可使用的优惠券 35 | 36 | 37 | 38 | 39 | 40 | {{item.name}} 41 | {{item.desc}} 42 | {{item.date}} 43 | 44 | 45 | ¥2 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 您还没有已使用的优惠券 59 | 60 | 61 | 62 | 63 | 64 | {{item.name}} 65 | {{item.desc}} 66 | {{item.date}} 67 | 68 | 69 | ¥2 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 您还没有已过期的优惠券 83 | 84 | 85 | 86 | 87 | 88 | {{item.name}} 89 | {{item.desc}} 90 | {{item.date}} 91 | 92 | 93 | ¥2 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /pages/w_my_park_coupon/w_my_park_coupon.wxss: -------------------------------------------------------------------------------- 1 | /* pages/parkcoupon/parkcoupon.wxss */ 2 | page{ 3 | background: #f2f4f6; 4 | } 5 | /* 无优惠券显示 */ 6 | .no-coupon{ 7 | font-size: 34rpx; 8 | text-align: center; 9 | color: #333; 10 | margin-top: 450rpx; 11 | } 12 | .no-coupon text{ 13 | display: block; 14 | } 15 | .no-coupon text:last-child{ 16 | color: #999; 17 | font-size: 26rpx; 18 | margin-top: 15rpx; 19 | } 20 | /* 有优惠券时 */ 21 | .top-info{ 22 | width: 100%; 23 | height: 100rpx; 24 | background: white; 25 | margin-bottom: 30rpx; 26 | position: relative; 27 | } 28 | .top-info view{ 29 | width: 33.3%; 30 | height: 100rpx; 31 | line-height: 100rpx; 32 | display: inline-block; 33 | text-align: center; 34 | font-size: 32rpx; 35 | color: #d8d8d8; 36 | box-sizing: border-box; 37 | /* padding: 0 30rpx; */ 38 | overflow: hidden; 39 | text-overflow: ellipsis; 40 | white-space: nowrap; 41 | } 42 | .top-info view text{ 43 | width: 180rpx; 44 | height: 100rpx; 45 | line-height: 100rpx; 46 | display: inline-block; 47 | text-align: center; 48 | font-size: 32rpx; 49 | color: #d8d8d8; 50 | margin: 0 auto; 51 | overflow: hidden; 52 | text-overflow: ellipsis; 53 | white-space: nowrap; 54 | } 55 | .top-info view:nth-child(2) text{ 56 | width: 206rpx; 57 | } 58 | .top-info .active{ 59 | color: #6f6f6f; 60 | box-sizing: border-box; 61 | border-bottom: 2rpx solid #ffb900; 62 | } 63 | /* 优惠券样式 */ 64 | .coupon-info{ 65 | width: 670rpx; 66 | height: 202rpx; 67 | margin: 20rpx auto; 68 | box-sizing: border-box; 69 | border-left: 6rpx solid #ffb900; 70 | border-radius: 10rpx; 71 | background: white; 72 | position: relative; 73 | overflow: hidden; 74 | } 75 | .coupon-info.no{ 76 | border-left: 6rpx solid #dadada; 77 | } 78 | 79 | .coupon-info-desc{ 80 | width: 410rpx; 81 | height: 100%; 82 | box-sizing: border-box; 83 | padding: 26rpx 25rpx; 84 | overflow: hidden; 85 | border-right: 1rpx dashed #d2d2d2; 86 | display: inline-block; 87 | } 88 | .coupon-info-desc text{ 89 | display: block; 90 | /* float: left; */ 91 | color: #282828; 92 | padding: 0; 93 | } 94 | .coupon-info-desc-name{ 95 | color: #555; 96 | font-size: 28rpx; 97 | } 98 | .coupon-info-desc-name.no{ 99 | color: #bbb; 100 | } 101 | .coupon-info-desc-info{ 102 | color: #282828; 103 | font-size: 36rpx; 104 | display: block; 105 | margin: 15rpx 0; 106 | } 107 | .coupon-info-desc-info.no{ 108 | color: #bbb; 109 | } 110 | .coupon-info-desc-date{ 111 | color: #555; 112 | font-size: 26rpx; 113 | } 114 | .coupon-info-desc-date.no{ 115 | color: #dadada; 116 | } 117 | .coupon-info-money{ 118 | display: inline-block; 119 | float: right; 120 | width: 252rpx; 121 | height: 202rpx; 122 | line-height: 202rpx; 123 | text-align: center; 124 | } 125 | .coupon-info-money view{ 126 | color: #ff0000; 127 | font-size: 36rpx; 128 | } 129 | .coupon-info-money.no view{ 130 | color: #bbb; 131 | } 132 | .coupon-info-money view text{ 133 | color: #ff0000; 134 | font-size: 52rpx; 135 | font-weight: 600; 136 | padding: 0 16rpx 0 10rpx; 137 | } 138 | .coupon-info-money.no view text{ 139 | color: #bbb; 140 | } 141 | 142 | /* 左右半圆 */ 143 | .coupon-left{ 144 | width: 30rpx; 145 | height: 30rpx; 146 | border-radius: 50%; 147 | background: #f2f4f6; 148 | position: absolute; 149 | top: -15rpx; 150 | left:394rpx; 151 | } 152 | .coupon-right{ 153 | width: 30rpx; 154 | height: 30rpx; 155 | border-radius: 50%; 156 | background: #f2f4f6; 157 | position: absolute; 158 | bottom: -15rpx; 159 | left:394rpx; 160 | } -------------------------------------------------------------------------------- /pages/w_my_payment_record/w_my_payment_record.js: -------------------------------------------------------------------------------- 1 | // pages/w_my_payment_record/w_my_payment_record.js 2 | //获取应用实例 3 | const app = getApp() 4 | Page({ 5 | 6 | /** 7 | * 页面的初始数据 8 | */ 9 | data: { 10 | date: "",//日期 11 | payment:[{ 12 | car_number:"苏E·05E67", //车牌号 13 | car_money: "6.00", //支付金额 14 | payment_area: '日照停车场A2区域', //停车区域 15 | pay_time: "2018-07-01 09:25:15", //付款时间 16 | stop_time:"2小时25分钟11秒", //停车时长 17 | }, { 18 | car_number: "苏E·05E67", //车牌号 19 | car_money: "6.00", //支付金额 20 | payment_area: '日照停车场A2区域', //停车区域 21 | pay_time: "2018-07-01 09:25:15", //付款时间 22 | stop_time: "2小时25分钟11秒", //停车时长 23 | }, { 24 | car_number: "苏E·05E67", //车牌号 25 | car_money: "6.00", //支付金额 26 | payment_area: '日照停车场A2区域', //停车区域 27 | pay_time: "2018-07-01 09:25:15", //付款时间 28 | stop_time: "2小时25分钟11秒", //停车时长 29 | },],//缴费信息 30 | }, 31 | 32 | /** 33 | * 生命周期函数--监听页面加载 34 | */ 35 | onLoad: function (options) { 36 | 37 | //获取当前时间戳 38 | var timestamp = Date.parse(new Date()); 39 | //获取当前时间 40 | var n = timestamp; 41 | var date = new Date(n); 42 | //年 43 | var Y = date.getFullYear(); 44 | //月 45 | var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1); 46 | var time=Y+"-"+M; 47 | this.setData({ 48 | date: time 49 | }); 50 | }, 51 | 52 | /** 53 | * 生命周期函数--监听页面初次渲染完成 54 | */ 55 | onReady: function () { 56 | 57 | }, 58 | 59 | /** 60 | * 生命周期函数--监听页面显示 61 | */ 62 | onShow: function () { 63 | 64 | }, 65 | 66 | /** 67 | * 生命周期函数--监听页面隐藏 68 | */ 69 | onHide: function () { 70 | 71 | }, 72 | 73 | /** 74 | * 生命周期函数--监听页面卸载 75 | */ 76 | onUnload: function () { 77 | 78 | }, 79 | 80 | /** 81 | * 页面相关事件处理函数--监听用户下拉动作 82 | */ 83 | onPullDownRefresh: function () { 84 | 85 | }, 86 | 87 | /** 88 | * 页面上拉触底事件的处理函数 89 | */ 90 | onReachBottom: function () { 91 | 92 | }, 93 | // 日期选择 94 | bindDateChange: function (e) { 95 | console.log('picker发送选择改变,携带值为', e.detail.value) 96 | this.setData({ 97 | date: e.detail.value 98 | }) 99 | }, 100 | 101 | }) -------------------------------------------------------------------------------- /pages/w_my_payment_record/w_my_payment_record.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "缴费历史" 3 | } -------------------------------------------------------------------------------- /pages/w_my_payment_record/w_my_payment_record.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{date}} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 停车缴费21次 15 | 共计¥62.00 16 | 17 | 18 | 19 | 20 | 21 | 暂无缴费记录 22 | 23 | 24 | 25 | 26 | 27 | {{item.car_number}} 28 | ¥{{item.car_money}} 29 | 30 | 31 | {{item.payment_area}} 32 | 33 | 34 | {{item.pay_time}} 35 | {{item.stop_time}} 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /pages/w_my_payment_record/w_my_payment_record.wxss: -------------------------------------------------------------------------------- 1 | /* pages/w_my_payment_record/w_my_payment_record.wxss */ 2 | /* 日期和统计 */ 3 | /* 日期 */ 4 | .date{ 5 | width: 100%; 6 | height: 145rpx; 7 | box-sizing: border-box; 8 | padding: 20rpx 0 0 32rpx; 9 | background: #efeff4; 10 | } 11 | .bottom-image{ 12 | width: 46rpx; 13 | height: 46rpx; 14 | margin-top: 6rpx; 15 | } 16 | .picker{ 17 | display: flex; 18 | align-items: center; 19 | font-size: 32rpx; 20 | color: #282828; 21 | } 22 | .picker image{ 23 | margin-left: 19rpx; 24 | } 25 | /* 统计 */ 26 | .count{ 27 | margin-top: 10rpx; 28 | font-size: 26rpx; 29 | color: #909090; 30 | } 31 | .count-cishu{ 32 | margin-right: 33rpx; 33 | } 34 | /* 缴费信息 */ 35 | .payment{ 36 | width: 100%; 37 | height: 184rpx; 38 | border-bottom: 1rpx solid #999; 39 | box-sizing: border-box; 40 | padding: 24rpx 32rpx; 41 | } 42 | .payment-car{ 43 | color: #282828; 44 | overflow: hidden; 45 | } 46 | .payment-car-number{ 47 | font-size: 32rpx; 48 | font-weight: 700; 49 | } 50 | .payment-car-money{ 51 | font-size: 36rpx; 52 | font-weight: 700; 53 | float: right; 54 | } 55 | .payment-area{ 56 | display: flex; 57 | align-items: center; 58 | margin-top: 6rpx; 59 | } 60 | .payment-area-info{ 61 | font-size: 26rpx; 62 | color: #909090; 63 | } 64 | .payment-date{ 65 | color: #909090; 66 | font-size: 26rpx; 67 | margin-top: 8rpx; 68 | } 69 | .payment-date-stop-time{ 70 | float: right; 71 | } 72 | /* 无记录时 */ 73 | .no-payment{ 74 | width: 100%; 75 | text-align: center; 76 | font-size: 34rpx; 77 | margin-top: 160rpx; 78 | color: #777; 79 | } -------------------------------------------------------------------------------- /pages/w_payment/w_payment.js: -------------------------------------------------------------------------------- 1 | // pages/payment/payment.js 2 | //获取应用实例 3 | const app = getApp() 4 | 5 | Page({ 6 | /** 7 | * 页面的初始数据 8 | */ 9 | data: { 10 | title:'',//车牌 11 | member: false,//是否是会员,默认false 12 | first_pay: true,//是否是首次登录,默认true 13 | showHeight: !1,//会员积分模块高度判断 14 | pay_stop: 0,//停车费,默认0 15 | pay_member: 0,//会员减免,默认0 16 | pay_coupon: 0,//优惠券减免,默认0 17 | pay_memberjifen: 0,//付款时的支付的会员积分 18 | pay_memberjifen_money: 0,//付款时会员积分所减的金额 19 | pay_result:0,//实际支付价格,默认0 20 | first_jin: true,//是否是首次进入,默认是 21 | 22 | showModalStatus: false,//优惠券面板显示,默认隐藏 23 | // search_result: null,//优惠券结果 24 | ok_coupon: [ 25 | { 26 | name: "停车券", 27 | desc: "停车满2小时可用", 28 | date: "2019.07.30-2018.09.30", 29 | }, { 30 | name: "日照万象汇", 31 | desc: "停车满2小时可用", 32 | date: "2019.07.30-2018.09.30", 33 | }, { 34 | name: "日照万象汇", 35 | desc: "停车满2小时可用", 36 | date: "2019.07.30-2018.09.30", 37 | }, { 38 | name: "日照万象汇", 39 | desc: "停车满2小时可用", 40 | date: "2019.07.30-2018.09.30", 41 | } 42 | ],//优惠券结果 43 | keyboardShow: null,//优惠券的值 44 | }, 45 | 46 | /** 47 | * 生命周期函数--监听页面加载 48 | */ 49 | onLoad: function (options) { 50 | // 判断是否会员和获取车牌信息\ 51 | // wx.showLoading({ 52 | // title: '正在加载...', 53 | // mask: true, 54 | // }) 55 | var str2=""; 56 | if (options.title && options.title != "" && options.title.indexOf("·") == -1){ 57 | var str = options.title 58 | str2 = str.substring(0, 2) + "·" + str.substring(2); 59 | } 60 | // var pay_result = this.data.pay_result.toFixed(2); 61 | this.setData({ 62 | title: str2, 63 | member: app.globalData.member, 64 | }) 65 | // 请求查询需要缴费多少 66 | // wx.request({ 67 | // url: app.globalData.host + '/wxinfo/listBindCar', 68 | // data:{ 69 | // carnumber: options.title, 70 | // }, 71 | // header: { 72 | // 'content-type': 'application/json', 73 | // 'Cookie': 'NWRZPARKINGID=' + app.globalData.loginMess 74 | // }, 75 | // success: function (res) { 76 | // console.log(res) 77 | // if ((parseInt(res.statusCode) === 200) && res.data.code === 1001) { 78 | // that.setData({ 79 | // cars_number: res.data.data.list, 80 | // first_jin: false, 81 | // }) 82 | // wx.hideLoading() 83 | // } else { 84 | // wx.hideLoading() 85 | // wx.showModal({ 86 | // title: "获取信息出错", 87 | // content: "" + res.data.msg, 88 | // confirmColor: "#4fafc9", 89 | // confirmText: "我知道了", 90 | // showCancel: false, 91 | // success: function (res) { 92 | // if (res.confirm) { 93 | // wx.reLaunch({ 94 | // url: "/pages/index/index" 95 | // }) 96 | // } 97 | // } 98 | // }) 99 | // } 100 | // }, 101 | // fail: function (res) { 102 | // wx.hideLoading() 103 | // console.log(res) 104 | // wx.showModal({ 105 | // title: "获取信息出错", 106 | // content: "请求超时或出现了其它未知错误,请您重新尝试", 107 | // confirmColor: "#4fafc9", 108 | // confirmText: "我知道了", 109 | // showCancel: false, 110 | // success: function (res) { 111 | // if (res.confirm) { 112 | // wx.reLaunch({ 113 | // url: "/pages/index/index" 114 | // }) 115 | // } 116 | // } 117 | // }) 118 | // } 119 | // }) 120 | 121 | 122 | }, 123 | 124 | /** 125 | * 生命周期函数--监听页面初次渲染完成 126 | */ 127 | onReady: function () { 128 | // 判断是否会员 129 | this.setData({ 130 | member: app.globalData.member 131 | }) 132 | }, 133 | 134 | /** 135 | * 生命周期函数--监听页面显示 136 | */ 137 | onShow: function () { 138 | // 判断是否会员 139 | this.setData({ 140 | member: app.globalData.member 141 | }) 142 | }, 143 | 144 | /** 145 | * 生命周期函数--监听页面隐藏 146 | */ 147 | onHide: function () { 148 | 149 | }, 150 | 151 | /** 152 | * 生命周期函数--监听页面卸载 153 | */ 154 | onUnload: function () { 155 | 156 | }, 157 | 158 | /** 159 | * 页面相关事件处理函数--监听用户下拉动作 160 | */ 161 | onPullDownRefresh: function () { 162 | 163 | }, 164 | 165 | /** 166 | * 页面上拉触底事件的处理函数 167 | */ 168 | onReachBottom: function () { 169 | 170 | }, 171 | // 付款按钮 172 | payment: function (event) { 173 | var that = this; 174 | var oid = event.currentTarget.dataset.oid; 175 | var parameter; 176 | if (that.data.cid == '') { 177 | parameter = { oid: oid } 178 | } else { 179 | parameter = { oid: oid, cid: that.data.cid[0].cid } 180 | } 181 | wx.request({ 182 | url: app.globalData.host + '/wechat/wx_pay/deliver_pay', 183 | data: parameter, 184 | header: { 185 | 'content-type': 'application/json', 186 | 'Cookie': 'NEWWWAY-session-id=' + app.globalData.loginMess 187 | }, 188 | success: function (res) { 189 | if (res.data.result) { //正常付款 190 | wx.requestPayment( 191 | { 192 | 'timeStamp': res.data.Message.timeStamp,//时间戳 193 | 'nonceStr': res.data.Message.nonceStr,//随机字符串,长度为32个字符以下 194 | 'package': res.data.Message.package,//统一下单接口返回的 prepay_id 参数值 195 | 'signType': 'MD5', 196 | 'paySign': res.data.Message.paySign,//签名 197 | 'success': function (res) { 198 | wx.request({ 199 | url: app.globalData.host + '/wechat/wx_pay/receive_pay', 200 | data: { 201 | oid: oid 202 | }, 203 | header: { 204 | 'content-type': 'application/json', 205 | 'Cookie': 'NEWWWAY-session-id=' + app.globalData.loginMess 206 | }, 207 | success: function (res) { 208 | app.globalData.payShow = 0; 209 | app.globalData.cid = ''; 210 | wx.navigateBack({ 211 | delta: 10 212 | }) 213 | } 214 | }); 215 | }, 216 | 'fail': function (res) { 217 | console.log("失败") 218 | console.log(res) 219 | }, 220 | 'complete': function (res) { 221 | } 222 | }) 223 | } else { 224 | if (res.data.errorcode == "1001") { //已下架 225 | var content = ""; 226 | for (var i = 0; i < res.data.data.length; i++) { 227 | content += res.data.data[i] + "\r\n"; 228 | } 229 | wx.showModal({ 230 | title: res.data.Messge, 231 | content: content, 232 | confirmColor: "#4fafc9", 233 | confirmText: "我知道了", 234 | showCancel: false 235 | }) 236 | } else if (res.data.errorcode == "1002") { //未登录 237 | that.setData({ 238 | hiddenmodalput: false 239 | }); 240 | } else if (res.data.errorcode == "1003") { //购物券失效 241 | wx.showModal({ 242 | title: '提示', 243 | content: res.data.Messge, 244 | confirmColor: "#4fafc9", 245 | confirmText: "我知道了", 246 | showCancel: false, 247 | }) 248 | } else if (res.data.errorcode == "1004") { //使用优惠券后结算金额为0 249 | wx.showModal({ 250 | title: '提示', 251 | content: res.data.Messge, 252 | confirmColor: "#4fafc9", 253 | confirmText: "我知道了", 254 | showCancel: false, 255 | success: function (res1) { 256 | if (res1.confirm) { 257 | wx.navigateBack({ 258 | delta: 10 259 | }) 260 | } 261 | } 262 | }) 263 | } 264 | else { } 265 | } 266 | } 267 | }) 268 | }, 269 | //事件处理函数 270 | /*点击减号*/ 271 | bindMinus: function () { 272 | var pay_memberjifen = this.data.pay_memberjifen; 273 | if (pay_memberjifen > 0) { 274 | pay_memberjifen--; 275 | } 276 | var pay_memberjifen_money = pay_memberjifen/100; 277 | var minusStatus = pay_memberjifen > 0 ? 'normal' : 'disable'; 278 | this.setData({ 279 | pay_memberjifen: pay_memberjifen, 280 | pay_memberjifen_money: pay_memberjifen_money, 281 | minusStatus: minusStatus 282 | }) 283 | }, 284 | /*点击加号*/ 285 | bindPlus: function () { 286 | var pay_memberjifen = this.data.pay_memberjifen; 287 | pay_memberjifen++; 288 | var pay_memberjifen_money = pay_memberjifen / 100; 289 | var minusStatus = pay_memberjifen > 0 ? 'normal' : 'disable'; 290 | this.setData({ 291 | pay_memberjifen: pay_memberjifen, 292 | pay_memberjifen_money: pay_memberjifen_money, 293 | minusStatus: minusStatus 294 | }) 295 | }, 296 | //查看照片 297 | photo:function(){ 298 | 299 | }, 300 | coupon:function(){ 301 | this.showModal(); 302 | }, 303 | //显示对话框 304 | showModal: function () { 305 | // 显示遮罩层 306 | var animation = wx.createAnimation({ 307 | duration: 200, 308 | timingFunction: "linear", 309 | delay: 0 310 | }) 311 | this.animation = animation 312 | animation.translateY(300).step() 313 | this.setData({ 314 | animationData: animation.export(), 315 | showModalStatus: true 316 | }) 317 | setTimeout(function () { 318 | animation.translateY(0).step() 319 | this.setData({ 320 | animationData: animation.export() 321 | }) 322 | }.bind(this), 200) 323 | }, 324 | //隐藏对话框 325 | hideModal: function () { 326 | // 隐藏遮罩层 327 | var animation = wx.createAnimation({ 328 | duration: 200, 329 | timingFunction: "linear", 330 | delay: 0 331 | }) 332 | this.animation = animation 333 | animation.translateY(300).step() 334 | this.setData({ 335 | animationData: animation.export(), 336 | }) 337 | setTimeout(function () { 338 | animation.translateY(0).step() 339 | this.setData({ 340 | animationData: animation.export(), 341 | showModalStatus: false 342 | }) 343 | }.bind(this), 200) 344 | }, 345 | //关闭隐藏对话框 346 | close_coupon:function(){ 347 | this.hideModal(); 348 | }, 349 | //缴费规则 350 | tapRule:function(){ 351 | wx.navigateTo({ 352 | url: "/pages/w_index_rule/w_index_rule" 353 | }) 354 | } 355 | }) -------------------------------------------------------------------------------- /pages/w_payment/w_payment.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "进行支付" 3 | } -------------------------------------------------------------------------------- /pages/w_payment/w_payment.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 日照停车场A2区域 13 | 14 | 15 | {{title}} 16 | 查看照片 17 | 18 | 19 | 20 | 入场时间: 21 | 2018-07-01 22 | 09:10:18 23 | 24 | 停车时长: 25 | 0天2小时25分钟 26 | 27 | 首次缴费: 28 | 2018-07-01 29 | 09:10:18 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 停车费 41 | ¥{{pay_stop}} 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 白银会员 50 | -¥{{pay_member}} 51 | 52 | 53 | 54 | 55 | 56 | 57 | 普通用户 58 | 暂无优惠 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 优惠券 67 | 68 | 无可用优惠券 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 会员积分 80 | -¥{{pay_memberjifen_money}} 81 | 82 | 83 | 84 | 1825分 85 | 86 | + 87 | {{pay_memberjifen}} 88 | - 89 | 90 | 91 | 92 | 93 | 缴费规则 94 | 95 | 96 | 97 | 98 | 99 | 100 | 合计: 101 | ¥ 102 | {{pay_result}} 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 温馨提示 112 | 每次停车仅首次支付可享受支付优惠,再次支付时将无法再使用哦。 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 优惠券 125 | 126 | 127 | 128 | 129 | 130 | 131 | {{item.name}} 132 | {{item.desc}} 133 | {{item.date}} 134 | 135 | 136 | ¥2 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | -------------------------------------------------------------------------------- /pages/w_payment/w_payment.wxss: -------------------------------------------------------------------------------- 1 | /* pages/payment/payment.wxss */ 2 | /*整体背景*/ 3 | page{ 4 | background: #f2f4f6; 5 | } 6 | 7 | /*支付背景*/ 8 | .pay-bg{ 9 | width: 670rpx; 10 | box-sizing: border-box; 11 | margin: 30rpx auto 0; 12 | height: auto; 13 | border-top: 6rpx solid #ffb900; 14 | position: relative; 15 | } 16 | 17 | /* 左右半圆 */ 18 | .circle-left{ 19 | width: 25rpx; 20 | height: 25rpx; 21 | border-radius: 50%; 22 | background: #f2f4f6; 23 | position: absolute; 24 | top: 342.5rpx; 25 | left:-12.5rpx; 26 | z-index: 12; 27 | } 28 | .circle-right{ 29 | width: 25rpx; 30 | height: 25rpx; 31 | border-radius: 50%; 32 | background: #f2f4f6; 33 | position: absolute; 34 | top: 342.5rpx; 35 | right:-12.5rpx; 36 | z-index: 12; 37 | } 38 | /* 车辆详情 */ 39 | .car_info{ 40 | width: 100%; 41 | height: 356rpx; 42 | background: white; 43 | border-bottom: 1rpx dashed #d2d2d2; 44 | /* border-bottom: 1rpx dotted #d2d2d2; */ 45 | } 46 | .car-info-area{ 47 | color: #282828; 48 | font-size: 36rpx; 49 | display: block; 50 | padding-top: 50rpx; 51 | text-align: center; 52 | font-weight: 700; 53 | } 54 | .car-info-np{ 55 | width: 100%; 56 | text-align: center; 57 | height: 44rpx; 58 | padding-top: 30rpx; 59 | } 60 | .car-info-number{ 61 | font-size: 34rpx; 62 | color: #282828; 63 | margin-right: 32rpx; 64 | height: 56rpx; 65 | line-height: 56rpx; 66 | font-weight: 700; 67 | } 68 | .car-info-photos{ 69 | width: 138rpx; 70 | height: 46rpx; 71 | border: 1rpx solid #3d85e9; 72 | font-size: 26rpx; 73 | line-height: 46rpx; 74 | display: inline-block; 75 | border-radius: 50rpx; 76 | color: #3d85e9; 77 | text-align: center; 78 | } 79 | .car-info-rs{ 80 | width: 100%; 81 | margin-top: 38rpx; 82 | box-sizing: border-box; 83 | padding-left: 25rpx; 84 | color: #767779; 85 | font-size: 27rpx; 86 | } 87 | .car-info-ruchangtime{ 88 | display: block; 89 | padding-right: 46rpx; 90 | } 91 | .car-info-ruchangdate{ 92 | padding-right: 20rpx; 93 | } 94 | .car-info-stoptime{ 95 | display: block; 96 | padding-right: 46rpx; 97 | padding-top: 15rpx; 98 | } 99 | .car-info-firsttime{ 100 | display: block; 101 | padding-right: 46rpx; 102 | padding-top: 15rpx; 103 | } 104 | /* 停车初始费用 */ 105 | .start-pay-info{ 106 | width: 100%; 107 | height: 120rpx; 108 | background: white; 109 | box-sizing: border-box; 110 | padding: 0 32rpx; 111 | border-bottom: 1rpx solid #d2d2d2; 112 | font-size: 32rpx; 113 | color: #282828; 114 | position: relative; 115 | display: flex; 116 | flex-direction: row; 117 | align-items: center; 118 | justify-content: space-between; 119 | 120 | } 121 | .start-pay-info:before, .start-pay-info:after{ 122 | /*直线上倒三角*/ 123 | width:0px; 124 | height:0px; 125 | border: solid transparent; 126 | position:absolute; 127 | top:100%; 128 | content:""; 129 | } 130 | .start-pay-info:before{ 131 | border-width:15rpx; 132 | border-top-color: #d2d2d2; 133 | left:60rpx; 134 | z-index: 12; 135 | } 136 | .start-pay-info:after{ 137 | border-width:13rpx; 138 | border-top-color: #fff; 139 | left:62rpx; 140 | z-index: 12; 141 | } 142 | 143 | /* 会员减免 */ 144 | .m-p-i{ 145 | width: 100%; 146 | background: white; 147 | box-sizing: border-box; 148 | padding: 0 32rpx; 149 | } 150 | .member-pay-info{ 151 | width: 100%; 152 | height: 106rpx; 153 | background: white; 154 | box-sizing: border-box; 155 | border-bottom: 1rpx solid #e5e5e5; 156 | font-size: 32rpx; 157 | color: #282828; 158 | display: flex; 159 | flex-direction: row; 160 | align-items: center; 161 | justify-content: space-between; 162 | } 163 | .no-member{ 164 | color: #bfbfbf; 165 | } 166 | /* 优惠券 */ 167 | .coupon-pay-info{ 168 | width: 100%; 169 | height: 106rpx; 170 | background: white; 171 | box-sizing: border-box; 172 | font-size: 32rpx; 173 | border-bottom: 1rpx solid #e5e5e5; 174 | color: #282828; 175 | display: flex; 176 | flex-direction: row; 177 | align-items: center; 178 | justify-content: space-between; 179 | } 180 | .item2{ 181 | display: flex; 182 | flex-direction: row; 183 | align-items: center; 184 | } 185 | .coupon-pay-info-number{ 186 | color: #bfbfbf; 187 | } 188 | .with_arrow { 189 | width: 16px; 190 | height: 16px; 191 | margin-left: 32rpx; 192 | } 193 | /* 会员积分 */ 194 | .memberjifen-pay-info{ 195 | width: 100%; 196 | height:250rpx; 197 | box-sizing: border-box; 198 | padding: 32rpx 32rpx; 199 | font-size: 32rpx; 200 | background: white; 201 | color: #282828; 202 | overflow: hidden; 203 | position: relative; 204 | } 205 | .m-height{ 206 | height:450rpx; 207 | } 208 | .memberjifen-pay-info-jian{ 209 | width: 100%; 210 | overflow: hidden; 211 | } 212 | .memberjifen-pay-info-desc{ 213 | float: left; 214 | } 215 | .memberjifen-pay-info-number{ 216 | float: right; 217 | color: #282828; 218 | } 219 | .memberjifen-pay-info-fen{ 220 | margin-top: 22rpx; 221 | width: 100%; 222 | overflow: hidden; 223 | margin-bottom: 50rpx; 224 | } 225 | .memberjifen-pay-info-fen-desc{ 226 | float: left; 227 | font-size: 28rpx; 228 | color: #777777; 229 | } 230 | .memberjifen-pay-info-fen-saun{ 231 | display: inline-block; 232 | float: right; 233 | overflow: hidden; 234 | } 235 | .memberjifen-pay-number-jian{ 236 | float: right; 237 | height: 40rpx; 238 | width: 40rpx; 239 | background: #e8eaec; 240 | color: #777; 241 | text-align: center; 242 | line-height: 40rpx; 243 | border: 1rpx solid #e8eaec; 244 | font-size: 40rpx; 245 | } 246 | /*普通样式*/ 247 | .memberjifen-pay-info-fen-saun .normal { 248 | color:#777; 249 | } 250 | /*禁用样式*/ 251 | .memberjifen-pay-info-fen-saun .disable { 252 | color: #ccc; 253 | } 254 | .memberjifen-pay-number-jia{ 255 | float: right; 256 | height: 40rpx; 257 | width: 40rpx; 258 | background: #e8eaec; 259 | color: #777; 260 | text-align: center; 261 | line-height: 40rpx; 262 | border: 1rpx solid #e8eaec; 263 | } 264 | .memberjifen-pay-number{ 265 | float: right; 266 | padding: 0 20rpx; 267 | height: 40rpx; 268 | line-height: 40rpx; 269 | text-align: center; 270 | } 271 | /* 缴费提示 */ 272 | .search-prompt{ 273 | width: 100%; 274 | display: flex; 275 | flex-direction: row; 276 | align-items: center; 277 | text-align: center; 278 | justify-content:center; 279 | position: absolute; 280 | bottom: 24rpx; 281 | left: 0; 282 | } 283 | .pay-img{ 284 | display: flex; 285 | align-items: center; 286 | text-align: center; 287 | justify-content:center; 288 | width: 30rpx; 289 | height: 30rpx; 290 | box-sizing: border-box; 291 | margin-left: 8rpx; 292 | } 293 | .pay-desc{ 294 | display: flex; 295 | align-items: center; 296 | text-align: center; 297 | justify-content:center; 298 | color: #999; 299 | font-size: 24rpx; 300 | } 301 | /* 进行付款 */ 302 | .pay-info{ 303 | width: 100%; 304 | height: 88rpx; 305 | background: #e8eaec; 306 | overflow: hidden; 307 | } 308 | .pay-info-desc{ 309 | font-size: 28rpx; 310 | color: #282828; 311 | line-height: 88rpx; 312 | margin-left: 80rpx; 313 | } 314 | .pay-info-number-biao{ 315 | color: #ff0000; 316 | font-size: 28rpx; 317 | line-height: 88rpx; 318 | margin-right: 10rpx; 319 | } 320 | .pay-info-number{ 321 | color: #ff0000; 322 | font-size: 38rpx; 323 | line-height: 88rpx; 324 | } 325 | .pay{ 326 | float: right; 327 | width: 248rpx; 328 | height: 88rpx; 329 | background: #ffb900; 330 | color: #282828; 331 | font-size: 32rpx; 332 | border-radius: 0; 333 | } 334 | .pay::after{ 335 | border: 0rpx; 336 | } 337 | 338 | /* 支付提示 */ 339 | .pay-tishi{ 340 | width: 100%; 341 | position: absolute; 342 | bottom: 32rpx; 343 | box-sizing: border-box; 344 | } 345 | .pay-prompt{ 346 | width: 670rpx; 347 | margin: 0 auto ; 348 | text-align:center; 349 | } 350 | .pay-prompt-desc{ 351 | color:#a0a0a0; 352 | font-size: 22rpx; 353 | text-align: center; 354 | display: block; 355 | } 356 | .pay-prompt-desc1{ 357 | padding-bottom: 14rpx; 358 | } 359 | .pay-prompt-desc2{ 360 | padding-bottom: 10rpx; 361 | text-align: center; 362 | } 363 | 364 | /*遮罩层搜索结果*/ 365 | /*使屏幕变暗 */ 366 | .commodity_screen { 367 | width: 100%; 368 | height: 100%; 369 | position: fixed; 370 | top: 0; 371 | left: 0; 372 | background: #000; 373 | opacity: 0.2; 374 | overflow: hidden; 375 | z-index: 1000; 376 | color: #fff; 377 | } 378 | /*对话框 */ 379 | .commodity_attr_box { 380 | height: 800rpx; 381 | width: 100%; 382 | /* overflow: hidden; */ 383 | position: fixed; 384 | bottom: 0; 385 | left: 0; 386 | z-index: 2000; 387 | background: #faf4f6; 388 | /* padding-top: 20rpx; */ 389 | box-sizing: border-box; 390 | 391 | border-top-left-radius: 15rpx; 392 | border-top-right-radius: 15rpx; 393 | } 394 | .coupon-title{ 395 | position: absolute; 396 | top: 0rpx; 397 | left: 0; 398 | height: 98rpx; 399 | width: 100%; 400 | overflow: hidden; 401 | display: flex; 402 | flex-direction: row; 403 | align-items: center; 404 | justify-content: space-between; 405 | box-sizing: border-box; 406 | padding: 0 24rpx 0 48rpx; 407 | border-bottom: 2rpx solid #ddd; 408 | z-index: 2002; 409 | background: white; 410 | border-top-left-radius: 15rpx; 411 | border-top-right-radius: 15rpx; 412 | } 413 | .coupon-info-zong{ 414 | margin-top:100rpx; 415 | height: 700rpx; 416 | box-sizing: border-box; 417 | z-index: 2001; 418 | overflow: hidden; 419 | overflow-y:scroll; 420 | } 421 | .coupon-title text{ 422 | font-size: 34rpx; 423 | color: #555; 424 | } 425 | .coupon-title image{ 426 | height: 60rpx; 427 | width: 60rpx; 428 | } 429 | 430 | 431 | .commodity_attr_box::-webkit-scrollbar-track-piece { 432 | background-color: rgba(0, 0, 0, 0); 433 | border-left: 1px solid rgba(0, 0, 0, 0); 434 | } 435 | .commodity_attr_box::-webkit-scrollbar { 436 | width: 5px; 437 | height: 13px; 438 | -webkit-border-radius: 5px; 439 | -moz-border-radius: 5px; 440 | border-radius: 5px; 441 | } 442 | .commodity_attr_box::-webkit-scrollbar-thumb { 443 | background-color: rgba(0, 0, 0, 0.5); 444 | background-clip: padding-box; 445 | -webkit-border-radius: 5px; 446 | -moz-border-radius: 5px; 447 | border-radius: 5px; 448 | min-height: 28px; 449 | } 450 | .commodity_attr_box::-webkit-scrollbar-thumb:hover { 451 | background-color: rgba(0, 0, 0, 0.5); 452 | -webkit-border-radius: 5px; 453 | -moz-border-radius: 5px; 454 | border-radius: 5px; 455 | } 456 | 457 | /* 优惠券样式 */ 458 | .coupon-info{ 459 | width: 670rpx; 460 | height: 202rpx; 461 | margin: 20rpx auto; 462 | box-sizing: border-box; 463 | border-left: 6rpx solid #ffb900; 464 | border-radius: 10rpx; 465 | background: white; 466 | position: relative; 467 | overflow: hidden; 468 | } 469 | .coupon-info-desc{ 470 | width: 410rpx; 471 | height: 100%; 472 | box-sizing: border-box; 473 | padding: 26rpx 25rpx; 474 | overflow: hidden; 475 | border-right: 1rpx dashed #d2d2d2; 476 | display: inline-block; 477 | } 478 | .coupon-info-desc text{ 479 | display: block; 480 | /* float: left; */ 481 | color: #282828; 482 | padding: 0; 483 | } 484 | .coupon-info-desc-name{ 485 | color: #555; 486 | font-size: 28rpx; 487 | } 488 | .coupon-info-desc-info{ 489 | color: #282828; 490 | font-size: 36rpx; 491 | display: block; 492 | margin: 15rpx 0; 493 | } 494 | .coupon-info-desc-date{ 495 | color: #555; 496 | font-size: 26rpx; 497 | } 498 | .coupon-info-money{ 499 | display: inline-block; 500 | float: right; 501 | width: 252rpx; 502 | height: 202rpx; 503 | line-height: 202rpx; 504 | text-align: center; 505 | } 506 | .coupon-info-money view{ 507 | color: #ff0000; 508 | font-size: 36rpx; 509 | } 510 | .coupon-info-money view text{ 511 | color: #ff0000; 512 | font-size: 52rpx; 513 | font-weight: 600; 514 | padding: 0 16rpx 0 10rpx; 515 | } 516 | 517 | 518 | /* 左右半圆 */ 519 | .coupon-left{ 520 | width: 30rpx; 521 | height: 30rpx; 522 | border-radius: 50%; 523 | background: #f2f4f6; 524 | position: absolute; 525 | top: -15rpx; 526 | left:394rpx; 527 | } 528 | .coupon-right{ 529 | width: 30rpx; 530 | height: 30rpx; 531 | border-radius: 50%; 532 | background: #f2f4f6; 533 | position: absolute; 534 | bottom: -15rpx; 535 | left:394rpx; 536 | } -------------------------------------------------------------------------------- /pages/w_payment_prompt/w_payment_prompt.js: -------------------------------------------------------------------------------- 1 | // pages/w_payment_prompt/w_payment_prompt.js 2 | //获取应用实例 3 | const app = getApp() 4 | Page({ 5 | 6 | /** 7 | * 页面的初始数据 8 | */ 9 | data: { 10 | time: '获取验证码', //倒计时 11 | disabled: true,//获取验证码按钮属性 12 | disabled2: true,//确认绑定按钮属性 13 | currentTime: 60, 14 | platenumber: '',//车牌号 15 | }, 16 | 17 | /** 18 | * 生命周期函数--监听页面加载 19 | */ 20 | onLoad: function (options) { 21 | 22 | }, 23 | 24 | /** 25 | * 生命周期函数--监听页面初次渲染完成 26 | */ 27 | onReady: function () { 28 | 29 | }, 30 | 31 | /** 32 | * 生命周期函数--监听页面显示 33 | */ 34 | onShow: function () { 35 | 36 | }, 37 | 38 | /** 39 | * 生命周期函数--监听页面隐藏 40 | */ 41 | onHide: function () { 42 | 43 | }, 44 | 45 | /** 46 | * 生命周期函数--监听页面卸载 47 | */ 48 | onUnload: function () { 49 | 50 | }, 51 | 52 | /** 53 | * 页面相关事件处理函数--监听用户下拉动作 54 | */ 55 | onPullDownRefresh: function () { 56 | 57 | }, 58 | 59 | /** 60 | * 页面上拉触底事件的处理函数 61 | */ 62 | onReachBottom: function () { 63 | 64 | }, 65 | // 验证码input 66 | addPlatenumber: function (e) { 67 | this.setData({ 68 | platenumber: e.detail.value 69 | }) 70 | }, 71 | // 表单提交 72 | formSubmit: function (e) { 73 | console.log('form发生了submit事件,携带数据为:', e.detail.value) 74 | 75 | 76 | // wx.request({ 77 | // url: `${config.api + '/addinfo'}`, 78 | // data: { 79 | // phoneNum: this.data.phoneNum, 80 | // code: this.data.code, 81 | // otherInfo: this.data.otherInfo 82 | // }, 83 | // header: { 84 | // 'content-type': 'application/json' 85 | // }, 86 | // method: 'POST', 87 | // success: function (res) { 88 | // console.log(res) 89 | // if ((parseInt(res.statusCode) === 200) && res.data.message === 'pass') { 90 | // wx.showToast({ 91 | // title: '验证成功', 92 | // icon: 'success' 93 | // }) 94 | // } else { 95 | // wx.showToast({ 96 | // title: res.data.message, 97 | // image: '../../images/fail.png' 98 | // }) 99 | // } 100 | // }, 101 | // fail: function (res) { 102 | // console.log(res) 103 | // } 104 | // }) 105 | }, 106 | formReset: function () { 107 | console.log('form发生了reset事件') 108 | }, 109 | tapindex: function (e) { 110 | wx.reLaunch({ 111 | url: "/pages/index/index" 112 | }) 113 | }, 114 | tapplatenumber: function (e) { 115 | wx.navigateTo({ 116 | url: "/pages/w_my_bind_platenumber/w_my_bind_platenumber" 117 | }) 118 | }, 119 | }) -------------------------------------------------------------------------------- /pages/w_payment_prompt/w_payment_prompt.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "缴费提示" 3 | } -------------------------------------------------------------------------------- /pages/w_payment_prompt/w_payment_prompt.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 缴费成功 9 | 10 | 11 | 请在半小时内离开停车场,超出时间段将可能产生新的费用 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /pages/w_payment_prompt/w_payment_prompt.wxss: -------------------------------------------------------------------------------- 1 | /* pages/w_payment_prompt/w_payment_prompt.wxss */ 2 | 3 | /*绑定结果提示 */ 4 | .bind-prompt{ 5 | display: block; 6 | width: 670rpx; 7 | font-size: 48rpx; 8 | font-weight: 600; 9 | margin: 150rpx 0 0rpx; 10 | display: flex; 11 | align-items: center; 12 | justify-content: center; 13 | } 14 | .bind-prompt-img{ 15 | width: 54rpx; 16 | height: 54rpx; 17 | margin-right: 40rpx; 18 | } 19 | 20 | /* 半小时提示 */ 21 | .pay-warn{ 22 | width: 670rpx; 23 | margin: 0 auto; 24 | display: flex; 25 | align-items: center; 26 | margin-top: 40rpx; 27 | } 28 | .bind-prompt-desc1{ 29 | text-align: center; 30 | font-size: 34rpx; 31 | line-height: 60rpx; 32 | } -------------------------------------------------------------------------------- /project.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "项目配置文件。", 3 | "packOptions": { 4 | "ignore": [] 5 | }, 6 | "setting": { 7 | "urlCheck": false, 8 | "es6": true, 9 | "postcss": true, 10 | "minified": true, 11 | "newFeature": true 12 | }, 13 | "compileType": "miniprogram", 14 | "libVersion": "1.9.4", 15 | "appid": "wx7dc591c0f91ad17f", 16 | "projectname": "%E5%81%9C%E8%BD%A6%E5%9C%BA%E6%B5%8B%E8%AF%951", 17 | "svr": "", 18 | "client": "", 19 | "qcloudRoot": "", 20 | "miniprogramRoot": "", 21 | "pluginRoot": "", 22 | "scripts": {}, 23 | "condition": { 24 | "search": { 25 | "current": -1, 26 | "list": [] 27 | }, 28 | "conversation": { 29 | "current": -1, 30 | "list": [] 31 | }, 32 | "plugin": { 33 | "current": -1, 34 | "list": [] 35 | }, 36 | "game": { 37 | "list": [] 38 | }, 39 | "miniprogram": { 40 | "current": 4, 41 | "list": [ 42 | { 43 | "id": 0, 44 | "name": "我的", 45 | "pathName": "pages/w_my/w_my", 46 | "query": "" 47 | }, 48 | { 49 | "id": -1, 50 | "name": "绑定会员", 51 | "pathName": "pages/w_my_bind_member/w_my_bind_member", 52 | "query": "" 53 | }, 54 | { 55 | "id": -1, 56 | "name": "绑定车牌", 57 | "pathName": "pages/w_my_bind_platenumber/w_my_bind_platenumber", 58 | "query": "" 59 | }, 60 | { 61 | "id": -1, 62 | "name": "绑定车牌结果", 63 | "pathName": "pages/w_my_bind_prompt/w_my_bind_prompt", 64 | "query": "" 65 | }, 66 | { 67 | "id": -1, 68 | "name": "支付界面", 69 | "pathName": "pages/w_payment/w_payment", 70 | "query": "" 71 | }, 72 | { 73 | "id": -1, 74 | "name": "我的爱车", 75 | "pathName": "pages/w_my_car/w_my_car", 76 | "query": "" 77 | }, 78 | { 79 | "id": -1, 80 | "name": "缴费历史", 81 | "pathName": "pages/w_my_payment_record/w_my_payment_record", 82 | "query": "" 83 | }, 84 | { 85 | "id": 7, 86 | "name": "优惠券", 87 | "pathName": "pages/w_my_park_coupon/w_my_park_coupon", 88 | "query": "" 89 | }, 90 | { 91 | "id": -1, 92 | "name": "缴费提示", 93 | "pathName": "pages/w_payment_prompt/w_payment_prompt", 94 | "query": "" 95 | }, 96 | { 97 | "id": -1, 98 | "name": "加载失败提示", 99 | "pathName": "pages/index_fail/index_fail", 100 | "query": "" 101 | } 102 | ] 103 | } 104 | } 105 | } -------------------------------------------------------------------------------- /utils/util.js: -------------------------------------------------------------------------------- 1 | const formatTime = date => { 2 | const year = date.getFullYear() 3 | const month = date.getMonth() + 1 4 | const day = date.getDate() 5 | const hour = date.getHours() 6 | const minute = date.getMinutes() 7 | const second = date.getSeconds() 8 | 9 | return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':') 10 | } 11 | 12 | const formatNumber = n => { 13 | n = n.toString() 14 | return n[1] ? n : '0' + n 15 | } 16 | 17 | module.exports = { 18 | formatTime: formatTime 19 | } 20 | --------------------------------------------------------------------------------