notice.mixins.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. // 机构通知消息
  2. const noticeMixins = {
  3. data() {
  4. },
  5. filters: {
  6. noticeUsersFilters(value) { // 账户通知状态
  7. const map = {
  8. 1: '账号审核通知',
  9. 2: '成为公司运营人员通知',
  10. 3: '商品上架审核通知',
  11. 4: '新品展示审核通知',
  12. 5: '商品资质到期通知'
  13. }
  14. return map[value]
  15. },
  16. noticeServeFilters(value) { // 账户通知状态
  17. const map = {
  18. 1: '上架费到期通知'
  19. }
  20. return map[value]
  21. }
  22. },
  23. methods: {
  24. getUserAuthShopMessageList() {
  25. this.ShopService.getUserAuthShopMessageList(this.listQuery)
  26. .then(response => {
  27. let data = response.data
  28. this.hasNextPage = response.data.hasNextPage
  29. if (data.list && data.list.length > 0) {
  30. this.isEmpty = false
  31. this.list = [...data.list]
  32. this.pullFlag = false
  33. setTimeout(() => {
  34. this.pullFlag = true
  35. }, 500)
  36. if (this.hasNextPage) {
  37. this.pullUpOn = false
  38. this.nomoreText = '上拉显示更多'
  39. } else {
  40. if (this.list.length < 3) {
  41. this.pullUpOn = true
  42. this.loadding = false
  43. } else {
  44. this.pullUpOn = false
  45. this.loadding = false
  46. this.nomoreText = '到底了'
  47. }
  48. }
  49. } else {
  50. this.isEmpty = true
  51. }
  52. this.skeletonShow = false
  53. })
  54. .catch(error => {
  55. this.$util.msg(error.msg, 2000)
  56. })
  57. },
  58. getReachBottomData(index) {
  59. //上拉加载
  60. this.listQuery.pageNum += 1
  61. this.ShopService.getUserAuthShopMessageList(this.listQuery)
  62. .then(response => {
  63. let data = response.data
  64. if (data.list && data.list.length > 0) {
  65. this.hasNextPage = data.hasNextPage
  66. this.list = this.list.concat(data.list)
  67. this.pullFlag = false // 防上拉暴滑
  68. setTimeout(() => {
  69. this.pullFlag = true
  70. }, 500)
  71. if (this.hasNextPage) {
  72. this.pullUpOn = false
  73. this.nomoreText = '上拉显示更多'
  74. } else {
  75. this.pullUpOn = false
  76. this.loadding = false
  77. this.nomoreText = '已至底部'
  78. }
  79. }
  80. })
  81. .catch(error => {
  82. this.$util.msg(error.msg, 2000)
  83. })
  84. },
  85. deleteBtn(id, index) {
  86. // 删除通知消息
  87. this.UserService.authDeleteMessage({ id: id })
  88. .then(response => {
  89. let _this = this
  90. uni.vibrateShort({
  91. success: function() {
  92. _this.list.splice(index, 1)
  93. }
  94. })
  95. })
  96. .catch(error => {
  97. console.log('error=>', error.msg)
  98. })
  99. },
  100. noticeUsersText(cell) { // 账户通知文案
  101. const map = {
  102. 1: '您的注册信息已审核通过,恭喜您成为采美平台供应商用户。您可以上架商品到采美商城进行出售了',
  103. 2: `恭喜您(微信昵称:${cell.content})成功成为【${cell.shopName}】的运营人员。`,
  104. 3: '该商品上架审核未通过,暂时不能上架采美商城。请登录采美网站修改商品资料重新提交。',
  105. 4: '该商品新品展示审核未通过,未能展示在采美商城新品橱窗。',
  106. 5: `该商品的资质证书将于${cell.content}后失效,请及时登录采美网站上传新证书。`
  107. }
  108. return map[cell.shopMessType]
  109. },
  110. noticeServeText(cell) { // 服务通知文案
  111. const map = {
  112. 1: `您的供应商账号上架费将于${cell.content},到期后将无法发布和编辑商品,同时也会影响到其他采美提供的支持服务。请联系采美工作人员进行续费,联系电话0755-22907771 或15338851365`
  113. }
  114. return map[cell.shopTieredType]
  115. }
  116. }
  117. }
  118. export default noticeMixins