森蓝小程序
This commit is contained in:
62
pages/myPhoto/index.css
Normal file
62
pages/myPhoto/index.css
Normal file
@@ -0,0 +1,62 @@
|
||||
.page {
|
||||
position: absolute;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
/* justify-content: center; */
|
||||
align-items: center;
|
||||
background: url(https://humeng-res.oss-cn-beijing.aliyuncs.com/hm_aigc/applet/bg_%E4%B8%BB%E8%83%8C%E6%99%AF%402x.png)
|
||||
100% no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.title {
|
||||
position: absolute;
|
||||
font-size: 16px;
|
||||
line-height: 22px;
|
||||
color: #454F63;
|
||||
z-index: 999;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.back {
|
||||
position: absolute;
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
left: 0;
|
||||
background-image: url(https://humeng-res.oss-cn-beijing.aliyuncs.com/humeng/vlog/lv2_icon_backBlack%402x.png);
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
|
||||
.center {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
overflow-y: scroll;
|
||||
position: absolute;
|
||||
bottom: 93px;
|
||||
width: 100vw;
|
||||
align-content: baseline;
|
||||
}
|
||||
|
||||
.img {
|
||||
position: relative;
|
||||
width: 45%;
|
||||
left: calc((100vw - 96%)/2);
|
||||
height: 420rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.02);
|
||||
margin: 20rpx 10rpx 0 10rpx;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.center :last-child {
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
72
pages/myPhoto/myPhoto.vue
Normal file
72
pages/myPhoto/myPhoto.vue
Normal file
@@ -0,0 +1,72 @@
|
||||
<template>
|
||||
<view class="page flex-col">
|
||||
<view class="title" :style="{'top': uniMenuInfo.top + 6 + 'px'}">我的写真</view>
|
||||
<view class="back" @tap="goBack()" :style="{'top' : uniMenuInfo.top - 12 + 'px'}"></view>
|
||||
<view class="center" v-if="uniMenuInfo.bottom"
|
||||
:style="{'height': 'calc(100vh - ' + (uniMenuInfo.bottom + 10) + 'px)', 'top': uniMenuInfo.top + 35 + 'px'}">
|
||||
<view class="img" v-for="(item, idx) in imgUrlList" @tap="previewImage(item.aiPhoto)" :key="item.id">
|
||||
<image :src="item.aiPhoto+'?x-oss-process=image/resize,m_lfit,h_800,w_800'" mode="aspectFill" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
uniMenuInfo: {},
|
||||
imgUrlList: [],
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
uni.showLoading({
|
||||
title: '正在加载...',
|
||||
mask: true
|
||||
});
|
||||
this.uniMenuInfo = uni.getStorageSync('uniMenuInfo');
|
||||
this.initializeLoading();
|
||||
},
|
||||
methods: {
|
||||
previewImage(url) {
|
||||
let previewImageList = [];
|
||||
previewImageList.push(url);
|
||||
uni.previewImage({
|
||||
urls: previewImageList,
|
||||
});
|
||||
},
|
||||
goBack() {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
},
|
||||
initializeLoading() {
|
||||
var _this = this;
|
||||
uni.request({
|
||||
url: _this.java_http_url + '/applet/smart_camera/getMyAiPhoto',
|
||||
method: 'POST',
|
||||
data: {
|
||||
userId: uni.getStorageSync('userInfo').id
|
||||
},
|
||||
success(res) {
|
||||
console.log('用户生成ai照片', res)
|
||||
if(res.data.code == 200) {
|
||||
_this.imgUrlList = res.data.data;
|
||||
_this.imgUrlList.forEach((el, idx)=> {
|
||||
el.aiPhoto = 'https://oss.humengfilms.com/' + el.aiPhoto
|
||||
})
|
||||
}
|
||||
},
|
||||
complete() {
|
||||
uni.hideLoading();
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@import url("@/pages/myPhoto/index.css");
|
||||
@import url("@/css/common.css");
|
||||
</style>
|
||||
Reference in New Issue
Block a user