This commit is contained in:
2024-06-26 10:36:59 +08:00
parent 6fffb0a624
commit d70b5af884
8 changed files with 89 additions and 56 deletions

View File

@ -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) {

View File

@ -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
View File

@ -0,0 +1,4 @@
var witch = '1' //1加密 2不加密
export { witch }

View File

@ -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: "",

View File

@ -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 => {

View File

@ -191,4 +191,4 @@
}
}
}
</style>
</style>

View File

@ -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() {

View File

@ -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: '注册成功',