policyInfo.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  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. this.inputForm = this.recover(this.inputForm, data)
  288. // console.log(this.inputForm.buildingName);
  289. // if(this.inputForm.buildingName=='盐都经开区'){
  290. // this.imgurl="https://miniapp.huidutech.com.cn/yd_qycpfbH5/jin.jpg";
  291. // }else if(this.inputForm.buildingName=='盐城高新区'){
  292. // this.imgurl="https://miniapp.huidutech.com.cn/yd_qycpfbH5/gao.jpg";
  293. // }else if(this.inputForm.buildingName=='龙冈产业园'){
  294. // this.imgurl="https://miniapp.huidutech.com.cn/yd_qycpfbH5/long.jpg";
  295. // }
  296. // if(this.inputForm.picture!=""){
  297. // this.inputForm.picture="http://47.97.69.114:8089"+this.inputForm.picture;
  298. // }
  299. },
  300. goToCompany(companyName) {
  301. //https://www.qcc.com/web/search?key=
  302. window.open("https://www.qcc.com/web/search?key="+companyName);
  303. //window.location.href = `https://www.qcc.com/company/${encodeURIComponent(companyName)}`;
  304. },
  305. call1(){
  306. // uni.navigateTo({
  307. // url: '/pages/index/AudioToWord'
  308. // })
  309. // uni.navigateTo({
  310. // url: '/pages/comList/comList'
  311. // })
  312. //未登录
  313. if(this.isLogin==null){
  314. uni.showModal({
  315. title: '您还未登录,是否跳转登录页面?',
  316. showCancel: true,
  317. success: (res) => {
  318. if (res.confirm) {
  319. uni.reLaunch({
  320. url: '/pages/login/login'
  321. })
  322. }
  323. }
  324. });
  325. }else{
  326. window.location.href = 'tel:'+this.inputForm.phone;
  327. }
  328. },
  329. call2(){
  330. //未登录
  331. if(this.isLogin==null){
  332. uni.showModal({
  333. title: '您还未登录,是否跳转登录页面?',
  334. showCancel: true,
  335. success: (res) => {
  336. if (res.confirm) {
  337. uni.reLaunch({
  338. url: '/pages/login/login'
  339. })
  340. }
  341. }
  342. });
  343. }else{
  344. window.location.href = 'tel:'+this.inputForm.bz6;
  345. }
  346. },
  347. }
  348. }
  349. </script>
  350. <style>
  351. /* .file-title) {
  352. font-size: 17px !important;
  353. } */
  354. input,textarea{
  355. color: #8799a3;
  356. }
  357. .swiper {
  358. width: 750rpx;
  359. height: 310rpx;
  360. }
  361. .swiper-item {
  362. width: 750rpx;
  363. height: 310rpx;
  364. background-color: aliceblue;
  365. }
  366. .show1{
  367. background-color: #2752eb;
  368. padding-left: 8rpx;
  369. }
  370. .textbg{
  371. display: flex;
  372. background-color: white;
  373. padding-top: 29rpx;
  374. }
  375. .text2{
  376. flex: 1;
  377. color: #000000;
  378. font-size: 30rpx;
  379. padding-bottom: 2rpx;
  380. }
  381. .text22{
  382. flex: 1;
  383. color: #666666;
  384. font-size: 29rpx;
  385. padding-bottom: 2rpx;
  386. }
  387. .text3{
  388. display: flex;
  389. color: #000000;
  390. }
  391. .phone{
  392. display: flex;
  393. color: #1E8AD7;
  394. padding-left: 5rpx;
  395. padding-right: 5rpx;
  396. font-size: 30rpx;
  397. align-items: center
  398. }
  399. .phoneimg{
  400. margin-left: 10rpx;
  401. width: 35rpx;
  402. height: 35rpx;
  403. }
  404. .titlebg2{
  405. display: flex;
  406. background-color: white;
  407. padding-left: 22rpx;
  408. padding-top: 35rpx;
  409. padding-bottom: 25rpx;
  410. margin-bottom: 2rpx;
  411. }
  412. .titlet1{
  413. width: 7rpx;
  414. margin-top: 7rpx;
  415. margin-bottom: 7rpx;
  416. background-color: #2752eb;
  417. margin-right: 8rpx;
  418. }
  419. .titlet2{
  420. font-weight: 800;
  421. color: #2752eb;
  422. }
  423. .overlay{
  424. position: fixed; /* 固定定位,覆盖整个页面 */
  425. top: 0;
  426. left: 0;
  427. width: 100%;
  428. height: 100%;
  429. background-color: rgba(255, 255, 255, 0.5); /* 半透明白色背景 */
  430. z-index: 1000; /* 确保遮罩在页面内容之上 */
  431. }
  432. .custom-header {
  433. display: flex;
  434. align-items: center;
  435. justify-content: center;
  436. padding: 10px;
  437. width: 100%;
  438. }
  439. .is-back {
  440. position: relative;
  441. }
  442. .back-container {
  443. position: absolute;
  444. left: 10px;
  445. cursor: pointer;
  446. }
  447. .back-text {
  448. color: white; /* 返回按钮文本颜色 */
  449. }
  450. .content-container {
  451. flex: 1;
  452. text-align: center;
  453. }
  454. .content-text {
  455. color: white; /* 标题文本颜色 */
  456. font-weight: bold;
  457. }
  458. /* 背景颜色 */
  459. .bg-blue {
  460. background-color: #4285f4; /* 假设这是一个蓝色背景 */
  461. }
  462. .text1{
  463. width: 100%;
  464. margin-left: 30rpx;
  465. font-size: 28rpx;
  466. color: #333;
  467. font-weight: bold;
  468. }
  469. .text2{
  470. width: 100%;
  471. margin-left: 30rpx;
  472. font-size: 28rpx;
  473. color: #333;
  474. }
  475. .text12{
  476. width: 100%;
  477. margin-left: 30rpx;
  478. color: #000000;
  479. margin-bottom: 20rpx;
  480. font-size: 29rpx;
  481. }
  482. .img-item {
  483. width: 100%;
  484. }
  485. </style>