goodListMall.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  1. <template>
  2. <view class="index-product-wrapper" :class="iSshowH ? 'on' : ''" :style="'margin-top:'+mbConfig*2+'rpx;'"
  3. v-show="!isSortType">
  4. <view v-if="iSshowH">
  5. <u-tabs :list="navigationList2" @click="" lineColor="#EB4C63" :inactiveStyle="{ color: '#333' }"
  6. :activeStyle="{ color: '#EB4C63', fontWeight: 'bold' }"></u-tabs>
  7. </view>
  8. <!-- 首发新品 -->
  9. <view class="list-box animated" :class='tempArr.length > 0 ? "fadeIn on" : ""'>
  10. <view class="item" v-for="(item, index) in tempArr" :key="index" @click="goDetail(item)">
  11. <view class="pictrue">
  12. <span class="pictrue_log pictrue_log_class" :style="'background-color:' + labelColor"
  13. v-if="item.activity && item.activity.type === '1'">{{ $t(`秒杀`) }}</span>
  14. <span class="pictrue_log pictrue_log_class" :style="'background-color:' + labelColor"
  15. v-if="item.activity && item.activity.type === '2'">{{ $t(`砍价`) }}</span>
  16. <span class="pictrue_log pictrue_log_class" :style="'background-color:' + labelColor"
  17. v-if="item.activity && item.activity.type === '3'">{{ $t(`拼团`) }}</span>
  18. <image :src="item.image" mode="aspectFit"></image>
  19. </view>
  20. <view class="text-info">
  21. <view class="title" v-if="titleShow">
  22. <u-text prefixIcon="bookmark" iconStyle="font-size: 16px; color:red" :lines="2" bold block size="12" :text="item.store_name"></u-text>
  23. </view>
  24. <view class="tags" v-if="opriceShow">赠送{{ item.ot_price }}红积分</view>
  25. <view class="price" :style="{ color: fontColor }">
  26. <view v-if="priceShow">
  27. <text>{{ $t(`¥`) }}</text>{{ item.price }}
  28. </view>
  29. <view class="txt" :style="'border:1px solid ' + labelColor + ';color:' + labelColor"
  30. :class="priceShow ? '' : 'on'" v-if="item.checkCoupon && couponShow">{{ $t(`券`) }}</view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. export default {
  39. name: 'promotionList',
  40. props: {
  41. dataConfig: {
  42. type: Object,
  43. default: () => { }
  44. },
  45. tempArr: {
  46. type: Array,
  47. default: []
  48. },
  49. iSshowH: {
  50. type: Boolean,
  51. default: false
  52. },
  53. isSortType: {
  54. type: String | Number,
  55. default: 0
  56. }
  57. },
  58. data() {
  59. return {
  60. navigationList2: [{
  61. name: 'Tab1',
  62. }, {
  63. name: 'Tab2'
  64. }, {
  65. name: 'Tab2'
  66. }, {
  67. name: 'Tab3'
  68. }, {
  69. name: 'Tab4'
  70. }, {
  71. name: 'Tab5'
  72. }, {
  73. name: 'Tab6'
  74. }, {
  75. name: 'Tab7'
  76. }],
  77. ProductNavindex: 0,
  78. explosiveMoney: [
  79. {
  80. "chiild": [
  81. {
  82. "title": "标题",
  83. "val": "首发新品",
  84. "max": 4,
  85. "pla": "选填,不超过四个字"
  86. },
  87. {
  88. "title": "简介",
  89. "val": "最新出炉",
  90. "max": 4,
  91. "pla": "选填,不超过四个字"
  92. }
  93. ],
  94. "link": {
  95. "title": "链接",
  96. "activeVal": 3,
  97. "optiops": [
  98. {
  99. "type": 0,
  100. "value": 1,
  101. "label": "精品推荐"
  102. },
  103. {
  104. "type": 1,
  105. "value": 2,
  106. "label": "热门榜单"
  107. },
  108. {
  109. "type": 2,
  110. "value": 3,
  111. "label": "首发新品"
  112. },
  113. {
  114. "type": 3,
  115. "value": 4,
  116. "label": "促销单品"
  117. }
  118. ]
  119. }
  120. },
  121. {
  122. "chiild": [
  123. {
  124. "title": "标题",
  125. "val": "精品推荐",
  126. "max": 4,
  127. "pla": "选填,不超过四个字"
  128. },
  129. {
  130. "title": "简介",
  131. "val": "猜你喜欢",
  132. "max": 4,
  133. "pla": "选填,不超过四个字"
  134. }
  135. ],
  136. "link": {
  137. "title": "链接",
  138. "activeVal": 1,
  139. "optiops": [
  140. {
  141. "type": 0,
  142. "value": 1,
  143. "label": "精品推荐"
  144. },
  145. {
  146. "type": 1,
  147. "value": 2,
  148. "label": "热门榜单"
  149. },
  150. {
  151. "type": 2,
  152. "value": 3,
  153. "label": "首发新品"
  154. },
  155. {
  156. "type": 3,
  157. "value": 4,
  158. "label": "促销单品"
  159. }
  160. ]
  161. }
  162. },
  163. {
  164. "chiild": [
  165. {
  166. "title": "标题",
  167. "val": "热门榜单",
  168. "max": 4,
  169. "pla": "选填,不超过四个字"
  170. },
  171. {
  172. "title": "简介",
  173. "val": "好评如云",
  174. "max": 4,
  175. "pla": "选填,不超过四个字"
  176. }
  177. ],
  178. "link": {
  179. "title": "链接",
  180. "activeVal": 2,
  181. "optiops": [
  182. {
  183. "type": 0,
  184. "value": 1,
  185. "label": "精品推荐"
  186. },
  187. {
  188. "type": 1,
  189. "value": 2,
  190. "label": "热门榜单"
  191. },
  192. {
  193. "type": 2,
  194. "value": 3,
  195. "label": "首发新品"
  196. },
  197. {
  198. "type": 3,
  199. "value": 4,
  200. "label": "促销单品"
  201. }
  202. ]
  203. }
  204. },
  205. {
  206. "chiild": [
  207. {
  208. "title": "标题",
  209. "val": "促销单品",
  210. "max": 4,
  211. "pla": "选填,不超过四个字"
  212. },
  213. {
  214. "title": "简介",
  215. "val": "多买多销",
  216. "max": 4,
  217. "pla": "选填,不超过四个字"
  218. }
  219. ],
  220. "link": {
  221. "title": "链接",
  222. "activeVal": 4,
  223. "optiops": [
  224. {
  225. "type": 0,
  226. "value": 1,
  227. "label": "精品推荐"
  228. },
  229. {
  230. "type": 1,
  231. "value": 2,
  232. "label": "热门榜单"
  233. },
  234. {
  235. "type": 2,
  236. "value": 3,
  237. "label": "首发新品"
  238. },
  239. {
  240. "type": 3,
  241. "value": 4,
  242. "label": "促销单品"
  243. }
  244. ]
  245. }
  246. }
  247. ],
  248. numConfig: 9,
  249. // imgStyle: this.dataConfig.imgStyle.type,
  250. mbConfig: 0,
  251. themeColor: "rgba(29,176,252,1)",
  252. titleShow: true, //标题是否显示
  253. opriceShow: true, //原价是否显示
  254. priceShow: true, //价格是否显示
  255. couponShow: true,//优惠券标签是否显示
  256. titleConfig: 2, //标题位置
  257. fontColor: "rgba(253,80,47,1)",
  258. labelColor: "rgba(29,176,252,1)"
  259. };
  260. },
  261. created() {
  262. },
  263. methods: {
  264. // 首发新品切换
  265. ProductNavTab(type, index) {
  266. this.ProductNavindex = index;
  267. this.$emit('changeTab', type);
  268. },
  269. goDetail(item) {
  270. this.$emit('detail', item);
  271. }
  272. }
  273. }
  274. </script>
  275. <style lang="scss">
  276. .index-product-wrapper {
  277. margin: 30rpx 20rpx 0 20rpx;
  278. &.on {
  279. min-height: 1500rpx;
  280. }
  281. .nav-bd {
  282. display: flex;
  283. align-items: center;
  284. margin-top: 30rpx;
  285. .item {
  286. display: flex;
  287. flex-direction: column;
  288. align-items: center;
  289. justify-content: center;
  290. width: 25%;
  291. &.on {
  292. border-radius: 0;
  293. }
  294. .txt {
  295. font-size: 32rpx;
  296. color: #282828;
  297. }
  298. .label {
  299. display: flex;
  300. align-items: center;
  301. justify-content: center;
  302. width: 124rpx;
  303. height: 32rpx;
  304. margin-top: 5rpx;
  305. font-size: 24rpx;
  306. color: #999;
  307. border-radius: 16rpx;
  308. }
  309. }
  310. }
  311. .list-box {
  312. display: flex;
  313. flex-wrap: wrap;
  314. justify-content: space-between;
  315. margin-top: 30rpx;
  316. .item {
  317. width: 345rpx;
  318. margin-bottom: 20rpx;
  319. background-color: #fff;
  320. border-radius: 20rpx;
  321. overflow: hidden;
  322. position: relative;
  323. .pictrue_log {
  324. width: 92rpx;
  325. height: 44rpx;
  326. font-size: 26rpx;
  327. line-height: 44rpx;
  328. }
  329. image {
  330. width: 100%;
  331. height: 346rpx;
  332. display: block;
  333. }
  334. .text-info {
  335. padding: 10rpx 20rpx 15rpx;
  336. .title {
  337. color: #222222;
  338. }
  339. .tags {
  340. display: inline-block;
  341. font-size: 20rpx;
  342. padding: 6rpx;
  343. background-color: #FCE9EC;
  344. color: #EB4C63;
  345. margin: 6rpx 0;
  346. }
  347. .old-price {
  348. margin-top: 4rpx;
  349. font-size: 26rpx;
  350. color: #f51414;
  351. // text-decoration: line-through;
  352. text {
  353. margin-right: 2px;
  354. font-size: 20rpx;
  355. }
  356. }
  357. .price {
  358. display: flex;
  359. align-items: flex-end;
  360. font-size: 36rpx;
  361. font-weight: 550;
  362. text {
  363. padding-bottom: 4rpx;
  364. font-size: 26rpx;
  365. font-weight: normal;
  366. }
  367. .txt {
  368. display: flex;
  369. align-items: center;
  370. justify-content: center;
  371. width: 28rpx;
  372. height: 28rpx;
  373. margin-left: 15rpx;
  374. margin-bottom: 10rpx;
  375. border-radius: 4rpx;
  376. font-size: 20rpx;
  377. font-weight: normal;
  378. &.on {
  379. margin-left: 0;
  380. }
  381. }
  382. }
  383. }
  384. }
  385. &.on {
  386. display: flex;
  387. }
  388. }
  389. }
  390. </style>