u-attr.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864
  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 v-if="is_show_price" :theme="themeObject.theme"
  18. :userTheme="themeObject.userTheme" :sign="sign" :price="sellPrice"
  19. :default-price="goods.price"></app-price>
  20. </view>
  21. </view>
  22. <app-member-mark v-if="goods.level_show === 1" :theme="themeObject"></app-member-mark>
  23. </view>
  24. <view class="u-stock">库存:{{stock}}</view>
  25. </view>
  26. <view class="u-close-image" @click="close">
  27. <image class="bd-close-image u-border-box" src="/static/image/icon/icon-close.png"></image>
  28. </view>
  29. </view>
  30. <view class="u-center">
  31. <scroll-view class="u-scroll-view" scroll-y="true">
  32. <slot name="extra"></slot>
  33. <view v-if="goods.type === 'goods'" class="u-attr-group u-border-box"
  34. v-for="(item, index) in newGroup" :key="index">
  35. <view class="u-group-name u-text">{{item.attr_group_name}}</view>
  36. <view class="dir-left-wrap">
  37. <view
  38. :class="['u-group-item', attr.select ? 'u-checked ' + themeObject.back : 'u-unchecked', attr.num_0 ? 'u-attr_num_0' : '']"
  39. @click="storeAttr(attr.attr_id, item.attr_group_id, attr.num_0)"
  40. v-for="(attr, key) in item.attr_list" :key="key">
  41. {{attr.attr_name}}
  42. </view>
  43. </view>
  44. </view>
  45. <view class="service"
  46. v-if="enable_screen&&service_screen&&service_screen.screenList&&service_screen.screenList.length>0&&!is_gift">
  47. <view class="service_title">全优汇服务</view>
  48. <view class="service_item">
  49. <image style="width: 26upx;height:26upx;"
  50. src="https://t12.9026.com/web/statics/icon1/sp.png"> </image>
  51. <view>
  52. <view style="float: left;">碎屏险</view>
  53. <view class="slh">{{screenDescription}}</view>
  54. </view>
  55. <view style="color: red;" @click="gotoSpDetail">服务说明
  56. <image style="width: 26upx;height:26upx;"
  57. src="https://t12.9026.com/web/statics/icon1/问号.png"> </image>
  58. </view>
  59. <!-- <view>{{service_screen.screenList.intro}}</view> -->
  60. </view>
  61. <view class="service_value">
  62. <view class="service_block" v-for="(item,index) of service_screen.screenList"
  63. :class="{service_block_active:index == serviceId}" @click="select_service(index)">
  64. {{item.name}} ¥{{item.price}}
  65. </view>
  66. </view>
  67. </view>
  68. <view class="u-number dir-left-nowrap main-between cross-center">
  69. <view class="u-text">数量</view>
  70. <view class="dir-left-nowrap u-input-box">
  71. <view @click.stop="numberSub"
  72. :class="[number <=1 ? 'u-reduced-1' : 'u-reduced-0', 'u-number-btn']"></view>
  73. <input @blur="numberBlur" type="number" class="u-input" v-model="number">
  74. <view @click.stop="numberAdd" class="u-number-btn u-added-1"></view>
  75. </view>
  76. </view>
  77. </scroll-view>
  78. </view>
  79. <view class="u-bottom dir-left-nowrap">
  80. <view v-if="is_show_left && (goods.type === 'goods' || is_must_left)" class="box-grow-1"
  81. :class="cartClass" @click="leftSubmit">
  82. <slot name="left_slot"></slot>
  83. <template v-if="!$slots.left_slot">{{leftText}}</template>
  84. </view>
  85. <view v-if="is_show_right" class="box-grow-1" @click="rightSubmit"
  86. :class="[!$slots.right_slot ? themeObject.back + ' u-btn u-btn-color' : '']">
  87. <slot name="right_slot"></slot>
  88. <template v-if="!$slots.right_slot">{{rightText}}</template>
  89. </view>
  90. <template v-if="$slots.right">
  91. <slot name="right"></slot>
  92. </template>
  93. </view>
  94. </view>
  95. </u-popup>
  96. </view>
  97. </template>
  98. <script>
  99. import {
  100. mapState
  101. } from 'vuex'
  102. import uPopup from '../../basic-component/u-popup/u-popup.vue';
  103. import appPrice from "../goods/app-price.vue";
  104. import appMemberMark from "../app-member-mark/app-member-mark.vue";
  105. export default {
  106. name: "u-attr",
  107. props: {
  108. value: {
  109. type: Boolean
  110. },
  111. goods: {
  112. type: Object
  113. },
  114. themeObject: {
  115. type: Object
  116. },
  117. checked: {
  118. type: Object
  119. },
  120. is_show_price: {
  121. type: Boolean,
  122. default: true
  123. },
  124. is_show_left: {
  125. type: Boolean,
  126. default: true
  127. },
  128. is_must_left: {
  129. type: Boolean,
  130. default: true
  131. },
  132. is_show_right: {
  133. type: Boolean,
  134. default: true
  135. },
  136. enable_screen: {
  137. type: Boolean,
  138. default: true
  139. },
  140. leftText: {
  141. type: String,
  142. default: '加入购物车'
  143. },
  144. rightText: {
  145. type: String,
  146. default: '立即购买'
  147. },
  148. leftFunc: {
  149. type: Boolean
  150. },
  151. rightFunc: {
  152. type: Boolean
  153. },
  154. sign: {
  155. type: String
  156. },
  157. again: {
  158. type: Number
  159. },
  160. is_gift: {
  161. type: Boolean,
  162. default: false
  163. }
  164. },
  165. data() {
  166. return {
  167. newValue: false,
  168. picUrl: null,
  169. newGroup: [],
  170. number: 1,
  171. service_screen: null, //碎屏险
  172. service_label: null, //当前对屏对象
  173. serviceId: null, //碎屏险ID
  174. card_id: null,
  175. screenDescription: ''
  176. }
  177. },
  178. methods: {
  179. gotoSpDetail() {
  180. uni.navigateTo({
  181. url: "/pages/goods/spDetail"
  182. })
  183. },
  184. select_service(index) {
  185. if (this.serviceId == index) {
  186. this.serviceId = null
  187. this.screenDescription = ""
  188. this.service_label = null
  189. this.card_id = null
  190. } else {
  191. this.serviceId = index
  192. this.screenDescription = this.service_screen.screenList[index]['description'] || ''
  193. this.service_label = this.service_screen.screenList[index]
  194. this.card_id = this.service_screen.screenList['card_id']
  195. }
  196. this.checked.service_label = this.service_label;
  197. this.checked.card_id = this.card_id;
  198. this.checked.hasScreen = this.hasCurrentServiceData();
  199. this.$emit('check', this.checked, this.number);
  200. // if(this.serviceId || this.serviceId===0){
  201. // this.service_screen.screenList.forEach((item,index)=>{
  202. // this.screenDescription=this.service_screen.screenList[index]['description']||''
  203. // })
  204. // }else{
  205. // this.service_label = null
  206. // }
  207. },
  208. getservice(copyGroup, attrNum_0, select) {
  209. console.log('getservice,164')
  210. console.log(copyGroup, attrNum_0, select)
  211. console.log(this.goods.attr)
  212. console.log(select)
  213. let select_val = []
  214. this.goods.attr.forEach((item, index) => {
  215. console.log(item)
  216. let select_item_list = []
  217. let select_item_value = ''
  218. let attrList = item.attr_list || [];
  219. attrList.forEach((value, key) => {
  220. select_item_value = value.attr_group_id + '-' + value.attr_id
  221. select_item_list.push(select_item_value)
  222. })
  223. if (JSON.stringify(select) == JSON.stringify(select_item_list)) {
  224. this.service_screen = item
  225. }
  226. })
  227. },
  228. getserviceByAttrId() {
  229. let that = this;
  230. this.goods.attr.forEach((item, index) => {
  231. if (item.id == this.checked.id) {
  232. that.service_screen = item
  233. that.select_service(0);
  234. }
  235. })
  236. },
  237. hasCurrentServiceData() {
  238. let that = this;
  239. let result = 0;
  240. console.log(this.service_screen)
  241. if (this.enable_screen && this.service_screen && this.service_screen.screenList &&
  242. this.service_screen.screenList.length > 0) {
  243. result = 1;
  244. } else
  245. result = 0;
  246. return result;
  247. },
  248. close: function() {
  249. this.$emit('input', false);
  250. },
  251. turnOn: function() {
  252. this.$emit('input', true);
  253. },
  254. inArray: function(newVal, arr) {
  255. return arr.some(v => {
  256. return newVal === v;
  257. });
  258. },
  259. identifier: function(copyGroup, attrNum_0, select) {
  260. console.log('identifier,175')
  261. copyGroup.forEach(f => {
  262. f.attr_list.forEach(c => {
  263. let param = `${f.attr_group_id}-${c.attr_id}`;
  264. this.inArray(param, attrNum_0) && !this.inArray(param, select) ? c.num_0 =
  265. true : c.num_0 = false;
  266. });
  267. });
  268. },
  269. selectCheck: function(copyAttr, attrNum_0, select) {
  270. copyAttr.forEach(f => {
  271. let arr = [];
  272. let sign = 0;
  273. let attrList = f.attr_list || []
  274. attrList.forEach(c => {
  275. let param = `${c.attr_group_id}-${c.attr_id}`;
  276. if (!this.inArray(param, select)) {
  277. sign += 1;
  278. arr.push(param);
  279. }
  280. });
  281. if (f.stock === 0 && sign <= 1) Array.prototype.push.apply(attrNum_0, arr);
  282. console.log("eeeeeeeeeeeeeeeee")
  283. console.log(f)
  284. f.service_label = this.service_label;
  285. f.card_id = this.card_id;
  286. f.hasScreen = this.hasCurrentServiceData();
  287. if (sign === 0) {
  288. this.$emit('check', f, 1);
  289. }
  290. });
  291. },
  292. storeAttr: function(attr_id, group_id, num_0) {
  293. console.log(201)
  294. if (num_0 === true) return;
  295. let newGroup = this.newGroup;
  296. let copyAttr = this.copyAttr;
  297. let select = [];
  298. console.log(newGroup)
  299. console.log(attr_id)
  300. console.log(group_id)
  301. newGroup.forEach((i, index) => {
  302. let attr_list = i.attr_list;
  303. attr_list.forEach((k) => {
  304. if (i.attr_group_id === group_id) {
  305. if (k.attr_id === attr_id) {
  306. if (k.select === true) {
  307. k.select = false;
  308. } else {
  309. k.select = true;
  310. }
  311. } else {
  312. k.select = false;
  313. }
  314. // k.attr_id === attr_id ? k.select = true : k.select = false;
  315. }
  316. if (k.select === true) {
  317. select.push(`${i.attr_group_id}-${k.attr_id}`);
  318. if (index === 0) this.picUrl = k.pic_url;
  319. }
  320. });
  321. });
  322. let attrNum_0 = [];
  323. console.log(230)
  324. console.log(copyAttr)
  325. console.log(attrNum_0)
  326. console.log(select)
  327. this.selectCheck(copyAttr, attrNum_0, select);
  328. this.$nextTick(() => {
  329. if (this.number > this.stock) this.number = this.stock;
  330. });
  331. this.identifier(newGroup, attrNum_0, select);
  332. this.getservice(newGroup, attrNum_0, select)
  333. if (select.length !== newGroup.length) {
  334. this.$emit('check', null, 1);
  335. }
  336. },
  337. firstSelect: function() {
  338. console.log("ddddd")
  339. console.log(this.copyAttr)
  340. console.log(this.copyGroup)
  341. if (!this.copyGroup || !this.copyAttr) return;
  342. let copyGroup = this.copyGroup;
  343. let copyAttr = this.copyAttr;
  344. let groupLength = copyGroup.length;
  345. let select = [];
  346. copyAttr.forEach(i => {
  347. let attr_list = i.attr_list || [];
  348. attr_list.forEach(j => {
  349. let attr_group_id = j.attr_group_id;
  350. copyGroup.forEach(k => {
  351. if (attr_group_id === k.attr_group_id) {
  352. let groups_attr_list = k.attr_list;
  353. groups_attr_list.forEach(g => {
  354. if (g.attr_id === j.attr_id) {
  355. if (i.stock > 0) {
  356. if (groupLength > 0) {
  357. g.select = true;
  358. select.push(
  359. `${k.attr_group_id}-${g.attr_id}`
  360. );
  361. if (groupLength === copyGroup.length) {
  362. this.picUrl = g.pic_url;
  363. }
  364. groupLength--;
  365. }
  366. }
  367. }
  368. });
  369. }
  370. });
  371. });
  372. });
  373. let attrNum_0 = [];
  374. this.selectCheck(copyAttr, attrNum_0, select);
  375. this.identifier(copyGroup, attrNum_0, select);
  376. this.getservice(copyGroup, attrNum_0, select); //getservice
  377. this.newGroup = copyGroup;
  378. console.log(this.newGroup)
  379. },
  380. numberBlur: function(e) {
  381. let value = parseInt(e.detail.value);
  382. if (!value) value = 1;
  383. if (value > this.stock) {
  384. value = this.stock;
  385. uni.showToast({
  386. title: '库存不足',
  387. icon: 'none'
  388. });
  389. }
  390. this.number = value;
  391. },
  392. numberSub: function() {
  393. let value = this.number;
  394. if (value > 1) {
  395. value--;
  396. this.number = value;
  397. }
  398. },
  399. numberAdd: function() {
  400. let value = this.number;
  401. value++;
  402. if (value > this.stock) {
  403. value = this.stock;
  404. uni.showToast({
  405. title: '库存不足',
  406. icon: 'none'
  407. });
  408. }
  409. this.number = value;
  410. },
  411. leftSubmit: function() {
  412. if (this.leftFunc === true) {
  413. this.$emit('leftFunc', this.number);
  414. } else {
  415. this.cart();
  416. }
  417. this.close();
  418. },
  419. rightSubmit: function() {
  420. let _this = this
  421. if (!this.checked) {
  422. uni.showToast({
  423. title: '请先选规格',
  424. icon: 'none'
  425. });
  426. return false;
  427. }
  428. // if (!this.service_label) {
  429. // uni.showModal({
  430. // title: '提示',
  431. // content: '确定不需要碎屏险吗?',
  432. // success: function (res) {
  433. // if (res.confirm) {
  434. // _this.submit()
  435. // } else if (res.cancel) {
  436. // return false
  437. // }
  438. // }
  439. // });
  440. // }else{
  441. // this.submit()
  442. // }
  443. this.submit()
  444. },
  445. submit() {
  446. if (this.$user.isLogin() && this.$store.state.user.info) {
  447. let member_level = this.$store.state.user.info.identity.member_level;
  448. if (member_level < this.goods.member_level) {
  449. uni.showModal({
  450. title: "提示",
  451. content: "需达到" + this.goods.member_name + "会员才可购买",
  452. showCancel: true,
  453. buttonText: '升级',
  454. success: (res) => {
  455. if (res.confirm) {
  456. uni.navigateTo({
  457. // url:"/pages/member/index/index",
  458. url: '/pages/member/upgrade/upgrade?level=' + member_level +
  459. '&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. id: _this.goods.id,
  483. attrs,
  484. num: _this.number,
  485. cat_id: 0,
  486. card_id: _this.card_id,
  487. goods_attr_id: _this.checked.id,
  488. service_label: _this.service_label
  489. }]
  490. }
  491. if (_this.rightFunc === true) {
  492. console.log(333)
  493. _this.$emit('rightFunc', goods);
  494. } else {
  495. console.log(336)
  496. _this.shop(goods);
  497. }
  498. if (_this.service_label['id'] || 0)
  499. _this.close();
  500. },
  501. shop: function(goods) {
  502. console.log(342)
  503. console.log(goods)
  504. let hasScreen = this.hasCurrentServiceData();
  505. uni.navigateTo({
  506. url: `/pages/order-submit/order-submit?mch_list=${JSON.stringify([goods])}&hasScreen=${hasScreen}`
  507. });
  508. },
  509. cart: function() {
  510. if (!this.checked) {
  511. uni.showToast({
  512. title: '请先选规格',
  513. icon: 'none'
  514. });
  515. return false;
  516. }
  517. if (this.goods.type === 'ecard') return;
  518. this.$request({
  519. url: this.$api.cart.add,
  520. method: 'post',
  521. data: {
  522. goods_id: this.checked.goods_id,
  523. attr: this.checked.id,
  524. num: this.number
  525. }
  526. }).then(res => {
  527. if (res.code === 0) {
  528. uni.showToast({
  529. title: res.msg,
  530. icon: 'none'
  531. });
  532. this.$emit('cart', this.checked, this.number);
  533. this.close();
  534. } else {
  535. uni.showToast({
  536. title: res.msg,
  537. icon: "none",
  538. duration: 2500
  539. });
  540. }
  541. });
  542. },
  543. clickImg(src) {
  544. uni.previewImage({
  545. current: 0,
  546. urls: [src]
  547. });
  548. }
  549. },
  550. components: {
  551. uPopup,
  552. appPrice,
  553. appMemberMark
  554. },
  555. computed: {
  556. imgUrl: function() {
  557. if (this.picUrl) {
  558. return this.picUrl;
  559. } else if (this.goods) {
  560. return this.goods.cover_pic;
  561. } else {
  562. return '';
  563. }
  564. },
  565. stock: function() {
  566. if (!this.$validation.isEmpty(this.checked)) {
  567. return this.checked.stock;
  568. } else if (!this.$validation.isEmpty(this.goods)) {
  569. return this.goods.goods_num;
  570. }
  571. },
  572. sellPrice: function() {
  573. if (!this.$validation.isEmpty(this.checked)) {
  574. return this.goods.level_show === 1 ? this.checked.price_member : this.checked.price;
  575. } else if (!this.$validation.isEmpty(this.goods)) {
  576. return this.goods.hasOwnProperty('price_min') ? this.goods.price_min : this.goods.price;
  577. }
  578. },
  579. copyGroup: function() {
  580. if (!this.goods) return;
  581. let group = this.$utils.deepClone(this.goods.attr_groups);
  582. for (let i = 0; i < group.length; i++) {
  583. group[i].attr_list.forEach(item => {
  584. item.select = false;
  585. item.num_0 = false;
  586. });
  587. }
  588. return group;
  589. },
  590. copyAttr: function() {
  591. if (!this.goods) return;
  592. return this.$utils.deepClone(this.goods.attr);
  593. },
  594. cartClass: function() {
  595. if (!this.$slots.left_slot) {
  596. if (this.themeObject.theme === 'a' || this.themeObject.theme === 'b' || this.themeObject.theme ===
  597. 'f') {
  598. return this.themeObject.sBack + ' u-btn u-btn-color ';
  599. } else {
  600. return this.themeObject.sBack + ' u-btn ' + this.themeObject.color;
  601. }
  602. } else {
  603. return '';
  604. }
  605. }
  606. },
  607. watch: {
  608. value: {
  609. handler(newVal) {
  610. this.newValue = newVal;
  611. if (newVal === false) return;
  612. if (this.$validation.isEmpty(this.checked) || this.checked.first) this.$utils.throttle(this
  613. .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>