u-attr.vue 26 KB

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