Compare commits

..

4 Commits

Author SHA1 Message Date
c4edb4ec3d 🎨 修改接口地址 2023-12-10 05:54:10 +08:00
e31e6d8fc5 11.28 2023-11-28 22:30:40 +08:00
eef9377e02 2023.11.23 2023-11-23 23:39:38 +08:00
3579868cc7 2023.11.16 2023-11-16 00:11:40 +08:00
8 changed files with 198 additions and 16 deletions

1
.gitignore vendored
View File

@@ -2,3 +2,4 @@ node_modules/*
package-lock.json
yarn.lock
unpackage
.hbuilderx

View File

@@ -1,6 +1,6 @@
// isdev 为 true 表示开发环境 false 表示发布环境
const isdev = true;
const baseUrl = isdev ? 'http://5a0a6573.r9.cpolar.top' : 'http://eb467b6.r19.cpolar.top';// 办公室接口 & 测试环境
const baseUrl = isdev ? 'https://api.jimingyiliao.com' : 'http://eb467b6.r19.cpolar.top';// 办公室接口 & 测试环境
// const baseUrl = isdev ? 'http://192.168.1.133:8899' : 'https://api.gwkjxb.com';// 办公室接口 & 正式环境
// const baseUrl = 'https://api.gwkjxb.com';// 正式环境(由于本地测试后台没有启动,暂时通用正式服)
@@ -18,4 +18,4 @@ const config = {
appID:'wx2a050f9a5c87a6dc',
isdev
}
export default config
export default config

View File

@@ -115,6 +115,11 @@
"style": {
"navigationBarTitleText": "客服中心"
}
},{
"path": "pages/index/result",
"style": {
"navigationBarTitleText": "测试结果"
}
}
],
"globalStyle": {

View File

@@ -46,14 +46,7 @@
is_loading.value = false
return
}
// 滚动条设置
uni.createSelectorQuery().in(instance).select('#scroll-view-content').boundingClientRect((res)=>{
let top = res.height-w_h.value+100;
if(top>0){
scrollTop.value = top;
}
// console.log(res.height,w_h.value)
}).exec()
records.value.push({
content:in_content.value,
type:2
@@ -83,6 +76,14 @@
duration:2000
})
}
// 滚动条设置
uni.createSelectorQuery().in(instance).select('#scroll-view-content').boundingClientRect((res)=>{
let top = res.height-w_h.value+100;
if(top>0){
scrollTop.value = top;
}
// console.log(res.height,w_h.value)
}).exec()
}
</script>
<template>

163
pages/index/result.vue Normal file
View File

@@ -0,0 +1,163 @@
<script setup>
// 引入依赖
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 { onLoad } from "@dcloudio/uni-app"
// import mySwiper from "@/components/mySwiper.vue"
import {ref,onMounted,nextTick} from "vue"
import {useStore} from '@/store/index.js'
import api from "@/api/index.js"
const store = useStore()
onLoad((e) => {
res_.value = JSON.parse(decodeURIComponent(e.res))
console.log(res_.value)
randomFunc()
})
// 变量
const res_ = ref(null)
const userInfo = ref(null)
const bg_imgs = 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_index = ref(0)
const avatarUrl = ref(null)
const info = ref({left:'',right:''})
const show_ = ref(false)
// 函数
function randomFunc() {
bg_index.value = parseInt((Math.random()*3))
uni.getImageInfo({
src:bg_imgs.value[bg_index.value],
success:function(res) {
avatarUrl.value = uni.getStorageSync('avatarUrl')
info.value.left = res_.value.leftEyeVision
info.value.right = res_.value.rightEyeVision
show_.value = true
},
fail(err) {
console.log(err)
}
})
}
</script>
<template>
<view class="visionTestBox page-box">
<!-- <view class="actionBox" :style="{background:`url(${bg_imgs[bg_index]})`}">
测试
</view> -->
<view class="actionBox">
<view class="img-box">
<image style="width: 100%;" :src="bg_imgs[bg_index]" mode="widthFix"></image>
<view v-if="show_" class="avatar-box">
<image :src="avatarUrl" mode="widthFix"></image>
</view>
<view v-if="show_" class="res-text-row">
<view class="rtr-left">{{info.left}}</view>
<view class="rtr-right">{{info.right}}</view>
</view>
</view>
</view>
</view>
</template>
<style scoped lang="scss">
.avatar-box{
width: 100%;
position: absolute;
top:280rpx;
image{
width: 260rpx;
margin: 0px auto;
display: block;
border-radius: 50%;
}
}
.img-box{
position: relative;
.res-text-row{
width: 100%;
display: flex;
justify-content: space-around;
align-items: center;
position: absolute;
top: 47%;
font-weight: 900;
color:gray;
.rtr-left{
margin-left: 20%;
}
}
}
.visionTestBox,.actionBox{
height: 100%;
}
.actionBox{
.ab-show-box{
// width: 100%;
height: 50%;
border: 2rpx solid #d0d0d0;
margin: 10rpx;
margin-top: 0px;
display: flex;
align-items: center;
justify-content: center;
image{
height: auto;
}
}
.ab-action-box{
.ac-row{
display: flex;
align-items: center;
justify-content: center;
.ac-row-card-text{
padding: 10rpx !important;
width: 80rpx !important;
height: 80rpx !important;
display: flex;
align-items: center;
justify-content: center;
}
.ac-row-card{
// white-space: nowrap;
margin: 20rpx;
font-size: 24rpx;
border-radius: 50%;
width: 40rpx;
height: 40rpx;
padding: 30rpx;
box-shadow: 2rpx 20rpx 40rpx #dfdfdf;
}
}
}
}
.content-text{
margin-bottom: 20rpx;
.ct-title{
text-align: center;
font-size: 34px;
color: #26758d;
}
}
.okBtn{
width: 100%;
color: white;
background-color: #26758d;
padding: 20rpx;
text-align: center;
box-sizing: border-box;
border-radius: 20rpx;
}
.pop-box{
.pb-title{
text-align: center;
margin-bottom: 40rpx;
}
background-color: white;
padding: 20rpx;
width: 80%;
margin: 0 auto;
border-radius: 20rpx;
}
</style>

View File

@@ -10,7 +10,6 @@
const store = useStore()
onLoad((e) => {
userInfo.value = JSON.parse(store.userInfo)
console.log(userInfo.value)
countDown.value = countDown_init
// if(!store.userInfo?.has_operation) { // 未填写手术信息
// setTimeout(()=>{
@@ -74,8 +73,14 @@
left:4,
right:4
})
const is_test = ref(true)
// 函数
function toStart() { // 开始测试
// if(is_test.value) {
// uni.navigateTo({
// url:'/pages/index/result'
// })
// }
inputDialog.value.close()
inputDialog2.value.open()
let s = setInterval(() => {
@@ -141,19 +146,23 @@
uni.showLoading({
mask:true
})
const res = await api.saveVision({
const params = {
leftEyeVision:vision_info.value.left+'',
rightEyeVision:vision_info.value.right+'',
userId:userInfo.value.userId
})
}
const res = await api.saveVision(params)
uni.hideLoading()
if(res.code == 0) {
uni.showToast({
title:"保存成功",
icon:"success",
duration:2000,
success: function (res){
uni.navigateBack()
success: function (res1){
// uni.navigateBack()
uni.redirectTo({
url:"/pages/index/result?res="+encodeURIComponent(JSON.stringify(params))
})
}
})

View File

@@ -7,6 +7,7 @@
import {ref,onMounted,nextTick} from "vue"
import {useStore} from '@/store/index.js'
import api from "@/api/index"
import emptyCard from "@/components/emptyCard.vue"
// 生命周期
onLoad(() => {
getList()
@@ -68,7 +69,7 @@
</view>
<view class="list-box">
<view class="lb-card" v-for="(item,i) in list" @tap="toDetail(item)">
<view v-if="list.length>0" class="lb-card" v-for="(item,i) in list" @tap="toDetail(item)">
<view class="lb-left">
<image :src="item.cover_img" mode="aspectFill"></image>
</view>
@@ -77,6 +78,7 @@
<view class="lb-content text-ellipsis-1 small-text" v-html="item.content"></view>
</view>
</view>
<emptyCard v-else></emptyCard>
</view>
</view>
</template>

View File

@@ -63,6 +63,7 @@ export const useStore = defineStore('main2', {
this.access_token = access_token
this.isLogin = true
this.userInfo = uni.getStorageSync('userInfo')
this.operation_info = uni.getStorageSync('operation_info')
// this.getUserInfo()
}
else{