comInfo.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679
  1. <template>
  2. <view>
  3. <view class="overlay" v-if="showfx" @click="showwx">
  4. <image style="height: 100%;width: 100%;" src="/static/img/zz.png"></image>
  5. </view>
  6. <!-- <cu-custom bgColor="bg-blue" :isBack="true" v-if="title == '新建企业信息'">
  7. <block slot="backText">返回</block>
  8. <block slot="content">新建企业信息</block>
  9. </cu-custom>
  10. <cu-custom bgColor="bg-blue" :isBack="true" v-if="title == '修改企业信息'">
  11. <block slot="backText">返回</block>
  12. <block slot="content">修改企业信息</block>
  13. </cu-custom>
  14. <cu-custom bgColor="bg-blue" :isBack="true" v-if="title == '查看企业信息'">
  15. <block slot="backText">返回</block>
  16. <block slot="content">查看企业信息</block>
  17. </cu-custom> -->
  18. <!-- <view :class="['custom-header', { 'is-back': isBack }, bgColor]">
  19. <view class="back-container" @click="handleBack">
  20. <view class="back-text">返回</view>
  21. </view>
  22. <view class="content-container">
  23. <view class="content-text">{{title}}</view>
  24. </view>
  25. </view> -->
  26. <view :class="['custom-header', { 'is-back': isBack }, bgColor]">
  27. <view class="back-container" @click="handleBack">
  28. <view class="back-text">返回</view>
  29. </view>
  30. <view class="content-container">
  31. <view class="content-text">园区详情</view>
  32. </view>
  33. </view>
  34. <swiper class="swiper" circular :indicator-dots="true" :autoplay="true" :interval="3000" :duration="800">
  35. <swiper-item>
  36. <image :src="imgurl" class="swiper-item"></image>
  37. </swiper-item>
  38. <swiper-item>
  39. <image :src="imgurl" class="swiper-item"></image>
  40. </swiper-item>
  41. </swiper>
  42. <form class="cu-list menu">
  43. <view class="show1">
  44. <view class="textbg">
  45. <view class="text1">
  46. {{inputForm.buildingName}}
  47. </view>
  48. </view>
  49. </view>
  50. <view class="titlebg2">
  51. <view class="titlet1" ></view>
  52. <view class="titlet2" >简介</view>
  53. </view>
  54. <view class="textbg">
  55. <view class="text12">
  56. {{inputForm.buildingDescribe}}
  57. </view>
  58. </view>
  59. <!-- <view class="textbg">
  60. <view class="text12">
  61. 所属行业
  62. </view>
  63. <view class="text22">
  64. {{inputForm.industry}}
  65. </view>
  66. </view>
  67. <view class="textbg">
  68. <view class="text12">
  69. 去年销售
  70. </view>
  71. <view class="text22">
  72. {{inputForm.des3}}
  73. </view>
  74. </view> -->
  75. <view class="titlebg2" style="margin-top:10rpx ;" v-if="inputForm.picture!=''">
  76. <view class="titlet1" ></view>
  77. <view class="titlet2" >产业布局</view>
  78. </view>
  79. <image :src="inputForm.picture" mode="widthFix" class="img-item" >
  80. </image>
  81. <!-- <view class="textbg">
  82. <view class="text12">
  83. 产品名称
  84. </view>
  85. <view class="text22">
  86. {{inputForm.bz1}}
  87. </view>
  88. </view>
  89. <view class="textbg" >
  90. <view class="text12">
  91. 产业链环节
  92. </view>
  93. <view class="text22">
  94. {{inputForm.bz2}}
  95. </view>
  96. </view>
  97. <view style="height: 50rpx;background-color: white;"></view>
  98. <view class="titlebg2" style="margin-top:10rpx ;" v-if="inputForm.bz3!=''&&inputForm.bz3!=undefined">
  99. <view class="titlet1" ></view>
  100. <view class="titlet2" >主导产品二</view>
  101. </view>
  102. <view class="textbg" v-if="inputForm.bz3!=''&&inputForm.bz3!=undefined">
  103. <view class="text12">
  104. 产品名称
  105. </view>
  106. <view class="text22">
  107. {{inputForm.bz3}}
  108. </view>
  109. </view>
  110. <view class="textbg" v-if="inputForm.bz3!=''&&inputForm.bz3!=undefined" >
  111. <view class="text12">
  112. 产业链环节
  113. </view>
  114. <view class="text22">
  115. {{inputForm.bz4}}
  116. </view>
  117. </view> -->
  118. <view v-if="inputForm.bz3!=''&&inputForm.bz3!=undefined" style="height: 50rpx;background-color: white;"></view>
  119. <view style="height: 40rpx;"></view>
  120. <view class="padding-xl" v-if="isadmin&&inputForm.des6=='1'">
  121. <button @click="sharezz" class="cu-btn block bg-blue margin-tb-sm lg">分享此企业账号</button>
  122. </view>
  123. </form>
  124. </view>
  125. </template>
  126. <script>
  127. import loginService from '@/api/auth/loginService.js'
  128. import { wxShare } from "@/common/wxutils.js";
  129. export default {
  130. onShow() {
  131. //this.$auth.checkLogin()
  132. },
  133. data() {
  134. return {
  135. title: '新建企业信息',
  136. imgurl: "",
  137. isBack: true, // 是否显示返回按钮
  138. backText: '返回', // 返回按钮的文本
  139. bgColor: 'bg-blue', // 背景颜色
  140. autoUpload: false,
  141. inputForm: {
  142. id: '',
  143. buildingName: '',
  144. buildingDescribe: '',
  145. picture: '',
  146. name: '',
  147. industry: '',
  148. des1: '',
  149. des2: '',
  150. des3: '',
  151. entryTime: '',
  152. officeArea: '',
  153. annualRent: '',
  154. floor: '',
  155. lxr: '',
  156. phone: '',
  157. htStime: '',
  158. htEtime: '',
  159. qyDes: '',
  160. businessContent: '',
  161. totalNumber: '',
  162. securityNumber: '',
  163. belowUndergraduate: '',
  164. undergraduate: '',
  165. postgraduate: '',
  166. doctoralStudent: '',
  167. qyDes: '',
  168. num2: '',
  169. num3: '',
  170. softWritingNumbers: '',
  171. bz1: '',
  172. bz2: '',
  173. bz3: '',
  174. bz4: '',
  175. bz5: '',
  176. bz6: '',
  177. des5: '',
  178. des6: '',
  179. des7: '',
  180. des8: '',
  181. des9: '',
  182. },
  183. text1:'',
  184. text2:'',
  185. parkList: [],
  186. ischeck: false,
  187. isLogin:"",
  188. username:"",
  189. isadmin:false,
  190. lyIndex: '',
  191. showLYList: [],
  192. showfx:false,
  193. }
  194. },
  195. created() {
  196. },
  197. mounted() {
  198. },
  199. onLoad(query) {
  200. this.isLogin=this.$auth.checkisLogin();
  201. this.username=this.$auth.getUserInfo();
  202. if(this.username!=undefined&&this.username!=''&&this.username!=null&&this.isLogin!=null){
  203. if(this.username.loginName=='admin'){
  204. this.isadmin=true;
  205. }
  206. }
  207. if (query && query.ischeck) {
  208. this.ischeck = true
  209. this.title = "查看企业信息";
  210. }
  211. if (query && query.id && !query.ischeck) {
  212. this.title = "修改企业信息";
  213. }
  214. this.getComById(query)
  215. },
  216. methods: {
  217. getParkList(query) {
  218. loginService.list({
  219. current: 1,
  220. size: 1000000,
  221. }).then(({
  222. data
  223. }) => {
  224. this.parkList = data.records.map((item) => {
  225. return {
  226. label: item.buildingName,
  227. value: item.id
  228. }
  229. })
  230. this.showLYList = this.parkList.map(item => item.label)
  231. if (query && query.id) {
  232. loginService.queryByIdCom(query.id).then(({
  233. data
  234. }) => {
  235. this.inputForm = this.recover(this.inputForm, data)
  236. this.lyIndex = this.parkList.findIndex(item => item.value == this.inputForm.des1)
  237. console.log(this.lyIndex, '=====================>lyIndex')
  238. }).catch((e) => {
  239. })
  240. }
  241. }).catch(e => {
  242. console.log(e)
  243. })
  244. },
  245. handleBack() {
  246. // 返回逻辑,比如跳转至上一页
  247. this.$router.go(-1);
  248. console.log('返回按钮被点击');
  249. },
  250. showwx() {
  251. this.showfx=false;
  252. },
  253. getComById(query) {
  254. loginService.queryByIdBuild(query.id).then(({
  255. data
  256. }) => {
  257. this.setData(data);
  258. }).catch((e) => {
  259. })
  260. },
  261. //账号分享
  262. sharezz(){
  263. var that=this;
  264. setTimeout(function() {
  265. that.showfx=true;
  266. console.log("1"+ this.showfx);
  267. }, 500); // 2000毫秒后执行
  268. loginService.getloginstr(this.inputForm.phone).then(({
  269. data
  270. }) => {
  271. //未登录
  272. if(data.Id=='0'){
  273. uni.showModal({
  274. title: '您无权限分享账号,请联系管!',
  275. showCancel: true,
  276. success: (res) => {
  277. }
  278. });
  279. }else{
  280. this.weixin(data);
  281. // const textArea = document.createElement("textarea");
  282. // textArea.value = 'https://miniapp.huidutech.com.cn/yd_qycpfbH5/#/pages/index/index?loginid='+data.Id;
  283. // document.body.appendChild(textArea);
  284. // textArea.focus();
  285. // textArea.select();
  286. // try {
  287. // document.execCommand('copy');
  288. // uni.showModal({
  289. // title: '已将登录链接复制到剪切板,直接打开微信好友粘贴分享!',
  290. // showCancel: true,
  291. // success: (res) => {
  292. // }
  293. // });
  294. // } catch (err) {
  295. // console.error('Could not copy text', err);
  296. // uni.showModal({
  297. // title: '当前不支持分享功能!',
  298. // showCancel: true,
  299. // success: (res) => {
  300. // }
  301. // });
  302. // } finally {
  303. // document.body.removeChild(textArea);
  304. // }
  305. }
  306. }).catch((e) => {
  307. })
  308. },
  309. // async initUser() {
  310. // const { data = {} } = await api.fetchUserInfo();
  311. // if (Object.keys(data).length > 0) {
  312. // // 设置用户基本信息
  313. // this.setUser(data);
  314. // const browser = window.navigator.userAgent.toLowerCase();
  315. // //匹配browser中是否含有MicroMessenger字符串
  316. // if (browser.match(/MicroMessenger/i) == "micromessenger") {
  317. // this.weixin(data);
  318. // } else {
  319. // const params = new URLSearchParams(window.location.search);
  320. // const id = params.get("id");
  321. // if (!id || (id && id !== data.uid)) {
  322. // // 如果不是微信浏览器,则跳转页面带id后缀
  323. // const url_a = window.location.origin;
  324. // window.location.href = url_a + "?id=" + data.uid;
  325. // }
  326. // }
  327. // }
  328. // },
  329. async weixin(data) {
  330. try {
  331. if ( data) {
  332. //微信加签
  333. var obj = {
  334. appId: data.appid,
  335. nonceStr: data.nonceStr,
  336. signature: data.signature,
  337. timestamp: data.timestamp,
  338. Id: data.Id,
  339. }
  340. //分享数据,这段主要是为了在hash模式下分享出去的链接不被浏览器截取,保证完全把链接分享出去(link的链接可以自己拼,无须与当前页面的后缀参数之类的内容完全一致)
  341. let shareData = {
  342. title: '‘都企供需’线上平台',
  343. desc: '点击直接登录',
  344. imgUrl: 'https://miniapp.huidutech.com.cn/yd_qycpfbH5/static/img/titlebg.jpg',
  345. link: 'https://miniapp.huidutech.com.cn/yd_qycpfbH5/#/pages/index/index?loginid='+data.Id + "&t=" + data.timestamp + "&Content=1", // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
  346. };
  347. //引用
  348. wxShare(obj, shareData);
  349. } else {
  350. uni.showModal({
  351. title: '获取sdk参数失败!',
  352. showCancel: true,
  353. success: (res) => {
  354. }
  355. });
  356. }
  357. } catch (err) {
  358. //
  359. } finally {
  360. //
  361. }
  362. },
  363. setData(data){
  364. this.inputForm = this.recover(this.inputForm, data)
  365. console.log(this.inputForm.buildingName);
  366. if(this.inputForm.buildingName=='盐都经开区'){
  367. this.imgurl="https://miniapp.huidutech.com.cn/yd_qycpfbH5/jin.jpg";
  368. }else if(this.inputForm.buildingName=='盐城高新区'){
  369. this.imgurl="https://miniapp.huidutech.com.cn/yd_qycpfbH5/gao.jpg";
  370. }else if(this.inputForm.buildingName=='龙冈产业园'){
  371. this.imgurl="https://miniapp.huidutech.com.cn/yd_qycpfbH5/long.jpg";
  372. }
  373. if(this.inputForm.picture!=""){
  374. this.inputForm.picture="http://47.97.69.114:8089"+this.inputForm.picture;
  375. }
  376. },
  377. goToCompany(companyName) {
  378. //https://www.qcc.com/web/search?key=
  379. window.open("https://www.qcc.com/web/search?key="+companyName);
  380. //window.location.href = `https://www.qcc.com/company/${encodeURIComponent(companyName)}`;
  381. },
  382. call1(){
  383. // uni.navigateTo({
  384. // url: '/pages/index/AudioToWord'
  385. // })
  386. // uni.navigateTo({
  387. // url: '/pages/comList/comList'
  388. // })
  389. //未登录
  390. if(this.isLogin==null){
  391. uni.showModal({
  392. title: '您还未登录,是否跳转登录页面?',
  393. showCancel: true,
  394. success: (res) => {
  395. if (res.confirm) {
  396. uni.reLaunch({
  397. url: '/pages/login/login'
  398. })
  399. }
  400. }
  401. });
  402. }else{
  403. window.location.href = 'tel:'+this.inputForm.phone;
  404. }
  405. },
  406. call2(){
  407. //未登录
  408. if(this.isLogin==null){
  409. uni.showModal({
  410. title: '您还未登录,是否跳转登录页面?',
  411. showCancel: true,
  412. success: (res) => {
  413. if (res.confirm) {
  414. uni.reLaunch({
  415. url: '/pages/login/login'
  416. })
  417. }
  418. }
  419. });
  420. }else{
  421. window.location.href = 'tel:'+this.inputForm.bz6;
  422. }
  423. },
  424. }
  425. }
  426. </script>
  427. <style>
  428. /* .file-title) {
  429. font-size: 17px !important;
  430. } */
  431. input,textarea{
  432. color: #8799a3;
  433. }
  434. .swiper {
  435. width: 750rpx;
  436. height: 310rpx;
  437. }
  438. .swiper-item {
  439. width: 750rpx;
  440. height: 310rpx;
  441. background-color: aliceblue;
  442. }
  443. .show1{
  444. background-color: #2752eb;
  445. padding-left: 8rpx;
  446. }
  447. .textbg{
  448. display: flex;
  449. background-color: white;
  450. padding-top: 29rpx;
  451. }
  452. .text2{
  453. flex: 1;
  454. color: #000000;
  455. font-size: 30rpx;
  456. padding-bottom: 2rpx;
  457. }
  458. .text22{
  459. flex: 1;
  460. color: #666666;
  461. font-size: 29rpx;
  462. padding-bottom: 2rpx;
  463. }
  464. .text3{
  465. display: flex;
  466. color: #000000;
  467. }
  468. .phone{
  469. display: flex;
  470. color: #1E8AD7;
  471. padding-left: 5rpx;
  472. padding-right: 5rpx;
  473. font-size: 30rpx;
  474. align-items: center
  475. }
  476. .phoneimg{
  477. margin-left: 10rpx;
  478. width: 35rpx;
  479. height: 35rpx;
  480. }
  481. .titlebg2{
  482. display: flex;
  483. background-color: white;
  484. padding-left: 22rpx;
  485. padding-top: 35rpx;
  486. padding-bottom: 25rpx;
  487. margin-bottom: 2rpx;
  488. }
  489. .titlet1{
  490. width: 7rpx;
  491. margin-top: 7rpx;
  492. margin-bottom: 7rpx;
  493. background-color: #2752eb;
  494. margin-right: 8rpx;
  495. }
  496. .titlet2{
  497. font-weight: 800;
  498. color: #2752eb;
  499. }
  500. .overlay{
  501. position: fixed; /* 固定定位,覆盖整个页面 */
  502. top: 0;
  503. left: 0;
  504. width: 100%;
  505. height: 100%;
  506. background-color: rgba(255, 255, 255, 0.5); /* 半透明白色背景 */
  507. z-index: 1000; /* 确保遮罩在页面内容之上 */
  508. }
  509. .custom-header {
  510. display: flex;
  511. align-items: center;
  512. justify-content: center;
  513. padding: 10px;
  514. width: 100%;
  515. }
  516. .is-back {
  517. position: relative;
  518. }
  519. .back-container {
  520. position: absolute;
  521. left: 10px;
  522. cursor: pointer;
  523. }
  524. .back-text {
  525. color: white; /* 返回按钮文本颜色 */
  526. }
  527. .content-container {
  528. flex: 1;
  529. text-align: center;
  530. }
  531. .content-text {
  532. color: white; /* 标题文本颜色 */
  533. font-weight: bold;
  534. }
  535. /* 背景颜色 */
  536. .bg-blue {
  537. background-color: #4285f4; /* 假设这是一个蓝色背景 */
  538. }
  539. .text1{
  540. width: 100%;
  541. margin-left: 30rpx;
  542. font-size: 32rpx;
  543. color: #333;
  544. font-weight: bold;
  545. }
  546. .text12{
  547. width: 100%;
  548. margin-left: 30rpx;
  549. color: #000000;
  550. margin-bottom: 20rpx;
  551. font-size: 29rpx;
  552. }
  553. .img-item {
  554. width: 100%;
  555. }
  556. </style>