dsdsd
This commit is contained in:
parent
c36394383e
commit
768635302b
@ -20,23 +20,20 @@ function request(url, method = 'GET', data = {}) {
|
||||
dataType: 'json', // 微信官方文档中介绍会对数据进行一次JSON.parse
|
||||
header,
|
||||
success(res) {
|
||||
console.log(res)
|
||||
setTimeout(() => {
|
||||
|
||||
if(res.data.code && res.data.code == 10103){
|
||||
wx.removeStorageSync('access_token');
|
||||
wx.switchTab({
|
||||
url: '/pages/my/index',
|
||||
})
|
||||
reject(err);
|
||||
reject(res.data);
|
||||
} else {
|
||||
console.log(res.data)
|
||||
resolve(res.data);
|
||||
}
|
||||
// // HTTP状态码为200才视为成功
|
||||
// if (res.code === 200) {
|
||||
// resolve(res);
|
||||
// } else {
|
||||
// // wx.request的特性,只要有响应就会走success回调,所以在这里判断状态,非200的均视为请求失败
|
||||
// reject(res);
|
||||
// }
|
||||
|
||||
}, delay);
|
||||
},
|
||||
fail(err) {
|
||||
|
||||
BIN
assets/images/logo.jpg
Normal file
BIN
assets/images/logo.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
BIN
assets/images/top-bg.png
Normal file
BIN
assets/images/top-bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
@ -1,8 +1,8 @@
|
||||
@font-face {
|
||||
font-family: "iconfont"; /* Project id 4945922 */
|
||||
src: url('//at.alicdn.com/t/c/font_4945922_srge2kps8c.woff2?t=1749628761058') format('woff2'),
|
||||
url('//at.alicdn.com/t/c/font_4945922_srge2kps8c.woff?t=1749628761058') format('woff'),
|
||||
url('//at.alicdn.com/t/c/font_4945922_srge2kps8c.ttf?t=1749628761058') format('truetype');
|
||||
src: url('//at.alicdn.com/t/c/font_4945922_1cebnuqykww.woff2?t=1749652718973') format('woff2'),
|
||||
url('//at.alicdn.com/t/c/font_4945922_1cebnuqykww.woff?t=1749652718973') format('woff'),
|
||||
url('//at.alicdn.com/t/c/font_4945922_1cebnuqykww.ttf?t=1749652718973') format('truetype');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
@ -13,6 +13,14 @@
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-shouji:before {
|
||||
content: "\e6f7";
|
||||
}
|
||||
|
||||
.icon-xiaoxi:before {
|
||||
content: "\e600";
|
||||
}
|
||||
|
||||
.icon-jiahao1:before {
|
||||
content: "\e727";
|
||||
}
|
||||
@ -37,4 +45,3 @@
|
||||
content: "\e609";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -17,6 +17,7 @@ Page({
|
||||
"frequency": "",
|
||||
"time": "饭前"
|
||||
}],
|
||||
start_date: '',
|
||||
end_date: '',
|
||||
reminder: {
|
||||
"morning": "08:00",
|
||||
@ -27,7 +28,7 @@ Page({
|
||||
selectList: [],
|
||||
selectValue: '',
|
||||
selectVisible: false,
|
||||
start_date: '',
|
||||
|
||||
timeData: '',
|
||||
id: '',
|
||||
style: 'border: 0;',
|
||||
@ -47,6 +48,7 @@ Page({
|
||||
minuteVisible: false,
|
||||
date: new Date('2021-12-23').getTime(), // 支持时间戳传入
|
||||
dateText: '',
|
||||
birthStart: new Date().getTime(),
|
||||
filter(type, options) {
|
||||
if (type === 'year') {
|
||||
return options.sort((a, b) => b.value - a.value);
|
||||
@ -128,17 +130,17 @@ Page({
|
||||
},
|
||||
showSelect(e){
|
||||
const { mode, index } = e.currentTarget.dataset;
|
||||
console.log(mode, index )
|
||||
modeText = mode
|
||||
modeIndex = index
|
||||
this.setData({
|
||||
selectValue: [this.data.detail[index].frequency],
|
||||
selectVisible: true,
|
||||
selectValue: this.data.detail[index].frequency ? this.data.detail[index].frequency : '',
|
||||
|
||||
})
|
||||
},
|
||||
onSelectChange(e){
|
||||
this.setData({
|
||||
[`detail[${modeIndex}].frequency`]: e.detail.value
|
||||
[`detail[${modeIndex}].frequency`]: e.detail.value[0]
|
||||
})
|
||||
},
|
||||
showPicker(e) {
|
||||
@ -146,6 +148,7 @@ Page({
|
||||
modeType = mode;
|
||||
this.setData({
|
||||
birthVisible: true,
|
||||
timeData: this.data[mode],
|
||||
});
|
||||
|
||||
},
|
||||
@ -206,7 +209,11 @@ Page({
|
||||
detail: this.data.detail.filter((item, i) => i !== index)
|
||||
})
|
||||
},
|
||||
|
||||
onPickerCancel(){
|
||||
this.setData({
|
||||
selectVisible: false,
|
||||
});
|
||||
},
|
||||
async addData(){
|
||||
const res = await request('/api/v1/patient/add_therapeutic_regimen','post',{
|
||||
detail: JSON.stringify(this.data.detail),
|
||||
@ -236,8 +243,7 @@ Page({
|
||||
},
|
||||
async saveData(){
|
||||
if(this.data.id){
|
||||
const res = await request('patient/medicine_scheme','put',{
|
||||
id: this.data.id,
|
||||
const res = await request(`patient/medicine_scheme/${this.data.id}`,'put',{
|
||||
detail: JSON.stringify(this.data.detail),
|
||||
reminder: JSON.stringify(this.data.reminder),
|
||||
start_date: this.data.start_date,
|
||||
@ -258,13 +264,25 @@ Page({
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
console.log(options)
|
||||
if(options.id){
|
||||
this.setData({
|
||||
id: options.id
|
||||
})
|
||||
this.getData(options.id)
|
||||
}
|
||||
},
|
||||
|
||||
async getData(){
|
||||
const obj = JSON.parse(await wx.getStorageSync('therapeuticRegimen'));
|
||||
this.setData({
|
||||
detail: obj.detail,
|
||||
start_date: obj.start_date,
|
||||
end_date: obj.end_date,
|
||||
reminder: JSON.parse(obj.reminder),
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
|
||||
@ -37,6 +37,7 @@
|
||||
padding-left: 0;
|
||||
margin-bottom: 28rpx;
|
||||
margin-top: 24rpx;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.yp-info{
|
||||
margin-top: 24rpx;
|
||||
@ -52,7 +53,7 @@
|
||||
.tip{
|
||||
position: absolute;
|
||||
right: -36rpx;
|
||||
top: 28rpx;
|
||||
top: 34rpx;
|
||||
z-index: 999;
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@
|
||||
<t-cell class="{{item.frequency ? 'active':''}}" title="单次频次(每日次数)" arrow bind:click="showSelect" data-index="{{index}}" data-mode="frequency" data-list="{{frequencyList}}" note="{{item.frequency ? (frequencyList[item.frequency - 1].label) : '请选择'}}">
|
||||
</t-cell>
|
||||
|
||||
<view class="day-time">
|
||||
<view class="day-time" wx:if="{{item.frequency}}">
|
||||
<t-row gutter="12">
|
||||
<t-col span="8">
|
||||
<view class="day-time-item" bindtap="showPickertime" data-mode="morning" >
|
||||
@ -47,14 +47,14 @@
|
||||
<text class="iconfont icon-bianji"></text>
|
||||
</view>
|
||||
</t-col>
|
||||
<t-col span="8">
|
||||
<t-col span="8" wx:if="{{item.frequency >= 2}}">
|
||||
<view class="day-time-item" bindtap="showPickertime" data-mode="noon">
|
||||
{{reminder.noon}}
|
||||
<text class="iconfont icon-bianji"></text>
|
||||
</view>
|
||||
|
||||
</t-col>
|
||||
<t-col span="8">
|
||||
<t-col span="8" wx:if="{{item.frequency == 3}}">
|
||||
<view class="day-time-item" bindtap="showPickertime" data-mode="evening">
|
||||
{{reminder.evening}}
|
||||
<text class="iconfont icon-bianji"></text>
|
||||
@ -112,10 +112,9 @@
|
||||
<t-picker
|
||||
visible="{{selectVisible}}"
|
||||
value="{{selectValue}}"
|
||||
data-key="value"
|
||||
default-value="{{selectValue}}"
|
||||
cancelBtn="取消"
|
||||
confirmBtn="确认"
|
||||
usingCustomNavbar
|
||||
bindchange="onSelectChange"
|
||||
bindcancel="onPickerCancel"
|
||||
>
|
||||
|
||||
@ -97,6 +97,11 @@ Page({
|
||||
});
|
||||
this.changeSubmit();
|
||||
},
|
||||
onCodeInput(e) {
|
||||
this.setData({
|
||||
code: e.detail.value
|
||||
});
|
||||
},
|
||||
|
||||
onAccountChange(e) {
|
||||
this.setData({
|
||||
@ -125,10 +130,14 @@ Page({
|
||||
isSubmit: false
|
||||
});
|
||||
},
|
||||
|
||||
toLoginCode(){
|
||||
wx.navigateTo({
|
||||
url: `/pages/loginCode/loginCode`,
|
||||
});
|
||||
},
|
||||
async login() {
|
||||
|
||||
const res = await request('/patient/code_login', 'post', {
|
||||
const res = await request('patient/code_login', 'post', {
|
||||
code: this.data.code,
|
||||
mobile: this.data.phoneNumber
|
||||
});
|
||||
@ -153,7 +162,7 @@ Page({
|
||||
});
|
||||
},
|
||||
uploadPass() {
|
||||
console.log('1222')
|
||||
|
||||
wx.navigateTo({
|
||||
url: `/pages/forGetPassword/index`,
|
||||
})
|
||||
|
||||
@ -1,106 +1,130 @@
|
||||
.login {
|
||||
&__title {
|
||||
color: rgba(0, 0, 0, 0.9);
|
||||
font-size: 56rpx;
|
||||
font-weight: 600;
|
||||
line-height: 72rpx;
|
||||
padding: 16rpx 32rpx 40rpx;
|
||||
.page {
|
||||
background-color: rgba(255,255,255,1.000000);
|
||||
position: relative;
|
||||
width: 750rpx;
|
||||
height: 1624rpx;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.image-wrapper_1 {
|
||||
background: url('/assets/images/top-bg.png') center center no-repeat;
|
||||
background-size: 100% 100%;
|
||||
padding-bottom: 80rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
image{
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
&__input {
|
||||
.input-label {
|
||||
display: flex;
|
||||
padding-right: 32rpx;
|
||||
box-sizing: border-box;
|
||||
border-right: 1rpx solid #e7e7e7;
|
||||
}
|
||||
|
||||
.input-icon {
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
}
|
||||
|
||||
&__tips {
|
||||
color: rgba(0, 0, 0, 0.4);
|
||||
font-size: 24rpx;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
line-height: 40rpx;
|
||||
margin: 24rpx 32rpx 32rpx;
|
||||
}
|
||||
|
||||
&__button {
|
||||
margin: 0 32rpx;
|
||||
}
|
||||
|
||||
&__password--forget {
|
||||
display: flex;
|
||||
font-size: 24rpx;
|
||||
align-items: center;
|
||||
margin: 32rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
&__others {
|
||||
margin: 64rpx 32rpx auto 32rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
&-label {
|
||||
min-width: 96rpx;
|
||||
color: rgba(0, 0, 0, 0.6);
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
&-buttons {
|
||||
flex: 1;
|
||||
margin-left: 32rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
|
||||
.button {
|
||||
margin: 0 !important;
|
||||
|
||||
&:not(:last-child) {
|
||||
margin-right: 32rpx !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 覆盖组件样式
|
||||
.radio-class {
|
||||
--td-radio-icon-size: 32rpx;
|
||||
--td-radio-label-line-height: 40rpx;
|
||||
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.radio-class-icon {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
|
||||
.radio-class-label {
|
||||
margin-left: 8rpx !important;
|
||||
font-size: 24rpx !important;
|
||||
line-height: 40rpx !important;
|
||||
.image_4{
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 0;
|
||||
}
|
||||
}
|
||||
.phoneLogin{
|
||||
.image_1 {
|
||||
width: 750rpx;
|
||||
height: 88rpx;
|
||||
}
|
||||
.image_2 {
|
||||
width: 174rpx;
|
||||
height: 64rpx;
|
||||
margin: 12rpx 12rpx 0 564rpx;
|
||||
}
|
||||
.image_3 {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
align-self: center;
|
||||
margin-top: 196rpx;
|
||||
}
|
||||
.box_1 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 40rpx 64rpx 36rpx 64rpx;
|
||||
}
|
||||
.text-wrapper_1 {
|
||||
background-color: rgba(0,91,162,1.000000);
|
||||
border-radius: 24rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 34rpx 190rpx 32rpx 192rpx;
|
||||
}
|
||||
.text_1 {
|
||||
overflow-wrap: break-word;
|
||||
color: rgba(255,255,255,1);
|
||||
font-size: 34rpx;
|
||||
letter-spacing: 0rpx;
|
||||
font-family: Alibaba-PuHuiTi-M;
|
||||
font-weight: normal;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
line-height: 34rpx;
|
||||
}
|
||||
.text-wrapper_2 {
|
||||
border-radius: 24rpx;
|
||||
border: 1px solid rgba(232,232,232,1);
|
||||
margin-top: 40rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 34rpx 190rpx 32rpx 192rpx;
|
||||
}
|
||||
.text_2 {
|
||||
overflow-wrap: break-word;
|
||||
color: rgba(34,34,34,1);
|
||||
font-size: 34rpx;
|
||||
letter-spacing: 0rpx;
|
||||
font-family: Alibaba-PuHuiTi-M;
|
||||
font-weight: normal;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
line-height: 34rpx;
|
||||
}
|
||||
.text_3 {
|
||||
overflow-wrap: break-word;
|
||||
color: rgba(144,147,153,1);
|
||||
font-size: 26rpx;
|
||||
font-family: PingFangSC-Regular;
|
||||
font-weight: normal;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
line-height: 26rpx;
|
||||
align-self: center;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
.login-tips{
|
||||
.text-wrapper_3 {
|
||||
width: 520rpx;
|
||||
flex-direction: row;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin: 552rpx 50rpx 0 52rpx;
|
||||
}
|
||||
.text_4 {
|
||||
overflow-wrap: break-word;
|
||||
color: rgba(136,136,136,1);
|
||||
font-size: 24rpx;
|
||||
letter-spacing: 1rpx;
|
||||
font-family: PingFangSC-Regular;
|
||||
font-weight: normal;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
margin: 24rpx 32rpx 32rpx;
|
||||
margin-top: 80rpx;
|
||||
color: rgba(0, 0, 0, 0.6);
|
||||
|
||||
wx-text{
|
||||
color: var(--td-brand-color);
|
||||
}
|
||||
white-space: nowrap;
|
||||
line-height: 24rpx;
|
||||
}
|
||||
.text_5 {
|
||||
overflow-wrap: break-word;
|
||||
color: rgba(33,80,159,1);
|
||||
font-size: 24rpx;
|
||||
letter-spacing: 1rpx;
|
||||
font-family: PingFangSC-Medium;
|
||||
font-weight: 500;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
line-height: 24rpx;
|
||||
}
|
||||
.image_4 {
|
||||
width: 750rpx;
|
||||
height: 68rpx;
|
||||
margin-top: -2rpx;
|
||||
}
|
||||
@ -1,65 +1,20 @@
|
||||
<t-navbar left-arrow />
|
||||
<view class="page login">
|
||||
<view class="login__title">欢迎登录 TDsign</view>
|
||||
<view class="login__content">
|
||||
<view class="login__input">
|
||||
<view class="login__password" wx:if="{{isPasswordLogin}}">
|
||||
<t-input placeholder="请输入手机号" value="{{passwordInfo.account}}" bindchange="onAccountChange">
|
||||
<view slot="label" class="input-label">
|
||||
<t-icon name="mobile" size="40rpx" class="input-iconl"></t-icon>
|
||||
</view>
|
||||
</t-input>
|
||||
<t-input placeholder="请输入密码" type="password" clearable value="{{passwordInfo.password}}" bindchange="onPasswordChange">
|
||||
<view slot="label" class="input-label">
|
||||
<t-icon name="git-repository-private" size="40rpx" class="input-iconl"></t-icon>
|
||||
</view>
|
||||
</t-input>
|
||||
</view>
|
||||
<view wx:else>
|
||||
<t-input value="{{phoneNumber}}" placeholder="请输入手机号" type="number" bindchange="onPhoneInput">
|
||||
<view slot="label" class="input-label">
|
||||
<t-icon name="mobile" size="40rpx" class="input-iconl"></t-icon>
|
||||
</view>
|
||||
</t-input>
|
||||
<t-input value="{{code}}" placeholder="请输入验证码" type="number" bindchange="onCodeInput">
|
||||
<view slot="label" class="input-label">
|
||||
<t-icon name="mail" size="40rpx" class="input-iconl"></t-icon>
|
||||
</view>
|
||||
<view slot="suffix" style="display: flex; align-items: center">
|
||||
<view class="suffix--line"></view>
|
||||
<view class="verify" aria-role="button" bindtap="getCode">发送验证码</view>
|
||||
</view>
|
||||
</t-input>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<t-radio-group allow-uncheck borderless value="{{radioValue}}" bind:change="onCheckChange">
|
||||
<t-radio label="同意《用户服务协议条款》" value="agree" t-class="radio-class" t-class-icon="radio-class-icon" t-class-label="radio-class-label" />
|
||||
</t-radio-group>
|
||||
<view class="login__button">
|
||||
<t-button theme="primary" size="large" block disabled="{{!isSubmit}}" bindtap="login">
|
||||
{{ isPasswordLogin ? '登录' : '验证并登录' }}
|
||||
</t-button>
|
||||
<t-button class="phoneLogin" theme="primary" size="large" block open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">
|
||||
手机号快速登录
|
||||
</t-button>
|
||||
</view>
|
||||
<!-- <view class="login__password--forget" wx:if="{{isPasswordLogin}}">
|
||||
<text>忘记密码?</text>
|
||||
<text bindtap="uploadPass" >找回密码</text>
|
||||
</view> -->
|
||||
<view class="page">
|
||||
<view class="image-wrapper_1">
|
||||
<image src="" class="image_1"></image>
|
||||
<image src="" class="image_2"></image>
|
||||
<image src="../../assets/images/logo.jpg" class="image_3"></image>
|
||||
<image src="../../assets/images/top-bg.png" class="image_4"></image>
|
||||
</view>
|
||||
<!-- <view class="login__others">
|
||||
<text class="login__others-label">其他方式</text>
|
||||
<view class="login__others-buttons">
|
||||
<t-button class="button" variant="outline" theme="default" size="medium" shape="round" bindtap="changeLogin">
|
||||
{{isPasswordLogin ? '验证码登录' : '密码登录' }}
|
||||
</t-button>
|
||||
|
||||
<view class="box_1">
|
||||
<button class="text-wrapper_1" open-type="getPhoneNumber" bind:getphonenumber="getPhoneNumber">
|
||||
<text lines="1" class="text_1">手机号快捷登录</text>
|
||||
</button>
|
||||
<view class="text-wrapper_2" bind:tap="toLoginCode">
|
||||
<text lines="1" class="text_2">手机号登录/注册</text>
|
||||
</view>
|
||||
<view class="text-wrapper_3">
|
||||
<text lines="1" class="text_4">登录或注册完成即代表您同意</text>
|
||||
<text lines="1" class="text_5">《用户服务协议》</text>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="login-tips">
|
||||
<view>未注册过的手机号,我们将自动帮你注册账号</view>
|
||||
<view>登录或注册完成即代表你同意<text bindtap="uploadPass">《用户服务协议》</text></view>
|
||||
</view>
|
||||
</view>
|
||||
@ -2,52 +2,128 @@ import request from '~/api/request';
|
||||
|
||||
Page({
|
||||
data: {
|
||||
code: '',
|
||||
phoneNumber: '',
|
||||
sendCodeCount: 60,
|
||||
verifyCode: '',
|
||||
timer: null,
|
||||
getCodeText: '获取验证码',
|
||||
|
||||
},
|
||||
|
||||
timer: null,
|
||||
|
||||
|
||||
onLoad(options) {
|
||||
const { phoneNumber } = options;
|
||||
if (phoneNumber) {
|
||||
this.setData({ phoneNumber });
|
||||
}
|
||||
this.countDown();
|
||||
|
||||
},
|
||||
|
||||
onVerifycodeChange(e) {
|
||||
bindKeyInput(e){
|
||||
const { mode } = e.currentTarget.dataset;
|
||||
this.setData({
|
||||
verifyCode: e.detail.value,
|
||||
});
|
||||
[mode]: e.detail.value
|
||||
})
|
||||
},
|
||||
|
||||
countDown() {
|
||||
this.setData({ sendCodeCount: 60 });
|
||||
this.timer = setInterval(() => {
|
||||
if (this.data.sendCodeCount <= 0) {
|
||||
this.setData({ isSend: false, sendCodeCount: 0 });
|
||||
clearInterval(this.timer);
|
||||
} else {
|
||||
this.setData({ sendCodeCount: this.data.sendCodeCount - 1 });
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
|
||||
sendCode() {
|
||||
if (this.data.sendCodeCount === 0) {
|
||||
this.countDown();
|
||||
async getCode(){
|
||||
if (!this.data.phoneNumber) {
|
||||
wx.showToast({
|
||||
title: '请输入手机号',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 验证手机号格式
|
||||
if (!/^1[3-9]\d{9}$/.test(this.data.phoneNumber)) {
|
||||
wx.showToast({
|
||||
title: '请输入正确的手机号',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果正在倒计时,不允许重复获取
|
||||
if (this.data.timer) {
|
||||
return;
|
||||
}
|
||||
},
|
||||
|
||||
// 发送验证码
|
||||
const res = await request('patient/send_code', 'post', {
|
||||
mobile: this.data.phoneNumber,
|
||||
type: 1
|
||||
})
|
||||
console.log('验证码已发送');
|
||||
wx.showToast({
|
||||
title: '验证码已发送',
|
||||
icon: 'success'
|
||||
});
|
||||
|
||||
// 开始倒计时
|
||||
let countdown = 60;
|
||||
this.setData({
|
||||
getCodeText: `${countdown}s后重新获取`
|
||||
});
|
||||
|
||||
this.data.timer = setInterval(() => {
|
||||
countdown--;
|
||||
if (countdown <= 0) {
|
||||
clearInterval(this.data.timer);
|
||||
this.setData({
|
||||
timer: null,
|
||||
getCodeText: '获取验证码'
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
getCodeText: `${countdown}s后重新获取`
|
||||
});
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
},
|
||||
async login() {
|
||||
const res = await request('/login/postCodeVerify', 'get', { code: this.data.verifyCode });
|
||||
if (res.success) {
|
||||
await wx.setStorageSync('access_token', res.data.token);
|
||||
// 验证手机号
|
||||
if (!this.data.phoneNumber) {
|
||||
wx.showToast({
|
||||
title: '请输入手机号',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 验证手机号格式
|
||||
if (!/^1[3-9]\d{9}$/.test(this.data.phoneNumber)) {
|
||||
wx.showToast({
|
||||
title: '请输入正确的手机号',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 验证验证码
|
||||
if (!this.data.code) {
|
||||
wx.showToast({
|
||||
title: '请输入验证码',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 验证验证码格式(假设验证码为6位数字)
|
||||
if (!/^\d{6}$/.test(this.data.code)) {
|
||||
wx.showToast({
|
||||
title: '请输入6位数字验证码',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const res = await request('patient/code_login', 'post', {
|
||||
code: this.data.code,
|
||||
mobile: this.data.phoneNumber
|
||||
});
|
||||
await wx.setStorageSync('access_token', res.token);
|
||||
if (res.is_personal_information_complete) {
|
||||
wx.switchTab({
|
||||
url: `/pages/my/index`,
|
||||
});
|
||||
} else {
|
||||
wx.navigateTo({
|
||||
url: `/pages/my/info-edit/index`,
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
});
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
{
|
||||
"navigationStyle": "custom",
|
||||
"usingComponents": {
|
||||
"t-navbar": "tdesign-miniprogram/navbar/navbar",
|
||||
"t-input": "tdesign-miniprogram/input/input",
|
||||
"t-link": "tdesign-miniprogram/link/link",
|
||||
"t-button": "tdesign-miniprogram/button/button"
|
||||
}
|
||||
},
|
||||
"navigationBarTitleText": "登录"
|
||||
}
|
||||
|
||||
@ -1,37 +1,213 @@
|
||||
.login-code {
|
||||
&__title {
|
||||
color: rgba(0, 0, 0, 0.9);
|
||||
font-size: 56rpx;
|
||||
font-weight: 600;
|
||||
line-height: 72rpx;
|
||||
padding: 16rpx 32rpx 40rpx;
|
||||
}
|
||||
|
||||
&__tips {
|
||||
margin: 0 32rpx;
|
||||
color: rgba(0, 0, 0, 0.4);
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
&__input {
|
||||
margin-top: 48rpx;
|
||||
|
||||
.suffix {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-width: 168rpx;
|
||||
}
|
||||
|
||||
.suffix--line {
|
||||
width: 2rpx;
|
||||
height: 48rpx;
|
||||
background-color: #f3f3f3;
|
||||
margin-right: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
&__button {
|
||||
margin: 56rpx 32rpx;
|
||||
}
|
||||
.page {
|
||||
background-color: rgba(255,255,255,1.000000);
|
||||
position: relative;
|
||||
width: 750rpx;
|
||||
height: 1624rpx;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.box_1 {
|
||||
background-color: rgba(255,255,255,1.000000);
|
||||
padding-bottom: 12rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.image_1 {
|
||||
width: 750rpx;
|
||||
height: 88rpx;
|
||||
}
|
||||
.image-wrapper_1 {
|
||||
width: 706rpx;
|
||||
flex-direction: row;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin: 12rpx 12rpx 0 32rpx;
|
||||
}
|
||||
.image_2 {
|
||||
width: 24rpx;
|
||||
height: 48rpx;
|
||||
margin: 8rpx 0 8rpx 0;
|
||||
}
|
||||
.image_3 {
|
||||
width: 174rpx;
|
||||
height: 64rpx;
|
||||
}
|
||||
.box_2 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 60rpx 64rpx 36rpx 64rpx;
|
||||
}
|
||||
.text-group_1 {
|
||||
margin-right: 238rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.text_1 {
|
||||
overflow-wrap: break-word;
|
||||
color: rgba(51,51,51,1);
|
||||
font-size: 48rpx;
|
||||
font-family: Alibaba-PuHuiTi-M;
|
||||
font-weight: normal;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
line-height: 48rpx;
|
||||
margin-right: 146rpx;
|
||||
}
|
||||
.text_2 {
|
||||
overflow-wrap: break-word;
|
||||
color: rgba(153,153,153,1);
|
||||
font-size: 26rpx;
|
||||
font-family: Alibaba-PuHuiTi-R;
|
||||
font-weight: normal;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
line-height: 26rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.section_1 {
|
||||
background-color: rgba(245,245,245,1.000000);
|
||||
border-radius: 24rpx;
|
||||
margin-top: 90rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
padding: 34rpx 34rpx 34rpx 40rpx;
|
||||
}
|
||||
.image-text_1 {
|
||||
flex-direction: row;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
}
|
||||
.thumbnail_1 {
|
||||
font-size: 40rpx;
|
||||
margin-right: 8rpx;
|
||||
width: 50rpx;
|
||||
transform: translateY(4rpx);
|
||||
}
|
||||
.text-group_2 {
|
||||
overflow-wrap: break-word;
|
||||
// color: rgba(170,170,170,1);
|
||||
font-size: 32rpx;
|
||||
letter-spacing: 0rpx;
|
||||
font-family: Alibaba-PuHuiTi-R;
|
||||
font-weight: normal;
|
||||
white-space: nowrap;
|
||||
line-height: 32rpx;
|
||||
flex: auto;
|
||||
}
|
||||
.section_2 {
|
||||
background-color: rgba(245,245,245,1.000000);
|
||||
border-radius: 24rpx;
|
||||
margin-top: 32rpx;
|
||||
flex-direction: row;
|
||||
display: flex;
|
||||
justify-content: flex-center;
|
||||
padding: 32rpx 40rpx 34rpx 40rpx;
|
||||
}
|
||||
.image-text_2 {
|
||||
flex-direction: row;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.thumbnail_2 {
|
||||
font-size: 40rpx;
|
||||
margin-right: 10rpx;
|
||||
width: 50rpx;
|
||||
transform: translateY(4rpx);
|
||||
}
|
||||
.text-group_3 {
|
||||
overflow-wrap: break-word;
|
||||
// color: rgba(170,170,170,1);
|
||||
font-size: 32rpx;
|
||||
letter-spacing: 0rpx;
|
||||
font-family: Alibaba-PuHuiTi-R;
|
||||
font-weight: normal;
|
||||
white-space: nowrap;
|
||||
line-height: 32rpx;
|
||||
margin-top: 2rpx;
|
||||
}
|
||||
.block_1 {
|
||||
background-color: rgba(187,187,187,1.000000);
|
||||
width: 2rpx;
|
||||
height: 32rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: 2rpx 0 0 0;
|
||||
}
|
||||
.text_3 {
|
||||
overflow-wrap: break-word;
|
||||
color: rgba(0,91,162,1);
|
||||
font-size: 32rpx;
|
||||
font-family: Alibaba-PuHuiTi-R;
|
||||
font-weight: normal;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
line-height: 32rpx;
|
||||
margin: 2rpx 0 0 34rpx;
|
||||
}
|
||||
.text-wrapper_1 {
|
||||
background-color: rgba(0,91,162,1.000000);
|
||||
border-radius: 24rpx;
|
||||
margin-top: 80rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 34rpx 232rpx 32rpx 234rpx;
|
||||
}
|
||||
.text_4 {
|
||||
overflow-wrap: break-word;
|
||||
color: rgba(255,255,255,1);
|
||||
font-size: 34rpx;
|
||||
letter-spacing: 0rpx;
|
||||
font-family: Alibaba-PuHuiTi-M;
|
||||
font-weight: normal;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
line-height: 34rpx;
|
||||
}
|
||||
.text_5 {
|
||||
overflow-wrap: break-word;
|
||||
color: rgba(144,147,153,1);
|
||||
font-size: 26rpx;
|
||||
font-family: PingFangSC-Regular;
|
||||
font-weight: normal;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
line-height: 26rpx;
|
||||
align-self: center;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
.text-wrapper_2 {
|
||||
width: 520rpx;
|
||||
flex-direction: row;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin: 600rpx 50rpx 0 52rpx;
|
||||
}
|
||||
.text_6 {
|
||||
overflow-wrap: break-word;
|
||||
color: rgba(136,136,136,1);
|
||||
font-size: 24rpx;
|
||||
letter-spacing: 1rpx;
|
||||
font-family: PingFangSC-Regular;
|
||||
font-weight: normal;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
line-height: 24rpx;
|
||||
}
|
||||
.text_7 {
|
||||
overflow-wrap: break-word;
|
||||
color: rgba(33,80,159,1);
|
||||
font-size: 24rpx;
|
||||
letter-spacing: 1rpx;
|
||||
font-family: PingFangSC-Medium;
|
||||
font-weight: 500;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
line-height: 24rpx;
|
||||
}
|
||||
.image_4 {
|
||||
width: 750rpx;
|
||||
height: 68rpx;
|
||||
margin-top: -2rpx;
|
||||
}
|
||||
@ -1,24 +1,36 @@
|
||||
<t-navbar left-arrow />
|
||||
<view class="page login-code">
|
||||
<view class="login-code__title"> 请输入验证码 </view>
|
||||
<view class="login-code__tips"> 验证码已通过短信发送至 {{ phoneNumber }} </view>
|
||||
<view class="login-code__input">
|
||||
<t-input placeholder="输入验证码" value="{{verifyCode}}" type="number" bindchange="onVerifycodeChange">
|
||||
<view slot="suffix" class="suffix">
|
||||
<view class="suffix--line"></view>
|
||||
<t-link
|
||||
size="medium"
|
||||
hover
|
||||
disabled="{{sendCodeCount !== 0}}"
|
||||
theme="primary"
|
||||
content="{{sendCodeCount === 0 ? '发送验证码' : sendCodeCount+'秒后重发' }}"
|
||||
bindtap="sendCode"
|
||||
/>
|
||||
<view class="page">
|
||||
<view class="box_1">
|
||||
<image src="https://lanhu-oss-2537-2.lanhuapp.com/SketchPngc7eafd88f05e3acc51a4c7ba25ac5d8858a9aaac00d7c68d603489d8e173d890" class="image_1"></image>
|
||||
<view class="image-wrapper_1">
|
||||
<image src="https://lanhu-oss-2537-2.lanhuapp.com/SketchPngf1d54de0848dc82606ca0a16f317ad38594ba02bce6208c871534a0b25940b90" class="image_2"></image>
|
||||
<image src="https://lanhu-oss-2537-2.lanhuapp.com/SketchPng2e60a3b7b2cf506a5f57e1f715583164f2b1c3ebfdb48ed093bfea66a8490f11" class="image_3"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="box_2">
|
||||
<view class="text-group_1">
|
||||
<text lines="1" class="text_1">验证码登录</text>
|
||||
<text lines="1" class="text_2">未注册的手机号验证后将自动注册</text>
|
||||
</view>
|
||||
<view class="section_1">
|
||||
<view class="image-text_1">
|
||||
<text class="iconfont icon-shouji thumbnail_1"></text>
|
||||
<input lines="1" type="number" class="text-group_2" maxlength="11" placeholder="请输入手机号" data-mode="phoneNumber" value="{{phoneNumber}}" bindinput="bindKeyInput"></input>
|
||||
</view>
|
||||
</t-input>
|
||||
</view>
|
||||
<view class="section_2">
|
||||
<view class="image-text_2">
|
||||
<text class="iconfont icon-xiaoxi thumbnail_2"></text>
|
||||
<input lines="1" type="number" class="text-group_3" placeholder="请输入验证码" data-mode="code" value="{{code}}" bindinput="bindKeyInput"></input>
|
||||
</view>
|
||||
<view class="block_1"></view>
|
||||
<text lines="1" class="text_3" bind:tap="getCode">{{getCodeText}}</text>
|
||||
</view>
|
||||
<view class="text-wrapper_1">
|
||||
<text lines="1" class="text_4" bind:tap="login">登录/注册</text>
|
||||
</view>
|
||||
<view class="text-wrapper_2">
|
||||
<text lines="1" class="text_6">登录或注册完成即代表您同意</text>
|
||||
<text lines="1" class="text_7">《用户服务协议》</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="login-code__button">
|
||||
<t-button theme="primary" size="large" block disabled="{{!verifyCode}}" bindtap="login">登录</t-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -13,11 +13,19 @@ Page({
|
||||
url: '/pages/AddTherapeuticRegimen/index',
|
||||
})
|
||||
},
|
||||
|
||||
async toPathDetails(e){
|
||||
const data = this.data.list[e.currentTarget.dataset.index]
|
||||
await wx.setStorageSync('therapeuticRegimen',JSON.stringify(data));
|
||||
wx.navigateTo({
|
||||
url: `/pages/AddTherapeuticRegimen/index?id=${data.id}`,
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.getList()
|
||||
|
||||
},
|
||||
|
||||
async getList(){
|
||||
@ -48,7 +56,7 @@ Page({
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
this.getList()
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<!--pages/therapeuticRegimen/index.wxml-->
|
||||
<scroll-view class="therapeuticRegimen">
|
||||
<view class="therapeuticRegimen-item">
|
||||
<!-- <view class="therapeuticRegimen-item">
|
||||
<view class="time">
|
||||
2024.10.01 至 2024.10.31
|
||||
</view>
|
||||
@ -15,20 +15,21 @@
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="therapeuticRegimen-item" wx:for="{{list}}" wx:key="index">
|
||||
</view> -->
|
||||
<view class="therapeuticRegimen-item" wx:for="{{list}}" wx:key="index" data-index="{{index}}" bind:tap="toPathDetails">
|
||||
<view class="time">
|
||||
{{item.start_time}} 至 {{item.end_time}}
|
||||
<text class="tab-text {{item.status == '进行中' ? 'primary' : 'default'}}">{{item.status}}</text>
|
||||
{{item.start_date}} 至 {{item.end_date}}
|
||||
|
||||
</view>
|
||||
<view class="item-box" wx:for="{{item.medicine_schemes}}" wx:key="index">
|
||||
<text class="tab-text {{item.status == '进行中' ? 'primary' : 'default'}}">{{item.status}}</text>
|
||||
<view class="item-box" wx:for="{{item.detail}}" wx:for-item="detail" wx:key="index">
|
||||
|
||||
<view class="image-box"></view>
|
||||
<view class="details">
|
||||
<view class="name">{{item.name}}</view>
|
||||
<view class="text">每日{{item.frequency}}次,{{item.time}}</view>
|
||||
<view class="name">{{detail.name}}</view>
|
||||
<view class="text">每日{{detail.frequency}}次,{{detail.time}}</view>
|
||||
</view>
|
||||
<view class="yw-jl">{{item.dose}}</view>
|
||||
<view class="yw-jl">{{detail.dose}}</view>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user