Browse Source

分享海报

h5_css
yanyan 3 years ago
parent
commit
54547a8dd4
  1. 0
      static/images/share_bg.jpg
  2. 5
      store/user.js
  3. 7
      subpkg/complete/complete.vue

0
static/images/share_bg.png → static/images/share_bg.jpg

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 110 KiB

5
store/user.js

@ -59,6 +59,9 @@ export default {
if (!state.address.provinceName) return '' if (!state.address.provinceName) return ''
return state.address.provinceName + state.address.cityName + state.address.countyName + state.address.detailInfo return state.address.provinceName + state.address.cityName + state.address.countyName + state.address.detailInfo
} },
getToken(){
return uni.getStorageSync('token');
}
} }
} }

7
subpkg/complete/complete.vue

@ -184,6 +184,7 @@
if (!res.success) return uni.$showMsg() if (!res.success) return uni.$showMsg()
this.questionList = res.data this.questionList = res.data
if (this.questionList.length != 0) { if (this.questionList.length != 0) {
this.questionList = res.data.reverse();
this.ask = this.questionList[0].ask; this.ask = this.questionList[0].ask;
this.answer = this.questionList[0].answer; this.answer = this.questionList[0].answer;
this.correctAnswer = this.questionList[0].correctAnswer; this.correctAnswer = this.questionList[0].correctAnswer;
@ -221,7 +222,7 @@
guid: this.userId guid: this.userId
}) })
if (!res.success) return uni.$showMsg() if (!res.success) return uni.$showMsg()
this.achieveMedalImg = "http://146.56.223.227:9527/profile//2024/03/15/52ce69e2db8e362f225d3c00e10d6fdd.png" this.achieveMedalImg = res.data
if (res.data == null || res.data == "") { if (res.data == null || res.data == "") {
this.showMedal = false this.showMedal = false
this.showLayer = false this.showLayer = false
@ -309,7 +310,7 @@
const width = res[0].width const width = res[0].width
const height = res[0].height const height = res[0].height
// 初始化画布大小 // 初始化画布大小
const dpr = wx.getWindowInfo().pixelRatio const dpr = wx.getSystemInfoSync().pixelRatio
canvas.width = width * dpr canvas.width = width * dpr
canvas.height = height * dpr canvas.height = height * dpr
context.scale(dpr, dpr) context.scale(dpr, dpr)
@ -327,7 +328,7 @@
context.stroke(); context.stroke();
// 图片对象 // 图片对象
const image = canvas.createImage() const image = canvas.createImage()
image.src = '/static/images/share_bg.png' image.src = '/static/images/share_bg.jpg'
// 图片对象 // 图片对象
const imageQR = canvas.createImage() const imageQR = canvas.createImage()
console.log(this.imageQR) console.log(this.imageQR)

Loading…
Cancel
Save