【fix】优化代码

This commit is contained in:
黄少君
2024-02-22 18:37:23 +08:00
parent 17c043348a
commit f8fac0a5bc
246 changed files with 973 additions and 406 deletions

View File

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