diff --git a/api/request.js b/api/request.js index 1ca8495..2dc05ea 100644 --- a/api/request.js +++ b/api/request.js @@ -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) { diff --git a/app.less b/app.less index 29c143a..658b301 100644 --- a/app.less +++ b/app.less @@ -25,6 +25,9 @@ page { color: #222222; } } + button{ + margin: 0; + } } .page { diff --git a/assets/images/logo.jpg b/assets/images/logo.jpg new file mode 100644 index 0000000..88ec9de Binary files /dev/null and b/assets/images/logo.jpg differ diff --git a/assets/images/top-bg.png b/assets/images/top-bg.png new file mode 100644 index 0000000..35e6579 Binary files /dev/null and b/assets/images/top-bg.png differ diff --git a/iconfont.less b/iconfont.less index d028e8d..33b1f51 100644 --- a/iconfont.less +++ b/iconfont.less @@ -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"; } - diff --git a/pages/AddTherapeuticRegimen/index.js b/pages/AddTherapeuticRegimen/index.js index 4580209..db0e468 100644 --- a/pages/AddTherapeuticRegimen/index.js +++ b/pages/AddTherapeuticRegimen/index.js @@ -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), + }) + }, + /** * 生命周期函数--监听页面初次渲染完成 */ diff --git a/pages/AddTherapeuticRegimen/index.less b/pages/AddTherapeuticRegimen/index.less index d9aa029..df81610 100644 --- a/pages/AddTherapeuticRegimen/index.less +++ b/pages/AddTherapeuticRegimen/index.less @@ -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; } } diff --git a/pages/AddTherapeuticRegimen/index.wxml b/pages/AddTherapeuticRegimen/index.wxml index d7e5c4b..8f963e2 100644 --- a/pages/AddTherapeuticRegimen/index.wxml +++ b/pages/AddTherapeuticRegimen/index.wxml @@ -39,7 +39,7 @@ - + @@ -47,14 +47,14 @@ - + {{reminder.noon}} - + {{reminder.evening}} @@ -112,10 +112,9 @@ diff --git a/pages/login/login.js b/pages/login/login.js index bea47d8..b2e6a07 100644 --- a/pages/login/login.js +++ b/pages/login/login.js @@ -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`, }) diff --git a/pages/login/login.less b/pages/login/login.less index 38d6ed5..c834a02 100644 --- a/pages/login/login.less +++ b/pages/login/login.less @@ -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; } \ No newline at end of file diff --git a/pages/login/login.wxml b/pages/login/login.wxml index 7fb37e7..534f306 100644 --- a/pages/login/login.wxml +++ b/pages/login/login.wxml @@ -1,65 +1,20 @@ - - \ No newline at end of file diff --git a/pages/therapeuticRegimen/index.js b/pages/therapeuticRegimen/index.js index 9f65ddb..d4f8f84 100644 --- a/pages/therapeuticRegimen/index.js +++ b/pages/therapeuticRegimen/index.js @@ -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() }, /** diff --git a/pages/therapeuticRegimen/index.wxml b/pages/therapeuticRegimen/index.wxml index 9e04d40..6b0e256 100644 --- a/pages/therapeuticRegimen/index.wxml +++ b/pages/therapeuticRegimen/index.wxml @@ -1,6 +1,6 @@ - + + - {{item.start_time}} 至 {{item.end_time}} - {{item.status}} + {{item.start_date}} 至 {{item.end_date}} + - + {{item.status}} + - {{item.name}} - 每日{{item.frequency}}次,{{item.time}} + {{detail.name}} + 每日{{detail.frequency}}次,{{detail.time}} - {{item.dose}} + {{detail.dose}}