order_addcart.vue 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500
  1. <template>
  2. <view class="order_addcart" :style="colorStyle">
  3. <view class="order_addcart-header-area">
  4. <view class="received" @click="goDetail(item)">
  5. <view class="pictrue">
  6. <!-- <image src='../../static/order_addcart/qiandai.png'></image> -->
  7. </view>
  8. <view class="text-info">
  9. <view class="received-count">
  10. 0.00元
  11. </view>
  12. <view class="received-info">
  13. 已领取红包
  14. </view>
  15. </view>
  16. </view>
  17. <view class="loss" @click="goDetail(item)">
  18. <view class="text-info">
  19. <view class="received-count">
  20. 0.93元
  21. </view>
  22. <view class="received-info">
  23. 已错失红包
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="loop">
  29. <view class="loop-title">
  30. 当前红包池
  31. </view>
  32. <view class="loop-count">
  33. 4498.0.1元
  34. </view>
  35. <!-- <image src='../../static/order_addcart/hongbaochi.png' mode="widthFix"></image> -->
  36. </view>
  37. <view class="tab-area">
  38. <view @click="isactiveTab = 'todayRank'"
  39. :class="{'tab-area-active1':isactiveTab === 'todayRank','base-tab':true}">
  40. <text> 今日红包排行榜</text>
  41. </view>
  42. <view @click="isactiveTab = 'allRank'"
  43. :class="{'tab-area-active2':isactiveTab === 'allRank','base-tab':true}">
  44. <text> 红包领取总榜</text>
  45. </view>
  46. </view>
  47. <view class="rank-list">
  48. <view class="rank-list-item">
  49. <!-- <img src='../../static/order_addcart/rank1.png' alt=""> -->
  50. <text class="nuber"> 15772754677</text>
  51. <text class="mosaic"> 1577***4677</text>
  52. <text class="litem-info"> 共领取了</text>
  53. <text class="balance"> 31212.40</text>
  54. </view>
  55. <view class="rank-list-item">
  56. <!-- <img src='../../static/order_addcart/rank2.png' alt=""> -->
  57. <text class="nuber"> 15772754677</text>
  58. <text class="mosaic"> 1577***4677</text>
  59. <text class="litem-info"> 共领取了</text>
  60. <text class="balance"> 3121.40</text>
  61. </view>
  62. <view class="rank-list-item">
  63. <!-- <img src='../../static/order_addcart/rank3.png' alt=""> -->
  64. <text class="nuber"> 15772754677</text>
  65. <text class="mosaic"> 1577***4677</text>
  66. <text class="litem-info"> 共领取了</text>
  67. <text class="balance"> 312.40</text>
  68. </view>
  69. </view>
  70. </view>
  71. </template>
  72. <script>
  73. // #ifdef APP-PLUS
  74. let sysHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
  75. // #endif
  76. // #ifndef APP-PLUS
  77. let sysHeight = 0
  78. // #endif
  79. import {
  80. getCartList,
  81. getCartCounts,
  82. changeCartNum,
  83. cartDel,
  84. getResetCart
  85. } from '@/api/order.js';
  86. import {
  87. getProductHot,
  88. collectAll,
  89. getProductDetail
  90. } from '@/api/store.js';
  91. import {
  92. toLogin
  93. } from '@/libs/login.js';
  94. import {
  95. mapGetters
  96. } from "vuex";
  97. import recommend from '@/components/recommend';
  98. import productWindow from '@/components/productWindow';
  99. // #ifdef MP
  100. import authorize from '@/components/Authorize';
  101. // #endif
  102. import pageFooter from '@/components/pageFooter/index.vue'
  103. import colors from "@/mixins/color";
  104. import {
  105. HTTP_REQUEST_URL
  106. } from '@/config/app';
  107. const hot_res = require('@/mock/json/hot_res.json')
  108. import {
  109. getNavigation
  110. } from '@/api/public.js'
  111. export default {
  112. components: {
  113. pageFooter,
  114. recommend,
  115. productWindow,
  116. // #ifdef MP
  117. authorize
  118. // #endif
  119. },
  120. mixins: [colors],
  121. data() {
  122. return {
  123. isactiveTab: 'todayRank',
  124. imgHost: HTTP_REQUEST_URL,
  125. is_diy: uni.getStorageSync('is_diy'),
  126. canShow: false,
  127. cartCount: 0,
  128. goodsHidden: true,
  129. footerswitch: true,
  130. hostProduct: [],
  131. cartList: {
  132. valid: [],
  133. invalid: []
  134. },
  135. isAllSelect: false, //全选
  136. selectValue: [], //选中的数据
  137. selectCountPrice: 0.00,
  138. isAuto: false, //没有授权的不会自动授权
  139. isShowAuth: false, //是否隐藏授权
  140. hotScroll: false,
  141. hotPage: 1,
  142. hotLimit: 10,
  143. loading: false,
  144. loadend: false,
  145. loadTitle: this.$t(`我也是有底线的`), //提示语
  146. page: 1,
  147. limit: 20,
  148. loadingInvalid: false,
  149. loadendInvalid: false,
  150. loadTitleInvalid: this.$t(`加载更多`), //提示语
  151. pageInvalid: 1,
  152. limitInvalid: 20,
  153. attr: {
  154. cartAttr: false,
  155. productAttr: [],
  156. productSelect: {}
  157. },
  158. productValue: [], //系统属性
  159. storeInfo: {},
  160. attrValue: '', //已选属性
  161. attrTxt: this.$t(`请选择`), //属性页面提示
  162. cartId: 0,
  163. product_id: 0,
  164. sysHeight: sysHeight,
  165. newData: {},
  166. activeRouter: '',
  167. is_diy_set: false
  168. };
  169. },
  170. computed: mapGetters(['isLogin']),
  171. onLoad(options) {
  172. // if (this.is_diy) {
  173. // if (uni.getStorageSync('FOOTER_BAR')) {
  174. // uni.hideTabBar()
  175. // } else {
  176. // this.is_diy_set = true
  177. // }
  178. // uni.request({
  179. // url:'api/mock/navigation',
  180. // success:res=>{
  181. // this.newData = res.data
  182. // if (this.newData.status && this.newData.status.status) {
  183. // uni.hideTabBar()
  184. // } else {
  185. // uni.showTabBar()
  186. // }
  187. // }
  188. // })
  189. // // getNavigation().then(res => {
  190. // // this.newData = res.data
  191. // // if (this.newData.status && this.newData.status.status) {
  192. // // uni.hideTabBar()
  193. // // } else {
  194. // // uni.showTabBar()
  195. // // }
  196. // // })
  197. // } else {
  198. // uni.hideTabBar()
  199. // }
  200. let that = this;
  201. if (that.isLogin == false) {
  202. toLogin();
  203. }
  204. let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
  205. let curRoute = routes[routes.length - 1].route //获取当前页面路由
  206. this.activeRouter = '/' + curRoute
  207. },
  208. onShow() {
  209. this.canShow = false
  210. if (this.isLogin == true) {
  211. this.hotPage = 1;
  212. this.hostProduct = [],
  213. this.hotScroll = false,
  214. this.getHostProduct();
  215. this.loadend = false;
  216. this.page = 1;
  217. this.cartList.valid = [];
  218. this.getCartList();
  219. this.loadendInvalid = false;
  220. this.pageInvalid = 1;
  221. this.cartList.invalid = [];
  222. this.getInvalidList();
  223. this.getCartNum();
  224. this.goodsHidden = true;
  225. this.footerswitch = true;
  226. this.hostProduct = [];
  227. this.hotScroll = false;
  228. this.hotPage = 1;
  229. this.hotLimit = 10;
  230. this.cartList = {
  231. valid: [],
  232. invalid: []
  233. },
  234. this.isAllSelect = false; //全选
  235. this.selectValue = []; //选中的数据
  236. this.selectCountPrice = 0.00;
  237. this.cartCount = 0;
  238. this.isShowAuth = false;
  239. };
  240. },
  241. methods: {
  242. // 授权关闭
  243. authColse: function(e) {
  244. this.isShowAuth = e;
  245. },
  246. // 修改购物车
  247. reGoCat: function() {
  248. let that = this,
  249. productSelect = that.productValue[this.attrValue];
  250. //如果有属性,没有选择,提示用户选择
  251. if (
  252. that.attr.productAttr.length &&
  253. productSelect === undefined
  254. )
  255. return that.$util.Tips({
  256. title: that.$t(`产品库存不足,请选择其它`)
  257. });
  258. let q = {
  259. id: that.cartId,
  260. product_id: that.product_id,
  261. num: that.attr.productSelect.cart_num,
  262. unique: that.attr.productSelect !== undefined ?
  263. that.attr.productSelect.unique : ""
  264. };
  265. getResetCart(q)
  266. .then(function(res) {
  267. that.attr.cartAttr = false;
  268. that.$util.Tips({
  269. title: that.$t(`添加购物车成功`),
  270. success: () => {
  271. that.loadend = false;
  272. that.page = 1;
  273. that.cartList.valid = [];
  274. that.getCartList();
  275. that.getCartNum();
  276. }
  277. });
  278. })
  279. .catch(res => {
  280. return that.$util.Tips({
  281. title: res.msg
  282. });
  283. });
  284. },
  285. onMyEvent: function() {
  286. this.$set(this.attr, 'cartAttr', false);
  287. },
  288. reElection: function(item) {
  289. this.getGoodsDetails(item)
  290. },
  291. /**
  292. * 获取产品详情
  293. *
  294. */
  295. getGoodsDetails: function(item) {
  296. uni.showLoading({
  297. title: this.$t(`加载中`),
  298. mask: true
  299. });
  300. let that = this;
  301. that.cartId = item.id;
  302. that.product_id = item.product_id;
  303. getProductDetail(item.product_id).then(res => {
  304. uni.hideLoading();
  305. that.attr.cartAttr = true;
  306. let storeInfo = res.data.storeInfo;
  307. that.$set(that, 'storeInfo', storeInfo);
  308. that.$set(that.attr, 'productAttr', res.data.productAttr);
  309. that.$set(that, 'productValue', res.data.productValue);
  310. that.DefaultSelect();
  311. }).catch(err => {
  312. uni.hideLoading();
  313. })
  314. },
  315. /**
  316. * 属性变动赋值
  317. *
  318. */
  319. ChangeAttr: function(res) {
  320. let productSelect = this.productValue[res];
  321. if (productSelect && productSelect.stock > 0) {
  322. this.$set(this.attr.productSelect, "image", productSelect.image);
  323. this.$set(this.attr.productSelect, "price", productSelect.price);
  324. this.$set(this.attr.productSelect, "stock", productSelect.stock);
  325. this.$set(this.attr.productSelect, "unique", productSelect.unique);
  326. this.$set(this.attr.productSelect, "cart_num", 1);
  327. this.$set(this, "attrValue", res);
  328. this.$set(this, "attrTxt", this.$t(`已选择`));
  329. } else {
  330. this.$set(this.attr.productSelect, "image", this.storeInfo.image);
  331. this.$set(this.attr.productSelect, "price", this.storeInfo.price);
  332. this.$set(this.attr.productSelect, "stock", 0);
  333. this.$set(this.attr.productSelect, "unique", "");
  334. this.$set(this.attr.productSelect, "cart_num", 0);
  335. this.$set(this, "attrValue", "");
  336. this.$set(this, "attrTxt", this.$t(`请选择`));
  337. }
  338. },
  339. /**
  340. * 默认选中属性
  341. *
  342. */
  343. DefaultSelect: function() {
  344. let productAttr = this.attr.productAttr;
  345. let value = [];
  346. for (var key in this.productValue) {
  347. if (this.productValue[key].stock > 0) {
  348. value = this.attr.productAttr.length ? key.split(",") : [];
  349. break;
  350. }
  351. }
  352. for (let i = 0; i < productAttr.length; i++) {
  353. this.$set(productAttr[i], "index", value[i]);
  354. }
  355. //sort();排序函数:数字-英文-汉字;
  356. let productSelect = this.productValue[value.sort().join(",")];
  357. if (productSelect && productAttr.length) {
  358. this.$set(
  359. this.attr.productSelect,
  360. "store_name",
  361. this.storeInfo.store_name
  362. );
  363. this.$set(this.attr.productSelect, "image", productSelect.image);
  364. this.$set(this.attr.productSelect, "price", productSelect.price);
  365. this.$set(this.attr.productSelect, "stock", productSelect.stock);
  366. this.$set(this.attr.productSelect, "unique", productSelect.unique);
  367. this.$set(this.attr.productSelect, "cart_num", 1);
  368. this.$set(this, "attrValue", value.sort().join(","));
  369. this.$set(this, "attrTxt", this.$t(`已选择`));
  370. } else if (!productSelect && productAttr.length) {
  371. this.$set(
  372. this.attr.productSelect,
  373. "store_name",
  374. this.storeInfo.store_name
  375. );
  376. this.$set(this.attr.productSelect, "image", this.storeInfo.image);
  377. this.$set(this.attr.productSelect, "price", this.storeInfo.price);
  378. this.$set(this.attr.productSelect, "stock", 0);
  379. this.$set(this.attr.productSelect, "unique", "");
  380. this.$set(this.attr.productSelect, "cart_num", 0);
  381. this.$set(this, "attrValue", "");
  382. this.$set(this, "attrTxt", this.$t(`请选择`));
  383. } else if (!productSelect && !productAttr.length) {
  384. this.$set(
  385. this.attr.productSelect,
  386. "store_name",
  387. this.storeInfo.store_name
  388. );
  389. this.$set(this.attr.productSelect, "image", this.storeInfo.image);
  390. this.$set(this.attr.productSelect, "price", this.storeInfo.price);
  391. this.$set(this.attr.productSelect, "stock", this.storeInfo.stock);
  392. this.$set(
  393. this.attr.productSelect,
  394. "unique",
  395. this.storeInfo.unique || ""
  396. );
  397. this.$set(this.attr.productSelect, "cart_num", 1);
  398. this.$set(this, "attrValue", "");
  399. this.$set(this, "attrTxt", this.$t(`请选择`));
  400. }
  401. },
  402. attrVal(val) {
  403. this.$set(this.attr.productAttr[val.indexw], 'index', this.attr.productAttr[val.indexw].attr_values[val
  404. .indexn]);
  405. },
  406. /**
  407. * 购物车数量加和数量减
  408. *
  409. */
  410. ChangeCartNum: function(changeValue) {
  411. //changeValue:是否 加|减
  412. //获取当前变动属性
  413. let productSelect = this.productValue[this.attrValue];
  414. //如果没有属性,赋值给商品默认库存
  415. if (productSelect === undefined && !this.attr.productAttr.length)
  416. productSelect = this.attr.productSelect;
  417. //无属性值即库存为0;不存在加减;
  418. if (productSelect === undefined) return;
  419. let stock = productSelect.stock || 0;
  420. let num = this.attr.productSelect;
  421. if (changeValue) {
  422. num.cart_num++;
  423. if (num.cart_num > stock) {
  424. this.$set(this.attr.productSelect, "cart_num", stock ? stock : 1);
  425. this.$set(this, "cart_num", stock ? stock : 1);
  426. }
  427. } else {
  428. num.cart_num--;
  429. if (num.cart_num < 1) {
  430. this.$set(this.attr.productSelect, "cart_num", 1);
  431. this.$set(this, "cart_num", 1);
  432. }
  433. }
  434. },
  435. /**
  436. * 购物车手动填写
  437. *
  438. */
  439. iptCartNum: function(e) {
  440. this.$set(this.attr.productSelect, 'cart_num', e);
  441. },
  442. subDel: function(event) {
  443. let that = this,
  444. selectValue = that.selectValue;
  445. if (selectValue.length > 0)
  446. cartDel(selectValue).then(res => {
  447. that.loadend = false;
  448. that.page = 1;
  449. that.cartList.valid = [];
  450. that.getCartList();
  451. that.getCartNum();
  452. });
  453. else
  454. return that.$util.Tips({
  455. title: that.$t(`请选择产品`)
  456. });
  457. },
  458. getSelectValueProductId: function() {
  459. let that = this;
  460. let validList = that.cartList.valid;
  461. let selectValue = that.selectValue;
  462. let productId = [];
  463. if (selectValue.length > 0) {
  464. for (let index in validList) {
  465. if (that.inArray(validList[index].id, selectValue)) {
  466. productId.push(validList[index].product_id);
  467. }
  468. }
  469. };
  470. return productId;
  471. },
  472. subCollect: function(event) {
  473. let that = this,
  474. selectValue = that.selectValue;
  475. if (selectValue.length > 0) {
  476. let selectValueProductId = that.getSelectValueProductId();
  477. collectAll(that.getSelectValueProductId().join(',')).then(res => {
  478. return that.$util.Tips({
  479. title: res.msg,
  480. icon: 'success'
  481. });
  482. }).catch(err => {
  483. return that.$util.Tips({
  484. title: err
  485. });
  486. });
  487. } else {
  488. return that.$util.Tips({
  489. title: that.$t(`请选择产品`)
  490. });
  491. }
  492. },
  493. subOrder(event) {
  494. console.log(event)
  495. let that = this,
  496. selectValue = that.selectValue;
  497. if (selectValue.length > 0) {
  498. uni.navigateTo({
  499. url: '/pages/goods/order_confirm/index?cartId=' + selectValue.join(',')
  500. });
  501. } else {
  502. return that.$util.Tips({
  503. title: that.$t(`请选择产品`)
  504. });
  505. }
  506. },
  507. checkboxAllChange: function(event) {
  508. let value = event.detail.value;
  509. if (value.length > 0) {
  510. this.setAllSelectValue(1)
  511. } else {
  512. this.setAllSelectValue(0)
  513. }
  514. },
  515. setAllSelectValue: function(status) {
  516. let that = this;
  517. let selectValue = [];
  518. let valid = that.cartList.valid;
  519. if (valid.length > 0) {
  520. let newValid = valid.map(item => {
  521. if (status) {
  522. if (that.footerswitch) {
  523. if (item.attrStatus) {
  524. item.checked = true;
  525. selectValue.push(item.id);
  526. } else {
  527. item.checked = false;
  528. }
  529. } else {
  530. item.checked = true;
  531. selectValue.push(item.id);
  532. }
  533. that.isAllSelect = true;
  534. } else {
  535. item.checked = false;
  536. that.isAllSelect = false;
  537. }
  538. return item;
  539. });
  540. that.$set(that.cartList, 'valid', newValid);
  541. that.selectValue = selectValue;
  542. that.switchSelect();
  543. }
  544. },
  545. checkboxChange: function(event) {
  546. let that = this;
  547. let value = event.detail.value;
  548. let valid = that.cartList.valid;
  549. let arr1 = [];
  550. let arr2 = [];
  551. let arr3 = [];
  552. let newValid = valid.map(item => {
  553. if (that.inArray(item.id, value)) {
  554. if (that.footerswitch) {
  555. if (item.attrStatus) {
  556. item.checked = true;
  557. arr1.push(item);
  558. } else {
  559. item.checked = false;
  560. }
  561. } else {
  562. item.checked = true;
  563. arr1.push(item);
  564. }
  565. } else {
  566. item.checked = false;
  567. arr2.push(item);
  568. }
  569. return item;
  570. });
  571. if (that.footerswitch) {
  572. arr3 = arr2.filter(item => !item.attrStatus);
  573. }
  574. // for (let index in valid) {
  575. // if (that.inArray(valid[index].id, value)){
  576. // if(valid[index].attrStatus){
  577. // valid[index].checked = true;
  578. // }else{
  579. // valid[index].checked = false;
  580. // }
  581. // } else {
  582. // valid[index].checked = false;
  583. // }
  584. // }
  585. that.$set(that.cartList, 'valid', newValid);
  586. // let newArr = that.cartList.valid.filter(item => item.attrStatus);
  587. that.isAllSelect = newValid.length === arr1.length + arr3.length;
  588. that.selectValue = value;
  589. that.switchSelect();
  590. },
  591. inArray: function(search, array) {
  592. for (let i in array) {
  593. if (array[i] == search) {
  594. return true;
  595. }
  596. }
  597. return false;
  598. },
  599. switchSelect: function() {
  600. let that = this;
  601. let validList = that.cartList.valid;
  602. let selectValue = that.selectValue;
  603. let selectCountPrice = 0.00;
  604. if (selectValue.length < 1) {
  605. that.selectCountPrice = selectCountPrice;
  606. } else {
  607. for (let index in validList) {
  608. if (that.inArray(validList[index].id, selectValue)) {
  609. selectCountPrice = that.$util.$h.Add(selectCountPrice, that.$util.$h.Mul(validList[index]
  610. .cart_num, validList[
  611. index].truePrice))
  612. }
  613. }
  614. that.selectCountPrice = selectCountPrice;
  615. }
  616. },
  617. /**
  618. * 购物车手动填写
  619. *
  620. */
  621. iptCartNum: function(index) {
  622. let item = this.cartList.valid[index];
  623. if (item.cart_num) {
  624. this.setCartNum(item.id, item.cart_num);
  625. }
  626. this.switchSelect();
  627. },
  628. blurInput: function(index) {
  629. let item = this.cartList.valid[index];
  630. console.log(item)
  631. if (!item.cart_num) {
  632. item.cart_num = 1;
  633. this.$set(this.cartList, 'valid', this.cartList.valid)
  634. }
  635. },
  636. subCart: function(index) {
  637. let that = this;
  638. let status = false;
  639. let item = that.cartList.valid[index];
  640. item.cart_num = Number(item.cart_num) - 1;
  641. if (item.cart_num < 1) status = true;
  642. if (item.cart_num <= 1) {
  643. item.cart_num = 1;
  644. item.numSub = true;
  645. } else {
  646. item.numSub = false;
  647. item.numAdd = false;
  648. }
  649. if (false == status) {
  650. that.setCartNum(item.id, item.cart_num, function(data) {
  651. that.cartList.valid[index] = item;
  652. that.getCartNum();
  653. that.switchSelect();
  654. });
  655. }
  656. },
  657. addCart: function(index) {
  658. let that = this;
  659. let item = that.cartList.valid[index];
  660. item.cart_num = Number(item.cart_num) + 1;
  661. let productInfo = item.productInfo;
  662. if (productInfo.hasOwnProperty('attrInfo') && item.cart_num >= item.productInfo.attrInfo.stock) {
  663. item.cart_num = item.productInfo.attrInfo.stock;
  664. item.numAdd = true;
  665. item.numSub = false;
  666. } else {
  667. item.numAdd = false;
  668. item.numSub = false;
  669. }
  670. that.setCartNum(item.id, item.cart_num, function(data) {
  671. that.cartList.valid[index] = item;
  672. that.getCartNum();
  673. that.switchSelect();
  674. });
  675. },
  676. setCartNum(cartId, cartNum, successCallback) {
  677. let that = this;
  678. changeCartNum(cartId, cartNum).then(res => {
  679. console.log(res)
  680. successCallback && successCallback(res.data);
  681. }).catch(err => {
  682. console.log(err)
  683. return that.$util.Tips({
  684. title: err
  685. });
  686. })
  687. },
  688. getCartNum: function() {
  689. let that = this;
  690. // getCartCounts().then(res => {
  691. that.cartCount = 0;
  692. this.$store.commit('indexData/setCartNum', that.cartCount > 99 ? '..' : that.cartCount)
  693. if (that.cartCount > 0) {
  694. wx.setTabBarBadge({
  695. index: 2,
  696. text: that.cartCount + ''
  697. })
  698. } else {
  699. wx.hideTabBarRedDot({
  700. index: 2
  701. })
  702. }
  703. // });
  704. },
  705. getCartData(data) {
  706. let resData = {
  707. "valid": [],
  708. "invalid": [],
  709. "deduction": {
  710. "seckill_id": 0,
  711. "bargain_id": 0,
  712. "combination_id": 0,
  713. "discount_id": 0
  714. }
  715. }
  716. this.loading = false;
  717. this.canShow = true
  718. return resData;
  719. // return new Promise((resolve, reject) => {
  720. // getCartList(data).then((res) => {
  721. // resolve(res.data);
  722. // }).catch((err) => {
  723. // this.loading = false;
  724. // this.canShow = true
  725. // this.$util.Tips({
  726. // title: err
  727. // });
  728. // })
  729. // });
  730. },
  731. async getCartList() {
  732. uni.showLoading({
  733. title: this.$t(`加载中`),
  734. mask: true
  735. });
  736. let that = this;
  737. let data = {
  738. page: that.page,
  739. limit: that.limit,
  740. status: 1
  741. }
  742. let countResData = {
  743. "count": 0,
  744. "ids": [
  745. 9671,
  746. 9670,
  747. 9669
  748. ],
  749. "sum_price": "955.00"
  750. }
  751. // getCartCounts().then(async c => {
  752. that.cartCount = countResData.count;
  753. let n = Math.ceil(countResData.ids.length / that.limit)
  754. for (let i = 0; i < n; i++) {
  755. // let cartList = await this.getCartData(data)
  756. let cartListData = {
  757. "valid": [{
  758. "id": 9671,
  759. "uid": 34391,
  760. "type": "0",
  761. "product_id": 97,
  762. "product_attr_unique": "fd6d98f3",
  763. "cart_num": 1,
  764. "add_time": 1666709939,
  765. "is_pay": 0,
  766. "is_del": 0,
  767. "is_new": 0,
  768. "combination_id": 0,
  769. "seckill_id": 0,
  770. "bargain_id": 0,
  771. "advance_id": 0,
  772. "status": 1,
  773. "productInfo": {
  774. "id": 97,
  775. "mer_id": 0,
  776. "image": "https://demo26.crmeb.net/uploads/attach/2021/11/20211113/small_0d407b8541efd8c8f87e5ac581d1421c.png",
  777. "recommend_image": "",
  778. "slider_image": [
  779. "https://demo26.crmeb.net/uploads/attach/2021/11/13/2d97c9bd7abcdb65049c97bbe9ba61d1.jpg",
  780. "https://demo26.crmeb.net/uploads/attach/2021/11/13/a48cce02122f4046193bdda67d970b55.jpg",
  781. "https://demo26.crmeb.net/uploads/attach/2021/11/13/5c4754f2b647b9e240e08f48c9889ebf.jpg",
  782. "https://demo26.crmeb.net/uploads/attach/2021/11/13/e8f6b1235f10f83d8a43bd91def20332.jpg",
  783. "https://demo26.crmeb.net/uploads/attach/2021/11/13/634a51ad34590eab005063742d086b87.jpg"
  784. ],
  785. "store_name": "仟佰家 干花花束真花手工落地高枝装饰摆件招财莲蓬插花居客厅摆设 干花组合6025【不含花瓶】 干花包",
  786. "store_info": "仟佰家 干花花束真花手工落地高枝装饰摆件招财莲蓬插花居客厅摆设 干花组合6025【不含花瓶】 干花包",
  787. "keyword": "",
  788. "bar_code": "",
  789. "cate_id": "22,24",
  790. "price": "306.00",
  791. "vip_price": "0.00",
  792. "ot_price": "299.00",
  793. "postage": "0.00",
  794. "unit_name": "件",
  795. "sort": 100,
  796. "sales": 2,
  797. "stock": 12384,
  798. "is_show": 1,
  799. "is_hot": 0,
  800. "is_benefit": 0,
  801. "is_best": 0,
  802. "is_new": 1,
  803. "is_virtual": 0,
  804. "virtual_type": 0,
  805. "add_time": 1636791973,
  806. "is_postage": 0,
  807. "is_del": 0,
  808. "mer_use": 0,
  809. "give_integral": "0.00",
  810. "cost": "258.00",
  811. "is_seckill": 0,
  812. "is_bargain": null,
  813. "is_good": 0,
  814. "is_sub": 0,
  815. "is_vip": 0,
  816. "ficti": 0,
  817. "browse": 0,
  818. "code_path": "",
  819. "soure_link": "",
  820. "temp_id": 57,
  821. "spec_type": 1,
  822. "activity": "0,1,2,3",
  823. "spu": "5310153503736",
  824. "label_id": "0",
  825. "video_link": "",
  826. "command_word": "",
  827. "recommend_list": "",
  828. "vip_product": 0,
  829. "presale": 0,
  830. "presale_start_time": 0,
  831. "presale_end_time": 0,
  832. "presale_day": 0,
  833. "logistics": "1,2",
  834. "freight": 2,
  835. "custom_form": "",
  836. "is_limit": 0,
  837. "limit_type": 0,
  838. "limit_num": 0,
  839. "express_delivery": true,
  840. "store_mention": true,
  841. "attrInfo": {
  842. "id": 967,
  843. "product_id": 97,
  844. "suk": "干花组合6025【不含花瓶】,干花包",
  845. "stock": 562,
  846. "sales": 1,
  847. "price": "306.00",
  848. "image": "https://demo26.crmeb.net/uploads/attach/2021/11/13/small_634a51ad34590eab005063742d086b87.jpg",
  849. "bar_code": "",
  850. "ot_price": "299.00",
  851. "volume": "0.00",
  852. "weight": "0.00",
  853. "brokerage": "0.00",
  854. "brokerage_two": "0.00",
  855. "type": 0,
  856. "unique": "fd6d98f3",
  857. "cost": "258.00",
  858. "quota": 0,
  859. "quota_show": 0,
  860. "vip_price": "0.00",
  861. "is_virtual": 0,
  862. "coupon_id": 0,
  863. "disk_info": ""
  864. }
  865. },
  866. "attrStatus": true,
  867. "vip_truePrice": 0,
  868. "costPrice": "258.00",
  869. "trueStock": 562,
  870. "truePrice": 306,
  871. "sum_price": "306.00",
  872. "price_type": "level",
  873. "is_valid": 1
  874. },
  875. {
  876. "id": 9670,
  877. "uid": 34391,
  878. "type": "0",
  879. "product_id": 102,
  880. "product_attr_unique": "02cce37e",
  881. "cart_num": 1,
  882. "add_time": 1666709927,
  883. "is_pay": 0,
  884. "is_del": 0,
  885. "is_new": 0,
  886. "combination_id": 0,
  887. "seckill_id": 0,
  888. "bargain_id": 0,
  889. "advance_id": 0,
  890. "status": 1,
  891. "productInfo": {
  892. "id": 102,
  893. "mer_id": 0,
  894. "image": "https://demo26.crmeb.net/uploads/attach/2021/11/15/small_a79f5d2ea6bf0c3c11b2127332dfe2df.jpg",
  895. "recommend_image": "",
  896. "slider_image": [
  897. "https://demo26.crmeb.net/uploads/attach/2021/11/15/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg",
  898. "https://demo26.crmeb.net/uploads/attach/2021/11/15/7f46e98ece1920e1a4082dfc72bcd72a.jpg",
  899. "https://demo26.crmeb.net/uploads/attach/2021/11/15/bfb275263d02ab081b8670a752f2823f.jpg",
  900. "https://demo26.crmeb.net/uploads/attach/2021/11/15/e499a4dc489cda7b8d472cb3a3b348b7.jpg",
  901. "https://demo26.crmeb.net/uploads/attach/2021/11/15/06fa150a47163e973bb4806a380afaab.jpg"
  902. ],
  903. "store_name": "索尼(SONY)WH-CH510 无线立体声耳机 学生网课 白色",
  904. "store_info": "索尼(SONY)WH-CH510 无线立体声耳机 学生网课 白色",
  905. "keyword": "耳机",
  906. "bar_code": "",
  907. "cate_id": "18,27,25",
  908. "price": "299.00",
  909. "vip_price": "0.00",
  910. "ot_price": "349.00",
  911. "postage": "0.00",
  912. "unit_name": "件",
  913. "sort": 0,
  914. "sales": 3,
  915. "stock": 297,
  916. "is_show": 1,
  917. "is_hot": 0,
  918. "is_benefit": 0,
  919. "is_best": 0,
  920. "is_new": 0,
  921. "is_virtual": 0,
  922. "virtual_type": 0,
  923. "add_time": 1636958921,
  924. "is_postage": 0,
  925. "is_del": 0,
  926. "mer_use": 0,
  927. "give_integral": "0.00",
  928. "cost": "259.00",
  929. "is_seckill": 0,
  930. "is_bargain": null,
  931. "is_good": 0,
  932. "is_sub": 0,
  933. "is_vip": 0,
  934. "ficti": 0,
  935. "browse": 0,
  936. "code_path": "",
  937. "soure_link": "",
  938. "temp_id": 57,
  939. "spec_type": 1,
  940. "activity": "0,1,2,3",
  941. "spu": "5757529716664",
  942. "label_id": "0",
  943. "video_link": "",
  944. "command_word": "",
  945. "recommend_list": "",
  946. "vip_product": 0,
  947. "presale": 0,
  948. "presale_start_time": 0,
  949. "presale_end_time": 0,
  950. "presale_day": 0,
  951. "logistics": "1,2",
  952. "freight": 2,
  953. "custom_form": "",
  954. "is_limit": 0,
  955. "limit_type": 0,
  956. "limit_num": 0,
  957. "express_delivery": true,
  958. "store_mention": true,
  959. "attrInfo": {
  960. "id": 9,
  961. "product_id": 102,
  962. "suk": "黑色,CH510",
  963. "stock": 98,
  964. "sales": 2,
  965. "price": "299.00",
  966. "image": "https://demo26.crmeb.net/uploads/attach/2021/11/15/small_a79f5d2ea6bf0c3c11b2127332dfe2df.jpg",
  967. "bar_code": "",
  968. "ot_price": "349.00",
  969. "volume": "0.00",
  970. "weight": "0.00",
  971. "brokerage": "0.00",
  972. "brokerage_two": "0.00",
  973. "type": 0,
  974. "unique": "02cce37e",
  975. "cost": "259.00",
  976. "quota": 0,
  977. "quota_show": 0,
  978. "vip_price": "0.00",
  979. "is_virtual": 0,
  980. "coupon_id": 0,
  981. "disk_info": ""
  982. }
  983. },
  984. "attrStatus": true,
  985. "vip_truePrice": 0,
  986. "costPrice": "259.00",
  987. "trueStock": 98,
  988. "truePrice": 299,
  989. "sum_price": "299.00",
  990. "price_type": "level",
  991. "is_valid": 1
  992. },
  993. {
  994. "id": 9669,
  995. "uid": 34391,
  996. "type": "0",
  997. "product_id": 89,
  998. "product_attr_unique": "89807c67",
  999. "cart_num": 1,
  1000. "add_time": 1666709911,
  1001. "is_pay": 0,
  1002. "is_del": 0,
  1003. "is_new": 0,
  1004. "combination_id": 0,
  1005. "seckill_id": 0,
  1006. "bargain_id": 0,
  1007. "advance_id": 0,
  1008. "status": 1,
  1009. "productInfo": {
  1010. "id": 89,
  1011. "mer_id": 0,
  1012. "image": "https://demo26.crmeb.net/uploads/attach/2021/11/20211113/small_2fbe723632427b0768df24c4f23c6cad.png",
  1013. "recommend_image": "",
  1014. "slider_image": [
  1015. "https://demo26.crmeb.net/uploads/attach/2021/11/20211113/2fbe723632427b0768df24c4f23c6cad.png",
  1016. "https://demo26.crmeb.net/uploads/attach/2021/11/20211113/64d188477292aa4ae2df8da7e63aca79.png"
  1017. ],
  1018. "store_name": "家居梵高系列联名款饭盒袋大容量手拎保温实用方便 星月夜饭盒袋",
  1019. "store_info": "",
  1020. "keyword": "家居梵高系列联名款饭盒袋大容量手拎保温实用方便 星月夜饭盒袋",
  1021. "bar_code": "",
  1022. "cate_id": "35",
  1023. "price": "350.00",
  1024. "vip_price": "0.00",
  1025. "ot_price": "300.00",
  1026. "postage": "0.00",
  1027. "unit_name": "件",
  1028. "sort": 553,
  1029. "sales": 19,
  1030. "stock": 185,
  1031. "is_show": 1,
  1032. "is_hot": 1,
  1033. "is_benefit": 0,
  1034. "is_best": 0,
  1035. "is_new": 0,
  1036. "is_virtual": 0,
  1037. "virtual_type": 0,
  1038. "add_time": 1636777038,
  1039. "is_postage": 0,
  1040. "is_del": 0,
  1041. "mer_use": 0,
  1042. "give_integral": "0.00",
  1043. "cost": "300.00",
  1044. "is_seckill": 0,
  1045. "is_bargain": null,
  1046. "is_good": 1,
  1047. "is_sub": 0,
  1048. "is_vip": 0,
  1049. "ficti": 0,
  1050. "browse": 0,
  1051. "code_path": "",
  1052. "soure_link": "",
  1053. "temp_id": 0,
  1054. "spec_type": 1,
  1055. "activity": "0,1,2,3",
  1056. "spu": "1015710267816",
  1057. "label_id": "",
  1058. "video_link": "",
  1059. "command_word": "",
  1060. "recommend_list": "",
  1061. "vip_product": 0,
  1062. "presale": 0,
  1063. "presale_start_time": 0,
  1064. "presale_end_time": 0,
  1065. "presale_day": 0,
  1066. "logistics": "1,2",
  1067. "freight": 2,
  1068. "custom_form": "[]",
  1069. "is_limit": 0,
  1070. "limit_type": 0,
  1071. "limit_num": 0,
  1072. "express_delivery": true,
  1073. "store_mention": true,
  1074. "attrInfo": {
  1075. "id": 1017,
  1076. "product_id": 89,
  1077. "suk": "梵高自画像饭盒",
  1078. "stock": 88,
  1079. "sales": 8,
  1080. "price": "350.00",
  1081. "image": "https://demo26.crmeb.net/uploads/attach/2021/11/20211113/small_2fbe723632427b0768df24c4f23c6cad.png",
  1082. "bar_code": "",
  1083. "ot_price": "300.00",
  1084. "volume": "0.00",
  1085. "weight": "0.00",
  1086. "brokerage": "0.00",
  1087. "brokerage_two": "0.00",
  1088. "type": 0,
  1089. "unique": "89807c67",
  1090. "cost": "300.00",
  1091. "quota": 0,
  1092. "quota_show": 0,
  1093. "vip_price": "0.00",
  1094. "is_virtual": 0,
  1095. "coupon_id": 0,
  1096. "disk_info": ""
  1097. }
  1098. },
  1099. "attrStatus": true,
  1100. "vip_truePrice": 0,
  1101. "costPrice": "300.00",
  1102. "trueStock": 88,
  1103. "truePrice": 350,
  1104. "sum_price": "350.00",
  1105. "price_type": "level",
  1106. "is_valid": 1
  1107. }
  1108. ],
  1109. "invalid": [],
  1110. "deduction": {
  1111. "seckill_id": 0,
  1112. "bargain_id": 0,
  1113. "combination_id": 0,
  1114. "discount_id": 0
  1115. }
  1116. }
  1117. let cartList = cartListData
  1118. let valid = cartList.valid
  1119. let validList = that.$util.SplitArray(valid, that.cartList.valid);
  1120. let numSub = [{
  1121. numSub: true
  1122. }, {
  1123. numSub: false
  1124. }];
  1125. let numAdd = [{
  1126. numAdd: true
  1127. }, {
  1128. numAdd: false
  1129. }],
  1130. selectValue = [];
  1131. if (validList.length > 0) {
  1132. for (let index in validList) {
  1133. if (validList[index].cart_num == 1) {
  1134. validList[index].numSub = true;
  1135. } else {
  1136. validList[index].numSub = false;
  1137. }
  1138. let productInfo = validList[index].productInfo;
  1139. if (productInfo.hasOwnProperty('attrInfo') && validList[index].cart_num ==
  1140. validList[index].productInfo.attrInfo
  1141. .stock) {
  1142. validList[index].numAdd = true;
  1143. } else if (validList[index].cart_num == validList[index].productInfo
  1144. .stock) {
  1145. validList[index].numAdd = true;
  1146. } else {
  1147. validList[index].numAdd = false;
  1148. }
  1149. if (validList[index].attrStatus) {
  1150. validList[index].checked = true;
  1151. selectValue.push(validList[index].id);
  1152. } else {
  1153. validList[index].checked = false;
  1154. }
  1155. }
  1156. }
  1157. that.$set(that.cartList, 'valid', validList);
  1158. data.page = that.page + 1;
  1159. // that.goodsHidden = cartList.valid.length <= 0 ? false : true;
  1160. that.selectValue = selectValue;
  1161. let newArr = validList.filter(item => item.attrStatus);
  1162. that.isAllSelect = newArr.length == selectValue.length && newArr.length;
  1163. that.switchSelect();
  1164. }
  1165. that.loading = false;
  1166. this.canShow = true
  1167. uni.hideLoading();
  1168. // });
  1169. },
  1170. getInvalidList: function() {
  1171. let that = this;
  1172. if (this.loadendInvalid) return false;
  1173. if (this.loadingInvalid) return false;
  1174. let data = {
  1175. page: that.pageInvalid,
  1176. limit: that.limitInvalid,
  1177. status: 0
  1178. }
  1179. let resData = {
  1180. "valid": [],
  1181. "invalid": [],
  1182. "deduction": {
  1183. "seckill_id": 0,
  1184. "bargain_id": 0,
  1185. "combination_id": 0,
  1186. "discount_id": 0
  1187. }
  1188. }
  1189. // getCartList(data).then(res => {
  1190. let cartList = resData,
  1191. invalid = cartList.invalid,
  1192. loadendInvalid = invalid.length < that.limitInvalid;
  1193. let invalidList = that.$util.SplitArray(invalid, that.cartList.invalid);
  1194. that.$set(that.cartList, 'invalid', invalidList);
  1195. that.loadendInvalid = loadendInvalid;
  1196. that.loadTitleInvalid = loadendInvalid ? that.$t(`我也是有底线的`) : that.$t(`加载更多`);
  1197. that.pageInvalid = that.pageInvalid + 1;
  1198. that.loadingInvalid = false;
  1199. // }).catch(res => {
  1200. // that.loadingInvalid = false;
  1201. // that.loadTitleInvalid = that.$t(`加载更多`);
  1202. // })
  1203. },
  1204. getHostProduct: function() {
  1205. let that = this;
  1206. if (that.hotScroll) return
  1207. that.hotPage++
  1208. that.hotScroll = hot_res.length < that.hotLimit
  1209. that.hostProduct = that.hostProduct.concat(hot_res)
  1210. // getProductHot(
  1211. // that.hotPage,
  1212. // that.hotLimit,
  1213. // ).then(res => {
  1214. // that.hotPage++
  1215. // that.hotScroll = res.data.length < that.hotLimit
  1216. // that.hostProduct = that.hostProduct.concat(res.data)
  1217. // });
  1218. },
  1219. goodsOpen: function() {
  1220. let that = this;
  1221. that.goodsHidden = !that.goodsHidden;
  1222. },
  1223. goRouter(item) {
  1224. var pages = getCurrentPages();
  1225. var page = (pages[pages.length - 1]).$page.fullPath;
  1226. if (item.link == page) return
  1227. uni.switchTab({
  1228. url: item.link,
  1229. fail(err) {
  1230. uni.redirectTo({
  1231. url: item.link
  1232. })
  1233. }
  1234. })
  1235. },
  1236. manage: function() {
  1237. let that = this;
  1238. that.footerswitch = !that.footerswitch;
  1239. let arr1 = [];
  1240. let arr2 = [];
  1241. let newValid = that.cartList.valid.map(item => {
  1242. if (that.footerswitch) {
  1243. if (item.attrStatus) {
  1244. if (item.checked) {
  1245. arr1.push(item.id);
  1246. }
  1247. } else {
  1248. item.checked = false;
  1249. arr2.push(item);
  1250. }
  1251. } else {
  1252. if (item.checked) {
  1253. arr1.push(item.id);
  1254. }
  1255. }
  1256. return item;
  1257. });
  1258. that.cartList.valid = newValid;
  1259. if (that.footerswitch) {
  1260. that.isAllSelect = newValid.length === arr1.length + arr2.length;
  1261. } else {
  1262. that.isAllSelect = newValid.length === arr1.length;
  1263. }
  1264. that.selectValue = arr1;
  1265. that.switchSelect();
  1266. },
  1267. unsetCart: function() {
  1268. let that = this,
  1269. ids = [];
  1270. for (let i = 0, len = that.cartList.invalid.length; i < len; i++) {
  1271. ids.push(that.cartList.invalid[i].id);
  1272. }
  1273. cartDel(ids).then(res => {
  1274. that.$util.Tips({
  1275. title: that.$t(`清除成功`)
  1276. });
  1277. that.$set(that.cartList, 'invalid', []);
  1278. that.getCartNum();
  1279. }).catch(res => {
  1280. });
  1281. }
  1282. },
  1283. onReachBottom() {
  1284. let that = this;
  1285. if (that.loadend) {
  1286. that.getInvalidList();
  1287. }
  1288. if (that.cartList.valid.length == 0 && that.cartList.invalid.length == 0) {
  1289. that.getHostProduct();
  1290. }
  1291. }
  1292. }
  1293. </script>
  1294. <style scoped lang="scss">
  1295. .order_addcart {
  1296. padding: 20rpx;
  1297. }
  1298. .rank-list {
  1299. background: white;
  1300. margin-top: 20rpx;
  1301. padding-top: 20rpx;
  1302. padding-bottom: 10rpx;
  1303. .rank-list-item {
  1304. margin: 20rpx;
  1305. margin-bottom: 40rpx;
  1306. width: calc(100% - 40rpx);
  1307. height: 50rpx;
  1308. display: flex;
  1309. image {
  1310. width: 50rpx;
  1311. height: 50rpx;
  1312. margin-right: 20rpx;
  1313. margin-left: 10rpx;
  1314. }
  1315. .nuber {
  1316. font-size: 18rpx;
  1317. margin-right: 20rpx;
  1318. line-height: 0rpx;
  1319. }
  1320. .mosaic {
  1321. font-size: 18rpx;
  1322. margin-right: 20rpx;
  1323. color: #999999;
  1324. line-height: 0rpx;
  1325. }
  1326. .litem-info {
  1327. text-align: right;
  1328. flex-grow: 1;
  1329. font-size: 24rpx;
  1330. line-height: 50rpx;
  1331. margin-right: 20rpx;
  1332. color: #666666;
  1333. }
  1334. .balance {
  1335. line-height: 50rpx;
  1336. color: #EB4C63;
  1337. }
  1338. }
  1339. }
  1340. .loop {
  1341. // background: url('../../static/order_addcart/hongbaochi.png') no-repeat;
  1342. width: 100%;
  1343. height: 250rpx;
  1344. background-size: 100% 100%;
  1345. position: relative;
  1346. .loop-title {
  1347. padding: 20rpx;
  1348. padding-left: 35rpx;
  1349. font-size: 32rpx;
  1350. }
  1351. .loop-count {
  1352. text-align: center;
  1353. line-height: 97rpx;
  1354. font-size: 48rpx;
  1355. color: #EB4C63;
  1356. width: 420rpx;
  1357. height: 97rpx;
  1358. background: #FFFFFF;
  1359. border-radius: 23px;
  1360. border: 1px solid #EB4C63;
  1361. position: absolute;
  1362. left: 50%;
  1363. top: 47%;
  1364. transform: translateX(-50%);
  1365. }
  1366. // image {
  1367. // width: 100%;
  1368. // }
  1369. }
  1370. .tab-area {
  1371. margin-top: 20rpx;
  1372. display: flex;
  1373. flex-wrap: nowrap;
  1374. justify-content: space-between;
  1375. line-height: 90rpx;
  1376. text-align: center;
  1377. .base-tab {
  1378. width: 48%;
  1379. height: 90rpx;
  1380. }
  1381. .tab-area-active1 {
  1382. // background: url('../../static/order_addcart/tab1.png') no-repeat;
  1383. background-size: 340rpx 120rpx;
  1384. }
  1385. .tab-area-active2 {
  1386. // background: url('../../static/order_addcart/tab2.png') no-repeat;
  1387. background-size: 340rpx 120rpx;
  1388. }
  1389. }
  1390. .order_addcart-header-area {
  1391. display: flex;
  1392. .received {
  1393. width: 405rpx;
  1394. height: 175rpx;
  1395. padding: 20rpx;
  1396. margin-bottom: 20rpx;
  1397. margin-right: 20rpx;
  1398. background-color: #fff;
  1399. border-radius: 20rpx;
  1400. overflow: hidden;
  1401. position: relative;
  1402. display: flex;
  1403. .pictrue {
  1404. display: flex;
  1405. align-items: center;
  1406. image {
  1407. width: 98rpx;
  1408. height: 98rpx;
  1409. }
  1410. margin-right: 20rpx;
  1411. }
  1412. .text-info {
  1413. display: flex;
  1414. flex-direction: column;
  1415. justify-content: center;
  1416. color: #6EB03A;
  1417. .received-count {
  1418. font-size: 38rpx;
  1419. margin-bottom: 10rpx;
  1420. letter-spacing: 2px;
  1421. }
  1422. .received-info {
  1423. font-size: 28rpx;
  1424. }
  1425. }
  1426. }
  1427. .loss {
  1428. flex-grow: 1;
  1429. height: 175rpx;
  1430. padding: 20rpx;
  1431. margin-bottom: 20rpx;
  1432. background-color: #fff;
  1433. border-radius: 20rpx;
  1434. overflow: hidden;
  1435. position: relative;
  1436. display: flex;
  1437. .text-info {
  1438. width: 100%;
  1439. display: flex;
  1440. flex-direction: column;
  1441. justify-content: center;
  1442. text-align: center;
  1443. color: #D08D5B;
  1444. .received-count {
  1445. font-size: 38rpx;
  1446. margin-bottom: 10rpx;
  1447. letter-spacing: 2px;
  1448. }
  1449. .received-info {
  1450. font-size: 28rpx;
  1451. }
  1452. }
  1453. }
  1454. }
  1455. </style>