From e31e6d8fc5e68693147b6045de24bc241d974a75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E6=80=AA?= <690927457@qq.com> Date: Tue, 28 Nov 2023 22:30:40 +0800 Subject: [PATCH] 11.28 --- config/index.js | 2 +- pages/index/result.vue | 43 +++++++++++++++++++++++++++++++------- pages/index/visionTest.vue | 22 +++++++++---------- pages/wikipedia/index.vue | 4 +++- 4 files changed, 51 insertions(+), 20 deletions(-) diff --git a/config/index.js b/config/index.js index 33e2254..ef3e1f2 100644 --- a/config/index.js +++ b/config/index.js @@ -1,6 +1,6 @@ // isdev 为 true 表示开发环境 false 表示发布环境 const isdev = true; -const baseUrl = isdev ? 'http://e07b2b5.r9.cpolar.top' : 'http://eb467b6.r19.cpolar.top';// 办公室接口 & 测试环境 +const baseUrl = isdev ? 'http://47.116.50.126:8888' : 'http://eb467b6.r19.cpolar.top';// 办公室接口 & 测试环境 // const baseUrl = isdev ? 'http://192.168.1.133:8899' : 'https://api.gwkjxb.com';// 办公室接口 & 正式环境 // const baseUrl = 'https://api.gwkjxb.com';// 正式环境(由于本地测试后台没有启动,暂时通用正式服) diff --git a/pages/index/result.vue b/pages/index/result.vue index c1ecf40..f3a92b7 100644 --- a/pages/index/result.vue +++ b/pages/index/result.vue @@ -9,13 +9,12 @@ 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([ - 4.1, - 4.5 - ]) + const res_ = ref(null) const userInfo = ref(null) const bg_imgs = ref([ '/static/result1.jpg', @@ -23,9 +22,24 @@ '/static/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) + } + }) }