diff --git a/pages.json b/pages.json index 6ee921b..964c938 100644 --- a/pages.json +++ b/pages.json @@ -54,6 +54,12 @@ "style": { "navigationBarTitleText": "问题反馈" } + }, + { + "path": "pages/index/visionTest", + "style": { + "navigationBarTitleText": "视力测试" + } } ], "globalStyle": { diff --git a/pages/index/index.vue b/pages/index/index.vue index bf13dbe..914b08f 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -52,18 +52,29 @@ } const single = ref('') function maskClick(e){ - console.log('maskClick事件:', e); + // console.log('maskClick事件:', e); } const hValue = ref('') // 医院 const hValueId = ref('') // 医院id function onClickH(e) { - console.log(hValue.value) + // console.log(hValue.value) + } + function toExam() { // 视力测试 + uni.navigateTo({ + url:"/pages/index/visionTest" + }) } \ No newline at end of file diff --git a/static/1.png b/static/1.png new file mode 100644 index 0000000..c64dcbb Binary files /dev/null and b/static/1.png differ diff --git a/static/2.png b/static/2.png new file mode 100644 index 0000000..f840bdd Binary files /dev/null and b/static/2.png differ diff --git a/static/3.png b/static/3.png new file mode 100644 index 0000000..d69e473 Binary files /dev/null and b/static/3.png differ diff --git a/static/4.png b/static/4.png new file mode 100644 index 0000000..b271c04 Binary files /dev/null and b/static/4.png differ diff --git a/unpackage/dist/dev/mp-weixin/app.js b/unpackage/dist/dev/mp-weixin/app.js index ec23a9b..024b67c 100644 --- a/unpackage/dist/dev/mp-weixin/app.js +++ b/unpackage/dist/dev/mp-weixin/app.js @@ -11,6 +11,7 @@ if (!Math) { "./pages/user/star.js"; "./pages/user/setting.js"; "./pages/user/feedback.js"; + "./pages/index/visionTest.js"; } const _sfc_main = { onLaunch: function() { diff --git a/unpackage/dist/dev/mp-weixin/app.json b/unpackage/dist/dev/mp-weixin/app.json index 7053395..e25d3ec 100644 --- a/unpackage/dist/dev/mp-weixin/app.json +++ b/unpackage/dist/dev/mp-weixin/app.json @@ -8,7 +8,8 @@ "pages/login/login", "pages/user/star", "pages/user/setting", - "pages/user/feedback" + "pages/user/feedback", + "pages/index/visionTest" ], "window": { "navigationBarTextStyle": "white", diff --git a/unpackage/dist/dev/mp-weixin/pages/index/index.js b/unpackage/dist/dev/mp-weixin/pages/index/index.js index 7faad92..e87023f 100644 --- a/unpackage/dist/dev/mp-weixin/pages/index/index.js +++ b/unpackage/dist/dev/mp-weixin/pages/index/index.js @@ -66,12 +66,15 @@ const _sfc_main = { } const single = common_vendor.ref(""); function maskClick(e) { - console.log("maskClick事件:", e); } const hValue = common_vendor.ref(""); common_vendor.ref(""); function onClickH(e) { - console.log(hValue.value); + } + function toExam() { + common_vendor.index.navigateTo({ + url: "/pages/index/visionTest" + }); } return (_ctx, _cache) => { return { @@ -82,41 +85,47 @@ const _sfc_main = { lbt_list: lbt_list.value }), b: common_vendor.p({ + type: "forward", + color: "#9bc027", + size: "20" + }), + c: common_vendor.o(toExam), + d: common_vendor.p({ type: "forward", color: "#ffa2a2", size: "20" }), - c: common_vendor.p({ + e: common_vendor.p({ type: "forward", color: "#f9b275", size: "20" }), - d: common_vendor.p({ + f: common_vendor.p({ type: "forward", color: "#8fdc8a", size: "20" }), - e: common_vendor.o(radioChange), - f: common_vendor.o(maskClick), - g: common_vendor.o(($event) => single.value = $event), - h: common_vendor.p({ + g: common_vendor.o(radioChange), + h: common_vendor.o(maskClick), + i: common_vendor.o(($event) => single.value = $event), + j: common_vendor.p({ type: "date", ["clear-icon"]: false, modelValue: single.value }), - i: common_vendor.o(onClickH), - j: common_vendor.o(($event) => hValue.value = $event), - k: common_vendor.p({ + k: common_vendor.o(onClickH), + l: common_vendor.o(($event) => hValue.value = $event), + m: common_vendor.p({ suffixIcon: "search", focus: true, placeholder: "请输入内容", modelValue: hValue.value }), - l: common_vendor.o(toClose), - m: common_vendor.sr(inputDialog, "1cf27b2a-4", { + n: common_vendor.o(toClose), + o: common_vendor.sr(inputDialog, "1cf27b2a-5", { "k": "inputDialog" }), - n: common_vendor.p({ + p: common_vendor.p({ ["is-mask-click"]: false }) }; diff --git a/unpackage/dist/dev/mp-weixin/pages/index/index.wxml b/unpackage/dist/dev/mp-weixin/pages/index/index.wxml index d932a8b..7686867 100644 --- a/unpackage/dist/dev/mp-weixin/pages/index/index.wxml +++ b/unpackage/dist/dev/mp-weixin/pages/index/index.wxml @@ -1 +1 @@ -已完成事项待完成事项 注意事项 术前注意事项 术中注意事项 术后注意事项 完善手术信息已经手术手术时间医院名称 关闭 \ No newline at end of file +视力测试已完成事项待完成事项 注意事项 术前注意事项 术中注意事项 术后注意事项 完善手术信息已经手术手术时间医院名称 关闭 \ No newline at end of file diff --git a/unpackage/dist/dev/mp-weixin/pages/index/index.wxss b/unpackage/dist/dev/mp-weixin/pages/index/index.wxss index e0488ce..ee4cd5b 100644 --- a/unpackage/dist/dev/mp-weixin/pages/index/index.wxss +++ b/unpackage/dist/dev/mp-weixin/pages/index/index.wxss @@ -23,6 +23,17 @@ /* 垂直间距 */ /* 透明度 */ /* 文章场景相关 */ +.mc-row.data-v-1cf27b2a { + display: flex; + width: 100%; + justify-content: space-between; + border: 1px solid #9bc027; + padding: 20px 10px; + border-radius: 10px; + color: #9bc027; + font-size: 16px; + font-weight: 900; +} .radio.data-v-1cf27b2a { margin-right: 20rpx; } diff --git a/unpackage/dist/dev/mp-weixin/pages/index/visionTest.js b/unpackage/dist/dev/mp-weixin/pages/index/visionTest.js new file mode 100644 index 0000000..87321e1 --- /dev/null +++ b/unpackage/dist/dev/mp-weixin/pages/index/visionTest.js @@ -0,0 +1,162 @@ +"use strict"; +const common_vendor = require("../../common/vendor.js"); +const store_index = require("../../store/index.js"); +require("../../api/index.js"); +require("../../api/request.js"); +require("../../config/index.js"); +if (!Array) { + const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup"); + _easycom_uni_popup2(); +} +const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js"; +if (!Math) { + _easycom_uni_popup(); +} +const _sfc_main = { + __name: "visionTest", + setup(__props) { + const store = store_index.useStore(); + common_vendor.onLoad((e) => { + var _a; + if (!((_a = store.userInfo) == null ? void 0 : _a.has_operation)) { + setTimeout(() => { + inputDialog.value.open(); + }, 0); + } + }); + const inputDialog = common_vendor.ref(); + const inputDialog2 = common_vendor.ref(); + const inputDialog3 = common_vendor.ref(); + const step1 = common_vendor.ref("先测右眼,请遮住左眼"); + common_vendor.ref("请遮住右眼"); + const countDown = common_vendor.ref(5); + common_vendor.ref(1); + const current_img = common_vendor.ref(""); + const current_img_index = common_vendor.ref(null); + const sizes = common_vendor.ref([ + { + size: 23, + vision: 4.2 + }, + { + size: 19, + vision: 4.2 + }, + { + size: 15, + vision: 4.2 + }, + { + size: 11, + vision: 4.2 + }, + { + size: 9, + vision: 4.2 + }, + { + size: 7, + vision: 4.2 + }, + { + size: 6, + vision: 4.2 + }, + { + size: 4, + vision: 4.2 + }, + { + size: 3, + vision: 4.2 + } + ]); + const show_size = common_vendor.ref({ + width: "29px" + }); + const num = common_vendor.ref(0); + const now = common_vendor.ref(1); + const vision_info = common_vendor.ref({ + left: 4, + right: 4.1 + }); + function toStart() { + inputDialog.value.close(); + inputDialog2.value.open(); + let s = setInterval(() => { + countDown.value--; + if (countDown.value == 0) { + clearInterval(s); + inputDialog2.value.close(); + } + }, 1e3); + randomFunc(); + } + function randomFunc() { + let ran = Math.ceil(Math.random() * 4); + if (current_img_index.value == ran) { + randomFunc(); + } else { + current_img.value = "../../static/" + ran + ".png"; + current_img_index.value = ran; + } + } + function chooseFunc(index) { + randomFunc(); + if (num.value > 8) { + if (now.value == 2) { + return; + } + show_size.value.width = "29px"; + countDown.value = 5; + step1.value = "测左眼,请遮住右眼"; + num.value = 8; + now.value = 2; + toStart(); + } else { + show_size.value.width = sizes.value[num.value].size + "px"; + num.value++; + } + } + function okFunc() { + inputDialog3.value.open(); + } + return (_ctx, _cache) => { + return { + a: current_img.value, + b: common_vendor.s(show_size.value), + c: common_vendor.o(($event) => chooseFunc()), + d: common_vendor.o(($event) => chooseFunc()), + e: common_vendor.o(($event) => chooseFunc()), + f: common_vendor.o(($event) => chooseFunc()), + g: common_vendor.o(($event) => chooseFunc()), + h: common_vendor.o(toStart), + i: common_vendor.sr(inputDialog, "29752d91-0", { + "k": "inputDialog" + }), + j: common_vendor.p({ + ["is-mask-click"]: true + }), + k: common_vendor.t(countDown.value), + l: common_vendor.t(step1.value), + m: common_vendor.sr(inputDialog2, "29752d91-1", { + "k": "inputDialog2" + }), + n: common_vendor.p({ + ["is-mask-click"]: false + }), + o: common_vendor.t(vision_info.value.left), + p: common_vendor.t(vision_info.value.right), + q: common_vendor.o(okFunc), + r: common_vendor.sr(inputDialog3, "29752d91-2", { + "k": "inputDialog3" + }), + s: common_vendor.p({ + ["is-mask-click"]: true + }) + }; + }; + } +}; +const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-29752d91"], ["__file", "F:/项目2023/视力表/vision-record/pages/index/visionTest.vue"]]); +wx.createPage(MiniProgramPage); diff --git a/unpackage/dist/dev/mp-weixin/pages/index/visionTest.json b/unpackage/dist/dev/mp-weixin/pages/index/visionTest.json new file mode 100644 index 0000000..bc01403 --- /dev/null +++ b/unpackage/dist/dev/mp-weixin/pages/index/visionTest.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "视力测试", + "usingComponents": { + "uni-popup": "../../uni_modules/uni-popup/components/uni-popup/uni-popup" + } +} \ No newline at end of file diff --git a/unpackage/dist/dev/mp-weixin/pages/index/visionTest.wxml b/unpackage/dist/dev/mp-weixin/pages/index/visionTest.wxml new file mode 100644 index 0000000..057d7f8 --- /dev/null +++ b/unpackage/dist/dev/mp-weixin/pages/index/visionTest.wxml @@ -0,0 +1 @@ +看不清测试须知 使用uni-app自带的editor组件,该组件支持App、H5、微信小程序,其他家小程序自身未提供这类解决方案。 确定测试须知{{k}}{{l}}测试结束 测试结束,当前视力为{{o}}(左),{{p}}(右)。 确定 \ No newline at end of file diff --git a/unpackage/dist/dev/mp-weixin/pages/index/visionTest.wxss b/unpackage/dist/dev/mp-weixin/pages/index/visionTest.wxss new file mode 100644 index 0000000..8440779 --- /dev/null +++ b/unpackage/dist/dev/mp-weixin/pages/index/visionTest.wxss @@ -0,0 +1,87 @@ +/** + * 这里是uni-app内置的常用样式变量 + * + * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 + * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App + * + */ +/** + * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 + * + * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 + */ +/* 颜色变量 */ +/* 行为相关颜色 */ +/* 文字基本颜色 */ +/* 背景颜色 */ +/* 边框颜色 */ +/* 尺寸变量 */ +/* 文字尺寸 */ +/* 图片尺寸 */ +/* Border Radius */ +/* 水平间距 */ +/* 垂直间距 */ +/* 透明度 */ +/* 文章场景相关 */ +.visionTestBox.data-v-29752d91, .actionBox.data-v-29752d91 { + height: 100%; +} +.actionBox .ab-show-box.data-v-29752d91 { + height: 50%; + border: 2rpx solid #d0d0d0; + margin: 10rpx; + margin-top: 0px; + display: flex; + align-items: center; + justify-content: center; +} +.actionBox .ab-action-box .ac-row.data-v-29752d91 { + display: flex; + align-items: center; + justify-content: center; +} +.actionBox .ab-action-box .ac-row .ac-row-card-text.data-v-29752d91 { + padding: 10rpx !important; + width: 80rpx !important; + height: 80rpx !important; + display: flex; + align-items: center; + justify-content: center; +} +.actionBox .ab-action-box .ac-row .ac-row-card.data-v-29752d91 { + margin: 20rpx; + font-size: 24rpx; + border-radius: 50%; + width: 40rpx; + height: 40rpx; + padding: 30rpx; + box-shadow: 2rpx 20rpx 40rpx #dfdfdf; +} +.content-text.data-v-29752d91 { + margin-bottom: 20rpx; +} +.content-text .ct-title.data-v-29752d91 { + text-align: center; + font-size: 34px; + color: #26758d; +} +.okBtn.data-v-29752d91 { + width: 100%; + color: white; + background-color: #26758d; + padding: 20rpx; + text-align: center; + box-sizing: border-box; + border-radius: 20rpx; +} +.pop-box.data-v-29752d91 { + background-color: white; + padding: 20rpx; + width: 80%; + margin: 0 auto; + border-radius: 20rpx; +} +.pop-box .pb-title.data-v-29752d91 { + text-align: center; + margin-bottom: 40rpx; +} \ No newline at end of file diff --git a/unpackage/dist/dev/mp-weixin/static/1.png b/unpackage/dist/dev/mp-weixin/static/1.png new file mode 100644 index 0000000..c64dcbb Binary files /dev/null and b/unpackage/dist/dev/mp-weixin/static/1.png differ diff --git a/unpackage/dist/dev/mp-weixin/static/2.png b/unpackage/dist/dev/mp-weixin/static/2.png new file mode 100644 index 0000000..f840bdd Binary files /dev/null and b/unpackage/dist/dev/mp-weixin/static/2.png differ diff --git a/unpackage/dist/dev/mp-weixin/static/3.png b/unpackage/dist/dev/mp-weixin/static/3.png new file mode 100644 index 0000000..d69e473 Binary files /dev/null and b/unpackage/dist/dev/mp-weixin/static/3.png differ diff --git a/unpackage/dist/dev/mp-weixin/static/4.png b/unpackage/dist/dev/mp-weixin/static/4.png new file mode 100644 index 0000000..b271c04 Binary files /dev/null and b/unpackage/dist/dev/mp-weixin/static/4.png differ