cart.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056
  1. <template>
  2. <view class="container">
  3. <view class="no-login" v-if="!hasLogin">
  4. <view class="c">
  5. <text>您还没有注册</text>
  6. <button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
  7. <image class="wechat" src="/static/images/wechat.png"></image>
  8. 点击授权微信登录
  9. </button>
  10. </view>
  11. </view>
  12. <view class="login" v-else>
  13. <!--<view class="service-policy">
  14. <view class="item">30天无忧退货</view>
  15. <view class="item">48小时快速退款</view>
  16. <view class="item">满88元免邮费</view>
  17. </view>-->
  18. <view class="no-cart" v-if="cartGoods.length <= 0">
  19. <view class="c">
  20. <image src="/static/static/images/cart.png" @tap="goIndex"></image>
  21. <text>空空如也~</text>
  22. <text>去添加点什么吧</text>
  23. </view>
  24. </view>
  25. <view class="cart-view" v-else>
  26. <view class="list">
  27. <view class="group-item">
  28. <view class="goods">
  29. <!-- <view class="item {{isEditCart ? 'edit' : ''}}" wx:for="{{cartGoods}}" wx:key="id">
  30. <van-checkbox value="{{ item.checked }}" bind:change="checkedItem" data-item-index="{{index}}"></van-checkbox>
  31. <view class="cart-goods">
  32. <image class="img" src="{{item.picUrl}}"></image>
  33. <view class="info">
  34. <view class="t">
  35. <text class="name">{{item.goodsName}}</text>
  36. <text class="num">x{{item.number}}</text>
  37. </view>
  38. <view class="attr">{{ isEditCart ? '已选择:' : ''}}{{item.specifications||''}}</view>
  39. <view class="b">
  40. <text class="price">¥{{item.price}}</text>
  41. <view class="selnum">
  42. <view class="cut" bindtap="cutNumber" data-item-index="{{index}}">-</view>
  43. <input value="{{item.number}}" class="number" disabled="true" type="number" />
  44. <view class="add" bindtap="addNumber" data-item-index="{{index}}">+</view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </view>-->
  50. <view class="item edit" v-for="(item, index) in cartGoods" :key="index">
  51. <van-checkbox :value="item.checked" @change="checkedItem($event, { itemIndex: index })" :data-item-index="index"></van-checkbox>
  52. <view class="cart-goods">
  53. <image class="img" :src="item.picUrl"></image>
  54. <view class="info">
  55. <view class="t">
  56. <text class="name">{{ item.goodsName }}</text>
  57. <!-- <text class="num">x{{item.number}}</text> -->
  58. </view>
  59. <view class="attr">{{ item.specifications || '' }}</view>
  60. <view class="b">
  61. <text class="price">¥{{ item.price }}</text>
  62. <view class="selnum">
  63. <view class="cut" @tap="cutNumber" :data-item-index="index">-</view>
  64. <input :value="item.number" class="number" :disabled="true" type="number" />
  65. <view class="add" @tap="addNumber" :data-item-index="index">+</view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. <view class="cart-bottom">
  75. <van-checkbox :value="checkedAllStatus" @change="checkedAll">全选({{ cartTotal.checkedGoodsCount }})</van-checkbox>
  76. <view class="total">合计:{{ '¥' + cartTotal.checkedGoodsAmount }}</view>
  77. <view class="action_btn_area">
  78. <!--<view class="{{!isEditCart ? 'edit' : 'sure'}}" bindtap="editCart">{{!isEditCart ? '编辑' : '完成'}}</view>
  79. <view class="delete" bindtap="deleteCart" wx:if="{{isEditCart}}">删除({{cartTotal.checkedGoodsCount}})</view>-->
  80. <view class="checkout" @tap="checkoutOrder">结算</view>
  81. <!-- </view> -->
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. </template>
  88. <script>
  89. var util = require('../../../utils/util.js');
  90. var api = require('../../../config/api.js');
  91. var user = require('../../../utils/user.js');
  92. var app = getApp();
  93. export default {
  94. data() {
  95. return {
  96. cartGoods: [],
  97. cartTotal: {
  98. goodsCount: 0,
  99. goodsAmount: 0,
  100. checkedGoodsCount: 0,
  101. checkedGoodsAmount: 0
  102. },
  103. isEditCart: false,
  104. checkedAllStatus: true,
  105. editCartList: [],
  106. hasLogin: false
  107. };
  108. },
  109. onLoad: function (options) {
  110. // 页面初始化 options为页面跳转所带来的参数
  111. },
  112. onReady: function () {
  113. // 页面渲染完成
  114. },
  115. onPullDownRefresh() {
  116. uni.showNavigationBarLoading(); //在标题栏中显示加载
  117. this.getCartList();
  118. uni.hideNavigationBarLoading(); //完成停止加载
  119. uni.stopPullDownRefresh(); //停止下拉刷新
  120. },
  121. onShow: function () {
  122. console.info(app.globalData.hasLogin);
  123. let that = this;
  124. if (app.globalData.hasLogin) {
  125. that.setData({
  126. hasLogin: app.globalData.hasLogin
  127. });
  128. that.getCartList();
  129. } else {
  130. app.globalData.checkLoginReadyCallback = (res) => {
  131. this.setData({
  132. hasLogin: true
  133. });
  134. that.getCartList();
  135. };
  136. }
  137. },
  138. onHide: function () {
  139. // 页面隐藏
  140. },
  141. onUnload: function () {
  142. // 页面关闭
  143. },
  144. methods: {
  145. goIndex: function () {
  146. uni.switchTab({
  147. url: '/pages/index/index'
  148. });
  149. },
  150. getPhoneNumber: function (e) {
  151. let that = this;
  152. var ivObj = e.detail.iv;
  153. var telObj = e.detail.encryptedData;
  154. let r_userid = uni.getStorageSync('r_userid');
  155. if (r_userid == null || r_userid == '') {
  156. r_userid = 0;
  157. }
  158. //------执行Login---------
  159. uni.login({
  160. success: (res) => {
  161. util.request(api.AuthRegister, {
  162. code: res.code,
  163. encryptedData: telObj,
  164. iv: ivObj,
  165. r_userid: r_userid
  166. }).then(function (res) {
  167. if (res.errno === 0) {
  168. that.setData({
  169. hasLogin: true
  170. });
  171. //存储用户信息
  172. app.globalData.hasLogin = true;
  173. uni.setStorageSync('userInfo', res.data.userInfo);
  174. uni.setStorageSync('token', res.data.token);
  175. uni.showToast({
  176. title: '授权注册成功',
  177. icon: 'success',
  178. duration: 2000
  179. });
  180. }
  181. });
  182. }
  183. });
  184. //-----------------是否授权,授权通过进入主页面,授权拒绝则停留在登陆界面
  185. if (e.detail.errMsg == 'getPhoneNumber:fail user deny') {
  186. //用户点击拒绝
  187. uni.showModal({
  188. title: '警告',
  189. content: '您点击了拒绝授权,部分功能无法使用!!!',
  190. showCancel: false,
  191. confirmText: '确定',
  192. success: function (res) {
  193. // 用户没有授权成功,不需要改变 isHide 的值
  194. if (res.confirm) {
  195. uni.switchTab({
  196. url: '/pages/index/index'
  197. });
  198. }
  199. }
  200. });
  201. }
  202. },
  203. getCartList: function () {
  204. let that = this;
  205. util.request(api.CartList).then(function (res) {
  206. if (res.errno === 0) {
  207. that.setData({
  208. cartGoods: res.data.cartList,
  209. cartTotal: res.data.cartTotal
  210. });
  211. that.setData({
  212. checkedAllStatus: that.isCheckedAll()
  213. });
  214. //显示购物车角标
  215. if (res.data.cartTotal != null) {
  216. uni.setStorageSync('cartcount', res.data.cartTotal.goodsCount);
  217. user.cartshow();
  218. }
  219. }
  220. });
  221. },
  222. isCheckedAll: function () {
  223. //判断购物车商品已全选
  224. return this.cartGoods.every(function (element, index, array) {
  225. if (element.checked == true) {
  226. return true;
  227. } else {
  228. return false;
  229. }
  230. });
  231. },
  232. doCheckedAll: function () {
  233. let checkedAll = this.isCheckedAll();
  234. this.setData({
  235. checkedAllStatus: this.isCheckedAll()
  236. });
  237. },
  238. checkedItem: function (event, _dataset) {
  239. /* ---处理dataset begin--- */
  240. this.handleDataset(event, _dataset);
  241. /* ---处理dataset end--- */
  242. let itemIndex = event.target.dataset.itemIndex;
  243. let that = this;
  244. let productIds = [];
  245. productIds.push(that.cartGoods[itemIndex].productId);
  246. if (!this.isEditCart) {
  247. util.request(
  248. api.CartChecked,
  249. {
  250. productIds: productIds,
  251. isChecked: that.cartGoods[itemIndex].checked ? 0 : 1
  252. },
  253. 'POST'
  254. ).then(function (res) {
  255. if (res.errno === 0) {
  256. that.setData({
  257. cartGoods: res.data.cartList,
  258. cartTotal: res.data.cartTotal
  259. });
  260. }
  261. that.setData({
  262. checkedAllStatus: that.isCheckedAll()
  263. });
  264. });
  265. } else {
  266. //编辑状态
  267. let tmpCartData = this.cartGoods.map(function (element, index, array) {
  268. if (index == itemIndex) {
  269. element.checked = !element.checked;
  270. }
  271. return element;
  272. });
  273. that.setData({
  274. cartGoods: tmpCartData,
  275. checkedAllStatus: that.isCheckedAll(),
  276. 'cartTotal.checkedGoodsCount': that.getCheckedGoodsCount()
  277. });
  278. }
  279. },
  280. getCheckedGoodsCount: function () {
  281. let checkedGoodsCount = 0;
  282. this.cartGoods.forEach(function (v) {
  283. if (v.checked === true) {
  284. checkedGoodsCount += v.number;
  285. }
  286. });
  287. console.log(checkedGoodsCount);
  288. return checkedGoodsCount;
  289. },
  290. getCheckedGoodsAmount: function () {
  291. let checkedGoodsAmount = 0;
  292. this.cartGoods.forEach(function (v) {
  293. if (v.checked === true) {
  294. checkedGoodsAmount += v.number * v.price;
  295. }
  296. });
  297. return checkedGoodsAmount.toFixed(2);
  298. },
  299. checkedAll: function () {
  300. let that = this;
  301. if (!this.isEditCart) {
  302. var productIds = this.cartGoods.map(function (v) {
  303. return v.productId;
  304. });
  305. util.request(
  306. api.CartChecked,
  307. {
  308. productIds: productIds,
  309. isChecked: that.isCheckedAll() ? 0 : 1
  310. },
  311. 'POST'
  312. ).then(function (res) {
  313. if (res.errno === 0) {
  314. console.log(res.data);
  315. that.setData({
  316. cartGoods: res.data.cartList,
  317. cartTotal: res.data.cartTotal
  318. });
  319. }
  320. that.setData({
  321. checkedAllStatus: that.isCheckedAll()
  322. });
  323. });
  324. } else {
  325. //编辑状态
  326. let checkedAllStatus = that.isCheckedAll();
  327. let tmpCartData = this.cartGoods.map(function (v) {
  328. v.checked = !checkedAllStatus;
  329. return v;
  330. });
  331. that.setData({
  332. cartGoods: tmpCartData,
  333. checkedAllStatus: that.isCheckedAll(),
  334. 'cartTotal.checkedGoodsCount': that.getCheckedGoodsCount()
  335. });
  336. }
  337. },
  338. editCart: function () {
  339. var that = this;
  340. if (this.isEditCart) {
  341. this.getCartList();
  342. this.setData({
  343. isEditCart: !this.isEditCart
  344. });
  345. } else {
  346. //编辑状态
  347. let tmpCartList = this.cartGoods.map(function (v) {
  348. v.checked = false;
  349. return v;
  350. });
  351. this.setData({
  352. editCartList: this.cartGoods,
  353. cartGoods: tmpCartList,
  354. isEditCart: !this.isEditCart,
  355. checkedAllStatus: that.isCheckedAll(),
  356. 'cartTotal.checkedGoodsCount': that.getCheckedGoodsCount()
  357. });
  358. }
  359. },
  360. updateCart: function (productId, goodsId, number, id) {
  361. let that = this;
  362. util.request(
  363. api.CartUpdate,
  364. {
  365. productId: productId,
  366. goodsId: goodsId,
  367. number: number,
  368. id: id
  369. },
  370. 'POST'
  371. ).then(function (res) {
  372. that.setData({
  373. checkedAllStatus: that.isCheckedAll()
  374. });
  375. });
  376. },
  377. cutNumber: function (event) {
  378. let that = this;
  379. let itemIndex = event.target.dataset.itemIndex;
  380. let cartItem = this.cartGoods[itemIndex];
  381. //删除操作
  382. if (cartItem.number == 1) {
  383. uni.showModal({
  384. title: '提醒',
  385. content: '确定从购物车删除?',
  386. success(res) {
  387. if (res.confirm) {
  388. that.deleteCartGoods([cartItem.productId]);
  389. }
  390. }
  391. });
  392. } else {
  393. let number = cartItem.number - 1 > 1 ? cartItem.number - 1 : 1;
  394. cartItem.number = number;
  395. this.setData({
  396. cartGoods: this.cartGoods,
  397. 'cartTotal.checkedGoodsAmount': that.getCheckedGoodsAmount(),
  398. 'cartTotal.checkedGoodsCount': that.getCheckedGoodsCount()
  399. });
  400. this.updateCart(cartItem.productId, cartItem.goodsId, number, cartItem.id);
  401. //显示tab购物车
  402. user.cartadd(-1);
  403. }
  404. },
  405. addNumber: function (event) {
  406. let that = this;
  407. let itemIndex = event.target.dataset.itemIndex;
  408. let cartItem = this.cartGoods[itemIndex];
  409. console.log(cartItem);
  410. if (cartItem.goodsSn == '1036016') {
  411. uni.showToast({
  412. title: '此款商品只能购买一个',
  413. icon: 'none',
  414. duration: 2000
  415. });
  416. var number = 1;
  417. } else {
  418. var number = cartItem.number + 1;
  419. //显示tab购物车
  420. user.cartadd(1);
  421. }
  422. cartItem.number = number;
  423. this.setData({
  424. cartGoods: this.cartGoods,
  425. 'cartTotal.checkedGoodsAmount': that.getCheckedGoodsAmount(),
  426. 'cartTotal.checkedGoodsCount': that.getCheckedGoodsCount()
  427. });
  428. this.updateCart(cartItem.productId, cartItem.goodsId, number, cartItem.id);
  429. },
  430. checkoutOrder: function () {
  431. //下单
  432. //获取已选择的商品
  433. let that = this;
  434. var checkedGoods = this.cartGoods.filter(function (element, index, array) {
  435. if (element.checked == true) {
  436. return true;
  437. } else {
  438. return false;
  439. }
  440. });
  441. if (checkedGoods.length <= 0) {
  442. return false;
  443. }
  444. // storage中设置了cartId,则是购物车购买
  445. try {
  446. uni.setStorageSync('cartId', 0);
  447. uni.navigateTo({
  448. url: '/pages/checkout/checkout'
  449. });
  450. } catch (e) {
  451. console.log('CatchClause', e);
  452. console.log('CatchClause', e);
  453. }
  454. },
  455. deleteCart: function () {
  456. //获取已选择的商品
  457. let that = this;
  458. let productIds = this.cartGoods.filter(function (element, index, array) {
  459. if (element.checked == true) {
  460. return true;
  461. } else {
  462. return false;
  463. }
  464. });
  465. if (productIds.length <= 0) {
  466. return false;
  467. }
  468. productIds = productIds.map(function (element, index, array) {
  469. if (element.checked == true) {
  470. return element.productId;
  471. }
  472. });
  473. util.request(
  474. api.CartDelete,
  475. {
  476. productIds: productIds
  477. },
  478. 'POST'
  479. ).then(function (res) {
  480. console.log(res);
  481. if (res.errno === 0) {
  482. let cartList = res.data.cartList.map((v) => {
  483. v.checked = false;
  484. return v;
  485. });
  486. that.setData({
  487. cartGoods: cartList,
  488. cartTotal: res.data.cartTotal
  489. });
  490. }
  491. that.setData({
  492. checkedAllStatus: that.isCheckedAll()
  493. });
  494. });
  495. },
  496. deleteCartGoods: function (productIds) {
  497. //获取已选择的商品
  498. let that = this;
  499. console.log(productIds);
  500. util.request(
  501. api.CartDelete,
  502. {
  503. productIds: productIds
  504. },
  505. 'POST'
  506. ).then(function (res) {
  507. console.log(res.data);
  508. if (res.errno === 0) {
  509. let cartList = res.data.cartList.map((v) => {
  510. v.checked = false;
  511. return v;
  512. });
  513. that.setData({
  514. cartGoods: cartList,
  515. cartTotal: res.data.cartTotal
  516. });
  517. user.cartadd(-1);
  518. user.cartshow();
  519. }
  520. that.setData({
  521. checkedAllStatus: that.isCheckedAll()
  522. });
  523. });
  524. }
  525. }
  526. };
  527. </script>
  528. <style>
  529. page {
  530. height: 100%;
  531. min-height: 100%;
  532. background: #f4f4f4;
  533. }
  534. .container {
  535. background: #f4f4f4;
  536. width: 100%;
  537. height: auto;
  538. min-height: 100%;
  539. overflow: hidden;
  540. }
  541. .service-policy {
  542. width: 750rpx;
  543. height: 73rpx;
  544. background: #f4f4f4;
  545. padding: 0 31.25rpx;
  546. display: flex;
  547. flex-flow: row nowrap;
  548. align-items: center;
  549. justify-content: space-between;
  550. }
  551. .service-policy .item {
  552. background-size: 10rpx;
  553. padding-left: 15rpx;
  554. display: flex;
  555. align-items: center;
  556. font-size: 25rpx;
  557. color: #666;
  558. }
  559. .no-login {
  560. width: 100%;
  561. height: auto;
  562. margin: 0 auto;
  563. }
  564. .no-login .c {
  565. width: 100%;
  566. height: auto;
  567. margin-top: 400rpx;
  568. }
  569. .no-login .c text {
  570. margin: 0 auto;
  571. display: block;
  572. width: 258rpx;
  573. height: 59rpx;
  574. line-height: 29rpx;
  575. text-align: center;
  576. font-size: 35rpx;
  577. color: #999;
  578. }
  579. .no-login button {
  580. width: 90%;
  581. margin: 0 auto;
  582. color: #fff;
  583. font-size: 30rpx;
  584. height: 96rpx;
  585. line-height: 96rpx;
  586. right: 0;
  587. display: flex;
  588. justify-content: center;
  589. align-items: center;
  590. position: flex;
  591. bottom: 0;
  592. left: 0;
  593. border-radius: 0;
  594. padding: 0;
  595. margin-left: 5%;
  596. text-align: center;
  597. border-radius: 6rpx;
  598. letter-spacing: 3rpx;
  599. background-color: #242a48;
  600. }
  601. .wechat {
  602. width: 80rpx;
  603. height: 80rpx;
  604. margin-right: 15rpx;
  605. }
  606. .no-cart {
  607. width: 100%;
  608. height: auto;
  609. margin: 0 auto;
  610. }
  611. .no-cart .c {
  612. width: 100%;
  613. height: auto;
  614. margin-top: 400rpx;
  615. text-align: center;
  616. }
  617. .no-cart .c image {
  618. width: 120rpx;
  619. height: 120rpx;
  620. }
  621. .no-cart .c text {
  622. margin: 0 auto;
  623. display: block;
  624. width: 258rpx;
  625. height: 29rpx;
  626. line-height: 29rpx;
  627. text-align: center;
  628. font-size: 29rpx;
  629. color: #999;
  630. }
  631. .cart-view {
  632. width: 100%;
  633. height: auto;
  634. overflow: hidden;
  635. }
  636. .cart-view .list {
  637. height: auto;
  638. width: 100%;
  639. overflow: hidden;
  640. margin-bottom: 120rpx;
  641. }
  642. .cart-view .group-item {
  643. height: auto;
  644. width: 100%;
  645. background: #fff;
  646. margin-bottom: 18rpx;
  647. }
  648. .cart-view .item {
  649. height: 164rpx;
  650. width: 100%;
  651. overflow: hidden;
  652. }
  653. .cart-view .item .van-checkbox {
  654. float: left;
  655. margin: 65rpx 18rpx 65rpx 18rpx;
  656. }
  657. .cart-view .item .van-checkbox .van-icon {
  658. color: #fff;
  659. }
  660. .cart-view .item .cart-goods {
  661. float: left;
  662. height: 164rpx;
  663. width: 672rpx;
  664. border-bottom: 1px solid #f4f4f4;
  665. }
  666. .cart-view .item .img {
  667. float: left;
  668. height: 125rpx;
  669. width: 125rpx;
  670. background: #f4f4f4;
  671. margin: 19.5rpx 18rpx 19.5rpx 0;
  672. }
  673. .cart-view .item .info {
  674. float: left;
  675. height: 125rpx;
  676. width: 503rpx;
  677. margin: 19.5rpx 26rpx 19.5rpx 0;
  678. }
  679. .cart-view .item .t {
  680. margin: 8rpx 0;
  681. height: 28rpx;
  682. font-size: 25rpx;
  683. color: #333;
  684. overflow: hidden;
  685. }
  686. .cart-view .item .name {
  687. height: 28rpx;
  688. max-width: 310rpx;
  689. line-height: 28rpx;
  690. font-size: 25rpx;
  691. color: #333;
  692. overflow: hidden;
  693. }
  694. .cart-view .item .num {
  695. height: 28rpx;
  696. line-height: 28rpx;
  697. float: right;
  698. }
  699. .cart-view .item .attr {
  700. margin-bottom: 17rpx;
  701. height: 24rpx;
  702. line-height: 24rpx;
  703. font-size: 22rpx;
  704. color: #666;
  705. overflow: hidden;
  706. }
  707. .cart-view .item .b {
  708. height: 28rpx;
  709. line-height: 28rpx;
  710. font-size: 25rpx;
  711. color: #333;
  712. overflow: hidden;
  713. }
  714. .cart-view .item .price {
  715. float: left;
  716. color: #ab956d;
  717. }
  718. /*.cart-view .item.edit .t {
  719. display: none;
  720. }*/
  721. .cart-view .item.edit .attr {
  722. text-align: left;
  723. padding-right: 25rpx;
  724. background-size: 12rpx 20rpx;
  725. margin-bottom: 10rpx;
  726. height: 35rpx;
  727. line-height: 35rpx;
  728. font-size: 24rpx;
  729. color: #999;
  730. overflow: hidden;
  731. }
  732. .cart-view .item.edit .b {
  733. display: flex;
  734. height: 60rpx;
  735. overflow: hidden;
  736. }
  737. .cart-view .item.edit .price {
  738. line-height: 42rpx;
  739. height: 42rpx;
  740. flex: 1;
  741. color: #ab956d;
  742. }
  743. .cart-view .item.edit .selnum {
  744. width: 235rpx;
  745. height: 52rpx;
  746. border: 1rpx solid #ccc;
  747. display: flex;
  748. margin-bottom: 10rpx;
  749. }
  750. .selnum .cut {
  751. width: 70rpx;
  752. height: 100%;
  753. text-align: center;
  754. line-height: 50rpx;
  755. }
  756. .selnum .number {
  757. flex: 1;
  758. height: 100%;
  759. text-align: center;
  760. line-height: 50rpx;
  761. border-left: 1px solid #ccc;
  762. border-right: 1px solid #ccc;
  763. float: left;
  764. }
  765. .selnum .add {
  766. width: 80rpx;
  767. height: 100%;
  768. text-align: center;
  769. line-height: 50rpx;
  770. }
  771. .cart-view .group-item .header {
  772. width: 100%;
  773. height: 94rpx;
  774. line-height: 94rpx;
  775. padding: 0 26rpx;
  776. border-bottom: 1px solid #f4f4f4;
  777. }
  778. .cart-view .promotion .icon {
  779. display: inline-block;
  780. height: 24rpx;
  781. width: 15rpx;
  782. }
  783. .cart-view .promotion {
  784. margin-top: 25.5rpx;
  785. float: left;
  786. height: 43rpx;
  787. width: 480rpx;
  788. /*margin-right: 84rpx;*/
  789. line-height: 43rpx;
  790. font-size: 0;
  791. }
  792. .cart-view .promotion .tag {
  793. border: 1px solid #f48f18;
  794. height: 37rpx;
  795. line-height: 31rpx;
  796. padding: 0 9rpx;
  797. margin-right: 10rpx;
  798. color: #f48f18;
  799. font-size: 24.5rpx;
  800. }
  801. .cart-view .promotion .txt {
  802. height: 43rpx;
  803. line-height: 43rpx;
  804. padding-right: 10rpx;
  805. color: #333;
  806. font-size: 29rpx;
  807. overflow: hidden;
  808. }
  809. .cart-view .get {
  810. margin-top: 18rpx;
  811. float: right;
  812. height: 58rpx;
  813. padding-left: 14rpx;
  814. border-left: 1px solid #d9d9d9;
  815. line-height: 58rpx;
  816. font-size: 29rpx;
  817. color: #333;
  818. }
  819. .cart-bottom {
  820. position: fixed;
  821. bottom: 0;
  822. left: 0;
  823. height: 100rpx;
  824. width: 100%;
  825. background: #fff;
  826. display: flex;
  827. }
  828. .cart-bottom .van-checkbox {
  829. float: left;
  830. margin: 33rpx 18rpx 33rpx 26rpx;
  831. font-size: 29rpx;
  832. }
  833. .cart-bottom .van-checkbox .van-icon {
  834. color: #fff;
  835. }
  836. .cart-bottom .total {
  837. height: 34rpx;
  838. flex: 1;
  839. margin: 33rpx 15rpx;
  840. font-size: 29rpx;
  841. }
  842. .cart-bottom .delete {
  843. text-align: center;
  844. width: 180rpx;
  845. height: 80rpx;
  846. line-height: 82rpx;
  847. padding: 0;
  848. margin: 0;
  849. margin-left: -5rpx;
  850. padding-right: 25rpx;
  851. font-size: 25rpx;
  852. color: #f4f4f4;
  853. /* text-align: center; */
  854. border-top-left-radius: 0rpx;
  855. border-bottom-left-radius: 0rpx;
  856. border-top-right-radius: 50rpx;
  857. border-bottom-right-radius: 50rpx;
  858. letter-spacing: 3rpx;
  859. background-image: linear-gradient(to right, #9a9ba1 0%, #ae8b9c 100%);
  860. }
  861. .cart-bottom .checkout {
  862. height: 100rpx;
  863. width: 100rpx;
  864. text-align: center;
  865. line-height: 100rpx;
  866. font-size: 29rpx;
  867. /*background: #b4282d;*/
  868. background: #242a48;
  869. color: #fff;
  870. }
  871. .action_btn_area {
  872. /* border: 1px solid #333; */
  873. position: absolute;
  874. display: inline;
  875. justify-content: center;
  876. align-items: center;
  877. right: 0;
  878. top: 0;
  879. /*width: 380rpx;
  880. height: 100rpx; */
  881. display: inline;
  882. }
  883. .action_btn_area .edit {
  884. width: 140rpx;
  885. /* border: 1px solid #000;
  886. height: 70rpx;
  887. line-height: 72rpx;
  888. padding: 0;
  889. margin: 0;
  890. margin-right: 5rpx;
  891. text-align: center;
  892. margin-left: 20rpx;
  893. /* padding-left: 25rpx; */
  894. font-size: 25rpx;
  895. color: #f4f4f4;
  896. border-top-left-radius: 50rpx;
  897. border-bottom-left-radius: 50rpx;
  898. border-top-right-radius: 50rpx;
  899. border-bottom-right-radius: 50rpx;
  900. letter-spacing: 3rpx;
  901. /* background-image: linear-gradient(to right, #ff7701 100%); */
  902. background-image: linear-gradient(to right, #ab956d 0%, #ab956d 100%);
  903. }
  904. .action_btn_area .checkout {
  905. width: 140rpx;
  906. height: 70rpx;
  907. line-height: 72rpx;
  908. padding: 0;
  909. margin: 0;
  910. margin-left: 5rpx;
  911. margin-right: 10rpx;
  912. margin-top: 15rpx;
  913. /*padding-right: 25rpx; */
  914. font-size: 25rpx;
  915. color: #f4f4f4;
  916. text-align: center;
  917. border-top-left-radius: 50rpx;
  918. border-bottom-left-radius: 50rpx;
  919. border-top-right-radius: 50rpx;
  920. border-bottom-right-radius: 50rpx;
  921. letter-spacing: 3rpx;
  922. background: #242a48;
  923. float: right;
  924. }
  925. .action_btn_area .delete {
  926. width: 140rpx;
  927. /* border: 1px solid #000; */
  928. height: 70rpx;
  929. line-height: 72rpx;
  930. padding: 0;
  931. margin: 0;
  932. margin-right: 5rpx;
  933. text-align: center;
  934. padding-left: -5rpx;
  935. font-size: 25rpx;
  936. color: #f4f4f4;
  937. border-top-left-radius: 50rpx;
  938. border-bottom-left-radius: 50rpx;
  939. border-top-right-radius: 50rpx;
  940. border-bottom-right-radius: 50rpx;
  941. letter-spacing: 3rpx;
  942. background-image: linear-gradient(to right, #9a9ba1 0%, #9a9ba1 100%);
  943. }
  944. .action_btn_area .sure {
  945. text-align: center;
  946. width: 140rpx;
  947. height: 80rpx;
  948. line-height: 82rpx;
  949. padding: 0;
  950. margin: 0;
  951. margin-right: 10rpx;
  952. padding-left: -5rpx;
  953. font-size: 25rpx;
  954. color: #f4f4f4;
  955. /* text-align: center; */
  956. border-top-left-radius: 50rpx;
  957. border-bottom-left-radius: 50rpx;
  958. border-top-right-radius: 50rpx;
  959. border-bottom-right-radius: 50rpx;
  960. letter-spacing: 3rpx;
  961. background-image: linear-gradient(to right, #ab956d 0%, #ab956d 100%);
  962. /* background-image: linear-gradient(to right, #ff7701 0%, #fe4800 100%); */
  963. }
  964. .auth_btn {
  965. position: fixed;
  966. top: 55vh;
  967. left: 10vw;
  968. width: 80vw;
  969. height: 96rpx;
  970. line-height: 96rpx;
  971. font-size: 25rpx;
  972. color: #f4f4f4;
  973. /* text-align: center; */
  974. border-top-left-radius: 50rpx;
  975. border-bottom-left-radius: 50rpx;
  976. border-top-right-radius: 50rpx;
  977. border-bottom-right-radius: 50rpx;
  978. letter-spacing: 3rpx;
  979. background-image: linear-gradient(to right, #8baaaa 0%, #9a9ba1 100%);
  980. }
  981. </style>