Browse Source

接口联调

jw-featrue-zhanlibiao
mk 2 years ago
parent
commit
b9f3c70eda
  1. 3
      app.js
  2. 1
      subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js
  3. 35
      subpages/searchResult/pages/punchCard/punchCard.js
  4. 9
      subpages/searchResult/pages/punchCard/punchCard.wxss
  5. 9
      utils/api.js

3
app.js

@ -30,6 +30,7 @@ App({
navigationHeight: 40 navigationHeight: 40
}, },
user:{}, user:{},
share:false share:false,
questionnaireUrl:''
} }
}) })

1
subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js

@ -950,7 +950,6 @@ Page({
url: tempFilePath, url: tempFilePath,
duration duration
}) })
//
}); });
recorderManager.onFrameRecorded(res => { recorderManager.onFrameRecorded(res => {
console.log('onFrameRecorded', res) console.log('onFrameRecorded', res)

35
subpages/searchResult/pages/punchCard/punchCard.js

@ -19,7 +19,10 @@ Page({
}, },
resiId:"", resiId:"",
punchFlag:null, punchFlag:null,
currentTime:'' currentTime:'',
address:'',
longitude:'',
latitude:'',
}, },
/** /**
@ -75,12 +78,28 @@ Page({
}) })
setTimeout(() => { setTimeout(() => {
this.setData({ animationClass: '' }); this.setData({ animationClass: '' });
wx.showToast({ this.clockRecords()
title: '打卡成功',
icon:'none'
})
}, 1500); }, 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(){ toAddResi(){
wx.navigateTo({ wx.navigateTo({
url: `/subpages/addResi/pages/addResi/addResi?type=edit&resiId=${this.data.resiId}`, url: `/subpages/addResi/pages/addResi/addResi?type=edit&resiId=${this.data.resiId}`,
@ -110,9 +129,9 @@ Page({
console.log(res); console.log(res);
_this.setData({ _this.setData({
addressContent:res.result.address, addressContent:res.result.address,
// 'fmData.address': res.result.address, address: res.result.address,
// 'fmData.longitude':res.result.location.lng, longitude:res.result.location.lng,
// 'fmData.latitude':res.result.location.lat, latitude:res.result.location.lat,
}) })
}, },
fail(err) { fail(err) {

9
subpages/searchResult/pages/punchCard/punchCard.wxss

@ -16,7 +16,7 @@ page {
flex-direction: column; flex-direction: column;
min-height: 350rpx; min-height: 350rpx;
margin-top: 20rpx; margin-top: 20rpx;
padding: 30rpx; padding: 30rpx 30rpx 40rpx;
} }
.card .title{ .card .title{
@ -33,10 +33,11 @@ page {
background-color: #3A80E7; background-color: #3A80E7;
} }
.info{ .info{
margin-top: 38rpx; margin-top: 6rpx;
} }
.info .item{ .info .item{
display: flex; display: flex;
margin-top: 28rpx;
} }
.info .item .label{ .info .item .label{
width: fit-content; width: fit-content;
@ -52,14 +53,14 @@ page {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
border-radius: 50%; border-radius: 50%;
margin: 38rpx auto; margin: 50rpx auto 0;
} }
.address{ .address{
color: #666666; color: #666666;
font-size: 28rpx ; font-size: 28rpx ;
margin: 0 auto; margin: 0 auto;
margin-top: 40rpx; margin: 40rpx auto 30rpx;
} }
@keyframes rotateAnimation { @keyframes rotateAnimation {

9
utils/api.js

@ -40,7 +40,8 @@ module.exports = {
getResidentBaseInfoPage, getResidentBaseInfoPage,
getDemandoption, getDemandoption,
addMeasure, addMeasure,
getFollowUpDetail getFollowUpDetail,
clockRecords
} }
// 消息列表 // 消息列表
function getIntelligentMessage(param){ function getIntelligentMessage(param){
@ -187,7 +188,7 @@ function followUpDelete (parm) {
function getAgencygridtree () { function getAgencygridtree () {
return fly.post(`gov/org/customeragency/agencygridtree`,) return fly.post(`gov/org/customeragency/agencygridtree`,)
} }
// 上报诉求 // 上报事件
function addEvent (parm) { function addEvent (parm) {
return fly.post(`governance/icEvent/add-event-resi`,parm) return fly.post(`governance/icEvent/add-event-resi`,parm)
} }
@ -207,3 +208,7 @@ function addMeasure(parm) {
function getFollowUpDetail(id) { function getFollowUpDetail(id) {
return fly.get(`governance/satisfaction/communitySelfInsp/followUp/detail/${id}`) return fly.get(`governance/satisfaction/communitySelfInsp/followUp/detail/${id}`)
} }
// 打卡
function clockRecords(parm) {
return fly.post(`actual/base/clockRecords/save`,parm)
}

Loading…
Cancel
Save