index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798
  1. <template>
  2. <div>
  3. <!-- <div class="right-menu-item hover-effect" @click="handleDrawer">
  4. <i class="el-icon-message-solid" style="font-size: 24px; line-height: 50px" />
  5. <el-badge v-if='allUnreadNum > 0' class="mark" :value="allUnreadNum" />
  6. </div> -->
  7. <!-- <el-dropdown class="user-container yidong">
  8. <div class="user right-menu-item hover-effect">
  9. <span>移动端</span>
  10. </div>
  11. <el-dropdown-menu slot="dropdown" class="user-dropdown">
  12. <el-dropdown-item disabled v-for="(item, index) in QRcodeList" :key="index">
  13. <div class="QRcode">
  14. <el-image class="QRcode-img" :src="item.codeUrl" :preview-src-list="[item.codeUrl]" fit="fill"></el-image>
  15. <div>
  16. <div>{{ item.name }}</div>
  17. <div class="liveTitle">{{ item.saleName }}</div>
  18. <div>
  19. <el-image v-if="item.iosIcon" class="shouji-icon" :src="item.iosIcon" fit="fill"></el-image>
  20. <el-image v-if="item.androidIcon" class="shouji-icon" :src="item.androidIcon" fit="fill"></el-image>
  21. </div>
  22. </div>
  23. </div>
  24. </el-dropdown-item>
  25. </el-dropdown-menu>
  26. </el-dropdown> -->
  27. <el-drawer size="450px" :with-header="false" :show-close="false" :visible.sync="drawer" direction="rtl"
  28. :modal="false">
  29. <div class="drawer">
  30. <div :offset="0" class="drawer_left">
  31. <div class="drawer_top">
  32. <div class="flex center">
  33. <div class="radio">
  34. 状态筛选标签
  35. </div>
  36. <div class="icon_close">
  37. <i class="el-icon-close" @click="guanbi" />
  38. </div>
  39. </div>
  40. <div>
  41. <el-button :type="pam.read_flag == '' ? 'primary' : null" size="mini" @click="hadleRead(0)">全部</el-button>
  42. <el-button :type="pam.read_flag == 'NO' ? 'primary' : null" size="mini" @click="hadleRead(1)">未读</el-button>
  43. <el-badge :value="allUnreadNum" class="item" />
  44. <el-button :type="pam.read_flag == 'YES' ? 'primary' : null" size="mini"
  45. @click="hadleRead(2)">已读</el-button>
  46. </div>
  47. <el-tabs v-model="pam.type" @tab-click="handleClick">
  48. <el-tab-pane label="通知" name="N"></el-tab-pane>
  49. <el-tab-pane label="活动" name="A"></el-tab-pane>
  50. <el-tab-pane label="公告" name="B"></el-tab-pane>
  51. </el-tabs>
  52. </div>
  53. <div v-loading="loading" class="notice" style="position: relative;">
  54. <div style="position: absolute;top: 0;bottom: 0;left: 0;right: 0;">
  55. <v-scroll-view :x="false" :y="true" slidingBgClassName="slidingBgClassName3"
  56. slidingBlockClassName="slidingBlockClassName3">
  57. <div style="box-sizing: border-box;padding: 10px;">
  58. <div v-if="dataList.length" class="item-data" v-for="(item, index) in dataList" :key="index"
  59. @click="opendomview(item)">
  60. <div class="item-tag">{{ ["活动", "公告", "通知"][["A", "B", "N"].indexOf(item.type)] }}</div>
  61. <div class="item-centor">
  62. <div class="item-centor">{{ item.content }}</div>
  63. <div class="item-time">{{ item.issueTime }}</div>
  64. </div>
  65. </div>
  66. <el-empty v-if="!dataList.length" description="暂无数据"></el-empty>
  67. </div>
  68. </v-scroll-view>
  69. </div>
  70. </div>
  71. <el-pagination layout="total, prev, pager, next" :total="total" small :page-size="pam.pageSize"
  72. :current-page="pam.pageNum" @current-change="currentChange" />
  73. </div>
  74. </div>
  75. </el-drawer>
  76. <el-drawer :title="showRow.title" :visible.sync="dialogVisible" direction="rtl" :before-close="dialogVisibleGuanbi"
  77. size="450px" :modal="false">
  78. <el-card class="box-card">
  79. <div v-html="showRow.content"></div>
  80. </el-card>
  81. </el-drawer>
  82. </div>
  83. </template>
  84. <script>
  85. import { mapMutations, mapActions, mapGetters } from 'vuex'
  86. import vScrollView from 'v-scroll-view'
  87. // import { notifyMyList, notifyMyRead } from '@/api/notificationCenter/eventAnnouncement'
  88. import { EventBus } from '@/utils/eventBus'
  89. export default {
  90. components: { vScrollView },
  91. data() {
  92. return {
  93. drawer: false,
  94. dataList: [],
  95. loading: false,
  96. total: 0,
  97. pam: {
  98. type: "N",
  99. read_flag: "",
  100. pageNum: 1,
  101. pageSize: 20,
  102. },
  103. dialogVisible: false,
  104. showRow: {},
  105. QRcodeList: [{
  106. codeUrl: "https://fw.gd-jxm.com/gateway/pcapi/img/get?key=2023-10/16976800457215fe3d109-e0ae-485d-8b23-8e16d36885e9.jpg",
  107. name: "aaaaa",
  108. saleName: "",
  109. iosIcon: "https://fw.gd-jxm.com/gateway/pcapi/img/get?key=2023-10/16976801488369080b52c-a1e6-40a0-83f9-8e04f12b494e.jpg",
  110. androidIcon: "https://fw.gd-jxm.com/gateway/pcapi/img/get?key=2023-10/1697680143828d678a6e5-307d-47d0-8ee9-1698f100feb4.jpg"
  111. }]
  112. }
  113. },
  114. computed: {
  115. ...mapGetters(['allUnreadNum'])
  116. },
  117. mounted() {
  118. EventBus.$on('opendomview', this.opendomview)
  119. EventBus.$on('handleDrawerabcde', this.handleDrawer)
  120. var this_ = this
  121. if (this.timeId) {
  122. clearTimeout(this.timeId)
  123. }
  124. (function dingshiqingqiu() {
  125. this_.updateUnreadNotice()
  126. this_.timeId = setTimeout(dingshiqingqiu, 2000);
  127. })()
  128. },
  129. beforeDestroy() {
  130. if (this.timeId) {
  131. clearTimeout(this.timeId)
  132. }
  133. },
  134. watch: {
  135. pam: {
  136. handler(newVal, oldVal) {
  137. this.getMessageList()
  138. },
  139. deep: true
  140. }
  141. },
  142. methods: {
  143. ...mapMutations({
  144. SET_SHOW: 'app/SET_SHOW'
  145. }),
  146. ...mapActions({
  147. updateUnreadNotice: 'app/getUnreadNum'
  148. }),
  149. handleClick(val) {
  150. console.log(val)
  151. },
  152. opendomview(row) {
  153. this.showRow = row
  154. this.dialogVisible = true
  155. // notifyMyRead({
  156. // id:row.id
  157. // }).then(res=>{
  158. // this.updateUnreadNotice()
  159. // if(this.drawer){
  160. // this.getMessageList()
  161. // }
  162. // })
  163. },
  164. dialogVisibleGuanbi() {
  165. this.showRow = {}
  166. this.dialogVisible = false
  167. },
  168. // 数据处理
  169. getMessageList() {
  170. // notifyMyList({
  171. // "pageNum": this.pam.pageNum,
  172. // "pageSize": this.pam.pageSize,
  173. // "params": (()=>{
  174. // var arr = []
  175. // if(this.pam.read_flag){
  176. // arr.push({ "param": "a.read_flag", "compare": "=", "value": this.pam.read_flag })
  177. // }
  178. // if(this.pam.type){
  179. // arr.push({ "param": "a.type", "compare": "=", "value": this.pam.type })
  180. // }
  181. // return arr
  182. // })(),
  183. // "moduleId": "486084326453317-teshu"
  184. // }).then(res => {
  185. // this.dataList = res.data.records
  186. // this.total = res.data.total
  187. // })
  188. },
  189. currentChange(v) {
  190. this.pam.pageNum = v
  191. },
  192. // 打开消息弹窗
  193. handleDrawer() {
  194. this.drawer = true
  195. this.getMessageList()
  196. },
  197. guanbi() {
  198. this.drawer = false
  199. this.pam = {
  200. read_flag: "",
  201. pageNum: 1,
  202. pageSize: 20,
  203. }
  204. },
  205. // 状态筛选标签
  206. hadleRead(index) {
  207. this.dataList = []
  208. this.pam.read_flag = ["", "NO", "YES"][index]
  209. this.pam.pageNum = 1
  210. this.getMessageList()
  211. },
  212. }
  213. }
  214. </script>
  215. <style lang="scss" scoped>
  216. @import '~@/styles/variables.scss';
  217. .item {
  218. margin-left: -10px;
  219. margin-top: -10px;
  220. }
  221. .notice_tip {
  222. font-size: 16px;
  223. }
  224. ::v-deep .slidingBgClassName {
  225. background: rgba(0, 0, 0, 0.0075) !important;
  226. }
  227. ::v-deep .slidingBlockClassName {
  228. background: rgba(0, 0, 0, 0.0125) !important;
  229. }
  230. ::v-deep .el-drawer .el-drawer__body {
  231. overflow: hidden !important;
  232. }
  233. .navbar {
  234. width: 100%;
  235. height: 50px;
  236. overflow: hidden;
  237. background: #{$navbarBg};
  238. box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
  239. display: flex;
  240. flex-direction: row;
  241. align-items: center;
  242. .hamburger-container {
  243. line-height: 46px;
  244. height: 100%;
  245. color: #{$navbarText};
  246. cursor: pointer;
  247. transition: background 0.3s;
  248. -webkit-tap-highlight-color: transparent;
  249. border-right: 1px solid #eaeaea;
  250. &:hover {
  251. background: rgba(0, 0, 0, 0.025);
  252. }
  253. }
  254. ul {
  255. list-style: none;
  256. padding: 0;
  257. line-height: 20px;
  258. li {
  259. overflow: hidden;
  260. white-space: nowrap;
  261. text-overflow: ellipsis;
  262. }
  263. }
  264. .right-menu {
  265. height: 100%;
  266. line-height: 50px;
  267. &>div {
  268. float: left;
  269. }
  270. &:focus {
  271. outline: none;
  272. }
  273. .user-container {
  274. height: 50px;
  275. .user {
  276. i {
  277. font-size: 18px;
  278. margin-right: 5px;
  279. }
  280. span {
  281. font-size: 16px;
  282. }
  283. }
  284. }
  285. .right-menu-item {
  286. display: inline-block;
  287. padding: 0 15px;
  288. height: 100%;
  289. font-size: 18px;
  290. color: #{$navbarText};
  291. vertical-align: text-bottom;
  292. border-left: 1px solid #eaeaea;
  293. &.hover-effect {
  294. cursor: pointer;
  295. transition: background 0.3s;
  296. &:hover {
  297. background: rgba(0, 0, 0, 0.025);
  298. }
  299. }
  300. .notice-icon {
  301. padding-top: 0;
  302. padding-bottom: 0;
  303. }
  304. .right-menu-item {
  305. .notice-icon>i {
  306. font-size: 18px;
  307. }
  308. sup {
  309. top: 12px;
  310. right: 25px;
  311. }
  312. }
  313. }
  314. }
  315. .flex {
  316. display: flex;
  317. justify-content: space-between;
  318. }
  319. .dot_title {
  320. height: 40px;
  321. }
  322. .dot::before {
  323. content: '';
  324. display: inline-block;
  325. margin-right: 10px;
  326. padding: 5px;
  327. border-radius: 25px;
  328. background-color: #f00;
  329. }
  330. .tip {
  331. width: 37px;
  332. height: 20px;
  333. border-radius: 2px;
  334. background-color: rgba(255, 0, 0, 1);
  335. color: rgba(255, 255, 255, 1);
  336. font-size: 14px;
  337. text-align: center;
  338. }
  339. .drawer_top {
  340. margin: 0 20px;
  341. }
  342. .center {
  343. align-items: center;
  344. }
  345. .notice {
  346. box-sizing: content-box;
  347. margin: 0 10px 10px 10px;
  348. background-color: rgba(255, 255, 255, 1);
  349. height: calc(100% - 205px);
  350. box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4);
  351. overflow-x: hidden;
  352. &_item {
  353. width: calc(450px - 80px);
  354. margin: 20px;
  355. border-bottom: 1px solid #ebeef5;
  356. }
  357. }
  358. .icon {
  359. &_bell {
  360. text-align: right;
  361. cursor: pointer;
  362. }
  363. &_close {
  364. font-size: 25px;
  365. cursor: pointer;
  366. }
  367. }
  368. .drawer {
  369. height: 100%;
  370. display: flex;
  371. font-size: 14px;
  372. &_left {
  373. width: 450px;
  374. display: inline-block;
  375. }
  376. &_right {
  377. width: 450px;
  378. margin: 0 20px;
  379. display: inline-block;
  380. .radio {
  381. display: flex;
  382. justify-content: center;
  383. }
  384. &_content {
  385. height: 855px;
  386. padding: 0 2px;
  387. overflow-y: auto;
  388. &_item {
  389. display: flex;
  390. align-items: center;
  391. margin: 20px 0;
  392. padding: 0 10px;
  393. height: 84px;
  394. font-size: 14px;
  395. border-radius: 5px;
  396. background-color: rgba(255, 255, 255, 1);
  397. box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4);
  398. &_text {
  399. display: flex;
  400. flex-direction: column;
  401. justify-content: space-around;
  402. flex: 1 1;
  403. height: 84px;
  404. padding-left: 20px;
  405. line-height: 20px;
  406. }
  407. }
  408. }
  409. }
  410. }
  411. }
  412. ::v-deep .slidingBgClassName3 {
  413. background: rgba(0, 0, 0, 0.01) !important;
  414. }
  415. ::v-deep .slidingBlockClassName3 {
  416. background: rgba(0, 0, 0, 0.03) !important;
  417. }
  418. .item-data {
  419. width: 100%;
  420. height: 50px;
  421. display: flex;
  422. align-items: center;
  423. cursor: pointer;
  424. .item-tag {
  425. height: auto;
  426. box-sizing: border-box;
  427. padding: 6px;
  428. background: #e8fffb;
  429. color: #44D4D0;
  430. margin-right: 6px;
  431. line-height: normal;
  432. }
  433. .item-centor {
  434. line-height: normal;
  435. flex: 1;
  436. overflow: hidden;
  437. text-overflow: ellipsis;
  438. white-space: nowrap;
  439. font-size: 16px;
  440. flex-wrap: 500;
  441. .item-time {
  442. font-size: 12px;
  443. color: #aaa;
  444. margin-top: 5px;
  445. text-indent: .8em;
  446. }
  447. }
  448. &:hover {
  449. background: #e8fffb;
  450. }
  451. }
  452. ul {
  453. list-style: none;
  454. padding: 0;
  455. line-height: 20px;
  456. li {
  457. overflow: hidden;
  458. white-space: nowrap;
  459. text-overflow: ellipsis;
  460. }
  461. }
  462. .right-menu {
  463. height: 100%;
  464. line-height: 50px;
  465. &>div {
  466. float: left;
  467. }
  468. &:focus {
  469. outline: none;
  470. }
  471. .user-container {
  472. height: 50px;
  473. .user {
  474. i {
  475. font-size: 18px;
  476. margin-right: 5px;
  477. }
  478. span {
  479. font-size: 16px;
  480. }
  481. }
  482. }
  483. .right-menu-item {
  484. display: inline-block;
  485. padding: 0 15px;
  486. height: 100%;
  487. font-size: 18px;
  488. color: #{$navbarText};
  489. vertical-align: text-bottom;
  490. border-left: 1px solid #eaeaea;
  491. &.hover-effect {
  492. cursor: pointer;
  493. transition: background 0.3s;
  494. &:hover {
  495. background: rgba(0, 0, 0, 0.025);
  496. }
  497. }
  498. .notice-icon {
  499. padding-top: 0;
  500. padding-bottom: 0;
  501. }
  502. .right-menu-item {
  503. .notice-icon>i {
  504. font-size: 18px;
  505. }
  506. sup {
  507. top: 12px;
  508. right: 25px;
  509. }
  510. }
  511. }
  512. }
  513. .flex {
  514. display: flex;
  515. justify-content: space-between;
  516. }
  517. .dot_title {
  518. height: 40px;
  519. }
  520. .dot::before {
  521. content: '';
  522. display: inline-block;
  523. margin-right: 10px;
  524. padding: 5px;
  525. border-radius: 25px;
  526. background-color: #f00;
  527. }
  528. .tip {
  529. width: 37px;
  530. height: 20px;
  531. border-radius: 2px;
  532. background-color: rgba(255, 0, 0, 1);
  533. color: rgba(255, 255, 255, 1);
  534. font-size: 14px;
  535. text-align: center;
  536. }
  537. .drawer_top {
  538. margin: 0 20px;
  539. }
  540. .center {
  541. align-items: center;
  542. }
  543. .notice {
  544. box-sizing: content-box;
  545. margin: 0 20px;
  546. margin-top: 20px;
  547. background-color: rgba(255, 255, 255, 1);
  548. height: 690px;
  549. box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4);
  550. overflow-x: hidden;
  551. &_item {
  552. width: calc(450px - 80px);
  553. margin: 20px;
  554. border-bottom: 1px solid #ebeef5;
  555. }
  556. }
  557. .icon {
  558. &_bell {
  559. text-align: right;
  560. cursor: pointer;
  561. }
  562. &_close {
  563. font-size: 25px;
  564. cursor: pointer;
  565. }
  566. }
  567. .drawer {
  568. height: 100%;
  569. display: flex;
  570. font-size: 14px;
  571. &_left {
  572. width: 450px;
  573. display: inline-block;
  574. }
  575. &_right {
  576. width: 450px;
  577. margin: 0 20px;
  578. display: inline-block;
  579. .radio {
  580. display: flex;
  581. justify-content: center;
  582. }
  583. &_content {
  584. height: 855px;
  585. padding: 0 2px;
  586. overflow-y: auto;
  587. &_item {
  588. display: flex;
  589. align-items: center;
  590. margin: 20px 0;
  591. padding: 0 10px;
  592. height: 84px;
  593. font-size: 14px;
  594. border-radius: 5px;
  595. background-color: rgba(255, 255, 255, 1);
  596. box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4);
  597. &_text {
  598. display: flex;
  599. flex-direction: column;
  600. justify-content: space-around;
  601. flex: 1 1;
  602. height: 84px;
  603. padding-left: 20px;
  604. line-height: 20px;
  605. }
  606. }
  607. }
  608. }
  609. }
  610. .download {
  611. width: 595px;
  612. max-height: 327px;
  613. background-color: rgba(255, 255, 255, 1);
  614. .clear {
  615. cursor: pointer;
  616. }
  617. &_title {
  618. display: flex;
  619. justify-content: space-between;
  620. padding: 5px 15px;
  621. div:last-child {
  622. display: flex;
  623. justify-content: flex-end;
  624. flex: 0 350px;
  625. div {
  626. flex: 1;
  627. font-size: 14px;
  628. }
  629. div:last-child {
  630. flex: 1;
  631. text-align: right;
  632. }
  633. }
  634. }
  635. &_item {
  636. max-height: 280px;
  637. margin: 15px;
  638. overflow-y: auto;
  639. &_content {
  640. display: flex;
  641. justify-content: space-between;
  642. margin: 10px 0;
  643. padding-bottom: 5px;
  644. font-size: 14px;
  645. border-bottom: 1px solid rgba(204, 204, 204, 0.38);
  646. div:last-child {
  647. display: flex;
  648. justify-content: flex-end;
  649. flex: 0 350px;
  650. div {
  651. flex: 1;
  652. }
  653. div:last-child {
  654. flex: 1;
  655. text-align: right;
  656. }
  657. }
  658. }
  659. }
  660. }
  661. .el-dropdown-menu {
  662. padding: 0 !important;
  663. margin: 0 !important;
  664. z-index: 9999 !important;
  665. }
  666. ::v-deep .el-dropdown-menu__item.is-disabled {
  667. color: #000;
  668. padding: 20px;
  669. border-bottom: 1px solid #EBEEF5;
  670. }
  671. .yidong {
  672. ::v-deep .el-dropdown-menu__item {
  673. padding: 0;
  674. }
  675. }
  676. ::v-deep ul>li:last-child {
  677. border-bottom: none !important;
  678. }
  679. .QRcode {
  680. display: flex;
  681. flex-direction: row;
  682. align-items: center;
  683. }
  684. .QRcode-img {
  685. width: 120px;
  686. height: 120px;
  687. margin-right: 5px;
  688. border: 1px solid #EBEEF5;
  689. }
  690. .shouji-icon {
  691. width: 40px;
  692. height: 40px;
  693. margin-right: 10px;
  694. }
  695. .liveTitle {
  696. color: #f00;
  697. }</style>