index.vue 3.6 KB

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