order1.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926
  1. <template>
  2. <view class="content">
  3. <view class="navbar">
  4. <view v-for="(item, index) in navList" :key="index" class="nav-item" :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}
  5. <view class="corner num" v-if="numlist[index] > 0">{{numlist[index]}}</view>
  6. </view>
  7. </view>
  8. <swiper :current="tabCurrentIndex" class="swiper-box" duration="300" @change="changeTab">
  9. <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
  10. <scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
  11. <!-- 空白页 -->
  12. <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
  13. <!-- 订单列表 -->
  14. <view @click="goToOrderDetail(item)" v-for="(item, index) in tabItem.orderList" :key="index" class="order-item">
  15. <view class="i-top b-b">
  16. <text class="time">订单编号:{{ item.order_id }}</text>
  17. <text class="state" >{{ item.status_name }}</text>
  18. </view>
  19. <view class="goods-box-single">
  20. <image class="goods-img" :src="item._info[0].cart_info.productInfo.image" mode="scaleToFill"></image>
  21. <view class="productBox ">
  22. <view class="left">
  23. <text class="title clamp">{{ item._info[0].cart_info.productInfo.store_name }}</text>
  24. </view>
  25. <view class="right">
  26. <text class="price">{{ item._info[0].cart_info.productInfo.price || moneyNum }}</text>
  27. <text class="attr-box"> x {{ item._info[0].cart_info.cart_num }}</text>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="price-box">
  32. <text class="num">{{ item.total_num }}</text>
  33. 件商品 邮费:
  34. <text class="price blank">{{ item.total_postage | moneyNum }}</text>
  35. 合计:
  36. <text class="price">{{ item.total_price | moneyNum }}</text>
  37. </view>
  38. </view>
  39. <uni-load-more :status="tabItem.loadingType"></uni-load-more>
  40. </scroll-view>
  41. </swiper-item>
  42. </swiper>
  43. </view>
  44. </template>
  45. <script>
  46. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  47. import empty from '@/components/empty';
  48. import { mapState } from 'vuex';
  49. import { saveUrl } from '@/utils/loginUtils.js';
  50. import { orderList, orderCancel, orderDel, orderTake,getEarnings,count } from '@/api/order.js';
  51. export default {
  52. filters: {
  53. // 过滤金额为数字
  54. moneyNum: function(value) {
  55. return +value;
  56. }
  57. },
  58. components: {
  59. uniLoadMore,
  60. empty
  61. },
  62. data() {
  63. return {
  64. tabCurrentIndex: 0,
  65. length1:0,
  66. numlist:[0,0,0],
  67. showModal: false,
  68. navList: [
  69. {
  70. state: 0,
  71. text: '待配送',
  72. loadingType: 'more',
  73. orderList: [],
  74. page: 1, //当前页数
  75. limit: 10 //每次信息条数
  76. },
  77. {
  78. state: 1,
  79. text: '配送中',
  80. loadingType: 'more',
  81. orderList: [],
  82. page: 1, //当前页数
  83. limit: 10 //每次信息条数
  84. },
  85. {
  86. state: 2,
  87. text: '已送达',
  88. loadingType: 'more',
  89. orderList: [],
  90. page: 1, //当前页数
  91. limit: 10 //每次信息条数
  92. },
  93. ]
  94. };
  95. },
  96. onLoad() {
  97. this.Count();
  98. this.loadData();
  99. console.log(this.numlist)
  100. },
  101. computed: {
  102. ...mapState(['userInfo'])
  103. },
  104. methods: {
  105. // 确认收货
  106. orderTake(item, index) {
  107. let obj = this;
  108. uni.showModal({
  109. title: '是否确认收货?',
  110. success: function(res) {
  111. if (res.confirm) {
  112. orderTake({
  113. uni: item.order_id
  114. })
  115. .then(e => {
  116. obj.navList[obj.tabCurrentIndex].orderList.splice(index, 1);
  117. uni.showToast({
  118. title: '收货成功',
  119. icon: 'none'
  120. });
  121. })
  122. .catch(e => {
  123. console.log(e);
  124. });
  125. } else if (res.cancel) {
  126. console.log('用户点击取消');
  127. }
  128. }
  129. });
  130. },
  131. // 跳转到查询快递页面
  132. expressCheck(item) {
  133. uni.navigateTo({
  134. url: '/pages/order/expressInfo?id=' + item.id
  135. });
  136. },
  137. //跳转到订单详情
  138. goToOrderDetail(e) {
  139. console.log()
  140. uni.navigateTo({
  141. url: '/pages/order/orderShop?id=' + e.order_id
  142. });
  143. },
  144. //分享
  145. share(e) {
  146. console.log(e);
  147. uni.navigateTo({
  148. url: '/pages/product/details?pink_id=' + e.pink_id
  149. });
  150. },
  151. // 申请退款
  152. orderRefund(e) {
  153. uni.navigateTo({
  154. url: '/pages/order/orderRefund?id=' + e.order_id
  155. });
  156. },
  157. // 订单支付
  158. orderPay(e) {
  159. if (e.combination_id > 0) {
  160. uni.navigateTo({
  161. url: '/pages/money/pay?type=1&ordid=' + e.order_id + '&money=' + e.pay_price + '&goodsType=2'
  162. });
  163. } else {
  164. uni.navigateTo({
  165. url: '/pages/money/pay?type=1&ordid=' + e.order_id + '&money=' + e.pay_price
  166. });
  167. }
  168. },
  169. //获取订单列表
  170. loadData(source) {
  171. //这里是将订单挂载到tab列表下
  172. let index = this.tabCurrentIndex;
  173. console.log('this.tabCurrentIndex',this.tabCurrentIndex)
  174. let navItem = this.navList[index];
  175. console.log('this.navList[index]',this.navList[index])
  176. console.log('navItem.state',navItem.state)
  177. let state = navItem.state;
  178. if (source === 'tabChange' && navItem.loaded === true) {
  179. //tab切换只有第一次需要加载数据
  180. return;
  181. }
  182. if (navItem.loadingType === 'loading') {
  183. //防止重复加载
  184. return;
  185. }
  186. if (navItem.loadingType === 'noMore') {
  187. //防止重复加载
  188. return;
  189. }
  190. // 修改当前对象状态为加载中
  191. navItem.loadingType = 'loading';
  192. if(index == 0) {
  193. getEarnings({
  194. page: navItem.page,
  195. limit: navItem.limit,
  196. status: 0
  197. })
  198. .then(({ data }) => {
  199. console.log('--0---',data.data);
  200. navItem.orderList = navItem.orderList.concat(data.data);
  201. navItem.page++;
  202. if (navItem.limit == data.data.length) {
  203. navItem.loadingType = 'more';
  204. return;
  205. } else {
  206. navItem.loadingType = 'noMore';
  207. }
  208. })
  209. .catch(err => {
  210. console.log(err);
  211. });
  212. getEarnings({
  213. page: navItem.page,
  214. limit: navItem.limit,
  215. status: 1
  216. })
  217. .then(({ data }) => {
  218. console.log('--1---',data.data);
  219. console.log('数量',this.length1)
  220. navItem.orderList = navItem.orderList.concat(data.data);
  221. navItem.page++;
  222. if (navItem.limit == data.data.length) {
  223. navItem.loadingType = 'more';
  224. return;
  225. } else {
  226. navItem.loadingType = 'noMore';
  227. }
  228. this.$set(navItem, 'loaded', true);
  229. })
  230. .catch(err => {
  231. console.log(err);
  232. });
  233. }
  234. if(index == 1) {
  235. getEarnings({
  236. page: navItem.page,
  237. limit: navItem.limit,
  238. status: 2
  239. })
  240. .then(({ data }) => {
  241. console.log('--2---',data.data);
  242. navItem.orderList = navItem.orderList.concat(data.data);
  243. navItem.page++;
  244. if (navItem.limit == data.data.length) {
  245. navItem.loadingType = 'more';
  246. return;
  247. } else {
  248. navItem.loadingType = 'noMore';
  249. }
  250. this.$set(navItem, 'loaded', true);
  251. })
  252. .catch(err => {
  253. console.log(err);
  254. });
  255. }
  256. if(index == 2) {
  257. getEarnings({
  258. page: navItem.page,
  259. limit: navItem.limit,
  260. status: 3
  261. })
  262. .then(({ data }) => {
  263. console.log('--3---',data.data);
  264. navItem.orderList = navItem.orderList.concat(data.data);
  265. navItem.page++;
  266. if (navItem.limit == data.data.length) {
  267. navItem.loadingType = 'more';
  268. return;
  269. } else {
  270. navItem.loadingType = 'noMore';
  271. }
  272. })
  273. .catch(err => {
  274. console.log(err);
  275. });
  276. getEarnings({
  277. page: navItem.page,
  278. limit: navItem.limit,
  279. status: 4
  280. })
  281. .then(({ data }) => {
  282. console.log('--4---',data.data);
  283. navItem.orderList = navItem.orderList.concat(data.data);
  284. navItem.page++;
  285. if (navItem.limit == data.data.length) {
  286. navItem.loadingType = 'more';
  287. return;
  288. } else {
  289. navItem.loadingType = 'noMore';
  290. }
  291. this.$set(navItem, 'loaded', true);
  292. })
  293. .catch(err => {
  294. console.log(err);
  295. });
  296. }
  297. // getEarnings({
  298. // page: navItem.page,
  299. // limit: navItem.limit
  300. // })
  301. // .then(({ data }) => {
  302. // console.log('-----',data);
  303. // let arr = []
  304. // if(index == 0 ){
  305. // arr = data.filter(e => {
  306. // return e.status == 1 || e.status == 0;
  307. // })
  308. // }
  309. // if(index == 1){
  310. // arr = data.filter(e => {
  311. // return e.status == 2;
  312. // })
  313. // }
  314. // if(index == 2){
  315. // arr = data.filter(e => {
  316. // return e.status == 3 || e.status == 4;
  317. // })
  318. // }
  319. // console.log("22222222222222",arr);
  320. // navItem.orderList = navItem.orderList.concat(arr);
  321. // navItem.page++;
  322. // if (navItem.limit == data.length) {
  323. // navItem.page++;
  324. // navItem.loadingType = 'more';
  325. // } else {
  326. // navItem.loadingType = 'nomore';
  327. // }
  328. // if (type === 'refresh') {
  329. // if (loading == 1) {
  330. // uni.hideLoading();
  331. // } else {
  332. // uni.stopPullDownRefresh();
  333. // }
  334. // }
  335. // })
  336. // .catch(err => {
  337. // console.log(err);
  338. // });
  339. },
  340. //获取数量
  341. Count() {
  342. count({status: 0}).then(e =>{
  343. this.numlist[0] += e.data.data
  344. });
  345. count({status: 1}).then(e =>{
  346. this.numlist[0] += e.data.data
  347. });
  348. count({status: 2}).then(e =>{
  349. this.numlist[1] += e.data.data
  350. });
  351. count({status: 3}).then(e =>{
  352. this.numlist[2] += e.data.data
  353. });
  354. count({status: 4}).then(e =>{
  355. this.numlist[2] += e.data.data
  356. });
  357. },
  358. //swiper 切换
  359. changeTab(e) {
  360. this.tabCurrentIndex = e.target.current;
  361. this.loadData('tabChange');
  362. },
  363. //顶部tab点击
  364. tabClick(index) {
  365. this.tabCurrentIndex = index;
  366. this.loadData('tabChange');
  367. },
  368. //删除订单
  369. deleteOrder(item, index) {
  370. uni.showModal({
  371. content: '是否确认删除订单?',
  372. success: res => {
  373. uni.showLoading({
  374. title: '请稍后'
  375. });
  376. setTimeout((e) => {
  377. orderDel({
  378. uni: item.order_id
  379. })
  380. .then(e => {
  381. this.navList[this.tabCurrentIndex].orderList.splice(index, 1);
  382. uni.hideLoading();
  383. })
  384. .catch(e => {
  385. console.log(e);
  386. uni.hideLoading();
  387. });
  388. },1000)
  389. },
  390. fail: e => {
  391. console.log(e);
  392. }
  393. });
  394. },
  395. //取消订单
  396. cancelOrder(item) {
  397. uni.showModal({
  398. title: '订单取消',
  399. content: '是否取消订单?',
  400. success: e => {
  401. if (e.confirm) {
  402. uni.showLoading({
  403. title: '请稍后'
  404. });
  405. orderCancel({ id: item.order_id })
  406. .then(e => {
  407. uni.showToast({
  408. title: '取消成功',
  409. duration: 2000,
  410. position: 'top'
  411. });
  412. })
  413. .catch(e => {
  414. console.log(e);
  415. });
  416. //取消订单后删除待付款中该项
  417. let list = this.navList[this.tabCurrentIndex].orderList;
  418. let index = list.findIndex(val => val.id === item.id);
  419. index !== -1 && list.splice(index, 1);
  420. uni.hideLoading();
  421. }
  422. }
  423. });
  424. },
  425. //订单状态文字和颜色
  426. orderStateExp(state) {
  427. let stateTip = '',
  428. stateTipColor = '#EF041F';
  429. switch (+state) {
  430. case 0:
  431. stateTip = '全部';
  432. break;
  433. case 1:
  434. stateTip = '待付款';
  435. break;
  436. case 2:
  437. stateTip = '待发货';
  438. break;
  439. case 3:
  440. stateTip = '待收货';
  441. break;
  442. case 4:
  443. stateTip = '已完成';
  444. stateTipColor = '#5dbc7c';
  445. break;
  446. case 9:
  447. stateTip = '订单已关闭';
  448. stateTipColor = '#909399';
  449. break;
  450. //更多自定义
  451. }
  452. return { stateTip, stateTipColor };
  453. }
  454. }
  455. };
  456. </script>
  457. <style lang="scss">
  458. page,
  459. .content {
  460. background: $page-color-base;
  461. height: 100%;
  462. }
  463. .swiper-box {
  464. height: calc(100% - 40px);
  465. padding: 0 20rpx;
  466. }
  467. .list-scroll-content {
  468. height: 100%;
  469. }
  470. .navbar {
  471. display: flex;
  472. height: 40px;
  473. padding: 0 5px;
  474. background: #fff;
  475. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  476. position: relative;
  477. z-index: 10;
  478. .nav-item {
  479. flex: 1;
  480. display: flex;
  481. justify-content: center;
  482. align-items: center;
  483. height: 100%;
  484. font-size: 15px;
  485. color: $font-color-dark;
  486. position: relative;
  487. &.current {
  488. color: #FF0000;
  489. &:after {
  490. content: '';
  491. position: absolute;
  492. left: 50%;
  493. bottom: 0;
  494. transform: translateX(-50%);
  495. width: 44px;
  496. height: 0;
  497. border-bottom: 2px solid #FF0000;
  498. }
  499. }
  500. }
  501. .num{
  502. // width: 34rpx;
  503. // height: 34rpx;
  504. // line-height: 34rpx;
  505. // display: flex;
  506. // justify-content: center;
  507. // align-items: center;
  508. // background-color: #FF0000;
  509. // color: #fff;
  510. position: absolute;
  511. // border-radius: 22rpx;
  512. right: 40rpx;
  513. top: 10rpx;
  514. }
  515. }
  516. .uni-swiper-item {
  517. height: auto;
  518. }
  519. .order-item {
  520. display: flex;
  521. flex-direction: column;
  522. padding-left: 30rpx;
  523. background: #fff;
  524. margin-top: 16rpx;
  525. border-radius: 15rpx;
  526. .i-top {
  527. display: flex;
  528. align-items: center;
  529. height: 80rpx;
  530. padding-right: 30rpx;
  531. font-size: $font-base;
  532. color: $font-color-dark;
  533. position: relative;
  534. .time {
  535. flex: 1;
  536. font-size: 24rpx;
  537. font-family: PingFang SC;
  538. font-weight: 400;
  539. color: #666666;
  540. }
  541. .state {
  542. font-size: 28rpx;
  543. font-family: PingFang SC;
  544. font-weight: 500;
  545. color: #FF0000;
  546. }
  547. .del-btn {
  548. padding: 10rpx 0 10rpx 36rpx;
  549. font-size: $font-lg;
  550. color: $font-color-light;
  551. position: relative;
  552. &:after {
  553. content: '';
  554. width: 0;
  555. height: 30rpx;
  556. border-left: 1px solid $border-color-dark;
  557. position: absolute;
  558. left: 20rpx;
  559. top: 50%;
  560. transform: translateY(-50%);
  561. }
  562. }
  563. }
  564. /* 多条商品 */
  565. .goods-box {
  566. height: 160rpx;
  567. padding: 20rpx 0;
  568. white-space: nowrap;
  569. .goods-item {
  570. width: 120rpx;
  571. height: 120rpx;
  572. display: inline-block;
  573. margin-right: 24rpx;
  574. }
  575. .goods-img {
  576. display: block;
  577. width: 120rpx;
  578. height: 120rpx;
  579. }
  580. }
  581. /* 单条商品 */
  582. .goods-box-single {
  583. display: flex;
  584. padding-top: 20rpx;
  585. .goods-img {
  586. width: 160rpx;
  587. height: 160rpx;
  588. flex-shrink:0
  589. }
  590. .productBox{
  591. width: 100%;
  592. display: flex;
  593. justify-content: space-between;
  594. padding: 0 31rpx 0rpx 27rpx;
  595. .left {
  596. display: flex;
  597. flex-direction: column;
  598. padding: 0 30rpx 0 24rpx;
  599. overflow: hidden;
  600. .title {
  601. font-size: 26rpx;
  602. font-family: PingFang SC;
  603. font-weight: 500;
  604. color: #3F454B;
  605. line-height: 1;
  606. }
  607. }
  608. .right {
  609. text-align: right;
  610. display: flex;
  611. flex-direction: column;
  612. .attr-box {
  613. font-size: 26rpx;
  614. font-family: PingFang SC;
  615. font-weight: bold;
  616. color: #333333;
  617. padding: 10rpx 12rpx;
  618. }
  619. .price {
  620. font-size: 26rpx;
  621. font-family: PingFang SC;
  622. font-weight: bold;
  623. color: #333333;
  624. // color: $font-color-dark;
  625. &:before {
  626. content: '¥';
  627. margin: 0 2rpx 0 8rpx;
  628. }
  629. }
  630. }
  631. }
  632. }
  633. .price-box {
  634. display: flex;
  635. justify-content: flex-end;
  636. align-items: baseline;
  637. padding-right: 30rpx;
  638. // padding: 20rpx 30rpx;
  639. font-size: $font-sm + 2rpx;
  640. color: $font-color-light;
  641. font-size: 26rpx;
  642. font-family: PingFang SC;
  643. font-weight: 500;
  644. color: #333333;
  645. .num {
  646. margin: 0 8rpx;
  647. }
  648. .blank {
  649. margin-right: 10rpx;
  650. }
  651. .price {
  652. &:before {
  653. content: '¥';
  654. margin: 0 2rpx 0 8rpx;
  655. }
  656. }
  657. }
  658. .action-box {
  659. display: flex;
  660. justify-content: space-between;
  661. align-items: center;
  662. height: 100rpx;
  663. position: relative;
  664. padding-right: 30rpx;
  665. }
  666. .btn_box_action {
  667. display: flex;
  668. align-items: center;
  669. }
  670. .action-btn {
  671. width: 160rpx;
  672. height: 60rpx;
  673. margin: 0;
  674. margin-left: 24rpx;
  675. padding: 0;
  676. text-align: center;
  677. line-height: 60rpx;
  678. font-size: $font-sm + 2rpx;
  679. color: $font-color-dark;
  680. background: #fff;
  681. border-radius: 100px;
  682. &:after {
  683. border-radius: 100px;
  684. }
  685. &.recom {
  686. color: #12ADA9;
  687. &:after {
  688. border-color: #12ADA9;
  689. }
  690. }
  691. &.evaluate {
  692. color: $color-yellow;
  693. &:after {
  694. border-color: $color-yellow;
  695. }
  696. }
  697. &.share {
  698. color: #ffffff;
  699. background: linear-gradient(0deg, rgba(250, 39, 64, 1), rgba(254, 85, 68, 1));
  700. }
  701. }
  702. }
  703. // 积分投注弹窗
  704. .mask {
  705. z-index: 10;
  706. position: fixed;
  707. top: 0;
  708. right: 0;
  709. bottom: 0;
  710. left: 0;
  711. background-color: rgba(0, 0, 0, 0.5);
  712. width: 100%;
  713. height: 100%;
  714. display: flex;
  715. justify-content: center;
  716. align-items: center;
  717. flex-direction: column;
  718. .pop {
  719. z-index: 12;
  720. width: 560rpx;
  721. height: 379rpx;
  722. background: rgba(255, 255, 255, 1);
  723. border-radius: 30px;
  724. .pop-box {
  725. width: 100%;
  726. height: 100%;
  727. display: flex;
  728. flex-direction: column;
  729. text-align: center;
  730. align-items: center;
  731. margin-top: -72rpx !important;
  732. .pop-img {
  733. width: 177rpx;
  734. height: 186rpx;
  735. margin-bottom: 34rpx;
  736. }
  737. .pop-title {
  738. height: 34rpx;
  739. font-size: 36rpx;
  740. font-weight: 500;
  741. color: rgba(51, 51, 51, 1);
  742. margin-bottom: 32rpx;
  743. }
  744. .number {
  745. width: 454rpx;
  746. height: 78rpx;
  747. background: rgba(234, 234, 234, 1);
  748. background: #eaeaea;
  749. }
  750. }
  751. //关闭按钮
  752. .close-box {
  753. margin-top: 130rpx;
  754. text-align: center;
  755. .close {
  756. width: 83rpx;
  757. height: 83rpx;
  758. }
  759. }
  760. }
  761. }
  762. /* load-more */
  763. .uni-load-more {
  764. display: flex;
  765. flex-direction: row;
  766. height: 80rpx;
  767. align-items: center;
  768. justify-content: center;
  769. }
  770. .uni-load-more__text {
  771. font-size: 28rpx;
  772. color: #999;
  773. }
  774. .uni-load-more__img {
  775. height: 24px;
  776. width: 24px;
  777. margin-right: 10px;
  778. }
  779. .uni-load-more__img > view {
  780. position: absolute;
  781. }
  782. .uni-load-more__img > view view {
  783. width: 6px;
  784. height: 2px;
  785. border-top-left-radius: 1px;
  786. border-bottom-left-radius: 1px;
  787. background: #999;
  788. position: absolute;
  789. opacity: 0.2;
  790. transform-origin: 50%;
  791. animation: load 1.56s ease infinite;
  792. }
  793. .uni-load-more__img > view view:nth-child(1) {
  794. transform: rotate(90deg);
  795. top: 2px;
  796. left: 9px;
  797. }
  798. .uni-load-more__img > view view:nth-child(2) {
  799. transform: rotate(180deg);
  800. top: 11px;
  801. right: 0;
  802. }
  803. .uni-load-more__img > view view:nth-child(3) {
  804. transform: rotate(270deg);
  805. bottom: 2px;
  806. left: 9px;
  807. }
  808. .uni-load-more__img > view view:nth-child(4) {
  809. top: 11px;
  810. left: 0;
  811. }
  812. .load1,
  813. .load2,
  814. .load3 {
  815. height: 24px;
  816. width: 24px;
  817. }
  818. .load2 {
  819. transform: rotate(30deg);
  820. }
  821. .load3 {
  822. transform: rotate(60deg);
  823. }
  824. .load1 view:nth-child(1) {
  825. animation-delay: 0s;
  826. }
  827. .load2 view:nth-child(1) {
  828. animation-delay: 0.13s;
  829. }
  830. .load3 view:nth-child(1) {
  831. animation-delay: 0.26s;
  832. }
  833. .load1 view:nth-child(2) {
  834. animation-delay: 0.39s;
  835. }
  836. .load2 view:nth-child(2) {
  837. animation-delay: 0.52s;
  838. }
  839. .load3 view:nth-child(2) {
  840. animation-delay: 0.65s;
  841. }
  842. .load1 view:nth-child(3) {
  843. animation-delay: 0.78s;
  844. }
  845. .load2 view:nth-child(3) {
  846. animation-delay: 0.91s;
  847. }
  848. .load3 view:nth-child(3) {
  849. animation-delay: 1.04s;
  850. }
  851. .load1 view:nth-child(4) {
  852. animation-delay: 1.17s;
  853. }
  854. .load2 view:nth-child(4) {
  855. animation-delay: 1.3s;
  856. }
  857. .load3 view:nth-child(4) {
  858. animation-delay: 1.43s;
  859. }
  860. @-webkit-keyframes load {
  861. 0% {
  862. opacity: 1;
  863. }
  864. 100% {
  865. opacity: 0.2;
  866. }
  867. }
  868. </style>