comEdit.vue 16 KB

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