import { activity, User } from "@/config/api.js"; let app = getApp(); export default { data() { return { listActivityStaus: [], //状态 listActivityType: [], //类型 listChartPermission: [], //分类 listChartPermissionInit: [], activityTypeIds: "", //活动类型id 多个用 , 隔开 chartPermissionIds: "", //行业id 多个用 , 隔开 chartPermissionName: "所有行业", activityTypeName: "所有类型", selectShow: false, isShowJurisdiction: false, isGain: true, isId: 0, activityIdAdd: "", // 历史搜索列表 historySearchList: [], flag: false, activityTimeList: [ { Id: 1, IsChoose: false, StatusName: "今日活动" }, { Id: 2, IsChoose: false, StatusName: "明日活动" }, ], activityTimeStatus: "", keyWord: "", isNeedAddCountryCode: false, //判断是否需要区号 isAreaCode: false, areaCode: { id: "", type: "", }, }; }, methods: { // 滑动状态下拉选择的收起 closeTheWindow(type) { if (type == "statusstate") { const state = this.activeState ? this.activeState.split(",").map(Number) : []; this.listActivityStaus.forEach((item) => { if (state.indexOf(item.Id) !== -1) { item.IsChoose = true; } else { item.IsChoose = false; } }); } else if (type == "genre") { const types = this.activityTypeIds ? this.activityTypeIds.split(",").map(Number) : []; this.listActivityType.forEach((item) => { if (types.includes(item.ActivityTypeId)) { item.IsChoose = true; } else { item.IsChoose = false; } }); } else { const chart = this.chartPermissionIds ? this.chartPermissionIds.split(",").map(Number) : []; this.listChartPermission.forEach((item) => { if (chart.includes(item.ChartPermissionId)) { item.IsChoose = true; } else { item.IsChoose = false; } }); } }, //是否展示有权限的行业 isJurisdiction() { if (this.isShowJurisdiction) { this.isId = 2; } else { this.isId = 1; } this.getUserSearchContent("traverse"); }, /* 新布局产业选项确定按钮 */ replacementConfirm(type) { this.page_no = 1; if (type == "statusstate") { const arr = []; const str = []; this.listActivityStaus.forEach((key) => { if (key.IsChoose) { arr.push(key.Id); str.push(key.StatusName); } }); this.activeState = arr.join(","); const arrTwo = []; const strTwo = []; this.activityTimeList.forEach((key) => { if (key.IsChoose) { arrTwo.push(key.Id); strTwo.push(key.StatusName); } }); this.activityTimeStatus = arrTwo.join(","); if (strTwo.length > 0) { this.activeStateName = strTwo.join(","); } else { if (str.length == this.listActivityStaus.length || str.length <= 0) { this.activeStateName = "所有状态"; } else { this.activeStateName = str.join(","); } } } else if (type == "industry") { const arr = []; const str = []; this.listChartPermission.forEach((key) => { if (key.IsChoose) { arr.push(key.ChartPermissionId); str.push(key.PermissionName); } }); if ((str.length == 6 && this.listChartPermission.length == 6) || str.length <= 0) { this.chartPermissionName = "所有行业"; } else { this.chartPermissionName = str.join(","); } this.chartPermissionIds = arr.join(","); } else { const arr = []; const str = []; this.listActivityType.forEach((key) => { if (key.IsChoose) { arr.push(key.ActivityTypeId); str.push(key.ActivityTypeName); } }); if (str.length == this.listActivityType.length || str.length <= 0) { this.activityTypeName = "所有类型"; } else { this.activityTypeName = str.join(","); } this.activityTypeIds = arr.join(","); } this.page_no = 1; this.collectList = []; this.dynamicList = []; this.spanIndex = []; this.keyWord = ""; this.fastSearchKeWord(); this.getList(); this.selectComponent(`#${type}`).toggle(); }, /* 新布局产业选项重置按钮 */ replacementBtn(type) { if (type == "statusstate") { this.listActivityStaus.forEach((item) => (item.IsChoose = false)); this.activityTimeList.forEach((key) => { key.IsChoose = false; }); this.listActivityStaus[0].IsChoose = true; this.activeState = "1"; this.activityTimeStatus = ""; this.activeStateName = "未开始"; } else if (type == "industry") { this.listChartPermission = this.listChartPermissionInit; this.chartPermissionIds = ""; this.isShowJurisdiction = false; this.isId = 2; this.listChartPermission.map((item) => (item.IsChoose = false)); this.chartPermissionName = "所有行业"; } else { this.listActivityType.forEach((item) => (item.IsChoose = false)); this.activityTypeIds = ""; this.activityTypeName = "所有类型"; } }, //状态的下拉选择 overallBtn(type, item) { this.listActivityStaus.forEach((key) => { if (key.Id == item.Id) { key.IsChoose = !key.IsChoose; } }); }, // 行业的下拉选择 overallClick(type, item) { if (this.isShowJurisdiction) return; this.listChartPermission.forEach((key) => { if (key.ChartPermissionId == item.ChartPermissionId) { key.IsChoose = !key.IsChoose; } }); }, //类型的下拉选择 overallActivity(type, item) { this.listActivityType.forEach((key) => { if (key.ActivityTypeId == item.ActivityTypeId) { key.IsChoose = !key.IsChoose; } }); }, // 跳转判断权限 // public(type, flag, purl, price = "") { // this.$store.dispatch("checkHandle", type).then((res) => { // app.globalData.isAuth = res.IsAuth; // app.globalData.isBind = res.IsBind; // if (!res.IsAuth && !res.IsBind) { // //已授权已绑定 // if (flag) { // uni.navigateTo({ // url: purl + price, // }); // } // } else if (res.IsAuth) { // //未授权 // uni.navigateTo({ // url: "/pageMy/authGuide/authGuide", // }); // } else if (res.IsBind && !res.IsAuth) { // //已授权未绑定 // uni.navigateTo({ // url: "/pageMy/login/login", // }); // } // }); // }, //今日,明日 活动的选择 timeListBtn(type, item) { this.activityTimeList.forEach((key) => { if (key.Id == item.Id) { key.IsChoose = !key.IsChoose; } }); }, // strictSelection (){ // activity.descriptionOfResearch().then(res=>{ // if(res.Ret==200){ // this.$util.modalShow('',res.Data.Item.ConfigValue,'知道了',()=>{ // }) // } // }) // } }, };