notice-order.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  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. export default {
  46. mixins: [noticeMixins],
  47. components: {
  48. noticeCell
  49. },
  50. data() {
  51. return {
  52. }
  53. },
  54. onLoad(option) {
  55. this.initData(option)
  56. },
  57. methods: {
  58. async initData(option) {
  59. this.params.messageType = option.messageType
  60. this.getUserAuthClubMessageList()
  61. },
  62. handleOrderClick(cell) {
  63. this.clearCellNew(cell.id)
  64. if (cell.orderMessageType === 1) {
  65. if (this.isOnliyPay(cell)) {
  66. uni.navigateTo({
  67. url: `/pages/views/order/order-pay?orderId=${cell.orderId}`
  68. })
  69. } else {
  70. uni.showToast({
  71. title: '订单已支付完成',
  72. duration: 1000
  73. })
  74. }
  75. } else {
  76. let linkJumpMap = {
  77. 2: `/pages/views/order/order-detail?orderId=${cell.orderId}`,
  78. 3: `/pages/views/order/order-detail?orderId=${cell.orderId}`,
  79. 4: `/pages/views/order/order-detail?orderId=${cell.orderId}`,
  80. 5: `/pages/views/order/order-logistics?orderId=${cell.orderId}`,
  81. 6: `/pages/views/order/order-detail?orderId=${cell.orderId}`
  82. }
  83. uni.navigateTo({
  84. url: linkJumpMap[cell.orderMessageType]
  85. })
  86. }
  87. },
  88. isOnliyPay(cell){
  89. let statusVal = [11, 12, 13, 21, 22, 23, 111]
  90. return statusVal.includes(cell.status)
  91. }
  92. },
  93. onReachBottom() {
  94. if (this.hasNextPage) {
  95. this.loadding = true
  96. this.pullUpOn = true
  97. this.showLoading = true
  98. this.params.pageNum += 1
  99. this.getUserAuthClubMessageList()
  100. }
  101. },
  102. onPullDownRefresh() {
  103. //下拉刷新
  104. this.params.pageNum = 1
  105. this.dataValue = []
  106. this.getUserAuthClubMessageList()
  107. uni.stopPullDownRefresh()
  108. }
  109. }
  110. </script>
  111. <style lang="scss">
  112. page {
  113. background-color: #f7f7f7;
  114. }
  115. .container-main {
  116. width: 100%;
  117. box-sizing: border-box;
  118. padding: 24rpx 0;
  119. .empty-container {
  120. display: flex;
  121. flex-direction: column;
  122. align-items: center;
  123. justify-content: center;
  124. height: 60vh;
  125. }
  126. .empty_notice {
  127. width: 290rpx;
  128. height: 230rpx;
  129. }
  130. .error-text{
  131. color: #999999;
  132. font-size: 26rpx;
  133. }
  134. }
  135. .tui-notice {
  136. margin-bottom: 24rpx;
  137. }
  138. .tui-notice-cell {
  139. width: 702rpx;
  140. height: auto;
  141. background-color: #ffffff;
  142. border-radius: 16rpx;
  143. box-sizing: border-box;
  144. padding: 16rpx 24rpx;
  145. margin: 0 auto;
  146. .tui-cell-top {
  147. width: 100%;
  148. height: 88rpx;
  149. line-height: 88rpx;
  150. .cell-title {
  151. font-size: 32rpx;
  152. color: #333333;
  153. float: left;
  154. font-weight: bold;
  155. }
  156. .cell-time {
  157. font-size: 24rpx;
  158. color: #999999;
  159. float: right;
  160. }
  161. }
  162. .tui-cell-content {
  163. width: 100%;
  164. height: 160rpx;
  165. box-sizing: border-box;
  166. padding: 16rpx;
  167. border-radius: 8rpx;
  168. background-color: #f7f7f7;
  169. .cell-image {
  170. width: 128rpx;
  171. height: 128rpx;
  172. border-radius: 8rpx;
  173. float: left;
  174. image {
  175. width: 128rpx;
  176. height: 128rpx;
  177. display: block;
  178. border-radius: 8rpx;
  179. }
  180. }
  181. .cell-content {
  182. width: 490rpx;
  183. height: 100%;
  184. box-sizing: border-box;
  185. padding: 0 20rpx;
  186. line-height: 40rpx;
  187. font-size: 28rpx;
  188. color: #666666;
  189. text-align: justify;
  190. float: left;
  191. }
  192. }
  193. .tui-cell-bot {
  194. width: 100%;
  195. height: 80rpx;
  196. box-sizing: border-box;
  197. padding: 16rpx 0 0 0;
  198. .tui-cell-btn {
  199. width: 160rpx;
  200. height: 64rpx;
  201. border-radius: 35rpx;
  202. box-sizing: border-box;
  203. border: 1px solid #999999;
  204. text-align: center;
  205. line-height: 64rpx;
  206. font-size: 26rpx;
  207. color: #333333;
  208. float: right;
  209. margin-left: 24rpx;
  210. }
  211. }
  212. }
  213. .tui-custom-btn_box {
  214. width: 80px;
  215. height: 100%;
  216. box-sizing: border-box;
  217. display: flex;
  218. align-items: center;
  219. justify-content: center;
  220. background-color: #f7f7f7;
  221. }
  222. .tui-custom-btn {
  223. width: 56rpx;
  224. height: 56rpx;
  225. border-radius: 50%;
  226. background-color: #f94b4b;
  227. color: #ffffff;
  228. display: flex;
  229. align-items: center;
  230. justify-content: center;
  231. flex-shrink: 0;
  232. .deleteImage{
  233. width: 56rpx;
  234. height: 56rpx;
  235. }
  236. }
  237. </style>