detail_sec.vue 45 KB

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