This commit is contained in:
PQZ 2024-09-24 00:06:18 +08:00
parent 5abfd87a3a
commit 8294a578b3
2 changed files with 30 additions and 5 deletions

View File

@ -42,15 +42,22 @@
<view @click="gotoEvaluate(item)" class="evaluate" >评价订单</view>
</view>
</view>
<canvas style="width:200px; height: 200px; z-index: 9999999;margin: 40px auto;"
canvas-id="myQrcode"></canvas>
</view>
<uni-popup ref="popup" type="center" border-radius="10px 10px 0 0" @change="popupChange">
<view style="padding: 30rpx;border-radius:20rpx;width: 600rpx;background-color: #fff;display: flex;align-items: center;row-gap: 10rpx;flex-direction: column;">
<canvas style="width:200px; height: 200px; z-index: 9999999;margin: 40px auto;"
canvas-id="myQrcode"></canvas>
<view class="popup-title">收款码</view>
<div>11{{imageUrl}}</div>
<img style="width: 200px; height: 200px;" :src="imageUrl" />
<view class="popup-title">长按扫一扫支付</view>
</view>
</uni-popup>
<img style="width: ;" src="/static/images/pay.png" alt="" />
</view>
<tabBarVue msg="2"></tabBarVue>
@ -74,6 +81,7 @@
activeKey: 0,
pageNum:1,
totalPages:0,
imageUrl:null,
tabList: [{
id: 0,
title: '全部订单'
@ -168,9 +176,26 @@
text: res.data.code_url
})
}, 60)
setTimeout(()=>{
that.convertToImage()
}, 500)
})
},
convertToImage() {
uni.canvasToTempFilePath({
canvasId: 'myQrcode',
success: function(res) {
// H5tempFilePath base64
this.imageUrl = res.tempFilePath.replace(/[\r\n]/g, "")
console.log(this.imageUrl,200);
}
})
} ,
popupChange({show}) {
if (show) {

View File

@ -14,7 +14,7 @@ const request = config => {
if (getToken() && !isToken) {
config.header['Authorization'] = 'Bearer ' + getToken()
}else{
config.header['Authorization'] = 'Bearer ' +'1c734ee940d94a9fbbedf7422c866bb8'
config.header['Authorization'] = 'Bearer ' +'6e753c0a509e4d01bde4f315f6a39ceb'
}
// get请求映射params参数
if (config.params) {