Model6.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  1. <template>
  2. <view class="model-6">
  3. <view :style="{backgroundColor:editablePageConfig.editable_page_config_content.back_color}" class="goods-list" :class="editablePageConfig.editable_page_config_content.show_format==2?'single-column':'double-column'">
  4. <view class="goods-item margin-bottom" v-for="(goods,index) in editablePageConfig.editable_page_config_content.goods_list" :key="index" @click="productClick(goods.goods_id)">
  5. <view class="goods-img">
  6. <image mode="aspectFit" class="img" :src="goods.goods_image">
  7. <view class="goods-tag-img" v-if="editablePageConfig.editable_page_config_content['if_show_goods_icon']==1 && editablePageConfig.editable_page_config_content['goods_icon']!=''">
  8. <image mode="aspectFit" class="img" :src="editablePageConfig.editable_page_config_content.goods_icon" />
  9. </view>
  10. </view>
  11. <view class="info-wrap">
  12. <view class="name-wrap">
  13. <view class="goods-name">{{goods.goods_name}}</view>
  14. </view>
  15. <view class="pro-info">
  16. <view class="delete-price" v-if="goods['goods_marketprice']>0">
  17. <text class="unit">¥</text>{{parseFloat(goods.goods_marketprice)}}
  18. </view>
  19. <view class="delete-price" v-if="goods['goods_price']>goods['goods_promotion_price']">
  20. <text class="unit">¥</text>{{parseFloat(goods.goods_price)}}
  21. </view>
  22. <view class="sale">{{goods.goods_salenum}}人已购</view>
  23. </view>
  24. <view class="lineheight-clear">
  25. <view class="discount-price">
  26. <text class="unit">¥</text>
  27. <text class="price">{{parseFloat(goods.goods_promotion_price)}}</text>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. name: 'Model6',
  38. data () {
  39. return {}
  40. },
  41. props: ['editablePageConfig','editablePage'],
  42. components: {
  43. },
  44. computed: {
  45. },
  46. methods: {
  47. productClick(goods_id) {
  48. uni.navigateTo({url: '/pages/home/goodsdetail/Goodsdetail?goods_id='+goods_id })
  49. }
  50. }
  51. }
  52. </script>
  53. <style lang="scss" scoped>
  54. .model-6 .goods-list{
  55. border-radius:5px;
  56. }
  57. .model-6 .goods-list.single-column .goods-item {
  58. padding:13px;
  59. background:#fff;
  60. margin:5px 0;
  61. border-radius:5px;
  62. display:flex;
  63. position:relative;
  64. }
  65. .model-6 .goods-list.single-column .goods-item:first-child{
  66. margin-top: 0;
  67. }
  68. .model-6 .goods-list.single-column .goods-item:last-child{
  69. margin-bottom: 0;
  70. }
  71. .model-6 .goods-list.single-column .goods-item .goods-img {
  72. width:90px;
  73. height:90px;
  74. overflow:hidden;
  75. border-radius:5px;
  76. margin-right:10px;
  77. background:#e5e5e5;
  78. display:flex;
  79. justify-content:center;
  80. align-items:center;
  81. }
  82. .model-6 .goods-list.single-column .goods-item .goods-img .img {
  83. width: 100%;
  84. height: 100%;
  85. }
  86. .model-6 .goods-list.single-column .goods-item .goods-tag {
  87. color:#fff;
  88. line-height:1;
  89. padding:4px 6px;
  90. position:absolute;
  91. border-top-left-radius:5px;
  92. border-bottom-right-radius:5px;
  93. top:13px;
  94. left:13px;
  95. font-size:12px;
  96. background: #FF4544
  97. }
  98. .model-6 .goods-list.single-column .goods-item .goods-tag-img {
  99. position: absolute;
  100. border-top-left-radius: 5px;
  101. width: 40px;
  102. height: 40px;
  103. top: 13px;
  104. left: 13px;
  105. z-index: 5;
  106. overflow: hidden;
  107. margin: 0;
  108. }
  109. .model-6 .goods-list.single-column .goods-item .goods-tag-img .tag-wrap{
  110. background: #eee;
  111. font-size: 12px;
  112. padding: 5px;
  113. text-align: center;
  114. color: #999;
  115. }
  116. .model-6 .goods-list.single-column .goods-item .goods-tag-img .img {
  117. width: 100%;
  118. height: 100%;
  119. }
  120. .model-6 .goods-list.single-column .goods-item .info-wrap {
  121. flex:1;
  122. display:flex;
  123. flex-direction:column;
  124. }
  125. .model-6 .goods-list.single-column .goods-item .name-wrap {
  126. flex:1;
  127. }
  128. .model-6 .goods-list.single-column .goods-item .goods-name {
  129. font-size:14px;
  130. line-height:1.3;
  131. overflow:hidden;
  132. text-overflow:ellipsis;
  133. display:-webkit-box;
  134. -webkit-line-clamp:2;
  135. -webkit-box-orient:vertical;
  136. }
  137. .model-6 .goods-list.single-column .goods-item .discount-price {
  138. display:inline-block;
  139. font-weight:bold;
  140. line-height:1;
  141. margin-top:8px;
  142. color:#f44;
  143. }
  144. .model-6 .goods-list.single-column .goods-item .discount-price .unit {
  145. font-size:12px;
  146. }
  147. .model-6 .goods-list.single-column .goods-item .pro-info {
  148. display:flex;
  149. margin-top:8px;
  150. }
  151. .model-6 .goods-list.single-column .goods-item .pro-info .delete-price {
  152. text-decoration:line-through;
  153. flex:1;
  154. font-size:12px;
  155. line-height:1;
  156. color:#999;
  157. }
  158. .model-6 .goods-list.single-column .goods-item .pro-info .sale {
  159. font-size:12px;
  160. line-height:1;
  161. color:#999;
  162. }
  163. .model-6 .goods-list.single-column .goods-item .pro-info .sale {
  164. font-size:12px;
  165. }
  166. .model-6 .goods-list.single-column .goods-item .pro-info > view {
  167. line-height:1;
  168. }
  169. .model-6 .goods-list.single-column .goods-item .pro-info > view:nth-child(2) {
  170. text-align:right;
  171. }
  172. .model-6 .goods-list.single-column .goods-item .member-price-tag {
  173. display:inline-block;
  174. width:30px;
  175. line-height:1;
  176. margin-left:3px;
  177. }
  178. .model-6 .goods-list.single-column .goods-item .member-price-tag image {
  179. width:100%;
  180. }
  181. .model-6 .goods-list.double-column {
  182. display:flex;
  183. flex-wrap:wrap;
  184. margin: 0;
  185. padding: 0;
  186. }
  187. .model-6 .goods-list.double-column .goods-item {
  188. flex:1;
  189. position:relative;
  190. background:#fff;
  191. flex-basis:48%;
  192. max-width:calc((100% - 15px) / 2);
  193. margin-right:15px;
  194. margin-bottom:10px;
  195. border-radius:5px;
  196. }
  197. .model-6 .goods-list.double-column .goods-item:nth-child(2n) {
  198. margin-right:0;
  199. }
  200. .model-6 .goods-list.double-column .goods-item .goods-img {
  201. position:relative;
  202. height:0;
  203. overflow:hidden;
  204. padding-top:100%;
  205. border-top-left-radius:5px;
  206. border-top-right-radius:5px;
  207. background-color:#E8E8E8;
  208. }
  209. .model-6 .goods-list.double-column .goods-item .goods-img .img {
  210. position:absolute;
  211. top:50%;
  212. left:50%;
  213. transform:translate(-50%,-50%);
  214. width: 100%;
  215. height: 100%;
  216. }
  217. .model-6 .goods-list.double-column .goods-item .goods-tag {
  218. color:#fff;
  219. line-height:1;
  220. padding:4px 8px;
  221. position:absolute;
  222. border-bottom-right-radius:5px;
  223. top:0;
  224. left:0;
  225. font-size:12px;
  226. background: #FF4544;
  227. }
  228. .model-6 .goods-list.double-column .goods-item .goods-tag-img {
  229. position: absolute;
  230. border-top-left-radius: 5px;
  231. width: 40px;
  232. height: 40px;
  233. top: 0;
  234. left: 0;
  235. z-index: 5;
  236. overflow: hidden;
  237. margin: 0;
  238. }
  239. .model-6 .goods-list.double-column .goods-item .goods-tag-img .tag-wrap{
  240. background: #eee;
  241. font-size: 12px;
  242. padding: 5px;
  243. text-align: center;
  244. color: #999;
  245. }
  246. .model-6 .goods-list.double-column .goods-item .goods-tag-img .tag-wrap{
  247. background: #eee;
  248. font-size: 12px;
  249. }
  250. .model-6 .goods-list.double-column .goods-item .goods-tag-img .img {
  251. width: 100%;
  252. height: 100%;
  253. }
  254. .model-6 .goods-list.double-column .goods-item .info-wrap {
  255. padding:0 13px 13px 13px;
  256. }
  257. .model-6 .goods-list.double-column .goods-item .goods-name {
  258. font-size:14px;
  259. line-height:1.3;
  260. overflow:hidden;
  261. text-overflow:ellipsis;
  262. display:-webkit-box;
  263. -webkit-line-clamp:2;
  264. -webkit-box-orient:vertical;
  265. margin-top:10px;
  266. }
  267. .model-6 .goods-list.double-column .goods-item .discount-price {
  268. display:inline-block;
  269. font-weight:bold;
  270. line-height:1;
  271. margin-top:8px;
  272. color:#f44;
  273. font-size: 14px;
  274. }
  275. .model-6 .goods-list.double-column .goods-item .pro-info {
  276. display:flex;
  277. margin-top:8px;
  278. }
  279. .model-6 .goods-list.double-column .goods-item .pro-info .delete-price {
  280. text-decoration:line-through;
  281. flex:1;
  282. font-size:12px;
  283. line-height:1;
  284. color:#999;
  285. }
  286. .model-6 .goods-list.double-column .goods-item .pro-info .sale {
  287. font-size:12px;
  288. line-height:1;
  289. color:#999;
  290. }
  291. .model-6 .goods-list.double-column .goods-item .pro-info .delete-price .unit {
  292. margin-right:3px;
  293. }
  294. .model-6 .goods-list.double-column .goods-item .pro-info > view {
  295. line-height:1;
  296. }
  297. .model-6 .goods-list.double-column .goods-item .pro-info > view:nth-child(2) {
  298. text-align:right;
  299. }
  300. .model-6 .goods-list.double-column .goods-item .member-price-tag {
  301. display:inline-block;
  302. width:30px;
  303. line-height:1;
  304. margin-left:3px;
  305. }
  306. .model-6 .goods-list.double-column .goods-item .member-price-tag image {
  307. width:100%;
  308. }
  309. .model-6 .goods-list.double-column {
  310. display:flex;
  311. flex-wrap:wrap;
  312. margin: 0;
  313. padding: 0;
  314. }
  315. .model-6 .goods-list.double-column .goods-item {
  316. flex:1;
  317. position:relative;
  318. background:#fff;
  319. flex-basis:48%;
  320. max-width:calc((100% - 15px) / 2);
  321. margin-right:15px;
  322. margin-bottom:10px;
  323. border-radius:5px;
  324. }
  325. .model-6 .goods-list.double-column .goods-item:nth-child(2n) {
  326. margin-right:0;
  327. }
  328. .model-6 .goods-list.double-column .goods-item .goods-img {
  329. position:relative;
  330. height:0;
  331. overflow:hidden;
  332. padding-top:100%;
  333. border-top-left-radius:5px;
  334. border-top-right-radius:5px;
  335. background-color:#E8E8E8;
  336. }
  337. .model-6 .goods-list.double-column .goods-item .goods-img .img {
  338. position:absolute;
  339. top:50%;
  340. left:50%;
  341. transform:translate(-50%,-50%);
  342. width: 100%;
  343. height: 100%;
  344. }
  345. .model-6 .goods-list.double-column .goods-item .goods-tag {
  346. color:#fff;
  347. line-height:1;
  348. padding:4px 8px;
  349. position:absolute;
  350. border-bottom-right-radius:5px;
  351. top:0;
  352. left:0;
  353. font-size:12px;
  354. background: #FF4544;
  355. }
  356. .model-6 .goods-list.double-column .goods-item .goods-tag-img {
  357. position: absolute;
  358. border-top-left-radius: 5px;
  359. width: 40px;
  360. height: 40px;
  361. top: 0;
  362. left: 0;
  363. z-index: 5;
  364. overflow: hidden;
  365. margin: 0;
  366. }
  367. .model-6 .goods-list.double-column .goods-item .goods-tag-img .tag-wrap{
  368. background: #eee;
  369. font-size: 12px;
  370. padding: 5px;
  371. text-align: center;
  372. color: #999;
  373. }
  374. .model-6 .goods-list.double-column .goods-item .goods-tag-img .tag-wrap{
  375. background: #eee;
  376. font-size: 12px;
  377. }
  378. .model-6 .goods-list.double-column .goods-item .goods-tag-img .img {
  379. width: 100%;
  380. height: 100%;
  381. }
  382. .model-6 .goods-list.double-column .goods-item .info-wrap {
  383. padding:0 13px 13px 13px;
  384. }
  385. .model-6 .goods-list.double-column .goods-item .goods-name {
  386. font-size:14px;
  387. line-height:1.3;
  388. overflow:hidden;
  389. text-overflow:ellipsis;
  390. display:-webkit-box;
  391. -webkit-line-clamp:2;
  392. -webkit-box-orient:vertical;
  393. margin-top:10px;
  394. }
  395. .model-6 .goods-list.double-column .goods-item .discount-price {
  396. display:inline-block;
  397. font-weight:bold;
  398. line-height:1;
  399. margin-top:8px;
  400. color:#f44;
  401. }
  402. .model-6 .goods-list.double-column .goods-item .pro-info {
  403. display:flex;
  404. margin-top:8px;
  405. }
  406. .model-6 .goods-list.double-column .goods-item .pro-info .delete-price {
  407. text-decoration:line-through;
  408. flex:1;
  409. font-size:12px;
  410. line-height:1;
  411. color:#999;
  412. }
  413. .model-6 .goods-list.double-column .goods-item .pro-info .sale {
  414. font-size:12px;
  415. line-height:1;
  416. color:#999;
  417. }
  418. .model-6 .goods-list.double-column .goods-item .pro-info .delete-price .unit {
  419. margin-right:3px;
  420. }
  421. .model-6 .goods-list.double-column .goods-item .pro-info > view {
  422. line-height:1;
  423. }
  424. .model-6 .goods-list.double-column .goods-item .pro-info > view:nth-child(2) {
  425. text-align:right;
  426. }
  427. .model-6 .goods-list.double-column .goods-item .member-price-tag {
  428. display:inline-block;
  429. width:30px;
  430. line-height:1;
  431. margin-left:3px;
  432. }
  433. .model-6 .goods-list.double-column .goods-item .member-price-tag image {
  434. width:100%;
  435. }
  436. </style>