10.18前的开发

This commit is contained in:
2023-10-18 21:00:42 +08:00
parent 4fa658db18
commit aa47166ae7
70 changed files with 9936 additions and 172 deletions

View File

@@ -12,8 +12,10 @@ if (!Array) {
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
if (!Math) {
(mySwiper + _easycom_uni_icons + _easycom_uni_popup)();
(mySwiper + _easycom_uni_icons + uniDatetimePicker + uniEasyinput + _easycom_uni_popup)();
}
const uniDatetimePicker = () => "../../uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.js";
const uniEasyinput = () => "../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js";
const mySwiper = () => "../../components/mySwiper.js";
const _sfc_main = {
__name: "index",
@@ -21,12 +23,17 @@ const _sfc_main = {
const store = store_index.useStore();
common_vendor.onLoad((e) => {
var _a;
if (!((_a = store.userInfo) == null ? void 0 : _a.has_operation))
;
if (!((_a = store.userInfo) == null ? void 0 : _a.has_operation)) {
operation_flag.value = true;
setTimeout(() => {
console.log(inputDialog.value);
inputDialog.value.open();
}, 0);
}
});
const inputDialog = common_vendor.ref();
common_vendor.ref();
common_vendor.ref(false);
const operation_flag = common_vendor.ref(false);
const lbt_list = common_vendor.ref([
{
banner_name: "首页轮播2",
@@ -51,6 +58,21 @@ const _sfc_main = {
weigh: 6
}
]);
function toClose() {
inputDialog.value.close();
}
function radioChange(e) {
console.log(e);
}
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);
}
return (_ctx, _cache) => {
return {
a: common_vendor.p({
@@ -74,10 +96,27 @@ const _sfc_main = {
color: "#8fdc8a",
size: "20"
}),
e: common_vendor.sr(inputDialog, "1cf27b2a-4", {
e: common_vendor.o(radioChange),
f: common_vendor.o(maskClick),
g: common_vendor.o(($event) => single.value = $event),
h: 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({
suffixIcon: "search",
focus: true,
placeholder: "请输入内容",
modelValue: hValue.value
}),
l: common_vendor.o(toClose),
m: common_vendor.sr(inputDialog, "1cf27b2a-4", {
"k": "inputDialog"
}),
f: common_vendor.p({
n: common_vendor.p({
["is-mask-click"]: false
})
};

View File

@@ -3,6 +3,8 @@
"usingComponents": {
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons",
"uni-popup": "../../uni_modules/uni-popup/components/uni-popup/uni-popup",
"uni-datetime-picker": "../../uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker",
"uni-easyinput": "../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput",
"my-swiper": "../../components/mySwiper"
}
}

View File

@@ -1 +1 @@
<view class="content page-box data-v-1cf27b2a"><my-swiper wx:if="{{a}}" class="index-siwper margin-b-card data-v-1cf27b2a" style="width:100%" u-i="1cf27b2a-0" bind:__l="__l" u-p="{{a}}"/><view class="main-cards data-v-1cf27b2a"><view class="mc-part data-v-1cf27b2a" style="margin-left:0"><view class="mc-part-text data-v-1cf27b2a">已完成事项</view><image class="data-v-1cf27b2a" src="/static/done.png" mode="widthFix"></image></view><view class="mc-part mc-part2 data-v-1cf27b2a" style="margin-right:0"><view class="mc-part-text data-v-1cf27b2a">待完成事项</view><image class="data-v-1cf27b2a" style="transform:rotate(0deg)" src="/static/undone.png" mode="widthFix"></image></view></view><view class="attention-card data-v-1cf27b2a"><view class="part-title data-v-1cf27b2a"> 注意事项 </view><view class="ac-parts data-v-1cf27b2a"><view class="ac-part data-v-1cf27b2a" style="background:linear-gradient(45deg, #ffa2a2,#ffd3d3, #ffffff00)"> 术前注意事项 <uni-icons wx:if="{{b}}" class="data-v-1cf27b2a" u-i="1cf27b2a-1" bind:__l="__l" u-p="{{b}}"></uni-icons></view><view class="ac-part data-v-1cf27b2a" style="background:linear-gradient(45deg, #f9b275,#fff3e9, #ffffff00)"> 术中注意事项 <uni-icons wx:if="{{c}}" class="data-v-1cf27b2a" u-i="1cf27b2a-2" bind:__l="__l" u-p="{{c}}"></uni-icons></view><view class="ac-part data-v-1cf27b2a" style="background:linear-gradient(45deg, #8fdc8a,#fdfdfd, #ffffff00)"> 术后注意事项 <uni-icons wx:if="{{d}}" class="data-v-1cf27b2a" u-i="1cf27b2a-3" bind:__l="__l" u-p="{{d}}"></uni-icons></view></view></view><uni-popup wx:if="{{f}}" class="r data-v-1cf27b2a" u-s="{{['d']}}" u-r="inputDialog" u-i="1cf27b2a-4" bind:__l="__l" u-p="{{f}}"><view class="pop-box data-v-1cf27b2a"><view class="pb-title data-v-1cf27b2a">手术信息</view></view><view class="pop-close data-v-1cf27b2a"> 关闭 </view></uni-popup></view>
<view class="content page-box data-v-1cf27b2a"><my-swiper wx:if="{{a}}" class="index-siwper margin-b-card data-v-1cf27b2a" style="width:100%" u-i="1cf27b2a-0" bind:__l="__l" u-p="{{a}}"/><view class="main-cards data-v-1cf27b2a"><view class="mc-part data-v-1cf27b2a" style="margin-left:0"><view class="mc-part-text data-v-1cf27b2a">已完成事项</view><image class="data-v-1cf27b2a" src="/static/done.png" mode="widthFix"></image></view><view class="mc-part mc-part2 data-v-1cf27b2a" style="margin-right:0"><view class="mc-part-text data-v-1cf27b2a">待完成事项</view><image class="data-v-1cf27b2a" style="transform:rotate(0deg)" src="/static/undone.png" mode="widthFix"></image></view></view><view class="attention-card data-v-1cf27b2a"><view class="part-title data-v-1cf27b2a"> 注意事项 </view><view class="ac-parts data-v-1cf27b2a"><view class="ac-part data-v-1cf27b2a" style="background:linear-gradient(45deg, #ffa2a2,#ffd3d3, #ffffff00)"> 术前注意事项 <uni-icons wx:if="{{b}}" class="data-v-1cf27b2a" u-i="1cf27b2a-1" bind:__l="__l" u-p="{{b}}"></uni-icons></view><view class="ac-part data-v-1cf27b2a" style="background:linear-gradient(45deg, #f9b275,#fff3e9, #ffffff00)"> 术中注意事项 <uni-icons wx:if="{{c}}" class="data-v-1cf27b2a" u-i="1cf27b2a-2" bind:__l="__l" u-p="{{c}}"></uni-icons></view><view class="ac-part data-v-1cf27b2a" style="background:linear-gradient(45deg, #8fdc8a,#fdfdfd, #ffffff00)"> 术后注意事项 <uni-icons wx:if="{{d}}" class="data-v-1cf27b2a" u-i="1cf27b2a-3" bind:__l="__l" u-p="{{d}}"></uni-icons></view></view></view><uni-popup wx:if="{{n}}" class="r data-v-1cf27b2a" u-s="{{['d']}}" u-r="inputDialog" u-i="1cf27b2a-4" bind:__l="__l" u-p="{{n}}"><view class="pop-box data-v-1cf27b2a"><view class="pb-title data-v-1cf27b2a">完善手术信息</view><view class="pb-content data-v-1cf27b2a"><view class="pb-item data-v-1cf27b2a"><view class="pb-item-left data-v-1cf27b2a">已经手术</view><view class="pb-item-right data-v-1cf27b2a"><radio-group class="data-v-1cf27b2a" bindchange="{{e}}"><label class="radio data-v-1cf27b2a"><radio class="data-v-1cf27b2a" value="1"/>是</label><label class="radio data-v-1cf27b2a"><radio class="data-v-1cf27b2a" value="0"/>否</label></radio-group></view></view><view class="pb-item data-v-1cf27b2a"><view class="pb-item-left data-v-1cf27b2a">手术时间</view><view class="pb-item-right data-v-1cf27b2a"><uni-datetime-picker wx:if="{{h}}" class="data-v-1cf27b2a" bindmaskClick="{{f}}" u-i="1cf27b2a-5,1cf27b2a-4" bind:__l="__l" bindupdateModelValue="{{g}}" u-p="{{h}}"></uni-datetime-picker></view></view><view class="pb-item data-v-1cf27b2a"><view class="pb-item-left data-v-1cf27b2a">医院名称</view><view class="pb-item-right data-v-1cf27b2a"><uni-easyinput wx:if="{{k}}" class="data-v-1cf27b2a" bindiconClick="{{i}}" u-i="1cf27b2a-6,1cf27b2a-4" bind:__l="__l" bindupdateModelValue="{{j}}" u-p="{{k}}"></uni-easyinput></view></view></view></view><view class="pop-close data-v-1cf27b2a" bindtap="{{l}}"> 关闭 </view></uni-popup></view>

View File

@@ -23,6 +23,24 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.radio.data-v-1cf27b2a {
margin-right: 20rpx;
}
.pb-item.data-v-1cf27b2a {
display: flex;
align-items: center;
margin-bottom: 40rpx;
}
.pb-item .pb-item-left.data-v-1cf27b2a {
width: 30%;
}
.pb-item .pb-item-right.data-v-1cf27b2a {
margin-left: 10rpx;
width: 75%;
}
.data-v-1cf27b2a .uni-popup__wrapper {
width: 100%;
}
.part-title.data-v-1cf27b2a {
border-left: 10rpx solid #fe915d;
padding-left: 20rpx;
@@ -82,6 +100,18 @@
.pop-box.data-v-1cf27b2a {
background-color: white;
padding: 20rpx;
width: 80%;
margin: 0 auto;
border-radius: 20rpx;
}
.pop-box .pb-title.data-v-1cf27b2a {
text-align: center;
margin-bottom: 40rpx;
}
.pop-close.data-v-1cf27b2a {
text-align: center;
color: white;
margin-top: 20rpx;
}
.page-box.data-v-1cf27b2a {
padding: 20rpx;

View File

@@ -0,0 +1,111 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const store_index = require("../../store/index.js");
const api_index = require("../../api/index.js");
const utils_index = require("../../utils/index.js");
require("../../api/request.js");
require("../../config/index.js");
if (!Array) {
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
_easycom_uni_icons2();
}
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
if (!Math) {
_easycom_uni_icons();
}
const _sfc_main = {
__name: "login",
setup(__props) {
store_index.useStore();
common_vendor.onLoad(() => {
});
const avatarUrl = common_vendor.ref(null);
const nickname = common_vendor.ref("");
const res_form = common_vendor.ref(null);
common_vendor.watch(nickname, (v1, v2) => {
console.log("watch", v1);
});
function onChooseAvatar(e) {
avatarUrl.value = e.detail.avatarUrl;
}
function getPhoneNumber(e) {
getAccess_token({ code: e.detail.code });
}
async function getAccess_token(params = {}) {
const data = {
username: params.code,
//手机号按钮获取的code
type: "wechat_mini_app",
identity: "user",
password: "111",
avatarUrl: avatarUrl.value,
nickName: nickname.value
};
const res = await api_index.API.getToken(data);
if (res.code === 200) {
common_vendor.index.setStorageSync("avatarUrl", avatarUrl.value);
res_form.value = res.data;
res_form.value.access_token = "Bearer " + res.data.access_token;
let userId = res.data.userId;
common_vendor.index.setStorageSync("access_token", res_form.value.access_token);
wx_login(userId);
}
}
async function wx_login(userId) {
let res = await new Promise((resolve) => {
common_vendor.index.login({
provider: "weixin",
//使用微信登录
success: function(loginRes) {
resolve(loginRes);
console.log(loginRes, "微信登录返回信息");
}
});
});
let res2 = await api_index.API.wx_login({ code: res.code }, userId);
if (res2.code === 0) {
common_vendor.index.setStorageSync("userInfo", JSON.stringify(res_form.value));
utils_index.custom.uploadImage(avatarUrl.value, async (file) => {
avatarUrl.value = file.data.file.url;
common_vendor.index.setStorageSync("avatarUrl", file.data.file.url);
await updateFunc();
common_vendor.index.switchTab({
url: "/pages/user/index"
});
});
} else {
common_vendor.index.clearStorage();
}
}
async function updateFunc() {
let user_info = JSON.parse(common_vendor.index.getStorageSync("userInfo"));
user_info.avatar = avatarUrl.value;
user_info.id = user_info.userId;
return await api_index.API.userinfoUpdae(user_info);
}
function nameInput(e) {
nickname.value = e.detail.value;
}
return (_ctx, _cache) => {
return common_vendor.e({
a: avatarUrl.value
}, avatarUrl.value ? {
b: avatarUrl.value
} : {
c: common_vendor.p({
type: "person-filled",
color: "white",
size: "60"
})
}, {
d: common_vendor.o(onChooseAvatar),
e: common_vendor.o(nameInput),
f: nickname.value,
g: common_vendor.o(($event) => nickname.value = $event.detail.value),
h: common_vendor.o(getPhoneNumber)
});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-e4e4508d"], ["__file", "F:/项目2023/视力表/vision-record/pages/login/login.vue"]]);
wx.createPage(MiniProgramPage);

View File

@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "登录",
"usingComponents": {
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons"
}
}

View File

@@ -0,0 +1 @@
<view class="loginBox page-box img-part card-part data-v-e4e4508d" style="text-align:center"><view class="base-info data-v-e4e4508d"><button class="avatar-wrapper data-v-e4e4508d" open-type="chooseAvatar" bindchooseavatar="{{d}}" style="border-radius:50%"><image wx:if="{{a}}" class="avatar data-v-e4e4508d" mode="aspectFill" src="{{b}}"></image><uni-icons wx:else class="data-v-e4e4508d" u-i="e4e4508d-0" bind:__l="__l" u-p="{{c||''}}"></uni-icons></button><input type="nickname" bindblur="{{e}}" class="weui-input data-v-e4e4508d" placeholder="请输入昵称" value="{{f}}" bindinput="{{g}}"/></view><view class="btn-part data-v-e4e4508d"><button class="buy-btn data-v-e4e4508d" open-type="getPhoneNumber" bindgetphonenumber="{{h}}">立即登录</button></view></view>

View File

@@ -0,0 +1,75 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.base-info.data-v-e4e4508d {
padding: 50rpx 0;
}
/* pages/login/login.wxss */
page.data-v-e4e4508d {
height: 100%;
}
.container.data-v-e4e4508d {
align-items: center;
}
.title.data-v-e4e4508d {
font-weight: bolder;
font-size: 40rpx;
}
.more-info.data-v-e4e4508d {
color: gray;
font-size: 24rpx;
margin-top: 1rem;
}
.buy-btn.data-v-e4e4508d {
display: inline-block;
margin-top: 1rem;
background-color: #26758d;
color: white;
border-radius: 50rpx;
font-weight: 200;
font-size: 24rpx;
width: 50%;
padding: 10rpx 0;
}
.title-part.data-v-e4e4508d {
text-align: center;
}
.avatar-wrapper.data-v-e4e4508d {
width: 160rpx !important;
height: 160rpx;
padding: 0px;
margin: 0 auto;
overflow: hidden;
margin-bottom: 40rpx;
background: #ececec;
display: flex;
align-items: center;
justify-content: center;
}
.avatar.data-v-e4e4508d {
width: 160rpx;
height: 160rpx;
}

View File

@@ -1,48 +1,41 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const store_index = require("../../store/index.js");
const api_index = require("../../api/index.js");
const utils_index = require("../../utils/index.js");
require("../../api/index.js");
require("../../api/request.js");
require("../../config/index.js");
const _sfc_main = {
__name: "index",
setup(__props) {
store_index.useStore();
function getPhoneNumber(e) {
console.log(e);
getAccess_token({ code: e.detail.code });
}
async function getAccess_token(params = {}) {
const data = {
username: params.code,
//手机号按钮获取的code
type: "wechat_mini_app",
identity: "user",
password: "111"
};
await api_index.API.getToken(data);
wx_login();
}
async function wx_login(token_res) {
let res = await new Promise((resolve) => {
common_vendor.index.login({
provider: "weixin",
//使用微信登录
success: function(loginRes) {
resolve(loginRes);
console.log(loginRes, "微信登录返回信息");
}
});
common_vendor.onShow(() => {
is_login.value = utils_index.custom.checkLogin();
if (is_login.value) {
userinfo.value = common_vendor.index.getStorageSync("userInfo");
avatar.value = common_vendor.index.getStorageSync("avatarUrl");
userinfo.value = JSON.parse(userinfo.value);
}
});
const avatar = common_vendor.ref("");
common_vendor.ref(null);
const is_login = common_vendor.ref(null);
const userinfo = common_vendor.ref(null);
function toLogin() {
common_vendor.index.navigateTo({
url: "/pages/login/login"
});
let userId = "";
await api_index.API.wx_login({ code: res.code }, userId);
}
return (_ctx, _cache) => {
return {
a: common_vendor.o(getPhoneNumber)
};
return common_vendor.e({
a: is_login.value ? avatar.value : "../../static/avatar.png",
b: common_vendor.t(is_login.value ? userinfo.value.nickname : "未登录"),
c: !is_login.value
}, !is_login.value ? {
d: common_vendor.o(toLogin)
} : {});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "F:/项目2023/视力表/vision-record/pages/user/index.vue"]]);
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-79e6a490"], ["__file", "F:/项目2023/视力表/vision-record/pages/user/index.vue"]]);
wx.createPage(MiniProgramPage);

View File

@@ -1 +1 @@
<view class="user-box page-box"><button class="submit-btn" open-type="getPhoneNumber" bindgetphonenumber="{{a}}"><text>登录</text></button></view>
<view class="user-box page-box data-v-79e6a490"><view class="userinfo-box data-v-79e6a490"><image class="data-v-79e6a490" src="{{a}}" mode=""></image><view class=" data-v-79e6a490">{{b}}</view></view><view wx:if="{{c}}" class="btn-box data-v-79e6a490" bindtap="{{d}}"><view class="btn data-v-79e6a490">登录</view></view></view>

View File

@@ -0,0 +1,51 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.btn-box.data-v-79e6a490 {
text-align: center;
margin-top: 40rpx;
}
.btn-box .btn.data-v-79e6a490 {
display: inline-block;
padding: 10px 20px;
background: #e2e2e2;
color: #26758d;
border-radius: 10px;
width: 50%;
}
.userinfo-box.data-v-79e6a490 {
color: white;
background-color: #26758d;
display: flex;
align-items: center;
padding: 40rpx 20rpx;
}
.userinfo-box image.data-v-79e6a490 {
width: 120rpx;
height: 120rpx;
border-radius: 50%;
background: white;
margin-right: 20rpx;
}