u-attr.vue 27 KB

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