Compare commits

..

2 Commits

8 changed files with 75 additions and 20 deletions

View File

@ -1,5 +1,5 @@
import { getReportDetail } from "../../../service/report"; import { getReportDetail } from "../../../service/report";
import { alertInfo, getPixelRatio } from "../../../utils/index"; import { alertInfo, alertSuccess, getPixelRatio } from "../../../utils/index";
import request from '../../../utils/request' import request from '../../../utils/request'
import * as echarts from '../../components/echarts/echarts'; import * as echarts from '../../components/echarts/echarts';
const { OK } = request const { OK } = request
@ -134,18 +134,27 @@ Page({
case 'develop': case 'develop':
wx.setClipboardData({ wx.setClipboardData({
data: `http://1.92.72.5:8080/user-report/?report=${id}&tenement=${tenement}`, data: `http://1.92.72.5:8080/user-report/?report=${id}&tenement=${tenement}`,
success: () => {
alertSuccess("复制成功")
}
}) })
break; break;
// 体验版 // 体验版
case 'trial': case 'trial':
wx.setClipboardData({ wx.setClipboardData({
data: `http://1.92.72.5:8080/user-report/?report=${id}&tenement=${tenement}`, data: `http://1.92.72.5:8080/user-report/?report=${id}&tenement=${tenement}`,
success: () => {
alertSuccess("复制成功")
}
}) })
break; break;
// 正式版 // 正式版
case 'release': case 'release':
wx.setClipboardData({ wx.setClipboardData({
data: `https://zgd.hbhcbn.com/user-report/?report=${id}&tenement=${tenement}`, data: `https://zgd.hbhcbn.com/user-report/?report=${id}&tenement=${tenement}`,
success: () => {
alertSuccess("复制成功")
}
}) })
break; break;
} }

View File

@ -2,5 +2,7 @@
<navigator title="百科详情" canBack="{{true}}" /> <navigator title="百科详情" canBack="{{true}}" />
<view class="contentWrapper"> <view class="contentWrapper">
<view class="title">{{detail.title}}</view> <view class="title">{{detail.title}}</view>
<view class="content">{{detail.content}}</view> <view class="content">
<rich-text nodes="{{detail.content}}"></rich-text>
</view>
</view> </view>

View File

@ -89,7 +89,7 @@ Page({
noPermission() { noPermission() {
Dialog.confirm({ Dialog.confirm({
title: '提示', title: '提示',
message: '当前手机号不是用电管理联系账号', message: '当前手机号未录入系统,请联系管理员,或点击手动绑定',
confirmButtonText: '手动绑定', confirmButtonText: '手动绑定',
cancelButtonText: '取消', cancelButtonText: '取消',
}) })

View File

@ -107,6 +107,16 @@ Page({
handleDelete() { handleDelete() {
this.setData({ fileList: [] }) this.setData({ fileList: [] })
}, },
copy() {
wx.setClipboardData({
data: `河北华昌宝能售电有限公司
建行新石北路支行
13050161563600000908`,
success: () => {
alertSuccess("复制成功")
}
})
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */

View File

@ -11,6 +11,7 @@
点击上传 点击上传
</van-button> </van-button>
</van-field> </van-field>
</van-cell-group> </van-cell-group>
<view style="padding: 20rpx;"> <view style="padding: 20rpx;">
@ -24,3 +25,13 @@
<van-button bind:tap="handleSubmit" type="info" block style="margin-top: 20rpx;"> 提交 </van-button> <van-button bind:tap="handleSubmit" type="info" block style="margin-top: 20rpx;"> 提交 </van-button>
</view> </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>

View File

@ -51,8 +51,8 @@ Page({
switch (envVersion) { switch (envVersion) {
// 开发版 // 开发版
case 'develop': case 'develop':
api = `http://localhost:9001`; // api = `http://localhost:9001`;
// api = `https://zgd.hbhcbn.com/recharge-print-api-test`; api = `https://zgd.hbhcbn.com/recharge-print-api-test`;
// api = `https://zgd.hbhcbn.com/recharge-print-api-test`; // api = `https://zgd.hbhcbn.com/recharge-print-api-test`;
break; break;
// 体验版 // 体验版
@ -77,8 +77,14 @@ Page({
alertInfo("下载文件失败") alertInfo("下载文件失败")
return; return;
} }
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({ wx.openDocument({
filePath: res.tempFilePath, filePath: newPath,
fileType: [ "pdf"], // 3. 这个必须写合法类型,不然下载不了 fileType: [ "pdf"], // 3. 这个必须写合法类型,不然下载不了
success: function (res) { success: function (res) {
resolve() resolve()
@ -88,7 +94,16 @@ Page({
console.log('打开失败错误为', e) console.log('打开失败错误为', e)
rej() rej()
} }
});
},
fail(res) {
console.error(res)
alertInfo("下载失败")
rej()
}
}) })
} }
} }
}) })

View File

@ -11,8 +11,15 @@
"miniprogram": { "miniprogram": {
"list": [ "list": [
{ {
"name": "childPackage/pages/electricQuery/index", "name": "pages/publicTransfer/index",
"pathName": "childPackage/pages/electricQuery/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": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null

View File

@ -82,13 +82,12 @@ const parseResponse = function (response, url) {
alertError("服务异常") alertError("服务异常")
return return
} }
// const { statusCode } = response; const { statusCode } = response;
const { code } = response?.data || {}; if (!statusCode) {
console.log('url', url,'code', code, 'response.data', response.data)
if (!code) {
alertError("服务异常") alertError("服务异常")
return return
} }
console.log('url', url,'statusCode', statusCode, 'response.data', response)
if (code === 401) { if (code === 401) {
const currentUrl = getPageUrl() const currentUrl = getPageUrl()
@ -113,6 +112,8 @@ const parseResponse = function (response, url) {
if (500 <= code && code < 600) { if (500 <= code && code < 600) {
return { code: 500, message: "服务错误" } return { code: 500, message: "服务错误" }
} }
const { code } = response?.data || {};
return response.data; return response.data;
} }