123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- import { getStorage } from '@/common/storage.js'
- import { fetchMessageList, authDeleteMessage, authUpdateMessageAsRead } from '@/services/api/notice.js'
- // 机构通知消息
- const noticeMixins = {
- data () {
- return {
- params: {
- pageSize: 10,
- pageNum: 1,
- commonId: 0,
- messageType: 1
- },
- dataValue: [],
- isRequest: true,
- isEmpty: false,
- loadding: true,
- pullUpOn: true,
- pullFlag: true,
- hasNextPage: false,
- nomoreText: '上拉显示更多',
- showLoading: true
- }
- },
- filters: {
- noticeOrderFilters(value) {
- // 交易物流状态显示 1.下单成功通知 2.订单支付完成 3.退款/货成功通知 4.订单取消通知 5.订单发货通知 6.自动收货通知
- const map = {
- 1: '下单成功通知',
- 2: '订单支付完成',
- 3: '退款/货成功通知',
- 4: '订单取消通知',
- 5: '订单发货通知',
- 6: '自动收货通知'
- }
- return map[value]
- },
- noticeUsersFilters(value) {
- // 账户通知状态 1.注册成功通知 2.购买超级会员成功 3.超级会员到期提醒 4.超级会员到期提醒 5.升级资质机构成功 6.升级资质机构失败 7.成为机构运营人员通知
- const map = {
- 1: '注册成功通知',
- 2: '购买超级会员成功',
- 3: '超级会员到期提醒',
- 4: '系统赠送超级会员',
- 5: '升级资质机构成功',
- 6: '升级资质机构失败',
- 7: '成为机构运营人员通知'
- }
- return map[value]
- },
- noticeCouponFilters(value) {
- // 优惠券通知状态 1.优惠券待领取通知 2.优惠券过期通知
- const map = {
- 1: '优惠券待领取通知',
- 2: '优惠券过期通知',
- 3: '优惠券即将过期通知'
- }
- return map[value]
- }
- },
- methods: {
- async getUserAuthClubMessageList() {
- uni.showLoading({
- title: 'loading'
- })
- this.params.commonId = getStorage('USER_INFO').userId || 0
- const { data } = await fetchMessageList(this.params)
- this.dataValue = [...this.dataValue, ...data.list]
- this.isRequest = false
- this.hasNextPage = data.hasNextPage
- this.pullUpOn = false
- this.loadding = false
- this.showLoading = false
- if (this.dataValue.length > 0) {
- if (this.hasNextPage) {
- this.nomoreText = '上拉显示更多'
- } else {
- this.nomoreText = '到底了~'
- }
- } else {
- this.isEmpty = true
- }
- uni.hideLoading()
- },
- async deleteBtn(id,index) {
- // 删除通知消息
- try {
- await authDeleteMessage({ id, isConfig: true })
- this.params.pageSize = this.params.pageNum * this.params.pageSize
- this.params.pageNum = 1
- this.dataValue = []
- await this.getUserAuthClubMessageList()
- } catch(e) {
- console.log(e)
- }
- },
- async clearCellNew (Id) {
- await authUpdateMessageAsRead({ userType: 4, Id, isConfig: true })
- },
- noticeOrderText(cell) { // 交易物流通知文案
- const map = {
- 1: '您已成功下单!',
- 2: '您的订单已支付完成,将立即安排发货!',
- 3: `您的订单已${cell.refundType === 1 ? '部分退' : '全部退'}款/货成功!退款金额¥${cell.content},到账时间可能存在延迟,具体以支付方通知为准。`,
- 4: `${cell.content}`,
- 5: '您的订单已发货,请您留意物流变化!',
- 6: '您的订单因超时已被系统自动确认收货!'
- }
- return map[cell.orderMessageType]
- },
- noticeUsersText(cell) { // 账户通知文案
- const map = {
- 1: '欢迎成为采美机构用户,祝您开启愉快的采购之旅。',
- 2: `您已成功购买${cell.content}采美平台超级会员服务,在服务期内每月可领多张大额优惠券,还有更多超级会员专属权益等您体验,快去看看吧 >>>`,
- 3: `您的超级会员服务将于${cell.content}到期,到期后将无法享受专属会员权益,赶快去续费吧 >>>`,
- 4: `您已获得采美平台赠送的${cell.content}超级会员,在服务期内每月可领多张大额优惠券,还有更多超级会员专属权益等您体验,快去看看吧 >>>`,
- 5: '恭喜您成功升级为资质机构用户!现在可以查看更多商品的信息啦,采美平台也将为您提供更多专业服务。',
- 6: '您的账号升级资质机构失败!赶快去修改资料重新提交吧 >>>',
- 7: `恭喜您(微信昵称:${cell.content})成功成为机构运营人员,祝您开启愉快的采购之旅。`
- }
- return map[cell.accountType]
- },
- noticeCouponText(cell) { // 优惠促销通知文案
- const copunMap = {
- 0: `${cell.couponFee}元优惠券已派送到您的领券中心,快去领取下单吧。`,
- 2: `为了感谢您长久以来的支持,现已派送${cell.couponFee}元优惠券到您的领券中心,快去领取下单吧。`,
- 4: `恭喜您成功注册登录。现赠送${cell.couponFee}元优惠券到您的领券中心,快去领取下单吧。`,
- 5: `恭喜您成功邀请一位好友注册登录,现赠送${cell.couponFee}元优惠券到您的领券中心,快去领取下单吧。`,
- 6: `恭喜您邀请的好友已成功消费一笔订单,现赠送${cell.couponFee}元优惠券到您的领券中心,快去领取下单吧。`,
- }
- const map = {
- 1: copunMap[cell.couponType],
- 2: `您有${cell.couponFee}元优惠券将于${cell.content}过期,快去使用吧。`,
- 3: `您有${cell.couponFee}元优惠券尚未领取,优惠券即将失效,快去领取下单吧。`,
- }
- return map[cell.couponMessageType]
- }
- }
- }
- export default noticeMixins
|