detail.vue 51 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222
  1. <template>
  2. <!-- goods -->
  3. <div class="goods">
  4. <main class="index_main" v-if="shopType == 1">
  5. <div class="phone_nav_1 pc_none">
  6. <div class="phone_nav_in" >
  7. <NuxtLink class="phone_nav_a"
  8. v-for="(per_obj,per_index) in pageData_1" :key="per_index"
  9. :href="`/${per_obj.aLIas_pinyin}/index.html`"
  10. :title="per_obj.title">
  11. {{ per_obj.alias }}
  12. </NuxtLink>
  13. </div>
  14. </div>
  15. <section class="index_1 clearfix">
  16. <div class="breadcrumb phone_none">
  17. <div class="inner">
  18. <span class="location">当前位置:</span>
  19. <el-breadcrumb :separator-icon="ArrowRight">
  20. <el-breadcrumb-item>
  21. <NuxtLink to="/">首页</NuxtLink>
  22. </el-breadcrumb-item>
  23. <el-breadcrumb-item v-if="p_parent_name != ''">
  24. <NuxtLink :to="`/${targetSegment}/index.html`"> {{ p_parent_name }}</NuxtLink>
  25. </el-breadcrumb-item>
  26. <el-breadcrumb-item v-if="parent_name != ''">
  27. <NuxtLink :to="`/${targetSegment}/${targetSegment1}/index.html`"> {{ parent_name }}
  28. </NuxtLink>
  29. </el-breadcrumb-item>
  30. <el-breadcrumb-item>
  31. <NuxtLink :to="`/${targetSegment}/${targetSegment1}/${targetSegment2}/list-1.html`">
  32. {{ navTitle }}
  33. </NuxtLink>
  34. </el-breadcrumb-item>
  35. <el-breadcrumb-item>
  36. {{ routeNewsTtitle }}
  37. </el-breadcrumb-item>
  38. </el-breadcrumb>
  39. </div>
  40. </div>
  41. <div class="breadcrumb_box pc_none">
  42. <span class=" ">当前位置:</span>
  43. <NuxtLink to="/">首页</NuxtLink>
  44. <span class=" ">&gt;</span>
  45. <NuxtLink v-if="p_parent_name != ''" :to="`/${targetSegment}/index.html`">{{ p_parent_name }}</NuxtLink>
  46. <span class=" " v-if="p_parent_name != ''">&gt;</span>
  47. <NuxtLink v-if="parent_name != ''" :to="`/${targetSegment}/${targetSegment1}/index.html`"> {{ parent_name }}
  48. </NuxtLink>
  49. <span class=" " v-if="parent_name != ''">&gt;</span>
  50. <span class="">{{ routeNewsTtitle }}</span>
  51. </div>
  52. </section>
  53. <section class="index_2 clearfix">
  54. <img class="index_2_img" :src="shopImg" :title="newsDetail.name" alt="">
  55. <div class="index_2_left">
  56. <h4 class="index_2_h4 dot1">{{ newsDetail.name }}</h4>
  57. <div class="index_2_title_box clearfix">
  58. <time class="index_2_title"> 更新日期:{{ newsDetail.updated_at }}</time>
  59. <span class="index_2_title">浏览次数:{{ newsDetail.hits }}</span>
  60. </div>
  61. <div class="index_2_ul clearfix">
  62. <div class="index_2_li clearfix">
  63. <label class="index_2_li_label">公 司 名</label>
  64. <span class="index_2_li_text "> {{ newsDetail.com }}</span>
  65. </div>
  66. <div class="index_2_li clearfix">
  67. <label class="index_2_li_label">所 在 地</label>
  68. <span class="index_2_li_text ">{{ newsDetail.address }}</span>
  69. </div>
  70. <div class="index_2_li clearfix">
  71. <label class="index_2_li_label">联 系 人</label>
  72. <span class="index_2_li_text ">{{ newsDetail.contact }}</span>
  73. </div>
  74. <div class="index_2_li clearfix">
  75. <label class="index_2_li_label">产品单价</label>
  76. <span class="index_2_li_text">
  77. {{ newsDetail.price }}
  78. 元/
  79. {{ newsDetail.unit }}
  80. </span>
  81. </div>
  82. <div class="index_2_li clearfix">
  83. <label class="index_2_li_label">最小定量</label>
  84. <span class="index_2_li_text ">{{ newsDetail.min }}</span>
  85. </div>
  86. <div class="index_2_li clearfix">
  87. <label class="index_2_li_label">供货总量</label>
  88. <span class="index_2_li_text ">{{ newsDetail.max }}</span>
  89. </div>
  90. <div class="index_2_li clearfix">
  91. <label class="index_2_li_label">有 效 期</label>
  92. <span class="index_2_li_text ">{{ getValidityTime(newsDetail) }}</span>
  93. </div>
  94. </div>
  95. </div>
  96. </section>
  97. <!-- 选项卡1 -->
  98. <section class="index_3 clearfix phone_none">
  99. <div class="shop_head_1 clearfix">
  100. <div class="shop_head_1_name" :class="{ shop_head_1_name_only: supply_num == 1 }"
  101. @mouseover="supply_num = 1">详情信息</div>
  102. <div class="shop_head_1_name" :class="{ shop_head_1_name_only: supply_num == 2 }"
  103. @mouseover="supply_num = 2">联系方式</div>
  104. <div class="shop_head_1_name" :class="{ shop_head_1_name_only: supply_num == 3 }"
  105. @mouseover="supply_num = 3">图片展示</div>
  106. </div>
  107. <div class="card_out clearfix">
  108. <div class="card_1_box clearfix card_1_box_only" v-if="supply_num == 1" v-html="newsDetail.detail">
  109. </div>
  110. <div class="card_1_box clearfix card_1_box_only" v-if="supply_num == 2">
  111. <p class="supply_art_box_p">公司名称:{{ newsDetail.com }}</p>
  112. <p class="supply_art_box_p">电子邮箱:{{ newsDetail.email }}</p>
  113. <p class="supply_art_box_p">邮政编码:{{ newsDetail.postal }}</p>
  114. <p class="supply_art_box_p">联系地址:{{ newsDetail.address }}</p>
  115. </div>
  116. <div class="card_1_box clearfix card_1_box_only" v-if="supply_num == 3">
  117. <div class="supply_art_box_img">
  118. <img :src="item" v-for="item in newsDetail.imgurl">
  119. </div>
  120. </div>
  121. </div>
  122. </section>
  123. <div class="index_3 clearfix pc_none">
  124. <div class="phone_box_1_head">
  125. <a :class="{ a_choice_only: 1 == supply_num }"
  126. @mouseover="supply_num = 1">详情信息</a>
  127. <a :class="{ a_choice_only: 2 == supply_num }"
  128. @mouseover="supply_num = 2">联系方式</a>
  129. <a :class="{ a_choice_only: 3 == supply_num }"
  130. @mouseover="supply_num = 3">图片展示</a>
  131. </div>
  132. <div class=" pc_none">
  133. <!-- 详情信息 phone -->
  134. <div class="phone_box_1" v-show="supply_num == 1">
  135. <div class="phone_box_1_text" v-html="newsDetail.detail"></div>
  136. </div>
  137. <!-- 联系方式 phone -->
  138. <div class="phone_box_2 " v-show="supply_num == 2">
  139. <div class="phone_box_2_text">
  140. <div class="phone_box_2_li"><label class="phone_box_2_li_label">公司名称:</label> <span class="phone_box_2_li_text">{{ newsDetail.com }}</span></div>
  141. <div class="phone_box_2_li"><label class="phone_box_2_li_label">电子邮箱:</label> <span class="phone_box_2_li_text">{{ newsDetail.email }}</span></div>
  142. <div class="phone_box_2_li"><label class="phone_box_2_li_label">邮政编码:</label> <span class="phone_box_2_li_text">{{ newsDetail.postal }}</span></div>
  143. <div class="phone_box_2_li"><label class="phone_box_2_li_label">联系地址:</label> <span class="phone_box_2_li_text">{{ newsDetail.address }}</span></div>
  144. </div>
  145. </div>
  146. <!-- 图片展示 phone -->
  147. <div class="phone_box_5" v-show="supply_num == 3">
  148. <div class="phone_box_5_img_ul">
  149. <img :src="item" v-for="item in newsDetail.imgurl">
  150. </div>
  151. </div>
  152. </div>
  153. </div>
  154. <!-- 选项卡2 -->
  155. <section class="index_4 clearfix phone_none">
  156. <div class="box_1 clearfix">
  157. <div class="box_1_head">
  158. <div class="box_1_head_name">点击排行</div>
  159. </div>
  160. <div class="img_ul_1 clearfix">
  161. <div class="img_li_1 clearfix" v-for="(item, index) in pageData1" :key="index">
  162. <NuxtLink class="img_li_1_a" :href="getLinkPathDetail(item)" :title="item.title">
  163. <div class="img_li_1_img_box clearfix">
  164. <img class="img_li_1_img" :src="item.imgurl" :title="item.title" alt="">
  165. </div>
  166. <div class="img_li_1_dot2">{{ item.name }}
  167. </div>
  168. </NuxtLink>
  169. </div>
  170. </div>
  171. </div>
  172. <div class="box_1 clearfix">
  173. <div class="box_1_head">
  174. <div class="box_1_head_name">最新商机</div>
  175. </div>
  176. <div class="img_ul_1 clearfix">
  177. <div class="img_li_1 clearfix" v-for="(item, index) in pageData2" :key="index">
  178. <NuxtLink class="img_li_1_a" :href="getLinkPathDetail(item)" :title="item.title">
  179. <div class="img_li_1_img_box clearfix">
  180. <img class="img_li_1_img" :src="item.imgurl" :title="item.title" alt="">
  181. </div>
  182. <div class="img_li_1_dot2">{{ item.name }}
  183. </div>
  184. </NuxtLink>
  185. </div>
  186. </div>
  187. </div>
  188. </section>
  189. <div class="phone_3_box pc_none" >
  190. <div class="phone_head">
  191. <NuxtLink class="phone_head_a">
  192. 点击排行
  193. </NuxtLink>
  194. </div>
  195. <div class="phone_img_ul clearfix">
  196. <div class="phone_img_li clearfix" v-for="(item, index) in pageData1.slice(0,4)" :key="index">
  197. <NuxtLink class="phone_img_li_a" :href="getLinkPathDetail(item)" >
  198. <div class="phone_img_li_img_box clearfix">
  199. <img class="phone_img_li_img" :src="item.imgurl" :alt="item.name" >
  200. </div>
  201. <div class="phone_img_li_dot2 dot2">{{ item.name }}</div>
  202. </NuxtLink>
  203. </div>
  204. </div>
  205. </div>
  206. <div class="phone_4_box pc_none" >
  207. <div class="phone_head">
  208. <NuxtLink class="phone_head_a">
  209. 最新商机
  210. </NuxtLink>
  211. </div>
  212. <div class="phone_img_ul clearfix">
  213. <div class="phone_img_li clearfix" v-for="(item, index) in pageData2.slice(0,6)" :key="index">
  214. <NuxtLink class="phone_img_li_a" :href="getLinkPathDetail(item)" >
  215. <div class="phone_img_li_img_box clearfix">
  216. <img class="phone_img_li_img" :src="item.imgurl" :alt="item.name" >
  217. </div>
  218. <div class="phone_img_li_dot2 dot2">{{ item.name }}</div>
  219. </NuxtLink>
  220. </div>
  221. </div>
  222. </div>
  223. </main>
  224. <main class="index_main" v-if="shopType == 2">
  225. <div class="phone_nav_1 pc_none">
  226. <div class="phone_nav_in" >
  227. <NuxtLink class="phone_nav_a"
  228. v-for="(per_obj,per_index) in pageData_1" :key="per_index"
  229. :href="`/${per_obj.aLIas_pinyin}/index.html`"
  230. :title="per_obj.title">
  231. {{ per_obj.alias }}
  232. </NuxtLink>
  233. </div>
  234. </div>
  235. <section class=" clearfix">
  236. <div class="index_out_1_left clearfix">
  237. <section class="index_1 clearfix">
  238. <div class="breadcrumb phone_none">
  239. <div class="inner">
  240. <span class="location">当前位置 :</span>
  241. <el-breadcrumb :separator-icon="ArrowRight">
  242. <el-breadcrumb-item>
  243. <NuxtLink to="/">首页</NuxtLink>
  244. </el-breadcrumb-item>
  245. <el-breadcrumb-item v-if="p_parent_name != ''">
  246. <NuxtLink :to="`/${targetSegment}/index.html`"> {{ p_parent_name }}</NuxtLink>
  247. </el-breadcrumb-item>
  248. <el-breadcrumb-item v-if="parent_name != ''">
  249. <NuxtLink :to="`/${targetSegment}/${targetSegment1}/index.html`">
  250. {{ parent_name }}
  251. </NuxtLink>
  252. </el-breadcrumb-item>
  253. <el-breadcrumb-item>
  254. <NuxtLink :to="`/${targetSegment}/${targetSegment1}/${targetSegment2}/list-1.html`">
  255. {{ navTitle }}
  256. </NuxtLink>
  257. </el-breadcrumb-item>
  258. <el-breadcrumb-item>
  259. {{ routeNewsTtitle }}
  260. </el-breadcrumb-item>
  261. </el-breadcrumb>
  262. </div>
  263. </div>
  264. <div class="breadcrumb_box pc_none">
  265. <span class=" ">当前位置:</span>
  266. <NuxtLink to="/">首页</NuxtLink>
  267. <span class=" " v-if="p_parent_name != ''">&gt;</span>
  268. <NuxtLink v-if="p_parent_name != ''" :to="`/${targetSegment}/index.html`">{{ p_parent_name }}</NuxtLink>
  269. <span class=" " v-if="parent_name != ''">&gt;</span>
  270. <NuxtLink v-if="parent_name != ''" :to="`/${targetSegment}/${targetSegment1}/index.html`"> {{ parent_name }}
  271. </NuxtLink>
  272. <span class=" " >&gt;</span>
  273. <NuxtLink :to="`/${targetSegment}/${targetSegment1}/${targetSegment2}/list-1.html`"> {{ navTitle }}</NuxtLink>
  274. <span class=" " >&gt;</span>
  275. <span class="">{{ routeNewsTtitle }}</span>
  276. </div>
  277. </section>
  278. <section class="index_2 clearfix">
  279. <img class="index_2_img" :src="shopImg" :title="newsDetail.name" alt="">
  280. <div class="index_2_right">
  281. <h4 class="index_2_h4 dot1">求购:{{ newsDetail.name }}</h4>
  282. <div class="index_2_ul clearfix">
  283. <div class="index_2_li clearfix">
  284. <label class="index_2_li_label">发布日期</label>
  285. <span class="index_2_li_text">{{ getTime(newsDetail.updated_at, 'year', 1) }}</span>
  286. </div>
  287. <div class="index_2_li clearfix">
  288. <label class="index_2_li_label">截止日期</label>
  289. <span class="index_2_li_text">{{ getTime(newsDetail.validity, 'year', 1) }}</span>
  290. </div>
  291. <div class="index_2_li clearfix">
  292. <label class="index_2_li_label">浏览次数</label>
  293. <span class="index_2_li_text">{{ newsDetail.hits }}</span>
  294. </div>
  295. <div class="index_2_li clearfix">
  296. <label class="index_2_li_label">联 系 人</label>
  297. <span class="index_2_li_text">{{ newsDetail.contact }}</span>
  298. </div>
  299. <div class="index_2_li clearfix">
  300. <label class="index_2_li_label">发布地区</label>
  301. <span class="index_2_li_text">{{ newsDetail.address }}</span>
  302. </div>
  303. <div class="index_2_li clearfix">
  304. <label class="index_2_li_label">座 机</label>
  305. <span class="index_2_li_text">{{ newsDetail.landline }}</span>
  306. </div>
  307. <div class="index_2_li clearfix">
  308. <label class="index_2_li_label">联系电话</label>
  309. <span class="index_2_li_text">{{ newsDetail.phone }}</span>
  310. </div>
  311. </div>
  312. </div>
  313. </section>
  314. </div>
  315. <div class="shop_3_right clearfix phone_none">
  316. <div class="choice_1_box clearfix">
  317. <div class="choice_1_btn_box clearfix">
  318. <div class="choice_1_btn" :class="{ choice_1_btn_only: supply_buy == 1 }"
  319. @mouseover="supply_buy = 1">
  320. <span class="choice_1_btn_a" title="供应商品">供应商品</span>
  321. </div>
  322. <div class="choice_1_btn " :class="{ choice_1_btn_only: supply_buy == 2 }"
  323. @mouseover="supply_buy = 2">
  324. <a class="choice_1_btn_a" title="求购商品">求购商品</a>
  325. </div>
  326. </div>
  327. <div class="choice_1_card_box">
  328. <!-- 供应商品 -->
  329. <div class="shop_ul_img_2 choice_1_card clearfix" v-show="supply_buy == 1">
  330. <div class="shop_li_img_2" v-for="(item, index) in pageData3" :key="index">
  331. <NuxtLink class="shop_li_img_2_a" :href="getLinkPathDetail(item)"
  332. :title="item.name">
  333. <div class="shop_li_img_2_num"> {{ index + 1 }} </div>
  334. <div class="shop_li_img_2_right clearfix">
  335. <img class="shop_li_img_2_img" :src="item.imgurl" :title="item.name" alt="">
  336. <div class="shop_li_img_2_text">
  337. {{ item.name }}
  338. </div>
  339. </div>
  340. </NuxtLink>
  341. </div>
  342. </div>
  343. <!-- 供应商品 -->
  344. <!-- 求购商品 -->
  345. <div class="shop_ul_img_2 choice_1_card clearfix" v-show="supply_buy == 2">
  346. <div class="shop_li_img_2" v-for="(item, index) in pageData4" :key="index">
  347. <NuxtLink class="shop_li_img_2_a" :href="getLinkPathDetail(item)"
  348. :title="item.name">
  349. <div class="shop_li_img_2_num"> {{ index + 1 }} </div>
  350. <div class="shop_li_img_2_right clearfix">
  351. <img class="shop_li_img_2_img" :src="item.imgurl" :title="item.name" alt="">
  352. <div class="shop_li_img_2_text">
  353. {{ item.name }}
  354. </div>
  355. </div>
  356. </NuxtLink>
  357. </div>
  358. </div>
  359. <!-- 求购商品 -->
  360. </div>
  361. </div>
  362. </div>
  363. </section>
  364. <!-- 选项卡1 -->
  365. <section class="index_3 clearfix phone_none">
  366. <div class="shop_head_1 clearfix">
  367. <div class="shop_head_1_name" :class="{ shop_head_1_name_only: buy_num == 1 }"
  368. @mouseover="buy_num = 1">详情信息</div>
  369. <div class="shop_head_1_name" :class="{ shop_head_1_name_only: buy_num == 2 }"
  370. @mouseover="buy_num = 2">发布人信息</div>
  371. </div>
  372. <div class="card_out clearfix">
  373. <div class="card_1_box clearfix card_1_box_only" v-show="buy_num == 1" v-html="newsDetail.detail">
  374. </div>
  375. <div class="card_1_box clearfix card_1_box_only" v-show="buy_num == 2">
  376. <P>公司名称:{{ newsDetail.com }}</P>
  377. <P>电子邮箱:{{ newsDetail.email }}</P>
  378. <P>邮政编码:{{ newsDetail.postal }}</P>
  379. <P>联系地址:{{ newsDetail.address }}</P>
  380. </div>
  381. </div>
  382. </section>
  383. <div class="index_3 clearfix pc_none">
  384. <div class="phone_box_1_head">
  385. <a :class="{ a_choice_only: 1 == buy_num }"
  386. @mouseover="buy_num = 1">详情信息</a>
  387. <a :class="{ a_choice_only: 2 == buy_num }"
  388. @mouseover="buy_num = 2">发布人信息</a>
  389. </div>
  390. <div class="">
  391. <!-- 详情信息 phone -->
  392. <div class="phone_box_1" v-show="buy_num == 1">
  393. <div class="phone_box_1_text" v-html="newsDetail.detail"></div>
  394. </div>
  395. <!-- 发布人信息 phone -->
  396. <div class="phone_box_2 " v-show="buy_num == 2">
  397. <div class="phone_box_2_text">
  398. <div class="phone_box_2_li"><label class="phone_box_2_li_label">公司名称:</label> <span class="phone_box_2_li_text">{{ newsDetail.com }}</span></div>
  399. <div class="phone_box_2_li"><label class="phone_box_2_li_label">电子邮箱:</label> <span class="phone_box_2_li_text">{{ newsDetail.email }}</span></div>
  400. <div class="phone_box_2_li"><label class="phone_box_2_li_label">邮政编码:</label> <span class="phone_box_2_li_text">{{ newsDetail.postal }}</span></div>
  401. <div class="phone_box_2_li"><label class="phone_box_2_li_label">联系地址:</label> <span class="phone_box_2_li_text">{{ newsDetail.address }}</span></div>
  402. </div>
  403. </div>
  404. </div>
  405. </div>
  406. <!-- 选项卡2 -->
  407. <section class="index_4 clearfix phone_none">
  408. <div class="box_1 clearfix">
  409. <div class="box_1_head">
  410. <div class="box_1_head_name">点击排行</div>
  411. </div>
  412. <div class="img_ul_1 clearfix">
  413. <div class="img_li_1 clearfix" v-for="(item, index) in pageData1" :key="index">
  414. <NuxtLink class="img_li_1_a" :href="getLinkPathDetail(item)" :title="item.title">
  415. <div class="img_li_1_img_box clearfix">
  416. <img class="img_li_1_img" :src="item.imgurl" :title="item.title" alt="">
  417. </div>
  418. <div class="img_li_1_dot2">{{ item.name }}
  419. </div>
  420. </NuxtLink>
  421. </div>
  422. </div>
  423. </div>
  424. <div class="box_1 clearfix">
  425. <div class="box_1_head">
  426. <div class="box_1_head_name">最新商机</div>
  427. </div>
  428. <div class="img_ul_1 clearfix">
  429. <div class="img_li_1 clearfix" v-for="(item, index) in pageData2" :key="index">
  430. <NuxtLink class="img_li_1_a" :href="getLinkPathDetail(item)" :title="item.title">
  431. <div class="img_li_1_img_box clearfix">
  432. <img class="img_li_1_img" :src="item.imgurl" :title="item.title" alt="">
  433. </div>
  434. <div class="img_li_1_dot2">{{ item.name }}
  435. </div>
  436. </NuxtLink>
  437. </div>
  438. </div>
  439. </div>
  440. </section>
  441. <div class="phone_3_box pc_none" >
  442. <div class="phone_head">
  443. <NuxtLink class="phone_head_a">
  444. 点击排行
  445. </NuxtLink>
  446. </div>
  447. <div class="phone_img_ul clearfix">
  448. <div class="phone_img_li clearfix" v-for="(item, index) in pageData1.slice(0,4)" :key="index">
  449. <NuxtLink class="phone_img_li_a" :href="getLinkPathDetail(item)" >
  450. <div class="phone_img_li_img_box clearfix">
  451. <img class="phone_img_li_img" :src="item.imgurl" :alt="item.name" >
  452. </div>
  453. <div class="phone_img_li_dot2 dot2">{{ item.name }}</div>
  454. </NuxtLink>
  455. </div>
  456. </div>
  457. </div>
  458. <div class="phone_4_box pc_none" >
  459. <div class="phone_head">
  460. <NuxtLink class="phone_head_a">
  461. 最新商机
  462. </NuxtLink>
  463. </div>
  464. <div class="phone_img_ul clearfix">
  465. <div class="phone_img_li clearfix" v-for="(item, index) in pageData2.slice(0,6)" :key="index">
  466. <NuxtLink class="phone_img_li_a" :href="getLinkPathDetail(item)" >
  467. <div class="phone_img_li_img_box clearfix">
  468. <img class="phone_img_li_img" :src="item.imgurl" :alt="item.name" >
  469. </div>
  470. <div class="phone_img_li_dot2 dot2">{{ item.name }}</div>
  471. </NuxtLink>
  472. </div>
  473. </div>
  474. </div>
  475. </main>
  476. </div>
  477. </template>
  478. <script setup>
  479. //0.页面依赖 start ---------------------------------------->
  480. import { onMounted, ref } from 'vue'
  481. import { ElBreadcrumb, ElBreadcrumbItem, ElRadio, ElRadioGroup, ElCheckbox, ElCheckboxGroup, ElMessage, ElInput } from 'element-plus'
  482. import { ArrowRight } from '@element-plus/icons-vue'
  483. //0.页面依赖 end ---------------------------------------->
  484. //1.获得路由id start ---------------------------------------->
  485. const route = useRoute();
  486. const articleId = parseInt(route.params.id);
  487. const targetSegment = getRoutePath(1);
  488. const targetSegment1 = getRoutePath(2);
  489. const targetSegment2 = getRoutePath(3);
  490. const supply_num = ref(1)
  491. const buy_num = ref(1)
  492. const supply_buy = ref(1)
  493. //1.1 获得当前的路由id
  494. let routeId;
  495. let routeType;
  496. let navTitle = ref('')//二级导航标题
  497. let navCid = ref('')//二级导航id
  498. //通过导航路径反向查询导航id
  499. const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
  500. method: 'GET',
  501. query: {
  502. 'pinyin': targetSegment + '/' + targetSegment1 + '/' + targetSegment2,
  503. },
  504. });
  505. console.log("getRouteId", getRouteId);
  506. if (getRouteId.code == 200) {
  507. navTitle.value = getRouteId.data.alias
  508. navCid.value = getRouteId.data.category_id
  509. } else {
  510. console.log("获得路由id出错!", getRouteId.message)
  511. }
  512. //1.2 获取二级栏目
  513. let parent_name = ref('');//父级名称
  514. let parent_id = ref('');//父级id
  515. let parent_pinyin = ref('');//父级拼音
  516. const getRoutePName = await requestDataPromise('/web/getWebsiteRoute', {
  517. method: 'GET',
  518. query: {
  519. 'pinyin': targetSegment + '/' + targetSegment1,
  520. },
  521. });
  522. console.log("getRoutePName", getRoutePName);
  523. if (getRoutePName.code == 200) {
  524. routeId = getRoutePName.data.category_id
  525. parent_id.value = getRoutePName.data.category_id
  526. parent_name.value = getRoutePName.data.alias
  527. routeType = getRoutePName.data.type
  528. } else {
  529. console.log("获得路由id出错!", getRoutePName.message)
  530. }
  531. //1.3 获取一级栏目
  532. let p_parent_name = ref('');//父级名称
  533. let p_parent_id = ref('');//父级id
  534. let p_parent_pinyin = ref('');//父级拼音
  535. const getRoutePName_parent = await requestDataPromise('/web/getWebsiteRoute', {
  536. method: 'GET',
  537. query: {
  538. 'pinyin': targetSegment,
  539. },
  540. });
  541. console.log("getRoutePName_parent", getRoutePName_parent);
  542. if (getRoutePName_parent.code == 200) {
  543. p_parent_id.value = getRoutePName_parent.data.category_id
  544. p_parent_name.value = getRoutePName_parent.data.alias
  545. // p_parent_pinyin.value = getRoutePName_parent.data.aLIas_pinyin
  546. } else {
  547. console.log("获得路由id出错!", getRoutePName_parent.message)
  548. }
  549. //1.4 获取某个栏目
  550. const getParentId = await requestDataPromise('/web/getOneWebsiteCategory', {
  551. method: 'GET',
  552. query: {
  553. 'catid': parent_id.value,
  554. },
  555. });
  556. console.log("getParentId", getParentId);
  557. if (getParentId.code == 200) {
  558. parent_pinyin.value = getParentId.data.aLIas_pinyin
  559. } else {
  560. console.log("获得路由id出错!", getParentId.message)
  561. }
  562. //1.5是否展示有效期
  563. const getValidityTime = (shopData) => {
  564. if (shopData.islong == 1) {
  565. return "无期限"
  566. } else {
  567. if (shopData.validity) {
  568. return shopData.validity.split(' ')[0];
  569. }
  570. }
  571. }
  572. //1.获得路由id end ---------------------------------------->
  573. //2.获得模块数据 start ---------------------------------------->
  574. const pageData1 = ref([])//点击排行
  575. const pageData2 = ref([])//最新商机
  576. const pageData3 = ref([])//供应商品
  577. const pageData4 = ref([])//求购商品
  578. //创建请求数据json
  579. let getJson = [
  580. { "level": "3,0,8" },//点击排行
  581. { "level": "4,0,8" },//最新商机
  582. { "level": "5,0,6" },//供应商品
  583. { "level": "6,0,6" },//求购商品
  584. ]
  585. let jsonString = JSON.stringify(getJson)
  586. //获取所有数据
  587. async function getPageAllData() {
  588. const mkdata = await requestDataPromise('/web/getWebsiteshop', {
  589. method: 'GET',
  590. query: {
  591. 'id': jsonString,
  592. 'catid': 713,
  593. },
  594. });
  595. if (mkdata.code == 200) {
  596. //点击排行
  597. pageData1.value = mkdata.data.goods[0];
  598. //最新商机
  599. pageData2.value = mkdata.data.goods[1];
  600. //供应商品
  601. pageData3.value = mkdata.data.goods[2];
  602. //求购商品
  603. pageData4.value = mkdata.data.goods[3];
  604. } else {
  605. ElMessage.error(mkdata.message)
  606. }
  607. }
  608. getPageAllData();
  609. //2.获得模块数据 end ---------------------------------------->
  610. //4.新闻详情 start ---------------------------------------->
  611. //4.1 资讯详情
  612. const newsDetail = ref({})
  613. const routeNewsTtitle = ref("");
  614. //4.2 发布日期
  615. const time = ref("");
  616. //4.3 路径
  617. const routLevelTitle = ref("");
  618. const routLevelId = ref("");
  619. //4.4 是否展示投票
  620. const articleChoice = ref(false);
  621. //4.5 获取详情
  622. let shopImg = ref('')
  623. let shopType = ref(1)
  624. let seoTitle;
  625. let seoDescription;
  626. let seoKeywords;
  627. const mkdata = await requestDataPromise('/web/getWebsiteshopInfo', {
  628. method: 'GET',
  629. query: {
  630. 'id': articleId
  631. },
  632. });
  633. if (mkdata.code == 200) {
  634. //获取内容
  635. newsDetail.value = mkdata.data;
  636. shopType.value = mkdata.data.type_id
  637. //获取路径
  638. routLevelTitle.value = newsDetail.value.cat_name;
  639. routLevelId.value = newsDetail.value.category_id;
  640. shopImg.value = mkdata.data.imgurl[0]
  641. //获取发布时间
  642. if (newsDetail.value.updated_at) {
  643. time.value = newsDetail.value.updated_at.split(' ')[0];
  644. }
  645. //修正标题长度
  646. if (newsDetail.value.name.length >= 20) {
  647. routeNewsTtitle.value = newsDetail.value.name.substr(0, 20) + "...";
  648. } else {
  649. routeNewsTtitle.value = newsDetail.value.name
  650. }
  651. seoTitle = newsDetail.value.name;
  652. seoDescription = newsDetail.value.description;
  653. seoKeywords = newsDetail.value.keyword;
  654. } else {
  655. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  656. // console.log("错误位置:获取详情内容")
  657. // console.log("后端错误反馈:", mkdata.message)
  658. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  659. }
  660. //4.新闻详情 end ---------------------------------------->
  661. //5.设置seo信息 start---------------------------------------->
  662. const setData = await requestDataPromise('/web/getWebsiteCategoryHead', {
  663. method: 'GET',
  664. query: {
  665. 'catid': parent_id.value
  666. },
  667. });
  668. if (setData.code == 200) {
  669. let seoSuffix = setData.data.suffix;
  670. let seoName = setData.data.website_name;
  671. useSeoMeta({
  672. title: seoTitle + "_" + seoName + "_" + seoSuffix,
  673. meta: [
  674. { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
  675. { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
  676. ]
  677. });
  678. } else {
  679. console.log("设置频道页SEO出错!", setData.message)
  680. }
  681. //5.设置seo信息 end---------------------------------------->
  682. //8.页面图片放大 start---------------------------------------->
  683. const previewVisible = ref(false)
  684. const selectedImage = ref(' ')
  685. const openPreview = (event) => {
  686. if (event.target.tagName === 'IMG') {
  687. selectedImage.value = event.target.src;
  688. previewVisible.value = true;
  689. }
  690. }
  691. const closePreview = () => {
  692. previewVisible.value = false;
  693. }
  694. //8.页面图片放大 end---------------------------------------->
  695. const pageData_1 = ref([])
  696. let routeId_1;
  697. //通过导航路径反向查询导航id
  698. const getRouteId_1 = await requestDataPromise('/web/getWebsiteRoute', {
  699. method: 'GET',
  700. query: {
  701. 'pinyin': targetSegment ,
  702. },
  703. });
  704. if (getRouteId_1.code == 200) {
  705. routeId_1 = getRouteId_1.data.category_id
  706. } else {
  707. console.log("获得路由id出错!", getRouteId_1.message)
  708. }
  709. //4.1 获取所有导航1
  710. try {
  711. const navigateData_1 = await requestDataPromise('/web/getWebsiteModelCategory', {
  712. method: 'GET',
  713. query: {
  714. 'placeid': 1,
  715. 'pid': routeId_1,
  716. 'num': 8,
  717. 'type': 1
  718. },
  719. });
  720. if (navigateData_1.code == 200) {
  721. // 遍历可用的导航池放到页面中
  722. for (let index in navigateData_1.data) {
  723. let data = {
  724. title: navigateData_1.data[index].name,
  725. cid: navigateData_1.data[index].category_id,
  726. children_count: navigateData_1.data[index].children_count,
  727. alias: navigateData_1.data[index].alias,
  728. aLIas_pinyin: targetSegment + "/" + navigateData_1.data[index].aLIas_pinyin,
  729. children: navigateData_1.data[index].children,
  730. type: navigateData_1.data[index].type,
  731. pinyin: navigateData_1.data[index].aLIas_pinyin,
  732. data: [],
  733. data1: [],
  734. data2: [],
  735. data3: [],
  736. data4: [],
  737. category_id1: "",
  738. category_id2: "",
  739. category_id3: "",
  740. category_id4: "",
  741. title1: "",
  742. title2: "",
  743. title3: "",
  744. title4: ""
  745. };
  746. if (navigateData_1.data[index].is_url == 1) {
  747. // 处理 URL 的逻辑
  748. } else {
  749. if (navigateData_1.data[index].type == 2) {
  750. } else if (navigateData_1.data[index].type == 1) {
  751. }
  752. //每个页面最多8个模块
  753. pageData_1.value.push(data);
  754. }
  755. }
  756. // console.log("导航池11111goods", goodsData.value);
  757. // console.log("导航池11111newsData", newsData.value);
  758. //导航池加载完毕,开始申请模块数据
  759. let getJson = [
  760. // { "parent": routeId + ",0,0", "child": newsData.value[0].cid + ",5,9" },//模块1
  761. // { "parent": routeId + ",0,0", "child": newsData.value[1].cid + ",1,6" },//模块2
  762. // { "parent": routeId + ",0,0", "child": newsData.value[2].cid + ",1,6" },//模块3
  763. // { "parent": routeId + ",0,0", "child": newsData.value[3].cid + ",1,6" },//模块4
  764. ]
  765. for (let i = 0; i < newsData.value.length; i++) {
  766. if (i == 0) {
  767. getJson.push({ "parent": routeId + ",0,0", "child": newsData.value[0].cid + ",3,9" })
  768. } else if (i == 1) {
  769. getJson.push({ "parent": routeId + ",0,0", "child": newsData.value[1].cid + ",1,2" })
  770. } else if (i == 2) {
  771. getJson.push({ "parent": routeId + ",0,0", "child": newsData.value[2].cid + ",1,6" })
  772. } else if (i == 3) {
  773. getJson.push({ "parent": routeId + ",0,0", "child": newsData.value[3].cid + ",2,4" })
  774. }
  775. }
  776. let jsonString = JSON.stringify(getJson);
  777. if (newsData.value.length > 0) {
  778. getPageAllData(jsonString);
  779. }
  780. let goodsJson = [
  781. // { "catid": goodsData.value[0].cid + ",0,12" },//模块1
  782. // { "catid": goodsData.value[1].cid + ",0,4" },//模块2
  783. // { "catid": goodsData.value[2].cid + ",0,4" },//模块3
  784. ]
  785. for (let i = 0; i < goodsData.value.length; i++) {
  786. if (i == 0) {
  787. goodsJson.push({ "catid": goodsData.value[0].cid + ",0,12" });
  788. } else if (i == 1) {
  789. goodsJson.push({ "catid": goodsData.value[1].cid + ",0,4" });
  790. } else if (i == 2) {
  791. goodsJson.push({ "catid": goodsData.value[2].cid + ",0,4" });
  792. }
  793. }
  794. let goodsJsonString = JSON.stringify(goodsJson);
  795. getPageGoodsAllData(goodsJsonString);
  796. } else {
  797. console.log("错误:渲染8个模块环节出错,请检查是否存在没有数据的模块!")
  798. }
  799. } catch (error) {
  800. console.log("错误:导航池渲染执行接口出错!请检查频道页渲染的模块数据是否完整!")
  801. }
  802. // 延迟器-2个导航的定位
  803. const delayTimer_2 = ref(null);
  804. onMounted(() => {
  805. delayTimer_2.value = setTimeout(() => {
  806. let the_1_index = ref(null);
  807. if(targetSegment1){
  808. pageData_1.value.forEach((item, index) => {
  809. if(item.pinyin == targetSegment1){
  810. the_1_index.value = index;
  811. }
  812. })
  813. if(the_1_index.value != null){
  814. document.querySelectorAll('.phone_nav_in .phone_nav_a')[the_1_index.value].classList.add("router-link-active","router-link-exact-active")
  815. }
  816. }
  817. }, 999);
  818. })
  819. </script>
  820. <style lang="less" scoped>
  821. @import url('@/assets/css/shop/goodsDetail.less');
  822. @import url('@/assets/css/shop/goodsDetail1.less');
  823. </style>
  824. <style lang="less" scoped>
  825. @media screen and (min-width:801px){/*pc*/
  826. .pc_none{display:none;}
  827. }
  828. @media screen and (max-width:800px){/*ipad_phone*/
  829. .goods{width:100%;margin-bottom:0px;}
  830. .index_main{width:100%;margin-bottom:0px;}
  831. .index_out_1_left{
  832. width:100%;float:none;
  833. }
  834. .breadcrumb_box{
  835. height:22px;width:100%;margin:10px auto;
  836. word-break: keep-all; white-space: nowrap;overflow:hidden;text-overflow:ellipsis;
  837. width:92%;
  838. font-size:14px;
  839. color:#666;
  840. *{
  841. font-size:14px;
  842. display:inline ;
  843. color:#666;
  844. line-height:22px;height:22px;
  845. margin-right:5px;
  846. }
  847. }
  848. .index_2{width:92%;margin:0px auto 0px;}
  849. .index_2_img{width:auto;max-width:100%;height:302px;margin:0px auto 0px;float:none;display:block;border-radius:8px;}
  850. .index_2_h4{font-size:16px;line-height:26px;margin-top:11px;border:0px;padding-bottom:0px;}
  851. .index_2_title{font-size:14px;margin-right:10px;}
  852. .index_2_right{width:100%;margin:0px auto 0px;float:none;
  853. .index_2_li{margin-bottom:20px;width:49%; }
  854. .index_2_li:nth-of-type(odd){float:left;}
  855. .index_2_li:nth-of-type(even){float:right;}
  856. .index_2_li:nth-of-type(5){width:100%; }
  857. .index_2_li .index_2_li_label{line-height:18px;height:18px;font-size:14px;
  858. min-width:auto;margin-right:8px;}
  859. .index_2_li .index_2_li_text{line-height:18px;height:18px;font-size:14px;flex:1;
  860. word-break: keep-all; white-space: nowrap;overflow:hidden;text-overflow:ellipsis;
  861. }
  862. .index_2_li:nth-of-type(5) .index_2_li_text{ height:auto;
  863. word-wrap: break-word;
  864. overflow-wrap: break-word;
  865. white-space: pre-wrap;
  866. word-break: break-all;
  867. }
  868. }
  869. .index_2_left{width:100%;margin:0px auto 0px;float:none;
  870. .index_2_li{margin-bottom:20px;width:49%; }
  871. .index_2_li:nth-of-type(odd){float:left;}
  872. .index_2_li:nth-of-type(even){float:right;}
  873. .index_2_li:nth-of-type(-n+2){width:100%;}
  874. .index_2_li .index_2_li_label{line-height:18px;height:18px;font-size:14px;
  875. min-width:auto;margin-right:8px;}
  876. .index_2_li .index_2_li_text{line-height:18px;font-size:14px;flex:1;
  877. word-wrap: break-word;
  878. overflow-wrap: break-word;
  879. white-space: pre-wrap;
  880. word-break: break-all;
  881. }
  882. .index_2_li:nth-of-type(n+3) .index_2_li_text{ height:18px;
  883. word-break: keep-all; white-space: nowrap;overflow:hidden;text-overflow:ellipsis;
  884. }
  885. }
  886. .index_3{width:92%;margin:0px auto 0px;}
  887. .phone_box_1_head{
  888. width:100%;margin:0px auto 0px;
  889. height:50px;line-height:50px;
  890. background:#fff;border-bottom:1px solid #E6E6E6;
  891. a{
  892. float:left;height:50px;line-height:50px;margin:0;position:relative;
  893. color:#333;font-size:15px; font-weight:bold;box-sizing:border-box;
  894. position:relative;padding-left:30px;
  895. }
  896. a.a_choice_only{
  897. color:#255590;
  898. }
  899. a:nth-child(1){
  900. background: url(@/public/shop/01.png) no-repeat left center;
  901. background-size: 8px 12px;
  902. padding-left:15px;
  903. }
  904. }
  905. .phone_box_1{
  906. margin:0px auto 0px;
  907. .phone_box_1_text *,.phone_box_1_text{
  908. font-size:16px!important;line-height:26px!important;margin-top:15px!important;
  909. }
  910. .phone_box_1_text /deep/img{
  911. max-width:100%;
  912. }
  913. }
  914. .phone_box_2{
  915. margin:0px auto 0px;
  916. .phone_box_2_text{
  917. margin-top:15px;
  918. p{
  919. display:block;font-size:16px;line-height:26px;margin-top:5px;
  920. }
  921. }
  922. .phone_box_2_li{
  923. display:flex;margin-bottom:10px;
  924. }
  925. .phone_box_2_li_label{
  926. line-height:24px;height:24px;font-size:16px;
  927. margin-right:8px;
  928. }
  929. .phone_box_2_li_text{
  930. line-height:24px;font-size:16px;flex:1;
  931. word-wrap: break-word;
  932. overflow-wrap: break-word;
  933. white-space: pre-wrap;
  934. word-break: break-all;
  935. }
  936. }
  937. .phone_3_box{
  938. width:94%;margin:30px auto 30px;border:solid 1px #ddd; min-height:498px;
  939. .phone_head{height:33px;background:#f8f8f8;border-bottom:solid 1px #ddd;}
  940. .phone_head_a{float:left;height:100%;line-height:33px;font-size:14px;font-weight:bold;
  941. color:#255590;margin-left:10px;}
  942. .phone_img_ul{margin:15px auto 0px;width:96%;}
  943. .phone_img_li{width:49%;margin-bottom:15px;}
  944. .phone_img_li:nth-of-type(odd){float:left;}
  945. .phone_img_li:nth-of-type(even){float:right;}
  946. .phone_img_li_a{display:block;width:100%;}
  947. .phone_img_li_img_box{width:100%;}
  948. .phone_img_li_img{display:block;width:100%;height:44vw;}
  949. .phone_img_li_dot2{text-align:center;height:10vw;line-height:5vw;
  950. color:#333;font-size:4vw;width:100%;
  951. margin-top:6px;
  952. }
  953. }
  954. .phone_4_box{
  955. width:94%;margin:30px auto 30px;border:solid 1px #ddd; min-height:670px;
  956. .phone_head{height:33px;background:#f8f8f8;border-bottom:solid 1px #ddd;}
  957. .phone_head_a{float:left;height:100%;line-height:33px;font-size:14px;font-weight:bold;
  958. color:#255590;margin-left:10px;}
  959. .phone_img_ul{margin:15px auto 0px;width:96%;}
  960. .phone_img_li{width:49%;margin-bottom:15px;}
  961. .phone_img_li:nth-of-type(odd){float:left;}
  962. .phone_img_li:nth-of-type(even){float:right;}
  963. .phone_img_li_a{display:block;width:100%;}
  964. .phone_img_li_img_box{width:100%;}
  965. .phone_img_li_img{display:block;width:100%;height:44vw;}
  966. .phone_img_li_dot2{text-align:center;height:10vw;line-height:5vw;
  967. color:#333;font-size:4vw;width:100%;
  968. margin-top:6px;
  969. }
  970. }
  971. .phone_box_5{
  972. // 图片展示
  973. margin:0px auto 0px;
  974. .phone_box_5_img_ul{
  975. img{
  976. display:block;
  977. margin-top:15px;
  978. width:100%;
  979. }
  980. }
  981. }
  982. .phone_nav_1{
  983. width:100%; box-sizing:border-box;background:#fafafa;
  984. margin:10px auto;height:33px;
  985. .phone_nav_in{ width:92%;margin:0px auto;
  986. overflow-x:auto;overflow-y:hidden;
  987. word-break: keep-all; white-space: nowrap;
  988. line-height:33px;
  989. height:33px;
  990. }
  991. .phone_nav_in::-webkit-scrollbar{height:0px;}
  992. .phone_nav_a{display:inline-block;line-height:33px;height:33px;
  993. color:#333;font-size:14px;margin:0px 10px;
  994. }
  995. .phone_nav_a:nth-of-type(1){margin-left:0px;}
  996. }
  997. .phone_nav_a.router-link-active{
  998. color:#255590;
  999. }
  1000. .shop_3_right{display:none;}
  1001. .phone_none{display:none;}
  1002. }
  1003. </style>