From b9f3c70eda8ccec8bed04a49bd2fc721c6df7956 Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Thu, 12 Oct 2023 16:34:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 3 +- .../dissatisfied/demandCheck/demandCheck.js | 1 - .../searchResult/pages/punchCard/punchCard.js | 35 ++++++++++++++----- .../pages/punchCard/punchCard.wxss | 9 ++--- utils/api.js | 9 +++-- 5 files changed, 41 insertions(+), 16 deletions(-) diff --git a/app.js b/app.js index fb4fb95..8ac0a31 100644 --- a/app.js +++ b/app.js @@ -30,6 +30,7 @@ App({ navigationHeight: 40 }, user:{}, - share:false + share:false, + questionnaireUrl:'' } }) diff --git a/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js b/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js index 66ace68..3c20b44 100644 --- a/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js +++ b/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js @@ -950,7 +950,6 @@ Page({ url: tempFilePath, duration }) - // }); recorderManager.onFrameRecorded(res => { console.log('onFrameRecorded', res) diff --git a/subpages/searchResult/pages/punchCard/punchCard.js b/subpages/searchResult/pages/punchCard/punchCard.js index 0208fe2..1a94642 100644 --- a/subpages/searchResult/pages/punchCard/punchCard.js +++ b/subpages/searchResult/pages/punchCard/punchCard.js @@ -19,7 +19,10 @@ Page({ }, resiId:"", punchFlag:null, - currentTime:'' + currentTime:'', + address:'', + longitude:'', + latitude:'', }, /** @@ -75,12 +78,28 @@ Page({ }) setTimeout(() => { this.setData({ animationClass: '' }); - wx.showToast({ - title: '打卡成功', - icon:'none' - }) + this.clockRecords() + }, 1500); }, + clockRecords(){ + let currentDate = new Date().toISOString().split('T')[0]; // 会得到形如 "2023-09-27" 的日期 + let obj = { + resiId:this.data.resiId, + clockTime: currentDate + " " + this.data.currentTime, + clockAddress: this.data.address, + longitude:this.data.longitude , + latitude:this.data.latitude + } + api.clockRecords(obj).then(res=>{ + wx.showToast({ + title: this.data.punchFlag?'打卡成功':'更新成功', + icon:'none' + }) + }).catch(err=>{ + console.log(err); + }) + }, toAddResi(){ wx.navigateTo({ url: `/subpages/addResi/pages/addResi/addResi?type=edit&resiId=${this.data.resiId}`, @@ -110,9 +129,9 @@ Page({ 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, + address: res.result.address, + longitude:res.result.location.lng, + latitude:res.result.location.lat, }) }, fail(err) { diff --git a/subpages/searchResult/pages/punchCard/punchCard.wxss b/subpages/searchResult/pages/punchCard/punchCard.wxss index e5783ca..2117003 100644 --- a/subpages/searchResult/pages/punchCard/punchCard.wxss +++ b/subpages/searchResult/pages/punchCard/punchCard.wxss @@ -16,7 +16,7 @@ page { flex-direction: column; min-height: 350rpx; margin-top: 20rpx; - padding: 30rpx; + padding: 30rpx 30rpx 40rpx; } .card .title{ @@ -33,10 +33,11 @@ page { background-color: #3A80E7; } .info{ - margin-top: 38rpx; + margin-top: 6rpx; } .info .item{ display: flex; + margin-top: 28rpx; } .info .item .label{ width: fit-content; @@ -52,14 +53,14 @@ page { justify-content: center; align-items: center; border-radius: 50%; - margin: 38rpx auto; + margin: 50rpx auto 0; } .address{ color: #666666; font-size: 28rpx ; margin: 0 auto; - margin-top: 40rpx; + margin: 40rpx auto 30rpx; } @keyframes rotateAnimation { diff --git a/utils/api.js b/utils/api.js index 2841631..c139c6e 100644 --- a/utils/api.js +++ b/utils/api.js @@ -40,7 +40,8 @@ module.exports = { getResidentBaseInfoPage, getDemandoption, addMeasure, - getFollowUpDetail + getFollowUpDetail, + clockRecords } // 消息列表 function getIntelligentMessage(param){ @@ -187,7 +188,7 @@ function followUpDelete (parm) { function getAgencygridtree () { return fly.post(`gov/org/customeragency/agencygridtree`,) } -// 上报诉求 +// 上报事件 function addEvent (parm) { return fly.post(`governance/icEvent/add-event-resi`,parm) } @@ -207,3 +208,7 @@ function addMeasure(parm) { function getFollowUpDetail(id) { return fly.get(`governance/satisfaction/communitySelfInsp/followUp/detail/${id}`) } +// 打卡 +function clockRecords(parm) { + return fly.post(`actual/base/clockRecords/save`,parm) +}