u-attr.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799
  1. <template>
  2. <view class="u-attr">
  3. <view @click="turnOn">
  4. <slot name="btn"></slot>
  5. </view>
  6. <u-popup v-model="newValue" mode="bottom" border-radius="14" :safeAreaInsetBottom="true" @close="close">
  7. <view class="u-model" @touchmove.stop.prevent>
  8. <view class="u-top dir-left-nowrap u-border-box">
  9. <view class="u-pic u-border-box" @click="clickImg(imgUrl)">
  10. <image class="u-img" :src="imgUrl"></image>
  11. </view>
  12. <view class="u-info">
  13. <view class="cross-center dir-left-nowrap" :style="{'color': theme.color}">
  14. <view class="dir-left-nowrap">
  15. <slot name="priceBefore"></slot>
  16. <view class="u-price">
  17. <app-price
  18. v-if="is_show_price"
  19. :theme="theme"
  20. :sign="sign"
  21. :price="sellPrice"
  22. :default-price="goods.price"
  23. ></app-price>
  24. </view>
  25. </view>
  26. <app-member-mark
  27. v-if="goods.level_show === 1"
  28. :theme="theme"
  29. ></app-member-mark>
  30. </view>
  31. <view class="u-stock">库存:{{stock}}</view>
  32. </view>
  33. <view class="u-close-image" @click="close">
  34. <image class="bd-close-image u-border-box" src="/static/image/icon/icon-close.png" ></image>
  35. </view>
  36. </view>
  37. <view class="u-center">
  38. <scroll-view class="u-scroll-view" scroll-y="true">
  39. <slot name="extra"></slot>
  40. <view v-if="goods.type === 'goods'" class="u-attr-group u-border-box" v-for="(item, index) in newGroup" :key="index">
  41. <view class="u-group-name u-text">{{item.attr_group_name}}</view>
  42. <view class="dir-left-wrap" >
  43. <view :class="['u-group-item', attr.select ? 'u-checked' : 'u-unchecked', attr.num_0 ? 'u-attr_num_0' : '',attr.nothas ? 'u-attr_num_0' : '']"
  44. :style="{'background-color': attr.select ? theme.background : ''}"
  45. @click="storeAttr(attr.attr_id, item.attr_group_id, attr.num_0, attr)"
  46. v-for="(attr, key) in item.attr_list" :key="key">
  47. {{attr.attr_name}}
  48. </view>
  49. </view>
  50. </view>
  51. <view v-if="is_choose_number" class="u-number dir-left-nowrap main-between cross-center">
  52. <view class="u-text">数量</view>
  53. <view class="dir-left-nowrap u-input-box">
  54. <view @click.stop="numberSub" :class="[number <=1 ? 'u-reduced-1' : 'u-reduced-0', 'u-number-btn']"></view>
  55. <input @blur="numberBlur" type="number" class="u-input" v-model="number">
  56. <view @click.stop="numberAdd" class="u-number-btn u-added-1"></view>
  57. </view>
  58. </view>
  59. </scroll-view>
  60. </view>
  61. <view>
  62. <app-sell-tip :time="sell_time" @changeTime="changeTime"></app-sell-tip>
  63. </view>
  64. <app-jump-button form>
  65. <view class="u-bottom dir-left-nowrap">
  66. <view
  67. v-if="is_show_left && (goods.type === 'goods' || is_must_left)"
  68. class="box-grow-1"
  69. :style="{'color': theme.secondary_text,'background': theme.background_s_gradient_btn}"
  70. :class="['u-btn', is_show_right ? 'bd-btn-left' : '']"
  71. @click="leftSubmit">
  72. <slot name="left_slot"></slot>
  73. <template v-if="!$slots.left_slot">{{leftText}}</template>
  74. </view>
  75. <template v-if="(sign == '' || sign == 'mch') && sell_time > 0">
  76. <view
  77. v-if="isTip == 1"
  78. class="box-grow-1"
  79. @click="rightTip"
  80. :style="{'background': !$slots.right_slot ? theme.background_gradient_btn : ''}"
  81. :class="[!$slots.right_slot ? ' u-btn u-btn-color' : '', !(is_show_left && (goods.type === 'goods' || is_must_left)) ? '' : ' bd-btn-right']"
  82. >
  83. {{rightRemindText}}
  84. </view>
  85. </template>
  86. <template v-else>
  87. <view
  88. v-if="is_show_right"
  89. class="box-grow-1"
  90. @click="rightSubmit"
  91. :style="{'background': !$slots.right_slot ? theme.background_gradient_btn : ''}"
  92. :class="[!$slots.right_slot ? ' u-btn u-btn-color' : '', !(is_show_left && (goods.type === 'goods' || is_must_left)) ? '' : ' bd-btn-right']"
  93. >
  94. <slot name="right_slot"></slot>
  95. <template v-if="!$slots.right_slot">{{rightText}}</template>
  96. </view>
  97. <template v-if="$slots.right">
  98. <slot name="right"></slot>
  99. </template>
  100. </template>
  101. </view>
  102. </app-jump-button>
  103. </view>
  104. </u-popup>
  105. </view>
  106. </template>
  107. <script>
  108. import uPopup from '../../basic-component/u-popup/u-popup.vue';
  109. import appPrice from "../goods/app-price.vue";
  110. import appMemberMark from "../app-member-mark/app-member-mark.vue";
  111. import {mapGetters, mapState} from "vuex";
  112. import appSellTip from './app-sell-tip.vue';
  113. import goodsMixin from '@/core/goods-mixin.js';
  114. export default {
  115. name: "u-attr",
  116. mixins: [goodsMixin],
  117. props: {
  118. value: {
  119. type: [Boolean, Number]
  120. },
  121. goods: {
  122. type: Object,
  123. default: function() {
  124. return {}
  125. },
  126. required: true
  127. },
  128. theme: {
  129. type: Object
  130. },
  131. checked: {
  132. type: Object
  133. },
  134. is_show_price: {
  135. type: Boolean,
  136. default: true
  137. },
  138. is_show_left: {
  139. type: Boolean,
  140. default: true
  141. },
  142. is_must_left: {
  143. type: Boolean,
  144. default: false
  145. },
  146. is_show_right: {
  147. type: Boolean,
  148. default: true
  149. },
  150. is_choose_number: {
  151. type: Boolean,
  152. default: true,
  153. },
  154. leftText: {
  155. type: String,
  156. default: '加入购物车'
  157. },
  158. rightText: {
  159. type: String,
  160. default: '立即购买'
  161. },
  162. leftFunc: {
  163. type: Boolean
  164. },
  165. rightFunc: {
  166. type: Boolean
  167. },
  168. sign: {
  169. type: String
  170. },
  171. again: {
  172. type: Number
  173. },
  174. attentionSign : {
  175. type: String
  176. }
  177. },
  178. data() {
  179. return {
  180. newValue: false,
  181. picUrl: null,
  182. newGroup: [],
  183. number: 1,
  184. sell_time: 0,
  185. }
  186. },
  187. created() {
  188. // if(this.sign == 'community') {
  189. this.number = 1
  190. // }
  191. },
  192. methods: {
  193. close: function() {
  194. this.$emit('input', false);
  195. },
  196. turnOn: function() {
  197. this.$emit('input', true);
  198. },
  199. inArray: function(newVal, arr) {
  200. return arr.some(v => {
  201. return newVal === v;
  202. });
  203. },
  204. in_array:function(search,array){
  205. for(var i in array){
  206. if(array[i]==search){
  207. return true;
  208. }
  209. }
  210. return false;
  211. },
  212. identifier: function(copyGroup, attrNum_0, select) {
  213. copyGroup.forEach(f => {
  214. f.attr_list.forEach(c => {
  215. let param = `${f.attr_group_id}-${c.attr_id}`;
  216. this.inArray(param, attrNum_0) && !this.inArray(param, select) ? c.num_0 = true : c.num_0 = false;
  217. });
  218. });
  219. },
  220. selectCheck: function(copyAttr, attrNum_0, select) {
  221. copyAttr.forEach(f => {
  222. let arr = [];
  223. let sign = 0;
  224. f.attr_list.forEach(c => {
  225. let param = `${c.attr_group_id}-${c.attr_id}`;
  226. if (!this.inArray(param, select)) {
  227. sign += 1;
  228. arr.push(param);
  229. }
  230. });
  231. if (f.stock === 0 && sign <= 1) Array.prototype.push.apply(attrNum_0, arr);
  232. if (sign === 0) {
  233. this.$emit('check',{item: f, number: 1});
  234. }
  235. });
  236. },
  237. storeAttr: function(attr_id, group_id, num_0, attr) {
  238. if (num_0 === true) return;
  239. let newGroup = this.newGroup;
  240. let copyAttr = this.copyAttr;
  241. let select = [];
  242. console.log(attr_id);
  243. console.log(group_id);
  244. console.log(num_0)
  245. console.log(newGroup);
  246. console.log(copyAttr);
  247. console.log('attr',attr)
  248. newGroup.forEach((i, index) => {
  249. let attr_list = i.attr_list;
  250. attr_list.forEach((k,ind) => {
  251. if (i.attr_group_id === group_id) {
  252. if (k.attr_id === attr_id) {
  253. if (k.select === true) {
  254. k.select = false;
  255. console.log('反选')
  256. newGroup.forEach((i, index) => {
  257. let attr_list = i.attr_list;
  258. attr_list.forEach((k,ind) => {
  259. k.nothas = false
  260. k.select = false;
  261. })
  262. })
  263. } else {
  264. k.select = true;
  265. }
  266. } else {
  267. k.select = false;
  268. }
  269. //k.attr_id === attr_id ? k.select = true : k.select = false;
  270. }else{
  271. // k.nothas = true
  272. // k.select = false
  273. console.log('k',k)
  274. copyAttr.forEach((item,index)=>{
  275. if(attr.attr_name == item.attr_list[0].attr_name){
  276. console.log('name',item)
  277. if(k.attr_name != item.attr_list[1].attr_name){
  278. k.nothas = true
  279. k.select = false;
  280. }else{
  281. k.nothas = false
  282. k.select = false;
  283. }
  284. }
  285. // if(attr.attr_name == item.attr_list[1].attr_name){
  286. // if(k.attr_name == item.attr_list[0].attr_name){
  287. // console.log('guige',item)
  288. // k.nothas = false
  289. // // k.nothas = true
  290. // k.select = true;
  291. // }else{
  292. // k.select = false;
  293. // // // k.nothas = true
  294. // // if(k.select != true && k.attr_name != item.attr_list[1].attr_name){
  295. // // k.select = false;
  296. // // k.nothas = true
  297. // // }else{
  298. // // k.select = true;
  299. // // k.nothas = false
  300. // // }
  301. // }
  302. // }
  303. })
  304. }
  305. if (k.select === true) {
  306. select.push(`${i.attr_group_id}-${k.attr_id}`);
  307. if (index === 0) this.picUrl = k.pic_url;
  308. }
  309. });
  310. });
  311. //规格判定新增
  312. // copyAttr.forEach((i, index) => {
  313. // console.log(i)
  314. // let sign_id = i.sign_id;
  315. // var attr_arr_sign = sign_id.split(":");
  316. // // console.log(attr_arr_sign);
  317. // if(this.in_array(attr_id,attr_arr_sign)){
  318. // newGroup.forEach((ni, nindex) => {
  319. // let attr_list = ni.attr_list;
  320. // attr_list.forEach((ai,k) => {
  321. // ai.nothas = false;
  322. // if (ni.attr_group_id != group_id) {
  323. // if(!this.in_array(ai.attr_id,attr_arr_sign)){
  324. // console.log(ai.attr_id);
  325. // ai.nothas = true;
  326. // if(ai.select){
  327. // ai.select = false;
  328. // }
  329. // }else{
  330. // ai.nothas = false;
  331. // ai.select = true;
  332. // }
  333. // }
  334. // });
  335. // })
  336. // }
  337. // });
  338. let attrNum_0 = [];
  339. this.selectCheck(copyAttr, attrNum_0, select);
  340. this.$nextTick(() => {
  341. if (this.number > this.stock) this.number = this.stock;
  342. });
  343. this.identifier(newGroup, attrNum_0, select);
  344. if (select.length !== newGroup.length) {
  345. this.$emit('check', {
  346. item: null,
  347. number: 1
  348. });
  349. }
  350. },
  351. firstSelect: function() {
  352. console.log(1111111111)
  353. if (!this.copyGroup || !this.copyAttr) return;
  354. let copyGroup = this.copyGroup;
  355. let copyAttr = this.copyAttr;
  356. let groupLength = copyGroup.length;
  357. let select = [];
  358. copyAttr.forEach(i => {
  359. let attr_list = i.attr_list;
  360. attr_list.forEach(j => {
  361. let attr_group_id = j.attr_group_id;
  362. copyGroup.forEach(k => {
  363. if (attr_group_id === k.attr_group_id) {
  364. let groups_attr_list = k.attr_list;
  365. groups_attr_list.forEach(g => {
  366. if (g.attr_id === j.attr_id) {
  367. if (i.stock > 0) {
  368. if (groupLength > 0) {
  369. g.select = true;
  370. select.push(`${k.attr_group_id}-${g.attr_id}`);
  371. if (groupLength === copyGroup.length) {
  372. this.picUrl = g.pic_url;
  373. }
  374. groupLength--;
  375. }else{
  376. console.log('g',g)
  377. if(g.attr_group_name == '效期'){
  378. g.nothas = true
  379. }
  380. }
  381. }
  382. }
  383. });
  384. }
  385. });
  386. });
  387. });
  388. let attrNum_0 = [];
  389. this.selectCheck(copyAttr, attrNum_0, select);
  390. this.identifier(copyGroup, attrNum_0, select);
  391. this.newGroup = copyGroup;
  392. },
  393. numberBlur: function (e) {
  394. let value = parseInt(e.detail.value);
  395. if (!value) value = 1;
  396. if (value > this.stock) {
  397. value = this.stock;
  398. uni.showToast({
  399. title: '库存不足',
  400. icon: 'none'
  401. });
  402. }
  403. this.number = value;
  404. },
  405. numberSub:function() {
  406. let value = this.number;
  407. if (value > 1) {
  408. value--;
  409. this.number = value;
  410. }
  411. },
  412. numberAdd: function() {
  413. let value = this.number;
  414. value++;
  415. if (value > this.stock) {
  416. value = this.stock;
  417. uni.showToast({
  418. title: '库存不足',
  419. icon: 'none'
  420. });
  421. }
  422. if (!this.checkLimitBuy(value)) {
  423. value = this.goods.limit_buy.rest_number;
  424. }
  425. this.number = value;
  426. },
  427. leftSubmit:function() {
  428. if (this.leftFunc === true) {
  429. this.$emit('leftFunc', this.number);
  430. } else {
  431. this.cart();
  432. }
  433. this.close();
  434. },
  435. rightSubmit:function() {
  436. if (!this.checked) {
  437. uni.showToast({
  438. title: '请先选规格',
  439. icon: 'none'
  440. });
  441. return false;
  442. }
  443. if (!this.$user.isLogin()) {
  444. return this.$user.getInfo();
  445. }
  446. let attrs = [];
  447. this.checked.attr_list.forEach(item => {
  448. attrs.push({
  449. attr_id: item.attr_id,
  450. attr_group_id: item.attr_group_id
  451. });
  452. });
  453. let goods = {
  454. mch_id: this.goods.mch_id ? this.goods.mch_id : 0,
  455. goods_list: [
  456. {
  457. id: this.goods.id,
  458. attrs,
  459. num: this.number,
  460. cat_id: 0,
  461. goods_attr_id: this.checked.id
  462. }
  463. ]
  464. }
  465. if (!this.checkMinNUmber()) {
  466. return ;
  467. }
  468. if (!this.checkLimitBuy(this.number)) {
  469. return ;
  470. }
  471. if (this.rightFunc === true) {
  472. this.$emit('rightFunc', goods);
  473. } else {
  474. this.shop(goods);
  475. }
  476. this.close();
  477. },
  478. shop: function(goods) {
  479. uni.navigateTo({
  480. url: `/pages/order-submit/order-submit?mch_list=${JSON.stringify([goods])}`
  481. });
  482. },
  483. cart: function() {
  484. if (!this.checked) {
  485. uni.showToast({
  486. title: '请先选规格',
  487. icon: 'none'
  488. });
  489. return false;
  490. }
  491. if (this.goods.type === 'ecard') return;
  492. this.$request({
  493. url: this.$api.cart.add,
  494. method: 'post',
  495. data: {
  496. goods_id: this.checked.goods_id,
  497. attr: this.checked.id,
  498. num: this.number
  499. }
  500. }).then(res => {
  501. if (res.code === 0) {
  502. uni.showToast({
  503. title: res.msg,
  504. icon: 'none'
  505. });
  506. this.$emit('cart', this.checked, this.number);
  507. this.close();
  508. } else {
  509. uni.showToast({
  510. title: res.msg,
  511. icon: "none",
  512. duration: 2500
  513. });
  514. }
  515. });
  516. },
  517. clickImg(src) {
  518. // #ifdef MP
  519. uni.previewImage({
  520. current: 0,
  521. urls: [src]
  522. });
  523. // #endif
  524. // #ifdef H5
  525. this.$jwx.previewImage({
  526. current: src,
  527. urls: [src]
  528. });
  529. // #endif
  530. },
  531. checkMinNUmber() {
  532. if (this.goods.min_number > this.number) {
  533. this.$tips.showToast({
  534. title: '该商品' + this.goods.min_number + this.goods.unit + '起售',
  535. icon: 'none'
  536. });
  537. return false;
  538. }
  539. return true;
  540. },
  541. checkLimitBuy(value) {
  542. if (typeof this.goods.limit_buy !== 'undefined' && this.goods.limit_buy.status == 1 && this.goods.limit_buy.rest_number < value) {
  543. this.$tips.showToast({
  544. title: this.goods.limit_buy.text,
  545. icon: 'none'
  546. });
  547. return false;
  548. }
  549. return true;
  550. },
  551. changeTime(time) {
  552. this.sell_time = time;
  553. }
  554. },
  555. components: {
  556. uPopup,
  557. appPrice,
  558. appMemberMark,
  559. appSellTip
  560. },
  561. computed: {
  562. imgUrl: function() {
  563. if (this.picUrl) {
  564. return this.picUrl;
  565. } else if (this.goods) {
  566. return this.goods.cover_pic;
  567. } else {
  568. return '';
  569. }
  570. },
  571. stock: function() {
  572. if (!this.$validation.isEmpty(this.checked)) {
  573. return this.checked.stock;
  574. } else if (!this.$validation.isEmpty(this.goods)) {
  575. return this.goods.goods_num;
  576. }
  577. },
  578. sellPrice: function() {
  579. if (!this.$validation.isEmpty(this.checked)) {
  580. return this.goods.level_show === 1 ? this.checked.price_member : this.checked.price;
  581. } else if (!this.$validation.isEmpty(this.goods)) {
  582. return this.goods.hasOwnProperty('price_min') ? this.goods.price_min : this.goods.price;
  583. }
  584. },
  585. copyGroup: function() {
  586. if (!this.goods) return;
  587. console.log(this.goods.attr_groups)
  588. let group = this.$utils.deepClone(this.goods.attr_groups);
  589. console.log(group)
  590. for (let i = 0; i < group.length; i++) {
  591. group[i].attr_list.forEach(item => {
  592. item.select = false;
  593. item.num_0 = false;
  594. });
  595. }
  596. return group;
  597. },
  598. copyAttr: function() {
  599. if (!this.goods) return;
  600. return this.$utils.deepClone(this.goods.attr);
  601. },
  602. ...mapGetters({
  603. userInfo: 'user/info',
  604. }),
  605. ...mapState({
  606. isTip: state => state.mallConfig.mall.setting.is_remind_sell_time
  607. }),
  608. remindParams() {
  609. return {
  610. sell_time: this.sell_time,
  611. goods_id: this.goods.id,
  612. template_message_list: this.goods.template_message_list,
  613. buy_text: this.rightText
  614. };
  615. },
  616. },
  617. watch: {
  618. value: {
  619. handler(newVal) {
  620. this.newValue = newVal;
  621. if (newVal === false) {
  622. this.number = 1;
  623. return;
  624. }
  625. this.sell_time = this.goods.sell_time;
  626. if (this.$validation.isEmpty(this.checked)) this.$utils.throttle(this.firstSelect, 800);
  627. },
  628. immediate: true
  629. },
  630. number: {
  631. handler(newVal) {
  632. this.$emit('check', {
  633. item: this.checked,
  634. number: newVal
  635. });
  636. }
  637. },
  638. again: {
  639. handler() {
  640. this.firstSelect();
  641. }
  642. }
  643. }
  644. }
  645. </script>
  646. <style scoped >
  647. .u-model {
  648. width: 750upx;
  649. }
  650. .u-top {
  651. margin: 0 24upx;
  652. border-bottom: 1upx solid #e2e2e2;
  653. height: 140upx;
  654. }
  655. .u-close-image {
  656. width: 54upx;
  657. height: 78upx;
  658. padding: 24upx 0 24rpx 24rpx;
  659. margin-left: 24rpx;
  660. }
  661. .bd-close-image {
  662. width: 30upx;
  663. height: 30upx;
  664. }
  665. .u-pic {
  666. width: 200rpx;
  667. height: 200rpx;
  668. padding: 4upx;
  669. border-radius: 8rpx;
  670. position: relative;
  671. top: -64upx;
  672. background-color: #ffffff;
  673. }
  674. .u-img {
  675. width: 192rpx;
  676. height: 192rpx;
  677. background-color: #ffffff;
  678. }
  679. .u-info {
  680. width: 424upx;
  681. height: 136upx;
  682. padding: 45upx 0 0 24upx;
  683. }
  684. .u-scroll-view {
  685. width: 100%;
  686. max-height: calc(80vh - 154upx);
  687. }
  688. .u-attr-group {
  689. margin:24upx 32upx 0 32upx;
  690. border-bottom: 1upx solid #e2e2e2;
  691. }
  692. .u-number {
  693. height: 124upx;
  694. margin: 0 32upx;
  695. }
  696. .u-group-name {
  697. margin-bottom: 20upx;
  698. }
  699. .u-group-item {
  700. padding: 15upx 24upx;
  701. border-radius: 8upx;
  702. margin:0 20upx 20upx 0;
  703. font-size: 26upx;
  704. }
  705. .u-checked {
  706. color: #ffffff;
  707. }
  708. .u-unchecked {
  709. background-color: #f2f2f2;
  710. color: #353535;
  711. }
  712. .u-attr_num_0 {
  713. background-color: #f7f7f7;
  714. color: #cdcdcd;
  715. pointer-events: none;
  716. cursor: default;
  717. }
  718. .u-stock {
  719. font-size: 24upx;
  720. color: #999999;
  721. }
  722. .u-price {
  723. margin-right: 12upx;
  724. }
  725. .u-input {
  726. width: 88upx;
  727. height: 60upx;
  728. background-color: #f7f7f7;
  729. font-size: 20upx;
  730. color: #353535;
  731. text-align: center;
  732. }
  733. .u-input-box {
  734. width: 218upx;
  735. }
  736. .u-number-btn {
  737. height: 60upx;
  738. width: 60upx;
  739. background-repeat: no-repeat;
  740. background-size: 100% 100%;
  741. background-position: center;
  742. }
  743. .u-number-btn:first-child {
  744. margin-right: 5upx;
  745. }
  746. .u-number-btn:last-child {
  747. margin-left: 5upx;
  748. }
  749. .u-reduced-1 {
  750. background-image: url("../../../static/image/icon/can-be-reduced.png");
  751. }
  752. .u-reduced-0 {
  753. background-image: url("../../../static/image/cart/can-be-reduced.png");
  754. }
  755. .u-added-1 {
  756. background-image: url("../../../static/image/cart/can-be-added.png");
  757. }
  758. .u-text {
  759. font-size: 26upx;
  760. color: #666666;
  761. }
  762. .u-bottom {
  763. height: 110upx;
  764. width: 750upx;
  765. padding: 20upx 24upx;
  766. }
  767. .u-btn {
  768. text-align: center;
  769. line-height: 70upx;
  770. border-radius: 35upx;
  771. font-size: 26upx;
  772. width: calc(50% - 10upx);
  773. }
  774. .bd-btn-left {
  775. margin-right:10upx;
  776. /*border-top-right-radius: 0;*/
  777. /*border-bottom-right-radius: 0;*/
  778. }
  779. .bd-btn-right {
  780. margin-left: 10upx;
  781. /*border-top-left-radius: 0;*/
  782. /*border-bottom-left-radius: 0;*/
  783. }
  784. .u-btn-color {
  785. color: #ffffff;
  786. }
  787. </style>