【fix】优化代码
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
<script setup>
|
||||
import { getCurrentInstance, nextTick, ref } from "vue";
|
||||
import { useImage } from "@/hooks/useImage";
|
||||
import { useMainStore } from "@/store/store";
|
||||
import { useMainStore } from "@/store/modules/useMainStore";
|
||||
import { useShare } from "@/hooks/useShare";
|
||||
import { generateMiniProgramQrCode } from "@/api/global";
|
||||
|
||||
@ -270,7 +270,7 @@ async function generatePoster() {
|
||||
// #ifdef MP-WEIXIN
|
||||
wx.canvasToTempFilePath({
|
||||
canvasId: 'goods-canvas',
|
||||
canvas:canvasRef.value,//这里是重点,获取实例的时候保存为全局变量就行了
|
||||
canvas: canvasRef.value,//这里是重点,获取实例的时候保存为全局变量就行了
|
||||
success: async (res) => {
|
||||
posterImagePath.value = res.tempFilePath;
|
||||
uni.hideLoading()
|
||||
@ -279,7 +279,7 @@ async function generatePoster() {
|
||||
console.log(err)
|
||||
uni.hideLoading()
|
||||
}
|
||||
},_this)
|
||||
}, _this)
|
||||
// #endif
|
||||
}
|
||||
|
||||
@ -299,7 +299,7 @@ async function save() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<u-overlay
|
||||
<uv-overlay
|
||||
@touchmove="(e)=>{e.preventDefault();}"
|
||||
:show="show"
|
||||
@click="close">
|
||||
@ -332,7 +332,7 @@ async function save() {
|
||||
style="width:654rpx;height: 1032rpx;margin: 20rpx auto;position: absolute;z-index:999;top: -999px;"
|
||||
id="goods-canvas" />
|
||||
|
||||
</u-overlay>
|
||||
</uv-overlay>
|
||||
</template>
|
||||
|
||||
<style
|
||||
|
Reference in New Issue
Block a user