order.vue 22 KB

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