congzc il y a 1 an
Parent
révision
87157b3122
6 fichiers modifiés avec 58 ajouts et 27 suppressions
  1. +2
    -1
      src/api/lookPhoto.js
  2. +11
    -5
      src/pages/closeStyle/closeStyle.vue
  3. +2
    -2
      src/pages/closeStyle/multiplayer.vue
  4. +6
    -3
      src/pages/login/index.vue
  5. +29
    -15
      src/pages/lookPhoto/index.vue
  6. +8
    -1
      src/pages/uploadPhoto/uploadPhoto.vue

+ 2
- 1
src/api/lookPhoto.js Voir le fichier

@@ -47,7 +47,8 @@ export function getSupperPhotoStateApi(id) {
export function getUserQrcodeApi(data) { export function getUserQrcodeApi(data) {
return request({ return request({
url: `/api/miniApp/getUserQrcode`, url: `/api/miniApp/getUserQrcode`,
method: 'post',
method: 'POST',
responseType: "arraybuffer",
data data
}) })
} }

+ 11
- 5
src/pages/closeStyle/closeStyle.vue Voir le fichier

@@ -11,7 +11,7 @@
:key="item.id" :key="item.id"
class="styleListBoxItme" class="styleListBoxItme"
> >
<view class="styleInfo" @click="createPhoto(item.id)">
<view class="styleInfo" @click="createPhoto(item)">
<image :src="item.coverImg" mode="aspectFit" /> <image :src="item.coverImg" mode="aspectFit" />
<text class="name">{{ item.title }}</text> <text class="name">{{ item.title }}</text>
<text class="single">{{ peopleNum(item.mouldType) }}</text> <text class="single">{{ peopleNum(item.mouldType) }}</text>
@@ -107,10 +107,16 @@ function peopleNum(num) {
//#endregion --------------------- //#endregion ---------------------


//#region 点击图片 //#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 --------------------- //#endregion ---------------------
</script> </script>


+ 2
- 2
src/pages/closeStyle/multiplayer.vue Voir le fichier

@@ -121,9 +121,9 @@ const userInfoModulesPinia = userInfoModules();
const styleId = ref(null); const styleId = ref(null);
const styleData = ref({}); const styleData = ref({});
onLoad((options) => { onLoad((options) => {
// styleId.value = options.id;
styleId.value = options.id;
// styleId.value = "857147862095679488"; // styleId.value = "857147862095679488";
styleId.value = "2003";
// styleId.value = "2003";
// styleId.value = "246"; // styleId.value = "246";
getInfo(); getInfo();
// getMyCoin(); // getMyCoin();


+ 6
- 3
src/pages/login/index.vue Voir le fichier

@@ -143,7 +143,7 @@ const pageClass = computed(() => {
return "page"; return "page";
} }
}); });
//#region 勾选
//#region 勾选和手机号授权
const checkboxValue = ref([]); const checkboxValue = ref([]);
const checkboxList = ref([ const checkboxList = ref([
{ {
@@ -164,6 +164,7 @@ async function dogetphonenumber(e) {
openId: userInfoModulesPinia.openId, openId: userInfoModulesPinia.openId,
encryptedData: e.detail.encryptedData, encryptedData: e.detail.encryptedData,
iv: e.detail.iv, iv: e.detail.iv,
uid: urlUid.value,
}; };
try { try {
const res2 = await loginPhoneApi(data); const res2 = await loginPhoneApi(data);
@@ -260,7 +261,7 @@ const goPro = () => {
}; };
//#endregion --------------------- //#endregion ---------------------


//#region 手机号登录
//#region 抖音手机号登录
const formData = ref({ const formData = ref({
phoneNum: null, phoneNum: null,
codeNum: null, codeNum: null,
@@ -375,8 +376,10 @@ async function loginByCode() {
} }
//#endregion --------------------- //#endregion ---------------------


//#region
//#region 初始化
const urlUid = ref(""); //通过邀请来的会携带邀请人ID参数
onLoad((options) => { onLoad((options) => {
urlUid.value = options.userId ? options.userId : null;
uni.hideHomeButton(); uni.hideHomeButton();
// workId.value = options.id; // workId.value = options.id;




+ 29
- 15
src/pages/lookPhoto/index.vue Voir le fichier

@@ -22,12 +22,12 @@
<view @click="downloadImg" class="uploadBtn"> <view @click="downloadImg" class="uploadBtn">
<text>下载照片</text> <text>下载照片</text>
</view> </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> <text>耗金币1枚</text>
</view> -->
</view>
{{ supperTips() }} {{ supperTips() }}
</view>
</view> -->
<!-- 底部 --> <!-- 底部 -->
<view class="bottomBox"> <view class="bottomBox">
<view class="tips"> <view class="tips">
@@ -39,15 +39,17 @@
</view> </view>
<!-- 画报 --> <!-- 画报 -->
<view v-if="showPictorial" class="pictorialBox"> <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>
</view> </view>
</template> </template>
<script setup> <script setup>
// import myloading from '../../components/myLoading.vue'
//#region 导入 //#region 导入
import { onLoad, onShareAppMessage, onShareTimeline } from "@dcloudio/uni-app"; import { onLoad, onShareAppMessage, onShareTimeline } from "@dcloudio/uni-app";
import { BASE_URL } from "../../utils/request";
import { ref, reactive, watch } from "vue"; import { ref, reactive, watch } from "vue";
import { userInfoModules } from "@/store/modules/userInfo"; import { userInfoModules } from "@/store/modules/userInfo";
import { import {
@@ -337,9 +339,11 @@ async function getUserQrcode() {
}; };
const res = await getUserQrcodeApi(data); const res = await getUserQrcodeApi(data);
if (res.code == 200) { 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; showPictorial.value = true;
} else { } else {
uni.showToast({ uni.showToast({
@@ -369,11 +373,12 @@ async function getUserQrcode() {
<style lang="scss"> <style lang="scss">
.page { .page {
padding: 0 30rpx;
background-color: rgba(24, 25, 26, 1); background-color: rgba(24, 25, 26, 1);
} }
// 轮播图 // 轮播图
.u-swiper { .u-swiper {
margin-top: 40rpx;
margin-top: 70rpx;
width: 540rpx; width: 540rpx;
height: 720rpx !important; height: 720rpx !important;
border-radius: 50rpx; border-radius: 50rpx;
@@ -406,6 +411,7 @@ async function getUserQrcode() {
.uploadBtn { .uploadBtn {
position: relative; position: relative;
margin-top: 100rpx; margin-top: 100rpx;
margin-bottom: 200rpx;
width: 520rpx; width: 520rpx;
height: 100rpx; height: 100rpx;
line-height: 100rpx; line-height: 100rpx;
@@ -466,13 +472,13 @@ async function getUserQrcode() {
} }
.bottomBox { .bottomBox {
flex: 1;
position: relative;
bottom: -30rpx;
// flex: 1;
position: absolute;
bottom: 60rpx;
width: 100%; width: 100%;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 65rpx 10rpx 0;
padding: 65rpx 40rpx 0;
.tips { .tips {
position: absolute; position: absolute;
top: 0rpx; top: 0rpx;
@@ -502,12 +508,20 @@ async function getUserQrcode() {
.pictorialBox { .pictorialBox {
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100vh;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
background-color: rgba($color: #000000, $alpha: 0.9);
image { image {
margin-top: 80rpx; margin-top: 80rpx;
width: 630rpx; width: 630rpx;
height: 940rpx; height: 940rpx;
border-radius: 24rpx; border-radius: 24rpx;
margin-bottom: 50rpx;
}
text {
margin-bottom: 30rpx;
} }
z-index: 9; z-index: 9;
} }


+ 8
- 1
src/pages/uploadPhoto/uploadPhoto.vue Voir le fichier

@@ -86,7 +86,14 @@
<script setup> <script setup>
//#region 导入 //#region 导入
import { ref, reactive, nextTick } from "vue"; import { ref, reactive, nextTick } from "vue";
import { onLoad, onShow } from "@dcloudio/uni-app";
import {
onLoad,
onShareAppMessage,
onShareTimeline,
onAddToFavorites,
onShow,
} from "@dcloudio/uni-app";
import { BASE_URL } from "../../utils/request";
import { loginApi } from "../../api/login"; import { loginApi } from "../../api/login";
import { addImageApi } from "../../api/uploadphoto.js"; import { addImageApi } from "../../api/uploadphoto.js";
import { userInfoModules } from "@/store/modules/userInfo"; import { userInfoModules } from "@/store/modules/userInfo";


Chargement…
Annuler
Enregistrer