comEdit.vue 16 KB

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