notice-order.vue 5.6 KB

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