u-attr.vue 21 KB

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