index.js 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466
  1. // index.js
  2. import {
  3. login
  4. } from "../api/request";
  5. import {
  6. imgUrl,
  7. request,
  8. request2
  9. } from "../api/request"
  10. import {
  11. yjzjList
  12. } from "../api/index-api"
  13. import {
  14. send
  15. } from "../api/index-api2"
  16. import * as echarts from '../../ec-canvas/echarts';
  17. import {
  18. getNanVideo
  19. } from "../api/newPaper-api"
  20. import {
  21. cacheSet
  22. } from "../../utils/cacheUtil"
  23. // 获取应用实例
  24. const app = getApp()
  25. Page({
  26. data: {
  27. hideAll: true,
  28. imgUrl: imgUrl,
  29. // 屏幕高度
  30. navHeight: '',
  31. searchInput: '',
  32. // 南岸咨询
  33. naTab: 0,
  34. naItem: '',
  35. // 政民tab
  36. communicateTab: 0,
  37. // 政民item
  38. communicateItem: 0,
  39. // 服务列表
  40. serviceItems1: [{
  41. img: imgUrl + 'service-1.png',
  42. name: '生活缴费'
  43. },
  44. {
  45. img: imgUrl + 'service-2.png',
  46. name: '社保服务'
  47. },
  48. {
  49. img: imgUrl + 'service-3.png',
  50. name: '公积金'
  51. },
  52. {
  53. img: imgUrl + 'service-4.png',
  54. name: '电子证照'
  55. },
  56. {
  57. img: imgUrl + 'service-5.png',
  58. name: '民政低保'
  59. }
  60. ],
  61. serviceItems2: [{
  62. img: imgUrl + 'service-6.png',
  63. name: '税务服务'
  64. },
  65. {
  66. img: imgUrl + 'service-7.png',
  67. name: '交通出行'
  68. },
  69. {
  70. img: imgUrl + 'service-8.png',
  71. name: '停车泊车'
  72. },
  73. {
  74. img: imgUrl + 'service-9.png',
  75. name: '住房置业'
  76. },
  77. {
  78. img: imgUrl + 'csyjhsicon.png',
  79. name: '出生一件事'
  80. }
  81. ],
  82. serviceItems3:[{
  83. img: imgUrl + 'wzl1.png',
  84. name: '南岸融媒'
  85. },
  86. {
  87. img: imgUrl + 'wzl2.png',
  88. name: '政务之窗'
  89. },
  90. {
  91. img: imgUrl + 'wzl3.png',
  92. name: '城市热线'
  93. },
  94. {
  95. img: imgUrl + 'wzl4.png',
  96. name: '南岸视讯'
  97. },
  98. {
  99. img: imgUrl + 'wzl5.png',
  100. name: '直播南岸'
  101. }
  102. ],
  103. serviceItems4: [{
  104. img: imgUrl + 'shyk.png',
  105. name: '三会一课'
  106. },
  107. {
  108. img: imgUrl + 'cqjk.png',
  109. name: '重庆经开'
  110. },
  111. {
  112. img: imgUrl + 'wmsj.png',
  113. name: '文明实践'
  114. },
  115. {
  116. img: imgUrl + 'dbzs.png',
  117. name: '代表之声'
  118. },
  119. {
  120. img: imgUrl + 'jqzc.png',
  121. name: '集群注册'
  122. }
  123. ],
  124. serviceItems5: [{
  125. img: imgUrl + 'bmdt.png',
  126. name: '便民地图'
  127. },
  128. {
  129. img: imgUrl + 'zczx.png',
  130. name: '政策咨询'
  131. },
  132. {
  133. img: imgUrl + 'zsxm.png',
  134. name: '招商项目'
  135. },
  136. {
  137. img: imgUrl + 'tcjf.png',
  138. name: '停车缴费'
  139. },
  140. {
  141. img: imgUrl + 'bsdt.png',
  142. name: '办事大厅'
  143. }
  144. ],
  145. // 百姓聚焦
  146. peopleService: [{
  147. id: 1,
  148. top: true,
  149. name: '12345热线'
  150. },
  151. {
  152. id: 2,
  153. top: false,
  154. name: '个人社保查询'
  155. },
  156. {
  157. id: 3,
  158. top: false,
  159. name: '广阳岛'
  160. },
  161. {
  162. id: 4,
  163. top: false,
  164. name: '长嘉汇弹子石老街'
  165. },
  166. {
  167. id: 5,
  168. top: false,
  169. name: '南岸一颗树'
  170. },
  171. {
  172. id: 6,
  173. top: false,
  174. name: '印象南岸'
  175. }
  176. ],
  177. // 南岸咨询二级title
  178. naItemTabList: [{
  179. id: 1,
  180. name: '政策.咨询'
  181. },
  182. {
  183. id: 2,
  184. name: '党建.服务'
  185. },
  186. {
  187. id: 3,
  188. name: '抗疫.复工'
  189. },
  190. {
  191. id: 4,
  192. name: '功能.服务'
  193. }
  194. ],
  195. // 南岸咨询内容
  196. naContentList: [],
  197. // 南岸加载中参数
  198. isNaLoading: false,
  199. // 南岸是否为空数据
  200. isNaEmpty: true,
  201. // 本年办件数
  202. officeNumber: [],
  203. // 评价总量
  204. evalutionNum: 0,
  205. // 满意度
  206. evalutionRate: '',
  207. // 图表
  208. streetlinechartec: {
  209. lazyLoad: true,
  210. },
  211. // 图表图片
  212. canvasImg: '',
  213. // 视频推荐数据
  214. videoInfo: [],
  215. // 视频推荐数据加载中参数
  216. isVideoLoading: true,
  217. // 视频推荐是否为空数据
  218. isVideoEmpty: false,
  219. // 意见征集list
  220. yjzjDataList: [],
  221. scroll_height:"",
  222. // 在线调查
  223. investigatePage: 1,
  224. investigateList: [],
  225. isOnlineLoading: false,
  226. isOnlineFinish: false,
  227. // 地图服务
  228. mapServiceData: [{
  229. id: 1,
  230. name: '政务公开'
  231. },
  232. {
  233. id: 2,
  234. name: '政务服务'
  235. },
  236. {
  237. id: 3,
  238. name: '党群服务'
  239. },
  240. {
  241. id: 4,
  242. name: '教育资源'
  243. },
  244. {
  245. id: 5,
  246. name: '医疗卫生'
  247. },
  248. {
  249. id: 6,
  250. name: '户籍管理'
  251. },
  252. {
  253. id: 7,
  254. name: '交通服务'
  255. },
  256. {
  257. id: 8,
  258. name: '社会保障'
  259. },
  260. ],
  261. // 媒体矩阵导航
  262. mediaCurrentTab: 0,
  263. // 公众号弹窗
  264. ewmShowDialog: false,
  265. // 南岸发布flag
  266. isNafaLoading: false,
  267. // 媒体矩阵导航列表
  268. provList: [{
  269. "name": "南岸发布"
  270. },
  271. {
  272. "name": "微信公众号"
  273. }
  274. // {
  275. // "name": "今日头条"
  276. // }
  277. ],
  278. // 媒体矩阵内容选项
  279. mediaSelectList: [{
  280. id: '1',
  281. name: "重庆市南岸区人民政府",
  282. img: imgUrl + 'index-media-icon1.png',
  283. ewm: "index_ewm_logo_1.png"
  284. },
  285. {
  286. id: '2',
  287. name: "南岸文旅",
  288. img: imgUrl + 'index-media-icon2.png',
  289. ewm: "index_ewm_logo_2.png"
  290. },
  291. {
  292. id: '3',
  293. name: "南岸发布",
  294. img: imgUrl + 'index-media-icon3.png',
  295. ewm: "index_ewm_logo_3.jpg",
  296. },
  297. {
  298. id: '4',
  299. name: "南岸国资",
  300. img: imgUrl + 'index-media-icon4.png',
  301. ewm: "index_ewm_logo_4.png"
  302. },
  303. {
  304. id: '5',
  305. name: "重庆南岸消防",
  306. img: imgUrl + 'index-media-icon5.png',
  307. ewm: "index_ewm_logo_5.png"
  308. },
  309. {
  310. id: '6',
  311. name: "南岸生态环境",
  312. img: imgUrl + 'index-media-icon6.png',
  313. ewm: "index_ewm_logo_6.png"
  314. },
  315. {
  316. id: '7',
  317. name: "南岸健康卫士",
  318. img: imgUrl + 'index-media-icon7.png',
  319. ewm: "index_ewm_logo_7.png"
  320. },
  321. {
  322. id: '8',
  323. name: "南岸公安",
  324. img: imgUrl + 'index-media-icon8.png',
  325. ewm: "index_ewm_logo_8.png"
  326. },
  327. {
  328. id: '9',
  329. name: "遇见南坪",
  330. img: imgUrl + 'index-media-icon9.png',
  331. ewm: "index_ewm_logo_9.png"
  332. },
  333. {
  334. id: '10',
  335. name: "书香南岸",
  336. img: imgUrl + 'index-media-icon10.png',
  337. ewm: "index_ewm_logo_10.png"
  338. },
  339. // {
  340. // id: '11',
  341. // name: "南岸卫生健康监督",
  342. // img: imgUrl + 'index-media-icon11.png',
  343. // ewm: "index_ewm_logo_11.jpg"
  344. // },
  345. {
  346. id: '12',
  347. name: "广阳岛绿色发展公司",
  348. img: imgUrl + 'index-media-icon13.png',
  349. ewm: "index_ewm_logo_13.jpg"
  350. },
  351. {
  352. id: '13',
  353. name: "南岸人力社保",
  354. img: imgUrl + 'index-media-icon14.png',
  355. ewm: "index_ewm_logo_14.png"
  356. },
  357. {
  358. id: '14',
  359. name: "广阳湾智创生态城",
  360. img: imgUrl + 'index-media-icon15.png',
  361. ewm: "index_ewm_logo_15.jpg"
  362. },
  363. {
  364. id: '15',
  365. name: "南岸健康",
  366. img: imgUrl + 'index-media-icon18.png',
  367. ewm: "index_ewm_logo_18.jpg"
  368. },
  369. {
  370. id: '16',
  371. name: "重庆市南岸区天文街道",
  372. img: imgUrl + 'index-media-icon17.png',
  373. ewm: "index_ewm_logo_17.png"
  374. },
  375. {
  376. id: '17',
  377. name: "南岸智慧城管",
  378. img: imgUrl + 'index-media-icon16.png',
  379. ewm: "index_ewm_logo_16.png"
  380. },
  381. {
  382. id: '18',
  383. name: "重庆市南岸区南坪街道",
  384. img: imgUrl + 'index-media-icon19.png',
  385. ewm: "index_ewm_logo_19.png"
  386. },
  387. {
  388. id: '19',
  389. name: "南岸司法",
  390. img: imgUrl + 'index-media-icon12.png',
  391. ewm: "index_ewm_logo_12.png"
  392. },
  393. ],
  394. // 媒体矩阵南岸发布
  395. mediaReleaseList: [],
  396. // 媒体矩阵今日头条
  397. mediaHeadlineList: []
  398. },
  399. onReady() {},
  400. onShow() {
  401. if (typeof this.getTabBar === 'function' && this.getTabBar()) {
  402. this.getTabBar().setData({
  403. selected: 0
  404. })
  405. }
  406. this.setData({
  407. // naItem: 0,
  408. // naItemTab: 1,
  409. ewmShowDialog: false,
  410. isOnlineLoading: false,
  411. isOnlineFinish: false
  412. })
  413. if (this.data.loginReturnFlag) {
  414. this.setData({
  415. loginReturnFlag: false
  416. })
  417. this.getVideoRecommend()
  418. }
  419. },
  420. // 点击服务
  421. clickService1(e) {
  422. const index = e.currentTarget.dataset.item
  423. switch (index) {
  424. case 0: {
  425. wx.navigateToMiniProgram({
  426. appId: 'wxd2ade0f25a874ee2',
  427. success(res) {
  428. // 打开成功
  429. }
  430. })
  431. };
  432. break;
  433. case 1: {
  434. wx.navigateToMiniProgram({
  435. appId: 'wxfc86707bae655315',
  436. success(res) {
  437. // 打开成功
  438. }
  439. })
  440. };
  441. break;
  442. case 2: {
  443. wx.navigateToMiniProgram({
  444. appId: 'wx0bff7955e6e8b2bb',
  445. success(res) {
  446. // 打开成功
  447. }
  448. })
  449. };
  450. break;
  451. case 3: {
  452. wx.navigateToMiniProgram({
  453. appId: 'wxfc86707bae655315',
  454. success(res) {
  455. // 打开成功
  456. }
  457. })
  458. };
  459. break;
  460. case 4: {
  461. wx.navigateToMiniProgram({
  462. appId: 'wxfc86707bae655315',
  463. success(res) {
  464. // 打开成功
  465. }
  466. })
  467. };
  468. break;
  469. }
  470. },
  471. // 点击服务
  472. clickService2(e) {
  473. const index = e.currentTarget.dataset.item
  474. switch (index) {
  475. case 0: {
  476. wx.navigateToMiniProgram({
  477. appId: 'wxfc86707bae655315',
  478. success(res) {
  479. // 打开成功
  480. }
  481. })
  482. };
  483. break;
  484. case 1: {
  485. wx.navigateToMiniProgram({
  486. appId: 'wxbb58374cdce267a6',
  487. success(res) {
  488. // 打开成功
  489. }
  490. })
  491. };
  492. break;
  493. case 2: {
  494. wx.navigateTo({
  495. url: '/pages/map/map?se='+ '停车场',
  496. })
  497. // wx.navigateTo({
  498. // url: '/pages/web/web?url=' + "https://www.cqna.gov.cn/maps/sy_mobile.html&se=采样点",
  499. // })
  500. };
  501. break;
  502. case 3: {
  503. wx.navigateToMiniProgram({
  504. appId: 'wx0bff7955e6e8b2bb',
  505. success(res) {
  506. // 打开成功
  507. }
  508. })
  509. };
  510. break;
  511. case 4:{
  512. wx.navigateTo({
  513. url: '/pages/web/web?url= '+"https://mp.weixin.qq.com/s/0AYTnOLSgLRlqNgyhhfMjg",
  514. })
  515. }
  516. }
  517. },
  518. clickService5(e) {
  519. const index = e.currentTarget.dataset.item
  520. switch (index) {
  521. case 0: {
  522. wx.navigateTo({
  523. url: '/pages/map/map',
  524. })
  525. };
  526. break;
  527. }
  528. },
  529. toDataCenter() {
  530. wx.navigateTo({
  531. url: '/pages/dataCenter/dataCenter',
  532. })
  533. },
  534. onHide() {
  535. if (typeof this.getTabBar === 'function' && this.getTabBar()) {
  536. this.getTabBar().setData({
  537. selected: -1
  538. })
  539. }
  540. },
  541. onLoad() {
  542. var windowWidth = wx.getSystemInfoSync().windowWidth;
  543. var windowHeight = wx.getSystemInfoSync().windowHeight;
  544. //rpx与px单位之间的换算 : 750/windowWidth = 屏幕的高度(rpx)/windowHeight
  545. var scroll_height = 750*windowHeight/windowWidth;
  546. // 判断机型
  547. wx.getSystemInfo({
  548. success: res => {
  549. console.log(res);
  550. let system = res.system.split(" ")
  551. console.log(system);
  552. if (res.safeArea.top > 20 && system[0]=='iOS') { //iphonex,xr,xs
  553. scroll_height = scroll_height-70
  554. }
  555. },
  556. fail(err) {
  557. console.error(err);
  558. }
  559. })
  560. this.setData({
  561. scroll_height:scroll_height
  562. })
  563. // // 加载字体
  564. // wx.loadFontFace({
  565. // family: 'DOUYU',
  566. // // source: 'url("https://hui.yrslm.com:8089/douyu.ttf")',
  567. // source: 'url("https://www.cqna.gov.cn/mnazw/applet/font/douyu.ttf")',
  568. // success: function (e) {
  569. // console.log(e, '动态加载字体成功')
  570. // },
  571. // fail: function (e) {
  572. // console.log(e, '动态加载字体失败')
  573. // },
  574. // })
  575. // 获取视频推荐数据
  576. this.getVideoRecommend();
  577. // 获取媒体矩阵南岸发布数据
  578. this.getMediaReleaseList();
  579. // 获取媒体矩阵今日头条数据
  580. this.getMediaHeadlineList();
  581. // 获取好差评图表
  582. this.barComponent3 = this.selectComponent('#streetlinechart3');
  583. this.init_bar3();
  584. // 获取本年办件数
  585. this.getOfficeNumberByAreaInfo();
  586. // 意见征集数据
  587. this.yjzjData()
  588. // 初始化在线调查page
  589. this.setData({
  590. investigatePage: 1,
  591. investigateList: [],
  592. navHeight: app.globalData.navHeight + app.globalData.menuHeight / 2
  593. })
  594. this.initNadt()
  595. setTimeout(() => {
  596. this.setData({
  597. hideAll: false
  598. })
  599. }, 1000);
  600. // wx.login({
  601. // success(res) {
  602. // if (res.code) {
  603. // //发起网络请求
  604. // login(res.code).then(res => {
  605. // console.log(res)
  606. // wx.setStorageSync("token", res.data.data)
  607. // })
  608. // } else {
  609. // console.log('登录失败!' + res.errMsg)
  610. // }
  611. // }
  612. // })
  613. },
  614. // canvas转图片
  615. canvasToTempImage() {
  616. wx.canvasToTempFilePath({
  617. canvas: this.barComponent3.canvasNode,
  618. success: (res) => {
  619. this.setData({
  620. canvasImg: res.tempFilePath
  621. });
  622. }
  623. }, this);
  624. },
  625. // 加载评价图表
  626. init_bar3() {
  627. let that = this;
  628. this.barComponent3.init((canvas, width, height, dpr) => {
  629. // 初始化图表
  630. const barChart = echarts.init(canvas, null, {
  631. width: width,
  632. height: height,
  633. devicePixelRatio: dpr
  634. });
  635. wx.request({
  636. url: 'https://www.cqna.gov.cn/data//goodOrbad/getGoodOrBadByYearAndArea?area=1',
  637. method: 'GET',
  638. success: res => {
  639. res = res.data;
  640. if (res.result === 'ok') {
  641. let temp = [];
  642. temp.push(res.data.veryDissatisfied);
  643. temp.push(res.data.notSatisfied);
  644. temp.push(res.data.basicSatisfied);
  645. temp.push(res.data.satisfied);
  646. temp.push(res.data.great);
  647. // 计算最大值,以及分割值
  648. var maxValue = Math.max(...temp)
  649. maxValue = parseInt(maxValue / 10000 + 1) * 10000
  650. var interval = maxValue / 4
  651. barChart.setOption(this.getScaOption2(maxValue, interval));
  652. this.setData({
  653. evalutionNum: res.data.goodOrBad,
  654. evalutionRate: (res.data.good / res.data.goodOrBad * 100).toFixed(2)
  655. })
  656. barChart.setOption({
  657. series: [{
  658. data: temp
  659. }]
  660. })
  661. }
  662. }
  663. })
  664. barChart.on("finished", function () {
  665. that.canvasToTempImage();
  666. });
  667. // 注意这里一定要返回 chart 实例,否则会影响事件处理等
  668. return barChart;
  669. });
  670. },
  671. getScaOption2(maxValue, interval) {
  672. //请求数据
  673. let xAxis = {
  674. type: 'value',
  675. splitNumber: 4,
  676. max: maxValue,
  677. interval: interval,
  678. axisLine: {
  679. show: true
  680. },
  681. splitLine: {
  682. interval: 0
  683. }
  684. },
  685. yAxis = {
  686. axisTick: {
  687. show: false
  688. },
  689. type: 'category',
  690. data: [
  691. '非常不满意', '不满意', '基本满意', '满意', '非常满意'
  692. ]
  693. },
  694. grid = {
  695. left: '23%',
  696. top: '5%',
  697. bottom: '20%',
  698. right: '18%'
  699. },
  700. series = [{
  701. data: [],
  702. type: 'bar',
  703. barWidth: 15,
  704. itemStyle: {
  705. normal: {
  706. barBorderRadius: [0, 7, 7, 0],
  707. color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
  708. offset: 0,
  709. color: '#006BFD'
  710. },
  711. {
  712. offset: 1,
  713. color: '#00E9F1'
  714. }
  715. ]),
  716. }
  717. },
  718. label: {
  719. show: true,
  720. position: 'right',
  721. valueAnimation: true
  722. }
  723. }]
  724. return {
  725. backgroundColor: '#FFFFFF',
  726. xAxis: xAxis,
  727. yAxis: yAxis,
  728. grid: grid,
  729. series: series,
  730. animationDelay: function (idx) {
  731. return idx * 50;
  732. },
  733. animationEasing: 'elasticOut'
  734. };
  735. },
  736. // 获取本年办件数
  737. getOfficeNumberByAreaInfo() {
  738. request2({
  739. url: '/department/getOfficeNumberByAreaInfo?area=1&timeType=3',
  740. method: 'GET'
  741. }).then(res => {
  742. let temp = [];
  743. temp.push(res.data.acceptNumber);
  744. temp.push(res.data.serialNumber);
  745. temp.push(res.data.applicationNumberNetwork);
  746. this.setData({
  747. officeNumber: temp
  748. })
  749. })
  750. },
  751. // 搜索框
  752. bindKeyInput: function (e) {
  753. this.setData({
  754. searchInput: e.detail.value
  755. })
  756. },
  757. naChangeTab: function (e) {
  758. this.setData({
  759. naTab: e.detail.current,
  760. naItem: e.detail.current,
  761. naContentList: []
  762. })
  763. this.setData({
  764. })
  765. if (e.detail.current == 1) {
  766. wx.request({
  767. url: 'https://www.cq.gov.cn/ywdt/jrzq/index.json?cqjrcq=cqjrcq&_=1669609973472',
  768. success: res => {
  769. if (res.statusCode == 200) {
  770. var s = res.data
  771. s = s.substring(7, s.length - 1)
  772. s = JSON.parse(s)
  773. var d = [];
  774. var size = s.datas.length <= 5 ? s.datas.length : 5
  775. for (let i = 0; i < size; i++) {
  776. d.push({
  777. "DOCTITLE": s.datas[i].title,
  778. "url": s.datas[i].url
  779. })
  780. }
  781. this.setData({
  782. naContentList: d
  783. })
  784. }
  785. }
  786. })
  787. }
  788. if (e.detail.current == 2) {
  789. wx.request({
  790. url: 'https://www.gov.cn/pushinfo/v150203/pushinfo.jsonp?pushInfoJsonpCallBack=pushInfoJsonpCallBack&_=1669609973471',
  791. success: res => {
  792. console.log(res);
  793. if (res.statusCode == 200) {
  794. var s = res.data
  795. s = s.substring(22, s.length - 1)
  796. s = JSON.parse(s)
  797. console.log(s);
  798. var d = [];
  799. var size = s.length <= 5 ? s.length : 5
  800. for (let i = 0; i < size; i++) {
  801. d.push({
  802. "DOCTITLE": s[i].description,
  803. "url": s[i].link
  804. })
  805. }
  806. this.setData({
  807. naContentList: d
  808. })
  809. }
  810. }
  811. })
  812. }
  813. if (e.detail.current == 0) {
  814. let column = ["20430", "59482", "59481"]
  815. send(1, 5, column[e.detail.current]).then(res => {
  816. if (res.result) {
  817. this.setData({
  818. naContentList: res.data.DATA
  819. })
  820. }
  821. })
  822. }
  823. // 重置咨询title-tab
  824. this.setData({
  825. naItemTab: 1
  826. })
  827. },
  828. initNadt() {
  829. this.setData({
  830. isNaLoading: true
  831. })
  832. send(1, 5, "20430").then(res => {
  833. if (res.result) {
  834. this.setData({
  835. isNaLoading: false
  836. })
  837. if (res.data.DATA.length < 1) {
  838. this.setData({
  839. isNaEmpty: true
  840. })
  841. } else {
  842. this.setData({
  843. isNaEmpty: false
  844. })
  845. }
  846. this.setData({
  847. naContentList: res.data.DATA
  848. })
  849. } else {
  850. this.setData({
  851. isNaLoading: false,
  852. isNaEmpty: true
  853. })
  854. }
  855. })
  856. },
  857. // 南岸咨询子集菜单点击
  858. clickNaTilteTab: function (e) {
  859. this.setData({
  860. naItem: e.currentTarget.dataset.item,
  861. naContentList: []
  862. })
  863. if (e.currentTarget.dataset.item == 1) {
  864. // wx.showToast({title: '加载中',icon: 'loading',duration: 1000})
  865. this.setData({
  866. isNaLoading: true
  867. })
  868. wx.request({
  869. url: 'https://www.cq.gov.cn/ywdt/jrzq/index.json?cqjrcq=cqjrcq&_=1669609973472',
  870. success: res => {
  871. if (res.statusCode == 200) {
  872. var s = res.data
  873. s = s.substring(7, s.length - 1)
  874. s = JSON.parse(s)
  875. var d = [];
  876. var size = s.datas.length <= 5 ? s.datas.length : 5
  877. if (size < 1) {
  878. this.setData({
  879. isNaEmpty: true
  880. })
  881. } else {
  882. this.setData({
  883. isNaEmpty: false
  884. })
  885. }
  886. for (let i = 0; i < size; i++) {
  887. d.push({
  888. "DOCTITLE": s.datas[i].title,
  889. "url": s.datas[i].url
  890. })
  891. }
  892. // wx.showToast({title: '加载完成',icon: 'success',duration: 500})
  893. this.setData({
  894. isNaLoading: false
  895. })
  896. this.setData({
  897. naContentList: d
  898. })
  899. } else {
  900. this.setData({
  901. isNaLoading: false,
  902. isNaEmpty: true
  903. })
  904. }
  905. }
  906. })
  907. }
  908. if (e.currentTarget.dataset.item == 2) {
  909. // wx.showToast({title: '加载中',icon: 'loading',duration: 1000})
  910. this.setData({
  911. isNaLoading: true
  912. })
  913. wx.request({
  914. url: 'https://www.gov.cn/pushinfo/v150203/pushinfo.jsonp?pushInfoJsonpCallBack=pushInfoJsonpCallBack&_=1669609973471',
  915. success: res => {
  916. console.log(res);
  917. if (res.statusCode == 200) {
  918. var s = res.data
  919. s = s.substring(22, s.length - 1)
  920. s = JSON.parse(s)
  921. console.log(s);
  922. var d = [];
  923. var size = s.length <= 5 ? s.length : 5
  924. if (size < 1) {
  925. this.setData({
  926. isNaEmpty: true
  927. })
  928. } else {
  929. this.setData({
  930. isNaEmpty: false
  931. })
  932. }
  933. for (let i = 0; i < size; i++) {
  934. d.push({
  935. "DOCTITLE": s[i].description,
  936. "url": s[i].link
  937. })
  938. }
  939. this.setData({
  940. isNaLoading: false
  941. })
  942. // wx.showToast({title: '加载完成',icon: 'success',duration: 500})
  943. this.setData({
  944. naContentList: d
  945. })
  946. } else {
  947. this.setData({
  948. isNaLoading: false,
  949. isNaEmpty: true
  950. })
  951. }
  952. }
  953. })
  954. }
  955. if (e.currentTarget.dataset.item == 0) {
  956. let column = ["20430", "59482", "59481"]
  957. // wx.showToast({title: '加载中',icon: 'loading',duration: 1000})
  958. this.setData({
  959. isNaLoading: true
  960. })
  961. send(1, 5, column[e.currentTarget.dataset.item]).then(res => {
  962. if (res.result) {
  963. // wx.showToast({title: '加载完成',icon: 'success',duration: 500})
  964. this.setData({
  965. isNaLoading: false
  966. })
  967. if (res.data.DATA.length < 1) {
  968. this.setData({
  969. isNaEmpty: true
  970. })
  971. } else {
  972. this.setData({
  973. isNaEmpty: false
  974. })
  975. }
  976. this.setData({
  977. naContentList: res.data.DATA
  978. })
  979. } else {
  980. this.setData({
  981. isNaLoading: false,
  982. isNaEmpty: true
  983. })
  984. }
  985. })
  986. }
  987. },
  988. // 南岸咨询内容点击
  989. clickNaContent: function (e) {
  990. let item = e.currentTarget.dataset.item
  991. switch (this.data.naTab) {
  992. case 0:
  993. wx.navigateTo({
  994. url: '/pages/articlDetail/articlDetail?CHNLID=' + item.CHNLID + '&DOCID=' + item.DOCID,
  995. })
  996. break
  997. case 1:
  998. case 2:
  999. wx.navigateTo({
  1000. url: '/pages/web/web?url=' + item.url,
  1001. })
  1002. break
  1003. }
  1004. },
  1005. // 南岸咨询更多
  1006. naMore: function (e) {
  1007. let title = '';
  1008. switch (this.data.naTab) {
  1009. case 0:
  1010. title = '南岸动态'
  1011. wx.navigateTo({
  1012. url: '/pages/aticleList/aticleList?title=' + title + '&id=1',
  1013. })
  1014. break
  1015. case 1:
  1016. title = '今日重庆'
  1017. wx.navigateTo({
  1018. url: '/pages/aticleList/aticleList?title=' + title + '&id=2',
  1019. })
  1020. break
  1021. case 2:
  1022. title = '国务院信息'
  1023. wx.navigateTo({
  1024. url: '/pages/aticleList/aticleList?title=' + title + '&id=3',
  1025. })
  1026. break
  1027. }
  1028. },
  1029. // 政民互动
  1030. communicateChangeItem: function (e) {
  1031. this.setData({
  1032. communicateItem: e.currentTarget.dataset.item
  1033. })
  1034. },
  1035. communicateChangeTab: function (e) {
  1036. this.setData({
  1037. communicateTab: e.detail.current
  1038. })
  1039. if (this.data.communicateTab == 1) {
  1040. this.getInvestigation(false)
  1041. }
  1042. },
  1043. // 意见征集接口
  1044. yjzjData() {
  1045. yjzjList().then(res => {
  1046. var list = []
  1047. if (res.statusCode == 200 && res.datas.pageInfo.totalResults > 0) {
  1048. list = res.datas.data
  1049. for (var i = 0; i < list.length; i++) {
  1050. list[i].beginTime = this.formatDateNumber(new Date(list[i].beginTime * 1))
  1051. list[i].endTime = this.formatDateNumber(new Date(list[i].endTime * 1))
  1052. }
  1053. this.setData({
  1054. 'yjzjDataList': list
  1055. })
  1056. }
  1057. })
  1058. },
  1059. // 获取在线调查列表
  1060. getInvestigation(flag) {
  1061. this.setData({
  1062. isOnlineLoading: true
  1063. })
  1064. var data = []
  1065. wx.request({
  1066. url: `https://www.cqna.gov.cn/IGI/open/survey/list?siteId=254&pageIndex=${this.data.investigatePage}&pageSize=10&orderBy=startTime_desc`,
  1067. method: 'GET',
  1068. success: res => {
  1069. data = res.data.datas.data
  1070. if (data && data.length > 0) {
  1071. for (var i = 0; i < data.length; i++) {
  1072. data[i].startTime = this.formatDateNumber(new Date(data[i].startTime * 1))
  1073. data[i].endTime = this.formatDateNumber(new Date(data[i].endTime * 1))
  1074. }
  1075. data = this.data.investigateList.concat(data)
  1076. this.setData({
  1077. 'isOnlineLoading': false,
  1078. 'investigateList': data,
  1079. 'investigatePage': this.data.investigatePage + 1
  1080. })
  1081. } else {
  1082. this.setData({
  1083. 'isOnlineLoading': false
  1084. })
  1085. // 下拉刷新会提示加载完成
  1086. if (flag) {
  1087. this.setData({
  1088. 'isOnlineFinish': true
  1089. })
  1090. setTimeout(() => {
  1091. this.setData({
  1092. isOnlineFinish: false
  1093. })
  1094. }, 600)
  1095. }
  1096. }
  1097. },
  1098. fail: res => {
  1099. this.setData({
  1100. 'isOnlineLoading': false
  1101. })
  1102. }
  1103. })
  1104. },
  1105. // 在线调查触底
  1106. investigationScrollBottom(e) {
  1107. this.getInvestigation(true)
  1108. },
  1109. goToInvestigationDetail(e) {
  1110. const id = e.target.dataset.id
  1111. const siteId = e.target.dataset.siteid
  1112. wx.navigateTo({
  1113. url: '/pages/web/web?wxUrl=' + encodeURIComponent(`https://www.cqna.gov.cn/personalCenter/answerSheet/answerSheet.html?siteId=${siteId}&metadataId=${id}`),
  1114. })
  1115. },
  1116. goYjzjDetail(e) {
  1117. const html = e.currentTarget.dataset.item
  1118. const title = e.currentTarget.dataset.theme
  1119. wx.navigateTo({
  1120. url: `/pages/yjzjDetail/yjzjDetail?html=${encodeURIComponent(html)}&title=${title}`
  1121. })
  1122. },
  1123. // 日期格式化
  1124. formatDateNumber: function (date) {
  1125. let myYear = date.getFullYear();
  1126. let myMonth = date.getMonth() + 1;
  1127. let myWeekDay = date.getDate();
  1128. return myYear + "-" + myMonth + "-" + myWeekDay
  1129. },
  1130. toList: function () {
  1131. wx.navigateTo({
  1132. url: '/pages/programList/programList',
  1133. })
  1134. },
  1135. toLeaveMessage: function () {
  1136. wx.navigateTo({
  1137. url: '/pages/leaveMessage/leaveMessage',
  1138. })
  1139. },
  1140. // 媒体矩阵
  1141. swichNav: function (e) {
  1142. var that = this;
  1143. if (this.data.mediaCurrentTab === e.target.dataset.current) {
  1144. return false;
  1145. } else {
  1146. that.setData({
  1147. mediaCurrentTab: e.target.dataset.current,
  1148. navScrollLeft: e.target.dataset.current >= 2 ? ((e.target.dataset.current - 1) * 215) : 0
  1149. })
  1150. }
  1151. },
  1152. SPTJImgError(e) {
  1153. let temp = this.data.videoInfo;
  1154. temp[e.currentTarget.dataset.index].images = null;
  1155. this.setData({
  1156. videoInfo: temp
  1157. })
  1158. },
  1159. // 获取视频推荐数据
  1160. getVideoRecommend() {
  1161. this.setData({
  1162. isVideoLoading: true
  1163. })
  1164. getNanVideo().then(res => {
  1165. this.setData({
  1166. isVideoLoading: false
  1167. })
  1168. if (res.data.length <= 0) {
  1169. this.setData({
  1170. isVideoEmpty: true
  1171. })
  1172. } else {
  1173. this.setData({
  1174. isVideoEmpty: false,
  1175. videoInfo: res.data
  1176. })
  1177. }
  1178. })
  1179. },
  1180. gotoVideoDetail(e) {
  1181. wx.navigateTo({
  1182. url: '/pages/web/web?wxUrl=' + encodeURIComponent(e.currentTarget.dataset.url)
  1183. })
  1184. },
  1185. // 获取媒体矩阵南岸发布数据
  1186. getMediaReleaseList() {
  1187. let date = new Date();
  1188. let year = date.getFullYear()
  1189. let month = date.getMonth() + 1
  1190. let day = date.getDate()
  1191. let time = year + "-" + month + "-" + day;
  1192. this.setData({
  1193. isNafaLoading: true
  1194. })
  1195. wx.request({
  1196. url: 'https://www.cqna.gov.cn/data/article/getNAFBArticleByDate?date=' + time,
  1197. method: 'GET',
  1198. success: res => {
  1199. this.setData({
  1200. isNafaLoading: false,
  1201. mediaReleaseList: res.data.data
  1202. })
  1203. },
  1204. fail: res => {
  1205. this.setData({
  1206. isNafaLoading: false
  1207. })
  1208. }
  1209. })
  1210. },
  1211. gotoReleaseDetail(e) {
  1212. wx.navigateTo({
  1213. url: '/pages/web/web?wxUrl=' + encodeURIComponent(e.currentTarget.dataset.url),
  1214. })
  1215. },
  1216. // 获取媒体矩阵今日头条数据
  1217. getMediaHeadlineList() {
  1218. wx.request({
  1219. url: 'https://www.cqna.gov.cn/data/article/getAllOfficialAccount?official=重庆市南岸区人民政府',
  1220. method: 'GET',
  1221. success: res => {
  1222. this.setData({
  1223. mediaHeadlineList: res.data.data.jrtt
  1224. })
  1225. }
  1226. })
  1227. },
  1228. gotoHeadlineDetail(e) {
  1229. wx.navigateTo({
  1230. url: '/pages/web/web?wxUrl=' + encodeURIComponent(e.currentTarget.dataset.url),
  1231. })
  1232. },
  1233. mediaBindChange: function (e) {
  1234. var that = this;
  1235. that.setData({
  1236. mediaCurrentTab: e.detail.current,
  1237. navScrollLeft: e.detail.current >= 2 ? ((e.detail.current - 1) * 215) : 0
  1238. });
  1239. },
  1240. getUserProfile() {
  1241. wx.setStorageSync('nickname', "");
  1242. wx.setStorageSync('avatarUrl', "");
  1243. wx.getUserProfile({
  1244. desc: '获取用户信息',
  1245. success: (res) => {
  1246. wx.setStorageSync('nickname', res.userInfo.nickName);
  1247. wx.setStorageSync('avatarUrl', res.userInfo.avatarUrl);
  1248. wx.login({
  1249. success(res) {
  1250. if (res.code) {
  1251. //发起网络请求
  1252. data = {
  1253. code: res.code
  1254. }
  1255. login(data).then(res => {
  1256. console.log(res)
  1257. cacheSet('token', res.data.token, 3600 * 24)
  1258. // wx.setStorageSync("token", res.data.data)
  1259. })
  1260. } else {
  1261. console.log('登录失败!' + res.errMsg)
  1262. }
  1263. }
  1264. })
  1265. },
  1266. fail(res) {
  1267. console.log("获取用户信息失败", res)
  1268. }
  1269. })
  1270. },
  1271. //印象南岸进入
  1272. toYxna() {
  1273. wx.navigateTo({
  1274. url: "/pagesPublic/pages/yxnaJfq/yxnaJfq",
  1275. })
  1276. },
  1277. toJfq: function () {
  1278. wx.navigateTo({
  1279. url: '/pagesPublic/pages/yxnaJfq/yxnaJfq',
  1280. })
  1281. },
  1282. toJfh: function () {
  1283. wx.navigateTo({
  1284. url: '/pagesPublic/pages/yxnaJfh/yxnaJfh',
  1285. })
  1286. },
  1287. toXsj: function () {
  1288. wx.navigateTo({
  1289. url: '/pagesPublic/pages/yxna/yxna',
  1290. })
  1291. },
  1292. toQxn: function () {
  1293. wx.navigateTo({
  1294. url: '/pagesPublic/pages/yxnaQxn/yxnaQxn',
  1295. })
  1296. },
  1297. gotoSjzx() {
  1298. wx.navigateTo({
  1299. url: '/pages/dataCenter/dataCenter',
  1300. })
  1301. },
  1302. gotoZWTJ() {
  1303. wx.navigateTo({
  1304. url: '/pages/dataCenterZWTJ/dataCenterZWTJ',
  1305. })
  1306. },
  1307. gotoNewsPaper() {
  1308. wx.navigateTo({
  1309. url: '/pages/newsPaper/newsPaper',
  1310. })
  1311. },
  1312. gotoZlwd() {
  1313. wx.navigateTo({
  1314. url: '/pages/web/web?url=' + "https://www.cqna.gov.cn/ghwd/znwd/mobile/index.html",
  1315. })
  1316. },
  1317. gotoDTSS(e) {
  1318. const search = e.currentTarget.dataset.item
  1319. if (search && search != '') {
  1320. wx.navigateTo({
  1321. url: '/pages/map/map?se='+ search,
  1322. })
  1323. } else {
  1324. wx.navigateTo({
  1325. url: '/pages/map/map',
  1326. })
  1327. }
  1328. },
  1329. gotoMTJZ() {
  1330. wx.navigateTo({
  1331. url: '/pages/web/web?url=' + "https://data.cqna.gov.cn/newMedia/officialAccounts.html",
  1332. })
  1333. },
  1334. gotoSPTJ() {
  1335. wx.navigateTo({
  1336. url: '/pages/videoRecommend/videoRecommend',
  1337. })
  1338. },
  1339. gotoNAB() {
  1340. // wx.navigateTo({
  1341. // url: '/pages/phoneNewsPaper/phoneNewsPaper',
  1342. // })
  1343. wx.navigateTo({
  1344. url: '/pages/web/web?url=' + "http://www.cqna.com.cn/na_Class/node_24150.html",
  1345. })
  1346. },
  1347. showLogoDialog(e) {
  1348. this.setData({
  1349. ewmName: e.target.dataset.name,
  1350. ewmUrl: e.target.dataset.ewm
  1351. })
  1352. wx.navigateTo({
  1353. url: '/pages/web/web?url=https://www.cqna.gov.cn/data/newMedia/officialAccounts.html',
  1354. })
  1355. },
  1356. closeDialog() {
  1357. this.setData({
  1358. ewmShowDialog: false
  1359. })
  1360. },
  1361. toZMHD() {
  1362. wx.navigateTo({
  1363. url: '/pages/zmhd/zmhd',
  1364. })
  1365. },
  1366. callTheHotline() {
  1367. wx.makePhoneCall({
  1368. phoneNumber: '12345',
  1369. })
  1370. },
  1371. gotoZxft() {
  1372. wx.navigateTo({
  1373. url: '/pages/zxft/fileList',
  1374. })
  1375. },
  1376. gototsjy() {
  1377. wx.navigateTo({
  1378. url: '/pages/blankpage/blankpage?name=投诉建议',
  1379. })
  1380. },
  1381. // 点击百姓聚焦item
  1382. clickFocus(e) {
  1383. var id = e.currentTarget.dataset.id
  1384. switch(id) {
  1385. case 1: {
  1386. wx.makePhoneCall({
  1387. phoneNumber: "12345",
  1388. success: function () {
  1389. },
  1390. fail: function () {
  1391. }
  1392. })
  1393. };break;
  1394. case 2: {
  1395. wx.navigateToMiniProgram({
  1396. appId: 'wxfc86707bae655315',
  1397. success(res) {
  1398. // 打开成功
  1399. }
  1400. })
  1401. };break;
  1402. case 3: {
  1403. wx.navigateTo({
  1404. url: '/pages/web/web?url=' + "https://www.cqna.gov.cn/zjna/gyw/#tryb",
  1405. })
  1406. };break;
  1407. case 4: {
  1408. wx.navigateTo({
  1409. url: '/pages/web/web?url=' + "https://www.cqna.gov.cn/zjna/nbl/#yhnb",
  1410. })
  1411. };break;
  1412. case 5: {
  1413. wx.navigateTo({
  1414. url: '/pages/web/web?url=' + "https://www.cqna.gov.cn/zjna/ns/hlns/nsjd/202209/t20220921_11130108.html",
  1415. })
  1416. };break;
  1417. case 6: {
  1418. this.toYxna()
  1419. };break;
  1420. }
  1421. },
  1422. /**
  1423. * 用户点击右上角分享
  1424. */
  1425. onShareAppMessage() {
  1426. return {
  1427. title: '首页'
  1428. }
  1429. }
  1430. })