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