From 3c11974c662ef44db83e2456095f8ba375ecf0e7 Mon Sep 17 00:00:00 2001 From: Archer_cdm Date: Mon, 16 Jan 2023 23:52:19 +0800 Subject: [PATCH] =?UTF-8?q?=EF=BC=88*=EF=BC=89=E9=83=A8=E5=88=86UI?= =?UTF-8?q?=E6=90=AD=E5=BB=BA--=E5=BC=80=E5=A7=8B=E5=B7=A1=E6=A3=80?= =?UTF-8?q?=E3=80=81=E5=B7=A1=E6=A3=80=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weapp/app.json | 9 +- weapp/images/down.svg | 1 + weapp/package/basic/basic.wxml | 2 +- .../inspectionRecord/inspectionRecord.js | 85 +++++++++++ .../inspectionRecord/inspectionRecord.json | 6 + .../inspectionRecord/inspectionRecord.wxml | 40 +++++ .../inspectionRecord/inspectionRecord.wxss | 47 ++++++ weapp/package/polling/polling.js | 18 ++- weapp/package/polling/polling.wxml | 21 ++- weapp/package/polling/polling.wxss | 38 +++++ .../startInspection/startInspection.js | 138 ++++++++++++++++++ .../startInspection/startInspection.json | 6 + .../startInspection/startInspection.wxml | 87 +++++++++++ .../startInspection/startInspection.wxss | 85 +++++++++++ weapp/pages/index/index.wxml | 2 +- weapp/project.private.config.json | 28 +--- 16 files changed, 580 insertions(+), 33 deletions(-) create mode 100644 weapp/images/down.svg create mode 100644 weapp/package/inspectionRecord/inspectionRecord.js create mode 100644 weapp/package/inspectionRecord/inspectionRecord.json create mode 100644 weapp/package/inspectionRecord/inspectionRecord.wxml create mode 100644 weapp/package/inspectionRecord/inspectionRecord.wxss create mode 100644 weapp/package/startInspection/startInspection.js create mode 100644 weapp/package/startInspection/startInspection.json create mode 100644 weapp/package/startInspection/startInspection.wxml create mode 100644 weapp/package/startInspection/startInspection.wxss diff --git a/weapp/app.json b/weapp/app.json index ca7ade1..0a09b15 100644 --- a/weapp/app.json +++ b/weapp/app.json @@ -9,7 +9,9 @@ "root": "package", "pages": [ "polling/polling", - "basic/basic" + "basic/basic", + "startInspection/startInspection", + "inspectionRecord/inspectionRecord" ] }], "window": { @@ -41,5 +43,10 @@ } ] }, + "permission": { + "scope.userLocation": { + "desc": "你的位置信息将用于小程序位置接口的效果展示" + } + }, "sitemapLocation": "sitemap.json" } \ No newline at end of file diff --git a/weapp/images/down.svg b/weapp/images/down.svg new file mode 100644 index 0000000..d3a9661 --- /dev/null +++ b/weapp/images/down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/weapp/package/basic/basic.wxml b/weapp/package/basic/basic.wxml index b308372..720786e 100644 --- a/weapp/package/basic/basic.wxml +++ b/weapp/package/basic/basic.wxml @@ -22,7 +22,7 @@ 部门: - 管理部门 + {{userInfo.deptName || '--'}} diff --git a/weapp/package/inspectionRecord/inspectionRecord.js b/weapp/package/inspectionRecord/inspectionRecord.js new file mode 100644 index 0000000..2b1eea3 --- /dev/null +++ b/weapp/package/inspectionRecord/inspectionRecord.js @@ -0,0 +1,85 @@ +// package/inspectionRecord/inspectionRecord.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + ResList: [ //阅读状态 + { + value: 'normal', + text: '正常', + }, + { + value: 'abnormal', + text: '异常', + } + ], + ResIndex: 0, //巡检结果 + dataList: [1, 2, 3, 4, 5,] + }, + + // 巡检结果 + bindPickerRes(e) { + let that = this; + that.setData({ + ResIndex: e.detail.value + }) + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/weapp/package/inspectionRecord/inspectionRecord.json b/weapp/package/inspectionRecord/inspectionRecord.json new file mode 100644 index 0000000..3656c38 --- /dev/null +++ b/weapp/package/inspectionRecord/inspectionRecord.json @@ -0,0 +1,6 @@ +{ + "navigationBarBackgroundColor": "#1979ff", + "navigationBarTextStyle": "white", + "navigationBarTitleText": "巡检记录", + "enablePullDownRefresh": false +} \ No newline at end of file diff --git a/weapp/package/inspectionRecord/inspectionRecord.wxml b/weapp/package/inspectionRecord/inspectionRecord.wxml new file mode 100644 index 0000000..8d7a7ff --- /dev/null +++ b/weapp/package/inspectionRecord/inspectionRecord.wxml @@ -0,0 +1,40 @@ + + + + 时间范围: + + 2022-12-15 + + 2022-12-26 + + + + 巡检结果: + + {{ResList[ResIndex].text}} + + + + + + + + + + + 结构物A + + + 本次巡检日期:2022-12-21 17:00 + + + 巡检人:巡检人 + + + 巡检结果:异常 + + 查看详情 + + + + \ No newline at end of file diff --git a/weapp/package/inspectionRecord/inspectionRecord.wxss b/weapp/package/inspectionRecord/inspectionRecord.wxss new file mode 100644 index 0000000..e981149 --- /dev/null +++ b/weapp/package/inspectionRecord/inspectionRecord.wxss @@ -0,0 +1,47 @@ +/* package/inspectionRecord/inspectionRecord.wxss */ +page{ + background: #F7F7FA; +} + +.my-picker { + white-space: nowrap; + width: 100rpx; +} + +.contentBox { + padding: 210rpx 30rpx 20rpx; +} + +.listBox { + background-color: #fff; + border-radius: 10rpx; + box-shadow: 0rpx 0rpx 10rpx #ddd; + margin: 30rpx auto; + overflow: hidden; +} + +.titleBox { + overflow: hidden; + padding-bottom: 20rpx; + padding-top: 40rpx; +} + +.title { + float: left; + font-size: 32rpx; + width: 460rpx; + font-weight: bold; +} + +.btn { + width: 130rpx; + text-align: center; + font-size: 30rpx; + padding: 20rpx; + background: #1979ff; + color: #fff; + border-radius: 10rpx; + float: left; + margin-left: 30rpx; + margin-top: 20rpx; +} \ No newline at end of file diff --git a/weapp/package/polling/polling.js b/weapp/package/polling/polling.js index 2cee9c4..73f31cf 100644 --- a/weapp/package/polling/polling.js +++ b/weapp/package/polling/polling.js @@ -5,12 +5,26 @@ Page({ * 页面的初始数据 */ data: { - + dataList: [1, 2, 3, 4, 5,] }, // 顶部tab切换 clickTab(e) { - + this.setData({ + currentTab: e.currentTarget.dataset.current + }) + if (e.currentTarget.dataset.current == '0') { + wx.navigateTo({ + url: '/package/inspectionRecord/inspectionRecord', + }) + } + }, + + // 开始巡检 + bindStart() { + wx.navigateTo({ + url: '/package/startInspection/startInspection', + }) }, /** diff --git a/weapp/package/polling/polling.wxml b/weapp/package/polling/polling.wxml index 245eab7..4429a68 100644 --- a/weapp/package/polling/polling.wxml +++ b/weapp/package/polling/polling.wxml @@ -6,6 +6,25 @@ - 待巡检 + 待巡检 + + + + + + + + 结构物A巡检计划 + + + 计划时间:2022-12-21至2023-01-15 + + + 计划时间:周期巡检(3天一次) + + 开始巡检 + + + \ No newline at end of file diff --git a/weapp/package/polling/polling.wxss b/weapp/package/polling/polling.wxss index 499c174..5df3410 100644 --- a/weapp/package/polling/polling.wxss +++ b/weapp/package/polling/polling.wxss @@ -30,4 +30,42 @@ .active { color: #1979ff; position: relative; +} + +.contentBox { + padding: 210rpx 30rpx 20rpx; +} + +.listBox { + background-color: #fff; + border-radius: 10rpx; + box-shadow: 0rpx 0rpx 10rpx #ddd; + margin: 30rpx auto; + overflow: hidden; +} + +.titleBox { + overflow: hidden; + padding-bottom: 20rpx; + padding-top: 40rpx; +} + +.title { + float: left; + font-size: 32rpx; + width: 460rpx; + font-weight: bold; +} + +.btn { + width: 130rpx; + text-align: center; + font-size: 30rpx; + padding: 20rpx; + background: #1979ff; + color: #fff; + border-radius: 10rpx; + float: left; + margin-left: 30rpx; + margin-top: 20rpx; } \ No newline at end of file diff --git a/weapp/package/startInspection/startInspection.js b/weapp/package/startInspection/startInspection.js new file mode 100644 index 0000000..f42f352 --- /dev/null +++ b/weapp/package/startInspection/startInspection.js @@ -0,0 +1,138 @@ +// package/startInspection/startInspection.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + dataList: [1, 2, 3] + }, + + handleChangeTwo(e) { + this.setData({ + changeTwo: e.detail.value + }) + }, + + handleChangeThree(e) { + this.setData({ + changeThree: e.detail.value + }) + }, + + showModal() { + this.setData({ + showModal: true + }) + }, + + bindCancel() { + this.setData({ + showModal: false + }) + }, + + selfLocation() { + const self = this + wx.showLoading({ + title: '定位中', + mask: true, + }); + wx.getLocation({ + type: 'gcj02', + success: (res) => { + let latitude, longitude; + latitude = res.latitude.toString(); + longitude = res.longitude.toString(); + this.latitude = res.latitude + this.longitude = res.longitude + getGeocoder({ lat: latitude, long: longitude }).then(res => { // 获取详细信息的接口 + const data = res.data; + self.userAddress.userAddressdetail = '' + var params = { + text: data.address + } + parseAddress(params).then(res => { // 粘贴详细信息的接口 + console.log(res) + if (res.status == 200 && res.message == "success") { + this.$forceUpdate(); // 定位后,界面没有反应,因此加上强制刷新 + this.userAddress.userAddressdetail = res.data.town + res.data.detail; + this.$set(this.userAddress, 'selectAddress', parseInt(res.data.county_info.city_id)); + this.addressInfo[0] = res.data.province_info ? res.data.province_info : {}; + this.addressInfo[1] = res.data.city_info ? res.data.city_info : {}; + this.addressInfo[2] = res.data.county_info ? res.data.county_info : {}; + } + }).catch(res => { + console.log("没有地址信息") + }) + wx.hideLoading(); + }) + }, + fail: (res) => { + console.log(res) + wx.hideLoading(); + wx.showToast({ + title: res.errMsg, + icon: 'none', + duration: 1000 + }); + } + }); + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/weapp/package/startInspection/startInspection.json b/weapp/package/startInspection/startInspection.json new file mode 100644 index 0000000..40e7348 --- /dev/null +++ b/weapp/package/startInspection/startInspection.json @@ -0,0 +1,6 @@ +{ + "navigationBarBackgroundColor": "#1979ff", + "navigationBarTextStyle": "white", + "navigationBarTitleText": "开始巡检", + "enablePullDownRefresh": false +} \ No newline at end of file diff --git a/weapp/package/startInspection/startInspection.wxml b/weapp/package/startInspection/startInspection.wxml new file mode 100644 index 0000000..e71c9f8 --- /dev/null +++ b/weapp/package/startInspection/startInspection.wxml @@ -0,0 +1,87 @@ + + + 巡检要求 + + 结构物名称 + 结构物名称 + + + 开始时间 + 2022-12-25 + + + 结束时间 + 2023-01-15 + + + 巡检方式 + 周期巡检 + + + 巡检频次 + 3天一次 + + + 巡检人 + 巡检人 + + + 巡检单位 + 巡检单位 + + + 巡检点位 + 点位A、点位B、点位C + + + 巡检结果录入 + + + + 巡检点位 + 点位A + 开始巡检 + + + 上次巡检日期 + 2022-10-26 + + + 巡检人 + 巡检人A + + + 本次巡检日期 + 2022-12-23 + + + + + + + + 当前点位: + 点位A + + + 当前位置: + 点位A + + + 正常 + 异常 + + + + 轻微 + 中度 + 严重 + + + 取消 + 提交 + + + + + \ No newline at end of file diff --git a/weapp/package/startInspection/startInspection.wxss b/weapp/package/startInspection/startInspection.wxss new file mode 100644 index 0000000..619c2ee --- /dev/null +++ b/weapp/package/startInspection/startInspection.wxss @@ -0,0 +1,85 @@ +/* package/startInspection/startInspection.wxss */ +.box { + width: 696rpx; + margin: 0 auto; + padding: 30rpx 0; +} + +.titleFirst { + font-size: 32rpx; + margin-bottom: 30rpx; +} + +.txt { + width: 100%; + overflow: hidden; + margin-bottom: 40rpx; + color: #333; + font-size: 28rpx; +} + +.line { + width: 100%; + height: 2rpx; + background: #ccc; + margin-bottom: 40rpx; +} + +.startBtn { + float: right; + padding: 10rpx 20rpx; + background: #1979ff; + color: #fff; + border-radius: 10rpx; + font-size: 26rpx; +} + +.modal { + background: rgba(0, 0, 0, 0.6); + width: 100%; + position: fixed; + top: 0; + left: 0; + z-index: 10; + height: 100%; +} + +.popBox { + position: absolute; + top: 50%; + left: 50%; + z-index: 1000; + background: #fff; + width: 95%; + margin-left: -356rpx; + margin-top: -500rpx; + padding: 20rpx 0; +} + +.btnBox { + padding: 30rpx; + overflow: hidden; + font-size: 30rpx; +} + +.cancel { + width: 180rpx; + float: left; + text-align: center; + background: #fff; + border: 2rpx solid #1979ff; + border-radius: 10rpx; + padding: 12rpx 0; + color: #1979ff; +} + +.submit { + width: 180rpx; + float: right; + text-align: center; + border-radius: 10rpx; + padding: 12rpx 0; + background: #1979ff; + color: #fff; + border: 2rpx solid #1979ff; +} \ No newline at end of file diff --git a/weapp/pages/index/index.wxml b/weapp/pages/index/index.wxml index c584a56..13e3f48 100644 --- a/weapp/pages/index/index.wxml +++ b/weapp/pages/index/index.wxml @@ -8,7 +8,7 @@ - + diff --git a/weapp/project.private.config.json b/weapp/project.private.config.json index 9e505b5..dabc5aa 100644 --- a/weapp/project.private.config.json +++ b/weapp/project.private.config.json @@ -5,32 +5,6 @@ "compileHotReLoad": false, "urlCheck": false }, - "condition": { - "miniprogram": { - "list": [ - { - "name": "", - "pathName": "pages/login/login", - "query": "", - "launchMode": "default", - "scene": null - }, - { - "name": "", - "pathName": "package/polling/polling", - "query": "", - "launchMode": "default", - "scene": null - }, - { - "name": "", - "pathName": "package/basic/basic", - "query": "", - "launchMode": "default", - "scene": null - } - ] - } - }, + "condition": {}, "libVersion": "2.29.0" } \ No newline at end of file