123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878 |
- <template>
- <div>
- <!-- <div class="right-menu-item hover-effect" @click="handleDrawer">
- <i class="el-icon-message-solid" style="font-size: 24px; line-height: 50px" />
- <el-badge v-if='allUnreadNum > 0' class="mark" :value="allUnreadNum" />
- </div> -->
- <el-dropdown v-if="QRcodeList.length" class="user-container yidong">
- <div class="user right-menu-item hover-effect">
- <span>移动端</span>
- </div>
- <el-dropdown-menu slot="dropdown" class="user-dropdown">
- <el-dropdown-item v-for="(item, index) in QRcodeList" :key="index">
- <div class="QRcode">
- <el-image
- class="QRcode-img"
- :src="$showImgUrl(item.codeUrl)"
- :preview-src-list="[$showImgUrl(item.codeUrl)]"
- fit="fill"
- ></el-image>
- <div>
- <div>{{ item.name }}</div>
- <div class="liveTitle">{{ item.saleName }}</div>
- <div>
- <el-image
- v-if="$showImgUrl(item.iosIcon)"
- class="shouji-icon"
- :src="item.iosIcon"
- fit="fill"
- ></el-image>
- <el-image
- v-if="$showImgUrl(item.androidIcon)"
- class="shouji-icon"
- :src="item.androidIcon"
- fit="fill"
- ></el-image>
- </div>
- </div>
- </div>
- </el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- <el-drawer
- size="450px"
- :with-header="false"
- :show-close="false"
- :visible.sync="drawer"
- direction="rtl"
- :modal="false"
- >
- <div class="drawer">
- <div :offset="0" class="drawer_left">
- <div class="drawer_top">
- <div class="flex center">
- <div class="radio">状态筛选标签</div>
- <div class="icon_close">
- <i class="el-icon-close" @click="guanbi" />
- </div>
- </div>
- <div>
- <el-button :type="pam.read_flag == '' ? 'primary' : null" size="mini" @click="hadleRead(0)"
- >全部</el-button
- >
- <el-button :type="pam.read_flag == 'NO' ? 'primary' : null" size="mini" @click="hadleRead(1)"
- >未读</el-button
- >
- <el-badge :value="allUnreadNum" class="item" />
- <el-button :type="pam.read_flag == 'YES' ? 'primary' : null" size="mini" @click="hadleRead(2)"
- >已读</el-button
- >
- </div>
- <el-tabs v-model="pam.type" @tab-click="handleClick">
- <el-tab-pane label="通知" name="N"></el-tab-pane>
- <el-tab-pane label="活动" name="A"></el-tab-pane>
- <el-tab-pane label="公告" name="B"></el-tab-pane>
- </el-tabs>
- </div>
- <div v-loading="loading" class="notice" style="position: relative">
- <div style="position: absolute; top: 0; bottom: 0; left: 0; right: 0">
- <v-scroll-view
- :x="false"
- :y="true"
- slidingBgClassName="slidingBgClassName3"
- slidingBlockClassName="slidingBlockClassName3"
- >
- <div style="box-sizing: border-box; padding: 10px">
- <div
- v-if="dataList.length"
- class="item-data"
- v-for="(item, index) in dataList"
- :key="index"
- @click="opendomview(item)"
- >
- <div class="item-tag">{{ ['活动', '公告', '通知'][['A', 'B', 'N'].indexOf(item.type)] }}</div>
- <div class="item-centor">
- <div class="item-centor">{{ item.content }}</div>
- <div class="item-time">{{ item.issueTime }}</div>
- </div>
- </div>
- <el-empty v-if="!dataList.length" description="暂无数据"></el-empty>
- </div>
- </v-scroll-view>
- </div>
- </div>
- <el-pagination
- layout="total, prev, pager, next"
- :total="total"
- small
- :page-size="pam.pageSize"
- :current-page="pam.pageNum"
- @current-change="currentChange"
- />
- </div>
- </div>
- </el-drawer>
- <el-drawer
- :title="showRow.title"
- :visible.sync="dialogVisible"
- direction="rtl"
- :before-close="dialogVisibleGuanbi"
- size="450px"
- :modal="false"
- >
- <el-card class="box-card">
- <div v-html="showRow.content"></div>
- </el-card>
- </el-drawer>
- </div>
- </template>
- <script>
- import { mapMutations, mapActions, mapGetters } from 'vuex'
- import vScrollView from 'v-scroll-view'
- // import { notifyMyList, notifyMyRead } from '@/api/notificationCenter/eventAnnouncement'
- import { EventBus } from '@/utils/eventBus'
- import { commonCompanywechatGet } from '@/api/common'
- export default {
- components: { vScrollView },
- data() {
- return {
- drawer: false,
- dataList: [],
- loading: false,
- total: 0,
- pam: {
- type: 'N',
- read_flag: '',
- pageNum: 1,
- pageSize: 20
- },
- dialogVisible: false,
- showRow: {},
- QRcodeList: []
- }
- },
- computed: {
- ...mapGetters(['allUnreadNum']),
- // 用户信息
- userInfo() {
- return JSON.parse(localStorage.getItem('greemall_user'))
- }
- },
- mounted() {
- EventBus.$on('opendomview', this.opendomview)
- EventBus.$on('handleDrawerabcde', this.handleDrawer)
- var this_ = this
- if (this.timeId) {
- clearTimeout(this.timeId)
- }
- ;(function dingshiqingqiu() {
- this_.updateUnreadNotice()
- this_.timeId = setTimeout(dingshiqingqiu, 2000)
- })()
- commonCompanywechatGet({ id: this.userInfo?.companyWechatId, returnErr: true }).then(res => {
- console.log(res)
- this.QRcodeList = []
- if (res?.data?.qrcode1) {
- this.QRcodeList.push({
- codeUrl: res.data.qrcode1,
- name: '小程序',
- saleName: '',
- iosIcon:
- 'https://zf-mall.oss-cn-shenzhen.aliyuncs.com/2024-03/17115930219681afd35b0-8c93-400a-94f8-e49277c88616.png',
- androidIcon:
- 'https://zf-mall.oss-cn-shenzhen.aliyuncs.com/2024-03/1711593045466d069e7f6-5c77-40a0-a7b3-6e2b3a6ce0eb.png'
- })
- }
- if (res?.data?.qrcode2) {
- this.QRcodeList.push({
- codeUrl: res.data.qrcode2,
- name: '公众号',
- saleName: '',
- iosIcon:
- 'https://zf-mall.oss-cn-shenzhen.aliyuncs.com/2024-03/17115930219681afd35b0-8c93-400a-94f8-e49277c88616.png',
- androidIcon:
- 'https://zf-mall.oss-cn-shenzhen.aliyuncs.com/2024-03/1711593045466d069e7f6-5c77-40a0-a7b3-6e2b3a6ce0eb.png'
- })
- }
- if (res?.data?.payQrcode) {
- this.QRcodeList.push({
- codeUrl: res.data.payQrcode,
- name: '收款码',
- saleName: '',
- iosIcon:
- 'https://zf-mall.oss-cn-shenzhen.aliyuncs.com/2024-03/17115930219681afd35b0-8c93-400a-94f8-e49277c88616.png',
- androidIcon:
- 'https://zf-mall.oss-cn-shenzhen.aliyuncs.com/2024-03/1711593045466d069e7f6-5c77-40a0-a7b3-6e2b3a6ce0eb.png'
- })
- }
- })
- },
- beforeDestroy() {
- if (this.timeId) {
- clearTimeout(this.timeId)
- }
- },
- watch: {
- pam: {
- handler(newVal, oldVal) {
- this.getMessageList()
- },
- deep: true
- }
- },
- methods: {
- ...mapMutations({
- SET_SHOW: 'app/SET_SHOW'
- }),
- ...mapActions({
- updateUnreadNotice: 'app/getUnreadNum'
- }),
- handleClick(val) {
- console.log(val)
- },
- opendomview(row) {
- this.showRow = row
- this.dialogVisible = true
- // notifyMyRead({
- // id:row.id
- // }).then(res=>{
- // this.updateUnreadNotice()
- // if(this.drawer){
- // this.getMessageList()
- // }
- // })
- },
- dialogVisibleGuanbi() {
- this.showRow = {}
- this.dialogVisible = false
- },
- // 数据处理
- getMessageList() {
- // notifyMyList({
- // "pageNum": this.pam.pageNum,
- // "pageSize": this.pam.pageSize,
- // "params": (()=>{
- // var arr = []
- // if(this.pam.read_flag){
- // arr.push({ "param": "a.read_flag", "compare": "=", "value": this.pam.read_flag })
- // }
- // if(this.pam.type){
- // arr.push({ "param": "a.type", "compare": "=", "value": this.pam.type })
- // }
- // return arr
- // })(),
- // "moduleId": "486084326453317-teshu"
- // }).then(res => {
- // this.dataList = res.data.records
- // this.total = res.data.total
- // })
- },
- currentChange(v) {
- this.pam.pageNum = v
- },
- // 打开消息弹窗
- handleDrawer() {
- this.drawer = true
- this.getMessageList()
- },
- guanbi() {
- this.drawer = false
- this.pam = {
- read_flag: '',
- pageNum: 1,
- pageSize: 20
- }
- },
- // 状态筛选标签
- hadleRead(index) {
- this.dataList = []
- this.pam.read_flag = ['', 'NO', 'YES'][index]
- this.pam.pageNum = 1
- this.getMessageList()
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- @import '~@/styles/variables.scss';
- .item {
- margin-left: -10px;
- margin-top: -10px;
- }
- .notice_tip {
- font-size: 16px;
- }
- ::v-deep .slidingBgClassName {
- background: rgba(0, 0, 0, 0.0075) !important;
- }
- ::v-deep .slidingBlockClassName {
- background: rgba(0, 0, 0, 0.0125) !important;
- }
- ::v-deep .el-drawer .el-drawer__body {
- overflow: hidden !important;
- }
- .navbar {
- width: 100%;
- height: 50px;
- overflow: hidden;
- background: #{$navbarBg};
- box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
- display: flex;
- flex-direction: row;
- align-items: center;
- .hamburger-container {
- line-height: 46px;
- height: 100%;
- color: #{$navbarText};
- cursor: pointer;
- transition: background 0.3s;
- -webkit-tap-highlight-color: transparent;
- border-right: 1px solid #eaeaea;
- &:hover {
- background: rgba(0, 0, 0, 0.025);
- }
- }
- ul {
- list-style: none;
- padding: 0;
- line-height: 20px;
- li {
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- }
- .right-menu {
- height: 100%;
- line-height: 50px;
- & > div {
- float: left;
- }
- &:focus {
- outline: none;
- }
- .user-container {
- height: 50px;
- .user {
- i {
- font-size: 18px;
- margin-right: 5px;
- }
- span {
- font-size: 16px;
- }
- }
- }
- .right-menu-item {
- display: inline-block;
- padding: 0 15px;
- height: 100%;
- font-size: 18px;
- color: #{$navbarText};
- vertical-align: text-bottom;
- border-left: 1px solid #eaeaea;
- &.hover-effect {
- cursor: pointer;
- transition: background 0.3s;
- &:hover {
- background: rgba(0, 0, 0, 0.025);
- }
- }
- .notice-icon {
- padding-top: 0;
- padding-bottom: 0;
- }
- .right-menu-item {
- .notice-icon > i {
- font-size: 18px;
- }
- sup {
- top: 12px;
- right: 25px;
- }
- }
- }
- }
- .flex {
- display: flex;
- justify-content: space-between;
- }
- .dot_title {
- height: 40px;
- }
- .dot::before {
- content: '';
- display: inline-block;
- margin-right: 10px;
- padding: 5px;
- border-radius: 25px;
- background-color: #f00;
- }
- .tip {
- width: 37px;
- height: 20px;
- border-radius: 2px;
- background-color: rgba(255, 0, 0, 1);
- color: rgba(255, 255, 255, 1);
- font-size: 14px;
- text-align: center;
- }
- .drawer_top {
- margin: 0 20px;
- }
- .center {
- align-items: center;
- }
- .notice {
- box-sizing: content-box;
- margin: 0 10px 10px 10px;
- background-color: rgba(255, 255, 255, 1);
- height: calc(100% - 205px);
- box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4);
- overflow-x: hidden;
- &_item {
- width: calc(450px - 80px);
- margin: 20px;
- border-bottom: 1px solid #ebeef5;
- }
- }
- .icon {
- &_bell {
- text-align: right;
- cursor: pointer;
- }
- &_close {
- font-size: 25px;
- cursor: pointer;
- }
- }
- .drawer {
- height: 100%;
- display: flex;
- font-size: 14px;
- &_left {
- width: 450px;
- display: inline-block;
- }
- &_right {
- width: 450px;
- margin: 0 20px;
- display: inline-block;
- .radio {
- display: flex;
- justify-content: center;
- }
- &_content {
- height: 855px;
- padding: 0 2px;
- overflow-y: auto;
- &_item {
- display: flex;
- align-items: center;
- margin: 20px 0;
- padding: 0 10px;
- height: 84px;
- font-size: 14px;
- border-radius: 5px;
- background-color: rgba(255, 255, 255, 1);
- box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4);
- &_text {
- display: flex;
- flex-direction: column;
- justify-content: space-around;
- flex: 1 1;
- height: 84px;
- padding-left: 20px;
- line-height: 20px;
- }
- }
- }
- }
- }
- }
- ::v-deep .slidingBgClassName3 {
- background: rgba(0, 0, 0, 0.01) !important;
- }
- ::v-deep .slidingBlockClassName3 {
- background: rgba(0, 0, 0, 0.03) !important;
- }
- .item-data {
- width: 100%;
- height: 50px;
- display: flex;
- align-items: center;
- cursor: pointer;
- .item-tag {
- height: auto;
- box-sizing: border-box;
- padding: 6px;
- background: #e8fffb;
- color: #44d4d0;
- margin-right: 6px;
- line-height: normal;
- }
- .item-centor {
- line-height: normal;
- flex: 1;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- font-size: 16px;
- flex-wrap: 500;
- .item-time {
- font-size: 12px;
- color: #aaa;
- margin-top: 5px;
- text-indent: 0.8em;
- }
- }
- &:hover {
- background: #e8fffb;
- }
- }
- ul {
- list-style: none;
- padding: 0;
- line-height: 20px;
- li {
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- }
- .right-menu {
- height: 100%;
- line-height: 50px;
- & > div {
- float: left;
- }
- &:focus {
- outline: none;
- }
- .user-container {
- height: 50px;
- .user {
- i {
- font-size: 18px;
- margin-right: 5px;
- }
- span {
- font-size: 16px;
- }
- }
- }
- .right-menu-item {
- display: inline-block;
- padding: 0 15px;
- height: 100%;
- font-size: 18px;
- color: #{$navbarText};
- vertical-align: text-bottom;
- border-left: 1px solid #eaeaea;
- &.hover-effect {
- cursor: pointer;
- transition: background 0.3s;
- &:hover {
- background: rgba(0, 0, 0, 0.025);
- }
- }
- .notice-icon {
- padding-top: 0;
- padding-bottom: 0;
- }
- .right-menu-item {
- .notice-icon > i {
- font-size: 18px;
- }
- sup {
- top: 12px;
- right: 25px;
- }
- }
- }
- }
- .flex {
- display: flex;
- justify-content: space-between;
- }
- .dot_title {
- height: 40px;
- }
- .dot::before {
- content: '';
- display: inline-block;
- margin-right: 10px;
- padding: 5px;
- border-radius: 25px;
- background-color: #f00;
- }
- .tip {
- width: 37px;
- height: 20px;
- border-radius: 2px;
- background-color: rgba(255, 0, 0, 1);
- color: rgba(255, 255, 255, 1);
- font-size: 14px;
- text-align: center;
- }
- .drawer_top {
- margin: 0 20px;
- }
- .center {
- align-items: center;
- }
- .notice {
- box-sizing: content-box;
- margin: 0 20px;
- margin-top: 20px;
- background-color: rgba(255, 255, 255, 1);
- height: 690px;
- box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4);
- overflow-x: hidden;
- &_item {
- width: calc(450px - 80px);
- margin: 20px;
- border-bottom: 1px solid #ebeef5;
- }
- }
- .icon {
- &_bell {
- text-align: right;
- cursor: pointer;
- }
- &_close {
- font-size: 25px;
- cursor: pointer;
- }
- }
- .drawer {
- height: 100%;
- display: flex;
- font-size: 14px;
- &_left {
- width: 450px;
- display: inline-block;
- }
- &_right {
- width: 450px;
- margin: 0 20px;
- display: inline-block;
- .radio {
- display: flex;
- justify-content: center;
- }
- &_content {
- height: 855px;
- padding: 0 2px;
- overflow-y: auto;
- &_item {
- display: flex;
- align-items: center;
- margin: 20px 0;
- padding: 0 10px;
- height: 84px;
- font-size: 14px;
- border-radius: 5px;
- background-color: rgba(255, 255, 255, 1);
- box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4);
- &_text {
- display: flex;
- flex-direction: column;
- justify-content: space-around;
- flex: 1 1;
- height: 84px;
- padding-left: 20px;
- line-height: 20px;
- }
- }
- }
- }
- }
- .download {
- width: 595px;
- max-height: 327px;
- background-color: rgba(255, 255, 255, 1);
- .clear {
- cursor: pointer;
- }
- &_title {
- display: flex;
- justify-content: space-between;
- padding: 5px 15px;
- div:last-child {
- display: flex;
- justify-content: flex-end;
- flex: 0 350px;
- div {
- flex: 1;
- font-size: 14px;
- }
- div:last-child {
- flex: 1;
- text-align: right;
- }
- }
- }
- &_item {
- max-height: 280px;
- margin: 15px;
- overflow-y: auto;
- &_content {
- display: flex;
- justify-content: space-between;
- margin: 10px 0;
- padding-bottom: 5px;
- font-size: 14px;
- border-bottom: 1px solid rgba(204, 204, 204, 0.38);
- div:last-child {
- display: flex;
- justify-content: flex-end;
- flex: 0 350px;
- div {
- flex: 1;
- }
- div:last-child {
- flex: 1;
- text-align: right;
- }
- }
- }
- }
- }
- .el-dropdown-menu {
- padding: 0 !important;
- margin: 0 !important;
- z-index: 9999 !important;
- }
- ::v-deep .el-dropdown-menu__item.is-disabled {
- color: #000;
- padding: 20px;
- border-bottom: 1px solid #ebeef5;
- }
- .yidong {
- ::v-deep .el-dropdown-menu__item {
- padding: 0;
- }
- }
- ::v-deep ul > li:last-child {
- border-bottom: none !important;
- }
- .QRcode {
- display: flex;
- flex-direction: row;
- align-items: center;
- margin-bottom: 20px;
- }
- .QRcode-img {
- width: 120px;
- height: 120px;
- margin-right: 5px;
- border: 1px solid #ebeef5;
- }
- .shouji-icon {
- width: 40px;
- height: 40px;
- margin-right: 10px;
- }
- .liveTitle {
- color: #f00;
- }
- </style>
|