@@ -47,7 +47,8 @@ export function getSupperPhotoStateApi(id) { | |||
export function getUserQrcodeApi(data) { | |||
return request({ | |||
url: `/api/miniApp/getUserQrcode`, | |||
method: 'post', | |||
method: 'POST', | |||
responseType: "arraybuffer", | |||
data | |||
}) | |||
} |
@@ -11,7 +11,7 @@ | |||
:key="item.id" | |||
class="styleListBoxItme" | |||
> | |||
<view class="styleInfo" @click="createPhoto(item.id)"> | |||
<view class="styleInfo" @click="createPhoto(item)"> | |||
<image :src="item.coverImg" mode="aspectFit" /> | |||
<text class="name">{{ item.title }}</text> | |||
<text class="single">{{ peopleNum(item.mouldType) }}</text> | |||
@@ -107,10 +107,16 @@ function peopleNum(num) { | |||
//#endregion --------------------- | |||
//#region 点击图片 | |||
function createPhoto(id) { | |||
uni.navigateTo({ | |||
url: `/pages/closeStyle/goCreatePhoto?id=${id}`, | |||
}); | |||
function createPhoto(item) { | |||
if (item.mouldType == 1) { | |||
uni.navigateTo({ | |||
url: `/pages/closeStyle/goCreatePhoto?id=${item.id}`, | |||
}); | |||
} else { | |||
uni.navigateTo({ | |||
url: `/pages/closeStyle/multiplayer?id=${item.id}`, | |||
}); | |||
} | |||
} | |||
//#endregion --------------------- | |||
</script> | |||
@@ -121,9 +121,9 @@ const userInfoModulesPinia = userInfoModules(); | |||
const styleId = ref(null); | |||
const styleData = ref({}); | |||
onLoad((options) => { | |||
// styleId.value = options.id; | |||
styleId.value = options.id; | |||
// styleId.value = "857147862095679488"; | |||
styleId.value = "2003"; | |||
// styleId.value = "2003"; | |||
// styleId.value = "246"; | |||
getInfo(); | |||
// getMyCoin(); | |||
@@ -172,7 +172,7 @@ const pageClass = computed(() => { | |||
return "page"; | |||
} | |||
}); | |||
//#region 勾选 | |||
//#region 勾选和手机号授权 | |||
const checkboxValue = ref([]); | |||
const checkboxList = ref([ | |||
{ | |||
@@ -193,6 +193,7 @@ async function dogetphonenumber(e) { | |||
openId: userInfoModulesPinia.openId, | |||
encryptedData: e.detail.encryptedData, | |||
iv: e.detail.iv, | |||
uid: urlUid.value, | |||
}; | |||
try { | |||
const res2 = await loginPhoneApi(data); | |||
@@ -289,7 +290,7 @@ const goPro = () => { | |||
}; | |||
//#endregion --------------------- | |||
//#region 手机号登录 | |||
//#region 抖音手机号登录 | |||
const formData = ref({ | |||
phoneNum: null, | |||
codeNum: null, | |||
@@ -454,7 +455,10 @@ const handleOpenPrivacyContract = () => { | |||
}; | |||
//#region | |||
//#region 初始化 | |||
const urlUid = ref(""); //通过邀请来的会携带邀请人ID参数 | |||
onLoad((options) => { | |||
urlUid.value = options.userId ? options.userId : null; | |||
uni.hideHomeButton(); | |||
// workId.value = options.id; | |||
@@ -22,12 +22,12 @@ | |||
<view @click="downloadImg" class="uploadBtn"> | |||
<text>下载照片</text> | |||
</view> | |||
<view class="grayBtn" @click="photoSupper"> | |||
<!-- <view v-if="supperPhotoState == 0 || supperPhotoState == 3" class="free"> | |||
<!-- <view class="grayBtn" @click="photoSupper"> | |||
<view v-if="supperPhotoState == 0 || supperPhotoState == 3" class="free"> | |||
<text>耗金币1枚</text> | |||
</view> --> | |||
</view> | |||
{{ supperTips() }} | |||
</view> | |||
</view> --> | |||
<!-- 底部 --> | |||
<view class="bottomBox"> | |||
<view class="tips"> | |||
@@ -39,15 +39,17 @@ | |||
</view> | |||
<!-- 画报 --> | |||
<view v-if="showPictorial" class="pictorialBox"> | |||
<image :src="pictorialUrl" mode="scaleToFill" /> | |||
<image show-menu-by-longpress :src="pictorialUrl" mode="scaleToFill" /> | |||
<text>长按保存、分享、收藏</text> | |||
<view class="orangeBtn" @click="showPictorial = fales">关闭</view> | |||
</view> | |||
</view> | |||
</template> | |||
<script setup> | |||
// import myloading from '../../components/myLoading.vue' | |||
//#region 导入 | |||
import { onLoad, onShareAppMessage, onShareTimeline } from "@dcloudio/uni-app"; | |||
import { BASE_URL } from "../../utils/request"; | |||
import { ref, reactive, watch } from "vue"; | |||
import { userInfoModules } from "@/store/modules/userInfo"; | |||
import { | |||
@@ -337,9 +339,11 @@ async function getUserQrcode() { | |||
}; | |||
const res = await getUserQrcodeApi(data); | |||
if (res.code == 200) { | |||
uni.arrayBufferToBase64(res.data, (base64) => { | |||
pictorialUrl.value = "data:image/jpeg;base64," + base64; // 在前面加上正确的图片格式 | |||
}); | |||
pictorialUrl.value = `data:image/png;base64,${res.data}`; | |||
// ${uni.arrayBufferToBase64( | |||
// res.data | |||
// )} | |||
console.log(pictorialUrl.value); | |||
showPictorial.value = true; | |||
} else { | |||
uni.showToast({ | |||
@@ -369,11 +373,12 @@ async function getUserQrcode() { | |||
<style lang="scss"> | |||
.page { | |||
padding: 0 30rpx; | |||
background-color: rgba(24, 25, 26, 1); | |||
} | |||
// 轮播图 | |||
.u-swiper { | |||
margin-top: 40rpx; | |||
margin-top: 70rpx; | |||
width: 540rpx; | |||
height: 720rpx !important; | |||
border-radius: 50rpx; | |||
@@ -406,6 +411,7 @@ async function getUserQrcode() { | |||
.uploadBtn { | |||
position: relative; | |||
margin-top: 100rpx; | |||
margin-bottom: 200rpx; | |||
width: 520rpx; | |||
height: 100rpx; | |||
line-height: 100rpx; | |||
@@ -466,13 +472,13 @@ async function getUserQrcode() { | |||
} | |||
.bottomBox { | |||
flex: 1; | |||
position: relative; | |||
bottom: -30rpx; | |||
// flex: 1; | |||
position: absolute; | |||
bottom: 60rpx; | |||
width: 100%; | |||
display: flex; | |||
justify-content: space-between; | |||
padding: 65rpx 10rpx 0; | |||
padding: 65rpx 40rpx 0; | |||
.tips { | |||
position: absolute; | |||
top: 0rpx; | |||
@@ -502,12 +508,20 @@ async function getUserQrcode() { | |||
.pictorialBox { | |||
position: absolute; | |||
width: 100%; | |||
height: 100vh; | |||
height: 100%; | |||
display: flex; | |||
flex-direction: column; | |||
align-items: center; | |||
background-color: rgba($color: #000000, $alpha: 0.9); | |||
image { | |||
margin-top: 80rpx; | |||
width: 630rpx; | |||
height: 940rpx; | |||
border-radius: 24rpx; | |||
margin-bottom: 50rpx; | |||
} | |||
text { | |||
margin-bottom: 30rpx; | |||
} | |||
z-index: 9; | |||
} | |||
@@ -88,6 +88,13 @@ | |||
import { ref, reactive, nextTick } from "vue"; | |||
import { BASE_URL } from "../../utils/request"; | |||
import { onLoad, onShow } from "@dcloudio/uni-app"; | |||
import { | |||
onLoad, | |||
onShareAppMessage, | |||
onShareTimeline, | |||
onAddToFavorites, | |||
onShow, | |||
} from "@dcloudio/uni-app"; | |||
import { loginApi } from "../../api/login"; | |||
import { addImageApi } from "../../api/uploadphoto.js"; | |||
import { userInfoModules } from "@/store/modules/userInfo"; | |||