diff --git a/pages.json b/pages.json
index 0840bd2..ece7f56 100644
--- a/pages.json
+++ b/pages.json
@@ -88,7 +88,29 @@
"navigationBarTitleText": "注意事项",
"enablePullDownRefresh": true
}
- }
+ },
+ {
+ "path": "pages/user/setting/userAgreement",
+ "style": {
+ "navigationBarTitleText": "用户协议"
+ }
+ },
+ {
+ "path": "pages/user/setting/privacyPolicy",
+ "style": {
+ "navigationBarTitleText": "隐私政策"
+ }
+ },{
+ "path": "pages/user/setting/phone_list",
+ "style": {
+ "navigationBarTitleText": "个人信息手机清单"
+ }
+ },{
+ "path": "pages/user/setting/aboutUs",
+ "style": {
+ "navigationBarTitleText": "关于我们"
+ }
+ },
],
"globalStyle": {
"navigationBarTextStyle": "white",
diff --git a/pages/index/index.vue b/pages/index/index.vue
index b5fca0b..99ea52a 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -2,6 +2,7 @@
// 引入依赖
import uniDatetimePicker from '@/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue'
import uniEasyinput from '@/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue'
+ import unCombox from '@/uni_modules/uni-combox/components/uni-combox/uni-combox.vue'
import { onLoad,onShow } from "@dcloudio/uni-app"
import mySwiper from "@/components/mySwiper.vue"
import {ref,onMounted,nextTick,watch} from "vue"
diff --git a/pages/user/setting.vue b/pages/user/setting.vue
index 77e0c67..90d9cd3 100644
--- a/pages/user/setting.vue
+++ b/pages/user/setting.vue
@@ -4,6 +4,7 @@
import {ref,onMounted,nextTick} from "vue"
import {useStore} from '@/store/index.js'
import api from "@/api/index.js"
+ const store = useStore()
onLoad(() => {
// console.log(useStore.userInfo)
userinfo.value = JSON.parse(uni.getStorageSync('userInfo'))
@@ -14,7 +15,39 @@
const avatar = ref(null)
// 方法
function toDetail(type) {
-
+ let url = ''
+ switch(type) {
+ case 1:
+ url = '/pages/user/setting/userAgreement'
+ break;
+ case 2:
+ url = '/pages/user/setting/privacyPolicy'
+ break;
+ case 3:
+ url = '/pages/user/setting/phone_list'
+ break;
+ case 4:
+ url = '/pages/user/setting/aboutUs'
+ break;
+ case 5: // 退出
+ uni.showModal({
+ title:"提示",
+ content:"确认要退出登录吗?",
+ success:async function(res) {
+ if(res.confirm) {
+ store.logout()
+ }
+ }
+ })
+ break;
+ default:
+ break;
+ }
+ if(url) {
+ uni.navigateTo({
+ url
+ })
+ }
}
@@ -30,7 +63,7 @@
-
+
@@ -40,7 +73,7 @@
-
+
@@ -50,7 +83,7 @@
-
+
@@ -60,7 +93,7 @@
-
+
diff --git a/pages/user/setting/aboutUs.vue b/pages/user/setting/aboutUs.vue
new file mode 100644
index 0000000..ec1f1e5
--- /dev/null
+++ b/pages/user/setting/aboutUs.vue
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/setting/phone_list.vue b/pages/user/setting/phone_list.vue
new file mode 100644
index 0000000..500a6ff
--- /dev/null
+++ b/pages/user/setting/phone_list.vue
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/setting/privacyPolicy.vue b/pages/user/setting/privacyPolicy.vue
new file mode 100644
index 0000000..c66446a
--- /dev/null
+++ b/pages/user/setting/privacyPolicy.vue
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/setting/userAgreement.vue b/pages/user/setting/userAgreement.vue
new file mode 100644
index 0000000..abf4ed3
--- /dev/null
+++ b/pages/user/setting/userAgreement.vue
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/userInfo.vue b/pages/user/userInfo.vue
index 10330e0..42e0667 100644
--- a/pages/user/userInfo.vue
+++ b/pages/user/userInfo.vue
@@ -2,26 +2,51 @@
import { onLoad } from "@dcloudio/uni-app"
// import mySwiper from "@/components/mySwiper.vue"
import {ref,onMounted,nextTick,computed} from "vue"
+ import unCombox from '@/uni_modules/uni-combox/components/uni-combox/uni-combox.vue'
import {useStore} from '@/store/index.js'
+ const store = useStore()
import api from "@/api/index.js"
onLoad(() => {
// console.log(useStore.userInfo)
userinfo.value = JSON.parse(uni.getStorageSync('userInfo'))
console.log(userinfo.value)
avatar.value = uni.getStorageSync('avatarUrl')
- h_info.value = JSON.parse(uni.getStorageSync('operation_info'))
- if(h_info.value) {
- // console.log(h_info.value)
- getHospital(h_info.value.hospitalId)
+ if(uni.getStorageSync('operation_info')) {
+ h_info.value = JSON.parse(uni.getStorageSync('operation_info'))
+ if(h_info.value) {
+ // console.log(h_info.value)
+ getHospital(h_info.value.hospitalId)
+ }
}
})
+ // 变量
+ const h_queryParams = ref({
+ page:1,
+ pageSize:1000,
+ key:''
+ })
+ const hospitals = ref(null)
const userinfo = ref({})
const avatar = ref(null)
- const h_info = ref(null)
+ const h_info = ref({})
const inputDialog = ref(null)
const input_title = ref(null)
+ const hValue = ref('') // 医院
+ const hValueId = ref('') // 医院id
+ // const form_data = ref({})
// const userForm = ref(null)
// 方法
+ async function getHospitalList() {
+ const res = await api.getHospitalList(h_queryParams.value)
+ if(res.code == 0) {
+ hospitals.value = res.data.list
+ }
+ }
+ function onClickH() {
+ h_queryParams.value.key = hValue.value
+ getHospitalList()
+
+ }
async function getHospital(id) {
const res = await api.getHospitalInfo(id)
if(res.code === 0) {
@@ -55,10 +80,11 @@
}
}
function finishFunc() {
-
+ inputDialog.value.close()
}
const startDate = computed(() => getDate('start'))
const endDate = computed(() => getDate('end'))
+ const choosed_h = ref(null)
const date = ref(null)
function getDate(type) {
const date = new Date();
@@ -75,8 +101,66 @@
day = day > 9 ? day : '0' + day;
return `${year}-${month}-${day}`;
}
- function bindDateChange() {
-
+ function bindDateChange(e) {
+ console.log(e)
+ h_info.value.surgery_time = e.detail.value
+ }
+ function toChooseH(item) {
+ console.log(item)
+ choosed_h.value = item
+ hValue.value = item.name
+ // hospitals.value = null
+ }
+ async function sumbmitFunc() {
+ console.log(choosed_h.value,h_info.value,userinfo.value)
+ let obj = {
+ id: userinfo.value.userId,
+ // isSurgery: 1, //是否已经手术 0为手术,1已经手术
+ surgery_time: h_info.value?.surgery_time, //手术时间
+ nickname: userinfo.value.nickname,
+ // avatar: '',
+ phone: userinfo.value.phone,
+ hospitalId:choosed_h.value?.ID
+ }
+ const res = await api.userinfoUpdae(obj)
+ if(res.code === 0) {
+ uni.showToast({
+ title:res.msg,
+ icon:"success",
+ duration:2000,
+ async success() {
+ await wx_login(userinfo.value.userId)
+ uni.navigateBack()
+ }
+ })
+ }
+ else{
+ uni.showToast({
+ title:res.msg,
+ icon:"error",
+ duration:2000
+ })
+ }
+ }
+ async function wx_login(userId){
+ let res=await new Promise(resolve=>{
+ uni.login({
+ provider: 'weixin', //使用微信登录
+ success: function (loginRes) {
+ resolve(loginRes);
+ console.log(loginRes,'微信登录返回信息');
+ }
+ });
+ });
+ let res2=await api.wx_login({code:res.code},userId);
+ if(res2.code === 0) {
+ uni.setStorageSync('userInfo',JSON.stringify(userinfo.value))
+ // is_login.value = custom.checkLogin()
+ store.checkLogin()
+ }
+ else{
+ uni.clearStorage();
+ }
}
@@ -113,8 +197,13 @@
手术时间
- {{h_info?.surgery_time}}
-
+
+
+
+ {{h_info?.surgery_time}}
+
+
+
@@ -124,7 +213,8 @@
手术医院
- {{h_info?.name}}
+
+
@@ -144,14 +234,11 @@
- 提交
+ 确定
-
-
- {{h_info?.surgery_time}}
-
+ 确定