|
@@ -1,150 +1,166 @@
|
|
|
<template>
|
|
|
<div class="container">
|
|
|
- <div id="topnav" class="topnav flex-start" :style="{'height':`${topbarOffsetHeight-statusBarHeight}px`,'padding-top':`${statusBarHeight}px`,'background-color':`rgba(21, 17, 38,${topNavAlpha})`}" v-if="!cover.isFullScreen">
|
|
|
+ <div id="topnav" class="topnav flex-start">
|
|
|
<div class="nav-item flex-center" @click="back">
|
|
|
- <image :src="`${assetsUrl}back.png`" mode="widthFix" class="nav-img"></image>
|
|
|
+ <img :src="`${assetsUrl}back.png`" mode="widthFix" class="nav-img"></img>
|
|
|
</div>
|
|
|
<div class="nav-text font32 fw600">
|
|
|
{{pageName}}
|
|
|
</div>
|
|
|
<div class="nav-item"></div>
|
|
|
</div>
|
|
|
- <uni-popup ref="modalPopup" type="center">
|
|
|
- <Popup :content1="popup.content1" :content2="popup.content2" :tip1="popup.tip1" :tip2="popup.tip2" :btntext="popup.btntext" @closePopup="closePopup" @toService="toService" :btnEvent="'toService'"></Popup>
|
|
|
- </uni-popup>
|
|
|
- <uni-popup ref="popup" type="bottom" @maskClick="popupMaskClick">
|
|
|
+ <van-popup ref="videoPopup" position="center" v-model="showVideoPopup">
|
|
|
+ <video :src="previewVideoUrl" class="big-vdo" autoplay="autoplay" muted="muted" loop="loop"></video>
|
|
|
+ <img :src="`${assetsUrl}album-delete.png`" class="popup-close" @click="showVideoPopup=false">
|
|
|
+ </van-popup>
|
|
|
+ <van-popup ref="popup" position="bottom" v-model="showPopup">
|
|
|
<div class="popup" @touchmove.prevent>
|
|
|
<div class="p-title-box flex-between">
|
|
|
<div class="p-title font36 fw600">
|
|
|
上传相册
|
|
|
</div>
|
|
|
- <image :src="`${assetsUrl}info-figure-close.png`" mode="aspectFill" class="p-close" @click="closePopup"></image>
|
|
|
+ <img :src="`${assetsUrl}info-figure-close.png`" mode="aspectFill" class="p-close" @click="closePopup"></img>
|
|
|
</div>
|
|
|
<div class="p-title-tip font28 fw400">
|
|
|
上传清晰本人照片更容易交到好友哦
|
|
|
</div>
|
|
|
<div class="p-img-box flex-between">
|
|
|
<div class="p-img">
|
|
|
- <image :src="`${assetsUrl}info-figure-img1.png`" mode="aspectFill" class="img"></image>
|
|
|
+ <img :src="`${assetsUrl}info-figure-img1.png`" mode="aspectFill" class="img"></img>
|
|
|
<div class="p-text font22 fw400">
|
|
|
五官清晰
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="p-img">
|
|
|
- <image :src="`${assetsUrl}info-figure-img2.png`" mode="aspectFill" class="img"></image>
|
|
|
+ <img :src="`${assetsUrl}info-figure-img2.png`" mode="aspectFill" class="img"></img>
|
|
|
<div class="p-text font22 fw400">
|
|
|
半身照
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="p-img">
|
|
|
- <image :src="`${assetsUrl}info-figure-img3.png`" mode="aspectFill" class="img"></image>
|
|
|
+ <img :src="`${assetsUrl}info-figure-img3.png`" mode="aspectFill" class="img"></img>
|
|
|
<div class="p-text font22 fw400">
|
|
|
风景和人
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div style="height: 60rpx;">
|
|
|
-
|
|
|
+ <div style="height: 60px;position: relative;">
|
|
|
+ <input type="file" class="file" accept="image/png,image/jpg,image/jpeg" @change="uploadImg">
|
|
|
+ <div class="btn font32 fw600" @click="sure">
|
|
|
+ 从相册上传
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- </uni-popup>
|
|
|
- <uni-popup ref="authPopup" type="bottom" @maskClick="authPopupMaskClick">
|
|
|
+ </van-popup>
|
|
|
+ <van-popup ref="authPopup" position="bottom" v-model="showAuthPopup">
|
|
|
<div class="auth-popup" @touchmove.prevent>
|
|
|
<div class="ap-title">
|
|
|
请上传本人正面清晰照片
|
|
|
</div>
|
|
|
<div class="ap-imgs flex-start">
|
|
|
<div class="ap-img-box">
|
|
|
- <image :src="`${assetsUrl}auth-ap1.png`" mode="aspectFill" class="ap-img"></image>
|
|
|
+ <img :src="`${assetsUrl}auth-ap1.png`" mode="aspectFill" class="ap-img"></img>
|
|
|
<div class="ap-alpha flex-center">
|
|
|
- <image :src="`${assetsUrl}auth-right.png`" mode="aspectFill" class="ap-right"></image>
|
|
|
+ <img :src="`${assetsUrl}auth-right.png`" mode="aspectFill" class="ap-right"></img>
|
|
|
<div class="ap-text font30 fw400">
|
|
|
清晰正脸
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="ap-img-box">
|
|
|
- <image :src="`${assetsUrl}auth-ap2.png`" mode="aspectFill" class="ap-img"></image>
|
|
|
+ <img :src="`${assetsUrl}auth-ap2.png`" mode="aspectFill" class="ap-img"></img>
|
|
|
<div class="ap-alpha flex-center">
|
|
|
- <image :src="`${assetsUrl}auth-right.png`" mode="aspectFill" class="ap-right"></image>
|
|
|
+ <img :src="`${assetsUrl}auth-right.png`" mode="aspectFill" class="ap-right"></img>
|
|
|
<div class="ap-text font30 fw400">
|
|
|
全身/半身
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="ap-img-box">
|
|
|
- <image :src="`${assetsUrl}auth-ap3.png`" mode="aspectFill" class="ap-img"></image>
|
|
|
+ <img :src="`${assetsUrl}auth-ap3.png`" mode="aspectFill" class="ap-img"></img>
|
|
|
<div class="ap-alpha flex-center">
|
|
|
- <image :src="`${assetsUrl}auth-right.png`" mode="aspectFill" class="ap-right"></image>
|
|
|
+ <img :src="`${assetsUrl}auth-right.png`" mode="aspectFill" class="ap-right"></img>
|
|
|
<div class="ap-text font30 fw400">
|
|
|
记得微笑
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="ap-img-box">
|
|
|
- <image :src="`${assetsUrl}auth-ap4.png`" mode="aspectFill" class="ap-img"></image>
|
|
|
+ <img :src="`${assetsUrl}auth-ap4.png`" mode="aspectFill" class="ap-img"></img>
|
|
|
<div class="ap-alpha flex-center">
|
|
|
- <image :src="`${assetsUrl}auth-right.png`" mode="aspectFill" class="ap-right"></image>
|
|
|
+ <img :src="`${assetsUrl}auth-right.png`" mode="aspectFill" class="ap-right"></img>
|
|
|
<div class="ap-text font30 fw400">
|
|
|
光线合适
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div style="height: 60rpx;">
|
|
|
-
|
|
|
+ <div style="height: 60px;position: relative;">
|
|
|
+ <input type="file" class="file" accept="image/png,image/jpg,image/jpeg,video/mp4" @change="uploadImg">
|
|
|
+ <div class="btn font32 fw600" @click="sure">
|
|
|
+ 从相册上传
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- </uni-popup>
|
|
|
- <scroll-div
|
|
|
- scroll-y="true"
|
|
|
- :style="{'height': `${scrollHeight}px`,'padding-top':`${topNavHeight}px`}"
|
|
|
- v-if="scrollHeight>0"
|
|
|
- lower-threshold="200"
|
|
|
- refresher-enabled="true"
|
|
|
- :refresher-triggered="scrollTriggered"
|
|
|
- :refresher-threshold="45"
|
|
|
- refresher-default-style="white"
|
|
|
- refresher-background="#151126"
|
|
|
- @refresherrefresh="scrollRefresh"
|
|
|
- @refresherpulling="scrollPulling"
|
|
|
- @refresherrestore="scrollRestore"
|
|
|
- @refresherabort="scrollAbort"
|
|
|
- @scrolltolower="scrollToBottom"
|
|
|
- class="scroll-div"
|
|
|
- >
|
|
|
- <drag-image :list="albumData" :number="1000" :custom="true" @addImage="toAddImg" @sortImage="sortImg" @delImage="deleteImg" :chooseImage="isChooseImage" @chooseEvent="chooseImageHandle"></drag-image>
|
|
|
- </scroll-div>
|
|
|
- <div class="btn-tip font24 fw400" v-if="!isChooseImage">
|
|
|
- 长按可拖动调整图片顺序
|
|
|
+ </van-popup>
|
|
|
+ <div class="list flex-start">
|
|
|
+
|
|
|
+ <draggable v-model="albumData" ghost-class="ghost" animation="300" :move="onmove" draggable=".move-item">
|
|
|
+ <div class="move-item flex-center" @click="toAddImg" slot="header">
|
|
|
+ <van-image
|
|
|
+ width="108"
|
|
|
+ height="108"
|
|
|
+ fit="cover"
|
|
|
+ :src="`${assetsUrl}album-add.png`"
|
|
|
+ style="background-color: #151126;"/>
|
|
|
+ </van-image>
|
|
|
+ </div>
|
|
|
+ <div class="move-item mover" v-for="(item, index) in albumData" :key="index">
|
|
|
+ <van-image
|
|
|
+ width="108"
|
|
|
+ height="108"
|
|
|
+ radius="10"
|
|
|
+ fit="cover"
|
|
|
+ :src="item.url"
|
|
|
+ v-if="item.cate==='Img'"
|
|
|
+ @click="previewImg(item.url)"/>
|
|
|
+ <video :src="item.url" autoplay="autoplay" muted="muted" loop="loop" @click="previewVdo(item.url)" v-else class="vdo"></video>
|
|
|
+ <div class="img-delete flex-center" @click="deleteImg(index)">
|
|
|
+ <img class="del-image" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAhCAYAAABX5MJvAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAhdEVYdENyZWF0aW9uIFRpbWUAMjAyMDowNzoyNSAyMTo1NDoyOU4TkJAAAADcSURBVFhH7ZfRCoMwDEXLvkjwwVf/bH/emmAyN6glTW9WBjsgwm28OeCLpj81Sil7zvlJ90UiONS/yY5VogsO6XrBg3IEQ5a/s8vRSWUAKmLqp2w5jz5BiNQEGMo3GbloDLtFXJ1IkaEuhAiiY6gEIqB4yqACSk9piIBiKQ8VUFpLviKg3C2rESKgWERCBZSWiEfgIfffYvrrsAgoISJ3Apy3zuTxcSxLQkV6ykNEPKVQkZEyiAiiZKgDIaC4upACSlcn5fM/+WuDCAHF1E/Z/N9AhkMZnPNDPI+UDjPIXgAQIGjNAAAAAElFTkSuQmCC"/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </draggable>
|
|
|
+ </div>
|
|
|
+ <div class="btn-tip font24 fw400">
|
|
|
+ 可拖动调整图片顺序
|
|
|
</div>
|
|
|
<div class="btn font32 fw600" @click="sure">
|
|
|
- {{btnText}}
|
|
|
+ 去认证
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import draggable from "vuedraggable"
|
|
|
import TabBar from '@/components/TabBar/TabBar.vue';
|
|
|
+ import {assetsUrl} from '../../util/index.js';
|
|
|
import Popup from '@/components/Popup/Popup.vue';
|
|
|
import wxMap from '@/static/qqmap-wx-jssdk1.2/qqmap-wx-jssdk.min.js';
|
|
|
- import DragImage from '@/components/DragImage/DragImage.vue';
|
|
|
import {getPolicy,computeSignature,getKey} from '@/util/oss.js';
|
|
|
import {encode} from '@/util/base64.js'
|
|
|
+ import { ImagePreview } from 'vant';
|
|
|
/**
|
|
|
* 腾讯位置服务,手机账号:18996226740
|
|
|
*/
|
|
|
const wxMapSdk=new wxMap({key:'E5SBZ-T2YC3-CBL3F-YGFQQ-26PP2-ERFII'})
|
|
|
export default {
|
|
|
- components:{TabBar,Popup,DragImage},
|
|
|
+ components:{TabBar,Popup,draggable},
|
|
|
data() {
|
|
|
return {
|
|
|
- btnText:'去认证',
|
|
|
pageName:'编辑相册',
|
|
|
- isChooseImage:false,//是否为选择图片模式
|
|
|
- assetsUrl:this.$util.assetsUrl,
|
|
|
+ assetsUrl,
|
|
|
scrollHeight:0,
|
|
|
topNavHeight:0,
|
|
|
scrollRefreshing:false,
|
|
@@ -163,247 +179,128 @@
|
|
|
tip2:'',
|
|
|
btntext:''
|
|
|
},
|
|
|
+
|
|
|
+ showPopup:false,
|
|
|
+ showAuthPopup:false,
|
|
|
+ showVideoPopup:false,
|
|
|
+ previewVideoUrl:''
|
|
|
};
|
|
|
},
|
|
|
- computed: {
|
|
|
- statusBarHeight() {
|
|
|
- return this.$store.state.statusBarHeight;
|
|
|
- },
|
|
|
- topbarOffsetHeight() {
|
|
|
- return this.$store.state.topbarOffsetHeight;
|
|
|
- },
|
|
|
- imageCdn(){
|
|
|
- return this.$store.state.imageCdn;
|
|
|
- },
|
|
|
- videoCdn(){
|
|
|
- return this.$store.state.videoCdn;
|
|
|
- }
|
|
|
- },
|
|
|
- onLoad(options) {
|
|
|
- if(options.type==='auth'){
|
|
|
- this.isChooseImage=true;
|
|
|
- this.btnText='前往认证';
|
|
|
- this.pageName='选择照片';
|
|
|
- }else{
|
|
|
- this.isChooseImage=false;
|
|
|
- }
|
|
|
- this.computedScolldivHeight()
|
|
|
- this.getAlbumData();
|
|
|
- },
|
|
|
mounted() {
|
|
|
-
|
|
|
-
|
|
|
- },
|
|
|
- onPageScroll(e) {
|
|
|
-
|
|
|
+ this.getAlbumData();
|
|
|
},
|
|
|
methods:{
|
|
|
back(){
|
|
|
- uni.navigateBack({
|
|
|
- delta:1
|
|
|
- })
|
|
|
+ this.$router.back();
|
|
|
},
|
|
|
- chooseImageHandle(data){
|
|
|
- this.authChooseImages=data;
|
|
|
+ closePopup(){
|
|
|
+ this.showPopup=false;
|
|
|
+ this.showAuthPopup=false;
|
|
|
},
|
|
|
- toAddImg(){
|
|
|
- this.btnText='从相册上传';
|
|
|
- if(this.isChooseImage){
|
|
|
- this.$refs.authPopup.open();
|
|
|
- }
|
|
|
- else{
|
|
|
- this.$refs.popup.open();
|
|
|
+ onmove(){
|
|
|
+ console.log(this.albumData[0].url);
|
|
|
+ let ids=[];
|
|
|
+ for(let i=0;i<this.albumData.length;i++){
|
|
|
+ ids.push(this.albumData[i].mediaId);
|
|
|
}
|
|
|
-
|
|
|
- },
|
|
|
- popupMaskClick(){
|
|
|
- this.btnText=this.isChooseImage?'前往认证':'去认证';
|
|
|
- },
|
|
|
- authPopupMaskClick(){
|
|
|
- this.btnText=this.isChooseImage?'前往认证':'去认证';
|
|
|
+ this.sortImg(ids);
|
|
|
},
|
|
|
- closePopup(){
|
|
|
- this.$refs.popup.close();
|
|
|
- this.$refs.modalPopup.close();
|
|
|
- this.$refs.authPopup.close();
|
|
|
- this.btnText=this.isChooseImage?'前往认证':'去认证';
|
|
|
+ toAddImg(){
|
|
|
+ this.showPopup=true;
|
|
|
},
|
|
|
sortImg(ids){
|
|
|
- let user=JSON.parse(uni.getStorageSync('user'));
|
|
|
+ let user=JSON.parse(localStorage.getItem('user'));
|
|
|
this.$api.public.albumSort({
|
|
|
completeUser:user,
|
|
|
mediaIdsInSeq:ids
|
|
|
}).then(res=>{})
|
|
|
- },
|
|
|
- toService(){
|
|
|
- this.$refs.popup.close();
|
|
|
- uni.openCustomerServiceChat({
|
|
|
- extInfo:{
|
|
|
- url:'https://work.weixin.qq.com/kfid/kfca1b21d2f7e8a18e9',//客服链接
|
|
|
- },
|
|
|
- corpId:'wwa8f2a0d8a6dc0950',//企业ID
|
|
|
- fail(res){
|
|
|
- console.log(res)
|
|
|
- wx.showToast({
|
|
|
- title: '客服联系失败',
|
|
|
- icon:'none'
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- /**
|
|
|
- * 计算scroll高度
|
|
|
- */
|
|
|
- computedScolldivHeight() {
|
|
|
- let query = uni.createSelectorQuery().in(this);
|
|
|
- let heightLeaf =0;
|
|
|
- query.select('#topnav').boundingClientRect(data => {
|
|
|
- this.topNavHeight=data.height;
|
|
|
- heightLeaf += data.height;
|
|
|
- }).exec(() => {
|
|
|
- let sysInfo = uni.getSystemInfoSync();
|
|
|
- this.scrollHeight = sysInfo.windowHeight - heightLeaf;
|
|
|
- });
|
|
|
-
|
|
|
- },
|
|
|
- /**
|
|
|
- * 推荐下拉刷新、加载更多
|
|
|
- */
|
|
|
- scrollRefresh(){
|
|
|
- if (this.scrollRefreshing)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
- this.scrollRefreshing = true;
|
|
|
- setTimeout(() => {
|
|
|
- this.scrollTriggered = false;
|
|
|
- this.scrollRefreshing = false;
|
|
|
- }, 1000)
|
|
|
- this.getAlbumData();
|
|
|
- },
|
|
|
- scrollPulling(e) {},
|
|
|
- scrollRestore() {this.scrollTriggered = true;},
|
|
|
- scrollAbort() {},
|
|
|
- scrollToBottom(){
|
|
|
-
|
|
|
},
|
|
|
getAlbumData(){
|
|
|
- let user=JSON.parse(uni.getStorageSync('user'));
|
|
|
+ let user=JSON.parse(localStorage.getItem('user'));
|
|
|
this.$api.public.album({uurd:user.id}).then(res=>{
|
|
|
for(let i=0;i<res.data.dms.length;i++){
|
|
|
res.data.dms[i].isMove=false;
|
|
|
}
|
|
|
- let arr=[];
|
|
|
- if(this.isChooseImage){
|
|
|
- for(let i=0;i<res.data.dms.length;i++){
|
|
|
- if(res.data.dms[i].cate==='Img'){
|
|
|
- arr.push(res.data.dms[i])
|
|
|
- }
|
|
|
- }
|
|
|
- this.albumData=arr;
|
|
|
-
|
|
|
- }
|
|
|
- else{
|
|
|
- this.albumData=res.data.dms;
|
|
|
- }
|
|
|
+ this.albumData=res.data.dms;
|
|
|
|
|
|
})
|
|
|
},
|
|
|
+ previewImg(url){
|
|
|
+ ImagePreview([url])
|
|
|
+ },
|
|
|
+ previewVdo(url){
|
|
|
+ this.previewVideoUrl=url;
|
|
|
+ this.showVideoPopup=true;
|
|
|
+ },
|
|
|
deleteImg(index){
|
|
|
- this.$api.public.albumDelete({mediaId:this.albumData[index].mediaId}).then(res=>{})
|
|
|
+ this.$api.public.albumDelete({mediaId:this.albumData[index].mediaId}).then(res=>{
|
|
|
+ this.albumData.splice(index,1);
|
|
|
+ })
|
|
|
},
|
|
|
sure(){
|
|
|
- if(this.btnText==='从相册上传'){
|
|
|
-
|
|
|
- this.addImg();
|
|
|
- }
|
|
|
- else{
|
|
|
- this.popup={
|
|
|
- content1:'进行认证流程需给客服回复关键词',
|
|
|
- content2:'「真人认证」',
|
|
|
- tip1:'',
|
|
|
- tip2:'',
|
|
|
- btntext:'联系客服去认证'
|
|
|
- }
|
|
|
- this.$refs.modalPopup.open();
|
|
|
- }
|
|
|
+ this.$router.push({name:'chooseImage'});
|
|
|
},
|
|
|
-
|
|
|
- async addImg(){
|
|
|
- const that=this;
|
|
|
- this.closePopup();
|
|
|
-
|
|
|
- uni.chooseMedia({
|
|
|
- count: 9,
|
|
|
- mediaType: this.isChooseImage?['image']:['image','video'],
|
|
|
- sourceType: ['album', 'camera'],
|
|
|
- maxDuration: 30,
|
|
|
- camera: 'back',
|
|
|
- success(res) {
|
|
|
- uni.showLoading({
|
|
|
- mask:true,
|
|
|
- title:"正在上传···"
|
|
|
- })
|
|
|
- let arr=[],obj={},imageCdn='',videoCdn='';
|
|
|
-
|
|
|
-
|
|
|
- for(let i=0;i<res.tempFiles.length;i++){
|
|
|
- obj={
|
|
|
- cate:res.tempFiles[i].fileType==='image'?'Img':'Vdo',
|
|
|
- cdt:'General',
|
|
|
- env:'Album',
|
|
|
- url:null
|
|
|
+ uploadImg(e){
|
|
|
+ let files=e.target.files,obj={},arr=[];
|
|
|
+ if(files && files[0]) {
|
|
|
+ const file = files[0],that=this;
|
|
|
+ this.ext=`.${file.name.split('.')[1]}`;
|
|
|
+ this.$toast.loading({
|
|
|
+ message: '上传中',
|
|
|
+ forbidClick: true,
|
|
|
+ duration:0
|
|
|
+ });
|
|
|
+ this.$api.public.aliossToken({}).then(result=>{
|
|
|
+ const client=new this.$oss({
|
|
|
+ region: 'oss-cn-qingdao',
|
|
|
+ accessKeyId: result.data.accessKeyId,
|
|
|
+ accessKeySecret: result.data.accessKeySecret,
|
|
|
+ stsToken: result.data.securityToken,
|
|
|
+ bucket: 'zhenyanapp-gen',
|
|
|
+ refreshSTSToken: async () => {
|
|
|
+ const {data: res} = await this.$api.public.aliossToken({})
|
|
|
+ return {
|
|
|
+ accessKeyId: res.data.accessKeyId, // 自己账户的accessKeyId或临时秘钥
|
|
|
+ accessKeySecret: res.data.accessKeySecret, // 自己账户的accessKeySecret或临时秘钥
|
|
|
+ stsToken: res.data.securityToken, // 从STS服务获取的安全令牌(SecurityToken)。
|
|
|
+ }
|
|
|
+ },
|
|
|
+ refreshSTSTokenInterval: 3600 * 1000
|
|
|
+ });
|
|
|
+ let key=getKey(this.ext);
|
|
|
+ obj={
|
|
|
+ cate:this.ext==='.mp4'?'Vdo':'Img',
|
|
|
+ cdt:'General',
|
|
|
+ env:'Album',
|
|
|
+ url:null
|
|
|
+ }
|
|
|
+ client.put(key,file).then(succ=>{
|
|
|
+ console.log(succ)
|
|
|
+ if(this.ext==='.png'||this.ext==='.jpg'){
|
|
|
+ let link=`${localStorage.getItem('imageCdn')}/${key}`;
|
|
|
+ obj.url=link;
|
|
|
+ }
|
|
|
+ else if(this.ext==='.mp4'){
|
|
|
+ let link=`${localStorage.getItem('videoCdn')}/${key}`;
|
|
|
+ obj.url=link;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ this.$toast('只支持上传jpg/png/mp4格式文件');
|
|
|
+ return;
|
|
|
}
|
|
|
- const policyText=getPolicy();
|
|
|
- const policy=encode(JSON.stringify(policyText));
|
|
|
- const key=getKey(i,res.tempFiles[i].tempFilePath.split('.')[1]);
|
|
|
- that.$api.public.aliossToken({}).then(resuslt=>{
|
|
|
- let formData={
|
|
|
- key:key,
|
|
|
- policy:policy,
|
|
|
- OSSAccessKeyId:resuslt.data.accessKeyId,
|
|
|
- signature:computeSignature(resuslt.data.accessKeySecret,policy),
|
|
|
- 'x-oss-security-token':resuslt.data.securityToken,
|
|
|
- success_action_status:'200'
|
|
|
+ arr.push(obj);
|
|
|
+ that.$api.public.albumAdd({addMediaParamList:arr}).then(mapResult=>{
|
|
|
+ if(mapResult.status==='Succ'){
|
|
|
+ that.getAlbumData();
|
|
|
+ uni.hideLoading();
|
|
|
}
|
|
|
- uni.uploadFile({
|
|
|
- url: 'https://zhenyanapp-gen.oss-cn-qingdao.aliyuncs.com',
|
|
|
- filePath: res.tempFiles[i].tempFilePath,
|
|
|
- name: 'file',
|
|
|
- header:{
|
|
|
- "Content-Type": "multipart/form-data"
|
|
|
- },
|
|
|
- formData: formData,
|
|
|
- success: (data) => {
|
|
|
- if (data.statusCode === 200) {
|
|
|
- if(obj.cate==='Img'){
|
|
|
- let link=`${that.imageCdn}/${key}`;
|
|
|
- obj.url=link;
|
|
|
- }
|
|
|
- else if(obj.cate==='Vdo'){
|
|
|
- let link=`${that.videoCdn}/${key}`;
|
|
|
- obj.url=link;
|
|
|
- }
|
|
|
- arr.push(obj);
|
|
|
- if(arr.length===res.tempFiles.length){
|
|
|
- that.$api.public.albumAdd({addMediaParamList:arr}).then(mapResult=>{
|
|
|
- if(mapResult.status==='Succ'){
|
|
|
- that.getAlbumData();
|
|
|
- uni.hideLoading();
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- fail: err => {
|
|
|
- console.log(err);
|
|
|
- }
|
|
|
- })
|
|
|
})
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
+ this.$toast.clear();
|
|
|
+ this.showPopup=false;
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
}
|
|
|
|
|
@@ -411,60 +308,76 @@
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+@import "../../public.scss";
|
|
|
.container{
|
|
|
width: 100vw;
|
|
|
height: 100vh;
|
|
|
background-color: $bgcolor1;
|
|
|
position: relative;
|
|
|
+ overflow: auto;
|
|
|
.topnav {
|
|
|
- padding: 0 10rpx;
|
|
|
+ padding: 0 5px;
|
|
|
position: fixed;
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
width: 100vw;
|
|
|
+ height:60px;
|
|
|
z-index: 100;
|
|
|
- backdrop-filter: blur(10px);
|
|
|
.nav-item {
|
|
|
- width: 40rpx;
|
|
|
- height: 40rpx;
|
|
|
- margin-left: 16rpx;
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ padding:10px;
|
|
|
.nav-img{
|
|
|
- width: 40rpx;
|
|
|
- height: 40rpx;
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
.nav-text{
|
|
|
flex: 1;
|
|
|
color: $fontcolor5;
|
|
|
- height: 40rpx;
|
|
|
+ height: 20px;
|
|
|
text-align: center;
|
|
|
}
|
|
|
}
|
|
|
+ .big-vdo{
|
|
|
+ width:90vw;
|
|
|
+ height:90vh;
|
|
|
+ object-fit:cover;
|
|
|
+ overflow:hidden
|
|
|
+ }
|
|
|
+ .popup-close{
|
|
|
+ width: 32px;
|
|
|
+ height: 32px;
|
|
|
+ position: absolute;
|
|
|
+ right: 10px;
|
|
|
+ top:10px;
|
|
|
+ z-index: 999;
|
|
|
+ }
|
|
|
.popup{
|
|
|
width: 100vw;
|
|
|
box-sizing: border-box;
|
|
|
- padding: 56rpx 60rpx;
|
|
|
+ padding: 28px 30px;
|
|
|
background-color: $bgcolor3;
|
|
|
.p-title-box{
|
|
|
.p-title{
|
|
|
color: $fontcolor5;
|
|
|
}
|
|
|
.p-close{
|
|
|
- width: 40rpx;
|
|
|
- height: 40rpx;
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
}
|
|
|
}
|
|
|
.p-title-tip{
|
|
|
color: $fontcolor3;
|
|
|
- margin-top: 16rpx;
|
|
|
+ margin-top: 8px;
|
|
|
}
|
|
|
.p-img-box{
|
|
|
- margin-top: 80rpx;
|
|
|
+ margin-top: 40px;
|
|
|
.p-img{
|
|
|
.img{
|
|
|
- width: 200rpx;
|
|
|
- height: 200rpx;
|
|
|
+ width: 100px;
|
|
|
+ height: 100px;
|
|
|
}
|
|
|
.p-text{
|
|
|
color: $fontcolor2;
|
|
@@ -475,39 +388,39 @@
|
|
|
}
|
|
|
.auth-popup{
|
|
|
background-color: bgcolor1;
|
|
|
- border-radius: 40rpx 40rpx 0rpx 0rpx;
|
|
|
+ border-radius: 20px 20px 0px 0px;
|
|
|
.ap-title{
|
|
|
color: #ffffff;
|
|
|
text-align: center;
|
|
|
}
|
|
|
.ap-imgs{
|
|
|
flex-wrap: wrap;
|
|
|
- margin: 80rpx 64rpx 50rpx 64rpx;
|
|
|
+ margin: 40px 32px 25px 32px;
|
|
|
.ap-img-box{
|
|
|
- width: 306rpx;
|
|
|
- height: 306rpx;
|
|
|
- border-radius: 8rpx;
|
|
|
+ width: 153px;
|
|
|
+ height: 153px;
|
|
|
+ border-radius: 4px;
|
|
|
overflow: hidden;
|
|
|
- margin-right: 10rpx;
|
|
|
- margin-bottom: 10rpx;
|
|
|
+ margin-right: 5px;
|
|
|
+ margin-bottom: 5px;
|
|
|
position: relative;
|
|
|
&:nth-of-type(2n){
|
|
|
- margin-right: 0rpx;
|
|
|
+ margin-right: 0px;
|
|
|
}
|
|
|
.ap-img{
|
|
|
- width: 306rpx;
|
|
|
- height: 306rpx;
|
|
|
+ width: 153px;
|
|
|
+ height: 153px;
|
|
|
}
|
|
|
.ap-alpha{
|
|
|
position: absolute;
|
|
|
- width: 306rpx;
|
|
|
- height: 80rpx;
|
|
|
+ width: 153px;
|
|
|
+ height: 40px;
|
|
|
bottom: 0;
|
|
|
left: 0;
|
|
|
background: rgba(0,0,0,0.3);
|
|
|
.ap-right{
|
|
|
- width: 48rpx;
|
|
|
- height: 48rpx;
|
|
|
+ width: 24px;
|
|
|
+ height: 24px;
|
|
|
}
|
|
|
.ap-text{
|
|
|
color: #ffffff;
|
|
@@ -516,42 +429,47 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- .scroll-div{
|
|
|
+ .list{
|
|
|
position: relative;
|
|
|
- padding: 0rpx 30rpx;
|
|
|
+ padding: 0px 10px;
|
|
|
box-sizing: border-box;
|
|
|
- .move-area{
|
|
|
- position: absolute;
|
|
|
- left: 0;
|
|
|
- top: 0;
|
|
|
- width: 100%;
|
|
|
- flex-wrap: wrap;
|
|
|
- align-items: flex-start !important;
|
|
|
- .img-box{
|
|
|
- width: 216rpx;
|
|
|
- height: 216rpx;
|
|
|
- border-radius: 8rpx;
|
|
|
- position: relative;
|
|
|
- z-index: 1;
|
|
|
- margin-right: 19rpx;
|
|
|
- margin-top: 20rpx;
|
|
|
- &:nth-of-type(3n){
|
|
|
- margin-right: 0rpx;
|
|
|
- }
|
|
|
- .img-add{
|
|
|
- width: 216rpx;
|
|
|
- height: 216rpx;
|
|
|
- border-radius: 8rpx;
|
|
|
- }
|
|
|
- .img-delete{
|
|
|
- position: absolute;
|
|
|
- right: 16rpx;
|
|
|
- top: 16rpx;
|
|
|
- width: 40rpx;
|
|
|
- height: 40rpx;
|
|
|
+ padding-top: 60px;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ .move-item{
|
|
|
+ width: 108px;
|
|
|
+ height: 108px;
|
|
|
+ border-radius: 4px;
|
|
|
+ position: relative;
|
|
|
+ z-index: 1;
|
|
|
+ margin: 10px 5px 0px;
|
|
|
+ overflow: hidden;
|
|
|
+ display: inline-block;
|
|
|
+ // &:nth-of-type(3n){
|
|
|
+ // margin-right: 0px;
|
|
|
+ // }
|
|
|
+ .img-add{
|
|
|
+ width: 108px;
|
|
|
+ height: 108px;
|
|
|
+ border-radius: 4px;
|
|
|
+ }
|
|
|
+ .img-delete{
|
|
|
+ position: absolute;
|
|
|
+ right: 8px;
|
|
|
+ top: 8px;
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ background-color: rgba(0,0,0,0.3);
|
|
|
+ border-radius: 15px;
|
|
|
+ .del-image{
|
|
|
+ width: 12px;
|
|
|
+ height:12px;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ .vdo{
|
|
|
+ width: 108px;
|
|
|
+ height: 108px;
|
|
|
+ object-fit: cover;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
.btn-tip{
|
|
@@ -559,28 +477,41 @@
|
|
|
z-index: 999;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
- bottom: 160rpx;
|
|
|
+ bottom: 80px;
|
|
|
margin: auto;
|
|
|
- width: 630rpx;
|
|
|
- height: 50rpx;
|
|
|
+ width: 315px;
|
|
|
+ height: 25px;
|
|
|
color: #9A9ABF;
|
|
|
text-align: center;
|
|
|
- line-height: 50rpx;
|
|
|
+ line-height: 25px;
|
|
|
+ }
|
|
|
+ .file{
|
|
|
+ position: absolute;
|
|
|
+ bottom: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 100%;
|
|
|
+ z-index: 1000;
|
|
|
+ height: 52px;
|
|
|
+ top: 15px;
|
|
|
+ opacity: 0;
|
|
|
}
|
|
|
.btn{
|
|
|
position: fixed;
|
|
|
z-index: 999;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
- bottom: 44rpx;
|
|
|
+ bottom: 22px;
|
|
|
margin: auto;
|
|
|
- width: 630rpx;
|
|
|
- height: 104rpx;
|
|
|
- border-radius: 52rpx;
|
|
|
+ width: 315px;
|
|
|
+ height: 52px;
|
|
|
+ border-radius: 26px;
|
|
|
background-color: $primary;
|
|
|
color: $fontcolor5;
|
|
|
text-align: center;
|
|
|
- line-height: 104rpx;
|
|
|
+ line-height: 52px;
|
|
|
}
|
|
|
}
|
|
|
+.ghost{
|
|
|
+ opacity: 0;
|
|
|
+}
|
|
|
</style>
|