微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

770 lines
21 KiB

  1. // pages/regular/index.js
  2. import * as UTIL from '../../utils/util.js';
  3. import * as API from '../../utils/API.js';
  4. let EVN_CONFIG = require('../../env/env');
  5. const app = getApp();
  6. Page({
  7. /**
  8. * 页面的初始数据
  9. */
  10. data: {
  11. isIPX: app.globalData.isIPX,
  12. option1: [],
  13. option2: [],
  14. option3: [],
  15. list: [],
  16. value1: '',
  17. value2: '',
  18. value3: '',
  19. showPopup:false,
  20. result1:'',
  21. result2:'',
  22. result3:'',
  23. beginApplyDate:'' , //申请开始时间
  24. endApplyDate: '' , //申请结束时间
  25. txnamtMin: '' , //金额范围 最小
  26. xnamtMax: '' , //金额范围最大
  27. showDialog:false,
  28. beforeClose(action) {
  29. return new Promise((resolve) => {
  30. setTimeout(() => {
  31. if (action === 'confirm') {
  32. // 拦截确认操作
  33. resolve(false);
  34. } else {
  35. resolve(true);
  36. }
  37. }, 0);
  38. });
  39. },
  40. projectId:'',
  41. projectValue:'',
  42. pageNums:1,
  43. params:{
  44. actacn:'' , //付款账户
  45. payeeActacn: '' , //收款账号
  46. payeeToname:'' , //收款人
  47. transtype:'' ,// 业务类型 数据字典:trans_type
  48. direction:'' ,// 来往账标识 数据字典:direction
  49. pageSize:'10',
  50. pageNum:1,
  51. method:'POST',
  52. },
  53. recordform: {},
  54. formSms: {},
  55. recordopen4: false
  56. },
  57. /**
  58. * 生命周期函数--监听页面加载
  59. */
  60. onLoad(options) {
  61. var that = this;
  62. let qu = wx.createSelectorQuery()
  63. qu.select("#top_view").boundingClientRect()
  64. qu.select("#top_ban").boundingClientRect()
  65. qu.select("#top_view1").boundingClientRect()
  66. qu.select("#top_view2").boundingClientRect()
  67. qu.exec(res => {
  68. console.log(res);
  69. that.setData({
  70. scrollHeight:wx.getWindowInfo().windowHeight-res[3].top
  71. })
  72. })
  73. // 对账状态字典查询
  74. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'check_status', {method:'GET'}, {
  75. success: (res) => {
  76. that.setData({
  77. checkStatusOptions:res.data,
  78. })
  79. }
  80. })
  81. // 业务类型字典查询
  82. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'trans_type', {method:'GET'}, {
  83. success: (res) => {
  84. let option2 = [{
  85. text: '业务类型', value: ''
  86. }];
  87. res.data.map(rr=>{
  88. option2.push({
  89. text: rr.dictLabel, value: rr.dictValue
  90. })
  91. })
  92. that.setData({
  93. option2:option2,
  94. transTypeOptions:res.data,
  95. })
  96. }
  97. })
  98. // 来往账标识字典查询
  99. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'direction', {method:'GET'}, {
  100. success: (res) => {
  101. let option3 = [];
  102. res.data.map(rr=>{
  103. option3.push({
  104. text: rr.dictLabel, value: rr.dictValue
  105. })
  106. })
  107. option3[0].text = '来往账标识';
  108. that.setData({
  109. option3:option3,
  110. value3:res.data[0].dictValue,
  111. result3:res.data[0].dictValue,
  112. directionOptions:res.data,
  113. })
  114. }
  115. })
  116. var sendData = {
  117. pageNum:'1',
  118. pageSize:'100',
  119. accountName:'',
  120. bankAccountNumber:'',
  121. status:'N',
  122. method:'GET',
  123. accountType:102
  124. }
  125. UTIL.httpRequest(API.URL_GET_ACCOUNTLIST, sendData,{
  126. success: (res) => {
  127. console.log(res.rows)
  128. let option1 = [];
  129. res.rows.map(rr=>{
  130. console.log(rr);
  131. option1.push({
  132. text: rr.accountName, value: rr.bankAccountNumber
  133. })
  134. })
  135. that.setData({
  136. option1:option1,
  137. value1:res.rows[0].bankAccountNumber,
  138. result1:res.rows[0].bankAccountNumber,
  139. accountList:res.rows
  140. })
  141. console.log(res.rows[0].bankAccountNumber);
  142. let actacnName = (that.data.option1).filter(function (e) { return e.value == that.data.result1; });
  143. that.setData({
  144. actacnName:actacnName[0].text,
  145. ["params.actacn"]:res.rows[0].bankAccountNumber
  146. })
  147. that.getData();
  148. }
  149. })
  150. },
  151. getData(){
  152. var that = this;
  153. let data = that.data.list;
  154. //交易明细列表
  155. UTIL.httpRequest(API.URL_GET_GETRECORDETAILLIST , this.data.params, {
  156. success: (res) => {
  157. console.log(res);
  158. console.log(res.total +'---------------------'+ data.length);
  159. if(res.total <= data.length){
  160. return;
  161. }else{
  162. res.rows.map(rrr=>{
  163. rrr.directionText = UTIL.getTransform(rrr.direction,that.data.directionOptions);
  164. data.push(rrr);
  165. })
  166. that.setData({
  167. list:data
  168. })
  169. }
  170. }
  171. })
  172. },
  173. paging(){
  174. this.setData({
  175. pageNums:this.data.pageNums+1,
  176. })
  177. this.getData();
  178. },
  179. goSubmit(){
  180. var that = this ;
  181. let form = {
  182. actacn:that.data.result1 , //付款账户
  183. payeeActacn: '' , //收款账号
  184. payeeToname:'' , //收款人
  185. transtype:that.data.result2 ,// 业务类型 数据字典:trans_type
  186. direction:that.data.result3 ,// 来往账标识 数据字典:direction
  187. params:{
  188. beginTxnDate:that.data.beginApplyDate,
  189. endTxnDate:that.data.endApplyDate,
  190. txnamtMin:that.data.txnamtMin,
  191. txnamtMax:that.data.xnamtMax,
  192. },
  193. pageSize:'10',
  194. method:'POST',
  195. }
  196. console.log(form);
  197. UTIL.httpRequest(API.URL_GET_GETRECORDETAILLIST , form, {
  198. success: (res) => {
  199. res.rows.map(rrr=>{
  200. rrr.directionText = UTIL.getTransform(rrr.direction,that.data.directionOptions);
  201. })
  202. let actacnName = (that.data.option1).filter(function (e) { return e.value == that.data.result1; });
  203. that.setData({
  204. value1:that.data.result1,
  205. value2:that.data.result2,
  206. value3:that.data.result3,
  207. actacnName:actacnName[0].text,
  208. list:res.rows,
  209. showPopup:false
  210. })
  211. }
  212. })
  213. },
  214. bindDateBeginChange: function(e) {
  215. console.log('picker发送选择改变,携带值为', e.detail.value)
  216. this.setData({
  217. ['params.params.beginApplyDate']:e.detail.value,
  218. })
  219. },
  220. bindDateEndChange: function(e) {
  221. console.log('picker发送选择改变,携带值为', e.detail.value)
  222. this.setData({
  223. ['params.params.endApplyDate']:e.detail.value,
  224. })
  225. },
  226. reset(){
  227. this.setData({
  228. result2:'',
  229. txnamtMin:'',
  230. xnamtMax:'',
  231. beginApplyDate:'',
  232. endApplyDate:''
  233. })
  234. this.onLoad();
  235. },
  236. back:function(){
  237. wx.navigateBack({
  238. delta: 1
  239. })
  240. },
  241. showPopup(){
  242. var that = this;
  243. that.setData({
  244. showPopup:true
  245. })
  246. },
  247. onClose() {
  248. this.setData({
  249. showPopup: false,
  250. recordopen4: false
  251. });
  252. },
  253. onChangeZH(event) {
  254. console.log(event.detail);
  255. this.setData({
  256. result1: event.detail,
  257. });
  258. },
  259. onChangeLX(event) {
  260. console.log(event.detail);
  261. this.setData({
  262. result2: event.detail,
  263. });
  264. },
  265. onChangeBS(event) {
  266. console.log(event.detail);
  267. this.setData({
  268. result3: event.detail,
  269. });
  270. },
  271. changeTab1(event){
  272. var that = this ;
  273. let actacnName = (that.data.option1).filter(function (e) { return e.value == event.detail; });
  274. this.setData({
  275. result1: event.detail,
  276. value1: event.detail,
  277. actacnName:actacnName[0].text,
  278. ['params.actacn']:event.detail,
  279. ['params.pageNum']:1,
  280. list:[]
  281. });
  282. this.getData();
  283. },
  284. changeTab2(event){
  285. this.setData({
  286. result2: event.detail,
  287. value2: event.detail,
  288. ['params.transtype']:event.detail,
  289. ['params.pageNum']:1,
  290. list:[]
  291. });
  292. this.getData();
  293. },
  294. changeTab3(event){
  295. this.setData({
  296. result3: event.detail,
  297. value3: event.detail,
  298. ['params.direction']:event.detail,
  299. ['params.pageNum']:1,
  300. list:[]
  301. });
  302. this.getData();
  303. },
  304. minInput(e){
  305. var that = this ;
  306. that.setData({
  307. ['params.params.txnamtMin']:e.detail.value,
  308. })
  309. },
  310. maxInput(e){
  311. var that = this ;
  312. that.setData({
  313. ['params.params.xnamtMax']:e.detail.value,
  314. })
  315. },
  316. openDZ(e){
  317. var that = this;
  318. that.setData({
  319. projectId:'',
  320. projectValue:''
  321. })
  322. var id = e.currentTarget.dataset.id;
  323. that.setData({
  324. showDialog:true,
  325. projectId:id
  326. })
  327. },
  328. goDZ(e){
  329. var that = this ;
  330. var form = {
  331. manualRemark:that.data.projectValue,
  332. id:that.data.projectId,
  333. method:'POST'
  334. }
  335. console.log(form);
  336. UTIL.httpRequest(API.URL_GET_GETTRANSFEREDIT , form, {
  337. success: (res) => {
  338. that.setData({
  339. showDialog:false
  340. })
  341. wx.showToast({
  342. title: '保存成功',
  343. icon: 'success',
  344. duration: 2000,
  345. })
  346. }
  347. })
  348. },
  349. bindNameInput(e){
  350. var that = this;
  351. var value = e.detail.value;
  352. that.setData({
  353. projectValue:value
  354. })
  355. },
  356. toPayDetail(e){
  357. let id = e.currentTarget.dataset.id;
  358. wx.navigateTo({
  359. url: 'transactionDetail/transactionDetail?id='+id,
  360. })
  361. },
  362. goHD(e){
  363. let url = e.currentTarget.dataset.url;
  364. let alternateField1 = e.currentTarget.dataset.field1;
  365. let alternateField4 = e.currentTarget.dataset.field4;
  366. let alternateField9 = e.currentTarget.dataset.field9;
  367. let id = e.currentTarget.dataset.id;
  368. console.log(alternateField1);
  369. console.log(alternateField4);
  370. console.log(alternateField9);
  371. if (alternateField1=='3') {
  372. if (url==null) {
  373. UTIL.httpRequest(API.URL_GET_GETDIANZIHUIDAN1 + id , {method:'GET'}, {
  374. success: (res) => {
  375. console.log(res);
  376. url = res.data.alternateField2;
  377. wx.navigateTo({
  378. url: 'receipt/receipt?url='+url,
  379. })
  380. }
  381. })
  382. }else if(url.indexOf('失败')>-1){
  383. UTIL.showToastNoneIcon(url);
  384. }else{
  385. wx.navigateTo({
  386. url: 'receipt/receipt?url='+url,
  387. })
  388. }
  389. }
  390. if (alternateField4!=null) {
  391. console.log('aaa');
  392. if (url==null) {
  393. UTIL.httpRequest(API.URL_GET_GETDIANZIHUIDAN2 + id , {method:'GET'}, {
  394. success: (res) => {
  395. console.log(res);
  396. url = res.data.alternateField2;
  397. wx.navigateTo({
  398. url: 'receipt/receipt?url='+url,
  399. })
  400. }
  401. })
  402. }else if(url.indexOf('失败')>-1){
  403. UTIL.showToastNoneIcon(url);
  404. }else{
  405. wx.navigateTo({
  406. url: 'receipt/receipt?url='+url,
  407. })
  408. }
  409. }
  410. if (alternateField1=='2' && alternateField9!='' && alternateField9!=null) {
  411. if (url==null) {
  412. UTIL.httpRequest(API.URL_GET_GETDIANZIHUIDAN3 + id , {method:'GET'}, {
  413. success: (res) => {
  414. console.log(res);
  415. url = res.data.alternateField2;
  416. wx.navigateTo({
  417. url: 'receipt/receipt?url='+url,
  418. })
  419. }
  420. })
  421. }else if(url.indexOf('失败')>-1){
  422. UTIL.showToastNoneIcon(url);
  423. }else{
  424. wx.navigateTo({
  425. url: 'receipt/receipt?url='+url,
  426. })
  427. }
  428. }
  429. },
  430. showTransactionDialog(){
  431. wx.navigateTo({
  432. url: 'receipt/receipt',
  433. })
  434. },
  435. goSearch(e){
  436. console.log(e);
  437. var that = this;
  438. let form = {
  439. payeeToname:e.detail , //收款人
  440. params:{
  441. beginTxnDate:that.data.beginApplyDate,
  442. endTxnDate:that.data.endApplyDate,
  443. txnamtMin:that.data.txnamtMin,
  444. txnamtMax:that.data.xnamtMax,
  445. },
  446. }
  447. this.setData({
  448. list:[],
  449. ['params.payeeToname']:e.detail
  450. });
  451. this.getData();
  452. // UTIL.httpRequest(API.URL_GET_GETRECORDETAILLIST , form, {
  453. // success: (res) => {
  454. // res.rows.map(rrr=>{
  455. // rrr.directionText = UTIL.getTransform(rrr.direction,that.data.directionOptions);
  456. // })
  457. // that.setData({
  458. // list:res.rows,
  459. // showPopup:false
  460. // })
  461. // }
  462. // })
  463. },
  464. /**
  465. * 生命周期函数--监听页面初次渲染完成
  466. */
  467. onReady() {
  468. },
  469. /**
  470. * 生命周期函数--监听页面显示
  471. */
  472. onShow() {
  473. },
  474. /**
  475. * 生命周期函数--监听页面隐藏
  476. */
  477. onHide() {
  478. },
  479. /**
  480. * 生命周期函数--监听页面卸载
  481. */
  482. onUnload() {
  483. },
  484. /**
  485. * 页面相关事件处理函数--监听用户下拉动作
  486. */
  487. onPullDownRefresh() {
  488. },
  489. /**
  490. * 页面上拉触底事件的处理函数
  491. */
  492. onReachBottom() {
  493. },
  494. /**
  495. * 用户点击右上角分享
  496. */
  497. onShareAppMessage() {
  498. },
  499. handleHuidan(rows) {
  500. console.log(rows);
  501. this.data.recordform.id = rows.currentTarget.dataset.row.id;
  502. this.data.recordform.method = 'GET';
  503. this.data.recordListOpen = false;
  504. UTIL.httpRequest(API.transactionDetailsQuery2OnlyQuery , this.data.recordform, {
  505. success: (response) => {
  506. this.setData({
  507. tYinnongTradingRecordDetailList: response.data,
  508. recordListOpen: true,
  509. title: "查看回单列表数据"
  510. })
  511. }
  512. })
  513. },
  514. handleView1(rows){
  515. let dataRow = rows.currentTarget.dataset.row;
  516. if(dataRow.alternateField2 != null && dataRow.alternateField2 != "" && dataRow.alternateField2.indexOf('失败') == -1){
  517. this.showfileFunction(dataRow.alternateField2);
  518. } else{
  519. UTIL.showToastNoneIcon("暂无回单,请到村账户模块查询电子回单!");
  520. }
  521. },
  522. handleView2(rows){
  523. this.checkId = rows.currentTarget.dataset.row.id;
  524. this.yinnongTransfersIndexOpen = false;
  525. this.tYinnongTransferDetaiList = [];
  526. const baseURL = wx.getStorageSync('dressCode');
  527. //console.info(baseURL);
  528. const id = rows.currentTarget.dataset.row.id || this.ids
  529. if(rows.currentTarget.dataset.row.alternateField2 != null && rows.currentTarget.dataset.row.alternateField2 != "" && rows.currentTarget.dataset.row.alternateField2.indexOf('失败') == -1){
  530. this.receiptUrl = baseURL+rows.currentTarget.dataset.row.alternateField2;
  531. this.recordopen = true;
  532. if(rows.currentTarget.dataset.row.transferId != null){
  533. this.yinnongTransfersListOpen = true;
  534. this.yinnongTransfersIndexApplyOpen = false;
  535. this.tYinnongTransferDetaiList=[];
  536. queryTransferDetail(rows.currentTarget.dataset.row.transferId).then((res) => {
  537. this.yinnongTransfersIndexOpen = true;
  538. for (let i = 0 ; i < res.rows.length; i++){
  539. res.rows[i].transferStatus = this.transferStatusFormat(res.rows[i])
  540. this.tYinnongTransferDetaiList.push(res.rows[i])
  541. }
  542. });
  543. }else{
  544. this.yinnongTransfersListOpen = false;
  545. }
  546. } else {
  547. bankReceiptPhoto(rows.currentTarget.dataset.row.id).then((response) => {
  548. //console.info(response);
  549. if (response.code === 200) {
  550. this.receiptUrl =baseURL+ response.msg;
  551. this.recordopen = true;
  552. this.getList();
  553. }
  554. });
  555. }
  556. },
  557. handleView3(rows){
  558. const id = rows.currentTarget.dataset.row.id;
  559. let dataRow = rows.currentTarget.dataset.row;
  560. if(dataRow.alternateField2 != null && dataRow.alternateField2 != "" && dataRow.alternateField2.indexOf('失败') == -1){
  561. this.showfileFunction(dataRow.alternateField2);
  562. } else{
  563. UTIL.httpRequest(API.getDianzihuidan + id , {method: 'GET'}, {
  564. success: (response) => {
  565. if(response.data.alternateField2 != null && response.data.alternateField2 != "" && response.data.alternateField2.indexOf('失败') ==-1){
  566. this.showfileFunction(response.data.alternateField2);
  567. } else{
  568. UTIL.showToastNoneIcon(response.data.alternateField2);
  569. }
  570. }
  571. })
  572. }
  573. },
  574. handleView4(rows){
  575. let row = rows.currentTarget.dataset.row;
  576. if(row.alternateField2 != null && row.alternateField2 != "" && row.alternateField2.indexOf('失败') == -1){
  577. this.showfileFunction(row.alternateField2);
  578. } else {
  579. UTIL.httpRequest(API.queryReceiptPhoto4 + row.id , {method: 'GET'}, {
  580. success: (response) => {
  581. this.setData({
  582. recordopen4: true
  583. })
  584. }
  585. })
  586. }
  587. },
  588. handleView5(rows){
  589. let dataRow = rows.currentTarget.dataset.row;
  590. if(dataRow.alternateField2 != null && dataRow.alternateField2 != "" && dataRow.alternateField2.indexOf('失败') == -1){
  591. this.showfileFunction(dataRow.alternateField2);
  592. } else {
  593. UTIL.httpRequest(API.queryReceiptPhoto5 + dataRow.id , {method: 'GET'}, {
  594. success: (response) => {
  595. if (response.code === 200) {
  596. this.showfileFunction(response.msg);
  597. }else{
  598. UTIL.showToastNoneIcon(response.msg);
  599. }
  600. }
  601. })
  602. }
  603. },
  604. handleView6(rows){
  605. let dataRow = rows.currentTarget.dataset.row;
  606. if(dataRow.alternateField2 != null && dataRow.alternateField2 != "" && dataRow.alternateField2.indexOf('失败') == -1){
  607. const filenames = dataRow.alternateField2.split("|");
  608. if(filenames.length == 1){
  609. this.showfileFunction(filenames[0]);
  610. }else{
  611. for (var i=0;i<filenames.length;i++){
  612. this.showfileFunction(filenames[i]);
  613. }
  614. }
  615. } else {
  616. UTIL.httpRequest(API.queryReceiptPhoto6 + dataRow.id , {method: 'GET'}, {
  617. success: (response) => {
  618. if (response.code === 200) {
  619. const filenames = response.msg.split("|");
  620. if(filenames.length == 1){
  621. this.showfileFunction(filenames[0]);
  622. }else{
  623. for (var i=0;i<filenames.length;i++){
  624. this.showfileFunction(filenames[i]);
  625. }
  626. }
  627. }else{
  628. UTIL.showToastNoneIcon(response.msg);
  629. }
  630. }
  631. })
  632. }
  633. },
  634. handleView8(rows){
  635. let dataRow = rows.currentTarget.dataset.row;
  636. if(dataRow.alternateField2 != null && dataRow.alternateField2 != "" && dataRow.alternateField2.indexOf('失败') == -1){
  637. const filenames = dataRow.alternateField2.split("|");
  638. if(filenames.length == 1){
  639. this.showfileFunction(filenames[0]);
  640. }else{
  641. for (var i=0;i<filenames.length;i++){
  642. this.showfileFunction(filenames[i]);
  643. }
  644. }
  645. } else {
  646. UTIL.httpRequest(API.queryReceiptPhoto8 + dataRow.id , {method: 'GET'}, {
  647. success: (response) => {
  648. if (response.code === 200) {
  649. const filenames = response.msg.split("|");
  650. if(filenames.length == 1){
  651. this.showfileFunction(filenames[0]);
  652. }else{
  653. for (var i=0;i<filenames.length;i++){
  654. this.showfileFunction(filenames[i]);
  655. }
  656. }
  657. }else{
  658. UTIL.showToastNoneIcon(response.msg);
  659. }
  660. }
  661. })
  662. }
  663. },
  664. handleView18(rows){
  665. let dataRow = rows.currentTarget.dataset.row;
  666. if(dataRow.alternateField2 != null && dataRow.alternateField2 != "" && dataRow.alternateField2.indexOf('失败') == -1){
  667. this.showfileFunction(dataRow.alternateField2);
  668. } else{
  669. UTIL.httpRequest(API.queryReceiptPhoto18 + dataRow.id , {method: 'GET'}, {
  670. success: (response) => {
  671. if (response.code === 200) {
  672. if(response.data.alternateField2 != null && response.data.alternateField2 != "" && response.data.alternateField2.indexOf('失败') ==-1){
  673. this.showfileFunction(response.data.alternateField2);
  674. } else{
  675. UTIL.showToastNoneIcon(response.msg);
  676. }
  677. }else{
  678. UTIL.showToastNoneIcon(response.msg);
  679. }
  680. }
  681. })
  682. }
  683. },
  684. handleView10(rows){
  685. let dataRow = rows.currentTarget.dataset.row;
  686. if(dataRow.alternateField2 != null && dataRow.alternateField2 != "" && dataRow.alternateField2.indexOf('失败') == -1){
  687. this.showfileFunction(dataRow.alternateField2);
  688. } else{
  689. UTIL.httpRequest(API.queryReceiptPhoto10 + dataRow.id , {method: 'GET'}, {
  690. success: (response) => {
  691. if (response.code === 200) {
  692. if(response.msg != null && response.msg != "" && response.msg.indexOf('失败') ==-1){
  693. this.showfileFunction(response.msg);
  694. } else{
  695. UTIL.showToastNoneIcon(response.msg);
  696. }
  697. }else{
  698. UTIL.showToastNoneIcon(response.msg);
  699. }
  700. }
  701. })
  702. }
  703. },
  704. /** 绑定手机号操作 */
  705. smsSubmitForm() {
  706. this.formSms.method = 'GET';
  707. UTIL.httpRequest(API.bankReceiptPhoto4sms , this.formSms, {
  708. success: (response) => {
  709. if (response.code === 200) {
  710. this.setData({
  711. recordopen4: false
  712. })
  713. this.showfileFunction(response.msg);
  714. }else{
  715. UTIL.showToastNoneIcon(response.msg);
  716. }
  717. }
  718. })
  719. },
  720. showfileFunction(url){
  721. const baseURL = wx.getStorageSync('dressCode');
  722. if(url.indexOf('pdf') < 0){
  723. wx.previewImage({
  724. current: baseURL+ url, // 当前显示图片的http链接
  725. urls: [baseURL+ url] // 需要预览的图片http链接列表
  726. })
  727. }else{
  728. wx.downloadFile({
  729. // 示例 url,并非真实存在
  730. url: baseURL+url,
  731. success: function (res) {
  732. const filePath = res.tempFilePath;
  733. wx.openDocument({
  734. filePath: filePath,
  735. fileType: 'pdf', // 注意这里需要指定文件类型为'pdf'
  736. success: function (res) {
  737. console.log('打开文档成功');
  738. },
  739. fail: function (err) {
  740. UTIL.showToastNoneIcon('打开文档失败');
  741. }
  742. });
  743. },
  744. fail: function (err) {
  745. UTIL.showToastNoneIcon('下载文件失败');
  746. }
  747. });
  748. }
  749. }
  750. })