|
|
@@ -274,11 +274,7 @@ components: { TabTransition, PageBanner, RadarChart, LoginGuideCard, FamilyEnerg
|
|
|
},
|
|
|
|
|
|
// 家庭天盘 - 每日运势数据
|
|
|
- dailyFortuneData: null,
|
|
|
-
|
|
|
- // 心理报告上传
|
|
|
- uploadedReports: [],
|
|
|
- reportUploadLoading: false
|
|
|
+ dailyFortuneData: null
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -532,54 +528,6 @@ components: { TabTransition, PageBanner, RadarChart, LoginGuideCard, FamilyEnerg
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- // ===== 心理报告上传 =====
|
|
|
- chooseAndUploadReport: function() {
|
|
|
- var self = this
|
|
|
- uni.chooseImage({
|
|
|
- count: 1,
|
|
|
- sizeType: ['original', 'compressed'],
|
|
|
- sourceType: ['album', 'camera'],
|
|
|
- success: function(chooseRes) {
|
|
|
- self.reportUploadLoading = true
|
|
|
- var tempFilePath = chooseRes.tempFilePaths[0]
|
|
|
- var fileName = '心理报告_' + Date.now() + '.jpg'
|
|
|
-
|
|
|
- uni.uploadFile({
|
|
|
- url: config.baseUrl + '/api/mind/report/upload',
|
|
|
- filePath: tempFilePath,
|
|
|
- name: 'report',
|
|
|
- formData: {
|
|
|
- familyId: self.currentChildId || ''
|
|
|
- },
|
|
|
- header: {
|
|
|
- 'Authorization': 'Bearer ' + uni.getStorageSync('token')
|
|
|
- },
|
|
|
- success: function(uploadRes) {
|
|
|
- self.reportUploadLoading = false
|
|
|
- if (uploadRes.statusCode === 200) {
|
|
|
- var result = JSON.parse(uploadRes.data)
|
|
|
- if (result.code === 200) {
|
|
|
- self.uploadedReports.unshift(result.data)
|
|
|
- uni.showToast({ title: '上传成功', icon: 'success' })
|
|
|
- } else {
|
|
|
- uni.showToast({ title: result.message || '上传失败', icon: 'none' })
|
|
|
- }
|
|
|
- } else {
|
|
|
- uni.showToast({ title: '上传失败: ' + uploadRes.statusCode, icon: 'none' })
|
|
|
- }
|
|
|
- },
|
|
|
- fail: function(err) {
|
|
|
- self.reportUploadLoading = false
|
|
|
- uni.showToast({ title: '上传失败: ' + (err.errMsg || ''), icon: 'none' })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- fail: function() {
|
|
|
- // 用户取消选择
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
viewReport: function(report) {
|
|
|
if (report && report.fileUrl) {
|
|
|
uni.downloadFile({
|
|
|
@@ -598,23 +546,6 @@ components: { TabTransition, PageBanner, RadarChart, LoginGuideCard, FamilyEnerg
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- loadUploadedReports: function() {
|
|
|
- var self = this
|
|
|
- uni.request({
|
|
|
- url: config.baseUrl + '/api/mind/report/list',
|
|
|
- method: 'POST',
|
|
|
- data: { familyId: self.currentChildId || '' },
|
|
|
- header: {
|
|
|
- 'Authorization': 'Bearer ' + uni.getStorageSync('token')
|
|
|
- },
|
|
|
- success: function(res) {
|
|
|
- if (res.data && res.data.code === 200 && res.data.data) {
|
|
|
- self.uploadedReports = res.data.data
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
formatDate: function(dateStr) {
|
|
|
if (!dateStr) return ''
|
|
|
var d = parseDate(dateStr)
|