wangchenguang 2 years ago
commit 43d1b99aa1
  1. 96
      order/ordered/ordered.vue
  2. 17
      pages/person/person.vue

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

@ -159,9 +159,20 @@
},
//
onChooseAvatar(e) {
this.avatar = e.detail.avatarUrl
updateAvatars(e.detail.avatarUrl).then(res => {}).catch(e => {})
this.getInfo()
uni.uploadFile({
url: 'https://huorantech.cn/nakadai/nakadai/oss/fileUpload',
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() {

Loading…
Cancel
Save