notice-order.vue 5.8 KB

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