activitySearch.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  1. <template>
  2. <view class="container activity-content activity-search-content">
  3. <view class="top-content">
  4. <!-- 搜索 -->
  5. <view class="searchTarget-header">
  6. <input type="text" placeholder="请输入关键字" placeholder-class="sea_ipt_placeholder" class="sea_ipt" v-model="searchTxt" focus="true" confirm-type="search" @confirm="searchHandle" />
  7. <icon type="search" size="15" class="sea_ico" />
  8. <view class="ipt-right">
  9. <icon type="clear" size="16" color="#E0E0E0" @click="clearIpt" />
  10. <text class="line">|</text>
  11. <text @click="searchHandle" style="color: #3385ff">搜索</text>
  12. </view>
  13. </view>
  14. <view class="search-cont" v-if="!isShowSearch">
  15. <view class="search-cont-top">
  16. <view class="cont-tit">
  17. <text>热搜关键词:</text>
  18. </view>
  19. <view class="targetList">
  20. <view class="target-item text_oneLine" v-for="(item, index) in hotKeyWord" :key="index" @click="chooseTarget(item.KeyWord)"># {{ item.KeyWord }}</view>
  21. </view>
  22. </view>
  23. <view class="search-cont-top">
  24. <view class="cont-tit">
  25. <text>推荐关键词:</text>
  26. </view>
  27. <view class="targetList">
  28. <view class="target-item text_oneLine" v-for="(item, index) in keywordList" :key="index" @click="chooseTarget(item)"># {{ item }}</view>
  29. </view>
  30. </view>
  31. <view class="search-cont-top" v-if="historySearchList.length">
  32. <view class="cont-tit">
  33. <text>搜索历史:</text>
  34. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/empty_ico.png" class="empty_ico" @click="clearHistory"></image>
  35. </view>
  36. <view class="targetList">
  37. <block v-for="(item, index) in historySearchList" :key="index">
  38. <view v-if="index < 8" class="target-item text_oneLine" @click="chooseTarget(item)"># {{ item }}</view>
  39. </block>
  40. </view>
  41. </view>
  42. </view>
  43. <!-- 各种状态选择 -->
  44. <view class="select-conyent" v-if="isShowSearch">
  45. <text @click="handelState(item)" :class="['state-item', activeState == item.state && 'state-active-item']" v-for="item in activeStateOption" :key="item.name">{{ item.name }}</text>
  46. </view>
  47. </view>
  48. <!-- 内容列表部分 -->
  49. <!-- 活动列表 -->
  50. <view v-if="haveData" class="activity-pages">
  51. <view class="collect-ul">
  52. <view class="collect-ltem" v-for="(item, index) in collectList" :key="index">
  53. <view class="title-date" @click="goDetail(item)">
  54. <text :class="item.ActivityType == 1 ? '' : 'xianxia'">{{ item.ActivityType == 1 ? "线上" : "线下" }}</text>
  55. {{ item.ActivityTimeText }}
  56. <view class="audio-back" v-if="item.AudioLink" @click.stop="audioPlayBack(item)">
  57. <image
  58. class="audio-img"
  59. :src="
  60. curVoiceId === item.ActivityId && !curAudioPaused
  61. ? 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/back_stop.png'
  62. : 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/back_group.png'
  63. "
  64. ></image>
  65. {{ curVoiceId === item.ActivityId && !curAudioPaused ? "暂停" : "回放" }}
  66. </view>
  67. </view>
  68. <view class="item-li">
  69. <view class="item-img" @click="goDetail(item)">
  70. <image :src="item.ImgUrl"> </image>
  71. <text v-if="item.ActiveState == 1" class="img-status begin">未开始</text>
  72. <text v-else-if="item.ActiveState == 2" class="img-status proceed">进行中</text>
  73. <text v-else class="img-status">已结束</text>
  74. <view class="img-type">
  75. <image :src="item.ImgUrlText" mode=""></image>
  76. </view>
  77. </view>
  78. <view class="item">
  79. <view class="item-text" @click="goDetail(item)">
  80. <text class="activity-title"> {{ item.ActivityName }} </text>
  81. <text class="text_twoLine" v-if="item.Expert">专家背景:{{ item.Expert }} </text>
  82. <text class="text_twoLine" v-if="item.DistinguishedGuest">嘉宾:{{ item.DistinguishedGuest }} </text>
  83. <text class="text_twoLine" v-if="item.Speaker">主讲人:{{ item.Speaker }}</text>
  84. </view>
  85. <block v-if="item.ActiveState == 1">
  86. <view :class="['bottom-box', item.ActivityTypeId == 1 && item.IsLimitPeople == 0 && 'expert-item', item.City && 'city']">
  87. <view class="city-img" v-if="item.City">
  88. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/location.png"></image>
  89. {{ item.City }}
  90. </view>
  91. <view style="display: flex">
  92. <text v-if="item.IsShowOutboundCall && item.ActivityTypeId == 1" class="button" @click="signupIsAddOfCancel(item, 1)">{{ item.IsSignup == 1 ? "取消外呼" : "预约外呼" }}</text>
  93. <text v-if="item.IsShowAppointment" @click="summaryIsHandel(item)">{{ item.IsAppointment == 1 ? "取消纪要" : "预约纪要" }}</text>
  94. <text v-if="item.IsShowMeetingReminder" @click="meetingReminderAdd(item.ActivityId, item.IsCancelMeetingReminder)">
  95. {{ item.IsCancelMeetingReminder == 0 ? "消息提醒" : "取消提醒" }}
  96. </text>
  97. <view v-if="item.IsShowHelpSsk" style="width: 130rpx">
  98. <text @click="askingGo(item)">帮我带问</text>
  99. </view>
  100. <text v-if="item.IsShowOutboundCall && item.ActivityTypeId != 1" class="button" @click="signupIsAddOfCancel(item, 1)">{{ item.IsSignup == 1 ? "取消外呼" : "预约外呼" }}</text>
  101. <text v-if="item.IsShowDetails" @click="goDetail(item)" class="button" >查看详情</text>
  102. <block v-if="item.IsShowSignup">
  103. <block v-if="item.IsCClassMeeting">
  104. <text class="button" @click="signupIsAddOfCancel(item, 3, 'CClass')">{{ item.IsSignup == 1 ? "取消报名" : "我要报名" }}</text>
  105. </block>
  106. <block v-else>
  107. <text class="button" v-if="item.IsSignup !== 1" @click="wanttosignup(item.ActivityId)">我要报名</text>
  108. <text class="button" v-else @click="signupIsAddOfCancel(item, 2)">{{ item.SignupType == 1 ? "取消外呼" : "取消报名" }}</text>
  109. </block>
  110. </block>
  111. </view>
  112. </view>
  113. </block>
  114. <block v-else>
  115. <view class="bottom-box city" v-if="item.City">
  116. <view class="city-img">
  117. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/location.png" />
  118. {{ item.City }}
  119. </view>
  120. </view>
  121. <view class="bottom-box real-time" v-if="item.ActiveState == 2 && item.ActivityTypeId == 1">
  122. <text class="button" @click="askingGo(item, '提问')">实时提问</text>
  123. </view>
  124. </block>
  125. </view>
  126. </view>
  127. </view>
  128. <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="totalPage > 1" />
  129. </view>
  130. </view>
  131. <!-- 缺审部分 -->
  132. <view class="nodata" v-else>
  133. <image src="https://hzstatic.hzinsights.com/cygx/czbk/act_search.png" mode="" class="nodata_ico"></image>
  134. <text>未找到搜索结果</text>
  135. </view>
  136. <!-- 各种自定义弹框 -->
  137. <modalDialog
  138. :isShow="isShow"
  139. :signupType="signupType"
  140. :goFollow="goFollow"
  141. :signupStatus="signupStatus"
  142. :hasPermission="hasPermission"
  143. :jurisdictionList="jurisdictionList"
  144. :editIsShow="editIsShow"
  145. :isCancelShow="isCancelShow"
  146. :idTypeCancel="idTypeCancel"
  147. @cancelShowBtn="cancelEnsure"
  148. :countryCode="countryCode"
  149. :mobileEdit="mobileEdit"
  150. :goOnNextStep="goOnNextStep"
  151. :isShowhasPermission="isShowhasPermission"
  152. :applyForIsShow="applyForIsShow"
  153. :mailboxBinding="mailboxBinding"
  154. />
  155. <!-- 选择区号弹出层 -->
  156. <areaCode :isAreaCode="isAreaCode" :areaCode="areaCode" />
  157. <!-- 参会方式弹出层 -->
  158. <view class="select-box">
  159. <u-popup v-model="selectShow" mode="bottom">
  160. <view style="color: #333333; font-size: 28rpxrpx">请选择参会方式</view>
  161. <view style="color: #2c83ff" @click="signupAdd('id', 1)">预约外呼</view>
  162. <view style="color: #2c83ff" @click="signupAdd('id', 2)">自主拨入</view>
  163. <view style="color: #a9afb8" @click="selectShow = false">取消</view>
  164. </u-popup>
  165. </view>
  166. <view v-if="showAudioBox">
  167. <audioModule :showAudioPop.sync="showAudioPop" />
  168. </view>
  169. <freeCharge class="free-charge" :isShowFreeBtn="isShowFree" />
  170. </view>
  171. </template>
  172. <script>
  173. import { activity, User, Search } from "@/config/api.js";
  174. import { Throttle } from "@/config/util.js";
  175. import modalDialog from "@/components/modalDialog.vue";
  176. import areaCode from "@/activityPages/components/areaCode.vue";
  177. import myMixin from "../components/index.js";
  178. import myActivityMixin from "../components/indexActivity.js";
  179. import freeCharge from "@/components/freeCharge";
  180. import audioModule from "@/components/audioModule/index";
  181. let app = getApp({ allowDefault: true });
  182. export default {
  183. data() {
  184. return {
  185. // 关键字列表
  186. keywordList: [],
  187. chartWordList: [],
  188. searchTxt: "",
  189. isShowSearch: false,
  190. status: "loadmore",
  191. totalPage: "",
  192. haveData: true,
  193. activeState: 0, //活动进行状态
  194. activeStateOption: [
  195. {
  196. name: "全部",
  197. state: 0,
  198. },
  199. {
  200. name: "可回放",
  201. state: 1,
  202. },
  203. ],
  204. selectShow: false,
  205. dynamicList: [],
  206. hotKeyWord: [],
  207. showAudioPop: false,
  208. };
  209. },
  210. mixins: [myMixin, myActivityMixin],
  211. components: {
  212. modalDialog,
  213. areaCode,
  214. freeCharge,
  215. audioModule,
  216. },
  217. methods: {
  218. async researchHotKeyWord() {
  219. const res = await Search.getKeys();
  220. if (res.Ret === 200) {
  221. this.hotKeyWord = res.Data.ListHot || [];
  222. this.chartWordList = res.Data.List || [];
  223. this.keywordList = res.Data.Item ? res.Data.Item.ConfigValue.split(",") : [];
  224. }
  225. },
  226. //获取快捷主题
  227. fastSearchKeWord() {
  228. activity
  229. .fastSearchKeWord({
  230. ActiveState: this.activeState,
  231. Label: "More",
  232. })
  233. .then((res) => {
  234. if (res.Ret !== 200) return;
  235. this.dynamicList = res.Data.List || [];
  236. });
  237. },
  238. //清除了快捷主题
  239. clearDynamicName() {
  240. this.searchTxt = "";
  241. this.collectList = [];
  242. this.haveData = true;
  243. this.isShowSearch = false;
  244. },
  245. //搜索记录进来
  246. searchHandle() {
  247. if (this.searchTxt) {
  248. this.page_no = 1;
  249. //添加搜索记录
  250. if (!this.historySearchList.includes(this.searchTxt)) {
  251. this.historySearchList.unshift(this.searchTxt);
  252. this.$db.set("historySearchListActivity", JSON.stringify(this.historySearchList));
  253. }
  254. this.isShowSearch = true;
  255. this.getList();
  256. } else {
  257. this.$util.toast("请输入关键字");
  258. }
  259. },
  260. // 选择历史搜索
  261. chooseTarget(item) {
  262. this.searchTxt = item;
  263. this.collectList = [];
  264. this.page_no = 1;
  265. this.searchHandle();
  266. },
  267. /* 历史搜索清空 */
  268. clearHistory() {
  269. this.historySearchList = [];
  270. this.$db.del("historySearchListActivity");
  271. },
  272. //获取列表
  273. async getList() {
  274. const res = await activity.getActivityListNew({
  275. PageSize: this.pageSize,
  276. CurrentIndex: this.page_no,
  277. KeyWord: this.searchTxt,
  278. ActiveState: "1,2,3", //活动进行状态
  279. PlayBack: this.activeState,
  280. });
  281. if (res.Ret !== 200) return;
  282. this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
  283. this.totalPage = res.Data.Paging.Pages; //总页数
  284. if (this.page_no === 1) {
  285. this.collectList = res.Data.List || [];
  286. this.haveData = this.collectList.length ? true : false;
  287. if (this.refresh) {
  288. uni.stopPullDownRefresh();
  289. this.refresh = false;
  290. }
  291. } else {
  292. this.collectList.push(...res.Data.List);
  293. }
  294. },
  295. /* 表单清空 */
  296. clearIpt() {
  297. this.searchTxt = "";
  298. this.collectList = [];
  299. this.haveData = true;
  300. this.isShowSearch = false;
  301. },
  302. //获取是否需要填写区号接口
  303. countryCcode() {
  304. User.countryCcode().then((res) => {
  305. if (res.Ret == 200) {
  306. this.isNeedAddCountryCode = res.Data.IsNeedAddCountryCode;
  307. }
  308. });
  309. },
  310. //全部 或者可回放的点击事件
  311. handelState(item) {
  312. this.activeState = item.state;
  313. this.page_no = 1;
  314. this.getList();
  315. },
  316. // //点击了回放
  317. // audioPlayBack(item) {
  318. // this.$store.commit("audioBg/parseIntAudio", true);
  319. // // 判断是否为同一个音频
  320. // if (this.$store.state.audioBg.activityId == item.ActivityId) {
  321. // if (this.globalBgAudioManager.paused) {
  322. // this.globalBgAudioManager.play();
  323. // } else {
  324. // this.globalBgAudioManager.pause();
  325. // }
  326. // } else {
  327. // this.$store.commit("audioBg/addAudio", { list: item.VoiceList, activityId: item.ActivityId, activityTitle: item.ActivityName });
  328. // }
  329. // this.showAudioPop = true;
  330. // },
  331. //点击了回放
  332. async audioPlayBack(item) {
  333. if (!item.BackAudioPlay) {
  334. const res = await activity.getActivityDetail({
  335. ActivityId: item.ActivityId,
  336. });
  337. if (res.Ret === 200) {
  338. item.BackAudioPlay = res.Data;
  339. }
  340. }
  341. this.hasPermission = item.BackAudioPlay.HasPermission;
  342. this.jurisdictionList.ActivityId = item.BackAudioPlay.ActivityId;
  343. if (this.hasPermission == 1) {
  344. this.$store.commit("audioBg/parseIntAudio", true);
  345. // 判断是否为同一个音频
  346. if (this.$store.state.audioBg.activityId == item.ActivityId) {
  347. if (this.globalBgAudioManager.paused) {
  348. this.globalBgAudioManager.play();
  349. } else {
  350. this.globalBgAudioManager.pause();
  351. }
  352. } else {
  353. this.$store.commit("audioBg/addAudio", { list: item.VoiceList, activityId: item.ActivityId, activityTitle: item.ActivityName });
  354. }
  355. this.showAudioPop = true;
  356. } else if (this.hasPermission == 2) {
  357. this.jurisdictionList.SellerMobile = item.BackAudioPlay.SellerMobile;
  358. this.jurisdictionList.SellerName = item.BackAudioPlay.SellerName;
  359. this.jurisdictionList.PopupMsg = item.BackAudioPlay.PopupMsg;
  360. this.isShowhasPermission = true;
  361. } else if (this.hasPermission == 3 || this.hasPermission == 4 || this.hasPermission == 5) {
  362. this.jurisdictionList.PopupMsg = item.BackAudioPlay.PopupMsg;
  363. this.applyForIsShow = true;
  364. }
  365. },
  366. },
  367. computed: {
  368. curVoiceId() {
  369. //当前正在播放的音频id
  370. return this.$store.state.audioBg.activityId;
  371. },
  372. curAudioPaused() {
  373. //当前音频是否暂停状态
  374. return this.$store.state.audioBg.paused;
  375. },
  376. showAudioBox() {
  377. return this.$store.state.audioBg.parseIntShow;
  378. },
  379. },
  380. onShow() {
  381. this.$store.commit("audioBg/parseIntAudio", true);
  382. this.countryCcode(); //判断是否加区号
  383. this.$store.dispatch("statistics", { PageType: "ActivitSearch" });
  384. },
  385. onHide() {
  386. this.$store.commit("audioBg/parseIntAudio", false);
  387. },
  388. //load
  389. onLoad(option) {
  390. if (this.$db.get("historySearchListActivity")) {
  391. let historyList = JSON.parse(this.$db.get("historySearchListActivity"));
  392. this.historySearchList = historyList;
  393. }
  394. this.searchTxt = option.text || "";
  395. this.activeState = option.statesId || 0;
  396. if (option.text) {
  397. this.searchHandle();
  398. }
  399. this.researchHotKeyWord();
  400. this.fastSearchKeWord();
  401. },
  402. /* 触底 */
  403. onReachBottom: Throttle(function () {
  404. if (this.status === "nomore") return;
  405. this.status = "loading";
  406. this.page_no++;
  407. this.getList();
  408. }),
  409. /* 用户点击分享 */
  410. onShareAppMessage: function (res) {
  411. return {
  412. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : "活动搜索",
  413. path: "/activityPages/activitySearch/activitySearch?statesId=" + this.activeState + "&text=" + this.searchTxt,
  414. success: (res) => {},
  415. fail: (err) => {},
  416. };
  417. },
  418. /* 下拉刷新 */
  419. onPullDownRefresh: Throttle(function () {
  420. this.page_no = 1;
  421. this.refresh = true;
  422. if (this.tabsActive == 0) {
  423. this.getList();
  424. } else {
  425. this.getScheduleList();
  426. }
  427. }),
  428. };
  429. </script>
  430. <style scoped lang="scss">
  431. .activity-pages {
  432. padding-top: 190rpx;
  433. padding-bottom: 30rpx;
  434. }
  435. @import "../components/indexActivity.scss";
  436. .activity-search-content {
  437. background-color: #f7f7f7;
  438. .ipt-right {
  439. z-index: 11;
  440. }
  441. .select-conyent {
  442. display: flex;
  443. float: right;
  444. margin-bottom: 20rpx;
  445. height: 51rpx;
  446. width: 252rpx;
  447. border-radius: 47rpx;
  448. overflow: hidden;
  449. margin-right: 30rpx;
  450. .state-item {
  451. width: 126rpx;
  452. height: 51rpx;
  453. text-align: center;
  454. line-height: 51rpx;
  455. color: #999999;
  456. font-size: 24rpx;
  457. background-color: #f8f8fa;
  458. }
  459. .state-active-item {
  460. background: #3385ff;
  461. color: #fff;
  462. border-radius: 47rpx;
  463. }
  464. }
  465. .title-date {
  466. position: relative;
  467. .audio-back {
  468. position: absolute;
  469. right: 0;
  470. top: 50%;
  471. transform: translateY(-50%);
  472. width: 99rpx;
  473. height: 39rpx;
  474. font-size: 24rpx;
  475. color: #fff;
  476. display: flex;
  477. align-items: center;
  478. background-color: #3385ff;
  479. border-radius: 20rpx;
  480. padding-left: 4rpx;
  481. .audio-img {
  482. width: 30rpx;
  483. height: 30rpx;
  484. margin: 0 5rpx;
  485. }
  486. }
  487. }
  488. .top-content {
  489. width: 100%;
  490. position: fixed;
  491. top: 0;
  492. left: 0;
  493. z-index: 99;
  494. background-color: #fff;
  495. .searchTarget-header {
  496. position: relative;
  497. width: 100%;
  498. background-color: #fff;
  499. padding: 20rpx 0;
  500. display: flex;
  501. justify-content: center;
  502. align-items: center;
  503. .sea_ipt_placeholder {
  504. color: #8d8d8d;
  505. }
  506. .sea_ipt {
  507. width: 682rpx;
  508. height: 70rpx;
  509. line-height: 70rpx;
  510. box-sizing: border-box;
  511. border: 1rpx solid #e5e5e5;
  512. background-color: rgba(245, 245, 245, 0.2);
  513. font-size: 26rpx;
  514. color: #4a4a4a;
  515. padding: 0 180rpx 0 78rpx;
  516. border-radius: 70rpx;
  517. }
  518. .sea_ico {
  519. width: 31rpx;
  520. height: 31rpx;
  521. position: absolute;
  522. left: 60rpx;
  523. top: 50%;
  524. transform: translateY(-50%);
  525. }
  526. .ipt-right {
  527. display: flex;
  528. align-items: center;
  529. position: absolute;
  530. right: 59rpx;
  531. top: 50%;
  532. transform: translateY(-50%);
  533. color: #3385ff;
  534. .line {
  535. margin: 0 21rpx;
  536. color: #e0e0e0;
  537. }
  538. }
  539. }
  540. .search-cont {
  541. height: calc(100vh - 200rpx);
  542. padding-bottom: 20rpx;
  543. overflow: hidden;
  544. overflow-y: auto;
  545. background-color: #f7f7f7;
  546. .search-cont-top {
  547. padding: 0 34rpx 0;
  548. margin-bottom: 10rpx;
  549. padding-top: 20rpx;
  550. &:last-child {
  551. margin-bottom: 0;
  552. }
  553. .cont-tit {
  554. font-size: 32rpx;
  555. margin-bottom: 20rpx;
  556. font-weight: 500;
  557. display: flex;
  558. justify-content: space-between;
  559. .empty_ico {
  560. width: 32rpx;
  561. height: 33rpx;
  562. }
  563. }
  564. .targetList {
  565. display: flex;
  566. flex-wrap: wrap;
  567. font-size: 28rpx;
  568. .target-item {
  569. width: 50%;
  570. margin-bottom: 20rpx;
  571. }
  572. .chart-item {
  573. width: 100%;
  574. margin-bottom: 20rpx;
  575. }
  576. }
  577. }
  578. }
  579. }
  580. }
  581. </style>