Browse Source

增加行程上报、社会资讯详情加积分

release
lihenian 4 years ago
parent
commit
b85da02a84
  1. 2
      epdc-resident-mp-yushan/pages/toRegister/toRegister.js
  2. 45
      epdc-resident-mp-yushan/subpages/extend/pages/tripReport/tripReport.js
  3. 6
      epdc-resident-mp-yushan/subpages/extend/pages/tripReport/tripReport.wxml
  4. 4
      epdc-resident-mp-yushan/subpages/extend/pages/tripReport/tripReport.wxss

2
epdc-resident-mp-yushan/pages/toRegister/toRegister.js

@ -21,7 +21,7 @@ Page({
} }
}) })
let that = this let that = this
const versionNum = '1.2.19' const versionNum = '1.2.20'
api.getScanSwitch(versionNum).then(function (res) { api.getScanSwitch(versionNum).then(function (res) {
console.log(res.data) console.log(res.data)
let state = res.data ? res.data.scanFlag : '1' let state = res.data ? res.data.scanFlag : '1'

45
epdc-resident-mp-yushan/subpages/extend/pages/tripReport/tripReport.js

@ -148,7 +148,7 @@ Page({
onLoadOptions(e) { onLoadOptions(e) {
console.log('onLoadOptions', e.detail) console.log('onLoadOptions', e.detail)
const { value } = e.detail const { value } = e.detail
wx.showLoading({ mask: true }) wx.showLoading({ mask: true, title: "加载中..." })
this.setData({ this.setData({
pid: value[value.length - 1], pid: value[value.length - 1],
}) })
@ -156,7 +156,7 @@ Page({
}, },
onLoadComeAddress(e) { onLoadComeAddress(e) {
const { value } = e.detail const { value } = e.detail
wx.showLoading({ mask: true }) wx.showLoading({ mask: true, title: "加载中..." })
this.setData({ this.setData({
pid: value[value.length - 1], pid: value[value.length - 1],
}) })
@ -251,58 +251,57 @@ Page({
this.showToast('来到本地时间不能为空') this.showToast('来到本地时间不能为空')
return return
} }
this.setData({ // this.setData({
lock: true, // nowAddress: this.data.nowAddress.split('-'),
}) // comeFromAddress: this.data.comeFromAddress.split('-'),
this.setData({ // })
nowAddress: this.data.nowAddress.split('-'),
comeFromAddress: this.data.comeFromAddress.split('-'),
})
let params = { let params = {
name: this.data.name.trim(''), name: this.data.name.trim(''),
mobile: this.data.phone.trim(''), mobile: this.data.phone.trim(''),
idCard: this.data.card.trim(''), idCard: this.data.card.trim(''),
nowAddressCode: this.data.nowAddressValue.join(','), nowAddressCode: this.data.nowAddressValue.join(','),
nowAddressName: this.data.nowAddress.join('-'), nowAddressName: this.data.nowAddress,
nowAddressDetail: this.data.detailAddress, nowAddressDetail: this.data.detailAddress,
comeAddressCode: this.data.comeFromAddressValue.join(','), comeAddressCode: this.data.comeFromAddressValue.join(','),
comeAddressName: this.data.comeFromAddress.join('-'), comeAddressName: this.data.comeFromAddress,
comeDate: this.data.localTime, comeDate: this.data.localTime,
backDate: this.data.backTime, backDate: this.data.backTime,
note: this.data.actContent.trim(''), note: this.data.actContent.trim(''),
} }
const _this = this
wx.showModal({ wx.showModal({
title: '提示', title: '提示',
content: '是否要上报行程', content: '是否要上报行程',
success(res) { success(res) {
if (res.confirm) { if (res.confirm) {
_this.data.lock = true
wx.showLoading({
title: '提交中...'
})
saveTripInfo(params) saveTripInfo(params)
.then((res) => { .then((res) => {
if (res.code == 0 && res.msg == 'success') { if (res.code == 0 && res.msg == 'success') {
this.showToast('提交成功') _this.showToast('提交成功')
setTimeout(() => { setTimeout(() => {
this.setData({ _this.data.lock = false
lock: false,
})
wx.switchTab({ wx.switchTab({
url: '/pages/index/index', url: '/pages/index/index',
}) })
}, 1000) }, 1000)
} else { } else {
this.setData({ _this.data.lock = false
lock: false,
})
} }
}) }).catch(() => {
.catch((err) => { _this.data.lock = false
this.setData({
lock: false,
})
}) })
} else if (res.cancel) { } else if (res.cancel) {
console.log('用户点击取消') console.log('用户点击取消')
_this.data.lock = false
} }
}, },
fail() {
_this.data.lock = false
}
}) })
}, },
onInputValue(e) { onInputValue(e) {

6
epdc-resident-mp-yushan/subpages/extend/pages/tripReport/tripReport.wxml

@ -10,7 +10,7 @@
<text class="must">*</text> <text class="must">*</text>
<view class="item-label">姓名</view> <view class="item-label">姓名</view>
<view class="item-value"> <view class="item-value">
<input type="text" placeholder-class="placeholder" placeholder="请输入姓名" value="{{name}}" bindinput="onInputValue" data-code="name" maxlength='6' /> <input type="text" placeholder-class="placeholder" placeholder="请输入姓名" value="{{name}}" bindinput="onInputValue" data-code="name" maxlength='20' />
</view> </view>
</view> </view>
<view class="data-form-item"> <view class="data-form-item">
@ -95,7 +95,9 @@
</view> </view>
<view class="data-form"> <view class="data-form">
<view class="footer-item"> <view class="footer-item">
<view class="submit" bindtap="onSubmitApply">提交</view> <view class="submit" bindtap="onSubmitApply" hover-class="hover-submit-btn" hover-stay-time="150">
提交
</view>
</view> </view>
</view> </view>
</view> </view>

4
epdc-resident-mp-yushan/subpages/extend/pages/tripReport/tripReport.wxss

@ -140,6 +140,10 @@
color: #fff; color: #fff;
} }
.hover-submit-btn {
background: #ca0101;
}
/* 上传图片 start */ /* 上传图片 start */
.image-list { .image-list {
width: 100%; width: 100%;

Loading…
Cancel
Save