|
@@ -137,6 +137,52 @@ export default {
|
|
|
],
|
|
|
current: "昨日",
|
|
|
},
|
|
|
+ storeTrafficData: {
|
|
|
+ loading: false,
|
|
|
+ data: [],
|
|
|
+ options: [
|
|
|
+ {
|
|
|
+ label: "昨日",
|
|
|
+ value: {
|
|
|
+ startTime:
|
|
|
+ moment()
|
|
|
+ .subtract(1, "days")
|
|
|
+ .format("YYYY-MM-DD") + " 00:00:00",
|
|
|
+ endTime:
|
|
|
+ moment()
|
|
|
+ .subtract(1, "days")
|
|
|
+ .format("YYYY-MM-DD") + " 23:59:59:999",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "近7日",
|
|
|
+ value: {
|
|
|
+ startTime:
|
|
|
+ moment()
|
|
|
+ .subtract(7, "days")
|
|
|
+ .format("YYYY-MM-DD") + " 00:00:00",
|
|
|
+ endTime:
|
|
|
+ moment()
|
|
|
+ .subtract(1, "days")
|
|
|
+ .format("YYYY-MM-DD") + " 23:59:59:999",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "近30日",
|
|
|
+ value: {
|
|
|
+ startTime:
|
|
|
+ moment()
|
|
|
+ .subtract(30, "days")
|
|
|
+ .format("YYYY-MM-DD") + " 00:00:00",
|
|
|
+ endTime:
|
|
|
+ moment()
|
|
|
+ .subtract(1, "days")
|
|
|
+ .format("YYYY-MM-DD") + " 23:59:59:999",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ current: "昨日",
|
|
|
+ },
|
|
|
updateTime: "",
|
|
|
},
|
|
|
|
|
@@ -288,16 +334,16 @@ export default {
|
|
|
// 门户关键词搜索
|
|
|
*load_search_rank({ payload }, { put, call, select }) {
|
|
|
const current = yield select(
|
|
|
- (state) => state.bigscreen.searchRankData.current
|
|
|
+ (state) => state.bigscreen.storeTrafficData.current
|
|
|
);
|
|
|
const options = yield select(
|
|
|
- (state) => state.bigscreen.searchRankData.options
|
|
|
+ (state) => state.bigscreen.storeTrafficData.options
|
|
|
);
|
|
|
const condition = options.filter((item) => item.label == current)[0]
|
|
|
.value;
|
|
|
payload = { ...payload, ...condition };
|
|
|
yield put({
|
|
|
- type: "setSearchRankData",
|
|
|
+ type: "set",
|
|
|
payload: { loading: true },
|
|
|
});
|
|
|
const response = yield call(
|
|
@@ -312,6 +358,33 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ // 店铺流量排行
|
|
|
+ *load_store_traffic({ payload }, { put, call, select }) {
|
|
|
+ const current = yield select(
|
|
|
+ (state) => state.bigscreen.searchRankData.current
|
|
|
+ );
|
|
|
+ const options = yield select(
|
|
|
+ (state) => state.bigscreen.searchRankData.options
|
|
|
+ );
|
|
|
+ const condition = options.filter((item) => item.label == current)[0]
|
|
|
+ .value;
|
|
|
+ payload = { ...payload, ...condition };
|
|
|
+ yield put({
|
|
|
+ type: "setStoreTrafficData",
|
|
|
+ payload: { loading: true },
|
|
|
+ });
|
|
|
+ const response = yield call(
|
|
|
+ sldCommonService,
|
|
|
+ payload,
|
|
|
+ "get",
|
|
|
+ "v3/statistics/screen/analysis/storeFlowRank"
|
|
|
+ );
|
|
|
+ yield put({
|
|
|
+ type: "setStoreTrafficData",
|
|
|
+ payload: { data: response.data, loading: false },
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
// 初始化数据
|
|
|
*load_data({ payload }, { put, call }) {
|
|
|
// 更新时间
|
|
@@ -365,10 +438,24 @@ export default {
|
|
|
yield put.resolve({
|
|
|
type: "load_search_rank",
|
|
|
});
|
|
|
+
|
|
|
+ // 店铺流量
|
|
|
+ yield put.resolve({
|
|
|
+ type: "load_store_traffic",
|
|
|
+ });
|
|
|
},
|
|
|
},
|
|
|
|
|
|
reducers: {
|
|
|
+ setStoreTrafficData(state, { payload }) {
|
|
|
+ return {
|
|
|
+ ...state,
|
|
|
+ storeTrafficData: {
|
|
|
+ ...state.storeTrafficData,
|
|
|
+ ...payload,
|
|
|
+ },
|
|
|
+ };
|
|
|
+ },
|
|
|
setUpdateTime(state, { payload }) {
|
|
|
return {
|
|
|
...state,
|