HotNews.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. <template>
  2. <!-- 点击排行 -->
  3. <div class="categ_3_index clearfix">
  4. <div class="shop_name_box">
  5. <div class="shop_name">
  6. <span class="shop_name_box_a">点击排行</span>
  7. </div>
  8. <div class="shop_name_right"></div>
  9. </div>
  10. <div class="categ_ul_img_1">
  11. <div class="categ_li_img_1" v-for="item in pageData1">
  12. <NuxtLink
  13. :to="getShopPathDetail1(item)"
  14. class="categ_li_img_1_a"
  15. :title="item.name"
  16. >
  17. <img class="categ_li_img_1_img" :src="item.imgurl" alt="item.name">
  18. <div class="categ_li_img_1_dot2 dot2">
  19. {{ item.name }}
  20. </div>
  21. </NuxtLink>
  22. </div>
  23. </div>
  24. </div>
  25. <!-- 点击排行 -->
  26. <!-- 最新商机 -->
  27. <div class="categ_5_index clearfix">
  28. <div class="shop_name_box">
  29. <div class="shop_name">
  30. <span class="shop_name_box_a">最新商机</span>
  31. </div>
  32. <div class="shop_name_right"></div>
  33. </div>
  34. <div class="categ_ul_img_2">
  35. <div class="categ_li_img_2" v-for="item in pageData2">
  36. <NuxtLink
  37. :to="getShopPathDetail1(item)"
  38. class="categ_li_img_2_a"
  39. :title="item.name"
  40. >
  41. <img class="categ_li_img_2_img" :src="item.imgurl" alt="item.name">
  42. <div class="categ_li_img_2_dot2 dot2">
  43. {{ item.name }}
  44. </div>
  45. </NuxtLink>
  46. </div>
  47. </div>
  48. </div>
  49. </template>
  50. <script setup>
  51. //1.获得模块数据 start ---------------------------------------->
  52. const pageData1 = ref([])//点击排行
  53. const pageData2 = ref([])//最新商机
  54. //创建请求数据json
  55. let getJson = [
  56. {"level":"3,0,6"},//点击排行
  57. {"level":"4,0,6"},//最新商机
  58. ]
  59. let jsonString = JSON.stringify(getJson)
  60. //获取所有数据
  61. async function getPageAllData() {
  62. const mkdata = await requestDataPromise('/web/getWebsiteshop', {
  63. method: 'GET',
  64. query: {
  65. 'catid': 346,
  66. 'id': jsonString,
  67. },
  68. });
  69. if (mkdata.code == 200) {
  70. //最新数据2
  71. pageData1.value = mkdata.data.goods[0];
  72. //供应商品
  73. pageData2.value = mkdata.data.goods[1];
  74. } else {
  75. ElMessage.error(mkdata.message)
  76. }
  77. }
  78. getPageAllData();
  79. </script>
  80. <style lang="less" scoped>
  81. .dot2 {
  82. overflow: hidden;
  83. display: -webkit-box;
  84. -webkit-box-orient: vertical;
  85. -webkit-line-clamp: 2;
  86. }
  87. .categ_3_index {
  88. margin-top: 28px;
  89. }
  90. .clearfix {
  91. overflow: hidden;
  92. }
  93. .shop_name {
  94. float: left;
  95. height: 44px;
  96. line-height: 44px;
  97. color: #fff;
  98. font-weight: bold;
  99. position: relative;
  100. z-index: 11;
  101. text-align: center;
  102. font-size: 20px;
  103. background: #A01C0E;
  104. padding: 0px 14px;
  105. }
  106. .shop_name_box {
  107. border-top: solid 1px #fff;
  108. }
  109. .shop_name_box_a {
  110. height: 44px;
  111. line-height: 44px;
  112. color: #fff;
  113. font-weight: bold;
  114. font-size: 20px;
  115. }
  116. .shop_name_right {
  117. height: 40px;
  118. border-bottom: 1px solid #E8E9EC;
  119. margin-top: 4px;
  120. background: #F8F8F8;
  121. position: relative;
  122. z-index: 2;
  123. }
  124. .categ_li_img_1 {
  125. float: left;
  126. margin: 0px 24px 20px 0px;
  127. width: 180px;
  128. position: relative;
  129. }
  130. .categ_li_img_1_a {}
  131. .categ_li_img_1_img {
  132. display: block;
  133. width: 180px;
  134. height: 180px;
  135. }
  136. .categ_li_img_1_dot2 {
  137. width: 168px;
  138. margin: 10px auto 0px;
  139. height: 32px;
  140. line-height: 16px;
  141. color: #333;
  142. font-size: 14px;
  143. text-align: center;
  144. }
  145. .categ_li_img_1:nth-of-type(6n) {
  146. margin-right: 0px;
  147. }
  148. .categ_li_img_1_hover_dot1 {
  149. width: 152px;
  150. position: absolute;
  151. left: 50%;
  152. margin-left: -76px;
  153. bottom: 13px;
  154. font-size: 14px;
  155. background: linear-gradient(to right, #FFE1AA, #F9F4E3, #FFE1AA);
  156. -webkit-background-clip: text;
  157. color: transparent;
  158. }
  159. .categ_li_img_1:hover .categ_li_img_1_dot2 {
  160. color: #A01C0E;
  161. }
  162. .categ_li_img_1:nth-of-type(1) .categ_li_img_1_dot2::after {
  163. content: '';
  164. display: block;
  165. position: absolute;
  166. background: url(@/public/img/18.png) no-repeat left 0px;
  167. background-size: 100% 100%;
  168. width: 32px;
  169. height: 32px;
  170. left: 10px;
  171. top: 0px;
  172. z-index: 11;
  173. }
  174. .categ_li_img_1:nth-of-type(2) .categ_li_img_1_dot2::after {
  175. content: '';
  176. display: block;
  177. position: absolute;
  178. background: url(@/public/img/19.png) no-repeat left 0px;
  179. background-size: 100% 100%;
  180. width: 32px;
  181. height: 32px;
  182. left: 10px;
  183. top: 0px;
  184. z-index: 11;
  185. }
  186. .categ_li_img_1:nth-of-type(3) .categ_li_img_1_dot2::after {
  187. content: '';
  188. display: block;
  189. position: absolute;
  190. background: url(@/public/img/20.png) no-repeat left 0px;
  191. background-size: 100% 100%;
  192. width: 32px;
  193. height: 32px;
  194. left: 10px;
  195. top: 0px;
  196. z-index: 11;
  197. }
  198. .categ_ul_img_1 {
  199. margin-top: 20px;
  200. }
  201. .categ_ul_img_2 {
  202. margin-top: 20px;
  203. }
  204. .categ_li_img_2 {
  205. float: left;
  206. margin: 0px 24px 20px 0px;
  207. width: 180px;
  208. position: relative;
  209. }
  210. .categ_li_img_2_a {}
  211. .categ_li_img_2_img {
  212. display: block;
  213. width: 180px;
  214. height: 180px;
  215. }
  216. .categ_li_img_2_dot2 {
  217. width: 168px;
  218. margin: 10px auto 0px;
  219. height: 32px;
  220. line-height: 16px;
  221. color: #333;
  222. font-size: 14px;
  223. text-align: center;
  224. }
  225. .categ_li_img_2:nth-of-type(6n) {
  226. margin-right: 0px;
  227. }
  228. .categ_li_img_2_hover_dot1 {
  229. width: 152px;
  230. position: absolute;
  231. left: 50%;
  232. margin-left: -76px;
  233. bottom: 13px;
  234. font-size: 14px;
  235. background: linear-gradient(to right, #FFE1AA, #F9F4E3, #FFE1AA);
  236. -webkit-background-clip: text;
  237. color: transparent;
  238. }
  239. .categ_li_img_2:hover .categ_li_img_2_dot2 {
  240. color: #A01C0E;
  241. }
  242. </style>
  243. <style lang="less" scoped>
  244. @media screen and (min-width:801px){/*pc*/
  245. .pc_none{display:none;}
  246. }
  247. @media screen and (max-width:800px){/*ipad_phone*/
  248. .categ_3_index{width:92%;margin:30px auto 0;}
  249. .shop_name_box .shop_name{height:33px;line-height:33px;}
  250. .shop_name_box .shop_name_box_a{height:33px;line-height:33px;font-size:14px;font-weight:normal;display:block;}
  251. .shop_name_box{overflow:hidden;border-bottom:1px solid #E6E6E6;}
  252. .shop_name_right{display:none;}
  253. .categ_ul_img_1{overflow:hidden; height:120vw;}
  254. .categ_li_img_1{width:48%;overflow:hidden;margin:0px auto 15px;
  255. .categ_li_img_1_img{width:100%;height:44vw;}
  256. .categ_li_img_1_dot2{width:100%;margin:2vw auto 0;
  257. font-size:4vw;line-height:5vw;height:10vw;}
  258. }
  259. .categ_li_img_1:nth-of-type(odd){float:left;}
  260. .categ_li_img_1:nth-of-type(even){float:right;}
  261. .categ_li_img_1:nth-of-type(n+5){display:none;}
  262. .categ_5_index{width:92%;margin:10px auto 0;}
  263. .categ_ul_img_2{height:120vw;}
  264. .categ_li_img_2{width:48%;overflow:hidden;margin:0px auto 15px;
  265. .categ_li_img_2_img{width:100%;height:44vw;}
  266. .categ_li_img_2_dot2{width:100%;margin:2vw auto 0;
  267. font-size:4vw;line-height:5vw;height:10vw;}
  268. }
  269. .categ_li_img_2:nth-of-type(odd){float:left;}
  270. .categ_li_img_2:nth-of-type(even){float:right;}
  271. .categ_li_img_2:nth-of-type(n+7){display:none;}
  272. .phone_none{display:none;}
  273. }
  274. </style>