From d70b5af884ff24a7fd9582f91e04efe4c26f1833 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=BE=89?= <814457906@qq.com>
Date: Wed, 26 Jun 2024 10:36:59 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api/pagesB/getimg/index.js | 11 ++++
api/request.js | 28 +++++---
api/witch.js | 4 ++
pages/myinformation/myinformation.vue | 76 ++++++++++++----------
pagesB/Behaviorpoints/Behaviorpoints.vue | 9 ++-
pagesB/PointsMall/PointsMall.vue | 2 +-
pagesB/exchangerecords/exchangerecords.vue | 2 +
pagesB/register/register.vue | 13 ++--
8 files changed, 89 insertions(+), 56 deletions(-)
create mode 100644 api/witch.js
diff --git a/api/pagesB/getimg/index.js b/api/pagesB/getimg/index.js
index d6c3825..b21e2b9 100644
--- a/api/pagesB/getimg/index.js
+++ b/api/pagesB/getimg/index.js
@@ -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) {
diff --git a/api/request.js b/api/request.js
index 58a25cc..282084c 100644
--- a/api/request.js
+++ b/api/request.js
@@ -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)
diff --git a/api/witch.js b/api/witch.js
new file mode 100644
index 0000000..f5fdc6b
--- /dev/null
+++ b/api/witch.js
@@ -0,0 +1,4 @@
+
+var witch = '1' //1加密 2不加密
+
+export { witch }
diff --git a/pages/myinformation/myinformation.vue b/pages/myinformation/myinformation.vue
index 5d556d2..24363b0 100644
--- a/pages/myinformation/myinformation.vue
+++ b/pages/myinformation/myinformation.vue
@@ -25,7 +25,7 @@
{{appPersonallist.phone}}
-
+
切换家庭成员
@@ -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: "提示",
diff --git a/pagesB/Behaviorpoints/Behaviorpoints.vue b/pagesB/Behaviorpoints/Behaviorpoints.vue
index 56978dd..d0e9b17 100644
--- a/pagesB/Behaviorpoints/Behaviorpoints.vue
+++ b/pagesB/Behaviorpoints/Behaviorpoints.vue
@@ -23,7 +23,7 @@
{{score?score:0}}
-
+
积分榜排名:第{{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 => {
diff --git a/pagesB/PointsMall/PointsMall.vue b/pagesB/PointsMall/PointsMall.vue
index f0329fb..8b960b7 100644
--- a/pagesB/PointsMall/PointsMall.vue
+++ b/pagesB/PointsMall/PointsMall.vue
@@ -191,4 +191,4 @@
}
}
}
-
+
\ No newline at end of file
diff --git a/pagesB/exchangerecords/exchangerecords.vue b/pagesB/exchangerecords/exchangerecords.vue
index 49d9c45..5a4b41b 100644
--- a/pagesB/exchangerecords/exchangerecords.vue
+++ b/pagesB/exchangerecords/exchangerecords.vue
@@ -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() {
diff --git a/pagesB/register/register.vue b/pagesB/register/register.vue
index 689b390..4556fe7 100644
--- a/pagesB/register/register.vue
+++ b/pagesB/register/register.vue
@@ -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: '注册成功',