comInfo.vue 15 KB

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