Compare commits
2 Commits
26ec060327
...
cb58d3b439
Author | SHA1 | Date | |
---|---|---|---|
cb58d3b439 | |||
f00bcbe8d1 |
@ -1,5 +1,5 @@
|
||||
import { getReportDetail } from "../../../service/report";
|
||||
import { alertInfo, getPixelRatio } from "../../../utils/index";
|
||||
import { alertInfo, alertSuccess, getPixelRatio } from "../../../utils/index";
|
||||
import request from '../../../utils/request'
|
||||
import * as echarts from '../../components/echarts/echarts';
|
||||
const { OK } = request
|
||||
@ -134,18 +134,27 @@ Page({
|
||||
case 'develop':
|
||||
wx.setClipboardData({
|
||||
data: `http://1.92.72.5:8080/user-report/?report=${id}&tenement=${tenement}`,
|
||||
success: () => {
|
||||
alertSuccess("复制成功")
|
||||
}
|
||||
})
|
||||
break;
|
||||
// 体验版
|
||||
case 'trial':
|
||||
wx.setClipboardData({
|
||||
data: `http://1.92.72.5:8080/user-report/?report=${id}&tenement=${tenement}`,
|
||||
success: () => {
|
||||
alertSuccess("复制成功")
|
||||
}
|
||||
})
|
||||
break;
|
||||
// 正式版
|
||||
case 'release':
|
||||
wx.setClipboardData({
|
||||
data: `https://zgd.hbhcbn.com/user-report/?report=${id}&tenement=${tenement}`,
|
||||
success: () => {
|
||||
alertSuccess("复制成功")
|
||||
}
|
||||
})
|
||||
break;
|
||||
}
|
||||
|
@ -2,5 +2,7 @@
|
||||
<navigator title="百科详情" canBack="{{true}}" />
|
||||
<view class="contentWrapper">
|
||||
<view class="title">{{detail.title}}</view>
|
||||
<view class="content">{{detail.content}}</view>
|
||||
<view class="content">
|
||||
<rich-text nodes="{{detail.content}}"></rich-text>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -89,7 +89,7 @@ Page({
|
||||
noPermission() {
|
||||
Dialog.confirm({
|
||||
title: '提示',
|
||||
message: '当前手机号不是用电管理联系账号',
|
||||
message: '当前手机号未录入系统,请联系管理员,或点击手动绑定',
|
||||
confirmButtonText: '手动绑定',
|
||||
cancelButtonText: '取消',
|
||||
})
|
||||
|
@ -107,6 +107,16 @@ Page({
|
||||
handleDelete() {
|
||||
this.setData({ fileList: [] })
|
||||
},
|
||||
copy() {
|
||||
wx.setClipboardData({
|
||||
data: `河北华昌宝能售电有限公司
|
||||
建行新石北路支行
|
||||
13050161563600000908`,
|
||||
success: () => {
|
||||
alertSuccess("复制成功")
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
|
@ -11,6 +11,7 @@
|
||||
点击上传
|
||||
</van-button>
|
||||
</van-field>
|
||||
|
||||
</van-cell-group>
|
||||
|
||||
<view style="padding: 20rpx;">
|
||||
@ -23,4 +24,14 @@
|
||||
|
||||
<van-button bind:tap="handleSubmit" type="info" block style="margin-top: 20rpx;"> 提交 </van-button>
|
||||
</view>
|
||||
<van-dialog id="van-dialog" />
|
||||
<van-dialog id="van-dialog" />
|
||||
|
||||
<view style="margin: 30rpx;">
|
||||
<view style="display: flex; justify-content: space-between;margin-bottom: 30rpx;">
|
||||
请使用对公账号向以下账号汇款
|
||||
<view class="primaryTextBtn" bind:tap="copy"> 复制 </view>
|
||||
</view>
|
||||
<view> 河北华昌宝能售电有限公司 </view>
|
||||
<view> 建行新石北路支行 </view>
|
||||
<view> 13050161563600000908 </view>
|
||||
</view>
|
@ -51,8 +51,8 @@ Page({
|
||||
switch (envVersion) {
|
||||
// 开发版
|
||||
case 'develop':
|
||||
api = `http://localhost:9001`;
|
||||
// api = `https://zgd.hbhcbn.com/recharge-print-api-test`;
|
||||
// api = `http://localhost:9001`;
|
||||
api = `https://zgd.hbhcbn.com/recharge-print-api-test`;
|
||||
// api = `https://zgd.hbhcbn.com/recharge-print-api-test`;
|
||||
break;
|
||||
// 体验版
|
||||
@ -77,18 +77,33 @@ Page({
|
||||
alertInfo("下载文件失败")
|
||||
return;
|
||||
}
|
||||
wx.openDocument({
|
||||
filePath: res.tempFilePath,
|
||||
fileType: [ "pdf"], // 3. 这个必须写合法类型,不然下载不了 !!!
|
||||
success: function (res) {
|
||||
resolve()
|
||||
const fs = wx.getFileSystemManager()
|
||||
const newPath = `${wx.env.USER_DATA_PATH}/收据-${detail.time.slice(0, 10)}.pdf`
|
||||
fs.rename({
|
||||
oldPath: res.tempFilePath,
|
||||
newPath: newPath,
|
||||
success(r) {
|
||||
wx.openDocument({
|
||||
filePath: newPath,
|
||||
fileType: [ "pdf"], // 3. 这个必须写合法类型,不然下载不了 !!!
|
||||
success: function (res) {
|
||||
resolve()
|
||||
},
|
||||
fail: function (e) {
|
||||
alertError("打开失败")
|
||||
console.log('打开失败错误为', e)
|
||||
rej()
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: function (e) {
|
||||
alertError("打开失败")
|
||||
console.log('打开失败错误为', e)
|
||||
fail(res) {
|
||||
console.error(res)
|
||||
alertInfo("下载失败")
|
||||
rej()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -11,8 +11,15 @@
|
||||
"miniprogram": {
|
||||
"list": [
|
||||
{
|
||||
"name": "childPackage/pages/electricQuery/index",
|
||||
"pathName": "childPackage/pages/electricQuery/index",
|
||||
"name": "pages/publicTransfer/index",
|
||||
"pathName": "pages/publicTransfer/index",
|
||||
"query": "money=50&meterId=METER00071009940341737&tenementId=T00069259189616641&tenementName=%E5%8D%8E%E6%98%8C%E5%AE%9D%E8%83%BD&park=P00070370277523457",
|
||||
"launchMode": "default",
|
||||
"scene": null
|
||||
},
|
||||
{
|
||||
"name": "pages/special/index",
|
||||
"pathName": "pages/special/index",
|
||||
"query": "",
|
||||
"launchMode": "default",
|
||||
"scene": null
|
||||
|
@ -82,13 +82,12 @@ const parseResponse = function (response, url) {
|
||||
alertError("服务异常")
|
||||
return
|
||||
}
|
||||
// const { statusCode } = response;
|
||||
const { code } = response?.data || {};
|
||||
console.log('url', url,'code', code, 'response.data', response.data)
|
||||
if (!code) {
|
||||
const { statusCode } = response;
|
||||
if (!statusCode) {
|
||||
alertError("服务异常")
|
||||
return
|
||||
}
|
||||
console.log('url', url,'statusCode', statusCode, 'response.data', response)
|
||||
if (code === 401) {
|
||||
const currentUrl = getPageUrl()
|
||||
|
||||
@ -113,6 +112,8 @@ const parseResponse = function (response, url) {
|
||||
if (500 <= code && code < 600) {
|
||||
return { code: 500, message: "服务错误" }
|
||||
}
|
||||
const { code } = response?.data || {};
|
||||
|
||||
return response.data;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user