You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.4 KiB
67 lines
1.4 KiB
5 years ago
|
import {
|
||
|
getDailyRecordDetail,
|
||
|
getDailyRecordList
|
||
|
} from '../../../../api/noteIndex'
|
||
|
import regeneratorRuntime from '../../../../utils/runtime.js'
|
||
|
const getTime = require('../../../../utils/util')
|
||
|
Page({
|
||
|
data: {
|
||
|
imageUrl: [],
|
||
|
currentUrl: '',
|
||
|
id: '',
|
||
|
images: [],
|
||
|
dataList: [],
|
||
|
loadVisible: false,
|
||
|
loadType: 'more',
|
||
|
isContentShow:false,
|
||
|
nowData:''
|
||
|
},
|
||
|
async onLoad(options) {
|
||
|
let data = new Date()
|
||
|
this.setData({
|
||
|
nowData: getTime.formatTimestamp(data), //2020-03-27 13:28
|
||
|
})
|
||
|
this.setData({
|
||
|
id: options.id
|
||
|
})
|
||
|
this.getDailyRecordDetail()
|
||
|
},
|
||
|
async getDailyRecordDetail() {
|
||
|
this.setData({
|
||
|
loadVisible:true,
|
||
|
})
|
||
|
try {
|
||
|
let res = await getDailyRecordDetail(this.data.id)
|
||
|
console.log('res详情', res)
|
||
|
this.setData({
|
||
|
dataList: res.data,
|
||
|
images: res.data.images,
|
||
|
loadVisible:false,
|
||
|
isContentShow:true,
|
||
|
})
|
||
|
} catch (err) {
|
||
|
|
||
|
}
|
||
|
|
||
|
},
|
||
|
// 放大预览
|
||
|
gopreviewImage(e) {
|
||
|
console.log('e图片', e.currentTarget.dataset.index)
|
||
|
let imageUrl = []
|
||
|
this.data.images.forEach((element, index) => {
|
||
|
if (e.currentTarget.dataset.index == index) {
|
||
|
this.setData({
|
||
|
currentUrl: element.imgUrl
|
||
|
})
|
||
|
}
|
||
|
imageUrl.push(element.imgUrl)
|
||
|
})
|
||
|
this.setData({
|
||
|
imageUrl,
|
||
|
})
|
||
|
wx.previewImage({
|
||
|
current: this.data.currentUrl,
|
||
|
urls: this.data.imageUrl // 需要预览的图片http链接列表
|
||
|
})
|
||
|
},
|
||
|
})
|