百科支持富文本,对公展示充值信息,下载充值记录文件名改动

This commit is contained in:
2024-10-22 16:11:49 +08:00
parent f00bcbe8d1
commit cb58d3b439
6 changed files with 48 additions and 7 deletions

View File

@@ -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>

View File

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

View File

@@ -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>

View File

@@ -78,11 +78,11 @@ Page({
return;
}
const fs = wx.getFileSystemManager()
const newPath = wx.env.USER_DATA_PATH + '/' + `收据-${detail.time}.pdf`
const newPath = `${wx.env.USER_DATA_PATH}/收据-${detail.time.slice(0, 10)}.pdf`
fs.rename({
oldPath: res.tempFilePath,
newPath: newPath,
success() {
success(r) {
wx.openDocument({
filePath: newPath,
fileType: [ "pdf"], // 3. 这个必须写合法类型,不然下载不了
@@ -98,6 +98,8 @@ Page({
},
fail(res) {
console.error(res)
alertInfo("下载失败")
rej()
}
})