From b7426ce1e30b0b750d3a7b835bbc33bc869d4208 Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Thu, 28 Sep 2023 13:46:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 3 +- project.private.config.json | 16 +- .../pages/synthesis/synthesis.wxml | 2 +- .../dissatisfied/demandCheck/demandCheck.js | 51 +++--- .../dissatisfied/searchResi/searchResi.js | 1 - .../searchResult/pages/punchCard/punchCard.js | 165 ++++++++++++++++++ .../pages/punchCard/punchCard.json | 4 + .../pages/punchCard/punchCard.wxml | 46 +++++ .../pages/punchCard/punchCard.wxss | 103 +++++++++++ .../pages/searchResult/searchResult.js | 5 +- 10 files changed, 359 insertions(+), 37 deletions(-) create mode 100644 subpages/searchResult/pages/punchCard/punchCard.js create mode 100644 subpages/searchResult/pages/punchCard/punchCard.json create mode 100644 subpages/searchResult/pages/punchCard/punchCard.wxml create mode 100644 subpages/searchResult/pages/punchCard/punchCard.wxss diff --git a/app.json b/app.json index 8f4b521..a4c3773 100644 --- a/app.json +++ b/app.json @@ -23,7 +23,8 @@ "name": "searchResult", "pages": [ "pages/searchResult/searchResult", - "pages/searchRecords/searchRecords" + "pages/searchRecords/searchRecords", + "pages/punchCard/punchCard" ] }, { diff --git a/project.private.config.json b/project.private.config.json index 5ca9880..49283cd 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -3,11 +3,18 @@ "projectname": "epmet-work-minniprogram", "setting": { "compileHotReLoad": false, - "urlCheck": false + "urlCheck": true }, "condition": { "miniprogram": { "list": [ + { + "name": "查询结果", + "pathName": "subpages/searchResult/pages/searchResult/searchResult", + "query": "type=resi&keyWord=张三", + "launchMode": "default", + "scene": null + }, { "name": "设置", "pathName": "subpages/settings/pages/index/index", @@ -29,13 +36,6 @@ "launchMode": "default", "scene": null }, - { - "name": "查询结果", - "pathName": "subpages/searchResult/pages/searchResult/searchResult", - "query": "type=resi&keyWord=马", - "launchMode": "default", - "scene": null - }, { "name": "回访记录详情", "pathName": "subpages/communitySelfInsp/pages/followUpDetail/followUpDetail", diff --git a/subpages/communitySelfInsp/pages/synthesis/synthesis.wxml b/subpages/communitySelfInsp/pages/synthesis/synthesis.wxml index e02650c..6502d38 100644 --- a/subpages/communitySelfInsp/pages/synthesis/synthesis.wxml +++ b/subpages/communitySelfInsp/pages/synthesis/synthesis.wxml @@ -14,7 +14,7 @@ - + 提交人数 {{personQty}} diff --git a/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js b/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js index 85e16f1..b66518d 100644 --- a/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js +++ b/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js @@ -85,9 +85,10 @@ Page({ this.data.qqMapWX = new QQMapWX({ key: 'CMJBZ-4DECI-JXGGN-5B4WU-QLV2H-B5BEJ' }) - this.getLocation().then(() => { - this.reverseLocation() - }) + // this.getLocation().then(() => { + // }) + this.reverseLocation() + this.setData({ 'fmData.time': Date.now(), angencyId:app.globalData.user.agencyId, @@ -141,7 +142,7 @@ Page({ }, //跳转地图选点 toughGetLocation() { - this.getLocation(false); + // this.getLocation(false); wx.chooseLocation({ success: res => { console.log('resadddres', res) @@ -169,27 +170,27 @@ Page({ } }) }, - // 获取经纬度 - getLocation() { - return new Promise((resolve, reject) => { - const _this = this - wx.getLocation({ - type: 'gcj02', - success(res) { - if (res.latitude && res.longitude) { - _this.setData({ - 'personalInfo.issueLatitude': res.latitude, - 'personalInfo.issueLongitude': res.longitude - }) - resolve(true) - } - }, - fail(err) { - reject(err) - } - }) - }) - }, + // // 获取经纬度 + // getLocation() { + // return new Promise((resolve, reject) => { + // const _this = this + // wx.getLocation({ + // type: 'gcj02', + // success(res) { + // if (res.latitude && res.longitude) { + // _this.setData({ + // 'personalInfo.issueLatitude': res.latitude, + // 'personalInfo.issueLongitude': res.longitude + // }) + // resolve(true) + // } + // }, + // fail(err) { + // reject(err) + // } + // }) + // }) + // }, // 提交按钮 diff --git a/subpages/demandCheck/pages/dissatisfied/searchResi/searchResi.js b/subpages/demandCheck/pages/dissatisfied/searchResi/searchResi.js index d686971..b99bce5 100644 --- a/subpages/demandCheck/pages/dissatisfied/searchResi/searchResi.js +++ b/subpages/demandCheck/pages/dissatisfied/searchResi/searchResi.js @@ -284,7 +284,6 @@ Page({ }) }, toDemandCheck(){ - console.log(111); // wx.navigateTo({ // url: '/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck?resiId=' + this.data.resiId + '&mobile=' + this.data.resiMobile + "&resiName=" + this.data.resiName, // }) diff --git a/subpages/searchResult/pages/punchCard/punchCard.js b/subpages/searchResult/pages/punchCard/punchCard.js new file mode 100644 index 0000000..a3f525c --- /dev/null +++ b/subpages/searchResult/pages/punchCard/punchCard.js @@ -0,0 +1,165 @@ +// subpages/searchResult/pages/punchCard/punchCard.js +import api from "../../../../utils/api" +const QQMapWX = require('../../../../utils/qqmap-wx-jssdk') + +var timerId= null; +Page({ + + /** + * 页面的初始数据 + */ + data: { + form:{ + name:"", + birthday:"", + mobile:"", + gridName:"", + homeName:"", + genderName:"", + }, + resiId:"", + punchFlag:null, + currentTime:'' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + console.log(options); + this.updateTime(); + timerId = setInterval(this.updateTime, 1000); + console.log(timerId); + if(options.resiId){ + this.setData({ + resiId:options.resiId + }) + console.log(this.data.resiId); + this.getResiDetail() + } + this.data.qqMapWX = new QQMapWX({ + key: 'CMJBZ-4DECI-JXGGN-5B4WU-QLV2H-B5BEJ' + }) + this.reverseLocation() + }, + updateTime() { + let date = new Date(); + let hours = date.getHours().toString().padStart(2, '0'); + let minutes = date.getMinutes().toString().padStart(2, '0'); + let seconds = date.getSeconds().toString().padStart(2, '0'); + this.setData({ + currentTime: `${hours}:${minutes}:${seconds}` + }); + }, + getResiDetail: async function() { + try { + let res = await api.getResiDetail(this.data.resiId); + const {birthday,mobile,name,houseInfo,genderName} = res.data; + this.setData({ + 'form.name':name, + 'form.birthday':birthday, + 'form.mobile':mobile, + 'form.gridName' :houseInfo.gridName, + 'form.homeName' :houseInfo.homeName, + 'form.genderName' :genderName, + }); + console.log(this.data.form); + } catch(err) { + console.log(err); + } + }, + handlePunch(){ + this.setData({ + punchFlag:!this.data.punchFlag, + animationClass:'animate' + }) + console.log(this.data.animationClass); + setTimeout(() => { + this.setData({ animationClass: '' }); + }, 1500); + }, + toAddResi(){ + wx.navigateTo({ + url: `/subpages/addResi/pages/addResi/addResi?type=edit&resiId=${this.data.resiId}`, + }) + }, + toEvent(){ + let obj ={ + resiId : this.data.resiId, + resiMobile : this.data.form.mobile, + resiName:this.data.form.name + } + wx.setStorageSync('resiDetail',obj) + wx.navigateTo({ + url: '/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck', + }) + }, + reverseLocation() { + const _this = this + this.data.qqMapWX.reverseGeocoder({ + success(res) { + console.log(res); + _this.setData({ + addressContent:res.result.address, + // 'fmData.address': res.result.address, + // 'fmData.longitude':res.result.location.lng, + // 'fmData.latitude':res.result.location.lat, + }) + }, + fail(err) { + console.debug(err) + } + }) + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + if (timerId) { + clearInterval(timerId); + timerId = null; + } + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/subpages/searchResult/pages/punchCard/punchCard.json b/subpages/searchResult/pages/punchCard/punchCard.json new file mode 100644 index 0000000..aa6e978 --- /dev/null +++ b/subpages/searchResult/pages/punchCard/punchCard.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "详情" +} \ No newline at end of file diff --git a/subpages/searchResult/pages/punchCard/punchCard.wxml b/subpages/searchResult/pages/punchCard/punchCard.wxml new file mode 100644 index 0000000..18c8eac --- /dev/null +++ b/subpages/searchResult/pages/punchCard/punchCard.wxml @@ -0,0 +1,46 @@ + + + + 基础信息 + + + 姓名: + {{form.name}} + + + 性别: + {{form.genderName}} + + + 出生日期: + {{form.birthday}} + + + 住宅: + {{form.homeName}} + + + 电话: + {{form.mobile}} + + + + + + + + + 走访打卡 + + {{!punchFlag ? '开始打卡' : '更新打卡'}} + {{currentTime}} + + 当前位置:{{addressContent}} + + + + 相关操作 + 修改居民信息 + 满意度调查 + 上报居民诉求 + \ No newline at end of file diff --git a/subpages/searchResult/pages/punchCard/punchCard.wxss b/subpages/searchResult/pages/punchCard/punchCard.wxss new file mode 100644 index 0000000..2979958 --- /dev/null +++ b/subpages/searchResult/pages/punchCard/punchCard.wxss @@ -0,0 +1,103 @@ +/* subpages/searchResult/pages/punchCard/punchCard.wxss */ +/**index.wxss**/ +page { + width: 100%; + min-height: 100vh; + overflow: hidden; + overflow-y: scroll; + background-color: #f7f7f7; + padding: 0 20rpx; + box-sizing: border-box; + } +.card{ + background-color: #fff; + border-radius: 20rpx; + display: flex; + flex-direction: column; + min-height: 400rpx; + margin-top: 20rpx; + padding: 30rpx; +} + +.card .title{ + position: relative; +} +.card .title::after{ + position: absolute; + left: -30rpx; + top: 8rpx; + content: " "; + width: 10rpx; + height: 28rpx; + background-color: #3A80E7; +} +.info{ + margin-top: 40rpx; +} +.info .item{ + display: flex; + margin-top: 20rpx; +} +.info .item .label{ + width: fit-content; +} +.punch{ + width: 260rpx; + height: 260rpx; + background: linear-gradient(180deg,#5E9FFF, #3A80E7); + box-shadow: 0rpx 4rpx 35rpx 0rpx rgba(61,139,248,0.48); + color: #fff; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + border-radius: 50%; + margin: 0 auto; +} + +.address{ + color: #666666; + font-size: 28rpx; + margin: 0 auto; + margin-top: 40rpx; +} + +@keyframes rotateAnimation { + 0% { + transform: rotateY(0deg); + } + 100% { + transform: rotateY(180deg); + } + } + +.animate { + animation: rotateAnimation 2s forwards; + } + .btn{ + padding: 0 85rpx; + box-sizing: border-box; + min-width: 364rpx; + text-align: center; + height: 76rpx; + border-radius: 38rpx; + margin: 30rpx auto 0; + line-height: 76rpx; + border-radius: 76rpx; + } + + .blue{ + color:#3A80E7 ; + border: 2rpx solid #3A80E7; + + } + .yellow{ + color: #FF783C; + border: 2rpx solid #FF783C; + } + .green{ + color: #13C8BD; + border: 2rpx solid #13C8BD; + } + + \ No newline at end of file diff --git a/subpages/searchResult/pages/searchResult/searchResult.js b/subpages/searchResult/pages/searchResult/searchResult.js index 1a2119b..a81932d 100644 --- a/subpages/searchResult/pages/searchResult/searchResult.js +++ b/subpages/searchResult/pages/searchResult/searchResult.js @@ -150,11 +150,14 @@ Page({ }) } }, + // handelClickedit(e){ if(this.data.type == 'resi'){ + wx.navigateTo({ - url: `/subpages/addResi/pages/addResi/addResi?type=edit&resiId=${e.currentTarget.dataset.item.resiId}`, + url: `/subpages/searchResult/pages/punchCard/punchCard?resiId=${e.currentTarget.dataset.item.resiId}`, }) + }else{ wx.navigateTo({ url: `/subpages/addhouse/pages/addhouse/addhouse?type=edit&houseId=${e.currentTarget.dataset.item.id}`,