policyInfo.vue 12 KB

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