上传头像等

master
yujialong 2 years ago
parent 9bcc0a80ef
commit 085c8683f9
  1. 96
      order/ordered/ordered.vue
  2. 17
      pages/person/person.vue

@ -100,6 +100,10 @@
{ {
name: '数据产品', name: '数据产品',
id: 3 id: 3
},
{
name: '职站增值模块',
id: 4
} }
], ],
searchTimer: null, searchTimer: null,
@ -143,56 +147,60 @@
const { tabs } = this const { tabs } = this
data.map(e => { data.map(e => {
const list = e.startAndEndTimeList const list = e.startAndEndTimeList
let connect = true // if (list && list.length) {
list.map((n, i) => { let connect = true //
// list.map((n, i) => {
if (i) { //
if (new Date(n.startTime).getTime() - 86400000 !== new Date(list[i - 1].endTime).getTime()) connect = false if (i) {
} if (new Date(n.startTime).getTime() - 86400000 !== new Date(list[i - 1].endTime).getTime()) connect = false
}) }
// })
const now = Date.now() // //
if (now < list[0].startTime) { const now = Date.now()
e.startTime = list[0].startTime if (now < list[0].startTime) {
e.endTime = connect ? list[list.length - 1].endTime : list[0].endTime
e.status = '未生效'
} else if (now > list[list.length - 1].endTime) {
e.status = '已过期'
} else {
//
if (connect) {
e.startTime = list[0].startTime e.startTime = list[0].startTime
e.endTime = list[list.length - 1].endTime e.endTime = connect ? list[list.length - 1].endTime : list[0].endTime
e.status = '生效中' e.status = '未生效'
e.orderEnable = list[0].isEnable } else if (now > list[list.length - 1].endTime) {
e.status = '已过期'
} else { } else {
for (const i in list) { //
const n = list[i] if (connect) {
if (now >= new Date(n.startTime).getTime() && now <= new Date(n.endTime).getTime()) { e.startTime = list[0].startTime
// e.endTime = list[list.length - 1].endTime
e.startTime = n.startTime e.status = '生效中'
e.endTime = n.endTime e.orderEnable = list[0].isEnable
e.status = '生效中' } else {
e.orderEnable = n.isEnable for (const i in list) {
break const n = list[i]
} else if (i && now > new Date(list[i - 1].endTime).getTime() && now < new Date(n.startTime).getTime()) { if (now >= new Date(n.startTime).getTime() && now <= new Date(n.endTime).getTime()) {
// //
e.startTime = n.startTime e.startTime = n.startTime
e.endTime = n.endTime e.endTime = n.endTime
e.status = '未生效' e.status = '生效中'
e.orderEnable = n.isEnable e.orderEnable = n.isEnable
break break
} else if (i && list[i - 1] && now > new Date(list[i - 1].endTime).getTime() && now < new Date(n.startTime).getTime()) {
//
e.startTime = n.startTime
e.endTime = n.endTime
e.status = '未生效'
e.orderEnable = n.isEnable
break
} else {
e.status = '已过期'
}
} }
} }
} }
const date = new Date()
date.setHours(0)
date.setMinutes(0)
date.setSeconds(0)
if (e.startTime) e.startAndEndTime = e.startTime + ' ~ ' + e.endTime
// 1 0
e.isEnable = (e.status === '已过期' || !e.orderEnable) ? '禁用' : '启用'
} }
const date = new Date()
date.setHours(0)
date.setMinutes(0)
date.setSeconds(0)
e.startAndEndTime = e.startTime + ' ~ ' + e.endTime
// 1 0
e.isEnable = (e.status === '已过期' || !e.orderEnable) ? '禁用' : '启用'
}) })
this.list = data this.list = data
this.listAll = data this.listAll = data

@ -159,9 +159,20 @@
}, },
// //
onChooseAvatar(e) { onChooseAvatar(e) {
this.avatar = e.detail.avatarUrl uni.uploadFile({
updateAvatars(e.detail.avatarUrl).then(res => {}).catch(e => {}) url: 'https://huorantech.cn/nakadai/nakadai/oss/fileUpload',
this.getInfo() filePath: e.detail.avatarUrl,
name: 'file',
header: {
token: uni.getStorageSync('token'),
},
formData: {},
success: ({ data }) => {
updateAvatars(JSON.parse(data).filesResult.fileUrl).then(res => {
this.getInfo()
}).catch(e => {})
}
})
}, },
// //
toSet() { toSet() {

Loading…
Cancel
Save