u-attr.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865
  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. shopgoods: {}
  177. }
  178. },
  179. methods: {
  180. gotoSpDetail() {
  181. uni.navigateTo({
  182. url: "/pages/goods/spDetail"
  183. })
  184. },
  185. select_service(index) {
  186. if (this.serviceId == index) {
  187. this.serviceId = null
  188. this.screenDescription = ""
  189. this.service_label = null
  190. this.card_id = null
  191. } else {
  192. this.serviceId = index
  193. this.screenDescription = this.service_screen.screenList[index]['description'] || ''
  194. this.service_label = this.service_screen.screenList[index]
  195. this.card_id = this.service_screen.screenList['card_id']
  196. }
  197. this.checked.service_label = this.service_label;
  198. this.checked.card_id = this.card_id;
  199. this.checked.hasScreen = this.hasCurrentServiceData();
  200. this.$emit('check', this.checked, this.number);
  201. // if(this.serviceId || this.serviceId===0){
  202. // this.service_screen.screenList.forEach((item,index)=>{
  203. // this.screenDescription=this.service_screen.screenList[index]['description']||''
  204. // })
  205. // }else{
  206. // this.service_label = null
  207. // }
  208. },
  209. getservice(copyGroup, attrNum_0, select) {
  210. console.log('getservice,164')
  211. console.log(copyGroup, attrNum_0, select)
  212. console.log(this.goods.attr)
  213. console.log(select)
  214. let select_val = []
  215. this.goods.attr.forEach((item, index) => {
  216. console.log(item)
  217. let select_item_list = []
  218. let select_item_value = ''
  219. let attrList = item.attr_list || [];
  220. attrList.forEach((value, key) => {
  221. select_item_value = value.attr_group_id + '-' + value.attr_id
  222. select_item_list.push(select_item_value)
  223. })
  224. if (JSON.stringify(select) == JSON.stringify(select_item_list)) {
  225. this.service_screen = item
  226. }
  227. })
  228. },
  229. getserviceByAttrId() {
  230. let that = this;
  231. this.goods.attr.forEach((item, index) => {
  232. if (item.id == this.checked.id) {
  233. that.service_screen = item
  234. that.select_service(0);
  235. }
  236. })
  237. },
  238. hasCurrentServiceData() {
  239. let that = this;
  240. let result = 0;
  241. console.log(this.service_screen)
  242. if (this.enable_screen && this.service_screen && this.service_screen.screenList &&
  243. this.service_screen.screenList.length > 0) {
  244. result = 1;
  245. } else
  246. result = 0;
  247. return result;
  248. },
  249. close: function() {
  250. this.$emit('input', false);
  251. },
  252. turnOn: function() {
  253. this.$emit('input', true);
  254. },
  255. inArray: function(newVal, arr) {
  256. return arr.some(v => {
  257. return newVal === v;
  258. });
  259. },
  260. identifier: function(copyGroup, attrNum_0, select) {
  261. console.log('identifier,175')
  262. copyGroup.forEach(f => {
  263. f.attr_list.forEach(c => {
  264. let param = `${f.attr_group_id}-${c.attr_id}`;
  265. this.inArray(param, attrNum_0) && !this.inArray(param, select) ? c.num_0 =
  266. true : c.num_0 = false;
  267. });
  268. });
  269. },
  270. selectCheck: function(copyAttr, attrNum_0, select) {
  271. copyAttr.forEach(f => {
  272. let arr = [];
  273. let sign = 0;
  274. let attrList = f.attr_list || []
  275. attrList.forEach(c => {
  276. let param = `${c.attr_group_id}-${c.attr_id}`;
  277. if (!this.inArray(param, select)) {
  278. sign += 1;
  279. arr.push(param);
  280. }
  281. });
  282. if (f.stock === 0 && sign <= 1) Array.prototype.push.apply(attrNum_0, arr);
  283. console.log("eeeeeeeeeeeeeeeee")
  284. console.log(f)
  285. f.service_label = this.service_label;
  286. f.card_id = this.card_id;
  287. f.hasScreen = this.hasCurrentServiceData();
  288. if (sign === 0) {
  289. this.$emit('check', f, 1);
  290. }
  291. });
  292. },
  293. storeAttr: function(attr_id, group_id, num_0) {
  294. console.log(201)
  295. if (num_0 === true) return;
  296. let newGroup = this.newGroup;
  297. let copyAttr = this.copyAttr;
  298. let select = [];
  299. console.log(newGroup)
  300. console.log(attr_id)
  301. console.log(group_id)
  302. newGroup.forEach((i, index) => {
  303. let attr_list = i.attr_list;
  304. attr_list.forEach((k) => {
  305. if (i.attr_group_id === group_id) {
  306. if (k.attr_id === attr_id) {
  307. if (k.select === true) {
  308. k.select = false;
  309. } else {
  310. k.select = true;
  311. }
  312. } else {
  313. k.select = false;
  314. }
  315. // k.attr_id === attr_id ? k.select = true : k.select = false;
  316. }
  317. if (k.select === true) {
  318. select.push(`${i.attr_group_id}-${k.attr_id}`);
  319. if (index === 0) this.picUrl = k.pic_url;
  320. }
  321. });
  322. });
  323. let attrNum_0 = [];
  324. console.log(230)
  325. console.log(copyAttr)
  326. console.log(attrNum_0)
  327. console.log(select)
  328. this.selectCheck(copyAttr, attrNum_0, select);
  329. this.$nextTick(() => {
  330. if (this.number > this.stock) this.number = this.stock;
  331. });
  332. this.identifier(newGroup, attrNum_0, select);
  333. this.getservice(newGroup, attrNum_0, select)
  334. if (select.length !== newGroup.length) {
  335. this.$emit('check', null, 1);
  336. }
  337. },
  338. firstSelect: function() {
  339. console.log("ddddd")
  340. console.log(this.copyAttr)
  341. console.log(this.copyGroup)
  342. if (!this.copyGroup || !this.copyAttr) return;
  343. let copyGroup = this.copyGroup;
  344. let copyAttr = this.copyAttr;
  345. let groupLength = copyGroup.length;
  346. let select = [];
  347. copyAttr.forEach(i => {
  348. let attr_list = i.attr_list || [];
  349. attr_list.forEach(j => {
  350. let attr_group_id = j.attr_group_id;
  351. copyGroup.forEach(k => {
  352. if (attr_group_id === k.attr_group_id) {
  353. let groups_attr_list = k.attr_list;
  354. groups_attr_list.forEach(g => {
  355. if (g.attr_id === j.attr_id) {
  356. if (i.stock > 0) {
  357. if (groupLength > 0) {
  358. g.select = true;
  359. select.push(
  360. `${k.attr_group_id}-${g.attr_id}`
  361. );
  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. console.log(this.goods, ">>>>>>>>>>>>>>")
  448. if (this.$user.isLogin() && this.$store.state.user.info) {
  449. let member_level = this.$store.state.user.info.identity.member_level;
  450. if (member_level < this.goods.member_level) {
  451. uni.showModal({
  452. title: "提示",
  453. content: "需达到" + this.goods.member_name + "会员才可购买",
  454. showCancel: true,
  455. buttonText: '升级',
  456. success: (res) => {
  457. if (res.confirm) {
  458. uni.navigateTo({
  459. // url:"/pages/member/index/index",
  460. url: '/pages/member/upgrade/upgrade?level=' + member_level +
  461. '&other=' + this.goods.member_level
  462. })
  463. } else if (res.cancel) {
  464. console.log('用户点击取消');
  465. }
  466. }
  467. })
  468. return;
  469. }
  470. }
  471. let attrs = [];
  472. let _this = this
  473. let attrList = _this.checked.attr_list || [];
  474. attrList.forEach(item => {
  475. attrs.push({
  476. attr_id: item.attr_id,
  477. attr_group_id: item.attr_group_id
  478. });
  479. });
  480. let goods = {
  481. mch_id: _this.goods.mch_id ? _this.goods.mch_id : 0,
  482. hasScreen: _this.hasCurrentServiceData(),
  483. goods_list: [{
  484. id: _this.goods.id,
  485. attrs,
  486. num: _this.number,
  487. cat_id: 0,
  488. card_id: _this.card_id,
  489. goods_attr_id: _this.checked.id,
  490. service_label: _this.service_label
  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 ===
  599. 'f') {
  600. return this.themeObject.sBack + ' u-btn u-btn-color ';
  601. } else {
  602. return this.themeObject.sBack + ' u-btn ' + this.themeObject.color;
  603. }
  604. } else {
  605. return '';
  606. }
  607. }
  608. },
  609. watch: {
  610. value: {
  611. handler(newVal) {
  612. this.newValue = newVal;
  613. if (newVal === false) return;
  614. if (this.$validation.isEmpty(this.checked) || this.checked.first) this.$utils.throttle(this
  615. .firstSelect, 800);
  616. },
  617. immediate: true
  618. },
  619. number: {
  620. handler(newVal) {
  621. this.checked.service_label = this.service_label;
  622. this.checked.card_id = this.card_id;
  623. this.checked.hasScreen = this.hasCurrentServiceData();
  624. this.$emit('check', this.checked, newVal);
  625. }
  626. },
  627. again: {
  628. handler() {
  629. // this.firstSelect();
  630. }
  631. }
  632. }
  633. }
  634. </script>
  635. <style scoped>
  636. .u-model {
  637. width: 750upx;
  638. }
  639. .u-top {
  640. margin: 0 24upx;
  641. border-bottom: 1upx solid #e2e2e2;
  642. height: 140upx;
  643. }
  644. .u-close-image {
  645. width: 54upx;
  646. height: 78upx;
  647. padding: 24upx 0 24rpx 24rpx;
  648. margin-left: 24rpx;
  649. }
  650. .bd-close-image {
  651. width: 30upx;
  652. height: 30upx;
  653. }
  654. .u-pic {
  655. width: 200rpx;
  656. height: 200rpx;
  657. padding: 4upx;
  658. border-radius: 8rpx;
  659. position: relative;
  660. top: -64upx;
  661. background-color: #ffffff;
  662. }
  663. .u-img {
  664. width: 192rpx;
  665. height: 192rpx;
  666. background-color: #ffffff;
  667. }
  668. .u-info {
  669. width: 424upx;
  670. height: 136upx;
  671. padding: 45upx 0 0 24upx;
  672. }
  673. .u-scroll-view {
  674. width: 100%;
  675. max-height: calc(80vh - 154upx);
  676. }
  677. .u-attr-group {
  678. margin: 24upx 32upx 0 32upx;
  679. border-bottom: 1upx solid #e2e2e2;
  680. }
  681. .u-number {
  682. height: 124upx;
  683. margin: 0 32upx;
  684. }
  685. .u-group-name {
  686. margin-bottom: 20upx;
  687. }
  688. .u-group-item {
  689. padding: 15upx 24upx;
  690. border-radius: 8upx;
  691. margin: 0 20upx 20upx 0;
  692. font-size: 26upx;
  693. }
  694. .u-checked {
  695. color: #ffffff;
  696. }
  697. .u-unchecked {
  698. background-color: #f2f2f2;
  699. color: #353535;
  700. }
  701. .u-attr_num_0 {
  702. background-color: #f7f7f7;
  703. color: #cdcdcd;
  704. }
  705. .u-stock {
  706. font-size: 24upx;
  707. color: #999999;
  708. }
  709. .u-price {
  710. margin-right: 12upx;
  711. }
  712. .u-input {
  713. width: 88upx;
  714. height: 60upx;
  715. background-color: #f7f7f7;
  716. font-size: 20upx;
  717. color: #353535;
  718. text-align: center;
  719. }
  720. .u-input-box {
  721. width: 218upx;
  722. }
  723. .u-number-btn {
  724. height: 60upx;
  725. width: 60upx;
  726. background-repeat: no-repeat;
  727. background-size: 100% 100%;
  728. background-position: center;
  729. }
  730. .u-number-btn:first-child {
  731. margin-right: 5upx;
  732. }
  733. .u-number-btn:last-child {
  734. margin-left: 5upx;
  735. }
  736. .u-reduced-1 {
  737. background-image: url("../../../static/image/icon/can-be-reduced.png");
  738. }
  739. .u-reduced-0 {
  740. background-image: url("../../../static/image/cart/can-be-reduced.png");
  741. }
  742. .u-added-1 {
  743. background-image: url("../../../static/image/cart/can-be-added.png");
  744. }
  745. .u-text {
  746. font-size: 26upx;
  747. color: #666666;
  748. }
  749. .u-bottom {
  750. height: 110upx;
  751. }
  752. .u-btn {
  753. text-align: center;
  754. line-height: 110upx;
  755. }
  756. .u-btn-color {
  757. color: #ffffff;
  758. }
  759. .service_title {
  760. padding-top: 10px;
  761. margin: 14px 10px 10px;
  762. font-weight: 700;
  763. font-size: 13px;
  764. }
  765. .service_item {
  766. margin: 14px 10px 0px;
  767. font-size: 26rpx;
  768. color: #666;
  769. display: flex;
  770. justify-content: space-between;
  771. }
  772. .service_value {
  773. display: flex;
  774. flex-wrap: wrap;
  775. padding: 0px 10px;
  776. }
  777. .service_block {
  778. min-width: 46%;
  779. height: 28px;
  780. line-height: 26px;
  781. border: 1px solid #f5f5f5;
  782. border-radius: 16px;
  783. text-align: center;
  784. margin-right: 10px;
  785. margin-top: 10px;
  786. font-size: 12px;
  787. background-color: #f5f5f5;
  788. position: relative;
  789. }
  790. .service_block_active {
  791. color: #f21c1c;
  792. border: 1px solid #f21c1c;
  793. }
  794. .slh {
  795. margin-left: 5upx;
  796. overflow: hidden;
  797. text-overflow: ellipsis;
  798. width: 460upx;
  799. white-space: nowrap;
  800. float: left;
  801. /* display: -webkit-box;
  802. -webkit-line-clamp: 1;
  803. -webkit-box-orient: vertical; */
  804. }
  805. </style>