u-attr.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883
  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. console.log(this.service_screen,"oooooooooooooooo")
  242. })
  243. },
  244. getserviceByAttrId() {
  245. let that = this;
  246. this.goods.attr.forEach((item, index) => {
  247. if (item.id == this.checked.id) {
  248. that.service_screen = item
  249. that.select_service(0);
  250. }
  251. })
  252. },
  253. hasCurrentServiceData() {
  254. let that = this;
  255. let result = 0;
  256. console.log(this.service_screen)
  257. if (this.enable_screen && this.service_screen && this.service_screen.screenList &&
  258. this.service_screen.screenList.length > 0) {
  259. result = 1;
  260. } else
  261. result = 0;
  262. return result;
  263. },
  264. close: function() {
  265. this.$emit('input', false);
  266. },
  267. turnOn: function() {
  268. this.$emit('input', true);
  269. },
  270. inArray: function(newVal, arr) {
  271. return arr.some(v => {
  272. return newVal === v;
  273. });
  274. },
  275. identifier: function(copyGroup, attrNum_0, select) {
  276. console.log('identifier,175')
  277. copyGroup.forEach(f => {
  278. f.attr_list.forEach(c => {
  279. let param = `${f.attr_group_id}-${c.attr_id}`;
  280. this.inArray(param, attrNum_0) && !this.inArray(param, select) ? c.num_0 =
  281. true : c.num_0 = false;
  282. });
  283. });
  284. },
  285. selectCheck: function(copyAttr, attrNum_0, select) {
  286. copyAttr.forEach(f => {
  287. let arr = [];
  288. let sign = 0;
  289. let attrList = f.attr_list || []
  290. attrList.forEach(c => {
  291. let param = `${c.attr_group_id}-${c.attr_id}`;
  292. if (!this.inArray(param, select)) {
  293. sign += 1;
  294. arr.push(param);
  295. }
  296. });
  297. if (f.stock === 0 && sign <= 1) Array.prototype.push.apply(attrNum_0, arr);
  298. console.log("eeeeeeeeeeeeeeeee")
  299. console.log(f)
  300. f.service_label = this.service_label;
  301. f.card_id = this.card_id;
  302. f.hasScreen = this.hasCurrentServiceData();
  303. if (sign === 0) {
  304. this.$emit('check', f, 1);
  305. }
  306. });
  307. },
  308. storeAttr: function(attr_id, group_id, num_0) {
  309. console.log(201)
  310. if (num_0 === true) return;
  311. let newGroup = this.newGroup;
  312. let copyAttr = this.copyAttr;
  313. let select = [];
  314. console.log(newGroup)
  315. console.log(attr_id)
  316. console.log(group_id)
  317. newGroup.forEach((i, index) => {
  318. let attr_list = i.attr_list;
  319. attr_list.forEach((k) => {
  320. if (i.attr_group_id === group_id) {
  321. if (k.attr_id === attr_id) {
  322. if (k.select === true) {
  323. k.select = false;
  324. } else {
  325. k.select = true;
  326. }
  327. } else {
  328. k.select = false;
  329. }
  330. // k.attr_id === attr_id ? k.select = true : k.select = false;
  331. }
  332. if (k.select === true) {
  333. select.push(`${i.attr_group_id}-${k.attr_id}`);
  334. if (index === 0) this.picUrl = k.pic_url;
  335. }
  336. });
  337. });
  338. let attrNum_0 = [];
  339. console.log(230)
  340. console.log(copyAttr)
  341. console.log(attrNum_0)
  342. console.log(select)
  343. this.selectCheck(copyAttr, attrNum_0, select);
  344. this.$nextTick(() => {
  345. if (this.number > this.stock) this.number = this.stock;
  346. });
  347. this.identifier(newGroup, attrNum_0, select);
  348. this.getservice(newGroup, attrNum_0, select)
  349. if (select.length !== newGroup.length) {
  350. this.$emit('check', null, 1);
  351. }
  352. },
  353. firstSelect: function() {
  354. if (!this.copyGroup || !this.copyAttr) return;
  355. let copyGroup = this.copyGroup;
  356. let copyAttr = this.copyAttr;
  357. let groupLength = copyGroup.length;
  358. let select = [];
  359. copyAttr.forEach(i => {
  360. let attr_list = i.attr_list || [];
  361. attr_list.forEach(j => {
  362. let attr_group_id = j.attr_group_id;
  363. copyGroup.forEach(k => {
  364. if (attr_group_id === k.attr_group_id) {
  365. let groups_attr_list = k.attr_list;
  366. groups_attr_list.forEach(g => {
  367. if (g.attr_id === j.attr_id) {
  368. if (i.stock > 0) {
  369. if (groupLength > 0) {
  370. g.select = true;
  371. select.push(
  372. `${k.attr_group_id}-${g.attr_id}`
  373. );
  374. if (groupLength === copyGroup.length) {
  375. this.picUrl = g.pic_url;
  376. }
  377. groupLength--;
  378. }
  379. }
  380. }
  381. });
  382. }
  383. });
  384. });
  385. });
  386. let attrNum_0 = [];
  387. this.selectCheck(copyAttr, attrNum_0, select);
  388. this.identifier(copyGroup, attrNum_0, select);
  389. this.getservice(copyGroup, attrNum_0, select); //getservice
  390. this.newGroup = copyGroup;
  391. console.log(this.newGroup, ">>>>>>>>>>>+++++++++++")
  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. this.number = value;
  423. },
  424. leftSubmit: function() {
  425. if (this.leftFunc === true) {
  426. this.$emit('leftFunc', this.number);
  427. } else {
  428. this.cart();
  429. }
  430. this.close();
  431. },
  432. rightSubmit: function() {
  433. console.log(this.checked)
  434. let _this = this
  435. if (!this.checked) {
  436. uni.showToast({
  437. title: '请先选规格',
  438. icon: 'none'
  439. });
  440. return false;
  441. }
  442. // if (!this.service_label) {
  443. // uni.showModal({
  444. // title: '提示',
  445. // content: '确定不需要碎屏险吗?',
  446. // success: function (res) {
  447. // if (res.confirm) {
  448. // _this.submit()
  449. // } else if (res.cancel) {
  450. // return false
  451. // }
  452. // }
  453. // });
  454. // }else{
  455. // this.submit()
  456. // }
  457. this.submit()
  458. },
  459. submit() {
  460. console.log(this.goods, ">>>>>>>>>>>>>>")
  461. if (this.$user.isLogin() && this.$store.state.user.info) {
  462. let member_level = this.$store.state.user.info.identity.member_level;
  463. if (member_level < this.goods.member_level) {
  464. uni.showModal({
  465. title: "提示",
  466. content: "需达到" + this.goods.member_name + "会员才可购买",
  467. showCancel: true,
  468. buttonText: '升级',
  469. success: (res) => {
  470. if (res.confirm) {
  471. uni.navigateTo({
  472. // url:"/pages/member/index/index",
  473. url: '/pages/member/upgrade/upgrade?level=' + member_level +
  474. '&other=' + this.goods.member_level
  475. })
  476. } else if (res.cancel) {
  477. console.log('用户点击取消');
  478. }
  479. }
  480. })
  481. return;
  482. }
  483. }
  484. let attrs = [];
  485. let _this = this
  486. let attrList = _this.checked.attr_list || [];
  487. attrList.forEach(item => {
  488. attrs.push({
  489. attr_id: item.attr_id,
  490. attr_group_id: item.attr_group_id
  491. });
  492. });
  493. let goods = {
  494. mch_id: _this.goods.mch_id ? _this.goods.mch_id : 0,
  495. hasScreen: _this.hasCurrentServiceData(),
  496. goods_list: [{
  497. id: _this.goods.id,
  498. attrs,
  499. num: _this.number,
  500. cat_id: 0,
  501. card_id: _this.card_id,
  502. goods_attr_id: _this.checked.id,
  503. service_label: _this.service_label
  504. }]
  505. }
  506. if (_this.rightFunc === true) {
  507. console.log(333)
  508. _this.$emit('rightFunc', goods);
  509. } else {
  510. console.log(336)
  511. _this.shop(goods);
  512. }
  513. if (_this.service_label['id'] || 0)
  514. _this.close();
  515. },
  516. shop: function(goods) {
  517. console.log(342)
  518. console.log(goods)
  519. let hasScreen = this.hasCurrentServiceData();
  520. uni.navigateTo({
  521. url: `/pages/order-submit/order-submit?mch_list=${JSON.stringify([goods])}&hasScreen=${hasScreen}`
  522. });
  523. },
  524. cart: function() {
  525. if (!this.checked) {
  526. uni.showToast({
  527. title: '请先选规格',
  528. icon: 'none'
  529. });
  530. return false;
  531. }
  532. if (this.goods.type === 'ecard') return;
  533. let service
  534. if(this.checked.service_label){
  535. service = this.checked.service_label.id
  536. }else{
  537. service = ''
  538. }
  539. this.$request({
  540. url: this.$api.cart.add,
  541. method: 'post',
  542. data: {
  543. goods_id: this.checked.goods_id,
  544. attr: this.checked.id,
  545. service_id:service,
  546. num: this.number
  547. }
  548. }).then(res => {
  549. if (res.code === 0) {
  550. uni.showToast({
  551. title: res.msg,
  552. icon: 'none'
  553. });
  554. this.$emit('cart', this.checked, this.number);
  555. this.close();
  556. } else {
  557. uni.showToast({
  558. title: res.msg,
  559. icon: "none",
  560. duration: 2500
  561. });
  562. }
  563. });
  564. },
  565. clickImg(src) {
  566. uni.previewImage({
  567. current: 0,
  568. urls: [src]
  569. });
  570. }
  571. },
  572. components: {
  573. uPopup,
  574. appPrice,
  575. appMemberMark
  576. },
  577. computed: {
  578. imgUrl: function() {
  579. if (this.picUrl) {
  580. return this.picUrl;
  581. } else if (this.goods) {
  582. return this.goods.cover_pic;
  583. } else {
  584. return '';
  585. }
  586. },
  587. stock: function() {
  588. if (!this.$validation.isEmpty(this.checked)) {
  589. return this.checked.stock;
  590. } else if (!this.$validation.isEmpty(this.goods)) {
  591. return this.goods.goods_num;
  592. }
  593. },
  594. sellPrice: function() {
  595. if (!this.$validation.isEmpty(this.checked)) {
  596. return this.goods.level_show === 1 ? this.checked.price_member : this.checked.price;
  597. } else if (!this.$validation.isEmpty(this.goods)) {
  598. return this.goods.hasOwnProperty('price_min') ? this.goods.price_min : this.goods.price;
  599. }
  600. },
  601. copyGroup: function() {
  602. if (!this.goods) return;
  603. let group = this.$utils.deepClone(this.goods.attr_groups);
  604. for (let i = 0; i < group.length; i++) {
  605. group[i].attr_list.forEach(item => {
  606. item.select = false;
  607. item.num_0 = false;
  608. });
  609. }
  610. return group;
  611. },
  612. copyAttr: function() {
  613. if (!this.goods) return;
  614. return this.$utils.deepClone(this.goods.attr);
  615. },
  616. cartClass: function() {
  617. console.log(this.themeObject)
  618. if (!this.$slots.left_slot) {
  619. if (this.themeObject.theme === 'a' || this.themeObject.theme === 'b' || this.themeObject.theme ===
  620. 'f') {
  621. return this.themeObject.sBack + ' u-btn u-btn-color ';
  622. } else {
  623. return this.themeObject.sBack + ' u-btn ' + this.themeObject.color;
  624. }
  625. } else {
  626. return '';
  627. }
  628. }
  629. },
  630. watch: {
  631. value: {
  632. handler(newVal) {
  633. this.newValue = newVal;
  634. if (newVal === false) return;
  635. this.$utils.throttle(this.firstSelect, 800);
  636. },
  637. immediate: true
  638. },
  639. number: {
  640. handler(newVal) {
  641. this.checked.service_label = this.service_label;
  642. this.checked.card_id = this.card_id;
  643. this.checked.hasScreen = this.hasCurrentServiceData();
  644. this.$emit('check', this.checked, newVal);
  645. }
  646. },
  647. again: {
  648. handler() {
  649. // this.firstSelect();
  650. }
  651. }
  652. }
  653. }
  654. </script>
  655. <style scoped>
  656. .u-model {
  657. width: 750upx;
  658. }
  659. .u-top {
  660. margin: 0 24upx;
  661. border-bottom: 1upx solid #e2e2e2;
  662. height: 140upx;
  663. }
  664. .u-close-image {
  665. width: 54upx;
  666. height: 78upx;
  667. padding: 24upx 0 24rpx 24rpx;
  668. margin-left: 24rpx;
  669. }
  670. .bd-close-image {
  671. width: 30upx;
  672. height: 30upx;
  673. }
  674. .u-pic {
  675. width: 200rpx;
  676. height: 200rpx;
  677. padding: 4upx;
  678. border-radius: 8rpx;
  679. position: relative;
  680. top: -64upx;
  681. background-color: #ffffff;
  682. }
  683. .u-img {
  684. width: 192rpx;
  685. height: 192rpx;
  686. background-color: #ffffff;
  687. }
  688. .u-info {
  689. width: 424upx;
  690. height: 136upx;
  691. padding: 10upx 0 0 24upx;
  692. }
  693. .u-scroll-view {
  694. width: 100%;
  695. max-height: calc(80vh - 154upx);
  696. }
  697. .u-attr-group {
  698. margin: 24upx 32upx 0 32upx;
  699. border-bottom: 1upx solid #e2e2e2;
  700. }
  701. .u-number {
  702. height: 124upx;
  703. margin: 0 32upx;
  704. }
  705. .u-group-name {
  706. margin-bottom: 20upx;
  707. }
  708. .u-group-item {
  709. padding: 15upx 24upx;
  710. border-radius: 8upx;
  711. margin: 0 20upx 20upx 0;
  712. font-size: 26upx;
  713. }
  714. .u-checked {
  715. color: #ffffff;
  716. }
  717. .u-unchecked {
  718. background-color: #f2f2f2;
  719. color: #353535;
  720. }
  721. .u-attr_num_0 {
  722. background-color: #f7f7f7;
  723. color: #cdcdcd;
  724. }
  725. .u-stock {
  726. font-size: 24upx;
  727. color: #999999;
  728. }
  729. .u-price {
  730. margin-right: 12upx;
  731. }
  732. .u-input {
  733. width: 88upx;
  734. height: 60upx;
  735. background-color: #f7f7f7;
  736. font-size: 20upx;
  737. color: #353535;
  738. text-align: center;
  739. }
  740. .u-input-box {
  741. width: 218upx;
  742. }
  743. .u-number-btn {
  744. height: 60upx;
  745. width: 60upx;
  746. background-repeat: no-repeat;
  747. background-size: 100% 100%;
  748. background-position: center;
  749. }
  750. .u-number-btn:first-child {
  751. margin-right: 5upx;
  752. }
  753. .u-number-btn:last-child {
  754. margin-left: 5upx;
  755. }
  756. .u-reduced-1 {
  757. background-image: url("../../../static/image/icon/can-be-reduced.png");
  758. }
  759. .u-reduced-0 {
  760. background-image: url("../../../static/image/cart/can-be-reduced.png");
  761. }
  762. .u-added-1 {
  763. background-image: url("../../../static/image/cart/can-be-added.png");
  764. }
  765. .u-text {
  766. font-size: 26upx;
  767. color: #666666;
  768. }
  769. .u-bottom {
  770. height: 110upx;
  771. }
  772. .u-btn {
  773. text-align: center;
  774. line-height: 110upx;
  775. }
  776. .u-btn-color {
  777. color: #ffffff;
  778. }
  779. .service_title {
  780. padding-top: 10px;
  781. margin: 14px 10px 10px;
  782. font-weight: 700;
  783. font-size: 13px;
  784. }
  785. .service_item {
  786. margin: 14px 10px 0px;
  787. font-size: 26rpx;
  788. color: #666;
  789. display: flex;
  790. justify-content: space-between;
  791. }
  792. .service_value {
  793. display: flex;
  794. flex-wrap: wrap;
  795. padding: 0px 10px;
  796. }
  797. .service_block {
  798. min-width: 46%;
  799. height: 28px;
  800. line-height: 26px;
  801. border: 1px solid #f5f5f5;
  802. border-radius: 16px;
  803. text-align: center;
  804. margin-right: 10px;
  805. margin-top: 10px;
  806. font-size: 12px;
  807. background-color: #f5f5f5;
  808. position: relative;
  809. }
  810. .service_block_active {
  811. color: #f21c1c;
  812. border: 1px solid #f21c1c;
  813. }
  814. .slh {
  815. margin-left: 5upx;
  816. overflow: hidden;
  817. text-overflow: ellipsis;
  818. width: 460upx;
  819. white-space: nowrap;
  820. float: left;
  821. /* display: -webkit-box;
  822. -webkit-line-clamp: 1;
  823. -webkit-box-orient: vertical; */
  824. }
  825. </style>