|
@@ -4,7 +4,8 @@
|
|
<view class="header p-3">
|
|
<view class="header p-3">
|
|
<view class="centerY">
|
|
<view class="centerY">
|
|
<span class="d-inline-block fs-18 text-white font-bold">个人档案</span>
|
|
<span class="d-inline-block fs-18 text-white font-bold">个人档案</span>
|
|
- <span class="d-inline-block py-1 d-inline-block ml-auto text-white1" @click="closet">[ 退出 ]</span>
|
|
|
|
|
|
+ <span v-if="ipArr.find((item)=>item.ip==prodIp)&&ipArr.find((item)=>item.ip==prodIp).name!=='兰溪'"
|
|
|
|
+ class="d-inline-block py-1 d-inline-block ml-auto text-white1" @click="closet">[ 退出 ]</span>
|
|
</view>
|
|
</view>
|
|
<view class="centerY mt-2" @click="$mf.clickNavto('/pages/userinfo/userinfo')">
|
|
<view class="centerY mt-2" @click="$mf.clickNavto('/pages/userinfo/userinfo')">
|
|
<view class="w-15 userhead">
|
|
<view class="w-15 userhead">
|
|
@@ -111,19 +112,18 @@
|
|
src="@/static/img/index/jjjc.png" mode="widthFix" class="w-100"></image>
|
|
src="@/static/img/index/jjjc.png" mode="widthFix" class="w-100"></image>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
<view class="">
|
|
<view class="">
|
|
<uni-popup ref="popup1" type="center" :mask-click="false">
|
|
<uni-popup ref="popup1" type="center" :mask-click="false">
|
|
<view class="bg-white p-3 w-100" style="border-radius: 16rpx;">
|
|
<view class="bg-white p-3 w-100" style="border-radius: 16rpx;">
|
|
<view class="text-center mb-3 fs-14 font-bold py-2">
|
|
<view class="text-center mb-3 fs-14 font-bold py-2">
|
|
查询
|
|
查询
|
|
</view>
|
|
</view>
|
|
- <view class=" centerY mb-3" style="border-radius: 14rpx;border: 1px solid #007aff;">
|
|
|
|
- <input type="text" v-model="valueId" class="p-1 px-2 fs-12" placeholder="请输入身份证号码"
|
|
|
|
|
|
+ <view class=" centerY mb-3"
|
|
|
|
+ style="border-radius: 14rpx;border: 1px solid #007aff;overflow: hidden;">
|
|
|
|
+ <input type="text" v-model="valueId" class="px-2 fs-12" placeholder="请输入身份证号码"
|
|
placeholder-class="fs-12">
|
|
placeholder-class="fs-12">
|
|
- <button type="primary" class="d-inline-block fs-12 px-3 py-0 ml-auto mr-0"
|
|
|
|
|
|
+ <button type="primary" class="d-inline-block fs-12 px-3 ml-auto mr-0" style="padding: 4rpx ;"
|
|
@click="search">搜索</button>
|
|
@click="search">搜索</button>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -133,26 +133,111 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+ const ipArr = [{
|
|
|
|
+ name: '开发',
|
|
|
|
+ ip: 'http://192.168.1.103:10066'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: '测试',
|
|
|
|
+ ip: 'http://testapi.xklr.net:8601'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: '正式',
|
|
|
|
+ ip: 'http://apiv3.xklr.net'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: '兰溪',
|
|
|
|
+ ip: 'http://10.50.13.200:10066'
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ let globalData = getApp().globalData
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
userData: {},
|
|
userData: {},
|
|
physical: {},
|
|
physical: {},
|
|
- valueId: '330222194512283184'
|
|
|
|
|
|
+ valueId: '',
|
|
|
|
+ prodIp: '',
|
|
|
|
+ ipArr
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- mounted() {
|
|
|
|
|
|
+ onLoad() {
|
|
// console.log(this.$mf)
|
|
// console.log(this.$mf)
|
|
// console.log(this.$httpApi)
|
|
// console.log(this.$httpApi)
|
|
-
|
|
|
|
- if (!uni.getStorageSync('idCard')) {
|
|
|
|
- console.log(this.$refs)
|
|
|
|
- this.$refs.popup1.open()
|
|
|
|
- } else {
|
|
|
|
- this.getuserinfo(uni.getStorageSync('idCard'))
|
|
|
|
- }
|
|
|
|
|
|
+ this.decrypt()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ decrypt() {
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ title: '加载中'
|
|
|
|
+ })
|
|
|
|
+ let t = this;
|
|
|
|
+ uni.getStorage({
|
|
|
|
+ key: 'token',
|
|
|
|
+ success(res) {
|
|
|
|
+ console.log(res)
|
|
|
|
+ if (res.data !== '') {
|
|
|
|
+ ipArr.map((item) => {
|
|
|
|
+ console.log(globalData.configData.prodIp)
|
|
|
|
+ let timer = setInterval(async () => {
|
|
|
|
+ if (globalData.configData.prodIp) {
|
|
|
|
+ t.prodIp = globalData.configData.prodIp
|
|
|
|
+ clearInterval(timer)
|
|
|
|
+ }
|
|
|
|
+ if (item.ip == globalData.configData.prodIp) {
|
|
|
|
+ //兰溪
|
|
|
|
+ if (item.name == '兰溪') {
|
|
|
|
+ if (!res.data.length > 10) return
|
|
|
|
+ console.log(res)
|
|
|
|
+ let res2 = await t.$api.decrypt({
|
|
|
|
+ toKen: res.data
|
|
|
|
+ });
|
|
|
|
+ uni.setStorageSync('idCard', res2.idCard)
|
|
|
|
+ t.getuserinfo(res2.idCard)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }, 300)
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ let timer = setInterval(async () => {
|
|
|
|
+ if (globalData.configData.prodIp) {
|
|
|
|
+ t.prodIp = globalData.configData.prodIp
|
|
|
|
+ clearInterval(timer)
|
|
|
|
+ }
|
|
|
|
+ let i = ipArr.find((item) => item.ip == globalData.configData.prodIp).name=='兰溪'
|
|
|
|
+ if (!i) {
|
|
|
|
+ if (!uni.getStorageSync('idCard')) {
|
|
|
|
+ t.$refs.popup1.open()
|
|
|
|
+ uni.hideLoading()
|
|
|
|
+ } else {
|
|
|
|
+ t.getuserinfo(uni.getStorageSync('idCard'))
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }, 300)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ fail(res) {
|
|
|
|
+ console.log(res)
|
|
|
|
+ let timer = setInterval(async () => {
|
|
|
|
+ if (globalData.configData.prodIp) {
|
|
|
|
+ t.prodIp = globalData.configData.prodIp
|
|
|
|
+ clearInterval(timer)
|
|
|
|
+ }
|
|
|
|
+ let i = ipArr.find((item) => item.ip == globalData.configData.prodIp).name=='兰溪'
|
|
|
|
+ if (!i) {
|
|
|
|
+ if (!uni.getStorageSync('idCard')) {
|
|
|
|
+ t.$refs.popup1.open()
|
|
|
|
+ uni.hideLoading()
|
|
|
|
+ } else {
|
|
|
|
+ t.getuserinfo(uni.getStorageSync('idCard'))
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }, 300)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
closet() {
|
|
closet() {
|
|
uni.clearStorage('idCard')
|
|
uni.clearStorage('idCard')
|
|
uni.clearStorage('userData')
|
|
uni.clearStorage('userData')
|
|
@@ -200,7 +285,6 @@
|
|
uni.setStorageSync('userData', data || {});
|
|
uni.setStorageSync('userData', data || {});
|
|
uni.setStorageSync('idCard', data && data.idCard || '')
|
|
uni.setStorageSync('idCard', data && data.idCard || '')
|
|
this.userData = data || {}
|
|
this.userData = data || {}
|
|
- console.log(this.userData)
|
|
|
|
if (data && data.id) {
|
|
if (data && data.id) {
|
|
this.$refs.popup1.close();
|
|
this.$refs.popup1.close();
|
|
this.find_physical()
|
|
this.find_physical()
|