order.vue 23 KB

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