notice-order.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  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" />
  40. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText" />
  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. StaticUrl: this.$Static,
  59. listQuery: {
  60. source: 2,
  61. commonId: 0,
  62. messageType: 0,
  63. pageNum: 1,
  64. pageSize: 10
  65. },
  66. list: [],
  67. isEmpty: false,
  68. loadding: false,
  69. pullUpOn: true,
  70. pullFlag: true,
  71. hasNextPage: false,
  72. nomoreText: '上拉显示更多'
  73. }
  74. },
  75. onLoad(option) {
  76. this.initData(option)
  77. },
  78. methods: {
  79. async initData(option) {
  80. const userInfo = await this.$api.getStorage()
  81. this.listQuery.messageType = option.messageType
  82. this.listQuery.commonId = userInfo.clubId ? userInfo.clubId : 0
  83. this.getUserAuthClubMessageList()
  84. },
  85. handleOrderClick(cell) {
  86. if (cell.orderMessageType === 1) {
  87. if (this.isOnliyPay(cell)) {
  88. let payLinkMap = {
  89. 0: `/pages/user/order/order-pay-list?orderId=${cell.orderId}`,
  90. 1: `/pages/user/order/order-payunder?orderId=${cell.orderId}`
  91. }
  92. let linkJumpMap = { 1: `/pages/user/order/order-payunder?orderId=${cell.orderId}` }
  93. this.$api.navigateTo(linkJumpMap[cell.orderMessageType])
  94. } else {
  95. this.$util.msg('订单已完成支付', 2000)
  96. }
  97. } else {
  98. let linkJumpMap = {
  99. 2: `/pages/user/order/order-details?orderId=${cell.orderId}`,
  100. 3: `/pages/user/order/order-details?orderId=${cell.orderId}`,
  101. 4: `/pages/user/order/order-details?orderId=${cell.orderId}`,
  102. 5: `/pages/user/order/order-logistics?orderId=${cell.orderId}`,
  103. 6: `/pages/user/order/order-details?orderId=${cell.orderId}`
  104. }
  105. this.$api.navigateTo(linkJumpMap[cell.orderMessageType])
  106. }
  107. },
  108. isOnliyPay(cell){
  109. let onliyPay = false
  110. let statusVal = [11, 12, 13, 21, 22, 23, 111]
  111. statusVal.forEach(value => {
  112. if (cell.status === value) {
  113. onliyPay = true
  114. }
  115. })
  116. return onliyPay
  117. }
  118. },
  119. onReachBottom() {
  120. if (this.hasNextPage) {
  121. this.loadding = true
  122. this.pullUpOn = true
  123. this.getReachBottomData()
  124. }
  125. },
  126. onPullDownRefresh() {
  127. //下拉刷新
  128. this.listQuery.pageNum = 1
  129. this.getUserAuthClubMessageList()
  130. uni.stopPullDownRefresh()
  131. },
  132. onShow() {}
  133. }
  134. </script>
  135. <style lang="scss">
  136. page {
  137. background-color: #f7f7f7;
  138. }
  139. .container-main {
  140. width: 100%;
  141. box-sizing: border-box;
  142. padding: 24rpx 0;
  143. .empty-container-image {
  144. width: 260rpx;
  145. height: 260rpx;
  146. margin-top: -300rpx;
  147. }
  148. }
  149. .tui-notice {
  150. margin-bottom: 24rpx;
  151. }
  152. .tui-notice-cell {
  153. width: 702rpx;
  154. height: auto;
  155. background-color: #ffffff;
  156. border-radius: 16rpx;
  157. box-sizing: border-box;
  158. padding: 16rpx 24rpx;
  159. margin: 0 auto;
  160. .tui-cell-top {
  161. width: 100%;
  162. height: 88rpx;
  163. line-height: 88rpx;
  164. .cell-title {
  165. font-size: 32rpx;
  166. color: #333333;
  167. float: left;
  168. font-weight: bold;
  169. }
  170. .cell-time {
  171. font-size: 24rpx;
  172. color: #999999;
  173. float: right;
  174. }
  175. }
  176. .tui-cell-content {
  177. width: 100%;
  178. height: 160rpx;
  179. box-sizing: border-box;
  180. padding: 16rpx;
  181. border-radius: 8rpx;
  182. background-color: #f7f7f7;
  183. .cell-image {
  184. width: 128rpx;
  185. height: 128rpx;
  186. border-radius: 8rpx;
  187. float: left;
  188. image {
  189. width: 128rpx;
  190. height: 128rpx;
  191. display: block;
  192. border-radius: 8rpx;
  193. }
  194. }
  195. .cell-content {
  196. width: 490rpx;
  197. height: 100%;
  198. box-sizing: border-box;
  199. padding: 0 20rpx;
  200. line-height: 40rpx;
  201. font-size: 28rpx;
  202. color: #666666;
  203. text-align: justify;
  204. float: left;
  205. }
  206. }
  207. .tui-cell-bot {
  208. width: 100%;
  209. height: 80rpx;
  210. box-sizing: border-box;
  211. padding: 16rpx 0 0 0;
  212. .tui-cell-btn {
  213. width: 160rpx;
  214. height: 64rpx;
  215. border-radius: 35rpx;
  216. box-sizing: border-box;
  217. border: 1px solid #999999;
  218. text-align: center;
  219. line-height: 64rpx;
  220. font-size: 26rpx;
  221. color: #333333;
  222. float: right;
  223. margin-left: 24rpx;
  224. }
  225. }
  226. }
  227. .tui-custom-btn_box {
  228. width: 80px;
  229. height: 100%;
  230. padding: 0 20rpx;
  231. box-sizing: border-box;
  232. display: flex;
  233. align-items: center;
  234. justify-content: center;
  235. background-color: #f7f7f7;
  236. }
  237. .tui-custom-btn {
  238. width: 56rpx;
  239. height: 56rpx;
  240. border-radius: 50%;
  241. background-color: #f94b4b;
  242. color: #ffffff;
  243. display: flex;
  244. align-items: center;
  245. justify-content: center;
  246. flex-shrink: 0;
  247. .icon-shanchu3 {
  248. font-size: 32rpx;
  249. }
  250. }
  251. </style>