购物车历史订单增加,代码优化
This commit is contained in:
@@ -64,26 +64,12 @@
|
||||
const yesterday = $time.getYesterdayTimestamps();
|
||||
const thisWeek = $time.getThisWeekTimestamps();
|
||||
const thisMonth = $time.getThisMonthTimestamps();
|
||||
const thisLastMonth = $time.getThisLastMonthTimestamps()
|
||||
const timeData = reactive({
|
||||
list: [today, yesterday, thisWeek, thisMonth],
|
||||
sel: 0
|
||||
})
|
||||
|
||||
function changeTimeDataSel(i) {
|
||||
timeData.sel = i
|
||||
if (i == -1) {
|
||||
datePicker.value.open()
|
||||
}
|
||||
}
|
||||
|
||||
watch(() => timeData.sel, (newval) => {
|
||||
|
||||
const data = timeData.list[newval]
|
||||
if (newval != -1) {
|
||||
emits('update:time', [data.start, data.end])
|
||||
}
|
||||
})
|
||||
|
||||
const statusData = reactive({
|
||||
allList: uni.$dict.orderStatus,
|
||||
moreShow: false,
|
||||
@@ -116,6 +102,20 @@
|
||||
sel: ''
|
||||
})
|
||||
|
||||
function changeTimeDataSel(i) {
|
||||
timeData.sel = i
|
||||
if (i == -1) {
|
||||
datePicker.value.open()
|
||||
}
|
||||
}
|
||||
|
||||
watch(() => timeData.sel, (newval) => {
|
||||
const data = timeData.list[newval]
|
||||
if (newval != -1) {
|
||||
emits('update:time', [data.start, data.end])
|
||||
}
|
||||
})
|
||||
|
||||
function moreShowHide() {
|
||||
statusData.moreShow = false
|
||||
}
|
||||
@@ -126,21 +126,20 @@
|
||||
|
||||
function changeStatusSel(i) {
|
||||
statusData.sel = i
|
||||
statusData.allListSel = -1
|
||||
emits('updateStatus', i)
|
||||
}
|
||||
|
||||
function datePickerConfirm(e) {
|
||||
console.log(e);
|
||||
emits('update:time', [e.start, e.end])
|
||||
}
|
||||
|
||||
function changeAllListSel(i,item) {
|
||||
statusData.allListSel = i
|
||||
console.log(i);
|
||||
}
|
||||
function statusConfirm(){
|
||||
const status=statusData.allList[statusData.allListSel].type
|
||||
statusData.sel=status
|
||||
const status = statusData.allList[statusData.allListSel].type
|
||||
statusData.sel = status
|
||||
emits('updateStatus',status)
|
||||
moreShowHide()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user