Browse Source

上传

master
前端-胡立永 3 days ago
parent
commit
3b6327a78f
2 changed files with 25 additions and 19 deletions
  1. +24
    -18
      pages_order/mine/promotion.vue
  2. +1
    -1
      pages_order/order/createOrder.vue

+ 24
- 18
pages_order/mine/promotion.vue View File

@ -9,7 +9,7 @@
<image <image
class="image" class="image"
:src="promotionUrl" mode="aspectFill"></image>
:src="imagePath" mode="aspectFill"></image>
<canvas id="myCanvas" type="2d" canvas-id="firstCanvas1"></canvas> <canvas id="myCanvas" type="2d" canvas-id="firstCanvas1"></canvas>
@ -36,36 +36,37 @@ import index from '../../uni_modules/uv-ui-tools'
title: '', title: '',
baseUrl: 'https://image.hhlm1688.com/', baseUrl: 'https://image.hhlm1688.com/',
canvas: {}, canvas: {},
imagePath: '',
imagePath: 'https://image.hhlm1688.com/2025-02-26/6539d2fa-558d-47db-9681-ecffec5b6c5d.png',
index : 0, index : 0,
} }
}, },
onShow() { onShow() {
let that = this;
if(!that.promotionUrl){
// that.getQrCode()
uni.showLoading({
title: "拼命绘画中..."
})
}
that.$store.commit('getUserInfo')
// let that = this;
// that.draw()
// if(!that.promotionUrl){
// // that.getQrCode()
// uni.showLoading({
// title: "..."
// })
// }
// that.$store.commit('getUserInfo')
}, },
methods: { methods: {
getQrCode() { getQrCode() {
uni.showLoading({
title: "拼命绘画中..."
})
// uni.showLoading({
// title: "..."
// })
let that = this; let that = this;
that.$api('getInviteCode', res => { that.$api('getInviteCode', res => {
if (res.code == 200) { if (res.code == 200) {
that.url = res.result.url that.url = res.result.url
that.title = res.result.name that.title = res.result.name
that.imagePath = that.$config.aliOss.url + res.result.url
// that.imagePath = that.$config.aliOss.url + res.result.url
that.$store.commit('setPromotionUrl', that.imagePath)
// that.$store.commit('setPromotionUrl', that.imagePath)
// that.draw()
that.draw()
uni.hideLoading() uni.hideLoading()
} }
}) })
@ -118,7 +119,8 @@ import index from '../../uni_modules/uv-ui-tools'
// //
const coderImage = canvas.createImage() const coderImage = canvas.createImage()
coderImage.src = that.baseUrl + that.url
coderImage.src = '../static/p.jpg'
// coderImage.src = that.baseUrl + that.url
let size = 0; let size = 0;
console.log("----------2") console.log("----------2")
@ -129,12 +131,16 @@ import index from '../../uni_modules/uv-ui-tools'
0, 0, bgImage.width, bgImage.height) 0, 0, bgImage.width, bgImage.height)
size = Math.floor(canvas.width / 3) size = Math.floor(canvas.width / 3)
ctx.drawImage(coderImage,
canvas.width / 2 - (size / 2), canvas.height * 0.46, size, size)
that.canvasToTempFilePath() that.canvasToTempFilePath()
} }
console.log("----------3") console.log("----------3")
coderImage.onload = () => { coderImage.onload = () => {
ctx.drawImage(coderImage, ctx.drawImage(coderImage,
canvas.width / 2 - (size / 2), canvas.height * 0.6, size, size)
canvas.width / 2 - (size / 2), canvas.height * 0.46, size, size)
that.canvasToTempFilePath() that.canvasToTempFilePath()
} }


+ 1
- 1
pages_order/order/createOrder.vue View File

@ -384,7 +384,7 @@
} }
uni.requestPaymentWxPay(res) uni.requestPaymentWxPay(res)
.then(res => {
.then(e => {
uni.showToast({ uni.showToast({
title: '下单成功', title: '下单成功',
icon: 'none' icon: 'none'


Loading…
Cancel
Save