detail_sec.vue 50 KB

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