-
{{item.title}}
+
{{ item.title }}
-
@@ -31,7 +31,7 @@ export default {
selectedWay: {
// 可选时间项
- title: "最近7天",
+ title: "过去7天",
selected: true,
searchType: "LAST_SEVEN",
},
@@ -56,12 +56,35 @@ export default {
searchType: "YESTERDAY",
},
{
- title: "最近7天",
+ title: "过去7天",
selected: true,
searchType: "LAST_SEVEN",
},
{
- title: "最近30天",
+ title: "过去30天",
+ selected: false,
+ searchType: "LAST_THIRTY",
+ },
+ ],
+ originDateList: [
+ // 筛选条件
+ {
+ title: "今天",
+ selected: false,
+ searchType: "TODAY",
+ },
+ {
+ title: "昨天",
+ selected: false,
+ searchType: "YESTERDAY",
+ },
+ {
+ title: "过去7天",
+ selected: true,
+ searchType: "LAST_SEVEN",
+ },
+ {
+ title: "过去30天",
selected: false,
searchType: "LAST_THIRTY",
},
@@ -126,8 +149,8 @@ export default {
this.dates = dates.reverse();
},
// 改变已选店铺
- changeSelect() {
- console.log(this.month);
+ changeSelect(e) {
+ this.month = e
if (this.month) {
this.dateList.forEach((res) => {
res.selected = false;
@@ -138,34 +161,36 @@ export default {
this.$emit("selected", this.selectedWay);
} else {
- const current = this.dateList.find(item=>{return item.selected})
+
+ const current = this.dateList.find(item => { return item.selected })
this.selectedWay = current
+ this.clickBreadcrumb(current)
this.$emit("selected", this.selectedWay);
+
+
}
},
// 变更时间
clickBreadcrumb(item) {
- this.dateList.forEach((res) => {
+
+ let currentIndex;
+ this.dateList.forEach((res,index) => {
res.selected = false;
+ if(res.title === item.title){
+ currentIndex = index
+ }
});
item.selected = true;
item.storeId = this.storeId;
this.month = "";
- const dateList = this.dateList
- let currentDate
if (item.searchType == "") {
- if (
- dateList.some((date) => {
- currentDate = date
- return date.title == item.title;
- })
- ) {
- item.searchType = currentDate.searchType;
+ let currentDate = this.originDateList[currentIndex].searchType
+ if (currentDate) {
+ item.searchType = currentDate
} else {
item.searchType = "LAST_SEVEN";
}
}
-
this.selectedWay = item;
this.selectedWay.year = new Date().getFullYear();
this.selectedWay.month = "";
@@ -179,15 +204,20 @@ export default {
.breadcrumb {
display: flex;
align-items: center;
- > span {
+
+ >span {
margin-right: 15px;
cursor: pointer;
}
}
+
.active {
color: $theme_color;
position: relative;
}
+
+.date-picker {}
+
.active:before {
content: "";
position: absolute;
diff --git a/seller/src/views/lili-components/affix-time.vue b/seller/src/views/lili-components/affix-time.vue
index 98a75806..bc9162a7 100644
--- a/seller/src/views/lili-components/affix-time.vue
+++ b/seller/src/views/lili-components/affix-time.vue
@@ -1,45 +1,50 @@
-
{{item.title}}
+
{{ item.title }}
-
+
+
+
+
+
-