index.vue 3.8 KB

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