@@ -5,13 +5,11 @@ import { request } from "../utils/request" | |||||
* @param machineQrcodeId | * @param machineQrcodeId | ||||
* @return: status | * @return: status | ||||
*/ | */ | ||||
export function getImageQrcode(machineQrcodeId) { | |||||
export function getImageQrcode(data) { | |||||
return request({ | return request({ | ||||
url: `/api/screenImg/imageQrcode`, | url: `/api/screenImg/imageQrcode`, | ||||
method: 'post', | method: 'post', | ||||
data: { | |||||
machineQrcodeId | |||||
} | |||||
data | |||||
}) | }) | ||||
} | } | ||||
@@ -87,6 +87,7 @@ let isUpload = ref(false); | |||||
let modelUrl = ref(""); | let modelUrl = ref(""); | ||||
let modelId = ref(""); | let modelId = ref(""); | ||||
let modelMouldType = ref(""); | |||||
let QRCodeUrl = ref(""); | let QRCodeUrl = ref(""); | ||||
let showQrCode = ref(false); | let showQrCode = ref(false); | ||||
@@ -363,9 +364,14 @@ const reTry = () => { | |||||
// 点击上传照片按钮 | // 点击上传照片按钮 | ||||
const uploadImg = async () => { | const uploadImg = async () => { | ||||
const UserId = localStorage.getItem("UserId"); | |||||
const data = { | |||||
machineQrcodeId: localStorage.getItem("UserId"), | |||||
mouldType: modelMouldType.value, | |||||
}; | |||||
// const UserId = localStorage.getItem("UserId"); | |||||
// const mouldType = modelMouldType.value; | |||||
try { | try { | ||||
const res = await getImageQrcode(UserId); | |||||
const res = await getImageQrcode(data); | |||||
QRCodeUrl.value = res.data.wxQrcode; | QRCodeUrl.value = res.data.wxQrcode; | ||||
showQrCode.value = true; | showQrCode.value = true; | ||||
@@ -412,6 +418,7 @@ onLoad((options) => { | |||||
console.log(options, "options"); | console.log(options, "options"); | ||||
modelUrl.value = options.modelUrl; | modelUrl.value = options.modelUrl; | ||||
modelId.value = options.id; | modelId.value = options.id; | ||||
modelMouldType.value = options.mouldType; | |||||
}); | }); | ||||
onMounted(() => { | onMounted(() => { | ||||
@@ -21,9 +21,15 @@ | |||||
@change="getSwiperIndex" | @change="getSwiperIndex" | ||||
@click="previewImage" | @click="previewImage" | ||||
></u-swiper> | ></u-swiper> | ||||
<view class="logoBox" v-if="createState != 2"> | |||||
<image class="logo" src="../../assets/img/logo-4.png" mode="aspectFit" /> | |||||
</view> | |||||
<image | |||||
class="logo" | |||||
v-if="createState != 2" | |||||
:src="modelImgUrl" | |||||
mode="aspectFit" | |||||
/> | |||||
<!-- <view class="logoBox" v-if="createState != 2"> --> | |||||
<!-- <image class="logo" src="../../assets/img/logo-4.png" mode="aspectFit" /> --> | |||||
<!-- </view> --> | |||||
<view v-if="createState == 2" class="checkMore">左右滑动查看更多</view> | <view v-if="createState == 2" class="checkMore">左右滑动查看更多</view> | ||||
<view v-if="createState != 2" class="wait">生成中,请稍后...</view> | <view v-if="createState != 2" class="wait">生成中,请稍后...</view> | ||||
<!-- <view | <!-- <view | ||||
@@ -56,8 +62,10 @@ const userInfoModulesPinia = userInfoModules(); | |||||
const createState = ref(1); //制作状态:1生成中,2完成,3失败 | const createState = ref(1); //制作状态:1生成中,2完成,3失败 | ||||
const workId = ref(null); //作品id | const workId = ref(null); //作品id | ||||
const modelImgUrl = ref(""); | |||||
onLoad(async (options) => { | onLoad(async (options) => { | ||||
workId.value = options.id; | workId.value = options.id; | ||||
modelImgUrl.value = options.imgUrl; | |||||
// await getTemplateMsg(); | // await getTemplateMsg(); | ||||
getUser(); | getUser(); | ||||
await getSwiperList(); | await getSwiperList(); | ||||
@@ -298,19 +306,26 @@ onUnload(() => { | |||||
} | } | ||||
} | } | ||||
} | } | ||||
.logoBox { | |||||
display: flex; | |||||
flex-direction: column; | |||||
align-items: center; | |||||
justify-content: center; | |||||
.logo { | |||||
margin-top: 70rpx; | margin-top: 70rpx; | ||||
border-radius: 30rpx; | |||||
width: 540rpx; | |||||
height: 720rpx !important; | |||||
} | |||||
.logoBox { | |||||
// display: flex; | |||||
// flex-direction: column; | |||||
// align-items: center; | |||||
// justify-content: center; | |||||
// margin-top: 70rpx; | |||||
width: 540rpx; | width: 540rpx; | ||||
height: 720rpx !important; | height: 720rpx !important; | ||||
.logo { | .logo { | ||||
width: 260rpx; | |||||
margin: 90rpx; | |||||
animation: rotateAnimation 3s 0s infinite; | |||||
opacity: 0.7; | |||||
border-radius: 30rpx; | |||||
width: 100%; | |||||
// margin: 90rpx; | |||||
// animation: rotateAnimation 3s 0s infinite; | |||||
// opacity: 0.7; | |||||
} | } | ||||
} | } | ||||
@keyframes rotateAnimation { | @keyframes rotateAnimation { | ||||
@@ -130,7 +130,7 @@ async function createing2() { | |||||
console.log(res2); | console.log(res2); | ||||
// userInfoModulesPinia.createTimes = userInfoModulesPinia.createTimes - 1; | // userInfoModulesPinia.createTimes = userInfoModulesPinia.createTimes - 1; | ||||
uni.navigateTo({ | uni.navigateTo({ | ||||
url: `/pages/created/index?id=${res2.data.id}`, | |||||
url: `/pages/created/index?id=${res2.data.id}&imgUrl=${styleData.value.coverImg}`, | |||||
}); | }); | ||||
} else { | } else { | ||||
throw new Error(); | throw new Error(); | ||||
@@ -310,8 +310,9 @@ function toChooseModel() { | |||||
function toCamera() { | function toCamera() { | ||||
const url = styleData.value.coverImg; | const url = styleData.value.coverImg; | ||||
const id = styleData.value.id; | const id = styleData.value.id; | ||||
const mouldType = styleData.value.mouldType; | |||||
uni.navigateTo({ | uni.navigateTo({ | ||||
url: `/pages/camera/index?modelUrl=${url}&id=${id}`, | |||||
url: `/pages/camera/index?modelUrl=${url}&id=${id}&mouldType=${mouldType}`, | |||||
}); | }); | ||||
} | } | ||||
//#endregion --------------------- | //#endregion --------------------- | ||||
@@ -34,7 +34,7 @@ export const userInfoModules = defineStore("userInfoStore", () => { | |||||
function clearStorage() { | function clearStorage() { | ||||
token.value = null | token.value = null | ||||
phone.value = null | phone.value = null | ||||
createTimes.value = null | |||||
createTimes.value = 0 | |||||
uni.setStorageSync("token", null); | uni.setStorageSync("token", null); | ||||
uni.setStorageSync("createTimes", 0); | uni.setStorageSync("createTimes", 0); | ||||
uni.setStorageSync("phone", null); | uni.setStorageSync("phone", null); | ||||