detail.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661
  1. <template>
  2. <view class="content">
  3. <view class="top">
  4. <u-navbar title=" " @leftClick="leftClick" height="44px" bgColor="rgb(255,255,255,0)" :placeholder="true">
  5. </u-navbar>
  6. <view class="hflex acenter jbetween">
  7. <view >
  8. <view class="top_name">{{pageData.name}}</view>
  9. <view class="scale">{{pageData.num_staff}}人</view>
  10. </view>
  11. <image :src="pageData.head_img" mode="aspectFill" class="top_avatar"></image>
  12. </view>
  13. </view>
  14. <view class="box">
  15. <view class="hflex acenter jcenter tabs">
  16. <view class="tabs_item" :class="tab_active == 1 ? 'tab_active' :''" @click="changeTab(1)">公司信息</view>
  17. <view class="tabs_item" :class="tab_active == 2 ? 'tab_active' :''" @click="changeTab(2)">职位信息</view>
  18. </view>
  19. <view class="box1" v-if="tab_active == 1">
  20. <view class="title cell">船厂简介</view>
  21. <view class="cell">
  22. <u-read-more closeText="展开" :shadowStyle="shadowStyle" ref="uReadMore" :toggle="true" openText="收起" showHeight="66" backgroundImage="none">
  23. <u-parse :content="pageData.intro" @load="load"></u-parse>
  24. </u-read-more>
  25. </view>
  26. <view class="title cell">船厂地址</view>
  27. <view class="cell">
  28. <view class="text">{{pageData.address}}</view>
  29. </view>
  30. <view class="title cell">船厂环境</view>
  31. <view class="cell">
  32. <block v-for="(item,index) in pageData.environment_imgs" :key="index">
  33. <image :src="item" mode="aspectFill" class="img"></image>
  34. </block>
  35. </view>
  36. <view class="title cell">产品介绍</view>
  37. <view class="cell">
  38. <view class="text">{{pageData.product_intro}}</view>
  39. </view>
  40. </view>
  41. <view class="list" v-if="tab_active == 2">
  42. <block v-for="(item,index) in pageList.position" :key="index">
  43. <view class="list_item">
  44. <view class="hflex acenter jbetween">
  45. <view class="item_title">{{item.job_name}}</view>
  46. <view class="item_blue">{{item.salary}}·{{item.salary_month}}薪</view>
  47. </view>
  48. <view class="hflex acenter" style="padding: 20rpx 0 24rpx;">
  49. <block v-for="(item2,index2) in item.tags" :key="index2">
  50. <view class="item_box">{{item2}}</view>
  51. </block>
  52. <!-- <view class="item_box">{{item.education}}</view>
  53. <view class="item_box">{{item.experience}}</view> -->
  54. </view>
  55. <view class="item_name">{{item.com_name}}</view>
  56. <view class="hflex acenter jbetween" style="padding-top: 16rpx;">
  57. <view class="hflex acenter">
  58. <image class="item_avatar" :src="item.pub_user_avatar"></image>
  59. <view class="user_name">{{item.pub_user_job}}·{{item.pub_user}}</view>
  60. </view>
  61. <view class="user_right">{{item.job_addr}}</view>
  62. </view>
  63. </view>
  64. </block>
  65. </view>
  66. </view>
  67. <view class="bottom hflex acenter jbetween">
  68. <view class="vflex acenter" @click="collect">
  69. <u-icon name="star" color="#444444" size="20" v-if="!pageData.is_fav"></u-icon>
  70. <u-icon name="star-fill" color="#506DFF" size="20" v-else></u-icon>
  71. <view class="text_style1">收藏</view>
  72. </view>
  73. <view class="vflex acenter" @click="share('Poster1')">
  74. <image src="https://ship-expert.zhousi.hdlkeji.com/common/share.png" mode="" class="bottom_img"></image>
  75. <view class="text_style1">分享</view>
  76. </view>
  77. <view class="bottom_btn" @click="into_chatroom">私信聊聊</view>
  78. </view>
  79. <view class="share_content" :class="share_show?'':'share_content1'">
  80. <!-- <view style="width: 100%;height: 168rpx;"></view> -->
  81. <view class="share_box vflex Poster1">
  82. <text class="share_name Poster1" style="margin: 40rpx 0 28rpx;" :data-enode="pageData.name">{{pageData.name}}</text>
  83. <text class="share_label Poster1" style="margin: 0 0 16rpx;" data-enode="船厂简介">船厂简介</text>
  84. <view class="share_text Poster1" style="margin: 0 0 24rpx;" data-etype="textarea" :data-enode="pageData.intro">{{pageData.intro}}</view>
  85. <text class="share_label Poster1" style="margin: 0 0 16rpx;" data-enode="船厂介绍">船厂介绍</text>
  86. <view class="share_text Poster1" style="margin: 0 0 42rpx;" data-etype="textarea" :data-enode="pageData.product_intro">{{pageData.product_intro}}</view>
  87. <view class="hflex acenter share_text jcenter Poster1" style=" margin: 0 190rpx 12rpx;" data-enode="长按或扫码查看">长按或扫码查看</view>
  88. <view style="width: 100%;" class="vflex acenter jcenter">
  89. <image class="Poster1" style="width: 25rpx;height: 20rpx;" :data-enode="style.img1" data-etype="image" :src="style.img1" shape="10"></image>
  90. <image class="Poster1" style="width: 100%;height: 2rpx;margin: 30rpx 0;" :data-enode="style.img2" data-etype="image" :src="style.img2" shape="10"></image>
  91. </view>
  92. <view class="hflex acenter jbetween">
  93. <view class="vflex">
  94. <view class="share_name Poster1" style="margin: 54rpx 0 20rpx;" data-enode="船百知">船百知</view>
  95. <view class="share_text Poster1" style="margin: 0 0 36rpx;" data-enode="船百知伴你一起杨帆启航,驶向成功彼岸">船百知伴你一起杨帆启航,驶向成功彼岸</view>
  96. </view>
  97. <image class="Poster1" data-etype="image" :data-enode="style.code" :src="style.code" style="width: 136rpx;height: 136rpx;" shape="10"></image>
  98. </view>
  99. </view>
  100. <evils-el-poster width="325" height="467" @on-error="onError" :list="list" backgroundColor="rgb(255,255,255)" @on-success="onSuccess" ref="Eposter"></evils-el-poster>
  101. <view class="share_bottom">
  102. <view class="hflex acenter jcenter">
  103. <button class="vflex acenter jcenter bottom_item" open-type="share">
  104. <image src="https://ship-expert.zhousi.hdlkeji.com/common/wx.png" class="item_icon"></image>
  105. <view class="item_text">微信好友</view>
  106. </button>
  107. <!-- <button class="vflex acenter jcenter bottom_item" open-type="share">
  108. <image src="https://ship-expert.zhousi.hdlkeji.com/common/moments.png" class="item_icon"></image>
  109. <view class="item_text">朋友圈</view>
  110. </button> -->
  111. <view class="vflex acenter jcenter bottom_item" @click="saveImg">
  112. <image src="https://ship-expert.zhousi.hdlkeji.com/common/download.png" class="item_icon"></image>
  113. <view class="item_text">保存图片</view>
  114. </view>
  115. </view>
  116. <view class="share_cancel" @click="close">取消</view>
  117. </view>
  118. </view>
  119. </view>
  120. </template>
  121. <script>
  122. import $api from '@/static/js/api.js'
  123. var that = ''
  124. export default {
  125. data() {
  126. return {
  127. list: [],
  128. style: {
  129. img1: 'https://ship-expert.zhousi.hdlkeji.com/common/down2.png',
  130. img2: 'https://ship-expert.zhousi.hdlkeji.com/common/line.png',
  131. code: 'https://ship-expert.zhousi.hdlkeji.com/common/code.jpg'
  132. },
  133. pageData: {
  134. },
  135. tab_active: 1,
  136. shadowStyle: {
  137. backgroundImage: "none",
  138. },
  139. share_show: false,
  140. tempImage:'',
  141. id: '',
  142. pageList: [],
  143. }
  144. },
  145. onLoad(options) {
  146. that = this
  147. that.id = options.id
  148. that.getData()
  149. that.getList()
  150. uni.showShareMenu({
  151. withShareTicket: false,
  152. menus: ["shareAppMessage", "shareTimeline"]
  153. })
  154. },
  155. onShareAppMessage(res) {
  156. console.log(res);
  157. if (res.from === 'button') {// 来自页面内分享按钮
  158. console.log(res.target)
  159. }
  160. return {
  161. title: '船百知', //分享的名称
  162. path: '/pages/tabbar/shipyard/detail?id=' + that.id
  163. }
  164. },
  165. onShareTimeline(res) {
  166. /* uni.authorize({
  167. scope: 'scope.writePhotosAlbum',
  168. success() {
  169. uni.saveImageToPhotosAlbum({
  170. filePath: that.tempImage,
  171. success: function (res) {
  172. console.log('图片下载地址',res);
  173. }
  174. });
  175. }
  176. }) */
  177. return {
  178. title: '船百知',
  179. path: '/pages/tabbar/shipyard/detail?id=' + that.id,
  180. // imageUrl: that.,
  181. }
  182. },
  183. methods: {
  184. // 返回
  185. leftClick() {
  186. console.log('返回');
  187. $api.jump(-1)
  188. },
  189. getData() {
  190. $api.req({
  191. url: '/data/api.ShipYard/show',
  192. data: {
  193. id: that.id
  194. }
  195. }, function(res) {
  196. if(res.code == 1) {
  197. that.pageData = res.data
  198. }
  199. })
  200. },
  201. getList() {
  202. $api.req({
  203. url: '/data/api.ShipYard/jobs',
  204. data: {
  205. shipyard_id: that.id
  206. }
  207. }, function(res) {
  208. that.pageList = res.data.data
  209. })
  210. },
  211. // 切换tabs
  212. changeTab(index) {
  213. that.tab_active = index
  214. },
  215. load() {
  216. this.$refs.uReadMore.init();
  217. },
  218. // 收藏
  219. collect() {
  220. that.pageData.is_fav = !that.pageData.is_fav
  221. $api.req({
  222. url: '/data/api.ShipYard/fav',
  223. data: {
  224. shipyard_id: that.id,
  225. action: that.pageData.is_fav?1:0
  226. }
  227. }, function(res) {
  228. if(res.code == 1) {
  229. $api.info(res.info)
  230. }
  231. })
  232. },
  233. share(elClass) {
  234. let view = uni.createSelectorQuery().in(this).select(".Poster1");
  235. view.fields({
  236. size: true,
  237. rect: true,
  238. scrollOffset: true
  239. }, data => {
  240. }).exec();
  241. that.share_show = true
  242. that.$refs.Eposter.createForElRect(elClass,false)
  243. },
  244. into_chatroom() {
  245. var my = uni.getStorageSync("myUsername");
  246. var nameList = {
  247. myName: my,
  248. your: that.pageData.huanxinID,
  249. };
  250. uni.navigateTo({
  251. url: "/pages/chatroom/chatroom?username=" + JSON.stringify(nameList),
  252. });
  253. },
  254. close() {
  255. that.share_show = false
  256. },
  257. onSuccess(e) {
  258. console.log(e);
  259. that.tempImage = e
  260. },
  261. onError(err) {
  262. console.log('发生错误');
  263. console.log(err);
  264. },
  265. saveImg() {
  266. console.log(that.tempImage);
  267. uni.getSetting({
  268. success(res) {
  269. if(!res.authSetting['scope.writePhotosAlbum']) {
  270. uni.authorize({
  271. scope: 'scope.writePhotosAlbum',
  272. success() {
  273. uni.saveImageToPhotosAlbum({
  274. filePath: that.tempImage,
  275. success: function () {
  276. console.log('save success');
  277. $api.info('保存成功')
  278. that.close()
  279. }
  280. });
  281. }
  282. })
  283. }else {
  284. uni.saveImageToPhotosAlbum({
  285. filePath: that.tempImage,
  286. success: function () {
  287. console.log('save success');
  288. $api.info('保存成功')
  289. that.close()
  290. }
  291. });
  292. }
  293. }
  294. })
  295. },
  296. },
  297. }
  298. </script>
  299. <style lang="scss" scoped>
  300. .content {
  301. position: relative;
  302. .top {
  303. background: url('https://ship-expert.zhousi.hdlkeji.com/common/nav_bg.png') no-repeat;
  304. background-size: 100%;
  305. box-sizing: border-box;
  306. padding: 30rpx;
  307. height: 540rpx;
  308. .top_name {
  309. font-size: 36rpx;
  310. font-weight: 500;
  311. color: #222222;
  312. line-height: 50rpx;
  313. }
  314. .scale {
  315. font-size: 24rpx;
  316. font-weight: 400;
  317. color: #222222;
  318. line-height: 34rpx;
  319. }
  320. .top_avatar {
  321. width: 116rpx;
  322. height: 116rpx;
  323. border-radius: 16rpx;
  324. }
  325. }
  326. .box {
  327. position: absolute;
  328. left: 0;
  329. top: 344rpx;
  330. width: 100%;
  331. min-height: calc(100vh - 256rpx);
  332. background: #FFFFFF;
  333. border-radius: 40rpx 40rpx 0px 0px;
  334. .tabs {
  335. width: 100%;
  336. padding: 36rpx 0 40rpx;
  337. .tabs_item {
  338. font-size: 32rpx;
  339. font-weight: 500;
  340. color: #959595;
  341. line-height: 44rpx;
  342. width: 50%;
  343. text-align: center;
  344. }
  345. .tab_active {
  346. position: relative;
  347. color: #222222;
  348. }
  349. .tab_active::after {
  350. content: "";
  351. position: absolute;
  352. bottom: -8rpx;
  353. left: 39%;
  354. width: 80rpx;
  355. height: 4rpx;
  356. background: #506DFF;
  357. border-radius: 4rpx;
  358. }
  359. }
  360. .box1 {
  361. width: 100%;
  362. box-sizing: border-box;
  363. padding: 0 30rpx;
  364. margin-bottom: 186rpx;
  365. .title {
  366. font-size: 36rpx;
  367. font-weight: 500;
  368. color: #222222;
  369. line-height: 50rpx;
  370. }
  371. .cell {
  372. padding: 14rpx 0;
  373. }
  374. .text {
  375. font-size: 28rpx;
  376. font-weight: 400;
  377. color: #555555;
  378. line-height: 40rpx;
  379. }
  380. .img {
  381. width: 200rpx;
  382. height: 200rpx;
  383. border-radius: 12rpx;
  384. margin: 0 16rpx 20rpx 0;
  385. }
  386. .img:nth-child(3n+3) {
  387. margin: 0 0 20rpx;
  388. }
  389. }
  390. .list {
  391. box-sizing: border-box;
  392. width: 100%;
  393. padding: 0 30rpx;
  394. .list_item {
  395. width: 100%;
  396. padding: 28rpx 0 20rpx;
  397. border-top: 1rpx solid #F4F4F4;
  398. .item_title {
  399. font-size: 32rpx;
  400. font-weight: 600;
  401. color: #222222;
  402. }
  403. .item_blue {
  404. font-size: 32rpx;
  405. font-weight: bold;
  406. color: #506DFF;
  407. }
  408. .item_box {
  409. height: 40rpx;
  410. background: #F0F2F6;
  411. border-radius: 2px;
  412. box-sizing: border-box;
  413. padding: 4rpx 18rpx;
  414. font-size: 22rpx;
  415. font-weight: 400;
  416. color: #444444;
  417. margin-right: 20rpx;
  418. }
  419. .item_name {
  420. font-size: 24rpx;
  421. font-weight: 400;
  422. color: #666666;
  423. }
  424. .item_avatar {
  425. width: 40rpx;
  426. height: 40rpx;
  427. border-radius: 50%;
  428. margin-right: 12rpx;
  429. }
  430. .item_avatar1 {
  431. width: 88rpx;
  432. height: 88rpx;
  433. border-radius: 50%;
  434. margin-right: 20rpx;
  435. }
  436. .item_right1 {
  437. }
  438. .text_style1 {
  439. font-size: 22rpx;
  440. font-weight: 400;
  441. color: #666666;
  442. padding: 12rpx 0;
  443. }
  444. .item_box1 {
  445. margin-top: 8rpx;
  446. background: #EDF0FF;
  447. border-radius: 8rpx;
  448. box-sizing: border-box;
  449. padding: 4rpx 16rpx;
  450. font-size: 24rpx;
  451. font-weight: 400;
  452. color: #506DFF;
  453. }
  454. .item_btn1 {
  455. width: 140rpx;
  456. height: 52rpx;
  457. background: #F1F3FF;
  458. border-radius: 28rpx;
  459. font-size: 26rpx;
  460. font-weight: 500;
  461. color: #506DFF;
  462. line-height: 52rpx;
  463. text-align: center;
  464. }
  465. .user_name {
  466. font-size: 20rpx;
  467. font-weight: 400;
  468. color: #333333;
  469. }
  470. .user_right {
  471. font-size: 20rpx;
  472. font-weight: 400;
  473. color: #A1A1A1;
  474. }
  475. }
  476. }
  477. }
  478. .bottom {
  479. width: 100%;
  480. z-index: 9;
  481. position: fixed;
  482. bottom: 0;
  483. height: 166rpx;
  484. background: #FFFFFF;
  485. box-sizing: border-box;
  486. padding: 8rpx 30rpx 74rpx;
  487. .bottom_btn {
  488. width: 530rpx;
  489. height: 84rpx;
  490. background: #506DFF;
  491. border-radius: 42rpx;
  492. font-size: 36rpx;
  493. font-weight: 500;
  494. color: #FFFFFF;
  495. text-align: center;
  496. line-height: 84rpx;
  497. }
  498. .bottom_btn1 {
  499. width: 204rpx;
  500. height: 84rpx;
  501. border-radius: 21px;
  502. border: 1px solid #506DFF;
  503. font-size: 36rpx;
  504. font-weight: 500;
  505. color: #506DFF;
  506. text-align: center;
  507. line-height: 84rpx;
  508. margin-right: 20rpx;
  509. }
  510. .bottom_btn2 {
  511. width: 300rpx;
  512. height: 84rpx;
  513. border-radius: 21px;
  514. background: #506DFF;
  515. color: #FFFFFF;
  516. font-size: 36rpx;
  517. font-weight: 500;
  518. text-align: center;
  519. line-height: 84rpx;
  520. }
  521. .bottom_img {
  522. width: 40rpx;
  523. height: 40rpx;
  524. }
  525. }
  526. .share_content {
  527. position: fixed;
  528. top: 0;
  529. left: 0;
  530. z-index: 99;
  531. width: 100vw;
  532. height: 100vh;
  533. background: rgba(0,0,0,0.5);
  534. backdrop-filter: blur(5px);
  535. padding: 0 0 0;
  536. .share_box {
  537. margin: 130rpx auto 0;
  538. width: 650rpx;
  539. background: #FFFFFF;
  540. border-radius: 20rpx;
  541. box-sizing: border-box;
  542. padding: 0 40rpx;
  543. .share_name {
  544. width: 100%;
  545. font-size: 32rpx;
  546. font-weight: 500;
  547. color: #222222;
  548. line-height: 44rpx;
  549. }
  550. .share_label {
  551. width: 100%;
  552. font-size: 28rpx;
  553. font-weight: 400;
  554. color: #222222;
  555. line-height: 40rpx;
  556. }
  557. .share_text {
  558. width: 100%;
  559. font-size: 24rpx;
  560. font-weight: 400;
  561. color: #999999;
  562. line-height: 34rpx;
  563. text-overflow: ellipsis;
  564. overflow: hidden;
  565. display: -webkit-box;
  566. -webkit-box-orient: vertical;
  567. box-orient: vertical;
  568. line-clamp: 5;
  569. -webkit-line-clamp: 5;
  570. }
  571. .box_bottom {
  572. width: 100%;
  573. padding: 34rpx 0 16rpx;
  574. border-top: 1rpx dashed #C3C3C3;
  575. .bottom_left1 {
  576. font-size: 32rpx;
  577. font-weight: 500;
  578. color: #222222;
  579. line-height: 44rpx;
  580. padding-bottom: 20rpx;
  581. }
  582. .bottom_left2 {
  583. font-size: 22rpx;
  584. font-weight: 400;
  585. color: #999999;
  586. line-height: 32rpx;
  587. }
  588. .bottom_right {
  589. width: 136rpx;
  590. height: 136rpx;
  591. }
  592. }
  593. }
  594. canvas {
  595. position: absolute;
  596. top: 188rpx;
  597. left: 50rpx;
  598. width: 650rpx;
  599. min-height: 494rpx;
  600. background: #FFFFFF;
  601. border-radius: 20rpx;
  602. }
  603. .share_bottom {
  604. position: fixed;
  605. bottom: 0;
  606. width: 100%;
  607. height: 388rpx;
  608. background: #F5F7FF;
  609. border-radius: 40rpx 40rpx 0px 0px;
  610. .bottom_item {
  611. width: 33%;
  612. margin: 50rpx 0 90rpx;
  613. border: none !important;
  614. background-color: #F5F7FF !important;
  615. .item_icon {
  616. width: 76rpx;
  617. height: 76rpx;
  618. }
  619. .item_text {
  620. font-size: 26rpx;
  621. font-weight: 400;
  622. color: #333333;
  623. line-height: 36rpx;
  624. margin-top: 12rpx;
  625. }
  626. }
  627. button::after {
  628. border: none !important;
  629. }
  630. .share_cancel {
  631. width: 100%;
  632. text-align: center;
  633. font-size: 32rpx;
  634. font-weight: 400;
  635. color: #333333;
  636. line-height: 44rpx;
  637. }
  638. }
  639. }
  640. .share_content1 {
  641. z-index: -99 !important;
  642. }
  643. canvas {
  644. position: absolute;
  645. top: 188rpx;
  646. left: 50rpx;
  647. }
  648. }
  649. </style>