Browse Source

注册已完成,编辑修改个人信息开始开发

shibei
mk 2 years ago
parent
commit
cf3d6b3883
  1. BIN
      miniprogram/images/home/Associatio.png
  2. BIN
      miniprogram/images/home/add-issue.png
  3. BIN
      miniprogram/images/home/appramise.png
  4. BIN
      miniprogram/images/home/banshizhinan.png
  5. BIN
      miniprogram/images/home/chuangC.png
  6. BIN
      miniprogram/images/home/consult.png
  7. BIN
      miniprogram/images/home/dang_logo.png
  8. BIN
      miniprogram/images/home/down.png
  9. BIN
      miniprogram/images/home/dyfc.png
  10. BIN
      miniprogram/images/home/empty.png
  11. BIN
      miniprogram/images/home/happy.png
  12. BIN
      miniprogram/images/home/home-grid-bg.png
  13. BIN
      miniprogram/images/home/home-status.png
  14. BIN
      miniprogram/images/home/ic_dang.png
  15. BIN
      miniprogram/images/home/ic_tongzhixiaoxi.png
  16. BIN
      miniprogram/images/home/info-note.png
  17. BIN
      miniprogram/images/home/new-progress.png
  18. BIN
      miniprogram/images/home/notice-logo.png
  19. BIN
      miniprogram/images/home/notice.png
  20. BIN
      miniprogram/images/home/party-masses.png
  21. BIN
      miniprogram/images/home/partyElegant.png
  22. BIN
      miniprogram/images/home/partyhistory.png
  23. BIN
      miniprogram/images/home/project-close.png
  24. BIN
      miniprogram/images/home/project-end.png
  25. BIN
      miniprogram/images/home/project-handle.png
  26. BIN
      miniprogram/images/home/right-sword.png
  27. BIN
      miniprogram/images/home/signin.png
  28. BIN
      miniprogram/images/home/signined.png
  29. BIN
      miniprogram/images/home/suishibao.png
  30. BIN
      miniprogram/images/home/suishijiang.png
  31. BIN
      miniprogram/images/home/talents.png
  32. BIN
      miniprogram/images/home/up.png
  33. BIN
      miniprogram/images/home/wenjuandiaocha.png
  34. BIN
      miniprogram/images/home/wodexiaoxi.png
  35. BIN
      miniprogram/images/home/xingchengshangbao.png
  36. BIN
      miniprogram/images/home/xuqiuqingdan.png
  37. 558
      miniprogram/pages/formid/formid.js
  38. 4
      miniprogram/pages/formid/formid.json
  39. 152
      miniprogram/pages/formid/formid.wxml
  40. 74
      miniprogram/pages/formid/formid.wxss
  41. 4
      miniprogram/pages/my/my.wxml
  42. 2
      miniprogram/project.private.config.json
  43. 30
      miniprogram/subpages/checkIn/pages/checkIn/register/register.js
  44. 15
      miniprogram/subpages/checkIn/pages/checkIn/register/register.wxml
  45. 4
      miniprogram/subpages/knight/pages/knight/knight.wxml
  46. 41
      miniprogram/subpages/knight/pages/knight/observeResi/observeResi.js
  47. 10
      miniprogram/subpages/knight/pages/knight/observeResi/observeResi.wxml
  48. 2
      miniprogram/subpages/redGrider/pages/redGrider/redGrider.wxml
  49. 14
      miniprogram/utils/api.js
  50. 1123
      miniprogram/utils/qqmap-wx-jssdk.js
  51. 115
      miniprogram/utils/wgs84_to_gcj02.js

BIN
miniprogram/images/home/Associatio.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

BIN
miniprogram/images/home/add-issue.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

BIN
miniprogram/images/home/appramise.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

BIN
miniprogram/images/home/banshizhinan.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

BIN
miniprogram/images/home/chuangC.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

BIN
miniprogram/images/home/consult.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

BIN
miniprogram/images/home/dang_logo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 997 B

BIN
miniprogram/images/home/down.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

BIN
miniprogram/images/home/dyfc.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

BIN
miniprogram/images/home/empty.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

BIN
miniprogram/images/home/happy.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

BIN
miniprogram/images/home/home-grid-bg.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

BIN
miniprogram/images/home/home-status.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

BIN
miniprogram/images/home/ic_dang.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

BIN
miniprogram/images/home/ic_tongzhixiaoxi.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 858 B

BIN
miniprogram/images/home/info-note.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

BIN
miniprogram/images/home/new-progress.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

BIN
miniprogram/images/home/notice-logo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 877 B

BIN
miniprogram/images/home/notice.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

BIN
miniprogram/images/home/party-masses.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

BIN
miniprogram/images/home/partyElegant.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

BIN
miniprogram/images/home/partyhistory.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

BIN
miniprogram/images/home/project-close.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

BIN
miniprogram/images/home/project-end.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

BIN
miniprogram/images/home/project-handle.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

BIN
miniprogram/images/home/right-sword.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 428 B

BIN
miniprogram/images/home/signin.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

BIN
miniprogram/images/home/signined.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

BIN
miniprogram/images/home/suishibao.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

BIN
miniprogram/images/home/suishijiang.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

BIN
miniprogram/images/home/talents.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

BIN
miniprogram/images/home/up.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

BIN
miniprogram/images/home/wenjuandiaocha.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

BIN
miniprogram/images/home/wodexiaoxi.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

BIN
miniprogram/images/home/xingchengshangbao.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

BIN
miniprogram/images/home/xuqiuqingdan.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

558
miniprogram/pages/formid/formid.js

@ -1,125 +1,453 @@
var api = require('../../utils/api.js')
var global = require('../../utils/config.js')
import regeneratorRuntime from '../../utils/runtime.js'
const QQMapWX = require('../../utils/qqmap-wx-jssdk')
import {
gcj02_to_wgs84
} from "../../utils/wgs84_to_gcj02";
const app = getApp()
Page({
data: {
gridId: '',
gridName: '',
gridNameArr: [],
formid: '',
resToken: '',
resGridName: '',
inviteUserId: '',
GridNameId:""
},
onLoad(options) {
if (options.gid) {
this.setData({
gridId:'1221751857028825090',
inviteUserId: options.inviteUserId
})
}
this.getToken(options.gid)
// this.getInvitation()
},
// getInvitation(){
// let that = this
// api.getInvitation(this.data.gridId).then(function (res) {
// that.setData({
// GridNameId:res.data
// })
// that.getGridName()
// })
// },
getToken: function (gid) {
let that = this
wx.login({
success(res) {
if (res.code) {
console.log('微信CODE: ' + res.code)
let wxCode = res.code
const para = {
inviteUserId: that.data.inviteUserId,
//写死四机社区第一网格
gridId: '1224104693058306049',
wxCode: res.code
}
api.getTokenV3(para).then(function (res) {
global.Token = res.data.token
wx.removeStorageSync('token')
wx.setStorageSync('token', res.data.token)
that.setData({
resToken: res.data.token,
resGridName: res.data.grid
data: {
gridId: '',
gridName: '',
gridNameArr: [],
formid: '',
resToken: '',
resGridName: '',
inviteUserId: '',
GridNameId: "",
qqMapWX: '',
form: {
},
streetList: [],
addressContent: '',
address: '',
form: {
name: '',
idCard: '',
mobile: '',
homeName: '',//居住小区名称
workUnit: '',//工作单位
workType: '',//单位性质
workIndustry: '',//所属行业
party: 1,//是否为党员
allDeptIds: [],//社区id
shibei:'1',//是否居住在市北
},
selectedStatus:false,
selectOption: [
{ label: '党政机关', value: '0' },
{ label: '事业单位', value: '1' },
{ label: '国有企业', value: '2' },
{ label: '私营企业', value: '3' },
{ label: '集体企业', value: '4' },
{ label: '外资企业、合资企业', value: '5' },
{ label: '社会组织', value: '6' },
{ label: '其他', value: '7' }
],
workTypeInput:false,
workTypeText:'',//单位类型为其他的输入框值
newArr:[],
multiIds:[],
multiIndex: [0, 0],
changeFlag:false,
},
onLoad(options) {
// this.data.qqMapWX = new QQMapWX({
// key: 'CMJBZ-4DECI-JXGGN-5B4WU-QLV2H-B5BEJ'
// })
// this.getLocation().then(() => {
// this.reverseLocation()
// })
this.getDeptTree()
// if (options.gid) {
// this.setData({
// gridId:'1221751857028825090',
// inviteUserId: options.inviteUserId
// })
// }
// this.getToken(options.gid)
// this.getInvitation()
},
// 获取经纬度
getLocation() {
return new Promise((resolve, reject) => {
const _this = this
wx.getLocation({
type: 'gcj02',
success(res) {
if (res.latitude && res.longitude) {
_this.setData({
'form.issueLatitude': res.latitude,
'form.issueLongitude': res.longitude
})
_this.getDeptIdByItude()
resolve(true)
}
},
fail(err) {
reject(err)
}
})
})
})
},
getDeptIdByItude() {
let transfromlnglat = gcj02_to_wgs84(this.data.form.issueLongitude, this.data.form.issueLatitude)
const para = {
longitude: transfromlnglat[0],
latitude: transfromlnglat[1]
}
}
})
},
getGridName() {
let that = this
api.getCompleteName(this.data.GridNameId).then(function (res) {
wx.setStorage({
key: "gridName",
data: res.data
})
that.setData({
gridName: res.data,
gridNameArr: res.data.split('/')
})
})
},
bindGetUserInfo: function (e) {
if (e.detail.userInfo) {
// let wxHeadImg = e.detail.userInfo.avatarUrl
// let wxNickName = e.detail.userInfo.nickName
console.log(e)
let that = this
wx.login({
success: function (response) {
let code = response.code;
wx.getUserInfo({
success: function (res) {
console.log(res.encryptedData)
console.log(res.iv)
let encryptedData = res.encryptedData
let iv = res.iv
api.updateWxInfo(code, encryptedData, iv).then(function (res) {
// 跳转到首页
console.log('跳转到首页')
wx.setStorageSync('isFirst', 'noFirst')
wx.reLaunch({
url: '/pages/index/index'
})
})
api.getDeptIdByItude(para).then(res => {
// 返回成功以后再调用 列表
this.setData({
'form.streetId': res.data && res.data.streetId ? res.data.streetId : '',
'form.communityId': res.data && res.data.communityId ? res.data.communityId : '',
'form.gridId': res.data && res.data.gridId ? res.data.gridId : '',
'form.grid': res.data && res.data.gridName ? res.data.gridName : ''
})
this.getDeptTree()
}).catch(err => {
this.getDeptTree()
console.log(err)
})
},
//获取街道树
getDeptTree() {
api.getDeptTree().then(res => {
this.setData({
streetList: res.data[0].children
})
console.log(this.data.streetList);
let state = {
arr: [],
arr1: [],
arr2: [],
// arr3: [],
multiIds: []
}
this.data.streetList.map((v, vk) => {
state.arr1.push(v.label);
if (this.data.multiIndex[0] === vk) {
state.multiIds[0] = v;
}
if (state.arr2.length <= 0) {
v.children.map((c, ck) => {
state.arr2.push(c.label);
if (this.data.multiIndex[1] === ck) {
state.multiIds[1] = c;
}
// if (state.arr3.length <= 0) {
// c.children.map((t, tk) => {
// state.arr3.push(t.label);
// if (this.data.multiIndex[2] === tk) {
// state.multiIds[2] = t;
// }
// });
// }
});
}
});
state.arr[0] = state.arr1;
state.arr[1] = state.arr2;
this.setData({
newArr: state.arr,
multiIds: state.multiIds,
});
if (this.data.form.streetId && this.data.form.communityId) {
this.data.streetList.forEach(element => {
if (element.value == this.data.form.streetId) {
this.setData({
'form.street': element.label,
communityList: element.children.filter(item=>item.label!= '武定路社区'&&item.label!= '陵县路社区') // 社区
})
// 循环社区
element.children.forEach(community => {
if (community.value == this.data.form.communityId) {
this.setData({
'form.community': community.label,
gridList: community.children,
// 'form.grid': community.children[0].label, // 网格默认选择第一个
// 'form.gridId': community.children[0].value // 网格
})
}
});
}
});
}
})
}).catch(err => {
console.log(err)
})
},
//确定选择社区
bindMultiPickerChange() {
this.setData({
'form.allDeptIds':['1175270520603930625',this.data.multiIds[0].value,this.data.multiIds[1].value,this.data.streetList.filter(item=>item.value == this.data.multiIds[0].value)[0].children.filter(item=>item.value== this.data.multiIds[1].value)[0].children[0].value],
changeFlag:true
})
console.log(this.data.streetList);
console.log(this.data.form.allDeptIds);
},
//滑动社区
bindMultiPickerColumnChange(e) {
let data = {
newArr: this.data.newArr,
multiIndex: this.data.multiIndex,
multiIds: this.data.multiIds,
};
data.multiIndex[e.detail.column] = e.detail.value;
let searchColumn = () => {
let arr1 = [];
let arr2 = [];
this.data.streetList.map((v, vk) => {
if (data.multiIndex[0] === vk) {
data.multiIds[0] = {
...v,
};
v.children.map((c, ck) => {
arr1.push(c.label);
if (data.multiIndex[1] === ck) {
data.multiIds[1] = {
...c,
};
}
});
}
});
data.newArr[1] = arr1;
data.newArr[2] = arr2;
};
switch (e.detail.column) {
case 0:
// 每次切换还原初始值
data.multiIndex[1] = 0;
// data.multiIndex[2] = 0;
// 执行函数处理
searchColumn();
break;
case 1:
// data.multiIndex[2] = 0;
searchColumn();
break;
case 2:
searchColumn();
break;
}
})
} else {
console.log('拒绝授权')
wx.redirectTo({
url: '/pages/index/index'
})
// wx.showModal({
// title: '提示',
// content: '您点击了拒绝授权,将无法进入小程序,请授权之后再进入!',
// showCancel: false,
// confirmText: '返回授权',
// success: function (res) {
// if (res.confirm) {
// console.log('用户点击了“返回授权”')
// }
// }
// })
this.setData(data);
this.setData({
newArr:this.data.newArr.splice(0,2),
changeFlag:true
})
},
reverseLocation() {
const _this = this
this.data.qqMapWX.reverseGeocoder({
location: {
latitude: _this.data.form.issueLatitude,
longitude: _this.data.form.issueLongitude
},
success(res) {
_this.setData({
addressContent: res.result.address,
address: res.result.address
// 'form.issueAddress': res.result.address,
})
},
fail(err) {
console.debug(err)
}
})
},
//姓名双向绑定
bindRealNameInput(e) {
this.setData({
'form.name': e.detail.value
})
console.log(this.data.form)
},
//身份证双向绑定
bindRealIdcardInput(e) {
this.setData({
'form.idCard': e.detail.value
})
console.log(this.data.form)
},
//工作单位
bindWorkUnitInput(e) {
this.setData({
'form.workUnit': e.detail.value
})
console.log(this.data.form)
},
//所属行业
bindWorkIndustryInput(e) {
this.setData({
'form.workIndustry': e.detail.value
})
console.log(this.data.form)
},
//手机号双向绑定
bindRealMobileInput(e) {
this.setData({
'form.mobile': e.detail.value
})
console.log(this.data.form)
},
//居住小区名称
bindHomeNameInput(e) {
this.setData({
'form.homeName': e.detail.value
})
},
//单选框
bindFlagshibeiChange(e){
this.setData({
'form.shibei': e.detail.value
})
},
handleCLickShow(e) {
this.setData({
selectedStatus: true,
})
},
pickerConfirm(e) {
console.log(e);
if(e.detail.value == '7'){
this.setData({
workTypeInput:true
})
}
this.setData({
'form.workType': e.detail.label,
selectedStatus: false
});
},
//下拉框取消
pickerCancel() {
this.setData({
selectedStatus: false
});
},
bindWorkTypeTextInput(e){
console.log(e,'cccccc');
this.setData({
workTypeText: e.detail.value
})
console.log(this.data.workTypeText);
},
//单位性质弹框确定
confirmDlaog(e){
console.log(e);
this.setData({
workTypeInput:false
})
},
//单位性质弹框取消
cancelDlaog(){
this.setData({
workTypeInput:false
})
},
getToken: function (gid) {
let that = this
wx.login({
success(res) {
if (res.code) {
console.log('微信CODE: ' + res.code)
let wxCode = res.code
const para = {
inviteUserId: that.data.inviteUserId,
//写死四机社区第一网格
gridId: '1224104693058306049',
wxCode: res.code
}
api.getTokenV3(para).then(function (res) {
global.Token = res.data.token
wx.removeStorageSync('token')
wx.setStorageSync('token', res.data.token)
that.setData({
resToken: res.data.token,
resGridName: res.data.grid
})
})
}
}
})
},
// 单选点击事件
showToast (title) {
wx.showToast({
title: title,
icon: 'none',
duration: 2000
})
},
navigateToIndex() {
if (!this.data.form.name) {
this.showToast('请输入姓名')
return false
}
if (!this.data.form.idCard) {
this.showToast('请填写身份证号')
return false
}
if(!this.data.form.workUnit){
this.showToast('请填写工作单位')
return false
}
if (!this.data.form.mobile) {
this.showToast('请填写手机号')
return false
}
if(this.data.form.shibei == '1'){
if (this.data.form.allDeptIds.length == 0) {
this.showToast('请选择报到常住社区名称')
return false
}
if (!this.data.form.homeName) {
this.showToast('请填写居住小区名称')
return false
}
}else if(this.data.form.shibei == '0'){
if (this.data.form.allDeptIds.length == 0) {
this.showToast('请填写单位报到联系社区名称')
return false
}
}
const para = {
...this.data.form
}
if(this.data.workTypeText){
para.workType = this.data.workTypeText
}
para.party = parseInt(para.party)
console.log(para);
// wx.showLoading({
// title: "提交中..."
// })
let than = this
// api.submitReportparty(para).then(res => {
// wx.hideLoading()
// if(res.code == '0'){
// than.setData({
// submitStatus:true
// })
// }else{
// than.showToast(res.msg)
// }
// }).catch(err => {
// wx.hideLoading()
// console.log(err);
// })
wx.reLaunch({
url: '/pages/home/home'
})
console.log(this.data.form);
}
},
navigateToIndex () {
wx.reLaunch({
url: '/pages/home/home'
})
}
})
})

4
miniprogram/pages/formid/formid.json

@ -1,4 +1,6 @@
{
"navigationBarTitleText": "注册",
"usingComponents": {}
"usingComponents": {
"wux-picker": "../../dist/picker/index"
}
}

152
miniprogram/pages/formid/formid.wxml

@ -1,17 +1,145 @@
<view class="container">
<view class="card">
<image class="bgimg" src="../../images/ig_woyaozhuce.png" mode="widthFix"/>
<view class="context2">
<view class="context-title">欢迎使用北尚先锋</view>
<view class="context-name">
<!-- <view wx:for="{{gridNameArr}}" wx:key="thiskey" wx:for-index="idx" wx:for-item="item">
{{item}}
</view> -->
</view>
 </view>
</view>
<view class="basic-info">
<view class="list-item ">
<view class="left">
<text class="must">*</text>
<view class="title">姓名</view>
</view>
<view class="right">
<input confirm-type="next" bindblur="bindRealNameInput" bindinput="bindRealNameInput" value="{{form.name}}" placeholder-class="placeholder-style" placeholder="请输入" />
</view>
</view>
<view class="list-item gray ">
<view class="left">
<text class="must">*</text>
<view class="title">身份证号</view>
</view>
<view class="right">
<input confirm-type="next" bindblur="bindRealIdcardInput" bindinput="bindRealIdcardInput" value="{{form.idCard}}" placeholder-class="placeholder-style" placeholder="请输入" />
</view>
</view>
<view class="list-item ">
<view class="left">
<text class="must">*</text>
<view class="title">手机号码</view>
</view>
<view class="right">
<input confirm-type="next" bindblur="bindRealMobileInput" bindinput="bindRealMobileInput" value="{{form.mobile}}" placeholder-class="placeholder-style" placeholder="请输入" />
</view>
</view>
<view class="list-item gray">
<view class="left">
<text class="must">*</text>
<view class="title">工作单位</view>
</view>
<view class="right">
<input confirm-type="next" bindblur="bindWorkUnitInput" bindinput="bindWorkUnitInput" value="{{form.workUnit}}" placeholder-class="placeholder-style" placeholder="请输入" />
</view>
</view>
<view class="list-item ">
<view class="left">
<!-- <text class="must">*</text> -->
<view class="title">单位性质</view>
</view>
<view class="right" bind:tap="handleCLickShow">
<view class="{{form.workType?'':' gray-font'}}" >{{form.workType?form.workType:'请选择'}}</view>
</view>
</view>
<view class="list-item" wx:if="{{form.workType == '其他'}}">
<view class="left">
<!-- <text class="must">*</text> -->
<view class="title">单位性质(其他)</view>
</view>
<view class="right" >
<input confirm-type="next" bindblur="bindWorkTypeTextInput" bindinput="bindWorkTypeTextInput" value="{{workTypeText}}" placeholder-class="placeholder-style" placeholder="请输入" />
</view>
</view>
<view class="list-item gray">
<view class="left">
<!-- <text class="must">*</text> -->
<view class="title">所属行业</view>
</view>
<view class="right">
<input confirm-type="next" bindblur="bindWorkIndustryInput" bindinput="bindWorkIndustryInput" value="{{form.workIndustry}}" placeholder-class="placeholder-style" placeholder="请输入" />
</view>
</view>
<view class="list-item ">
<view class="left">
<!-- <text class="must">*</text> -->
<view class="title">是否居住在市北</view>
</view>
<view class="right">
<radio-group class="radio-group" bindchange="bindFlagshibeiChange">
<radio checked="{{form.shibei == 1}}" value="1" class="radio" checked="true">是</radio>
<radio checked="{{form.shibei == 0}}" value="0" class="radio">否</radio>
</radio-group>
</view>
</view>
<view class="list-item gray" wx:if="{{form.shibei == '1'}}">
<view class="left">
<text class="must">*</text>
<view class="title">报到的常住社区名称</view>
</view>
<picker mode="multiSelector" bindchange="bindMultiPickerChange" bindcolumnchange="bindMultiPickerColumnChange"
value="{{multiIndex}}" range="{{newArr}}" >
<view class="picker">
<van-button type="primary" wx:if="{{changeFlag}}" >
{{newArr[0][multiIndex[0]]}},{{newArr[1][multiIndex[1]]}}
</van-button>
<van-button wx:else class=" gray-font">
请选择
</van-button>
</view>
</picker>
</view>
<view class="list-item " wx:if="{{form.shibei == '1'}}">
<view class="left">
<text class="must">*</text>
<view class="title">居住小区名称</view>
</view>
<view class="right">
<input confirm-type="next" bindblur="bindHomeNameInput" bindinput="bindHomeNameInput" value="{{form.homeName}}" placeholder-class="placeholder-style" placeholder="请输入" />
</view>
</view>
<view class="list-item " wx:if="{{form.shibei == '0'}}">
<view class="left">
<text class="must">*</text>
<view class="title" style="text-overflow:ellipsis; white-space:nowrap; overflow:hidden;">单位报到联系社区名称</view>
</view>
<picker mode="multiSelector" bindchange="bindMultiPickerChange" bindcolumnchange="bindMultiPickerColumnChange"
value="{{multiIndex}}" range="{{newArr}}" >
<view class="picker">
<van-button type="primary" wx:if="{{changeFlag}}" style="text-overflow:ellipsis; white-space:nowrap; overflow:hidden;margin-left: 20rpx;">
{{newArr[0][multiIndex[0]]}},{{newArr[1][multiIndex[1]]}}
</van-button>
<van-button wx:else class=" gray-font">
请选择
</van-button>
</view>
</picker>
</view>
<view class="list-item ">
<view class="left">
<text class="must">*</text>
<view class="title">是否为中共党员</view>
</view>
<view class="right">
<radio-group class="radio-group" bindchange="bindFlagPartyChange">
<radio checked="{{form.party == 1}}" value="1" class="radio" checked="true">是</radio>
<radio checked="{{form.party == 0}}" value="0" class="radio">否</radio>
</radio-group>
</view>
</view>
</view>
<view class="buttons fixed">
<button hover-class="hover-class" class="btn2" bindtap="navigateToIndex">进入首页</button>
<!-- <button hover-class="hover-class" class="btn2" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">进入首页</button> -->
</view>
</view>
</view>
<wux-picker cols="1" options="{{selectOption}}" value="{{form.workType}}" visible="{{selectedStatus}}" bind:confirm="pickerConfirm" controlled bind:cancel="pickerCancel">
</wux-picker>
<modal hidden="{{!workTypeInput}}" title="请输入单位性质" confirm-text="提交" cancel-text="取消" bindcancel="cancelDlaog" bindconfirm="confirmDlaog">
<!-- <input type='text'placeholder="请输入" /> -->
<input confirm-type="next" bindblur="bindWorkTypeTextInput" bindinput="bindWorkTypeTextInput" value="{{workTypeText}}" placeholder-class="placeholder-style" placeholder="请输入" auto-focus/>
</modal>

74
miniprogram/pages/formid/formid.wxss

@ -1,25 +1,61 @@
.bgimg{
width: 710rpx;
height: 100%;
position: absolute;
}
.context2{
padding: 80px 22px 50px 20px;
position: absolute;
z-index: 99999;
font-size: 28rpx;
color: #333333;
}
.context-title{
font-size: 50rpx;
margin-bottom: 50rpx;
.container{
height: calc(100vh - 100rpx);
overflow-y: scroll ;
overflow-x: hidden;
}
.context-name{
font-size: 36rpx;
.gray{
background-color: #fafafa;
}
.context-name view{
line-height: 60rpx;
.gray-font{
color:#808080 ;
}
.basic-info {
width: 95%;
background: #fff;
border-radius: 16rpx;
box-sizing: border-box;
padding: 0 20rpx;
margin: 20rpx auto;
}
.basic-info .list-item {
width: 100%;
height: 100rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.basic-info .list-item .left .must {
color: #F61616;
font-size: 30rpx;
}
.basic-info .list-item .left .title {
color: #333;
font-size: 34rpx;
}
.basic-info .list-item .left {
display: flex;
align-items: center;
height: 100rpx;
}
.basic-info .list-item .right {
height: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
flex: 1;
}
.basic-info .list-item .right .picker{
width: 100%;
}
.basic-info .list-item .right input{
text-align: right;
}
.fixed{
position: fixed;
bottom: 20rpx;
}
.buttons .btn2 {
background: linear-gradient(to right, #f51212, #ff4c4c);
height:84rpx;

4
miniprogram/pages/my/my.wxml

@ -23,13 +23,13 @@
<image src="../../images/my/my01.png" />
</navigator>
<view class="w40"></view>
<navigator url="" class="grid2 red">
<!-- <navigator url="" class="grid2 red">
<view>
<view class="h1">退出登录</view>
<view class="h2">点击退出页面</view>
</view>
<image src="../../images/my/my02.png" />
</navigator>
</navigator> -->
</view>

2
miniprogram/project.private.config.json

@ -142,7 +142,7 @@
"scene": null
},
{
"name": "",
"name": "注册",
"pathName": "pages/formid/formid",
"query": "",
"launchMode": "default",

30
miniprogram/subpages/checkIn/pages/checkIn/register/register.js

@ -35,12 +35,14 @@ Page({
allDeptIds: [],//社区id
shibei:'1',//是否居住在市北
},
workTypeText:'',
orgOptions: [],
newArr:[],
multiIds:[],
multiIndex: [0, 0],
submitStatus:false,
changeFlag:false
changeFlag:false,
workTypeInput:false
},
/**
@ -134,12 +136,28 @@ Page({
*/
onShareAppMessage() {
},
cancelDlaog(){
this.setData({
workTypeInput:false
})
},
handelClickTwo(){
wx.navigateBack({
delta: 1
})
},
bindWorkTypeTextInput(e){
this.setData({
workTypeText: e.detail.value
})
},
confirmDlaog(e){
console.log(e);
this.setData({
workTypeInput:false
})
},
bindMultiPickerChange() {
this.setData({
'form.allDeptIds':['1175270520603930625',this.data.multiIds[0].value,this.data.multiIds[1].value],
@ -291,6 +309,12 @@ Page({
})
},
pickerConfirm(e) {
console.log(e);
if(e.detail.value == '7'){
this.setData({
workTypeInput:true
})
}
this.setData({
'form.workType': e.detail.label,
selectedStatus: false
@ -353,9 +377,13 @@ Page({
}else{
para.owners = parseInt(para.owners)
}
if(this.data.workTypeText){
para.workType = this.data.workTypeText
}
para.party = parseInt(para.party)
para.volunteer = parseInt(para.volunteer)
para.gridStaff = parseInt(para.gridStaff)
console.log(para);
wx.showLoading({
title: "提交中..."
})

15
miniprogram/subpages/checkIn/pages/checkIn/register/register.wxml

@ -47,6 +47,15 @@
<view class="{{form.workType?'picker':'picker gray-font'}}" >{{form.workType?form.workType:'请选择'}}</view>
</view>
</view>
<view class="list-item" wx:if="{{form.workType == '其他'}}">
<view class="left">
<!-- <text class="must">*</text> -->
<view class="title">单位性质(其他)</view>
</view>
<view class="right" >
<input confirm-type="next" bindblur="bindworkTypeTextInput" bindinput="bindworkTypeTextInput" value="{{workTypeText}}" placeholder-class="placeholder-style" placeholder="请输入" />
</view>
</view>
<view class="list-item gray">
<view class="left">
<!-- <text class="must">*</text> -->
@ -198,4 +207,8 @@
</view>
</block>
<wux-picker cols="1" options="{{selectOption}}" value="{{form.workType}}" visible="{{selectedStatus}}" bind:confirm="pickerConfirm" controlled bind:cancel="pickerCancel">
</wux-picker>
</wux-picker>
<modal hidden="{{!workTypeInput}}" title="请输入单位性质" confirm-text="提交" cancel-text="取消" bindcancel="cancelDlaog" bindconfirm="confirmDlaog">
<!-- <input type='text'placeholder="请输入" /> -->
<input confirm-type="next" bindblur="bindWorkTypeTextInput" bindinput="bindWorkTypeTextInput" value="{{workTypeText}}" placeholder-class="placeholder-style" placeholder="请输入" auto-focus/>
</modal>

4
miniprogram/subpages/knight/pages/knight/knight.wxml

@ -24,7 +24,7 @@
<view class="vcenter flex1">
<view class="h1">驿站地图</view>
<view class="h2">
主要是浏览、查询附近驿站点位。
主要是浏览、查询附近新锋驿站点位。
</view>
</view>
<view class="vcenter w20">
@ -48,7 +48,7 @@
<view class="vcenter flex1">
<view class="h1">城市观察员</view>
<view class="h2">
城市管理齐出力,优美环境共受益。
城市管理齐出力优美环境共受益。
</view>
</view>
<view class="vcenter w20">

41
miniprogram/subpages/knight/pages/knight/observeResi/observeResi.js

@ -309,7 +309,14 @@ Page({
this.showToast('请填写现工作单位')
return false
}
if(!this.data.form.courier){
this.showToast('请选择行业类别')
return false
}else if(this.data.form.courier == 5 && !this.data.form.courierText){
this.showToast('请请填写其他行业类别')
return false
}
const para = {
...this.data.form
}
@ -322,19 +329,25 @@ Page({
console.log(para);
wx.hideLoading()
let than = this
api.submitKnightpionner(para).then(res=>{
wx.hideLoading()
if(res.code == '0'){
than.setData({
submitStatus:true
})
}else{
than.showToast(res.msg)
}
}).catch(err=>{
wx.hideLoading()
console.log(err);
})
// api.submitKnightpionner(para).then(res=>{
// wx.hideLoading()
// if(res.code == '0'){
// than.setData({
// submitStatus:true
// })
// }else{
// than.showToast(res.msg)
// }
// }).catch(err=>{
// wx.hideLoading()
// console.log(err);
// })
},
bindRealCourierTextInput(e){
this.setData({
'form.courierText': e.detail.value
})
console.log(this.data.courierText)
},
handelClickTwo(){
wx.navigateBack({

10
miniprogram/subpages/knight/pages/knight/observeResi/observeResi.wxml

@ -69,6 +69,16 @@
<view class="{{selectedValueHlabel?'picker':'picker gray-font'}}" data-value='0' bind:tap="handleCLickH">{{selectedValueHlabel?selectedValueHlabel:'请选择'}}</view>
</view>
</view>
<view class="list-item gray" wx:if="{{form.courier=='5'}}">
<view class="left">
<text class="must">*</text>
<view class="title">行业类别(其他)</view>
</view>
<view class="right">
<input confirm-type="next" bindblur="bindRealCourierTextInput" bindinput="bindRealCourierTextInput" value="{{form.courierText}}" placeholder-class="placeholder-style" placeholder="请输入" />
</view>
</view>
<view class="list-item gray">
<view class="left">
<text class="must">*</text>

2
miniprogram/subpages/redGrider/pages/redGrider/redGrider.wxml

@ -12,7 +12,7 @@
<view class="vcenter flex1">
<view class="h1">网格力量</view>
<view class="h2">
“网格力量”是面向全区社区下网格···
“网格力量”是面向全区社区下网格
</view>
</view>
<view class="vcenter w20">

14
miniprogram/utils/api.js

@ -57,7 +57,9 @@ module.exports = {
standardbearerApply: standardbearerApply,
standardbearerStatus: standardbearerStatus,
getByLoginUser: getByLoginUser,
saveOrder: saveOrder
saveOrder: saveOrder,
getDeptIdByItude:getDeptIdByItude,
getDeptTree:getDeptTree
}
function getToken(wxCode) {
@ -493,4 +495,12 @@ function getByLoginUser() {
//保存招募令
function saveOrder(info) {
return fly.post("app-user/redspearhead/save", info)
}
}
//根据经纬度查询街道社区
function getDeptIdByItude (para) {
return fly.post(`admin/dept/getGridByCoordinate`, para)
}
//街道tree
function getDeptTree () {
return fly.get(`admin/dept/getAllDeptTree`)
}

1123
miniprogram/utils/qqmap-wx-jssdk.js

File diff suppressed because it is too large

115
miniprogram/utils/wgs84_to_gcj02.js

@ -0,0 +1,115 @@
//wgs84_to_gcj02.js文件
//地标 转 国测 常量
var x_PI = (3.14159265358979324 * 3000.0) / 180.0;
var PI = 3.1415926535897932384626;
var a = 6378245.0; //卫星椭球坐标投影到平面地图坐标系的投影因子。
var ee = 0.00669342162296594323; //椭球的偏心率。
//判断是否在国内,在中国国内的经纬度才需要做偏移
function out_of_china(lng, lat) {
return (
lng < 72.004 ||
lng > 137.8347 ||
(lat < 0.8293 || lat > 55.8271 || false)
);
}
//转化经度
function transformlng(lng, lat) {
var ret =
300.0 +
lng +
2.0 * lat +
0.1 * lng * lng +
0.1 * lng * lat +
0.1 * Math.sqrt(Math.abs(lng));
ret +=
((20.0 * Math.sin(6.0 * lng * PI) +
20.0 * Math.sin(2.0 * lng * PI)) *
2.0) /
3.0;
ret +=
((20.0 * Math.sin(lng * PI) +
40.0 * Math.sin((lng / 3.0) * PI)) *
2.0) /
3.0;
ret +=
((150.0 * Math.sin((lng / 12.0) * PI) +
300.0 * Math.sin((lng / 30.0) * PI)) *
2.0) /
3.0;
return ret;
}
//转化纬度
function transformlat(lng, lat) {
var ret =
-100.0 +
2.0 * lng +
3.0 * lat +
0.2 * lat * lat +
0.1 * lng * lat +
0.2 * Math.sqrt(Math.abs(lng));
ret +=
((20.0 * Math.sin(6.0 * lng * PI) +
20.0 * Math.sin(2.0 * lng * PI)) *
2.0) /
3.0;
ret +=
((20.0 * Math.sin(lat * PI) +
40.0 * Math.sin((lat / 3.0) * PI)) *
2.0) /
3.0;
ret +=
((160.0 * Math.sin((lat / 12.0) * PI) +
320 * Math.sin((lat * PI) / 30.0)) *
2.0) /
3.0;
return ret;
}
//wgs84 to gcj02 地球坐标系 转 火星坐标系
export function wgs84_to_gcj02(lng, lat) {
if (out_of_china(lng, lat)) {
return [lng, lat];
} else {
var dlat = transformlat(lng - 105.0, lat - 35.0);
var dlng = transformlng(lng - 105.0, lat - 35.0);
var radlat = (lat / 180.0) * PI;
var magic = Math.sin(radlat);
magic = 1 - ee * magic * magic;
var sqrtmagic = Math.sqrt(magic);
dlat =
(dlat * 180.0) /
(((a * (1 - ee)) / (magic * sqrtmagic)) * PI);
dlng =
(dlng * 180.0) / ((a / sqrtmagic) * Math.cos(radlat) * PI);
var mglat = lat + dlat;
var mglng = lng + dlng;
return [mglng, mglat];
}
}
//gcj02 to wgs84 火星坐标系 转 地球坐标系
export function gcj02_to_wgs84(lng, lat) {
if (out_of_china(lng, lat)) {
return [lng, lat]
}
else {
var dlat = transformlat(lng - 105.0, lat - 35.0);
var dlng = transformlng(lng - 105.0, lat - 35.0);
var radlat = lat / 180.0 * PI;
var magic = Math.sin(radlat);
magic = 1 - ee * magic * magic;
var sqrtmagic = Math.sqrt(magic);
dlat = (dlat * 180.0) / ((a * (1 - ee)) / (magic * sqrtmagic) * PI);
dlng = (dlng * 180.0) / (a / sqrtmagic * Math.cos(radlat) * PI);
var mglat = lat + dlat;
var mglng = lng + dlng;
return [lng * 2 - mglng, lat * 2 - mglat]
}
}
Loading…
Cancel
Save