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. console.log(err)
  65. })
  66. .finally(() => {
  67. setTimeout(() => {
  68. uni.hideLoading();
  69. this.loading = false;
  70. }, 300)
  71. })
  72. },
  73. // 获取消息状态
  74. getList() {
  75. request({
  76. url: '/appMessage/updateMessage',
  77. method: 'post',
  78. data: {
  79. "acceptUserId":this.$store.state.storeInfo.storeId,
  80. "sendUserId": this.sendUserId,
  81. 'userId':this.$store.state.storeInfo.userId
  82. }
  83. }).then(res => {
  84. }).catch(err => {
  85. })
  86. .finally(() => {
  87. setTimeout(() => {
  88. uni.hideLoading();
  89. this.loading = false;
  90. }, 300)
  91. })
  92. },
  93. inDetails() {
  94. if(this.sendUserId == 17) {
  95. this.$u.route({
  96. url: 'pages/me/Write-off-management/index',
  97. })
  98. }else {
  99. this.$u.route({
  100. url: 'pages/msg/Order-details/index',
  101. })
  102. }
  103. }
  104. },
  105. }
  106. </script>
  107. <style lang="scss" scoped>
  108. .content {
  109. width: 702rpx;
  110. // height: 447rpx;
  111. margin: 0 auto;
  112. background: #FFFFFF;
  113. margin-top: 20rpx;
  114. box-shadow: 0rpx 0rpx 17rpx 0rpx rgba(78, 60, 63, 0.2);
  115. border-radius: 10rpx;
  116. }
  117. .content-one {
  118. display: flex;
  119. justify-content: space-between;
  120. }
  121. .content-one-first {
  122. font-size: 28rpx;
  123. font-weight: bold;
  124. margin: 20rpx;
  125. }
  126. .content-one-second {
  127. font-size: 24rpx;
  128. color: #B2B2B2;
  129. margin: 20rpx;
  130. }
  131. .content-five {
  132. display: flex;
  133. justify-content: space-between;
  134. }
  135. .content-five-first {
  136. font-size: 24rpx;
  137. font-weight: bold;
  138. margin: 20rpx;
  139. }
  140. .content-five-second {
  141. font-size: 24rpx;
  142. color: #B2B2B2;
  143. margin: 20rpx;
  144. }
  145. // 中间虚线
  146. .content-two {
  147. width: 670rpx;
  148. margin: 0 auto;
  149. border-top: 1rpx solid #ededed;
  150. }
  151. .content-three {
  152. display: inline-block;
  153. margin-left: 30rpx;
  154. color: #aeaeae;
  155. margin-top: 20rpx;
  156. font-size: 24rpx;
  157. margin-bottom: 27rpx;
  158. }
  159. .content-four {
  160. color: #aeaeae;
  161. margin-left: 20rpx;
  162. margin-top: 6rpx;
  163. font-size: 24rpx;
  164. }
  165. .content-four-tail {
  166. color: #000;
  167. margin-left: 20rpx;
  168. margin-top: 10rpx;
  169. font-size: 24rpx;
  170. }
  171. </style>