activity.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834
  1. <template>
  2. <view class="container activity-content">
  3. <!-- 活动、日程 -->
  4. <view class="top-content" id="idtop">
  5. <view class="tab">
  6. <view class="tab-item" v-for="(item, index) in tabs" :key="item.id">
  7. <view class="scroll-tab-item" :class="{ active: tabsActive == index }"
  8. @click="toggleTab(item, index)">
  9. {{ item.name }}
  10. <image src="@/static/img/border_act.png" class="border_act" v-if="tabsActive == index" mode="">
  11. </image>
  12. </view>
  13. </view>
  14. </view>
  15. </view>
  16. <!-- 活动主题预告 -->
  17. <view class="dynamic-content" v-if="tabsActive == 0">
  18. <view class="target-title">
  19. <view class="foreshow box">
  20. <image src="../../static/img/foreshow_icon.png"></image>
  21. <text style="margin-left: 10rpx;">活动预告</text>
  22. </view>
  23. <view class="even-more box" @click="goSearch">
  24. <image src="../../static/img/search_iocn.png"></image>
  25. <text style="margin-left: 10rpx;">更多主题...</text>
  26. </view>
  27. </view>
  28. <view class="target-item">
  29. <view class="target-ul target-left">
  30. <view class="target-text" v-for="(item,index) in dynamicList" :key="index" v-if="index%2===0">
  31. <text :class="spanIndex.includes(index)?'active':''" @click="changeTarget(index)">
  32. {{item.KeyWord}}
  33. </text>
  34. </view>
  35. </view>
  36. <view class="target-ul target-right">
  37. <view class="target-text" v-for="(item,index) in dynamicList" :key="index" v-if="index%2 !== 0">
  38. <text :class="spanIndex.includes(index)?'active':''" @click="changeTarget(index)">
  39. {{item.KeyWord}}
  40. </text>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. <!-- 状态的下拉选择 -->
  46. <view class="select-sticky" v-if="tabsActive == 0">
  47. <view class="select-conyent">
  48. <van-dropdown-menu active-color="#333333">
  49. <van-dropdown-item id="statusstate" @open="isscroll" :title="activeStateName" @close="closeTheWindow('statusstate')">
  50. <view class="menu-items">
  51. <view class="menu-items-box" @click="overallBtn('statusstate', key)"
  52. v-for="key in listActivityStaus" :key="key.Id">
  53. <view class="items-box">
  54. <u-icon v-if="key.IsChoose" name="checkbox-mark" color="#2C83FF" size="24"></u-icon>
  55. </view>
  56. <text>{{ key.StatusName }}</text>
  57. </view>
  58. </view>
  59. <view style="background-color: #f8f8fa;width: 100%;">
  60. <view style="margin: 0 auto;width: 682rpx;border-bottom: 2rpx solid #E5E5E5;">
  61. </view>
  62. </view>
  63. <view class="menu-items">
  64. <view class="menu-items-box" @click="timeListBtn('statusstate', key)"
  65. v-for="key in activityTimeList" :key="key.Id">
  66. <view class="items-box">
  67. <u-icon v-if="key.IsChoose" name="checkbox-mark" color="#2C83FF" size="24"></u-icon>
  68. </view>
  69. <text>{{ key.StatusName }}</text>
  70. </view>
  71. </view>
  72. <view class="replacement-box">
  73. <view class="replacement">
  74. <text @click="replacementBtn('statusstate')" class="replacement-box">重置</text>
  75. <text @click="replacementConfirm('statusstate')">确定</text>
  76. </view>
  77. </view>
  78. </van-dropdown-item>
  79. <van-dropdown-item id="industry" @open="isscroll" :title="chartPermissionName" @close="closeTheWindow('industry')">
  80. <view class="decide">
  81. <view class="items-box">
  82. <u-icon v-if="isShowJurisdiction" name="checkbox-mark" color="#2C83FF" size="24">
  83. </u-icon>
  84. </view>
  85. <text @click="isJurisdiction">始终只展示有权限的行业</text>
  86. </view>
  87. <view style="background-color: #f8f8fa;width: 100%;">
  88. <view style="margin: 0 auto;width: 682rpx;border-bottom: 2rpx solid #E5E5E5;">
  89. </view>
  90. </view>
  91. <view class="menu-items">
  92. <view class="menu-items-box" v-for="item in listChartPermission"
  93. :key="item.ChartPermissionId" @click="overallClick('industry', item)">
  94. <view class="items-box">
  95. <u-icon v-if="item.IsChoose" name="checkbox-mark"
  96. :color="isShowJurisdiction ? '#ccc' : '#2C83FF'" size="24"></u-icon>
  97. </view>
  98. <text>{{ item.PermissionName }}</text>
  99. </view>
  100. </view>
  101. <view class="replacement">
  102. <text @click="replacementBtn('industry')" class="replacement-box">重置</text>
  103. <text @click="replacementConfirm('industry')">确定</text>
  104. </view>
  105. </van-dropdown-item>
  106. <van-dropdown-item id="genre" @open="isscroll" :title="activityTypeName" @close="closeTheWindow('genre')">
  107. <view class="menu-items">
  108. <view class="menu-items-box" @click="overallActivity('genre', item)"
  109. v-for="(item, index) in listActivityType" :key="item.ActivityTypeId">
  110. <view class="items-box">
  111. <u-icon v-if="item.IsChoose" name="checkbox-mark" color="#2C83FF" size="24">
  112. </u-icon>
  113. </view>
  114. <text>{{ item.ActivityTypeName }}</text>
  115. </view>
  116. </view>
  117. <view class="replacement">
  118. <text @click="replacementBtn('genre')" class="replacement-box">重置</text>
  119. <text @click="replacementConfirm('genre')">确定</text>
  120. </view>
  121. </van-dropdown-item>
  122. </van-dropdown-menu>
  123. </view>
  124. </view>
  125. <!-- 活动的列表 -->
  126. <view class="box-content" id="contentList" :class="{ head: tabsActive == 1 }" v-if="haveData">
  127. <view class="content-list" v-for="(item, index) in collectList" :key="index">
  128. <view class="list-top" @click="goDetail(item)">
  129. <view class="list-top-box">
  130. <text class="title">{{ item.ActivityTypeName }}</text>
  131. <view class="city" v-if="item.City">
  132. <image src="../../static/img/location.png" mode=""></image>
  133. <text>{{ item.City }}</text>
  134. </view>
  135. </view>
  136. <text style="color: #2acdd9; font-size: 26rpx" v-if="item.ActiveState == 1">未开始</text>
  137. <text style="color: #ff4040; font-size: 26rpx" v-if="item.ActiveState == 2">进行中</text>
  138. <text style="color: #999999; font-size: 26rpx" v-if="item.ActiveState == 3">已结束</text>
  139. </view>
  140. <view class="" style="display: flex">
  141. <view class="list-center" @click="goDetail(item)">
  142. <text class="title" v-if="item.IsBrackets == 1">{{
  143. item.ActivityName
  144. }}</text>
  145. <text class="title-two" v-else>{{ item.ActivityName }}</text>
  146. <view class="setting-center">
  147. <view class="">
  148. <view class="box-expert" style="padding-bottom: 30rpx" v-if="
  149. item.ActivityTypeName == '专家电话会' ||
  150. item.ActivityTypeName == '专家线下沙龙'
  151. ">
  152. <view style="width: 140rpx"> 专家背景: </view>
  153. <view style="width: 400rpx">
  154. <rich-text :nodes="item.Expert"></rich-text>
  155. </view>
  156. </view>
  157. <text style="padding-bottom: 30rpx" v-if="
  158. item.ActivityTypeName == '公司调研电话会' ||
  159. item.ActivityTypeName == '公司线下调研'
  160. ">嘉宾:{{ item.DistinguishedGuest }}</text>
  161. <text style="padding-bottom: 30rpx" v-if="
  162. item.ActivityTypeName == '分析师电话会' ||
  163. item.ActivityTypeName == '分析师线下沙龙'
  164. ">主讲人:{{ item.Speaker }}</text>
  165. </view>
  166. </view>
  167. <text style="padding-bottom: 30rpx">活动时间:{{ item.ActivityTimeText }}</text>
  168. </view>
  169. <view class="" style="display: flex; align-items: center; padding-right: 30rpx">
  170. <u-icon style="padding-bottom: 30rpx" name="arrow-right" color="#BDBDBD" size="34"></u-icon>
  171. </view>
  172. </view>
  173. <view class="list-bottom" v-if="
  174. item.ActiveState == 1 &&
  175. item.IsLimitPeople == 1 &&
  176. item.ActivityTypeName == '公司调研电话会'
  177. ">
  178. <view class="multi-text">
  179. <text v-if="item.IsSignup !== 1"
  180. @click="wanttosignup(item.ActivityId)">我要报名({{ item.SignupNum }}/{{ item.LimitPeopleNum }})</text>
  181. <text v-else
  182. @click="signupCancel(item.ActivityId, 2, item.ActivityTime)">{{ item.SignupType == 1 ? "取消外呼" : "取消报名" }}({{
  183. item.SignupNum
  184. }}/{{ item.LimitPeopleNum }})</text>
  185. </view>
  186. </view>
  187. <view class="list-bottom" v-else-if="item.ActiveState == 1">
  188. <view class="multi" v-if="item.ActivityTypeId == 1 || item.ActivityTypeId == 2 || (item.ActivityTypeId == 3 && item.IsLimitPeople == 0)">
  189. <text class="multi-outbound" v-if="item.IsSignup !== 1"
  190. @click="signupAdd(item.ActivityId, 1)">预约外呼</text>
  191. <text class="multi-outbound" v-else
  192. @click="signupCancel(item.ActivityId, 1, item.ActivityTime)">取消外呼</text>
  193. <text class="multi-remind" v-if="item.IsCancelMeetingReminder == 0"
  194. style="border-left: 1px solid #e5e5e5"
  195. @click="meetingReminderAdd(item.ActivityId)">会议提醒</text>
  196. <text class="multi-remind" v-else style="border-left: 1px solid #e5e5e5"
  197. @click="meetingReminderCancel(item.ActivityId)">取消会议提醒</text>
  198. </view>
  199. <view class="multi-text" v-else>
  200. <text v-if="item.IsSignup !== 1"
  201. @click="signupAdd(item.ActivityId, 3)">我要报名({{ item.SignupNum }}/{{ item.LimitPeopleNum }})</text>
  202. <text v-else
  203. @click="signupCancel(item.ActivityId, 3, item.ActivityTime)">取消报名({{ item.SignupNum }}/{{ item.LimitPeopleNum }})</text>
  204. </view>
  205. </view>
  206. </view>
  207. <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20"
  208. v-if="totalPage > 1" />
  209. </view>
  210. <!-- 缺审显示 -->
  211. <view class="nodata" :class="tabsActive == 0?'':'nodataTwo'" v-else>
  212. <image src="@/static/img/act_search.png" mode="" class="nodata_ico"></image>
  213. <text>{{tabsActive==1?'暂无日程':"暂无活动"}}</text>
  214. </view>
  215. <!-- 所有自定义弹框 -->
  216. <modalDialog :isShow="isShow" :signupType="signupType" :goFollow="goFollow" :signupStatus="signupStatus"
  217. :hasPermission="hasPermission" :jurisdictionList="jurisdictionList" :editIsShow="editIsShow"
  218. :isCancelShow="isCancelShow" :idTypeCancel="idTypeCancel" @cancelShowBtn="cancelEnsure"
  219. :countryCode="countryCode" :mobileEdit="mobileEdit" :goOnNextStep="goOnNextStep"
  220. :isShowhasPermission="isShowhasPermission" :applyForIsShow="applyForIsShow"
  221. :mailboxBinding="mailboxBinding"/>
  222. <!-- 区号的选择 -->
  223. <areaCode :isAreaCode="isAreaCode" :areaCode="areaCode" />
  224. <!-- 限制报名的参会方式 -->
  225. <view class="select-box">
  226. <u-popup v-model="selectShow" mode="bottom">
  227. <view style="color: #333333; font-size: 28rpxrpx">请选择参会方式</view>
  228. <view style="color: #2c83ff" @click="signupAdd('id', 1)">预约外呼</view>
  229. <view style="color: #2c83ff" @click="signupAdd('id', 2)">自主拨入</view>
  230. <view style="color: #a9afb8" @click="selectShow = false">取消</view>
  231. </u-popup>
  232. </view>
  233. </view>
  234. </template>
  235. <script>
  236. import { activity, User } from "@/config/api.js";
  237. import { Throttle } from "@/config/util.js";
  238. import modalDialog from "@/components/modalDialog.vue";
  239. import areaCode from "@/components/areaCode.vue";
  240. import myMixin from "@/activityPages/index.js";
  241. let app = getApp();
  242. export default {
  243. data() {
  244. return {
  245. tabs: [{
  246. name: "全部活动",
  247. id: 1,
  248. }, {
  249. name: "我的日程",
  250. id: 2,
  251. }],
  252. tabsActive: 0,
  253. totalPage: "",
  254. haveData: true,
  255. spanIndex: [],
  256. activeStateName: "未开始",
  257. activeState: "1", //活动进行状态
  258. dynamicList: [],
  259. isScrollShow:false
  260. };
  261. },
  262. mixins: [myMixin],
  263. components: {
  264. modalDialog,
  265. areaCode,
  266. },
  267. methods: {
  268. //页面滑动了
  269. isscroll(){
  270. this.isScrollShow=true
  271. },
  272. // 通过分享进来的下拉选择的状态
  273. shareOption() {
  274. const arr = this.activeState.split(',').map(item => item - 0)
  275. this.listActivityStaus.forEach(item => {
  276. if (arr.indexOf(item.Id) !== -1) {
  277. item.IsChoose = true
  278. } else {
  279. item.IsChoose = false
  280. }
  281. })
  282. const arrTwo = this.activityTimeStatus.split(',').map(item => item - 0)
  283. this.activityTimeList.forEach(item => {
  284. if (arrTwo.indexOf(item.Id) !== -1) {
  285. item.IsChoose = true
  286. } else {
  287. item.IsChoose = false
  288. }
  289. })
  290. const hyarr = this.chartPermissionIds.split(',').map(item => item - 0)
  291. this.listChartPermission.forEach(key => {
  292. if (hyarr.indexOf(key.ChartPermissionId) !== -1) {
  293. key.IsChoose = true
  294. } else {
  295. key.IsChoose = false
  296. }
  297. })
  298. const lxarr = this.activityTypeIds.split(',').map(item => item - 0)
  299. this.listActivityType.forEach(key => {
  300. if (lxarr.indexOf(key.ActivityTypeId) !== -1) {
  301. key.IsChoose = true
  302. } else {
  303. key.IsChoose = false
  304. }
  305. })
  306. this.preserve()
  307. },
  308. //获取列表
  309. getList() {
  310. activity
  311. .getActivityList({
  312. PageSize: this.pageSize,
  313. CurrentIndex: this.page_no,
  314. ActiveState: this.activeState, //活动进行状态
  315. ActivityTypeIds: this.activityTypeIds, //活动类型id 多个用 , 隔开
  316. ChartPermissionIds: this.chartPermissionIds, //行业id 多个用 , 隔开
  317. IsShowJurisdiction: this.isId,
  318. Label: this.keyWord,
  319. WhichDay: this.activityTimeStatus
  320. })
  321. .then((res) => {
  322. if (res.Ret !== 200) return;
  323. this.status =
  324. this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
  325. this.totalPage = res.Data.Paging.Pages; //总页数
  326. if (this.page_no === 1) {
  327. this.collectList = res.Data.List || [];
  328. this.haveData = this.collectList.length ? true : false;
  329. if (this.refresh) {
  330. uni.stopPullDownRefresh();
  331. this.refresh = false;
  332. }
  333. } else {
  334. this.collectList.push(...res.Data.List);
  335. }
  336. });
  337. },
  338. //我的日程
  339. getScheduleList() {
  340. activity
  341. .getScheduleList({
  342. PageSize: this.pageSize,
  343. CurrentIndex: this.page_no,
  344. })
  345. .then((res) => {
  346. if (res.Ret !== 200) return;
  347. this.status =
  348. this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
  349. this.totalPage = res.Data.Paging.Pages || ''; //总页数
  350. if (this.page_no === 1) {
  351. this.collectList = res.Data.List || [];
  352. this.haveData = this.collectList.length ? true : false;
  353. if (this.refresh) {
  354. uni.stopPullDownRefresh();
  355. this.refresh = false;
  356. }
  357. } else {
  358. this.collectList.push(...res.Data.List);
  359. }
  360. });
  361. },
  362. //获取活动详情接口
  363. getUserSearchContent(name) {
  364. activity
  365. .getUserSearchContent({
  366. IsShowJurisdiction: this.isId,
  367. })
  368. .then((res) => {
  369. this.isShowJurisdiction = res.Data.IsShowJurisdiction;
  370. this.listActivityStaus = res.Data.ListActivityStaus;
  371. this.listActivityType = res.Data.ListActivityType;
  372. this.listChartPermission = res.Data.ListChartPermission || [];
  373. this.listChartPermissionInit = res.Data.ListChartPermission2
  374. if (name == "traverse") {
  375. const hyArr = [];
  376. this.listChartPermission.forEach((key) => {
  377. if (key.IsChoose) {
  378. hyArr.push(key.ChartPermissionId);
  379. }
  380. });
  381. this.chartPermissionIds = hyArr.join(",");
  382. }
  383. if (this.isGain) {
  384. // this.preserve()
  385. } else {
  386. this.shareOption()
  387. }
  388. });
  389. },
  390. //头部tabs切换
  391. toggleTab(item, index) {
  392. if (this.tabsActive !== index) {
  393. this.tabsActive = index;
  394. }
  395. this.$store.dispatch('checkHandle').then(res => {
  396. app.globalData.isAuth = res.IsAuth;
  397. app.globalData.isBind = res.IsBind;
  398. if ((!res.IsAuth) && (!res.IsBind)) { //已授权已绑定
  399. this.page_no = 1;
  400. this.collectList = [];
  401. this.status = "loadmore";
  402. if (this.tabsActive == 0) {
  403. this.getList();
  404. } else {
  405. this.getScheduleList();
  406. }
  407. } else if (res.IsAuth) { //未授权
  408. this.tabsActive = 0
  409. uni.navigateTo({
  410. url: '/pages/authGuide/authGuide'
  411. })
  412. } else if (res.IsBind && !res.IsAuth) { //已授权未绑定
  413. this.tabsActive = 0
  414. uni.navigateTo({
  415. url: '/pages/login/login'
  416. })
  417. }
  418. })
  419. },
  420. //取消弹框的确认事件
  421. cancelEnsure(obj, type, unm) {
  422. this.init()
  423. if (obj.name == "conference") return;
  424. if (this.tabsActive == 0) {
  425. if (obj.cutId == 0) return;
  426. if (type == 1) {
  427. this.collectList.forEach((item) => {
  428. if (obj.cutId == item.ActivityId) {
  429. item.IsSignup = obj.state;
  430. if (unm) {
  431. item.SignupNum = item.SignupNum - 1;
  432. } else {
  433. item.SignupNum = item.SignupNum + 1;
  434. }
  435. }
  436. });
  437. } else {
  438. this.collectList.forEach((item) => {
  439. if (obj.cutId == item.ActivityId) {
  440. item.IsSignup = obj.state;
  441. if (unm) {
  442. item.SignupNum = item.SignupNum - 1;
  443. } else {
  444. item.SignupNum = item.SignupNum + 1;
  445. }
  446. }
  447. });
  448. }
  449. } else {
  450. this.getScheduleList();
  451. }
  452. },
  453. //去往搜索事件
  454. goSearch() {
  455. this.public({type:'show'}, true, "/activityPages/activitySearch/activitySearch")
  456. },
  457. //添加会议提醒接口
  458. meetingReminderAdd(id) {
  459. this.$store.dispatch("checkHandle").then((res) => {
  460. app.globalData.isAuth = res.IsAuth;
  461. app.globalData.isBind = res.IsBind;
  462. })
  463. if (app.globalData.isBind && !app.globalData.isAuth) {
  464. uni.navigateTo({
  465. url: "/pages/login/login",
  466. });
  467. return;
  468. } else if (app.globalData.isAuth) {
  469. uni.navigateTo({
  470. url: '/pages/authGuide/authGuide'
  471. })
  472. return
  473. }
  474. activity
  475. .meetingReminderAdd({
  476. ActivityId: id,
  477. })
  478. .then((res) => {
  479. if (res.Ret == 200) {
  480. this.hasPermission = res.Data.HasPermission;
  481. if (this.hasPermission == 1) {
  482. if (
  483. (res.Data.GoFollow && res.Data.SignupStatus !== "Success") ||
  484. !res.Data.GoFollow
  485. ) {
  486. this.isShow = true;
  487. } else {
  488. this.goFollow = res.Data.GoFollow;
  489. }
  490. this.signupType = 999;
  491. this.signupStatus = res.Data.SignupStatus;
  492. this.idTypeCancel = {
  493. cutId: res.Data.ActivityId,
  494. state: 1,
  495. name: "conference",
  496. };
  497. this.collectList.forEach((item) => {
  498. if (id == item.ActivityId) {
  499. item.IsCancelMeetingReminder = 1;
  500. }
  501. });
  502. } else if (this.hasPermission == 2) {
  503. this.jurisdictionList.SellerMobile = res.Data.SellerMobile;
  504. this.jurisdictionList.PopupMsg = res.Data.PopupMsg;
  505. this.isShowhasPermission = true;
  506. } else if (this.hasPermission == 3 || this.hasPermission == 4) {
  507. this.jurisdictionList.PopupMsg = res.Data.PopupMsg;
  508. this.applyForIsShow = true;
  509. }
  510. }
  511. });
  512. },
  513. //取消会议提醒接口
  514. meetingReminderCancel(id) {
  515. activity
  516. .meetingReminderCancel({
  517. ActivityId: id,
  518. })
  519. .then((res) => {
  520. if (res.Ret == 200) {
  521. uni.showModal({
  522. confirmText: "知道了",
  523. confirmColor: "#3385FF",
  524. content: res.Msg,
  525. showCancel: false,
  526. success: (res) => {
  527. if (res.confirm) {
  528. this.collectList.forEach((item) => {
  529. if (id == item.ActivityId) {
  530. item.IsCancelMeetingReminder = 0;
  531. }
  532. });
  533. }
  534. if (this.tabsActive !== 0) {
  535. this.status = "loading";
  536. this.page_no = 1;
  537. this.getScheduleList();
  538. }
  539. },
  540. });
  541. }
  542. });
  543. },
  544. //遍历
  545. preserve() {
  546. const arr = []
  547. const str = []
  548. this.listActivityStaus.forEach(item => {
  549. if (item.IsChoose) {
  550. arr.push(item.Id)
  551. str.push(item.StatusName)
  552. }
  553. })
  554. this.activeState = arr.join(',')
  555. const arrTwo = []
  556. const strTwo=[]
  557. this.activityTimeList.forEach(key => {
  558. if (key.IsChoose) {
  559. arrTwo.push(key.Id)
  560. strTwo.push(key.StatusName)
  561. }
  562. })
  563. if (strTwo.length > 0) {
  564. this.activeStateName = strTwo.join(',')
  565. }else{
  566. if (str.length == this.listActivityStaus.length) {
  567. this.activeStateName = '所有状态'
  568. } else {
  569. this.activeStateName = str.join(',')
  570. }
  571. }
  572. this.activityTimeStatus = arrTwo.join(',')
  573. const hyArr = []
  574. const hyStr = []
  575. this.listChartPermission.forEach(key => {
  576. if (key.IsChoose) {
  577. hyArr.push(key.ChartPermissionId)
  578. hyStr.push(key.PermissionName)
  579. }
  580. })
  581. if ((hyStr.length == 6 && this.listChartPermission.length == 6) || hyStr.length <= 0) {
  582. this.chartPermissionName = '所有分类'
  583. } else {
  584. this.chartPermissionName = hyStr.join(',')
  585. }
  586. this.chartPermissionIds = hyArr.join(',')
  587. const lxArr = []
  588. const lxStr = []
  589. this.listActivityType.forEach(key => {
  590. if (key.IsChoose) {
  591. lxArr.push(key.ActivityTypeId)
  592. lxStr.push(key.ActivityTypeName)
  593. }
  594. })
  595. if (lxStr.length == this.listActivityType.length && lxStr.length > 0 || lxStr.length <= 0) {
  596. this.activityTypeName = '所有类型'
  597. } else {
  598. this.activityTypeName = lxStr.join(',')
  599. }
  600. this.activityTypeIds = lxArr.join(',')
  601. this.getList()
  602. },
  603. //选择预告气泡的标签
  604. changeTarget(index, item) {
  605. let arrIndex = this.spanIndex.indexOf(index);
  606. if (arrIndex > -1) {
  607. this.spanIndex.splice(arrIndex, 1);
  608. } else {
  609. this.spanIndex.push(index);
  610. }
  611. const arr = []
  612. this.spanIndex.forEach(item=>{
  613. if(this.dynamicList.length>0){
  614. arr.push(this.dynamicList[item].KeyWord)
  615. }
  616. })
  617. this.keyWord = arr.join(',')
  618. this.page_no = 1
  619. this.getList()
  620. },
  621. //获取快捷主题
  622. fastSearchKeWord() {
  623. activity.fastSearchKeWord({
  624. ActiveState: this.activeState,
  625. ActivityTypeIds: this.activityTypeIds,
  626. ChartPermissionIds: this.chartPermissionIds,
  627. WhichDay: this.activityTimeStatus
  628. }).then(res => {
  629. if (res.Ret !== 200) return
  630. this.dynamicList = res.Data.List || []
  631. })
  632. },
  633. },
  634. //load
  635. onLoad(option) {
  636. this.$store.dispatch("checkHandle", {type:'load',val:option}).then(res => {
  637. app.globalData.isAuth = res.IsAuth;
  638. app.globalData.isBind = res.IsBind;
  639. if(option){
  640. if (Object.keys(option).length !== 0) {
  641. this.activeState = option.statesId; //活动进行状态
  642. this.activityTypeIds = option.typeIds; //活动类型id 多个用 , 隔开
  643. this.chartPermissionIds = option.chartIds; //行业id 多个用 , 隔开
  644. this.activeStateName = option.stateName;
  645. this.chartPermissionName = option.chartName;
  646. this.activityTypeName = option.typeName;
  647. this.activityTimeStatus = option.timeStatus;
  648. this.spanIndex = option.indexs ? option.indexs.split(',').map(item => item - 0) : []
  649. this.keyWord = option.keys
  650. this.isGain = false;
  651. }
  652. }else {
  653. this.isGain = true;
  654. }
  655. if (this.isGain) {
  656. this.getList();
  657. }
  658. this.getUserSearchContent();
  659. this.fastSearchKeWord()
  660. })
  661. },
  662. //切换tabs 刷新页面
  663. onTabItemTap() {
  664. if (this.page_no > 1 || this.tabsActive !== 0 || this.collectList !== []) {
  665. this.tabsActive = 0;
  666. this.activeStateName = "未开始";
  667. this.chartPermissionName = "所有分类";
  668. this.activityTypeName = "所有类型";
  669. this.activeState = "1"; //活动进行状态
  670. this.activityTypeIds = ""; //活动类型id 多个用 , 隔开
  671. this.chartPermissionIds = ""; //行业id 多个用 , 隔开
  672. this.page_no = 1;
  673. this.collectList = [];
  674. this.spanIndex=[]
  675. this.keyWord= ''
  676. this.activityTimeList.forEach(key => {key.IsChoose=false})
  677. this.activityTimeStatus=''
  678. this.getList();
  679. this.getUserSearchContent();
  680. }
  681. },
  682. //show
  683. onShow() {
  684. this.countryCcode(); //判断是否加区号
  685. this.$store.dispatch("statistics",{PageType:'Activit'})
  686. },
  687. //页面隐藏
  688. onHide() {
  689. if (this.tabsActive !== 0 ) return
  690. this.selectComponent("#statusstate").toggle(false);
  691. this.selectComponent("#industry").toggle(false);
  692. this.selectComponent("#genre").toggle(false);
  693. },
  694. /** 用户点击分享 */
  695. onShareAppMessage: function(res) {
  696. return {
  697. title: this.keyWord? this.keyWord:this.activeStateName+','+this.chartPermissionName+','+this.activityTypeName,
  698. path: "/pages/activity/activity?statesId=" +
  699. this.activeState +
  700. "&typeIds=" +
  701. this.activityTypeIds +
  702. "&chartIds=" +
  703. this.chartPermissionIds +
  704. "&stateName=" +
  705. this.activeStateName +
  706. "&chartName=" +
  707. this.chartPermissionName +
  708. "&typeName=" +
  709. this.activityTypeName +
  710. "&tabs=" +
  711. this.tabsActive +
  712. "&timeStatus=" +
  713. this.activityTimeStatus +
  714. "&indexs=" + this.spanIndex +
  715. "&keys=" + this.keyWord,
  716. success: (res) => {},
  717. fail: (err) => {},
  718. };
  719. },
  720. /* 触底 */
  721. onReachBottom: Throttle(function() {
  722. if (this.status === "nomore") return;
  723. this.status = "loading";
  724. this.page_no++;
  725. if (this.tabsActive == 0) {
  726. this.getList();
  727. } else {
  728. this.getScheduleList();
  729. }
  730. }),
  731. /* 下拉刷新 */
  732. onPullDownRefresh: Throttle(function() {
  733. this.page_no = 1;
  734. this.refresh = true;
  735. if (this.tabsActive == 0) {
  736. this.getList();
  737. } else {
  738. this.getScheduleList();
  739. }
  740. }),
  741. // 页面滚动事件
  742. onPageScroll() {
  743. if (this.tabsActive !== 0 || !this.isScrollShow) return
  744. this.selectComponent("#statusstate").toggle(false);
  745. this.selectComponent("#industry").toggle(false);
  746. this.selectComponent("#genre").toggle(false);
  747. this.isScrollShow=false
  748. },
  749. };
  750. </script>
  751. <style scoped lang="scss">
  752. @import "../../activityPages/index.scss";
  753. .box-content {
  754. padding: 0rpx 34rpx 20rpx !important;
  755. }
  756. .select-sticky {
  757. position: sticky !important;
  758. width: 100%;
  759. top: 78rpx;
  760. z-index: 9999;
  761. background-color: #fff;
  762. .select-conyent {
  763. padding: 0 30rpx;
  764. .decide {
  765. background-color: #F8F8FA;
  766. display: flex;
  767. align-items: center;
  768. margin: 0 auto;
  769. height: 110rpx;
  770. width: 100%;
  771. padding-left: 30rpx;
  772. }
  773. .items-box {
  774. width: 40rpx;
  775. }
  776. .menu-items {
  777. background-color: #F8F8FA;
  778. width: 100%;
  779. display: flex;
  780. flex-wrap: wrap;
  781. padding: 30rpx 30rpx 0;
  782. .menu-items-box {
  783. display: flex;
  784. width: 50%;
  785. font-size: 28rpx;
  786. font-weight: 400;
  787. margin-bottom: 40rpx;
  788. }
  789. }
  790. .replacement-box {
  791. background-color: #fff;
  792. border-radius: 0rpx 0rpx 16rpx 16rpx;
  793. }
  794. .replacement {
  795. margin: 0rpx 30rpx 20rpx;
  796. display: flex;
  797. background-color: #2C83FF;
  798. opacity: 1;
  799. height: 60rpx;
  800. line-height: 58rpx;
  801. font-size: 28rpx;
  802. font-weight: 400;
  803. color: #FFFFFF;
  804. border-radius: 30rpx;
  805. text {
  806. flex: 1;
  807. text-align: center;
  808. }
  809. .replacement-box {
  810. border: 1rpx solid #2C83FF;
  811. opacity: 1;
  812. color: #2C83FF;
  813. background: #FFFFFF;
  814. border-radius: 28rpx 0rpx 28rpx 28rpx;
  815. }
  816. }
  817. }
  818. }
  819. .activity-content .nodata {
  820. padding-top: 80rpx !important;
  821. }
  822. .activity-content .nodataTwo {
  823. padding-top: 280rpx !important;
  824. }
  825. </style>