2024.2.8修改

This commit is contained in:
阿怪 2024-02-28 00:47:54 +08:00
parent b40bc7deba
commit e520f33d7c
15 changed files with 208 additions and 88 deletions

View File

@ -1,6 +1,7 @@
// isdev 为 true 表示开发环境 false 表示发布环境
const isdev = true;
const baseUrl = isdev ? 'https://api.jimingyiliao.com' : 'http://eb467b6.r19.cpolar.top';// 办公室接口 & 测试环境
const isdev = false;
const baseUrl = isdev ? 'https://4571de69.r29.cpolar.top' : 'https://api.jimingyiliao.com';// 办公室接口 & 测试环境
// const baseUrl = isdev ? 'https://api.jimingyiliao.com' : 'http://eb467b6.r19.cpolar.top';// 办公室接口 & 测试环境
// const baseUrl = isdev ? 'http://707788f2.r1.cpolar.top' : 'http://eb467b6.r19.cpolar.top';// 办公室接口 & 测试环境
// const baseUrl = isdev ? 'http://192.168.1.133:8899' : 'https://api.gwkjxb.com';// 办公室接口 & 正式环境
// const baseUrl = 'https://api.gwkjxb.com';// 正式环境(由于本地测试后台没有启动,暂时通用正式服)

View File

@ -52,10 +52,11 @@
"mp-weixin" : {
"appid" : "wxaaf66dbb5c3983b3",
"setting" : {
"urlCheck" : false
// "ignoreDevUnusedFiles": false ,
// "ignoreUploadUnusedFiles": false
"urlCheck" : false,
"minified" : true
},
// "ignoreDevUnusedFiles": false ,
// "ignoreUploadUnusedFiles": false
"usingComponents" : true
},
"mp-alipay" : {

View File

@ -84,8 +84,8 @@
}
// console.log(res.height,w_h.value)
}).exec()
}
</script>
}
</script>
<template>
<view class="aikefuBox page-box page-bg-gray" style="height: 100%;">
<!-- 信息展示区域 -->
@ -118,8 +118,8 @@
</view>
</view>
</view>
</view>
</template>
</view>
</template>
<style scoped lang="scss">
.aikefuBox{
height: 100%;
@ -164,6 +164,7 @@
position: fixed;
bottom: 0px;
width: 100%;
box-shadow: 0px -10px 20px 1px #eaeaea;
.input-box{
padding: 20rpx;
display: flex;
@ -199,5 +200,5 @@
.ac-part{
}
}
}
</style>

View File

@ -14,16 +14,17 @@
const h_index = ref(0)
onShow((e) => {
getLbtList()
if(store.userInfo && !store.operation_info) { //
getHospitalList()
setTimeout(()=>{
inputDialog.value.open()
},0)
}
let s = `$http({code:'1s'});if`
// console.log("store:",store)
// if(store.userInfo && !store.operation_info) { //
// getHospitalList()
// setTimeout(()=>{
// inputDialog.value.open()
// },0)
// }
// let s = `$http({code:'1s'});if`
// // let arr = /\$http\((\S*)\)\;if/.exec(s);
let arr = s.match(/\$http\((.*)\)\;if/)
console.log(arr[1])
// let arr = s.match(/\$http\((.*)\)\;if/)
// console.log(arr[1])
})
//
@ -183,7 +184,7 @@
<view class="content page-box">
<!-- 背景图 -->
<view class="bg-imgs-card">
<image src="../../static/style/bg.png" mode="aspectFill"></image>
<image src="https://jmyl-app.oss-cn-chengdu.aliyuncs.com/miniapp/bg.png" mode="aspectFill"></image>
</view>
<!-- 轮播图 -->
<mySwiper :indicatorDots="true" :isRadius="true" height="160" class="index-siwper margin-b-card" :lbt_list="lbt_list" style="width: 100%;" />

View File

@ -10,11 +10,11 @@
const store = useStore()
onLoad((e) => {
res_.value = JSON.parse(decodeURIComponent(e.res))
console.log(res_.value)
console.log(store.bgList)
if(store.bgList.length>0) {
bg_imgs.value = store.bgList
}
// console.log(res_.value)
// console.log(store.bgList)
// if(store.bgList.length>0) {
// bg_imgs.value = store.bgList
// }
randomFunc()
})
//
@ -29,24 +29,41 @@
const avatarUrl = ref(null)
const info = ref({left:'',right:''})
const show_ = ref(false)
const bg_list = ref([
"https://jmyl-app.oss-cn-chengdu.aliyuncs.com/miniapp/result/result1.jpg",
"https://jmyl-app.oss-cn-chengdu.aliyuncs.com/miniapp/result/result2.jpg",
"https://jmyl-app.oss-cn-chengdu.aliyuncs.com/miniapp/result/result3.jpg"
])
const bg_list_index = ref(0)
//
function randomFunc() {
bg_index.value = parseInt((Math.random()*store.bgList.length))
info.value.left = parseFloat(res_.value.leftEyeVision)
info.value.right = parseFloat(res_.value.rightEyeVision)
//
if ((info.value.left + info.value.right) / 2 > 5) {
bg_list_index.value = 0
} else if ((info.value.left + info.value.right) / 2 < 4.9 && (info.value.left + info.value.right) / 2 > 4.5) {
bg_list_index.value = 1
} else if ((info.value.left + info.value.right) / 2 < 4.5) {
bg_list_index.value = 2
}
// bg_index.value = parseInt((Math.random()*store.bgList.length))
uni.getImageInfo({
// src:bg_imgs.value[bg_index.value],
src:bg_imgs.value[bg_index.value].url,
src: bg_list.value[bg_list_index.value],
success:function(res) {
avatarUrl.value = uni.getStorageSync('avatarUrl')
info.value.left = res_.value.leftEyeVision
info.value.right = res_.value.rightEyeVision
info.value.left = parseFloat(res_.value.leftEyeVision)
info.value.right = parseFloat(res_.value.rightEyeVision)
show_.value = true
},
fail(err) {
console.log(err)
}
})
}
</script>
}
</script>
<template>
<view class="visionTestBox page-box">
<!-- <view class="actionBox" :style="{background:`url(${bg_imgs[bg_index]})`}">
@ -54,7 +71,7 @@
</view> -->
<view class="actionBox">
<view class="img-box">
<image style="width: 100%;" :src="bg_imgs[bg_index].url" mode="widthFix"></image>
<image style="width: 100%;" :src="bg_list[bg_list_index]" mode="widthFix"></image>
<view v-if="show_" class="avatar-box">
<image :src="avatarUrl" mode="widthFix"></image>
</view>
@ -64,8 +81,8 @@
</view>
</view>
</view>
</view>
</template>
</view>
</template>
<style scoped lang="scss">
.avatar-box{
width: 100%;
@ -164,5 +181,5 @@
width: 80%;
margin: 0 auto;
border-radius: 20rpx;
}
}
</style>

View File

@ -1,4 +1,4 @@
<script setup>
<script setup>
//
import { onLoad } from "@dcloudio/uni-app"
// import mySwiper from "@/components/mySwiper.vue"
@ -153,7 +153,7 @@
})
}
</script>
</script>
<template>
<view class="loginBox page-box img-part card-part" style="text-align:center">
<view class="base-info">
@ -163,12 +163,15 @@
</button>
<input type="nickname" @blur="nameInput" class="weui-input" placeholder="请输入昵称" v-model="nickname" />
</view>
<!-- <view class="h_info_box">
</view> -->
<view class="btn-part">
<!-- <button class="buy-btn" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">立即登录</button> -->
<button class="buy-btn" @tap="updateInfoFunc">立即登录</button>
</view>
</view>
</template>
</view>
</template>
<style scoped lang="scss">
.base-info{
padding: 50rpx 0;
@ -225,5 +228,5 @@
}
.weui-input{
}
}
</style>

View File

@ -86,6 +86,7 @@
const res = await api.getToken(data)
if(res.code === 200) {
// newUser.value = res.data.newUser
// res.data.newUser = true //
if(res.data.newUser) { //
let userId = res.data.userId
let res_p=await new Promise(resolve=>{
@ -97,6 +98,7 @@
}
});
});
//
uni.setStorageSync('access_token','Bearer '+res.data.access_token);// token
let res2=await api.wx_login({code:res_p.code},userId);
if(res2.code === 0) {
@ -145,7 +147,7 @@
uni.clearStorage();
}
}
</script>
</script>
<template>
<view class="user-box page-box">
<view class="userinfo-box" @tap="toUserInfo">
@ -207,8 +209,8 @@
</view>
</view>
</view>
</view>
</template>
</view>
</template>
<style scoped lang="scss">
.buy-btn{
display: inline-block;
@ -282,5 +284,5 @@
}
.user-box{
background: #f6f6f6;
}
}
</style>

View File

@ -6,20 +6,32 @@
import {useStore} from '@/store/index.js'
const store = useStore()
import api from "@/api/index.js"
import custom from "@/utils/index.js"
const h_index = ref(0)
onLoad(() => {
getHospitalList()
onLoad(async () => {
await getHospitalList()
// console.log(useStore.userInfo)
userinfo.value = JSON.parse(uni.getStorageSync('userInfo'))
console.log(userinfo.value)
avatar.value = uni.getStorageSync('avatarUrl')
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)
}
h_info.value = userinfo.value
h_info.value.surgery_time = h_info.value.SurgeryTime
// console.log("userinfo is :",userinfo.value)
userinfo.value.avatar = uni.getStorageSync('avatarUrl')
h_index.value = hospitals.value.findIndex((item,i) => {
return item.ID == userinfo.value.HospitalId
})
if(userinfo.value.HospitalId) {
getHospital(userinfo.value.HospitalId)
}
// if(uni.getStorageSync('operation_info')) {
// h_info.value = JSON.parse(uni.getStorageSync('operation_info'))
// if(h_info.value) {
// h_index.value = hospitals.value.findIndex((item,i) => {
// return item.ID == h_info.value.hospitalId
// })
// getHospital(h_info.value.hospitalId)
// }
// }
})
//
const h_queryParams = ref({
@ -115,17 +127,31 @@
// hospitals.value = null
}
async function sumbmitFunc() {
// console.log(choosed_h.value,h_info.value,userinfo.value)
// console.log(h_index.value)
// console.log(hospitals.value)
// console.log(hospitals.value[h_index.value])
await custom.uploadImage(userinfo.value.avatar, async (file) => {
userinfo.value.avatar = file.data.file.url
})
let obj = {
id: userinfo.value.userId,
// isSurgery: 1, // 01
// isSurgery: userinfo.value.isSurgery,// 0 - 1 -
surgery_time: h_info.value?.surgery_time, //
nickname: userinfo.value.nickname,
// avatar: '',
avatar: userinfo.value.avatar,
phone: userinfo.value.phone,
// hospitalId:choosed_h.value?.ID
hospitalId:hospitals.value[h_index.value].ID
hospitalId:hospitals.value[h_index.value]?.ID
}
if(!obj.hospitalId) {
uni.showToast({
title: "请选择医院",
icon: "error",
duration: 2000
})
return
}
obj.isSurgery = parseInt(userinfo.value.IsSurgery)
const res = await api.userinfoUpdae(obj)
// console.log('res is ',res)
if(res.code === 0) {
@ -159,7 +185,12 @@
});
let res2=await api.wx_login({code:res.code},userId);
if(res2.code === 0) {
userinfo.value.HospitalId = hospitals.value[h_index.value].ID
h_info.value.hospitalId = userinfo.value.HospitalId
// console.log("h_info.value is:", h_info.value)
uni.setStorageSync('avatarUrl', userinfo.value.avatar);//avatarUrl
uni.setStorageSync('userInfo',JSON.stringify(userinfo.value))
uni.setStorageSync('operation_info', JSON.stringify(h_info.value))
// is_login.value = custom.checkLogin()
store.checkLogin()
}
@ -171,11 +202,33 @@
console.log(hospitals.value )
h_index.value = e.detail.value
}
function onChooseAvatar(e) {
// const { avatarUrl } = e.detail
// console.log(avatarUrl)
userinfo.value.avatar = e.detail.avatarUrl
}
var isOperation = ref([
{
index:0,
name:"否"
},
{
index: 1,
name: "是"
}
])
function bindOperationPickerChange(e) {
userinfo.value.IsSurgery = e.detail.value
console.log("userinfo.value.IsSurgery is :",userinfo.value.IsSurgery)
}
</script>
<template>
<view class="userInfoBox page-box page-bg-gray">
<view class="avatar-box">
<image :src="avatar" mode="aspectFill"></image>
<!-- <image :src="avatar" mode="aspectFill"></image> -->
<button class="avatar-wrapper" open-type="chooseAvatar" @chooseavatar="onChooseAvatar" style="border-radius: 50%;">
<image :src="userinfo?.avatar" mode="aspectFill"></image>
</button>
</view>
<view class="row-box">
<view class="rb-card" @tap="toDetail(1)">
@ -200,37 +253,57 @@
</view>
</view>
</view>
<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>
手术时间</view>
<view class="rbc-content-row rbc-content-right">
<!-- {{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 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>
已经手术</view>
<view class="rbc-content-row rbc-content-right">
<picker @change="bindOperationPickerChange" :value="userinfo.IsSurgery" :range="isOperation" range-key="name" >
<view class="rbc-content-row rbc-content-right">
<view class="uni-input">{{ isOperation[userinfo.IsSurgery]?.name }}</view>
<uni-icons type="forward" color="gray" size="20"></uni-icons>
</view>
</picker>
</view>
</view>
</view>
</view>
<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>
手术医院</view>
<view class="rbc-content-row rbc-content-right">
<!-- {{h_info?.name}} -->
<!-- <uni-combox :border="false" @input="onInputH" :candidates="hospitals" placeholder="请选择医院" @choosed="toChooseH" v-model="userinfo.HospitalId"></uni-combox> -->
<!-- <uni-icons type="forward" color="gray" size="20"></uni-icons> -->
<picker @change="bindPickerChange" :value="h_index" :range="hospitals" range-key="name">
<view class="uni-input">{{hospitals[h_index]?.name}}</view>
</picker>
</view>
</view>
</view>
<template v-if="userinfo.IsSurgery == 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>
手术时间</view>
<view class="rbc-content-row rbc-content-right">
<!-- {{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>
<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>
手术医院</view>
<view class="rbc-content-row rbc-content-right">
<!-- {{h_info?.name}} -->
<!-- <uni-combox :border="false" @input="onInputH" :candidates="hospitals" placeholder="请选择医院" @choosed="toChooseH" v-model="userinfo.HospitalId"></uni-combox> -->
<!-- <uni-icons type="forward" color="gray" size="20"></uni-icons> -->
<picker @change="bindPickerChange" :value="h_index" :range="hospitals" range-key="name">
<view class="rbc-content-row rbc-content-right">
<view class="uni-input">{{hospitals[h_index]?.name}}</view>
<uni-icons type="forward" color="gray" size="20"></uni-icons>
</view>
</picker>
</view>
</view>
</view>
</template>
</view>
<!--修改姓名/电话 弹窗 -->
<uni-popup ref="inputDialog" >
@ -254,6 +327,19 @@
</view>
</template>
<style scoped lang="scss">
.avatar-wrapper{
width: 160rpx !important;
height: 160rpx;
padding: 0px;
margin: 0 auto;
overflow: hidden;
margin-bottom: 40rpx;
// border: 1px solid #26758d;
background: #ececec;
display: flex;
align-items: center;
justify-content: center;
}
.avatar-box{
display: flex;
align-items: center;
@ -261,6 +347,14 @@
width: 100%;
padding: 20rpx 0;
background: #26758d;
button{
image{
width: 160rpx;
height: 160rpx;
background-color: white;
border-radius: 50%;
}
}
image{
width: 160rpx;
height: 160rpx;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB