index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <!-- 系统消息页面 -->
  3. <view class="header">
  4. <view class="content" v-for="(item,index) in orderList" :key="index">
  5. <view class="content-one">
  6. <text class="content-one-first">{{item.msgTitle}}</text>
  7. <text class="content-one-second">{{item.data}}</text>
  8. </view>
  9. <!-- 中间的虚线 -->
  10. <view class="content-two">
  11. </view>
  12. <text class="content-three">
  13. {{msgContent.replace(/<[^>]+>/g,"")}}
  14. </text>
  15. <view class="content-five" @click="inDetails" v-if="item.sendUserId==17||item.sendUserId==19">
  16. <text class="content-five-first">查看详情</text>
  17. <text class="content-five-second">
  18. <u-icon name="arrow-right"></u-icon>
  19. </text>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import {
  26. request
  27. } from '../../../common/request/request'
  28. require("promise.prototype.finally").shim()
  29. export default {
  30. data() {
  31. return {
  32. msgContent: '',
  33. sendUserId: '',
  34. orderList: []
  35. }
  36. },
  37. onLoad() {
  38. },
  39. onLoad(options) {
  40. this.sendUserId = options.sendUserId
  41. },
  42. created() {
  43. this.getDate()
  44. this.getList()
  45. },
  46. methods: {
  47. // 获取列表
  48. getDate() {
  49. request({
  50. url: '/appMessage/getMessageList',
  51. method: 'post',
  52. data: {
  53. "acceptUserId":this.$store.state.storeInfo.storeId,
  54. "sendUserId": this.sendUserId,
  55. 'userId':this.$store.state.storeInfo.userId
  56. }
  57. }).then(res => {
  58. this.orderList = res.data.list
  59. for(var i = 0; i<res.data.list.length; i++) {
  60. this.msgContent = res.data.list[i].msgContent
  61. this.sendUserId = res.data.list[i].sendUserId
  62. }
  63. }).catch(err => {
  64. })
  65. .finally(() => {
  66. setTimeout(() => {
  67. uni.hideLoading();
  68. this.loading = false;
  69. }, 300)
  70. })
  71. },
  72. // 获取消息状态
  73. getList() {
  74. request({
  75. url: '/appMessage/updateMessage',
  76. method: 'post',
  77. data: {
  78. "acceptUserId":this.$store.state.storeInfo.storeId,
  79. "sendUserId": this.sendUserId,
  80. 'userId':this.$store.state.storeInfo.userId
  81. }
  82. }).then(res => {
  83. }).catch(err => {
  84. })
  85. .finally(() => {
  86. setTimeout(() => {
  87. uni.hideLoading();
  88. this.loading = false;
  89. }, 300)
  90. })
  91. },
  92. inDetails() {
  93. if(this.sendUserId == 17) {
  94. this.$u.route({
  95. url: 'pages/me/Write-off-management/index',
  96. })
  97. }else {
  98. this.$u.route({
  99. url: 'pages/msg/Order-details/index',
  100. })
  101. }
  102. }
  103. },
  104. }
  105. </script>
  106. <style lang="scss" scoped>
  107. .content {
  108. width: 702rpx;
  109. // height: 447rpx;
  110. margin: 0 auto;
  111. background: #FFFFFF;
  112. margin-top: 20rpx;
  113. box-shadow: 0rpx 0rpx 17rpx 0rpx rgba(78, 60, 63, 0.2);
  114. border-radius: 10rpx;
  115. }
  116. .content-one {
  117. display: flex;
  118. justify-content: space-between;
  119. }
  120. .content-one-first {
  121. font-size: 28rpx;
  122. font-weight: bold;
  123. margin: 20rpx;
  124. }
  125. .content-one-second {
  126. font-size: 24rpx;
  127. color: #B2B2B2;
  128. margin: 20rpx;
  129. }
  130. .content-five {
  131. display: flex;
  132. justify-content: space-between;
  133. }
  134. .content-five-first {
  135. font-size: 24rpx;
  136. font-weight: bold;
  137. margin: 20rpx;
  138. }
  139. .content-five-second {
  140. font-size: 24rpx;
  141. color: #B2B2B2;
  142. margin: 20rpx;
  143. }
  144. // 中间虚线
  145. .content-two {
  146. width: 670rpx;
  147. margin: 0 auto;
  148. border-top: 1rpx solid #ededed;
  149. }
  150. .content-three {
  151. display: inline-block;
  152. margin-left: 30rpx;
  153. color: #aeaeae;
  154. margin-top: 20rpx;
  155. font-size: 24rpx;
  156. margin-bottom: 27rpx;
  157. }
  158. .content-four {
  159. color: #aeaeae;
  160. margin-left: 20rpx;
  161. margin-top: 6rpx;
  162. font-size: 24rpx;
  163. }
  164. .content-four-tail {
  165. color: #000;
  166. margin-left: 20rpx;
  167. margin-top: 10rpx;
  168. font-size: 24rpx;
  169. }
  170. </style>