activitySearch.vue 18 KB

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