diff --git a/pages/AddTherapeuticRegimen/index.js b/pages/AddTherapeuticRegimen/index.js index 7ab07cb..d71b837 100644 --- a/pages/AddTherapeuticRegimen/index.js +++ b/pages/AddTherapeuticRegimen/index.js @@ -303,7 +303,7 @@ Page({ const policyData = await request('admin/policy_token', 'post') const res = JSON.parse(policyData.token) - const fileNameWithExt = file.path.split('/').pop(); // hello.png + const fileNameWithExt = file.tempFilePath.split('/').pop(); // hello.png const fileName = fileNameWithExt.split('.').slice(0, -1).join('.'); // hello const formData = { @@ -322,7 +322,7 @@ Page({ wx.uploadFile({ url: 'https://image-fudan.oss-cn-beijing.aliyuncs.com/', method: 'put', - filePath: file.path, + filePath: file.tempFilePath, name: 'file', //固定值为file formData: formData, success(res) { @@ -344,9 +344,10 @@ Page({ }, handleUpload(e) { - wx.chooseImage({ + wx.chooseMedia({ count: 1, // 选择一个文件 - type: 'all', // 支持所有类型的文件 + mediaType: ['image'], + sourceType: ['album', 'camera'], success: (res) => { wx.showToast({ title: '文件上传中,请稍等!', icon: 'none' }); console.log('选择的文件:', res.tempFiles); // 输出选择的文件信息 diff --git a/pages/clockIn/index.less b/pages/clockIn/index.less index 71db38d..0ac4c08 100644 --- a/pages/clockIn/index.less +++ b/pages/clockIn/index.less @@ -94,7 +94,7 @@ .after{ position: absolute; width: 0; - height: calc(100% - 40rpx); + height: calc(100% - 20rpx); top: 34rpx; left: 10rpx; border-left: 2rpx dashed rgba(0,91,162,0.7); @@ -112,6 +112,8 @@ flex-direction: row; display: flex; justify-content: space-between; + padding: 10rpx 0; + padding-bottom: 20rpx; } .group_4 { border-radius: 100%; @@ -159,7 +161,6 @@ } .image-text_1 { // display: flex; - padding-right: 134rpx; } // .section_4 { // border-radius: 16rpx; @@ -209,16 +210,16 @@ .text_7 { overflow-wrap: break-word; color: rgba(0,91,162,1); - font-size: 28rpx; + font-size: 26rpx; font-family: Alibaba-PuHuiTi-M; font-weight: normal; text-align: right; white-space: nowrap; line-height: 32rpx; position: absolute; - right: 50rpx; - top: 50%; - transform: translateY(-50%); + right: 0rpx; + top: 4rpx; + z-index: 1; } .section_5 { width: 112rpx; @@ -386,23 +387,27 @@ background-color: rgba(0,91,162,1.000000); border-radius: 32rpx; - padding: 10rpx 32rpx 10rpx 32rpx; - // width: 70rpx; + // padding: 8rpx 28rpx 8rpx 28rpx; + height: 50rpx; + width: 100rpx; text-align: center; position: absolute; - right: 24rpx; - top: 50%; - transform: translateY(-50%); + right: 0rpx; + top: 0; + // transform: translateY(-50%); + z-index: 1; + display: flex; + align-items: center; + justify-content: center; } .text_14 { - overflow-wrap: break-word; color: rgba(255,255,255,1); - font-size: 28rpx; + font-size: 26rpx; font-family: Alibaba-PuHuiTi-M; - font-weight: normal; - text-align: right; - white-space: nowrap; - line-height: 32rpx; + // font-weight: normal; + // text-align: right; + // white-space: nowrap; + // line-height: 32rpx; } .section_10 { width: 112rpx; diff --git a/pages/clockIn/index.wxml b/pages/clockIn/index.wxml index c387ffa..0bc826a 100644 --- a/pages/clockIn/index.wxml +++ b/pages/clockIn/index.wxml @@ -12,6 +12,10 @@ {{item.medicine_time}} + 已打卡 + + 打卡 + @@ -22,11 +26,8 @@ {{detail.dose}} {{detail.time}} - - 已打卡 - - 打卡 - + + diff --git a/pages/followUp/index.js b/pages/followUp/index.js index 6fb40f6..7267880 100644 --- a/pages/followUp/index.js +++ b/pages/followUp/index.js @@ -251,7 +251,7 @@ Page({ const policyData = await request('admin/policy_token', 'post') const res = JSON.parse(policyData.token) - const fileNameWithExt = file.path.split('/').pop(); // hello.png + const fileNameWithExt = file.tempFilePath.split('/').pop(); // hello.png const fileName = fileNameWithExt.split('.').slice(0, -1).join('.'); // hello const formData = { @@ -270,7 +270,7 @@ Page({ wx.uploadFile({ url: 'https://image-fudan.oss-cn-beijing.aliyuncs.com/', method: 'put', - filePath: file.path, + filePath: file.tempFilePath, name: 'file', //固定值为file formData: formData, success(res) { @@ -297,9 +297,11 @@ Page({ wx.showToast({ title: '最多上传9张图片!', icon: 'none' }); return } - wx.chooseImage({ + wx.chooseMedia({ count: 1, // 选择一个文件 - type: 'all', // 支持所有类型的文件 + mediaType: ['image'], + sourceType: ['album', 'camera'], + // type: 'all', // 支持所有类型的文件 success: (res) => { wx.showToast({ title: '文件上传中,请稍等!', icon: 'none' }); console.log('选择的文件:', res.tempFiles); // 输出选择的文件信息 diff --git a/pages/home/index.less b/pages/home/index.less index 84f8334..52811f2 100644 --- a/pages/home/index.less +++ b/pages/home/index.less @@ -282,7 +282,8 @@ flex-direction: row; display: flex; justify-content: space-between; - margin: 32rpx 0rpx 18rpx 0; + margin: 30rpx 0; + // margin-bottom: 32rpx; } .box_6 { border-radius: 100%; @@ -365,13 +366,17 @@ border-radius: 32rpx; - padding: 10rpx 32rpx 10rpx 32rpx; - // width: 70rpx; + // padding: 10rpx 32rpx 10rpx 32rpx; + height: 50rpx; + width: 100rpx; text-align: center; position: absolute; - right: 24rpx; - top: 50%; - transform: translateY(-50%); + right: 0rpx; + top: -10rpx; + align-items: center; + + // transform: translateY(-50%); + z-index: 1; .text_23 { color:rgba(0,91,162,1.000000); } @@ -385,7 +390,7 @@ } .text_23 { overflow-wrap: break-word; - font-size: 28rpx; + font-size: 26rpx; font-family: Alibaba-PuHuiTi-M; font-weight: normal; text-align: right; diff --git a/pages/home/index.wxml b/pages/home/index.wxml index b0fde59..fd95f83 100644 --- a/pages/home/index.wxml +++ b/pages/home/index.wxml @@ -39,6 +39,9 @@ {{item.medicine_time}} + + {{item.status=='2'?'已打卡':'打卡'}} + @@ -48,10 +51,8 @@ {{item2.frequency}}片,{{item2.time}}服用 - - - {{item.status=='2'?'已打卡':'打卡'}} - + + diff --git a/pages/medicationRecord/index.less b/pages/medicationRecord/index.less index 8610195..dcc032f 100644 --- a/pages/medicationRecord/index.less +++ b/pages/medicationRecord/index.less @@ -147,7 +147,7 @@ .after{ position: absolute; width: 0; - height: calc(100% - 40rpx); + height: calc(100% - 20rpx); top: 34rpx; left: 10rpx; border-left: 2rpx dashed rgba(0,91,162,0.7); @@ -165,6 +165,8 @@ flex-direction: row; display: flex; justify-content: space-between; + padding: 10rpx 0; + margin-bottom: 20rpx; } .group_4 { border-radius: 100%; @@ -212,7 +214,6 @@ } .image-text_1 { display: flex; - padding-right: 160rpx; } .section_4 { border-radius: 16rpx; @@ -262,19 +263,20 @@ .text_7 { overflow-wrap: break-word; color: #909399; - font-size: 28rpx; + font-size: 26rpx; font-family: Alibaba-PuHuiTi-M; font-weight: normal; text-align: right; white-space: nowrap; line-height: 32rpx; position: absolute; - right: 24rpx; - top: 50%; - transform: translateY(-50%); - .active{ - color: rgba(0,91,162,1); - } + right: 0rpx; + top: 4rpx; + z-index: 1; + +} +.active{ + color: rgba(0,91,162,1); } .section_5 { width: 112rpx; diff --git a/pages/medicationRecord/index.wxml b/pages/medicationRecord/index.wxml index 015b872..aed70b4 100644 --- a/pages/medicationRecord/index.wxml +++ b/pages/medicationRecord/index.wxml @@ -40,19 +40,20 @@ {{day.medicine_time}} + 已打卡 + 未打卡 - + {{detail.name}} {{detail.dose}} {{detail.time}} - - 已打卡 - 未打卡 + + diff --git a/pages/message/index.js b/pages/message/index.js index b1e7f63..e86beef 100644 --- a/pages/message/index.js +++ b/pages/message/index.js @@ -108,9 +108,10 @@ Page({ }) }, goQuestionnaire(e) { - const data = this.data.dataList[0] + const data = this.data.dataList + const target = data.find(item => item.questionnaire_id === 0 && item.status === 2); wx.navigateTo({ - url: `/pages/followUp/index?planId=${data.id}&name=${data.plan_name}&time=${data.plan_date}&questionnaire_id=${data.questionnaire_id}` , + url: `/pages/followUp/index?planId=${target.id}&name=&time=&questionnaire_id=0` , }) }, toRegister() { diff --git a/pages/mmp-7/index.js b/pages/mmp-7/index.js index c9c26c8..0b7cc74 100644 --- a/pages/mmp-7/index.js +++ b/pages/mmp-7/index.js @@ -38,7 +38,7 @@ async uploadFileToOSS(file, callback) { const policyData = await request('admin/policy_token', 'post') const res = JSON.parse(policyData.token) - const fileNameWithExt = file.path.split('/').pop(); // hello.png + const fileNameWithExt = file.tempFilePath.split('/').pop(); // hello.png const fileName = fileNameWithExt.split('.').slice(0, -1).join('.'); // hello const formData = { @@ -57,7 +57,7 @@ async uploadFileToOSS(file, callback) { wx.uploadFile({ url: 'https://image-fudan.oss-cn-beijing.aliyuncs.com/', method: 'put', - filePath: file.path, + filePath: file.tempFilePath, name: 'file', //固定值为file formData: formData, success(res) { @@ -82,9 +82,10 @@ handleUpload(e) { const { mode } = e.currentTarget.dataset; - wx.chooseImage({ + wx.chooseMedia({ count: 1, // 选择一个文件 - type: 'all', // 支持所有类型的文件 + mediaType: ['image'], + sourceType: ['album', 'camera'], success: (res) => { wx.showToast({ title: '文件上传中,请稍等!', icon: 'none' }); if (res.tempFiles.length > 0) { diff --git a/pages/my/index.js b/pages/my/index.js index a37d572..da7fd47 100644 --- a/pages/my/index.js +++ b/pages/my/index.js @@ -57,6 +57,7 @@ Page({ const Token = wx.getStorageSync('access_token'); if (Token) { const personalInfo = await this.getPersonalInfo(); + personalInfo.avatar = personalInfo.avatar ? personalInfo.avatar : 'https://image-fudan.oss-cn-beijing.aliyuncs.com/mini_images/my/baby.png'; let style = '' if(personalInfo.risk_type == '1' || !personalInfo.risk_type){ style = 'success' diff --git a/pages/my/index.less b/pages/my/index.less index c1091b0..1a3883b 100644 --- a/pages/my/index.less +++ b/pages/my/index.less @@ -171,6 +171,7 @@ background-color: rgba(255,255,255,0.5); // padding: 20rpx; border-radius: 120rpx; + overflow: hidden; // border: 4rpx solid rgba(255,255,255,1); image{ width: 100%; diff --git a/pages/my/index.wxml b/pages/my/index.wxml index 7aeb655..e7741f9 100644 --- a/pages/my/index.wxml +++ b/pages/my/index.wxml @@ -18,7 +18,7 @@ - + diff --git a/pages/my/info-edit/index.js b/pages/my/info-edit/index.js index c95674b..c9b787e 100644 --- a/pages/my/info-edit/index.js +++ b/pages/my/info-edit/index.js @@ -341,8 +341,71 @@ Page({ userInfoHandler(e){ console.log(e.detail) + + this.uploadFileToOSS(e.detail.avatarUrl, (error, data) => { + if (error) { + wx.showToast({ title: '上传失败!', icon: 'none' }); + console.error('上传失败:', error); // 输出具体的错误信息 + } else { + wx.showToast({ title: '上传成功!', icon: 'success' }); + this.setData({ + 'personInfo.avatar': data + }) + + console.log('上传成功:', data); // 输出上传成功后的数据 + } + }); }, + //上传文件方法 + async uploadFileToOSS(file, callback) { + + + const policyData = await request('admin/policy_token', 'post') + const res = JSON.parse(policyData.token) + + const fileNameWithExt = file.split('/').pop(); // hello.png + const fileName = fileNameWithExt.split('.').slice(0, -1).join('.'); // hello + + const formData = { + key: 'upload_file/' + fileName, //上传文件名称 + policy: res.policy, //表单域 + 'x-oss-signature-version': res.x_oss_signature_version, //指定签名的版本和算法 + 'x-oss-credential': res.x_oss_credential, //指明派生密钥的参数集 + 'x-oss-date': res.x_oss_date, //请求的时间 + 'x-oss-signature': res.signature, //签名认证描述信息 + 'x-oss-security-token': res.security_token, //安全令牌 + success_action_status: "200" //上传成功后响应状态码 + }; + // console.log(filePath) + // return + // 发送请求上传文件 + wx.uploadFile({ + url: 'https://image-fudan.oss-cn-beijing.aliyuncs.com/', + method: 'put', + filePath: file, + name: 'file', //固定值为file + formData: formData, + success(res) { + console.log('上传响应:', res); + if (res.statusCode === 200) { + callback(null, 'https://image-fudan.oss-cn-beijing.aliyuncs.com/upload_file/'+ fileName); // 上传成功 + } else { + console.error('上传失败,状态码:', res.statusCode); + console.error('失败响应:', res); + callback(res); // 上传失败,返回响应 + } + }, + fail(err) { + console.error('上传失败:', err); // 输出错误信息 + wx.showToast({ title: '上传失败,请重试!', icon: 'none' }); + callback(err); // 调用回调处理错误 + } + }); + + }, + + async onSaveInfo() { let obj = this.data.personInfo; let errorStatus = {}; diff --git a/pages/my/info-edit/index.less b/pages/my/info-edit/index.less index 9b550ff..a9b97cb 100644 --- a/pages/my/info-edit/index.less +++ b/pages/my/info-edit/index.less @@ -67,12 +67,19 @@ page { z-index: 999; } +.info-edit__cell.avatar{ + .t-cell__title{ + line-height: 60rpx; + } +} + .user-avatar{ border: 0; + padding: 0; background-color: transparent; - width: 80rpx; - height: 80rpx; - border-radius: 80rpx; + width: 60rpx; + height: 60rpx; + border-radius: 60rpx; overflow: hidden; image{ width: 100%; diff --git a/pages/my/info-edit/index.wxml b/pages/my/info-edit/index.wxml index c385cbe..351494a 100644 --- a/pages/my/info-edit/index.wxml +++ b/pages/my/info-edit/index.wxml @@ -1,7 +1,7 @@ - -