detail.vue 18 KB

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