u-attr.vue 22 KB

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