policyInfo.vue 13 KB

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