preview.php 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018
  1. <template id="store-commodity-group-preview">
  2. <div class="store-commodity-group-preview" :style="{background: computedStyle.searchBox, }">
  3. <div class="filter-box" v-if="filterList.length">
  4. <div class="filter-item" :style="[sortType == item.code ? selectedFilterStyle:filterStyle]" v-for="item in filterList">
  5. {{item.name}}
  6. <div class="filter-arrow">
  7. <div class="icon up" :class="{ active: sortType == item.code && sortOrder == 'asc' }">
  8. <i class="el-icon-arrow-up"></i>
  9. </div>
  10. <div class="icon down active" :class="{ active: sortType == item.code && sortOrder == 'desc' }">
  11. <i class="el-icon-arrow-down"></i>
  12. </div>
  13. </div>
  14. </div>
  15. </div>
  16. <!-- 默认数据 -->
  17. <div class="flex-wrap" :style="{flexWrap: flexWrap, ...contianStyle}" v-if="showDefaultData">
  18. <div :class="[styleTypeClassArr, zoomComputed(index)]" v-for="(item,index) in defaultList" :key="index">
  19. <div class="diy-goods-basic" :style="goodsStyle">
  20. <div class="diy-goods-image">
  21. <div :class="hotClass" v-if="isShowHot" :style="hotStyle">{{hotName}}</div>
  22. <el-image :src="default_src"></el-image>
  23. <div class="store_distance" v-if="permession.store_distance.show">
  24. <span class="store_distance_text" :style="{backgroundColor: permession.store_distance.color }">门店</span>
  25. <span class="store_distance_num">12.5km</span>
  26. </div>
  27. </div>
  28. <div class="detail">
  29. <div class="name" style="color: rgb(55, 56, 58);" :style="{color: permession.showTitle.color }" v-if="permession.showTitle.show">
  30. 这里是商品标题
  31. </div>
  32. <div class="subtitle" style="color: rgb(153, 156, 167);" :style="{color: permession.showSubTitle.color }" v-if="permession.showSubTitle.show">
  33. 这里是商品副标题
  34. </div>
  35. <div class="diy-sale">
  36. <div class="diy-info">
  37. <div class="diy-price">
  38. <span class="diy-sale-price" style="color: rgb(253, 70, 62);" :style="{color: permession.goodsPrice.color }" v-if="permession.goodsPrice.show && (activeItem.data.style != 6 || index == 1) ">
  39. ¥<span>20</span>
  40. </span>
  41. <span class="diy-original-price" style="color: rgb(153, 156, 167);" :style="{color: permession.originalPrice.color }" v-if="!permession.memberPrice.show && permession.originalPrice.show">
  42. <span>¥40</span>
  43. </span>
  44. <span class="member-price" v-if="permession.memberPrice.show">
  45. <span class="member-price-box">
  46. <span class="price-icon">VIP</span>
  47. <span class="price-num" :style="{color: permession.memberPrice.color }"><span class="price-unit">¥</span><span>13</span></span>
  48. </span>
  49. </span>
  50. <span v-for="(value, index) in addonsPermessionFields">
  51. <span v-if="permession[value.key].show" :style="{color: permession[value.key].color }">
  52. <span>{{value.prefix_text}}{{value.name}}</span><span>25</span>
  53. </span>
  54. </span>
  55. </div>
  56. <div class="diy-sold">
  57. <span class="diy-sales" :style="{color: permession.goodsSales_num.color || '#999'}" v-if="permession.goodsSales_num.show">已售88</span>
  58. </div>
  59. </div>
  60. <div class="goods-buy" :style="goodsBuyStyle" v-if="isShowGoodsBuy">
  61. <span v-if="!goodsBuySrc">{{goodsBuyText}}</span>
  62. <img :src="goodsBuySrc" v-else>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. <!-- 有数据 -->
  70. <div class="flex-wrap" :style="{flexWrap: flexWrap, ...contianStyle}" v-else>
  71. <div :class="[styleTypeClassArr, zoomComputed(index)]" v-for="(item,index) in goodsList" :key="index">
  72. <div class="diy-goods-basic" :style="goodsStyle">
  73. <div class="diy-goods-image">
  74. <div :class="hotClass" v-if="isShowHot" :style="hotStyle">{{hotName}}</div>
  75. <div class="img-contain">
  76. <el-image class="test-img" :src="item.cover_pic" :style="goodsStyle"></el-image>
  77. </div>
  78. <view class="store_distance" v-if="permession.store_distance.show">
  79. <span class="store_distance_text" :style="{backgroundColor: permession.store_distance.color }">门店</span>
  80. <span class="store_distance_num">{{item.distance}}km</span>
  81. </view>
  82. </div>
  83. <div class="detail" v-if="showDetail(index)">
  84. <div class="name" style="color: rgb(55, 56, 58);" :style="{color: permession.showTitle.color }" v-if="permession.showTitle.show">
  85. {{item.goods_name}}
  86. </div>
  87. <div class="subtitle" style="color: rgb(153, 156, 167);" :style="{color: permession.showSubTitle.color }" v-if="permession.showSubTitle.show">
  88. {{item.subtitle || '暂未设置副标题'}}
  89. </div>
  90. <div class="diy-sale">
  91. <div class="diy-info">
  92. <div class="diy-price">
  93. <span class="diy-sale-price" style="color: rgb(253, 70, 62);" :style="{color: permession.goodsPrice.color }" v-if="permession.goodsPrice.show && (activeItem.data.style != 6 || index == 1) ">
  94. ¥<span>{{item.price}}</span>
  95. </span>
  96. <span class="diy-original-price" style="color: rgb(153, 156, 167);" :style="{color: permession.originalPrice.color }" v-if="!permession.memberPrice.show && permession.originalPrice.show">
  97. <span>¥{{item.original_price}}</span>
  98. </span>
  99. <span class="member-price" v-if="permession.memberPrice.show">
  100. <span class="member-price-box">
  101. <span class="price-icon">VIP</span>
  102. <span class="price-num" :style="{color: permession.memberPrice.color }"><span class="price-unit">¥</span><span>{{item.member_price}}</span></span>
  103. </span>
  104. </span>
  105. <div class="store_distance" style="color: rgb(153, 156, 167);" :style="{color: permession.store_distance.color }" v-if="permession.store_distance.show">
  106. {{item.distance}}km
  107. </div>
  108. <span v-for="(value, index) in addonsPermessionFields">
  109. <span v-if="permession[value.key].show" :style="{color: permession[value.key].color }">
  110. <span>{{value.prefix_text}}{{value.name}}</span><span>{{item[value.key]}}</span>
  111. </span>
  112. </span>
  113. </div>
  114. <div class="diy-sold">
  115. <span class="diy-sales" style="color: rgb(153, 156, 167);" :style="{color: permession.goodsSales_num.color }" v-if="permession.goodsSales_num.show">已售{{item.sales_num}}</span>
  116. </div>
  117. </div>
  118. <div class="goods-buy" :style="goodsBuyStyle" v-if="isShowGoodsBuy">
  119. <span v-if="!goodsBuySrc">{{goodsBuyText}}</span>
  120. <img :src="goodsBuySrc" v-else>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. </template>
  129. <script>
  130. Vue.component('store-commodity-group-preview', {
  131. name: "store-commodity-group-preview",
  132. props: {
  133. activeItem: {
  134. type: Object,
  135. default () {
  136. return {}
  137. }
  138. }
  139. },
  140. template: '#store-commodity-group-preview',
  141. computed: {
  142. showDefaultData() {
  143. var boo = true
  144. if (this.activeItem.data.chooseGoods != 2) {
  145. boo = false
  146. if (!this.goodsList.length) {
  147. boo = true
  148. }
  149. }
  150. return boo
  151. },
  152. flexWrap() {
  153. let acceptArr = [6, 7]
  154. return acceptArr.indexOf(this.activeItem.data.style) != -1 ? 'nowrap' : ''
  155. },
  156. default_src() { // 默认图片
  157. var type = this.activeItem.data.style || 1
  158. return type == 1 ? 'resources/img/decorate/default_img.png' : 'resources/img/decorate/default_picture.png'
  159. },
  160. contianStyle() {
  161. var style = this.filterKey(this.activeItem.computedStyle.searchIpts, ["margin"])
  162. return style
  163. },
  164. goodsStyle() {
  165. let tabItem = this.computedStyle.tabItem
  166. let other = this.filterKey(this.computedStyle.searchIpts, ["border"])
  167. let style = {
  168. 'background': this.computedStyle.iptBg,
  169. ...other
  170. }
  171. if (tabItem && tabItem.value == 'border') style.border = '1px solid ' + (tabItem ? tabItem.color : 'transparent')
  172. if (tabItem && tabItem.value == 'shandow') style.boxShadow = tabItem ? '0 0 10px ' + tabItem.color : '0 0 10px rgba(226, 231, 244, 0.7)'
  173. return style
  174. },
  175. styleTypeClassArr() {
  176. var type = this.activeItem.data.style || 1
  177. var contentClass = []
  178. var result = {
  179. 1: 'diy-goods-contain-full',
  180. 2: 'diy-goods-contain',
  181. 3: 'diy-goods-contain1',
  182. 4: 'diy-goods-contain2',
  183. 5: 'diy-goods-contain3',
  184. 6: 'diy-goods-contain4',
  185. 7: 'diy-goods-contain5'
  186. }
  187. return contentClass.concat(result[type])
  188. },
  189. computedStyle() {
  190. return this.activeItem.computedStyle
  191. },
  192. searchData() {
  193. return this.activeItem.data
  194. },
  195. // 角标
  196. isShowHot() {
  197. var angleMark = this.activeItem.data.angleMark || null
  198. return angleMark && angleMark.label != 1
  199. },
  200. hotStyle() {
  201. var angleMark = this.activeItem.data.angleMark || null
  202. if (angleMark.label == 3 && angleMark.customImgUrl) {
  203. return {
  204. width: "76px",
  205. height: "76px",
  206. background: `url(${angleMark.customImgUrl}) no-repeat`,
  207. backgroundSize: "76px"
  208. }
  209. }
  210. return {}
  211. },
  212. hotClass() {
  213. var angleMark = this.activeItem.data.angleMark || null
  214. var obj = ["diy-goods-hot"]
  215. if (angleMark) {
  216. var name = ["", "diy-goods-hot3", "diy-goods-hot2", "diy-goods-hot1"]
  217. if (angleMark.label == 2 && angleMark.angleMarkStyle) {
  218. var key = name[angleMark.angleMarkStyle.label]
  219. obj.push(key)
  220. }
  221. }
  222. return obj
  223. },
  224. hotName() {
  225. var angleMark = this.activeItem.data.angleMark || null
  226. if (angleMark && !angleMark.angleMarkText && angleMark.label == 2) {
  227. return "热卖"
  228. }
  229. return angleMark.angleMarkText
  230. },
  231. // 购物车
  232. isShowGoodsBuy() { // 是否显示购物车按钮
  233. var showShopCart = this.activeItem.data.showShopCart
  234. var type = this.activeItem.data.style || 1
  235. if (type == 6) {
  236. return false
  237. }
  238. return !(showShopCart == 2)
  239. },
  240. goodsBuySrc() {
  241. var shopCartData = this.activeItem.data.shopCartStyle || {}
  242. var imgUrl = shopCartData.src
  243. if (shopCartData.label == 3 || shopCartData.label == 4) {
  244. return imgUrl
  245. }
  246. return ""
  247. },
  248. goodsBuyStyle() {
  249. var shopCartStyle = this.activeItem.computedStyle.shopCartStyle || {}
  250. var shopCartData = this.activeItem.data.shopCartStyle || {}
  251. // 类型1尺寸
  252. var size = ["", "3px 7px", "6px 10px", "10px 16px"]
  253. var small = size[shopCartStyle.sizeType] || size[1]
  254. // 类型2/3/4尺寸
  255. var size1 = ["", "22px", "28px", " 36px"]
  256. var small1 = size1[shopCartStyle.sizeType] || size1[1]
  257. var imgUrl = shopCartData.src
  258. // 1 2 3 4
  259. var handleList = [{}, {
  260. borderRadius: `${shopCartStyle.borderReduis || 0}px`,
  261. backgroundColor: `${shopCartStyle.backgroundColor || '#fd463e'}`,
  262. color: `${shopCartStyle.color || '#fff'}`,
  263. border: `1px solid ${shopCartStyle.borderColor}`,
  264. padding: small
  265. }, {
  266. borderRadius: `50%`,
  267. backgroundColor: `${shopCartStyle.backgroundColor || '#fd463e'}`,
  268. color: `${shopCartStyle.color || '#fff'}`,
  269. border: `1px solid ${shopCartStyle.borderColor}`,
  270. width: small1,
  271. height: small1,
  272. lineHeight: small1
  273. }, ]
  274. if (shopCartData.label == 3 || shopCartData.label == 4) {
  275. return {
  276. width: small1,
  277. height: small1,
  278. lineHeight: small1
  279. }
  280. }
  281. var result = handleList[shopCartData.label || 1]
  282. return result
  283. },
  284. goodsBuyText() {
  285. var shopCartStyle = this.activeItem.data.shopCartStyle || {}
  286. if (shopCartStyle.label == 2) {
  287. return '+'
  288. } else if (shopCartStyle.label == 3 || shopCartStyle.label == 4) {
  289. return ""
  290. }
  291. return shopCartStyle.text || "购买"
  292. },
  293. // 几种类型变化样式
  294. // 权限列表
  295. permession() {
  296. var obj = {
  297. showTitle: {
  298. show: true,
  299. color: ""
  300. },
  301. showSubTitle: {
  302. show: true,
  303. color: ""
  304. },
  305. goodsPrice: {
  306. show: true,
  307. color: ""
  308. },
  309. originalPrice: {
  310. show: true,
  311. color: ""
  312. },
  313. memberPrice: {
  314. show: true,
  315. color: ""
  316. },
  317. goodsSales_num: {
  318. show: true,
  319. color: ""
  320. },
  321. store_distance: {
  322. show: false,
  323. color: ""
  324. },
  325. }
  326. let addonsPermessionFields = this.addonsPermessionFields;
  327. addonsPermessionFields.forEach(function(value, index, arr) {
  328. obj[value.key] = {
  329. show: true,
  330. color: ""
  331. }
  332. })
  333. var data = this.activeItem.data.showContent || []
  334. var style = this.activeItem.data.style
  335. if (data.length) {
  336. for (const key in obj) {
  337. obj[key].show = false
  338. }
  339. }
  340. data.map(item => {
  341. var keyObj = {
  342. 1: {
  343. key: 'showTitle',
  344. filter: [1, 2, 3, 4, 5, 6, 7] // style支持的权限标识
  345. },
  346. 2: {
  347. key: 'showSubTitle',
  348. filter: [1, 2]
  349. },
  350. 3: {
  351. key: 'goodsPrice',
  352. filter: [1, 2, 3, 4, 5, 6, 7]
  353. },
  354. 4: {
  355. key: 'originalPrice',
  356. filter: [1, 2, 3]
  357. },
  358. 5: {
  359. key: 'goodsSales_num',
  360. filter: [1, 2, 3]
  361. },
  362. 6: {
  363. key: 'store_distance',
  364. filter: [1, 2, 3, 4, 5, 6, 7]
  365. },
  366. 0: {
  367. key: 'memberPrice',
  368. filter: [1, 2, 3]
  369. }
  370. }
  371. addonsPermessionFields.forEach(function(value, index, arr) {
  372. keyObj[value.label] = {
  373. key: value.key,
  374. filter: [1, 3]
  375. }
  376. })
  377. var target = keyObj[item.label]
  378. // 存在选中 - 继续style判断是否支持
  379. if (style && target) {
  380. if (target.filter.indexOf(style) != -1) {
  381. obj[target.key].show = true
  382. obj[target.key].color = item.color
  383. }
  384. }
  385. })
  386. return obj
  387. } ,
  388. filterStyle(){
  389. return {
  390. borderColor:this.activeItem.computedStyle.titleColor,
  391. color:this.activeItem.computedStyle.titleColor
  392. }
  393. },
  394. selectedFilterStyle(){
  395. return {
  396. color:'#EB3534'
  397. }
  398. },
  399. filterList(){
  400. let defaultList = [{
  401. name:'距离',
  402. code:'distance'
  403. },
  404. {
  405. name:'价格',
  406. code:'price'
  407. },
  408. {
  409. name:'销量',
  410. code:'sales_num'
  411. },
  412. {
  413. name:'评论',
  414. code:'comment_num'
  415. }]
  416. let { filterList } = this.activeItem.data
  417. let newFilterList = [];
  418. if(filterList){
  419. defaultList.forEach(item=>{
  420. if(filterList.includes(item.code)){
  421. newFilterList.push(item)
  422. }
  423. })
  424. } else {
  425. newFilterList = defaultList;
  426. }
  427. if(newFilterList.length>0){
  428. this.sortType = newFilterList[0].code
  429. }
  430. return newFilterList
  431. }
  432. },
  433. watch: {
  434. "activeItem.data.goods": {
  435. handler(newVal, oldVal) {
  436. if (newVal && !deepEqual(newVal, oldVal)) {
  437. const ids = newVal.map(item => {
  438. return item.params.id
  439. })
  440. this.InitData(1, ids);
  441. this.getGoodsList(ids)
  442. }
  443. },
  444. immediate: true,
  445. },
  446. 'activeItem.data': {
  447. handler(newVal, oldVal) {
  448. if (!newVal) {
  449. return false
  450. }
  451. var newCommCate = newVal && newVal.commCate
  452. var oldCommCate = oldVal && oldVal.commCate
  453. if (newVal.chooseGoods == 2 && newCommCate) {
  454. let { commCate } = newVal,count = 10;
  455. if(commCate){
  456. if(Array.isArray(commCate)){
  457. count = newVal.cateNum
  458. }else { //兼容原有逻辑
  459. count = newCommCate.count
  460. }
  461. }
  462. this.defaultList = new Array(count).fill({})
  463. } else {
  464. this.defaultList = [{}]
  465. }
  466. // 会抛出警告
  467. // if (newCommCate && newCommCate.count && (newCommCate.count == oldCommCate.count)) return false
  468. // if (newCommCate && newCommCate.count) {
  469. // this.defaultList = new Array(newCommCate.count).fill({})
  470. // } else {
  471. // this.defaultList = [{}]
  472. // }
  473. },
  474. immediate: true
  475. }
  476. },
  477. data() {
  478. return {
  479. defaultList: [],
  480. goodsList: [],
  481. addonsPermessionFields: [],
  482. isExec: 0,
  483. sortType: 'distance',
  484. sortOrder: 'desc',
  485. }
  486. },
  487. mounted() {
  488. this.InitData(0);
  489. },
  490. methods: {
  491. async InitData(from, ids = []) {
  492. if (from == 1) {
  493. await this.getBaseAddonsFields();
  494. this.getGoodsList(ids);
  495. } else {
  496. await this.getBaseAddonsFields();
  497. }
  498. },
  499. getGoodsList: function(ids) {
  500. console.log('ids',ids);
  501. let idsArray = ids.length>10?ids.slice(0,10):ids;
  502. let that = this;
  503. let limit = ids.length;
  504. let data = {
  505. "site": 1,
  506. "component": "goods",
  507. "identify": "store-goods",
  508. "limit": ids.length,
  509. "id": JSON.stringify(idsArray)
  510. }
  511. let addonsFields = [];
  512. that.addonsPermessionFields.forEach(function(value, index, arr) {
  513. addonsFields.push(value.key);
  514. })
  515. data['addonsFields'] = addonsFields;
  516. request({
  517. params: {
  518. r: '/mall/diy/get-components-data',
  519. form: JSON.stringify([data])
  520. },
  521. method: 'get',
  522. }).then(res => {
  523. const {
  524. data
  525. } = res.data
  526. const result = []
  527. ids.forEach((id, index) => {
  528. if (data[id]) {
  529. result.push(data[id])
  530. }
  531. })
  532. that.goodsList = result
  533. })
  534. },
  535. zoomComputed(index) {
  536. const type = this.activeItem.data.style
  537. if (type == 6) {
  538. if (index % 2 == 0) {
  539. return "zoom"
  540. }
  541. }
  542. return ""
  543. },
  544. showDetail(index) {
  545. const type = this.activeItem.data.style
  546. return !(type == 6 && index > 2)
  547. },
  548. filterKey(obj, keys) {
  549. var result = {}
  550. keys.forEach(key => {
  551. for (const k in obj) {
  552. if (k.indexOf(key) != -1) {
  553. result[k] = obj[k]
  554. }
  555. }
  556. })
  557. return result
  558. },
  559. getBaseAddonsFields() {
  560. if (this.isExec == 1) return;
  561. return new Promise((resolve, reject) => {
  562. request({
  563. params: {
  564. r: 'mall/diy/get-addons-fields',
  565. type: 'permession_fields'
  566. },
  567. method: 'get',
  568. }).then(e => {
  569. if (e.data.code === 0) {
  570. resolve()
  571. if (e.data.data.length > 0 && this.isExec == 0) {
  572. let that = this
  573. e.data.data.forEach(function(value, index, arr) {
  574. that.addonsPermessionFields.push(value);
  575. })
  576. }
  577. }
  578. this.isExec = 1;
  579. }).catch(e => {
  580. console.log(e);
  581. reject();
  582. })
  583. })
  584. },
  585. }
  586. });
  587. </script>
  588. <style lang="scss" scoped>
  589. .store-commodity-group-preview {
  590. box-sizing: border-box;
  591. overflow: hidden;
  592. .flex-wrap {
  593. display: flex;
  594. flex-wrap: wrap;
  595. }
  596. .diy-goods-image {
  597. position: relative;
  598. }
  599. /* 角标 */
  600. .diy-goods-hot {
  601. position: absolute;
  602. top: 0;
  603. left: 0;
  604. transform: scale(.5);
  605. transform-origin: top left;
  606. color: #fff;
  607. font-size: 22px;
  608. z-index: 99;
  609. }
  610. .diy-goods-hot1 {
  611. width: 64px;
  612. height: 44px;
  613. line-height: 44px;
  614. padding-left: 4px;
  615. background: url("resources/img/decorate/store-commodity-group/common_label2_3.png") no-repeat;
  616. }
  617. .diy-goods-hot2 {
  618. width: 52px;
  619. height: 56px;
  620. line-height: 44px;
  621. text-align: center;
  622. background: url("resources/img/decorate/store-commodity-group/common_label2_2.png") no-repeat;
  623. background-size: 52px 56px;
  624. }
  625. .diy-goods-hot3 {
  626. top: -3px;
  627. width: 60px;
  628. height: 60px;
  629. line-height: 50px;
  630. background-size: 60px;
  631. padding-left: 4px;
  632. background: url("resources/img/decorate/store-commodity-group/common_label2.png") no-repeat;
  633. }
  634. /* 购物车按钮 */
  635. .diy-sale {
  636. box-sizing: border-box;
  637. width: 100%;
  638. display: flex;
  639. align-items: flex-end;
  640. justify-content: space-between;
  641. }
  642. .diy-sale .diy-info {
  643. /* flex: 1; */
  644. }
  645. .diy-info {
  646. .diy-sales {
  647. font-size: 11px;
  648. }
  649. }
  650. .goods-buy {
  651. box-sizing: border-box;
  652. display: inline-block;
  653. text-align: center;
  654. align-self: flex-end;
  655. }
  656. .goods-buy img {
  657. width: 100%;
  658. height: 100%;
  659. display: block;
  660. }
  661. .detail {
  662. display: flex;
  663. flex-wrap: wrap;
  664. padding: 8px 12px;
  665. }
  666. .detail .name {
  667. font-size: 14px;
  668. line-height: 18px;
  669. height: 36px;
  670. margin-bottom: 4px;
  671. overflow: hidden;
  672. text-overflow: ellipsis;
  673. display: -webkit-box;
  674. -webkit-box-orient: vertical;
  675. -webkit-line-clamp: 2;
  676. }
  677. .detail .subtitle {
  678. font-size: 12px;
  679. height: 16px;
  680. line-height: 16px;
  681. width: 100%;
  682. color: #999ca7;
  683. margin-bottom: 4px;
  684. overflow: hidden;
  685. word-break: break-all;
  686. text-overflow: ellipsis;
  687. }
  688. .store_distance {
  689. position: absolute;
  690. bottom: 0;
  691. font-size: 11px;
  692. color: #FFF;
  693. border-radius: 2px;
  694. overflow: hidden;
  695. display: flex;
  696. .store_distance_text {
  697. background-color: #FF7300;
  698. padding: 0 6px;
  699. }
  700. .store_distance_num {
  701. background-color: rgba(000,000,000,0.6);
  702. padding: 0 4px 0 2px;
  703. }
  704. }
  705. .diy-sale-price {
  706. color: #fd463e;
  707. font-weight: 700;
  708. }
  709. .diy-sale-price span {
  710. font-size: 16px;
  711. line-height: 16px;
  712. }
  713. .diy-original-price {
  714. text-decoration: line-through;
  715. }
  716. .member-price {
  717. height: 18px;
  718. display: flex;
  719. line-height: 18px;
  720. border-radius: 4px;
  721. display: inline-flex;
  722. margin-top: 10px;
  723. margin-bottom: 5px;
  724. overflow: hidden;
  725. }
  726. .member-price-box {
  727. display: flex;
  728. border-radius: 5px;
  729. background-color: #FCECD6;
  730. }
  731. .price-icon {
  732. color: #FCECD6;
  733. font-size: 11px;
  734. font-weight: bold;
  735. text-align:center;
  736. background: linear-gradient( 90deg, #292220 0%, #4E372D 100%);
  737. border-radius: 5px;
  738. border-bottom-right-radius: 0;
  739. padding: 0 6px;
  740. }
  741. .price-num {
  742. color: #333;
  743. font-size: 14px;
  744. word-break: break-all;
  745. line-height: 18px;
  746. padding-left: 8px;
  747. padding-right: 8px;
  748. .price-unit {
  749. font-size: 12px;
  750. margin-left: -4px;
  751. margin-right: -1px;
  752. }
  753. }
  754. /* 样式1 */
  755. .diy-goods-contain-full {
  756. width: 100%;
  757. margin: 0;
  758. }
  759. .diy-goods-contain-full .detail .name {
  760. height: 20px;
  761. max-height: 20px;
  762. margin-bottom: 4px;
  763. }
  764. /* 样式2 */
  765. .diy-goods-contain {
  766. width: 100%;
  767. }
  768. .diy-goods-contain .detail .name {
  769. height: 20px;
  770. max-height: 20px;
  771. margin-bottom: 4px;
  772. }
  773. .diy-goods-contain .diy-goods-image {
  774. float: left;
  775. width: 130px;
  776. height: 130px;
  777. }
  778. .diy-goods-contain .detail {
  779. margin-left: 130px;
  780. height: 130px;
  781. padding: 10px;
  782. }
  783. .diy-goods-contain .diy-original-price {
  784. display: block;
  785. }
  786. .diy-goods-image .el-image {
  787. display: block;
  788. width: 100%;
  789. height: 100%;
  790. }
  791. /* 样式3 */
  792. .diy-goods-contain1 {
  793. width: 50%;
  794. }
  795. .diy-goods-contain1 .diy-original-price {
  796. display: block;
  797. }
  798. .diy-goods-contain1 .subtitle {
  799. display: none;
  800. }
  801. .diy-goods-contain1 .diy-sale {
  802. margin-top: 16px;
  803. }
  804. /* 样式4 */
  805. .diy-goods-contain2 {
  806. width: 50%;
  807. }
  808. .diy-goods-contain2 .diy-goods-image {
  809. float: left;
  810. width: 80px;
  811. height: 80px;
  812. }
  813. .diy-goods-contain2 .detail {
  814. margin-left: 80px;
  815. padding: 4px;
  816. height: 80px;
  817. }
  818. .diy-goods-contain2 .detail .goods-buy {
  819. display: none;
  820. }
  821. .diy-goods-contain2 .detail .subtitle {
  822. display: none;
  823. }
  824. .diy-goods-contain2 .detail .diy-sold {
  825. display: none;
  826. }
  827. .diy-goods-contain2 .detail .diy-original-price {
  828. display: none;
  829. }
  830. /* 样式5 */
  831. .diy-goods-contain3 {
  832. width: 33.33%;
  833. }
  834. .diy-goods-contain3 .el-image__error {
  835. min-height: 100px;
  836. }
  837. .diy-goods-contain3 .detail .subtitle {
  838. display: none;
  839. }
  840. .diy-goods-contain3 .detail .goods-buy {
  841. display: none;
  842. }
  843. .diy-goods-contain3 .detail .diy-sold {
  844. display: none;
  845. }
  846. .diy-goods-contain3 .detail .diy-original-price {
  847. display: none;
  848. }
  849. /* 样式6 */
  850. .diy-goods-contain4 {
  851. width: 33.33%;
  852. flex: 0 0 33.33%;
  853. }
  854. /* 样式7 */
  855. .diy-goods-contain5 {
  856. width: 30%;
  857. flex: 0 0 30%;
  858. }
  859. .diy-goods-contain5 .name {
  860. height: 36px;
  861. }
  862. .diy-goods-contain5 .el-image__error {
  863. min-height: 100px;
  864. }
  865. .diy-goods-contain5 .detail .subtitle {
  866. display: none;
  867. }
  868. .diy-goods-contain5 .detail .diy-sold {
  869. display: none;
  870. }
  871. .diy-goods-contain5 .detail .diy-original-price {
  872. display: none;
  873. }
  874. .diy-goods-contain5 .detail .goods-buy {
  875. display: none;
  876. }
  877. /* 基础样式 */
  878. .diy-goods-basic {
  879. margin: 0 4px 4px 0;
  880. overflow: hidden;
  881. }
  882. .diy-goods-contain-full .diy-goods-basic,
  883. .diy-goods-contain .diy-goods-basic {
  884. margin: 0 0 6px 0;
  885. }
  886. /* 图片自适应 */
  887. .img-contain {
  888. padding-top: 100%;
  889. position: relative
  890. }
  891. .img-contain .test-img {
  892. position: absolute;
  893. top: 0;
  894. bottom: 0;
  895. left: 0;
  896. right: 0;
  897. }
  898. .zoom {
  899. transform: scale(1, 0.9);
  900. }
  901. .filter-box {
  902. display: flex;
  903. font-size: 12px;
  904. margin: 12px;
  905. .filter-item {
  906. display: flex;
  907. justify-content: center;
  908. align-items: center;
  909. width: 82px;
  910. height: 25px;
  911. color: #999;
  912. }
  913. .filter-item+.filter-item {
  914. margin-left: 16px;
  915. }
  916. .filter-arrow {
  917. margin-left: 4px;
  918. position: relative;
  919. height: 14px;
  920. width: 8px;
  921. display: flex;
  922. flex-direction: column;
  923. justify-content: space-evenly;
  924. .el-icon-arrow-up,.el-icon-arrow-down{
  925. font-size: 8px;
  926. position: absolute;
  927. opacity: 0.4;
  928. font-weight: bold;
  929. }
  930. .icon {
  931. &.active {
  932. .el-icon-arrow-up,.el-icon-arrow-down{
  933. opacity: 1;
  934. }
  935. }
  936. .el-icon-arrow-up {
  937. top:1px;
  938. }
  939. .el-icon-arrow-down {
  940. bottom: -2px;
  941. }
  942. }
  943. }
  944. }
  945. }
  946. </style>