index.vue 3.9 KB

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