notice-order.vue 6.2 KB

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