Before Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 7.7 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 997 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 858 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 877 B |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 428 B |
Before Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 7.2 KiB |
@ -1,125 +1,453 @@ |
|||||
var api = require('../../utils/api.js') |
var api = require('../../utils/api.js') |
||||
var global = require('../../utils/config.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() |
const app = getApp() |
||||
Page({ |
Page({ |
||||
data: { |
data: { |
||||
gridId: '', |
gridId: '', |
||||
gridName: '', |
gridName: '', |
||||
gridNameArr: [], |
gridNameArr: [], |
||||
formid: '', |
formid: '', |
||||
resToken: '', |
resToken: '', |
||||
resGridName: '', |
resGridName: '', |
||||
inviteUserId: '', |
inviteUserId: '', |
||||
GridNameId:"" |
GridNameId: "", |
||||
}, |
qqMapWX: '', |
||||
onLoad(options) { |
form: { |
||||
if (options.gid) { |
|
||||
this.setData({ |
}, |
||||
gridId:'1221751857028825090', |
streetList: [], |
||||
inviteUserId: options.inviteUserId |
addressContent: '', |
||||
}) |
address: '', |
||||
} |
form: { |
||||
this.getToken(options.gid) |
name: '', |
||||
// this.getInvitation()
|
idCard: '', |
||||
}, |
mobile: '', |
||||
// getInvitation(){
|
homeName: '',//居住小区名称
|
||||
// let that = this
|
workUnit: '',//工作单位
|
||||
// api.getInvitation(this.data.gridId).then(function (res) {
|
workType: '',//单位性质
|
||||
// that.setData({
|
workIndustry: '',//所属行业
|
||||
// GridNameId:res.data
|
party: 1,//是否为党员
|
||||
// })
|
allDeptIds: [],//社区id
|
||||
// that.getGridName()
|
shibei:'1',//是否居住在市北
|
||||
// })
|
}, |
||||
// },
|
selectedStatus:false, |
||||
getToken: function (gid) { |
selectOption: [ |
||||
let that = this |
{ label: '党政机关', value: '0' }, |
||||
wx.login({ |
{ label: '事业单位', value: '1' }, |
||||
success(res) { |
{ label: '国有企业', value: '2' }, |
||||
if (res.code) { |
{ label: '私营企业', value: '3' }, |
||||
console.log('微信CODE: ' + res.code) |
{ label: '集体企业', value: '4' }, |
||||
let wxCode = res.code |
{ label: '外资企业、合资企业', value: '5' }, |
||||
const para = { |
{ label: '社会组织', value: '6' }, |
||||
inviteUserId: that.data.inviteUserId, |
{ label: '其他', value: '7' } |
||||
//写死四机社区第一网格
|
], |
||||
gridId: '1224104693058306049', |
workTypeInput:false, |
||||
wxCode: res.code |
workTypeText:'',//单位类型为其他的输入框值
|
||||
} |
newArr:[], |
||||
api.getTokenV3(para).then(function (res) { |
multiIds:[], |
||||
global.Token = res.data.token |
multiIndex: [0, 0], |
||||
wx.removeStorageSync('token') |
changeFlag:false, |
||||
wx.setStorageSync('token', res.data.token) |
}, |
||||
that.setData({ |
onLoad(options) { |
||||
resToken: res.data.token, |
// this.data.qqMapWX = new QQMapWX({
|
||||
resGridName: res.data.grid |
// 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] |
||||
|
} |
||||
|
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; |
||||
|
|
||||
} |
} |
||||
} |
|
||||
}) |
this.setData(data); |
||||
}, |
this.setData({ |
||||
getGridName() { |
newArr:this.data.newArr.splice(0,2), |
||||
let that = this |
changeFlag:true |
||||
api.getCompleteName(this.data.GridNameId).then(function (res) { |
}) |
||||
wx.setStorage({ |
}, |
||||
key: "gridName", |
reverseLocation() { |
||||
data: res.data |
const _this = this |
||||
}) |
this.data.qqMapWX.reverseGeocoder({ |
||||
that.setData({ |
location: { |
||||
gridName: res.data, |
latitude: _this.data.form.issueLatitude, |
||||
gridNameArr: res.data.split('/') |
longitude: _this.data.form.issueLongitude |
||||
}) |
}, |
||||
}) |
success(res) { |
||||
}, |
_this.setData({ |
||||
bindGetUserInfo: function (e) { |
addressContent: res.result.address, |
||||
if (e.detail.userInfo) { |
address: res.result.address |
||||
// let wxHeadImg = e.detail.userInfo.avatarUrl
|
// 'form.issueAddress': res.result.address,
|
||||
// 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' |
|
||||
}) |
}) |
||||
}) |
}, |
||||
|
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 |
||||
} |
} |
||||
}) |
|
||||
} |
} |
||||
}) |
|
||||
|
|
||||
} else { |
const para = { |
||||
console.log('拒绝授权') |
...this.data.form |
||||
wx.redirectTo({ |
} |
||||
url: '/pages/index/index' |
if(this.data.workTypeText){ |
||||
}) |
para.workType = this.data.workTypeText |
||||
// wx.showModal({
|
} |
||||
// title: '提示',
|
para.party = parseInt(para.party) |
||||
// content: '您点击了拒绝授权,将无法进入小程序,请授权之后再进入!',
|
console.log(para); |
||||
// showCancel: false,
|
// wx.showLoading({
|
||||
// confirmText: '返回授权',
|
// title: "提交中..."
|
||||
// success: function (res) {
|
// })
|
||||
// if (res.confirm) {
|
let than = this |
||||
// console.log('用户点击了“返回授权”')
|
// 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' |
|
||||
}) |
|
||||
} |
|
||||
}) |
}) |
@ -1,4 +1,6 @@ |
|||||
{ |
{ |
||||
"navigationBarTitleText": "注册", |
"navigationBarTitleText": "注册", |
||||
"usingComponents": {} |
"usingComponents": { |
||||
|
"wux-picker": "../../dist/picker/index" |
||||
|
} |
||||
} |
} |
@ -1,17 +1,145 @@ |
|||||
<view class="container"> |
<view class="container"> |
||||
<view class="card"> |
<view class="basic-info"> |
||||
<image class="bgimg" src="../../images/ig_woyaozhuce.png" mode="widthFix"/> |
<view class="list-item "> |
||||
<view class="context2"> |
<view class="left"> |
||||
<view class="context-title">欢迎使用北尚先锋</view> |
<text class="must">*</text> |
||||
<view class="context-name"> |
<view class="title">姓名</view> |
||||
<!-- <view wx:for="{{gridNameArr}}" wx:key="thiskey" wx:for-index="idx" wx:for-item="item"> |
</view> |
||||
{{item}} |
<view class="right"> |
||||
</view> --> |
<input confirm-type="next" bindblur="bindRealNameInput" bindinput="bindRealNameInput" value="{{form.name}}" placeholder-class="placeholder-style" placeholder="请输入" /> |
||||
</view> |
</view> |
||||
</view> |
</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"> |
<view class="buttons fixed"> |
||||
<button hover-class="hover-class" class="btn2" bindtap="navigateToIndex">进入首页</button> |
<button hover-class="hover-class" class="btn2" bindtap="navigateToIndex">进入首页</button> |
||||
<!-- <button hover-class="hover-class" class="btn2" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">进入首页</button> --> |
<!-- <button hover-class="hover-class" class="btn2" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">进入首页</button> --> |
||||
</view> |
</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> |
@ -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] |
||||
|
} |
||||
|
} |