修改
This commit is contained in:
parent
6fffb0a624
commit
d70b5af884
@ -1,4 +1,11 @@
|
||||
import baseurl from '@/api/baseurl.js'
|
||||
import {
|
||||
witch
|
||||
} from "@/api/witch";
|
||||
import {
|
||||
encrypt,
|
||||
decrypt
|
||||
} from '@/api/crypto.js'
|
||||
|
||||
var request = function(config) {
|
||||
return new Promise((resolve, rejected) => {
|
||||
@ -9,6 +16,10 @@ var request = function(config) {
|
||||
timeout: 60000,
|
||||
header: config.header,
|
||||
success(res) {
|
||||
if (witch == '1') {
|
||||
res.data = decrypt(res.data)
|
||||
res.data = JSON.parse(res.data)
|
||||
}
|
||||
resolve(res.data)
|
||||
},
|
||||
fail(err) {
|
||||
|
||||
@ -2,8 +2,11 @@ import baseurl from './baseurl.js'
|
||||
import {
|
||||
encrypt,
|
||||
decrypt
|
||||
} from './crypto.js'
|
||||
var witch = '1' //1加密 2不加密
|
||||
} from '@/api/crypto.js'
|
||||
import {
|
||||
witch
|
||||
} from "@/api/witch";
|
||||
|
||||
var request = function(config) {
|
||||
if (uni.getStorageSync('openid')) {
|
||||
if (!config.header) {
|
||||
@ -16,13 +19,16 @@ var request = function(config) {
|
||||
appletType: ''
|
||||
}
|
||||
}
|
||||
if (witch == '1' && config.method == 'post' && config.url != '/applet/score/prizeExchange/approvalList') {
|
||||
config.data = encrypt(JSON.stringify(config.data))
|
||||
}
|
||||
if (witch == '1' && config.url == '/nurseApplet/chatRecord/updateReadStatus' || config.url ==
|
||||
'/applet/register/editPrimaryAccountFlag') {
|
||||
config.data = encrypt(JSON.stringify(config.data))
|
||||
if (witch == '1') {
|
||||
if (config.method == 'post' && config.url != '/applet/score/prizeExchange/approvalList') {
|
||||
config.data = encrypt(JSON.stringify(config.data))
|
||||
}
|
||||
if (config.url == '/nurseApplet/chatRecord/updateReadStatus' || config.url ==
|
||||
'/applet/register/editPrimaryAccountFlag') {
|
||||
config.data = encrypt(JSON.stringify(config.data))
|
||||
}
|
||||
}
|
||||
|
||||
const urls = config.url.split('?')[0]
|
||||
if (config.url != '/nurseApplet/chatRecord/updateReadStatus' && config.url !=
|
||||
"/nurseApplet/chatRecord/sendMessage" && config.url !=
|
||||
@ -42,8 +48,10 @@ var request = function(config) {
|
||||
success(res) {
|
||||
uni.hideLoading();
|
||||
if (witch == '1') {
|
||||
res.data = decrypt(res.data)
|
||||
res.data = JSON.parse(res.data)
|
||||
if (config.url != '/applet/score/prizeExchange/approvalList') {
|
||||
res.data = decrypt(res.data)
|
||||
res.data = JSON.parse(res.data)
|
||||
}
|
||||
}
|
||||
console.log(res.data)
|
||||
resolve(res.data)
|
||||
|
||||
4
api/witch.js
Normal file
4
api/witch.js
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
var witch = '1' //1加密 2不加密
|
||||
|
||||
export { witch }
|
||||
@ -25,7 +25,7 @@
|
||||
<view class="phone" v-if="appPersonallist.phone">
|
||||
{{appPersonallist.phone}}
|
||||
</view>
|
||||
<view class="switch btn" @tap='homeshow'>
|
||||
<view class="switch btn" @tap='getpersnoal'>
|
||||
切换家庭成员
|
||||
</view>
|
||||
<view class="manage btn" @click="gomanagefamily">
|
||||
@ -230,12 +230,10 @@
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
// this.bjimg = baseurl + '/profile/appletPicture/inviteFriendsOne.png'
|
||||
this.appPersonallist = uni.getStorageSync('userinfo')
|
||||
this.region = Number(uni.getStorageSync('region'))
|
||||
this.baseurl = baseurl
|
||||
this.myInfo()
|
||||
this.getpersnoal()
|
||||
if (this.appPersonallist && this.region != 3) {
|
||||
checkSignApply(this.appPersonallist.cardNo).then(res => {
|
||||
if (res.data) {
|
||||
@ -243,7 +241,7 @@
|
||||
this.infotitle = res.data.info
|
||||
}
|
||||
})
|
||||
} else {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
gomyappiont() {
|
||||
@ -281,13 +279,21 @@
|
||||
})
|
||||
}
|
||||
},
|
||||
// 获取成员
|
||||
// 切换家庭成员
|
||||
getpersnoal() {
|
||||
const value = uni.getStorageSync('openid');
|
||||
if (value) {
|
||||
getCurrentUser(value).then(res => {
|
||||
this.familyList = res.data
|
||||
})
|
||||
const value = uni.getStorageSync('userinfo');
|
||||
const value2 = uni.getStorageSync('patientId');
|
||||
if (value && value2) {
|
||||
const openid = uni.getStorageSync('openid');
|
||||
if (openid) {
|
||||
getCurrentUser(openid).then(res => {
|
||||
this.familyList = res.data
|
||||
this.showhome = true
|
||||
})
|
||||
}
|
||||
// this.myInfo()
|
||||
} else {
|
||||
this.gologin();
|
||||
}
|
||||
},
|
||||
// 切换成员
|
||||
@ -295,16 +301,17 @@
|
||||
const value = uni.getStorageSync('openid');
|
||||
if (value) {
|
||||
switchResident(value, e.patientCode).then(res => {
|
||||
uni.setStorageSync('userinfo', res.data);
|
||||
uni.setStorageSync('patientId', res.data.id);
|
||||
this.appPersonallist = res.data
|
||||
if (res.code == 200) {
|
||||
this.appPersonallist = res.data
|
||||
uni.setStorageSync('userinfo', res.data);
|
||||
uni.setStorageSync('patientId', res.data.id);
|
||||
uni.setStorageSync('patientName', res.data
|
||||
.patientName);
|
||||
this.$refs.uToast.show({
|
||||
title: '切换成功',
|
||||
type: 'success',
|
||||
duration: '1000',
|
||||
duration: '1500',
|
||||
})
|
||||
this.myInfo()
|
||||
clearInterval(this.$store.state.timeoutObj);
|
||||
uni.closeSocket();
|
||||
} else {
|
||||
@ -346,7 +353,7 @@
|
||||
}
|
||||
})
|
||||
} else {
|
||||
// that.removes();
|
||||
that.removes();
|
||||
}
|
||||
})
|
||||
} else {
|
||||
@ -480,32 +487,28 @@
|
||||
const value = uni.getStorageSync('userinfo');
|
||||
const value2 = uni.getStorageSync('patientId');
|
||||
if (value && value2) {
|
||||
if (uni.getStorageSync('region') == 3) {
|
||||
this.$refs.uToast.show({
|
||||
title: '当前地区不支持,请选择其它地区',
|
||||
type: 'error',
|
||||
})
|
||||
if (this.region == 3) {
|
||||
this.family()
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pagesB/Behaviorpoints/Behaviorpoints'
|
||||
})
|
||||
if (this.checkSign == "0") {
|
||||
uni.navigateTo({
|
||||
url: `/pagesC/Onlinesigning/Onlinesigning?checkSign=${this.checkSign}`,
|
||||
})
|
||||
} else if (this.checkSign == "01") {
|
||||
this.$refs.uToast.show({
|
||||
title: this.infotitle,
|
||||
type: 'error',
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pagesB/Behaviorpoints/Behaviorpoints'
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.gologin();
|
||||
}
|
||||
},
|
||||
// 切换家庭成员
|
||||
homeshow() {
|
||||
const value = uni.getStorageSync('userinfo');
|
||||
const value2 = uni.getStorageSync('patientId');
|
||||
if (value && value2) {
|
||||
this.showhome = true
|
||||
this.getpersnoal()
|
||||
// this.myInfo()
|
||||
} else {
|
||||
this.gologin();
|
||||
}
|
||||
},
|
||||
//管理家庭成员
|
||||
gomanagefamily() {
|
||||
const value = uni.getStorageSync('userinfo');
|
||||
@ -523,6 +526,7 @@
|
||||
uni.navigateTo({
|
||||
url: '/pagesB/AddMembers/AddMembers'
|
||||
})
|
||||
this.showhome = false
|
||||
// if (!this.userInfo) {
|
||||
// uni.showModal({
|
||||
// title: "提示",
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
{{score?score:0}}
|
||||
</span>
|
||||
</view>
|
||||
<view class="paiming" v-if="hkname=='河口'" @click='lookranking'>
|
||||
<view class="paiming" v-if="hkname=='河口'&&scoreranking" @click='lookranking'>
|
||||
<span
|
||||
:style="score>=0&&score<800?'color:#fff':score>=800&&score<1600?'color:#D3BC96':score>=1600&&score<2400?'color:#AD7600':score>=2400&&score<3000?'color:#FAEEDB':score>=3000?'color:#4864ED':''">
|
||||
积分榜排名:第{{scoreranking}}名
|
||||
@ -110,12 +110,14 @@
|
||||
import {
|
||||
detail,
|
||||
} from '@/api/pages/homepage/homepage.js'
|
||||
import baseurl from '@/api/baseurl.js'
|
||||
// import {
|
||||
// mapActions
|
||||
// } from "vuex";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
baseurl: '',
|
||||
query: {
|
||||
identity: uni.getStorageSync('userinfo').cardNo,
|
||||
pageNum: 1,
|
||||
@ -130,7 +132,7 @@
|
||||
hkname: '',
|
||||
orgName: "",
|
||||
patientName: "",
|
||||
scoreranking: 0,
|
||||
scoreranking: undefined,
|
||||
lookrankingshow: false,
|
||||
};
|
||||
},
|
||||
@ -140,6 +142,9 @@
|
||||
this.info();
|
||||
this.scoretotalinfo();
|
||||
},
|
||||
onLoad() {
|
||||
this.baseurl = baseurl
|
||||
},
|
||||
onReady() { //更改导航栏文字
|
||||
if (uni.getStorageSync('region') == 2) {
|
||||
detail(this.query.identity).then(res => {
|
||||
|
||||
@ -191,4 +191,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@ -41,6 +41,7 @@
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.list = []
|
||||
this.info()
|
||||
},
|
||||
methods: {
|
||||
@ -77,6 +78,7 @@
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() { //下拉刷新
|
||||
this.list = []
|
||||
this.query.pageNum = 1;
|
||||
this.info();
|
||||
setTimeout(function() {
|
||||
|
||||
@ -393,7 +393,7 @@
|
||||
url: 'https://apis.map.qq.com/ws/geocoder/v1/?location=location', //腾讯官方逆解析接口,可直接复制
|
||||
data: {
|
||||
location: location,
|
||||
'key': "Q4DBZ-UIMC2-B63UX-CUZ6A-S3UT7-TBF3V", //自己申请的Key
|
||||
'key': "7Y7BZ-PVXRA-IPYKT-C6YKF-YS3VF-LMFWJ", //自己申请的Key
|
||||
},
|
||||
method: "GET",
|
||||
success(res) {
|
||||
@ -427,15 +427,12 @@
|
||||
...mapMutations(['scoket']),
|
||||
// 与户主关系
|
||||
nationSelect(e) {
|
||||
console.log(e)
|
||||
this.query.householdRelationship = e[0].value
|
||||
this.householdRelationship = e[0].label
|
||||
// console.log(this.query.householdRelationship)
|
||||
// this.$refs.uForm.validateField('nation')
|
||||
},
|
||||
onChange(e) {
|
||||
this.selected = e
|
||||
// console.log(e)
|
||||
// this.allChecked = !this.allChecked;
|
||||
// this.selected = e.detail.value;
|
||||
},
|
||||
@ -444,12 +441,15 @@
|
||||
cancel() {},
|
||||
confirm(e) {
|
||||
this.query.diseaseList = e.map(Number)
|
||||
console.log(e, '打印e')
|
||||
},
|
||||
submit() {
|
||||
var that = this
|
||||
that.query.openid = uni.getStorageSync('openid');
|
||||
that.query.cityCode = uni.getStorageSync('region');
|
||||
if (!uni.getStorageSync('region')) {
|
||||
uni.setStorageSync("region", 2)
|
||||
uni.setStorageSync("location", '东营市')
|
||||
}
|
||||
that.query.cityCode = uni.getStorageSync('region')
|
||||
if (that.query.sexname == '男') {
|
||||
that.query.sex = 'MALE';
|
||||
} else if (that.query.sexname == '女') {
|
||||
@ -491,7 +491,6 @@
|
||||
uni.setStorageSync('patientName', res.data
|
||||
.patientName);
|
||||
uni.setStorageSync("userinfo", res.data)
|
||||
uni.setStorageSync("region", 2)
|
||||
that.scoket();
|
||||
that.$refs.uToast.show({
|
||||
title: '注册成功',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user