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