notice-order.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <template>
  2. <view class="container cart clearfix">
  3. <tui-skeleton v-if="isRequest" :loadingType="3" :isLoading="true" />
  4. <view class="container-main" v-else>
  5. <view class="clearfix">
  6. <!-- 空白页 -->
  7. <view class="empty-container" v-if="isEmpty">
  8. <image mode="aspectFill" class="empty_notice" src="@/static/tabBar/emtry_notice.png"></image>
  9. <text class="error-text">暂无任何消息~</text>
  10. </view>
  11. <!-- 列表 -->
  12. <view
  13. class="tui-notice"
  14. v-else
  15. v-for="(cell, index) in dataValue"
  16. :key="index"
  17. @click.stop="handleOrderClick(cell)"
  18. >
  19. <tui-swipe-action :operateWidth="80" :backgroundColor="'#F7F7F7'">
  20. <template v-slot:content>
  21. <notice-cell :cellType="1" :cell="cell"></notice-cell>
  22. </template>
  23. <template v-slot:button>
  24. <view class="tui-custom-btn_box">
  25. <view class="tui-custom-btn" @click.stop="deleteBtn(cell.id, index)">
  26. <image src="@/static/tabBar/delete_notice.png" class="deleteImage" mode="aspectFill"></image>
  27. </view>
  28. </view>
  29. </template>
  30. </tui-swipe-action>
  31. </view>
  32. <!--加载loadding-->
  33. <view v-if="showLoading">
  34. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  35. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText"></tui-nomore>
  36. </view>
  37. <!--加载loadding-->
  38. </view>
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. import noticeMixins from './mixins/notice_mixins.js'
  44. import noticeCell from './components/notice-cell.vue'
  45. import { mapActions } from 'vuex'
  46. export default {
  47. mixins: [noticeMixins],
  48. components: {
  49. noticeCell
  50. },
  51. data() {
  52. return {
  53. }
  54. },
  55. onLoad(option) {
  56. this.initData(option)
  57. },
  58. methods: {
  59. ...mapActions('user', ['updateNoticeNum']),
  60. async initData(option) {
  61. this.params.messageType = option.messageType
  62. this.getUserAuthClubMessageList()
  63. },
  64. handleOrderClick(cell) {
  65. this.clearCellNew(cell.id)
  66. this.updateNoticeNum()
  67. if (cell.orderMessageType === 1) {
  68. if (this.isOnliyPay(cell)) {
  69. uni.navigateTo({
  70. url: `/pages/views/order/order-pay?orderId=${cell.orderId}`
  71. })
  72. } else {
  73. uni.showToast({
  74. title: '订单已支付完成',
  75. duration: 1000
  76. })
  77. }
  78. } else {
  79. let linkJumpMap = {
  80. 2: `/pages/views/order/order-detail?orderId=${cell.orderId}`,
  81. 3: `/pages/views/order/order-detail?orderId=${cell.orderId}`,
  82. 4: `/pages/views/order/order-detail?orderId=${cell.orderId}`,
  83. 5: `/pages/views/order/order-logistics?orderId=${cell.orderId}`,
  84. 6: `/pages/views/order/order-detail?orderId=${cell.orderId}`
  85. }
  86. uni.navigateTo({
  87. url: linkJumpMap[cell.orderMessageType]
  88. })
  89. }
  90. },
  91. isOnliyPay(cell){
  92. let statusVal = [11, 12, 13, 21, 22, 23, 111]
  93. return statusVal.includes(cell.status)
  94. }
  95. },
  96. onReachBottom() {
  97. if (this.hasNextPage) {
  98. this.loadding = true
  99. this.pullUpOn = true
  100. this.showLoading = true
  101. this.params.pageNum += 1
  102. this.getUserAuthClubMessageList()
  103. }
  104. },
  105. onPullDownRefresh() {
  106. //下拉刷新
  107. this.params.pageNum = 1
  108. this.dataValue = []
  109. this.getUserAuthClubMessageList()
  110. uni.stopPullDownRefresh()
  111. }
  112. }
  113. </script>
  114. <style lang="scss">
  115. page {
  116. background-color: #f7f7f7;
  117. }
  118. .container-main {
  119. width: 100%;
  120. box-sizing: border-box;
  121. padding: 24rpx 0;
  122. .empty-container {
  123. display: flex;
  124. flex-direction: column;
  125. align-items: center;
  126. justify-content: center;
  127. height: 60vh;
  128. }
  129. .empty_notice {
  130. width: 290rpx;
  131. height: 230rpx;
  132. }
  133. .error-text{
  134. color: #999999;
  135. font-size: 26rpx;
  136. }
  137. }
  138. .tui-notice {
  139. margin-bottom: 24rpx;
  140. }
  141. .tui-notice-cell {
  142. width: 702rpx;
  143. height: auto;
  144. background-color: #ffffff;
  145. border-radius: 16rpx;
  146. box-sizing: border-box;
  147. padding: 16rpx 24rpx;
  148. margin: 0 auto;
  149. .tui-cell-top {
  150. width: 100%;
  151. height: 88rpx;
  152. line-height: 88rpx;
  153. .cell-title {
  154. font-size: 32rpx;
  155. color: #333333;
  156. float: left;
  157. font-weight: bold;
  158. }
  159. .cell-time {
  160. font-size: 24rpx;
  161. color: #999999;
  162. float: right;
  163. }
  164. }
  165. .tui-cell-content {
  166. width: 100%;
  167. height: 160rpx;
  168. box-sizing: border-box;
  169. padding: 16rpx;
  170. border-radius: 8rpx;
  171. background-color: #f7f7f7;
  172. .cell-image {
  173. width: 128rpx;
  174. height: 128rpx;
  175. border-radius: 8rpx;
  176. float: left;
  177. image {
  178. width: 128rpx;
  179. height: 128rpx;
  180. display: block;
  181. border-radius: 8rpx;
  182. }
  183. }
  184. .cell-content {
  185. width: 490rpx;
  186. height: 100%;
  187. box-sizing: border-box;
  188. padding: 0 20rpx;
  189. line-height: 40rpx;
  190. font-size: 28rpx;
  191. color: #666666;
  192. text-align: justify;
  193. float: left;
  194. }
  195. }
  196. .tui-cell-bot {
  197. width: 100%;
  198. height: 80rpx;
  199. box-sizing: border-box;
  200. padding: 16rpx 0 0 0;
  201. .tui-cell-btn {
  202. width: 160rpx;
  203. height: 64rpx;
  204. border-radius: 35rpx;
  205. box-sizing: border-box;
  206. border: 1px solid #999999;
  207. text-align: center;
  208. line-height: 64rpx;
  209. font-size: 26rpx;
  210. color: #333333;
  211. float: right;
  212. margin-left: 24rpx;
  213. }
  214. }
  215. }
  216. .tui-custom-btn_box {
  217. width: 80px;
  218. height: 100%;
  219. box-sizing: border-box;
  220. display: flex;
  221. align-items: center;
  222. justify-content: center;
  223. background-color: #f7f7f7;
  224. }
  225. .tui-custom-btn {
  226. width: 56rpx;
  227. height: 56rpx;
  228. border-radius: 50%;
  229. background-color: #f94b4b;
  230. color: #ffffff;
  231. display: flex;
  232. align-items: center;
  233. justify-content: center;
  234. flex-shrink: 0;
  235. .deleteImage{
  236. width: 56rpx;
  237. height: 56rpx;
  238. }
  239. }
  240. </style>