2023.11.7
This commit is contained in:
parent
b1e3735af0
commit
7c6e881e03
24
pages.json
24
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",
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
@ -30,7 +63,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="rb-card" @tap="toDetail(1)">
|
||||
<view class="rb-card" @tap="toDetail(2)">
|
||||
<view class="rbc-content">
|
||||
<view class="rbc-content-row rbc-content-left rbc-content-left-box">
|
||||
<!-- <uni-icons type="phone" color="gray" size="26"></uni-icons> -->
|
||||
@ -40,7 +73,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="rb-card" @tap="toDetail(1)">
|
||||
<view class="rb-card" @tap="toDetail(3)">
|
||||
<view class="rbc-content">
|
||||
<view class="rbc-content-row rbc-content-left rbc-content-left-box">
|
||||
<!-- <uni-icons type="calendar" color="gray" size="26"></uni-icons> -->
|
||||
@ -50,7 +83,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="rb-card" @tap="toDetail(1)">
|
||||
<view class="rb-card" @tap="toDetail(4)">
|
||||
<view class="rbc-content">
|
||||
<view class="rbc-content-row rbc-content-left rbc-content-left-box">
|
||||
<!-- <uni-icons type="paperplane" color="gray" size="26"></uni-icons> -->
|
||||
@ -60,7 +93,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="rb-card" @tap="toDetail(1)">
|
||||
<view class="rb-card" @tap="toDetail(5)">
|
||||
<view class="rbc-content">
|
||||
<view class="rbc-content-row rbc-content-left rbc-content-left-box">
|
||||
<!-- <uni-icons type="paperplane" color="gray" size="26"></uni-icons> -->
|
||||
|
11
pages/user/setting/aboutUs.vue
Normal file
11
pages/user/setting/aboutUs.vue
Normal file
@ -0,0 +1,11 @@
|
||||
<script setup>
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<view class="aboutUs page-box page-bg-gray">
|
||||
|
||||
</view>
|
||||
</template>
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
11
pages/user/setting/phone_list.vue
Normal file
11
pages/user/setting/phone_list.vue
Normal file
@ -0,0 +1,11 @@
|
||||
<script setup>
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<view class="phone_list page-box page-bg-gray">
|
||||
|
||||
</view>
|
||||
</template>
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
11
pages/user/setting/privacyPolicy.vue
Normal file
11
pages/user/setting/privacyPolicy.vue
Normal file
@ -0,0 +1,11 @@
|
||||
<script setup>
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<view class="privacyPolicy page-box page-bg-gray">
|
||||
|
||||
</view>
|
||||
</template>
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
11
pages/user/setting/userAgreement.vue
Normal file
11
pages/user/setting/userAgreement.vue
Normal file
@ -0,0 +1,11 @@
|
||||
<script setup>
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<view class="userAgreement page-box page-bg-gray">
|
||||
|
||||
</view>
|
||||
</template>
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
@ -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();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
@ -113,8 +197,13 @@
|
||||
<uni-icons type="calendar" color="gray" size="26"></uni-icons>
|
||||
手术时间</view>
|
||||
<view class="rbc-content-row rbc-content-right">
|
||||
{{h_info?.surgery_time}}
|
||||
<uni-icons type="forward" color="gray" size="20"></uni-icons>
|
||||
<!-- {{h_info?.surgery_time}} -->
|
||||
<picker mode="date" :value="h_info?.surgery_time" :start="startDate" :end="endDate" @change="bindDateChange">
|
||||
<view class="rbc-content-row rbc-content-right">
|
||||
<view class="uni-input"> {{h_info?.surgery_time}}</view>
|
||||
<uni-icons type="forward" color="gray" size="20"></uni-icons>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -124,7 +213,8 @@
|
||||
<uni-icons type="paperplane" color="gray" size="26"></uni-icons>
|
||||
手术医院</view>
|
||||
<view class="rbc-content-row rbc-content-right">
|
||||
{{h_info?.name}}
|
||||
<!-- {{h_info?.name}} -->
|
||||
<uni-combox @input="onClickH" :candidates="hospitals" placeholder="请选择医院" @choosed="toChooseH" v-model="hValue"></uni-combox>
|
||||
<uni-icons type="forward" color="gray" size="20"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
@ -144,14 +234,11 @@
|
||||
<uni-easyinput :inputBorder="false" v-else borderColor="#26758d" v-model="userinfo.phone" focus placeholder="输入您的电话"></uni-easyinput>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pb-item pb-item-btn" @tap="finishFunc">提交</view>
|
||||
<view class="pb-item pb-item-btn" @tap="finishFunc">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
<!-- 手术时间 -->
|
||||
<picker mode="date" :value="date" :start="startDate" :end="endDate" @change="bindDateChange">
|
||||
<view class="uni-input"> {{h_info?.surgery_time}}</view>
|
||||
</picker>
|
||||
<view class="pb-item pb-item-btn" style="margin-top: 40rpx;" @tap="sumbmitFunc">确定</view>
|
||||
</view>
|
||||
</template>
|
||||
<style scoped lang="scss">
|
||||
|
Loading…
Reference in New Issue
Block a user