trip.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. <template>
  2. <view class="content">
  3. <view class="navbar">
  4. <view v-for="(item, index) in tabList" :key="index" class="flex-sub"
  5. @click="tabClicks(item.state)">
  6. <view class="nav-item" :class="{ current: tabFromIndex === item.state }">{{ item.text }}<view class="ban" v-if="tabFromIndex === item.state"></view></view>
  7. <!-- <view class="text-center" style="margin-top: -30upx;">
  8. <image v-if="tabFromIndex === item.state " src="/static/upload/wx.png" style="width: 55upx;height: 16upx;margin-top: -5upx;"></image>
  9. </view> -->
  10. </view>
  11. </view>
  12. <!-- #ifdef H5 -->
  13. <view style="margin-top: 90upx;background: #f7f7f7;">
  14. <!-- #endif -->
  15. <!-- #ifndef H5 -->
  16. <view style="margin-top: 100upx; background: #f7f7f7;">
  17. <!-- #endif -->
  18. <view v-for="(item, index) in list" :key="index" class="padding margin" style="background: #fff; border-radius: 16rpx;">
  19. <!-- <view class="flex justify-between"
  20. style="font-size: 30upx;width: 100%;overflow: hidden;text-overflow: ellipsis;white-space:nowrap">
  21. <view style="color: #333333;">{{ item.title }}</view>
  22. <view v-if="item.isSee == 0"
  23. style="height: 32rpx;width: 32rpx;border-radius: 100rpx;background-color: red;color: #FFF;text-align: center;">
  24. </view>
  25. </view>
  26. <view style="color: #999999;font-size: 28upx;margin-top: 10upx;">{{ item.content }}</view> -->
  27. <view style="margin-top: 10upx;color: #999999;font-size: 28upx;">{{ item.createAt }}</view>
  28. <view class="flex" style="padding-top: 20rpx; justify-content: space-between;">
  29. <view class="title" style="color: #00c18a;">已完成</view>
  30. <view style="color: #f56c6c;">¥ 123.11</view>
  31. </view>
  32. <view class="flex align-center add_name" style="padding: 20rpx 0;">
  33. <image v-if="globalImages" :src="globalImages + 'imgs//mididi.png'" style="width: 56rpx;height: 56rpx;" mode=""></image>
  34. <view style="margin-left: 20rpx;">
  35. <view>出发地点</view>
  36. <view style="color: #999999;font-size: 26rpx;">出发地点地址</view>
  37. </view>
  38. </view>
  39. <view class="flex align-center add_name" style="padding: 20rpx 0;">
  40. <image v-if="globalImages" :src="globalImages + 'imgs//zhongdian.png'" style="width: 56rpx;height: 56rpx;" mode=""></image>
  41. <view style="margin-left: 20rpx;">
  42. <view>到达地点</view>
  43. <view style="color: #999999;font-size: 26rpx;">到达地点地址</view>
  44. </view>
  45. </view>
  46. <view style="border-top: 1rpx solid #f3f4f6;"></view>
  47. <view class=" flex align-center" style="padding-top: 20rpx; justify-content: space-between;">
  48. <view class="flex">
  49. <view style="#999999">18.1公里</view>
  50. <view style="margin-left: 20rpx;" class="flex">
  51. <image v-if="globalImages" :src="globalImages + 'imgs//star.png'" style="width: 28rpx;height: 28rpx;" mode=""></image>
  52. 4.8
  53. </view>
  54. </view>
  55. <view class="btn2 margin-left" >查看详情</view>
  56. </view>
  57. <!-- <view v-if="list.length-1!=index" style="width: 100%;height: 1rpx;background: #f5f5f5;margin-top: 30upx;"></view> -->
  58. </view>
  59. </view>
  60. <!-- <view v-if="list.length === 0" style="background: #1c1b20;text-align: center;padding-top: 140upx;color: #FFFFFF;">暂无消息</view> -->
  61. <empty v-if="list.length === 0" content="暂无消息" show="false" style="height: 100vh;"></empty>
  62. </view>
  63. </template>
  64. <script>
  65. import empty from '@/components/empty';
  66. import { waitForGlobalImages } from '@/utils/globalImageLoader'
  67. export default {
  68. components: {
  69. empty
  70. },
  71. data() {
  72. return {
  73. tabFromIndex: 0,
  74. tabCurrentIndex: 0,
  75. fromInfo: 5,
  76. list: [],
  77. page: 1,
  78. limit: 10,
  79. scrollTop: false,
  80. tabList: [
  81. {
  82. state: 0,
  83. text: '今日完成',
  84. totalElements: 0
  85. },
  86. {
  87. state: 7,
  88. text: '本周完成',
  89. totalElements: 0
  90. },
  91. {
  92. state: 5,
  93. text: '本月完成',
  94. totalElements: 0
  95. },
  96. {
  97. state: 19,
  98. text: '更早',
  99. totalElements: 0
  100. }
  101. ],
  102. globalImages: ''
  103. };
  104. },
  105. onPageScroll: function(e) {
  106. this.scrollTop = e.scrollTop > 200;
  107. },
  108. onReachBottom: function() {
  109. this.page = this.page + 1;
  110. this.loadData();
  111. },
  112. onPullDownRefresh: function() {
  113. this.page = 1;
  114. this.loadData();
  115. },
  116. onLoad(options) {
  117. waitForGlobalImages().then((path) => {
  118. console.log('✅ 全局图片路径:', path)
  119. this.globalImages = path
  120. })
  121. this.$queue.showLoading("加载中...")
  122. this.loadData();
  123. },
  124. methods: {
  125. //顶部渠道点击
  126. tabClicks(index) {
  127. this.list = [];
  128. this.page = 1;
  129. this.tabFromIndex = index;
  130. this.$queue.showLoading("加载中...")
  131. this.loadData();
  132. },
  133. //获取消息列表
  134. loadData() {
  135. let that = this;
  136. let number = 10;
  137. let token = this.$queue.getData('token');
  138. if (token) {
  139. let data = {
  140. page: this.page,
  141. limit: this.limit,
  142. state: this.tabFromIndex
  143. }
  144. this.$Request.getT('/app/message/selectMessageByUserId', data).then(res => {
  145. if (res.code === 0) {
  146. if (this.page == 1) {
  147. this.list = res.data.records
  148. } else {
  149. res.data.records.forEach(d => {
  150. this.list.push(d);
  151. });
  152. }
  153. }
  154. uni.hideLoading();
  155. uni.stopPullDownRefresh();
  156. });
  157. }
  158. }
  159. }
  160. };
  161. </script>
  162. <style lang="scss">
  163. .btn2 {
  164. width: 150rpx;
  165. height: 60rpx;
  166. background: #00c18a;
  167. border-radius: 16rpx;
  168. font-size: 24rpx;
  169. font-family: PingFang SC;
  170. font-weight: 500;
  171. color: #FFFFFF;
  172. display: flex;
  173. align-items: center;
  174. justify-content: center;
  175. }
  176. .order_up {
  177. width: 6rpx;
  178. height: 24rpx;
  179. margin-left: 6rpx;
  180. }
  181. page,
  182. page {
  183. background: #ffffff;
  184. }
  185. .content {
  186. background: #ffffff;
  187. height: 100%;
  188. }
  189. .swiper-box {
  190. height: calc(100% - 40px);
  191. }
  192. .list-scroll-content {
  193. height: 100%;
  194. }
  195. .navbar {
  196. display: flex;
  197. height: 40px;
  198. padding: 0 5px;
  199. // background: #1E1F31;
  200. // box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  201. color: #000000;
  202. position: relative;
  203. background: #FFFFFF;
  204. position: fixed;
  205. /* #ifdef H5 */
  206. top:80upx;
  207. /* #endif */
  208. /* #ifndef H5 */
  209. top: 0;
  210. /* #endif */
  211. left: 0;
  212. right: 0;
  213. z-index: 10;
  214. .nav-item {
  215. display: flex;
  216. justify-content: center;
  217. align-items: center;
  218. height: 100%;
  219. font-size: 15px;
  220. // color: #FFFFFF;
  221. position: relative;
  222. &.current {
  223. color: #00c18a;
  224. // &:after {
  225. // content: '';
  226. // position: absolute;
  227. // left: 50%;
  228. // bottom: 0;
  229. // transform: translateX(-50%);
  230. // width: 44px;
  231. // height: 0;
  232. // border-bottom: 2px solid #557EFD;
  233. // }
  234. }
  235. }
  236. }
  237. .uni-swiper-item {
  238. height: auto;
  239. }
  240. page {
  241. background-color: #F7F7F7;
  242. }
  243. .item {
  244. // background: #FFFFFF;
  245. padding: 20rpx;
  246. margin: 20rpx;
  247. font-size: 28rpx;
  248. // box-shadow: 7px 9px 34px rgba(0, 0, 0, 0.1);
  249. border-radius: 16upx;
  250. }
  251. /* load-more */
  252. .uni-load-more {
  253. display: flex;
  254. flex-direction: row;
  255. height: 40px;
  256. align-items: center;
  257. justify-content: center;
  258. }
  259. .uni-load-more__text {
  260. font-size: 14px;
  261. // color: #999;
  262. }
  263. .uni-load-more__img {
  264. height: 24px;
  265. width: 24px;
  266. margin-right: 10px;
  267. }
  268. .uni-load-more__img>view {
  269. position: absolute;
  270. }
  271. .uni-load-more__img>view view {
  272. width: 6px;
  273. height: 2px;
  274. border-top-left-radius: 1px;
  275. border-bottom-left-radius: 1px;
  276. background: #999;
  277. position: absolute;
  278. opacity: 0.2;
  279. transform-origin: 50%;
  280. animation: load 1.56s ease infinite;
  281. }
  282. .uni-load-more__img>view view:nth-child(1) {
  283. transform: rotate(90deg);
  284. top: 2px;
  285. left: 9px;
  286. }
  287. .uni-load-more__img>view view:nth-child(2) {
  288. transform: rotate(180deg);
  289. top: 11px;
  290. right: 0;
  291. }
  292. .uni-load-more__img>view view:nth-child(3) {
  293. transform: rotate(270deg);
  294. bottom: 2px;
  295. left: 9px;
  296. }
  297. .uni-load-more__img>view view:nth-child(4) {
  298. top: 11px;
  299. left: 0;
  300. }
  301. .load1,
  302. .load2,
  303. .load3 {
  304. height: 24px;
  305. width: 24px;
  306. }
  307. .load2 {
  308. transform: rotate(30deg);
  309. }
  310. .load3 {
  311. transform: rotate(60deg);
  312. }
  313. .load1 view:nth-child(1) {
  314. animation-delay: 0s;
  315. }
  316. .load2 view:nth-child(1) {
  317. animation-delay: 0.13s;
  318. }
  319. .load3 view:nth-child(1) {
  320. animation-delay: 0.26s;
  321. }
  322. .load1 view:nth-child(2) {
  323. animation-delay: 0.39s;
  324. }
  325. .load2 view:nth-child(2) {
  326. animation-delay: 0.52s;
  327. }
  328. .load3 view:nth-child(2) {
  329. animation-delay: 0.65s;
  330. }
  331. .load1 view:nth-child(3) {
  332. animation-delay: 0.78s;
  333. }
  334. .load2 view:nth-child(3) {
  335. animation-delay: 0.91s;
  336. }
  337. .load3 view:nth-child(3) {
  338. animation-delay: 1.04s;
  339. }
  340. .load1 view:nth-child(4) {
  341. animation-delay: 1.17s;
  342. }
  343. .load2 view:nth-child(4) {
  344. animation-delay: 1.3s;
  345. }
  346. .load3 view:nth-child(4) {
  347. animation-delay: 1.43s;
  348. }
  349. .ban {
  350. width: 50%;
  351. height: 5rpx;
  352. background: #00c18a;
  353. opacity: 0.7;
  354. position: absolute;
  355. top: 62rpx;
  356. // margin-left: 25%;
  357. }
  358. @-webkit-keyframes load {
  359. 0% {
  360. opacity: 1;
  361. }
  362. 100% {
  363. opacity: 0.2;
  364. }
  365. }
  366. </style>