notice_mixins.js 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. // 机构通知消息
  2. const noticeMixins = {
  3. filters: {
  4. noticeOrderFilters(value) {
  5. // 交易物流状态显示 1.下单成功通知 2.订单支付完成 3.退款/货成功通知 4.订单取消通知 5.订单发货通知 6.自动收货通知
  6. const map = {
  7. 1: '下单成功通知',
  8. 2: '订单支付完成',
  9. 3: '退款/货成功通知',
  10. 4: '订单取消通知',
  11. 5: '订单发货通知',
  12. 6: '自动收货通知'
  13. }
  14. return map[value]
  15. },
  16. noticeUsersFilters(value) {
  17. // 账户通知状态 1.注册成功通知 2.购买超级会员成功 3.超级会员到期提醒 4.超级会员到期提醒 5.升级资质机构成功 6.升级资质机构失败 7.成为机构运营人员通知
  18. const map = {
  19. 1: '注册成功通知',
  20. 2: '购买超级会员成功',
  21. 3: '超级会员到期提醒',
  22. 4: '系统赠送超级会员',
  23. 5: '升级资质机构成功',
  24. 6: '升级资质机构失败',
  25. 7: '成为机构运营人员通知'
  26. }
  27. return map[value]
  28. },
  29. noticeCouponFilters(value) {
  30. // 优惠券通知状态 1.优惠券待领取通知 2.优惠券过期通知
  31. const map = {
  32. 1: '优惠券待领取通知',
  33. 2: '优惠券过期通知',
  34. 3: '优惠券待领取通知'
  35. }
  36. return map[value]
  37. }
  38. },
  39. methods: {
  40. getUserAuthClubMessageList() {
  41. this.UserService.getUserAuthClubMessageList(this.listQuery)
  42. .then(response => {
  43. let data = response.data
  44. this.hasNextPage = response.data.hasNextPage
  45. if (data.list && data.list.length > 0) {
  46. this.isEmpty = false
  47. this.list = [...data.list]
  48. this.pullFlag = false
  49. setTimeout(() => {
  50. this.pullFlag = true
  51. }, 500)
  52. if (this.hasNextPage) {
  53. this.pullUpOn = false
  54. this.nomoreText = '上拉显示更多'
  55. } else {
  56. if (this.list.length < 5) {
  57. this.pullUpOn = true
  58. this.loadding = false
  59. } else {
  60. this.pullUpOn = false
  61. this.loadding = false
  62. this.nomoreText = '到底了~'
  63. }
  64. }
  65. } else {
  66. this.isEmpty = true
  67. }
  68. this.skeletonShow = false
  69. })
  70. .catch(error => {
  71. this.$util.msg(error.msg, 2000)
  72. })
  73. },
  74. getReachBottomData() {
  75. this.pullUpOn = false
  76. this.loadding = false
  77. //上拉加载
  78. this.listQuery.pageNum += 1
  79. this.UserService.getUserAuthClubMessageList(this.listQuery)
  80. .then(response => {
  81. let data = response.data
  82. if (data.list && data.list.length > 0) {
  83. this.hasNextPage = data.hasNextPage
  84. this.list = this.list.concat(data.list)
  85. this.pullFlag = false // 防上拉暴滑
  86. setTimeout(() => {
  87. this.pullFlag = true
  88. }, 500)
  89. if (this.hasNextPage) {
  90. this.pullUpOn = false
  91. this.nomoreText = '上拉显示更多'
  92. } else {
  93. this.pullUpOn = false
  94. this.loadding = false
  95. this.nomoreText = '到底了~'
  96. }
  97. }
  98. })
  99. .catch(error => {
  100. this.$util.msg(error.msg, 2000)
  101. })
  102. },
  103. deleteBtn(id,index) {
  104. // 删除通知消息
  105. this.UserService.authDeleteMessage({ id: id })
  106. .then(response => {
  107. let _this = this
  108. uni.vibrateShort({
  109. success: function() {
  110. _this.listQuery.pageNum = 1
  111. _this.getUserAuthClubMessageList()
  112. // _this.list.splice(index, 1)
  113. }
  114. })
  115. })
  116. .catch(error => {
  117. console.log('error=>', error.msg)
  118. })
  119. },
  120. noticeOrderText(cell) { // 交易物流通知文案
  121. const map = {
  122. 1: '您已成功下单!',
  123. 2: '您的订单已支付完成,将立即安排发货!',
  124. 3: `您的订单已${cell.refundType === 1 ? '部分退' : '全部退'}款/货成功!退款金额¥${cell.content},到账时间可能存在延迟,具体以支付方通知为准。`,
  125. 4: `${cell.content}`,
  126. 5: '您的订单已发货,请您留意物流变化!',
  127. 6: '您的订单因超时已被系统自动确认收货!'
  128. }
  129. return map[cell.orderMessageType]
  130. },
  131. noticeUsersText(cell) { // 账户通知文案
  132. const map = {
  133. 1: '欢迎成为采美机构用户,祝您开启愉快的采购之旅。',
  134. 2: `您已成功购买${cell.content}采美平台超级会员服务,在服务期内每月可领多张大额优惠券,还有更多超级会员专属权益等您体验,快去看看吧 >>>`,
  135. 3: `您的超级会员服务将于${cell.content}到期,到期后将无法享受专属会员权益,赶快去续费吧 >>>`,
  136. 4: `您已获得采美平台赠送的${cell.content}超级会员,在服务期内每月可领多张大额优惠券,还有更多超级会员专属权益等您体验,快去看看吧 >>>`,
  137. 5: '恭喜您成功升级为资质机构用户!现在可以查看更多商品的信息啦,采美平台也将为您提供更多专业服务。',
  138. 6: '您的账号升级资质机构失败!赶快去修改资料重新提交吧 >>>',
  139. 7: `恭喜您(微信昵称:${cell.content})成功成为机构运营人员,祝您开启愉快的采购之旅。`
  140. }
  141. return map[cell.accountType]
  142. },
  143. noticeCouponText(cell) { // 优惠促销通知文案
  144. const copunMap = {
  145. 0: `采美平台送您${cell.couponFee}元优惠券,众多大牌正品等着您,赶快去领取下单吧 >>>`,
  146. 1: `采美平台${cell.content}类商品大优惠,特送您${cell.couponFee}元优惠券,赶快去领取下单吧 >>>`,
  147. 2: `为了答谢您对采美平台的支持,采美送您${cell.couponFee}元优惠券,赶快去领取下单吧 >>>`,
  148. 3: `【${cell.content}】赠送您${cell.couponFee}元的店铺专属优惠券,众多火爆商品等您来!赶快去领取下单吧 >>>`,
  149. 4: `恭喜成功注册采美平台,现赠送您${cell.couponFee}元新用户优惠券,赶快去领取下单吧 >>>`,
  150. }
  151. const map = {
  152. 1: copunMap[cell.couponType],
  153. 2: `您有${cell.couponFee}元优惠券将于${cell.content}过期,赶快去查看使用吧 >>>`,
  154. 3: `您有${cell.couponFee}元优惠券尚未领取,优惠券将于${cell.content}后下架,赶快去领取下单吧 >>>`,
  155. }
  156. return map[cell.couponMessageType]
  157. }
  158. }
  159. }
  160. export default noticeMixins