index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771
  1. <template>
  2. <view>
  3. <view class="car_list">
  4. <view v-for="(pItem, pIndex) in cartListByGroup" :key="pIndex" style="margin-bottom: 20rpx">
  5. <view class="business_name" v-if="pItem.products.length !== 0">
  6. <image
  7. @click="selectBussiness(pIndex)"
  8. class="checkbox"
  9. :src="pItem.checked ? 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/checked.png' : 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/checkbox.png'"
  10. ></image
  11. >&nbsp;
  12. {{ pItem.business_name }}
  13. </view>
  14. <view class="product_group">
  15. <view v-for="(item, index) in pItem.products" @longpress="deleteCar(pIndex, index)" :key="index">
  16. <SwipeAction @clickItem="clickItem" :index="index" ref="swipeAction" :pIndex="pIndex">
  17. <view class="car_item">
  18. <view class="check_label" @click="checkedItem(pIndex, index, item.id)">
  19. <image
  20. class="checkbox"
  21. src="https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/checkbox_disabled.png"
  22. style="width: 30rpx; height: 30rpx"
  23. v-if="item.product_status !== 0 || item.stock == 0"
  24. />
  25. <image
  26. class="checkbox"
  27. :src="item.checked ? 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/checked.png' : 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/checkbox.png'"
  28. v-else
  29. ></image>
  30. </view>
  31. <view class="box_left">
  32. <navigator :url="'/pages/product/index?product_id=' + item.product_id">
  33. <image class="car_image" :src="item.thumb" mode=""></image>
  34. <view class="product_status" v-if="item.product_status !== 0">
  35. {{ item.stock == 0 ? '已售罄' : '已下架' }}
  36. </view>
  37. </navigator>
  38. </view>
  39. <view class="box_center">
  40. <navigator :url="'/pages/product/index?product_id=' + item.product_id" class="car_name">{{ item.name }}</navigator>
  41. <navigator :url="'/pages/product/index?product_id=' + item.product_id" class="car_spec">{{ item.spec }}</navigator>
  42. <view v-if="item.promo_title" class="promo_title">
  43. <text v-for="(promoText, index) in getPromoText(item.promo_title)" :key="index">{{ promoText }}</text>
  44. </view>
  45. <navigator :url="'/pages/product/index?product_id=' + item.product_id" class="car_price">
  46. <text class="price">¥{{ item.price }}</text>
  47. <text class="market_price">¥{{ item.market_price }}</text>
  48. </navigator>
  49. </view>
  50. <view class="box_right">
  51. <view class="buy_num_box">
  52. <button class="buy_num_sub" @click="changeQuantity(pIndex, index, -1)" data-eventsync="true">
  53. <image class="sub_icon" src="https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/sub_icon.png" mode=""></image>
  54. </button>
  55. <input type="number" class="buy_num" placeholder="数量" v-model="item.buy_num" @blur="changeQuantity(pIndex, index, 0)" />
  56. <button class="buy_num_add" @click="changeQuantity(pIndex, index, +1)" data-eventsync="true">
  57. <image class="add_icon" src="https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/add_icon.png" mode=""></image>
  58. </button>
  59. </view>
  60. <view class="pay_title">
  61. <text class="pay_title_text">{{ item.is_pay ? '支付商品' : '预约商品' }}</text>
  62. </view>
  63. </view>
  64. </view>
  65. </SwipeAction>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. <Empty v-if="cartList.length == 0" text="----- 还没有产品啦 -----" />
  71. <view class="to_bottom" v-if="cartList.length"> -----到底啦-----</view>
  72. <view class="bottom_box">
  73. <view class="check_all_label" @click="checkAll()">
  74. <image
  75. class="checkbox"
  76. :src="checkedAll ? 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/checked.png' : 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/checkbox.png'"
  77. ></image>
  78. <text class="checkall">全选</text>
  79. </view>
  80. <view class="price_box">
  81. <view style="display: flex; justify-content: flex-start; align-items: baseline; font-size: 24rpx">
  82. 已选{{ selectProductNum }}件,合计:<text class="price_total">¥{{ discountPrice }}</text></view
  83. >
  84. <view v-if="reductionMoney !== 0" style="display: flex; justify-content: flex-start; align-items: center; color: #999; font-size: 24rpx">
  85. 优惠减:<text>¥{{ reductionMoney.toFixed(2) }}</text>
  86. </view>
  87. </view>
  88. <view class="to_order" @click="toOrder()">{{ is_pay ? `${reductionMoney !== 0 ? '优惠' : ''}购买` : `${reductionMoney !== 0 ? '优惠' : ''}预约` }}</view>
  89. </view>
  90. <cc-myTabbar :tabBarShow="3"></cc-myTabbar>
  91. </view>
  92. </template>
  93. <script>
  94. import Empty from '@/components/Empty/Empty.vue';
  95. import SwipeAction from '@/components/SwipeAction/SwipeAction.vue';
  96. export default {
  97. components: { Empty, SwipeAction },
  98. data() {
  99. return {
  100. // 请求参数
  101. requestParam: {},
  102. // 是否全选
  103. checkedAll: false,
  104. // 总价
  105. priceTotal: '0.00',
  106. // 是否请求中
  107. isReqing: false,
  108. //购物车列表
  109. cartListByGroup: [],
  110. cartList: [],
  111. is_pay: 0,
  112. reductionMoney: 0,
  113. selectProductNum: 0,
  114. debounceTimer: null,
  115. changeQuantity: null,
  116. };
  117. },
  118. // 在created钩子中初始化
  119. created() {
  120. this.changeQuantity = this.debounce(this.handleQuantityChange);
  121. },
  122. onLoad() {
  123. // #ifdef MP-WEIXIN
  124. uni.hideTabBar();
  125. //分享按钮
  126. uni.showShareMenu({
  127. withShareTicket: true,
  128. menus: ['shareAppMessage', 'shareTimeline'],
  129. });
  130. // #endif
  131. },
  132. onShareAppMessage(obj) {
  133. // 获取分享信息
  134. let shareList = getApp().globalData.shareList;
  135. // 获取分享信息
  136. let shareObj = {
  137. title: '999智控终端平台\n药优惠 得积分 兑豪礼',
  138. path: '/pages/index/index',
  139. imageUrl: '',
  140. };
  141. // 循环列表
  142. for (let i in shareList) {
  143. if (shareList[i].pages == 'pages/car/index') {
  144. shareObj.path = shareList[i].path ? shareList[i].path : shareObj.path;
  145. shareObj.title = shareList[i].title ? `999智控终端平台\n${shareList[i].title}` : shareObj.title;
  146. shareObj.imageUrl = shareList[i].image_url ? shareList[i].image_url : shareObj.imageUrl;
  147. }
  148. }
  149. // 返回分享信息
  150. return shareObj;
  151. },
  152. onShow() {
  153. // 未登录不请求
  154. if (!this.$checkAccess.checkLogin()) return;
  155. // 请求中,不允许刷新
  156. if (this.isReqing) return;
  157. // 设置请求中
  158. this.isReqing = true;
  159. // 非全选
  160. this.checkedAll = 0;
  161. // 请求列表
  162. this.$http.request('api/shop_cart/get_list', this.requestParam).then((re) => {
  163. // 设置非请求中
  164. this.isReqing = false;
  165. // 成功结果
  166. if (re.code == 'success') {
  167. // 赋值
  168. this.cartListByGroup = this.formatGroupedData(re.data);
  169. this.cartList = re.data;
  170. // 计算价格
  171. this.priceHandler();
  172. }
  173. });
  174. },
  175. onPullDownRefresh() {
  176. // 未登录不请求
  177. if (!this.$checkAccess.checkLogin()) return;
  178. // 请求列表
  179. this.$http.request('api/shop_cart/get_list', this.requestParam).then((re) => {
  180. if (re.code == 'success') {
  181. // 赋值
  182. this.cartListByGroup = this.formatGroupedData(re.data);
  183. this.cartList = re.data;
  184. // 计算价格
  185. this.priceHandler();
  186. }
  187. });
  188. uni.stopPullDownRefresh();
  189. },
  190. onReachBottom() {},
  191. methods: {
  192. // 转换为数组格式
  193. formatGroupedData(list) {
  194. const groupedData = list.reduce((result, item) => {
  195. const { business_id, business_name } = item;
  196. // 如果该 business_id 的分组不存在,则初始化该分组
  197. if (!result[business_id]) {
  198. result[business_id] = {
  199. business_id,
  200. business_name,
  201. products: [],
  202. checked: false,
  203. };
  204. }
  205. // 将商品添加到对应的 business_id 分组
  206. result[business_id].products.push(item);
  207. return result;
  208. }, {});
  209. return groupedData;
  210. },
  211. //选择商业公司下面的所有商品
  212. selectBussiness(index) {
  213. this.cartListByGroup[index].checked = !this.cartListByGroup[index].checked;
  214. this.cartListByGroup[index].products.forEach((item) => {
  215. if (item.product_status == 0 && item.stock !== 0) item.checked = this.cartListByGroup[index].checked;
  216. });
  217. // 计算价格
  218. this.priceHandler();
  219. },
  220. debounce(fn, delay = 500) {
  221. return (...args) => {
  222. if (this.debounceTimer) {
  223. clearTimeout(this.debounceTimer);
  224. }
  225. this.debounceTimer = setTimeout(() => {
  226. fn.apply(this, args);
  227. }, delay);
  228. };
  229. },
  230. // 数量调整
  231. handleQuantityChange(pIndex, index, number) {
  232. //修改数量重新计算折扣
  233. // 如果不是0.表示两侧按钮点击,0表示输入的修改
  234. if (number != 0) {
  235. // 计算个数
  236. this.cartListByGroup[pIndex].products[index].buy_num = Number(this.cartListByGroup[pIndex].products[index].buy_num) + Number(number);
  237. }
  238. // 如果大于库存
  239. if (this.cartListByGroup[pIndex].products[index].buy_num > this.cartListByGroup[pIndex].products[index].stock) {
  240. // 设置为库存
  241. this.cartListByGroup[pIndex].products[index].buy_num = this.cartListByGroup[pIndex].products[index].stock;
  242. // 提示
  243. uni.showToast({
  244. title: '购买数量不能大于库存',
  245. icon: 'none',
  246. });
  247. return;
  248. }
  249. // 如果小于1.设置为1
  250. if (this.cartListByGroup[pIndex].products[index].buy_num < 1) {
  251. // 恢复1
  252. this.cartListByGroup[pIndex].products[index].buy_num = 1;
  253. // 提示
  254. uni.showToast({
  255. title: '数量不可小于1',
  256. icon: 'none',
  257. });
  258. return;
  259. }
  260. // 请求列表
  261. this.$http
  262. .request('api/shop_cart/edit', {
  263. id: this.cartListByGroup[pIndex].products[index].id,
  264. buy_num: this.cartListByGroup[pIndex].products[index].buy_num,
  265. })
  266. .then((re) => {
  267. if (re.code == 'success') {
  268. // 计算价格
  269. this.cartListByGroup[pIndex].products[index].buy_num = re.data.buy_num;
  270. this.priceHandler();
  271. } else {
  272. uni.showToast({
  273. title: re.msg,
  274. icon: 'none',
  275. });
  276. }
  277. });
  278. },
  279. // 删除购物车
  280. deleteCar(pIndex, index) {
  281. uni.showModal({
  282. title: '是否删除?',
  283. success: (re) => {
  284. if (re.confirm) {
  285. // 请求列表
  286. this.$http
  287. .request('api/shop_cart/del', {
  288. id: this.cartListByGroup[pIndex].products[index].id,
  289. })
  290. .then((re) => {
  291. // 如果删除成功的话
  292. if (re.code == 'success') {
  293. this.cartListByGroup[pIndex].products.splice(index, 1);
  294. // 计算价格
  295. this.priceHandler();
  296. if (this.$refs.swipeAction.length) {
  297. this.$refs.swipeAction[this.$refs.swipeAction.length - 1]?.reset();
  298. }
  299. }
  300. });
  301. } else {
  302. this.$refs.swipeAction[this.$refs.swipeAction.length - 1]?.reset();
  303. }
  304. },
  305. });
  306. },
  307. checkedItem(pIndex, index, product_id) {
  308. const product = this.cartListByGroup[pIndex].products[index];
  309. // 如果商品不可选中,直接返回
  310. if (product.product_status !== 0 || product.stock === 0) {
  311. return;
  312. }
  313. // 切换选中状态
  314. const isChecked = (product.checked = !product.checked);
  315. // 找到对应商家组中的商品并更新选中状态
  316. const productInGroup = this.cartListByGroup[pIndex].products.find((item) => item.id === product_id);
  317. if (productInGroup) {
  318. productInGroup.checked = isChecked;
  319. }
  320. // 检查该商家组内所有商品是否都已选中
  321. const checkedBussinessAll = this.cartListByGroup[pIndex].products.every((item) => item.checked);
  322. // 更新商家组的全选状态
  323. this.cartListByGroup[pIndex].checked = checkedBussinessAll;
  324. // 检查是否所有商品都已选中
  325. let checkedAll = true;
  326. for (const key in this.cartListByGroup) {
  327. if (!this.cartListByGroup[key].checked) {
  328. checkedAll = false;
  329. }
  330. }
  331. // 更新全选状态
  332. this.checkedAll = checkedAll ? 1 : 0;
  333. // 计算价格
  334. this.priceHandler();
  335. },
  336. checkAll() {
  337. // 设置全选/单选
  338. this.checkedAll = this.checkedAll ? 0 : 1;
  339. // 循环处理
  340. for (const index in this.cartListByGroup) {
  341. this.cartListByGroup[index].checked = this.checkedAll;
  342. this.cartListByGroup[index].products.forEach((item) => {
  343. if (item.product_status == 0 && item.stock !== 0) item.checked = this.checkedAll;
  344. });
  345. }
  346. // 计算价格
  347. this.priceHandler();
  348. },
  349. priceHandler() {
  350. // 总价格
  351. let priceTotal = 0;
  352. let pay_status = false;
  353. let reservation_status = false;
  354. // 循环处理
  355. for (const index in this.cartListByGroup) {
  356. this.cartListByGroup[index].products.forEach((item) => {
  357. if (item.checked) {
  358. priceTotal = this.$decimal.add(priceTotal, this.$decimal.mul(item.price, item.buy_num));
  359. if (item.is_pay == 0) {
  360. reservation_status = true;
  361. }
  362. if (item.is_pay == 1) {
  363. pay_status = true;
  364. }
  365. }
  366. });
  367. }
  368. if (pay_status && reservation_status) {
  369. this.is_pay = 2;
  370. } else if (pay_status) {
  371. this.is_pay = 1;
  372. } else if (reservation_status) {
  373. this.is_pay = 0;
  374. } else {
  375. this.is_pay = 0;
  376. }
  377. console.log(this.is_pay);
  378. // 小数点处理
  379. this.priceTotal = priceTotal.toFixed(2);
  380. },
  381. toOrder() {
  382. // 等待支付的信息
  383. let waitList = [];
  384. if (this.is_pay == 2) {
  385. uni.showToast({ icon: 'none', title: '混合商品,无法下单' });
  386. return;
  387. }
  388. // 循环处理
  389. for (let index in this.cartListByGroup) {
  390. // 如果选中的
  391. for (const key in this.cartListByGroup[index].products) {
  392. if (this.cartListByGroup[index].products[key].checked) {
  393. // 如果库存不足
  394. if (this.cartListByGroup[index].products[key].buy_num < 1) {
  395. uni.showToast({ icon: 'none', title: '选择的产品至少需要1个' });
  396. return;
  397. }
  398. // 如果库存不足
  399. if (this.cartListByGroup[index].products[key].buy_num > this.cartListByGroup[index].products[key].stock) {
  400. uni.showToast({ icon: 'none', title: '产品库存不足' });
  401. return;
  402. }
  403. waitList.push(this.cartListByGroup[index].products[key].id);
  404. }
  405. }
  406. }
  407. // 如果没有选择
  408. if (!waitList.length) {
  409. uni.showToast({ icon: 'none', title: '请选择需要结算的产品' });
  410. return;
  411. }
  412. // 如果没有选择
  413. if (waitList.length > 99) {
  414. uni.showToast({ icon: 'none', title: '这么多产品一个预约单写不下哦' });
  415. return;
  416. }
  417. uni.navigateTo({
  418. url: '/pages/car/order?cart_ids=' + waitList.join(','),
  419. });
  420. },
  421. clickItem(e) {
  422. this.deleteCar(e.pIndex, e.index);
  423. },
  424. },
  425. watch: {
  426. priceTotal: {
  427. handler(newVal, oldVal) {
  428. // 计算价格
  429. // this.priceHandler();
  430. let waitList = [];
  431. // 循环处理
  432. for (let index in this.cartListByGroup) {
  433. // 如果选中的
  434. for (const key in this.cartListByGroup[index].products) {
  435. if (this.cartListByGroup[index].products[key].checked) {
  436. // // 如果库存不足
  437. // if (newVal[index].products[key].buy_num < 1) {
  438. // uni.showToast({ icon: 'none', title: '选择的产品至少需要1个' });
  439. // return;
  440. // }
  441. // // 如果库存不足
  442. // if (newVal[index].products[key].buy_num > newVal[index].products[key].stock) {
  443. // uni.showToast({ icon: 'none', title: '产品库存不足' });
  444. // return;
  445. // }
  446. waitList.push(this.cartListByGroup[index].products[key].id);
  447. }
  448. }
  449. }
  450. this.selectProductNum = waitList.length;
  451. if (waitList.length > 0) {
  452. this.$http.request('api/shop_cart/check_list', { cart_ids: waitList.join(',') }).then((re) => {
  453. if (re.code == 'success') {
  454. this.reductionMoney = re.reduction;
  455. this.priceHandler();
  456. }
  457. });
  458. } else {
  459. this.reductionMoney = 0;
  460. this.priceHandler();
  461. }
  462. },
  463. deep: true,
  464. },
  465. },
  466. computed: {
  467. getPromoText() {
  468. return (promo_title) => {
  469. //在逗号增加换行符
  470. if (!promo_title) return [];
  471. return promo_title.split(';');
  472. };
  473. },
  474. discountPrice() {
  475. return this.$decimal.sub(this.priceTotal, this.reductionMoney).toFixed(2);
  476. },
  477. },
  478. };
  479. </script>
  480. <style lang="less">
  481. .car_list {
  482. display: block;
  483. overflow: hidden;
  484. margin: 0rpx auto;
  485. margin-top: 20rpx;
  486. padding-bottom: 110rpx;
  487. .business_name {
  488. padding: 8rpx 10rpx;
  489. border-bottom: 1px solid #f3f3f3;
  490. font-size: 32rpx;
  491. z-index: 1;
  492. display: flex;
  493. align-items: center;
  494. background-color: #fff;
  495. .checkbox {
  496. width: 40rpx;
  497. height: 40rpx;
  498. }
  499. .business_icon {
  500. width: 48rpx;
  501. height: 48rpx;
  502. margin-right: 10rpx;
  503. }
  504. }
  505. .car_item {
  506. height: 180rpx;
  507. display: block;
  508. background: #ffffff;
  509. margin: 0rpx auto;
  510. padding: 20rpx 0rpx 0;
  511. position: relative;
  512. .delete_btn {
  513. position: absolute;
  514. top: 0;
  515. right: 0;
  516. bottom: 0;
  517. width: 80px;
  518. background-color: #f44336;
  519. color: #fff;
  520. display: flex;
  521. justify-content: center;
  522. align-items: center;
  523. }
  524. .swipe-content {
  525. transition: transform 0.3s ease;
  526. }
  527. .check_label {
  528. float: left;
  529. width: 40rpx;
  530. height: 40rpx;
  531. display: flex;
  532. align-items: center;
  533. justify-content: center;
  534. margin-top: 10rpx;
  535. padding: 50rpx 20rpx;
  536. .checkbox {
  537. float: left;
  538. width: 40rpx;
  539. height: 40rpx;
  540. }
  541. }
  542. .box_left {
  543. float: left;
  544. width: 140rpx;
  545. height: 200rpx;
  546. margin-top: 10rpx;
  547. position: relative;
  548. .car_image {
  549. width: 140rpx;
  550. height: 140rpx;
  551. border-radius: 5rpx;
  552. }
  553. .product_status {
  554. position: absolute;
  555. width: 100%;
  556. height: 40rpx;
  557. bottom: 60rpx;
  558. display: flex;
  559. justify-content: center;
  560. align-items: center;
  561. font-size: 24rpx;
  562. background-color: #999999;
  563. }
  564. }
  565. .box_center {
  566. float: left;
  567. width: 300rpx;
  568. margin-left: 25rpx;
  569. .car_name {
  570. max-height: 60rpx;
  571. font-size: 30rpx;
  572. line-height: 30rpx;
  573. overflow: hidden;
  574. white-space: nowrap; /* 不换行 */
  575. overflow: hidden; /* 隐藏超出的内容 */
  576. text-overflow: ellipsis; /* 用省略号表示被隐藏的部分 */
  577. }
  578. .promo_title {
  579. max-width: 240rpx;
  580. font-size: 20rpx;
  581. line-height: 40rpx;
  582. overflow: hidden;
  583. padding: 0rpx 0rpx;
  584. color: #dd524d;
  585. display: flex;
  586. flex-direction: column;
  587. //超出省省略号
  588. // white-space: nowrap; /* 不换行 */
  589. // overflow: hidden; /* 隐藏超出的内容 */
  590. // text-overflow: ellipsis; /* 用省略号表示被隐藏的部分 */
  591. }
  592. .car_spec {
  593. color: #999999;
  594. font-size: 24rpx;
  595. max-height: 60rpx;
  596. line-height: 60rpx;
  597. overflow: hidden;
  598. }
  599. .car_price {
  600. font-size: 30rpx;
  601. line-height: 60rpx;
  602. .price {
  603. color: red;
  604. }
  605. .market_price {
  606. font-size: 24rpx;
  607. color: #999999;
  608. margin-left: 10rpx;
  609. padding-left: 10rpx;
  610. text-decoration: line-through;
  611. border-left: 2rpx solid #dddddd;
  612. }
  613. }
  614. }
  615. .box_right {
  616. float: right;
  617. width: 185rpx;
  618. padding-right: 15rpx;
  619. .buy_num_box {
  620. float: right;
  621. color: #333333;
  622. overflow: hidden;
  623. font-size: 24rpx;
  624. margin-top: 70rpx;
  625. text-align: center;
  626. .buy_num_sub {
  627. float: left;
  628. border: none;
  629. height: 36rpx;
  630. background: none;
  631. text-align: center;
  632. line-height: 36rpx;
  633. padding: 10rpx 10rpx;
  634. .sub_icon {
  635. width: 22rpx;
  636. height: 22rpx;
  637. display: block;
  638. }
  639. }
  640. .buy_num_sub::after {
  641. border: none;
  642. background: none;
  643. }
  644. .buy_num {
  645. float: left;
  646. width: 90rpx;
  647. height: 36rpx;
  648. font-size: 24rpx;
  649. min-height: 36rpx;
  650. line-height: 36rpx;
  651. padding: 0rpx 0rpx;
  652. border-radius: 8rpx;
  653. border: 2rpx solid #dddddd;
  654. }
  655. .buy_num_add {
  656. float: left;
  657. border: none;
  658. height: 36rpx;
  659. background: none;
  660. text-align: center;
  661. padding: 10rpx 10rpx;
  662. line-height: 36rpx;
  663. .add_icon {
  664. width: 22rpx;
  665. height: 22rpx;
  666. display: block;
  667. }
  668. }
  669. .buy_num_add::after {
  670. border: none;
  671. background: none;
  672. }
  673. }
  674. .pay_title {
  675. float: right;
  676. color: red;
  677. overflow: hidden;
  678. font-size: 24rpx;
  679. margin-top: 40rpx;
  680. text-align: center;
  681. }
  682. }
  683. }
  684. }
  685. .bottom_box {
  686. z-index: 999;
  687. left: 0rpx;
  688. width: 100%;
  689. height: 120rpx;
  690. display: block;
  691. position: fixed;
  692. overflow: hidden;
  693. background: #ffffff;
  694. padding: 0rpx 35rpx;
  695. bottom: 140rpx;
  696. display: flex;
  697. align-items: center;
  698. .check_all_label {
  699. float: left;
  700. width: 120rpx;
  701. height: 40rpx;
  702. font-size: 24rpx;
  703. line-height: 40rpx;
  704. padding: 30rpx 0rpx;
  705. .checkbox {
  706. float: left;
  707. width: 40rpx;
  708. height: 40rpx;
  709. }
  710. .checkbox.active {
  711. border: 2rpx solid red;
  712. .checkbox_active {
  713. background-color: #f89c33;
  714. }
  715. }
  716. .checkall {
  717. float: left;
  718. height: 40rpx;
  719. display: block;
  720. margin-left: 10rpx;
  721. line-height: 40rpx;
  722. }
  723. }
  724. .price_box {
  725. float: left;
  726. width: 400rpx;
  727. display: flex;
  728. flex-direction: column;
  729. color: #666666;
  730. font-size: 26rpx;
  731. text-align: right;
  732. margin-right: 20rpx;
  733. .price_total {
  734. color: red;
  735. font-size: 36rpx;
  736. }
  737. }
  738. .to_order {
  739. float: left;
  740. width: 140rpx;
  741. height: 60rpx;
  742. display: block;
  743. color: #ffffff;
  744. font-size: 28rpx;
  745. line-height: 60rpx;
  746. padding: 0rpx 0rpx;
  747. text-align: center;
  748. border-radius: 30rpx;
  749. background-color: #f89c33;
  750. }
  751. }
  752. </style>