1
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
// pages/auth/access/index.js
|
||||
Page({
|
||||
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
handClick(e) {
|
||||
let { type } = e.currentTarget.dataset
|
||||
//拍照
|
||||
if (type == 1) {
|
||||
wx.scanCode({
|
||||
onlyFromCamera: true,
|
||||
scanType: ['qrCode'],
|
||||
success(res) {
|
||||
console.log(res);
|
||||
},
|
||||
fail(err) {
|
||||
wx.showToast({
|
||||
title: '扫码失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
wx.navigateTo({
|
||||
url: "/pages/joinFlow/manual/index",
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
page {
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.banner {
|
||||
height: 400rpx;
|
||||
background-image: var(--background);
|
||||
padding: 30rpx;
|
||||
|
||||
.text-1 {
|
||||
color: white;
|
||||
font-size: 60rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.text-2 {
|
||||
font-size: 28rpx;
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
flex: 1;
|
||||
background-color: white;
|
||||
transform: translateY(-20rpx);
|
||||
border-radius: 30rpx 30rpx 0 0;
|
||||
padding: 80rpx 30rpx 30rpx;
|
||||
|
||||
.text-1 {
|
||||
text-align: center;
|
||||
font-weight: 700;
|
||||
font-size: 45rpx;
|
||||
}
|
||||
|
||||
.text-2 {
|
||||
font-size: 28rpx;
|
||||
text-align: center;
|
||||
color: rgba(69, 70, 78, 1);
|
||||
margin-top: 20rpx;
|
||||
margin-bottom: 60rpx;
|
||||
}
|
||||
|
||||
.item {
|
||||
box-shadow: 0 4rpx 12rpx rgba(11, 27, 61, 0.14);
|
||||
padding: 30rpx;
|
||||
border-radius: 30rpx;
|
||||
gap: 30rpx;
|
||||
margin-bottom: 60rpx;
|
||||
|
||||
.icon {
|
||||
width: 90rpx;
|
||||
aspect-ratio: 1;
|
||||
background-color: rgba(0, 106, 106, 0.1);
|
||||
font-size: 50rpx;
|
||||
border-radius: 20rpx;
|
||||
color: rgba(46, 139, 87, 1);
|
||||
}
|
||||
|
||||
.t-1 {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.t-2 {
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
color: rgba(69, 70, 78, 1);
|
||||
}
|
||||
}
|
||||
|
||||
.tip {
|
||||
background-color: rgba(255, 221, 180, 1);
|
||||
padding: 30rpx;
|
||||
border-radius: 20rpx;
|
||||
color: rgba(99, 63, 0, 1);
|
||||
font-size: 28rpx;
|
||||
line-height: 44rpx;
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
<view class="banner">
|
||||
<t-navbar t-class="fixed-nav"
|
||||
fixed="{{false}}" />
|
||||
<view class="info">
|
||||
<view class="text-1">术极守护</view>
|
||||
<view class="text-2">您的贴身康复管家</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="content">
|
||||
<view class="text-1">开始使用</view>
|
||||
<view class="text-2">请选择康复计划接入方式</view>
|
||||
<view class="item flex-align"
|
||||
bind:tap="handClick"
|
||||
data-type="1">
|
||||
<view class="icon flex-center">
|
||||
<t-icon name="qrcode" />
|
||||
</view>
|
||||
<view>
|
||||
<view class="t-1">扫码接入</view>
|
||||
<view class="t-2">扫描医护人员提供的二维码</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item flex-align"
|
||||
bind:tap="handClick"
|
||||
data-type="2">
|
||||
<view class="icon flex-center">
|
||||
<t-icon name="search" />
|
||||
</view>
|
||||
<view>
|
||||
<view class="t-1">手动选择</view>
|
||||
<view class="t-2">搜索医院、科室、手术名称</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="tip">
|
||||
<view>💡 温馨提示:</view>
|
||||
<view>首次使用需要录入基本信息,请准备好您的手术相关资料</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -1,36 +0,0 @@
|
||||
Page({
|
||||
data: {
|
||||
formData: {
|
||||
hospital: "",
|
||||
department: ""
|
||||
}
|
||||
},
|
||||
onInputChange(e) {
|
||||
console.log("dsds");
|
||||
const {field} = e.currentTarget.dataset;
|
||||
this.setData({
|
||||
[`formData.${field}`]: e.detail.value,
|
||||
});
|
||||
},
|
||||
|
||||
onSubmit() {
|
||||
let {formData} = this.data
|
||||
let errorText = ""
|
||||
if (!formData.hospital.trim()) {
|
||||
errorText = "请填写医院名称"
|
||||
}
|
||||
if (!formData.department.trim()) {
|
||||
errorText = "请填写科室名称"
|
||||
}
|
||||
if (errorText) {
|
||||
wx.showToast({
|
||||
title: errorText,
|
||||
icon: "none"
|
||||
})
|
||||
return;
|
||||
}
|
||||
wx.navigateTo({
|
||||
url: "/pages/joinFlow/person/index"
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
.content {
|
||||
margin-top: 60rpx;
|
||||
|
||||
.btn {
|
||||
margin-top: 60rpx;
|
||||
padding: 40rpx 30rpx;
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
<t-navbar title="选择康复计划"
|
||||
left-arrow
|
||||
fixed="{{false}}" />
|
||||
|
||||
<view class="content">
|
||||
<t-input value="{{formData.hospital}}"
|
||||
borderless
|
||||
label="医院"
|
||||
placeholder="请输入医院名称"
|
||||
bind:change="onInputChange"
|
||||
data-field="hospital" />
|
||||
<t-input value="{{formData.department}}"
|
||||
borderless
|
||||
label="科室"
|
||||
clearable="{{false}}"
|
||||
placeholder="请输入科室名称"
|
||||
bind:change="onInputChange"
|
||||
data-field="department" />
|
||||
|
||||
<view class="btn">
|
||||
<t-button block
|
||||
theme="primary" bind:tap="onSubmit">
|
||||
确认
|
||||
</t-button>
|
||||
</view>
|
||||
</view>
|
||||
@@ -1,21 +1,100 @@
|
||||
import request from "@/utils/request"
|
||||
import { getToken, setToken } from "@/utils/auth/manageToken"
|
||||
import { formatDate } from "@/utils/common"
|
||||
const app = getApp()
|
||||
Page({
|
||||
data: {
|
||||
loading: true,
|
||||
parmas: {},
|
||||
mood: "manual",
|
||||
showPicker: false,
|
||||
date: new Date().getTime(),
|
||||
|
||||
//手术
|
||||
showSurgery: false,
|
||||
surgeryList: [],
|
||||
selectSurgery: [],
|
||||
//医院信息
|
||||
hospital: "",
|
||||
department: "",
|
||||
//其他信息
|
||||
age: "",
|
||||
allergy: "",
|
||||
comorbidity: "",
|
||||
},
|
||||
onLoad(e) {
|
||||
if (Object.keys(e).length > 0) {
|
||||
this.setData({
|
||||
parmas: e,
|
||||
mood: "scan"
|
||||
})
|
||||
}
|
||||
this.init()
|
||||
},
|
||||
//初始化
|
||||
async init() {
|
||||
let token = getToken()
|
||||
//如果存在
|
||||
if (token) {
|
||||
let info = await request.get("/my-info")
|
||||
this.handUser(info)
|
||||
} else {
|
||||
wx.login({
|
||||
success: async (res) => {
|
||||
let response = await request.post("/login", {
|
||||
"wx_code": res.code
|
||||
})
|
||||
setToken(response.accessToken)
|
||||
this.handUser(response)
|
||||
},
|
||||
})
|
||||
}
|
||||
},
|
||||
//处理信息
|
||||
async handUser(data) {
|
||||
app.globalData.userInfo = data.userInfo
|
||||
if (data.needProfile == 0) {
|
||||
wx.switchTab({
|
||||
url: "/pages/home/index",
|
||||
})
|
||||
} else {
|
||||
let res = await request.get("/profile/surgicals")
|
||||
this.setData({
|
||||
surgeryList: res.list,
|
||||
})
|
||||
}
|
||||
this.setData({
|
||||
loading: false,
|
||||
})
|
||||
},
|
||||
|
||||
onInputChange(e) {
|
||||
const { field } = e.currentTarget.dataset;
|
||||
this.setData({
|
||||
[`${field}`]: e.detail.value,
|
||||
});
|
||||
},
|
||||
//选择手术
|
||||
changeSurgeryShow() {
|
||||
this.setData({
|
||||
showSurgery: !this.data.showSurgery
|
||||
})
|
||||
},
|
||||
handSelectSurgery(e) {
|
||||
let { data } = e.currentTarget.dataset
|
||||
let { selectSurgery } = this.data
|
||||
let isHave = selectSurgery.find(item => item.id == data.id)
|
||||
if (isHave) {
|
||||
this.setData({
|
||||
selectSurgery: selectSurgery.filter((item) => item.id != data.id)
|
||||
})
|
||||
} else {
|
||||
this.setData({
|
||||
selectSurgery: [...selectSurgery, data]
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
//选择时间
|
||||
chaneTimeShow() {
|
||||
this.setData({
|
||||
@@ -29,22 +108,26 @@ Page({
|
||||
})
|
||||
},
|
||||
|
||||
//选择手术
|
||||
changeSurgeryShow() {
|
||||
this.setData({
|
||||
showSurgery: !this.data.showSurgery
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
//提交
|
||||
onSubmit() {
|
||||
let { date, age, allergy, comorbidity } = this.data
|
||||
async onSubmit() {
|
||||
let { mood, hospital, department, date, age, allergy, comorbidity, parmas, selectSurgery } = this.data
|
||||
let errorText = ""
|
||||
if (!date) {
|
||||
if (mood == 'manual' && !hospital.trim()) {
|
||||
errorText = "请输入医院"
|
||||
}
|
||||
else if (mood == 'manual' && !department.trim()) {
|
||||
errorText = "请输入科室"
|
||||
}
|
||||
|
||||
else if (selectSurgery.length == 0) {
|
||||
errorText = "请选择手术"
|
||||
}
|
||||
else if (!date) {
|
||||
errorText = "请选择时间"
|
||||
}
|
||||
if (!age.trim()) {
|
||||
else if (!age.trim()) {
|
||||
errorText = "请填写年龄"
|
||||
}
|
||||
if (errorText) {
|
||||
@@ -54,8 +137,29 @@ Page({
|
||||
})
|
||||
return
|
||||
}
|
||||
wx.switchTab({
|
||||
url: '/pages/home/index',
|
||||
})
|
||||
try {
|
||||
wx.showLoading({
|
||||
title: '提交中',
|
||||
mask: true
|
||||
})
|
||||
await request.post("/profile", {
|
||||
entry_mode: mood,
|
||||
...parmas,
|
||||
hospital_name: hospital,
|
||||
department_name: department,
|
||||
surgical_ids: selectSurgery.map(item => item.id),
|
||||
surgical_date: formatDate(date, 'YYYY-MM-DD'),
|
||||
age: age,
|
||||
allergy_history: allergy,
|
||||
complication: comorbidity
|
||||
})
|
||||
wx.hideLoading()
|
||||
wx.switchTab({
|
||||
url: '/pages/home/index',
|
||||
})
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
wx.hideLoading()
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,4 +1,4 @@
|
||||
page {
|
||||
.page {
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -21,6 +21,7 @@ page {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.content {
|
||||
flex: 1;
|
||||
height: 0;
|
||||
@@ -29,6 +30,10 @@ page {
|
||||
border-radius: 30rpx 30rpx 0 0;
|
||||
padding: 50rpx 0 0;
|
||||
|
||||
.ce {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.text-1 {
|
||||
font-weight: 700;
|
||||
font-size: 45rpx;
|
||||
|
||||
@@ -1,55 +1,84 @@
|
||||
<wxs src="/utils/wxs/comment.wxs"
|
||||
module="utils"></wxs>
|
||||
<view class="banner">
|
||||
<t-navbar t-class="fixed-nav"
|
||||
fixed="{{false}}" />
|
||||
<view class="info">
|
||||
<view class="text-1">术极守护</view>
|
||||
<view class="text-2">您的贴身康复管家</view>
|
||||
|
||||
<view class="page"
|
||||
wx:if="{{!loading}}">
|
||||
<view class="banner">
|
||||
<t-navbar t-class="fixed-nav"
|
||||
fixed="{{false}}" />
|
||||
<view class="info">
|
||||
<view class="text-1">术极守护</view>
|
||||
<view class="text-2">您的贴身康复管家</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<scroll-view class="content"
|
||||
scroll-y>
|
||||
<view class="text-1">建立康复档案</view>
|
||||
<t-cell title="医院"
|
||||
wx:if="{{mood == 'manual'}}">
|
||||
<input slot="note"
|
||||
placeholder="请输入医院"
|
||||
data-field="hospital"
|
||||
bind:change="onInputChange" />
|
||||
</t-cell>
|
||||
<t-cell title="科室"
|
||||
wx:if="{{mood == 'manual'}}">
|
||||
<input slot="note"
|
||||
placeholder="请输入科室"
|
||||
data-field="department"
|
||||
bind:change="onInputChange" />
|
||||
</t-cell>
|
||||
<t-cell title="选择手术"
|
||||
arrow
|
||||
t-class-title="ce"
|
||||
bind:tap="changeSurgeryShow">
|
||||
<view slot="note">
|
||||
{{select.getNames(selectSurgery)}}
|
||||
</view>
|
||||
</t-cell>
|
||||
<t-cell title="手术日期"
|
||||
arrow
|
||||
note="{{utils.formatDate(date, 'YYYY/MM/DD') || '请选择'}}"
|
||||
bind:tap="chaneTimeShow">
|
||||
</t-cell>
|
||||
<t-cell title="年龄">
|
||||
<input type="number"
|
||||
slot="note"
|
||||
maxlength="3"
|
||||
placeholder="请输入年龄"
|
||||
data-field="age"
|
||||
bind:change="onInputChange" />
|
||||
</t-cell>
|
||||
<t-cell title="过敏史">
|
||||
<textarea placeholder="请输入过敏史(如:青霉素过敏)"
|
||||
slot="description"
|
||||
data-field="allergy"
|
||||
bind:change="onInputChange" />
|
||||
</t-cell>
|
||||
<t-cell title="合并症">
|
||||
<textarea placeholder="请输入合并症(如:高血压、糖尿病)"
|
||||
slot="description"
|
||||
data-field="comorbidity"
|
||||
bind:change="onInputChange" />
|
||||
</t-cell>
|
||||
</scroll-view>
|
||||
<view class="btn">
|
||||
<t-button block
|
||||
theme="primary"
|
||||
bind:tap="onSubmit">下一步
|
||||
</t-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<scroll-view class="content"
|
||||
scroll-y>
|
||||
<view class="text-1">建立康复档案</view>
|
||||
<t-cell title="选择手术"
|
||||
arrow
|
||||
note="请选择"
|
||||
bind:tap="changeSurgeryShow">
|
||||
</t-cell>
|
||||
<t-cell title="手术日期"
|
||||
arrow
|
||||
note="{{utils.formatDate(date, 'YYYY/MM/DD') || '请选择'}}"
|
||||
bind:tap="chaneTimeShow">
|
||||
</t-cell>
|
||||
<t-cell title="年龄">
|
||||
<input type="number"
|
||||
slot="note"
|
||||
maxlength="3"
|
||||
placeholder="请输入年龄"
|
||||
data-field="age"
|
||||
bind:change="onInputChange" />
|
||||
</t-cell>
|
||||
<t-cell title="过敏史">
|
||||
<textarea placeholder="请输入过敏史(如:青霉素过敏)"
|
||||
slot="description"
|
||||
data-field="allergy"
|
||||
bind:change="onInputChange" />
|
||||
</t-cell>
|
||||
<t-cell title="合并症">
|
||||
<textarea placeholder="请输入合并症(如:高血压、糖尿病)"
|
||||
slot="description"
|
||||
data-field="comorbidity"
|
||||
bind:change="onInputChange" />
|
||||
</t-cell>
|
||||
</scroll-view>
|
||||
<view class="btn">
|
||||
<t-button block
|
||||
theme="primary"
|
||||
bind:tap="onSubmit">下一步
|
||||
</t-button>
|
||||
<view class="flex-center"
|
||||
style="height: 100vh;"
|
||||
wx:else>
|
||||
<t-loading theme="circular"
|
||||
size="40rpx" />
|
||||
</view>
|
||||
|
||||
|
||||
<t-popup visible="{{showSurgery}}"
|
||||
placement="bottom"
|
||||
bind:visible-change="changeSurgeryShow">
|
||||
@@ -57,9 +86,14 @@
|
||||
<view class="title">手术列表</view>
|
||||
<scroll-view class="surgery-list"
|
||||
scroll-y>
|
||||
<view class="flex-between surgery-item " wx:for="{{6}}" wx:key="index">
|
||||
<view class="name">测试手术名字</view>
|
||||
<t-icon name="check" />
|
||||
<view class="flex-between surgery-item "
|
||||
wx:for="{{surgeryList}}"
|
||||
wx:key="index"
|
||||
data-data="{{item}}"
|
||||
bind:tap="handSelectSurgery">
|
||||
<view class="name">{{item.name}}</view>
|
||||
<t-icon name="check"
|
||||
wx:if="{{select.isSelected(item.id, selectSurgery)}}" />
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
@@ -72,4 +106,28 @@
|
||||
default-value="{{date}}"
|
||||
format="YYYY-MM-DD"
|
||||
bindconfirm="onTimeConfirm"
|
||||
bindclose="chaneTimeShow" />
|
||||
bindclose="chaneTimeShow" />
|
||||
|
||||
|
||||
|
||||
<wxs module="select">
|
||||
module.exports = {
|
||||
isSelected: function (id, list) {
|
||||
if (!list || !list.length) return false;
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
if (list[i].id === id) return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
getNames: function (list) {
|
||||
if (!list || !list.length) return "请选择";
|
||||
// 拼接名字,逗号分隔
|
||||
var names = "";
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
names += list[i].name;
|
||||
if (i < list.length - 1) names += ", ";
|
||||
}
|
||||
return names;
|
||||
}
|
||||
};
|
||||
</wxs>
|
||||
Reference in New Issue
Block a user