u-attr.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876
  1. <template>
  2. <view class="u-attr">
  3. <view @click="turnOn">
  4. <slot name="btn"></slot>
  5. </view>
  6. <u-popup v-model="newValue" :custom-style="!is_yushou?is_yu:is_shou" :mask="is_yushou" mode="bottom" border-radius="14" :safeAreaInsetBottom="true" @close="close">
  7. <view class="u-model" @touchmove.stop.prevent :style="!is_yushou?'position:fixed;bottom:0;background:#fff':''">
  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', themeObject.color]">
  14. <view class="">
  15. <slot name="priceBefore"></slot>
  16. <text v-if="!is_yushou" style="font-size: 24rpx;" :class="theme+ '-m-text ' + theme">定金¥{{attr_deposit}}抵¥{{attr_swell_deposit}}</text>
  17. <view class="u-price" style="display: flex;align-items: center;">
  18. <app-price v-if="is_show_price" style="margin-right: 12rpx;" :theme="themeObject.theme"
  19. :userTheme="themeObject.userTheme" :sign="sign" :price="sellPrice"
  20. :default-price="goods.price"></app-price>
  21. <app-member-mark v-if="goods.level_show === 1" :theme="themeObject"></app-member-mark>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="u-stock">库存:{{stock}}</view>
  26. </view>
  27. <view class="u-close-image" @click="close">
  28. <image class="bd-close-image u-border-box" src="/static/image/icon/icon-close.png"></image>
  29. </view>
  30. </view>
  31. <view class="u-center">
  32. <scroll-view class="u-scroll-view" scroll-y="true">
  33. <slot name="extra"></slot>
  34. <view v-if="goods.type === 'goods'" class="u-attr-group u-border-box"
  35. v-for="(item, index) in newGroup" :key="index">
  36. <view class="u-group-name u-text">{{item.attr_group_name}}</view>
  37. <view class="dir-left-wrap">
  38. <view
  39. :class="['u-group-item', attr.select ? 'u-checked ' + themeObject.back : 'u-unchecked', attr.num_0 ? 'u-attr_num_0' : '']"
  40. @click="storeAttr(attr.attr_id, item.attr_group_id, attr.num_0)"
  41. v-for="(attr, key) in item.attr_list" :key="key">
  42. {{attr.attr_name}}
  43. </view>
  44. </view>
  45. </view>
  46. <view class="service"
  47. v-if="enable_screen&&service_screen&&service_screen.screenList&&service_screen.screenList.length>0&&!is_gift">
  48. <view class="service_title">全优汇服务</view>
  49. <view class="service_item">
  50. <image style="width: 26upx;height:26upx;"
  51. src="https://t12.9026.com/web/statics/icon1/sp.png"> </image>
  52. <view>
  53. <view style="float: left;">碎屏险</view>
  54. <view class="slh">{{screenDescription}}</view>
  55. </view>
  56. <view style="color: red;" @click="gotoSpDetail">服务说明
  57. <image style="width: 26upx;height:26upx;"
  58. src="https://t12.9026.com/web/statics/icon1/问号.png"> </image>
  59. </view>
  60. <!-- <view>{{service_screen.screenList.intro}}</view> -->
  61. </view>
  62. <view class="service_value">
  63. <view class="service_block" v-for="(item,index) of service_screen.screenList"
  64. :key="index" :class="{service_block_active:index == serviceId}"
  65. @click="select_service(index)">
  66. {{item.name}} ¥{{item.price}}
  67. </view>
  68. </view>
  69. </view>
  70. <view class="u-number dir-left-nowrap main-between cross-center">
  71. <view class="u-text">数量</view>
  72. <view class="dir-left-nowrap u-input-box">
  73. <view @click.stop="numberSub"
  74. :class="[number <=1 ? 'u-reduced-1' : 'u-reduced-0', 'u-number-btn']"></view>
  75. <input @blur="numberBlur" type="number" class="u-input" v-model="number">
  76. <view @click.stop="numberAdd" class="u-number-btn u-added-1"></view>
  77. </view>
  78. </view>
  79. </scroll-view>
  80. </view>
  81. <view class="u-bottom dir-left-nowrap" v-if="is_yushou">
  82. <view v-if="is_show_left && (goods.type === 'goods' || is_must_left)" class="box-grow-1"
  83. :class="cartClass" @click="leftSubmit">
  84. <slot name="left_slot"></slot>
  85. <template v-if="!$slots.left_slot">{{leftText}}</template>
  86. </view>
  87. <view v-if="is_show_right" class="box-grow-1" @click="rightSubmit"
  88. :class="[!$slots.right_slot ? themeObject.back + ' u-btn u-btn-color' : '']">
  89. <slot name="right_slot"></slot>
  90. <template v-if="!$slots.right_slot">{{rightText}}</template>
  91. </view>
  92. <template v-if="$slots.right">
  93. <slot name="right"></slot>
  94. </template>
  95. </view>
  96. </view>
  97. </u-popup>
  98. </view>
  99. </template>
  100. <script>
  101. import {
  102. mapState
  103. } from 'vuex'
  104. import uPopup from '../../basic-component/u-popup/u-popup.vue';
  105. import appPrice from "../goods/app-price.vue";
  106. import appMemberMark from "../app-member-mark/app-member-mark.vue";
  107. export default {
  108. name: "u-attr",
  109. props: {
  110. attr_swell_deposit: String,
  111. attr_deposit: String,
  112. value: {
  113. type: Boolean
  114. },
  115. goods: {
  116. type: Object
  117. },
  118. themeObject: {
  119. type: Object
  120. },
  121. checked: {
  122. type: Object
  123. },
  124. is_show_price: {
  125. type: Boolean,
  126. default: true
  127. },
  128. is_show_left: {
  129. type: Boolean,
  130. default: true
  131. },
  132. is_must_left: {
  133. type: Boolean,
  134. default: true
  135. },
  136. is_show_right: {
  137. type: Boolean,
  138. default: true
  139. },
  140. enable_screen: {
  141. type: Boolean,
  142. default: true
  143. },
  144. leftText: {
  145. type: String,
  146. default: '加入购物车'
  147. },
  148. rightText: {
  149. type: String,
  150. default: '立即购买'
  151. },
  152. leftFunc: {
  153. type: Boolean
  154. },
  155. rightFunc: {
  156. type: Boolean
  157. },
  158. sign: {
  159. type: String
  160. },
  161. again: {
  162. type: Number
  163. },
  164. is_gift: {
  165. type: Boolean,
  166. default: false
  167. },
  168. is_yushou: {
  169. type: Boolean,
  170. default: true
  171. },
  172. height:Number
  173. },
  174. data() {
  175. return {
  176. newValue: false,
  177. picUrl: null,
  178. newGroup: [],
  179. number: 1,
  180. service_screen: null, //碎屏险
  181. service_label: null, //当前对屏对象
  182. serviceId: null, //碎屏险ID
  183. card_id: null,
  184. screenDescription: '',
  185. shopgoods: {},
  186. is_yu:{
  187. marginBottom:'110rpx'
  188. },
  189. is_shou:{
  190. }
  191. }
  192. },
  193. methods: {
  194. gotoSpDetail() {
  195. uni.navigateTo({
  196. url: "/pages/goods/spDetail"
  197. })
  198. },
  199. select_service(index) {
  200. if (this.serviceId == index) {
  201. this.serviceId = null
  202. this.screenDescription = ""
  203. this.service_label = null
  204. this.card_id = null
  205. } else {
  206. this.serviceId = index
  207. this.screenDescription = this.service_screen.screenList[index]['description'] || ''
  208. this.service_label = this.service_screen.screenList[index]
  209. this.card_id = this.service_screen.screenList['card_id']
  210. }
  211. this.checked.service_label = this.service_label;
  212. this.checked.card_id = this.card_id;
  213. this.checked.hasScreen = this.hasCurrentServiceData();
  214. this.$emit('check', this.checked, this.number);
  215. // if(this.serviceId || this.serviceId===0){
  216. // this.service_screen.screenList.forEach((item,index)=>{
  217. // this.screenDescription=this.service_screen.screenList[index]['description']||''
  218. // })
  219. // }else{
  220. // this.service_label = null
  221. // }
  222. },
  223. getservice(copyGroup, attrNum_0, select) {
  224. console.log('getservice,164')
  225. console.log(copyGroup, attrNum_0, select)
  226. console.log(this.goods.attr)
  227. console.log(select)
  228. let select_val = []
  229. this.goods.attr.forEach((item, index) => {
  230. console.log(item)
  231. let select_item_list = []
  232. let select_item_value = ''
  233. let attrList = item.attr_list || [];
  234. attrList.forEach((value, key) => {
  235. select_item_value = value.attr_group_id + '-' + value.attr_id
  236. select_item_list.push(select_item_value)
  237. })
  238. if (JSON.stringify(select) == JSON.stringify(select_item_list)) {
  239. this.service_screen = item
  240. }
  241. })
  242. },
  243. getserviceByAttrId() {
  244. let that = this;
  245. this.goods.attr.forEach((item, index) => {
  246. if (item.id == this.checked.id) {
  247. that.service_screen = item
  248. that.select_service(0);
  249. }
  250. })
  251. },
  252. hasCurrentServiceData() {
  253. let that = this;
  254. let result = 0;
  255. console.log(this.service_screen)
  256. if (this.enable_screen && this.service_screen && this.service_screen.screenList &&
  257. this.service_screen.screenList.length > 0) {
  258. result = 1;
  259. } else
  260. result = 0;
  261. return result;
  262. },
  263. close: function() {
  264. this.$emit('input', false);
  265. },
  266. turnOn: function() {
  267. this.$emit('input', true);
  268. },
  269. inArray: function(newVal, arr) {
  270. return arr.some(v => {
  271. return newVal === v;
  272. });
  273. },
  274. identifier: function(copyGroup, attrNum_0, select) {
  275. console.log('identifier,175')
  276. copyGroup.forEach(f => {
  277. f.attr_list.forEach(c => {
  278. let param = `${f.attr_group_id}-${c.attr_id}`;
  279. this.inArray(param, attrNum_0) && !this.inArray(param, select) ? c.num_0 =
  280. true : c.num_0 = false;
  281. });
  282. });
  283. },
  284. selectCheck: function(copyAttr, attrNum_0, select) {
  285. copyAttr.forEach(f => {
  286. let arr = [];
  287. let sign = 0;
  288. let attrList = f.attr_list || []
  289. attrList.forEach(c => {
  290. let param = `${c.attr_group_id}-${c.attr_id}`;
  291. if (!this.inArray(param, select)) {
  292. sign += 1;
  293. arr.push(param);
  294. }
  295. });
  296. if (f.stock === 0 && sign <= 1) Array.prototype.push.apply(attrNum_0, arr);
  297. console.log("eeeeeeeeeeeeeeeee")
  298. console.log(f)
  299. f.service_label = this.service_label;
  300. f.card_id = this.card_id;
  301. f.hasScreen = this.hasCurrentServiceData();
  302. if (sign === 0) {
  303. this.$emit('check', f, 1);
  304. }
  305. });
  306. },
  307. storeAttr: function(attr_id, group_id, num_0) {
  308. console.log(201)
  309. if (num_0 === true) return;
  310. let newGroup = this.newGroup;
  311. let copyAttr = this.copyAttr;
  312. let select = [];
  313. console.log(newGroup)
  314. console.log(attr_id)
  315. console.log(group_id)
  316. newGroup.forEach((i, index) => {
  317. let attr_list = i.attr_list;
  318. attr_list.forEach((k) => {
  319. if (i.attr_group_id === group_id) {
  320. if (k.attr_id === attr_id) {
  321. if (k.select === true) {
  322. k.select = false;
  323. } else {
  324. k.select = true;
  325. }
  326. } else {
  327. k.select = false;
  328. }
  329. // k.attr_id === attr_id ? k.select = true : k.select = false;
  330. }
  331. if (k.select === true) {
  332. select.push(`${i.attr_group_id}-${k.attr_id}`);
  333. if (index === 0) this.picUrl = k.pic_url;
  334. }
  335. });
  336. });
  337. let attrNum_0 = [];
  338. console.log(230)
  339. console.log(copyAttr)
  340. console.log(attrNum_0)
  341. console.log(select)
  342. this.selectCheck(copyAttr, attrNum_0, select);
  343. this.$nextTick(() => {
  344. if (this.number > this.stock) this.number = this.stock;
  345. });
  346. this.identifier(newGroup, attrNum_0, select);
  347. this.getservice(newGroup, attrNum_0, select)
  348. if (select.length !== newGroup.length) {
  349. this.$emit('check', null, 1);
  350. }
  351. },
  352. firstSelect: function() {
  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(
  371. `${k.attr_group_id}-${g.attr_id}`
  372. );
  373. if (groupLength === copyGroup.length) {
  374. this.picUrl = g.pic_url;
  375. }
  376. groupLength--;
  377. }
  378. }
  379. }
  380. });
  381. }
  382. });
  383. });
  384. });
  385. let attrNum_0 = [];
  386. this.selectCheck(copyAttr, attrNum_0, select);
  387. this.identifier(copyGroup, attrNum_0, select);
  388. this.getservice(copyGroup, attrNum_0, select); //getservice
  389. this.newGroup = copyGroup;
  390. console.log(this.newGroup, ">>>>>>>>>>>+++++++++++")
  391. },
  392. numberBlur: function(e) {
  393. let value = parseInt(e.detail.value);
  394. if (!value) value = 1;
  395. if (value > this.stock) {
  396. value = this.stock;
  397. uni.showToast({
  398. title: '库存不足',
  399. icon: 'none'
  400. });
  401. }
  402. this.number = value;
  403. },
  404. numberSub: function() {
  405. let value = this.number;
  406. if (value > 1) {
  407. value--;
  408. this.number = value;
  409. }
  410. },
  411. numberAdd: function() {
  412. let value = this.number;
  413. value++;
  414. if (value > this.stock) {
  415. value = this.stock;
  416. uni.showToast({
  417. title: '库存不足',
  418. icon: 'none'
  419. });
  420. }
  421. this.number = value;
  422. },
  423. leftSubmit: function() {
  424. if (this.leftFunc === true) {
  425. this.$emit('leftFunc', this.number);
  426. } else {
  427. this.cart();
  428. }
  429. this.close();
  430. },
  431. rightSubmit: function() {
  432. console.log(this.checked)
  433. let _this = this
  434. if (!this.checked) {
  435. uni.showToast({
  436. title: '请先选规格',
  437. icon: 'none'
  438. });
  439. return false;
  440. }
  441. // if (!this.service_label) {
  442. // uni.showModal({
  443. // title: '提示',
  444. // content: '确定不需要碎屏险吗?',
  445. // success: function (res) {
  446. // if (res.confirm) {
  447. // _this.submit()
  448. // } else if (res.cancel) {
  449. // return false
  450. // }
  451. // }
  452. // });
  453. // }else{
  454. // this.submit()
  455. // }
  456. this.submit()
  457. },
  458. submit() {
  459. console.log(this.goods, ">>>>>>>>>>>>>>")
  460. if (this.$user.isLogin() && this.$store.state.user.info) {
  461. let member_level = this.$store.state.user.info.identity.member_level;
  462. if (member_level < this.goods.member_level) {
  463. uni.showModal({
  464. title: "提示",
  465. content: "需达到" + this.goods.member_name + "会员才可购买",
  466. showCancel: true,
  467. buttonText: '升级',
  468. success: (res) => {
  469. if (res.confirm) {
  470. uni.navigateTo({
  471. // url:"/pages/member/index/index",
  472. url: '/pages/member/upgrade/upgrade?level=' + member_level +
  473. '&other=' + this.goods.member_level
  474. })
  475. } else if (res.cancel) {
  476. console.log('用户点击取消');
  477. }
  478. }
  479. })
  480. return;
  481. }
  482. }
  483. let attrs = [];
  484. let _this = this
  485. let attrList = _this.checked.attr_list || [];
  486. attrList.forEach(item => {
  487. attrs.push({
  488. attr_id: item.attr_id,
  489. attr_group_id: item.attr_group_id
  490. });
  491. });
  492. let goods = {
  493. mch_id: _this.goods.mch_id ? _this.goods.mch_id : 0,
  494. hasScreen: _this.hasCurrentServiceData(),
  495. goods_list: [{
  496. id: _this.goods.id,
  497. attrs,
  498. num: _this.number,
  499. cat_id: 0,
  500. card_id: _this.card_id,
  501. goods_attr_id: _this.checked.id,
  502. service_label: _this.service_label
  503. }]
  504. }
  505. if (_this.rightFunc === true) {
  506. console.log(333)
  507. _this.$emit('rightFunc', goods);
  508. } else {
  509. console.log(336)
  510. _this.shop(goods);
  511. }
  512. if (_this.service_label['id'] || 0)
  513. _this.close();
  514. },
  515. shop: function(goods) {
  516. console.log(342)
  517. console.log(goods)
  518. let hasScreen = this.hasCurrentServiceData();
  519. uni.navigateTo({
  520. url: `/pages/order-submit/order-submit?mch_list=${JSON.stringify([goods])}&hasScreen=${hasScreen}`
  521. });
  522. },
  523. cart: function() {
  524. if (!this.checked) {
  525. uni.showToast({
  526. title: '请先选规格',
  527. icon: 'none'
  528. });
  529. return false;
  530. }
  531. if (this.goods.type === 'ecard') return;
  532. this.$request({
  533. url: this.$api.cart.add,
  534. method: 'post',
  535. data: {
  536. goods_id: this.checked.goods_id,
  537. attr: this.checked.id,
  538. num: this.number
  539. }
  540. }).then(res => {
  541. if (res.code === 0) {
  542. uni.showToast({
  543. title: res.msg,
  544. icon: 'none'
  545. });
  546. this.$emit('cart', this.checked, this.number);
  547. this.close();
  548. } else {
  549. uni.showToast({
  550. title: res.msg,
  551. icon: "none",
  552. duration: 2500
  553. });
  554. }
  555. });
  556. },
  557. clickImg(src) {
  558. uni.previewImage({
  559. current: 0,
  560. urls: [src]
  561. });
  562. }
  563. },
  564. components: {
  565. uPopup,
  566. appPrice,
  567. appMemberMark
  568. },
  569. computed: {
  570. imgUrl: function() {
  571. if (this.picUrl) {
  572. return this.picUrl;
  573. } else if (this.goods) {
  574. return this.goods.cover_pic;
  575. } else {
  576. return '';
  577. }
  578. },
  579. stock: function() {
  580. if (!this.$validation.isEmpty(this.checked)) {
  581. return this.checked.stock;
  582. } else if (!this.$validation.isEmpty(this.goods)) {
  583. return this.goods.goods_num;
  584. }
  585. },
  586. sellPrice: function() {
  587. if (!this.$validation.isEmpty(this.checked)) {
  588. return this.goods.level_show === 1 ? this.checked.price_member : this.checked.price;
  589. } else if (!this.$validation.isEmpty(this.goods)) {
  590. return this.goods.hasOwnProperty('price_min') ? this.goods.price_min : this.goods.price;
  591. }
  592. },
  593. copyGroup: function() {
  594. if (!this.goods) return;
  595. let group = this.$utils.deepClone(this.goods.attr_groups);
  596. for (let i = 0; i < group.length; i++) {
  597. group[i].attr_list.forEach(item => {
  598. item.select = false;
  599. item.num_0 = false;
  600. });
  601. }
  602. return group;
  603. },
  604. copyAttr: function() {
  605. if (!this.goods) return;
  606. return this.$utils.deepClone(this.goods.attr);
  607. },
  608. cartClass: function() {
  609. console.log(this.themeObject)
  610. if (!this.$slots.left_slot) {
  611. if (this.themeObject.theme === 'a' || this.themeObject.theme === 'b' || this.themeObject.theme ===
  612. 'f') {
  613. return this.themeObject.sBack + ' u-btn u-btn-color ';
  614. } else {
  615. return this.themeObject.sBack + ' u-btn ' + this.themeObject.color;
  616. }
  617. } else {
  618. return '';
  619. }
  620. }
  621. },
  622. watch: {
  623. value: {
  624. handler(newVal) {
  625. this.newValue = newVal;
  626. if (newVal === false) return;
  627. this.$utils.throttle(this.firstSelect, 800);
  628. },
  629. immediate: true
  630. },
  631. number: {
  632. handler(newVal) {
  633. this.checked.service_label = this.service_label;
  634. this.checked.card_id = this.card_id;
  635. this.checked.hasScreen = this.hasCurrentServiceData();
  636. this.$emit('check', this.checked, newVal);
  637. }
  638. },
  639. again: {
  640. handler() {
  641. // this.firstSelect();
  642. }
  643. }
  644. }
  645. }
  646. </script>
  647. <style scoped>
  648. .u-model {
  649. width: 750upx;
  650. }
  651. .u-top {
  652. margin: 0 24upx;
  653. border-bottom: 1upx solid #e2e2e2;
  654. height: 140upx;
  655. }
  656. .u-close-image {
  657. width: 54upx;
  658. height: 78upx;
  659. padding: 24upx 0 24rpx 24rpx;
  660. margin-left: 24rpx;
  661. }
  662. .bd-close-image {
  663. width: 30upx;
  664. height: 30upx;
  665. }
  666. .u-pic {
  667. width: 200rpx;
  668. height: 200rpx;
  669. padding: 4upx;
  670. border-radius: 8rpx;
  671. position: relative;
  672. top: -64upx;
  673. background-color: #ffffff;
  674. }
  675. .u-img {
  676. width: 192rpx;
  677. height: 192rpx;
  678. background-color: #ffffff;
  679. }
  680. .u-info {
  681. width: 424upx;
  682. height: 136upx;
  683. padding: 10upx 0 0 24upx;
  684. }
  685. .u-scroll-view {
  686. width: 100%;
  687. max-height: calc(80vh - 154upx);
  688. }
  689. .u-attr-group {
  690. margin: 24upx 32upx 0 32upx;
  691. border-bottom: 1upx solid #e2e2e2;
  692. }
  693. .u-number {
  694. height: 124upx;
  695. margin: 0 32upx;
  696. }
  697. .u-group-name {
  698. margin-bottom: 20upx;
  699. }
  700. .u-group-item {
  701. padding: 15upx 24upx;
  702. border-radius: 8upx;
  703. margin: 0 20upx 20upx 0;
  704. font-size: 26upx;
  705. }
  706. .u-checked {
  707. color: #ffffff;
  708. }
  709. .u-unchecked {
  710. background-color: #f2f2f2;
  711. color: #353535;
  712. }
  713. .u-attr_num_0 {
  714. background-color: #f7f7f7;
  715. color: #cdcdcd;
  716. }
  717. .u-stock {
  718. font-size: 24upx;
  719. color: #999999;
  720. }
  721. .u-price {
  722. margin-right: 12upx;
  723. }
  724. .u-input {
  725. width: 88upx;
  726. height: 60upx;
  727. background-color: #f7f7f7;
  728. font-size: 20upx;
  729. color: #353535;
  730. text-align: center;
  731. }
  732. .u-input-box {
  733. width: 218upx;
  734. }
  735. .u-number-btn {
  736. height: 60upx;
  737. width: 60upx;
  738. background-repeat: no-repeat;
  739. background-size: 100% 100%;
  740. background-position: center;
  741. }
  742. .u-number-btn:first-child {
  743. margin-right: 5upx;
  744. }
  745. .u-number-btn:last-child {
  746. margin-left: 5upx;
  747. }
  748. .u-reduced-1 {
  749. background-image: url("../../../static/image/icon/can-be-reduced.png");
  750. }
  751. .u-reduced-0 {
  752. background-image: url("../../../static/image/cart/can-be-reduced.png");
  753. }
  754. .u-added-1 {
  755. background-image: url("../../../static/image/cart/can-be-added.png");
  756. }
  757. .u-text {
  758. font-size: 26upx;
  759. color: #666666;
  760. }
  761. .u-bottom {
  762. height: 110upx;
  763. }
  764. .u-btn {
  765. text-align: center;
  766. line-height: 110upx;
  767. }
  768. .u-btn-color {
  769. color: #ffffff;
  770. }
  771. .service_title {
  772. padding-top: 10px;
  773. margin: 14px 10px 10px;
  774. font-weight: 700;
  775. font-size: 13px;
  776. }
  777. .service_item {
  778. margin: 14px 10px 0px;
  779. font-size: 26rpx;
  780. color: #666;
  781. display: flex;
  782. justify-content: space-between;
  783. }
  784. .service_value {
  785. display: flex;
  786. flex-wrap: wrap;
  787. padding: 0px 10px;
  788. }
  789. .service_block {
  790. min-width: 46%;
  791. height: 28px;
  792. line-height: 26px;
  793. border: 1px solid #f5f5f5;
  794. border-radius: 16px;
  795. text-align: center;
  796. margin-right: 10px;
  797. margin-top: 10px;
  798. font-size: 12px;
  799. background-color: #f5f5f5;
  800. position: relative;
  801. }
  802. .service_block_active {
  803. color: #f21c1c;
  804. border: 1px solid #f21c1c;
  805. }
  806. .slh {
  807. margin-left: 5upx;
  808. overflow: hidden;
  809. text-overflow: ellipsis;
  810. width: 460upx;
  811. white-space: nowrap;
  812. float: left;
  813. /* display: -webkit-box;
  814. -webkit-line-clamp: 1;
  815. -webkit-box-orient: vertical; */
  816. }
  817. </style>