瀏覽代碼

除艺术照绘画记录外其他功能基本定型

李万涛 1 年之前
父節點
當前提交
92704e226a

+ 23 - 13
pages/digitalMen/generate/index.scss

xqd xqd xqd
@@ -620,20 +620,30 @@ page {
 					// align-items: center;
 					margin: 0 30rpx;
 					margin-left: 30rpx;
-					margin-bottom: 20rpx;
+					margin-bottom: 30rpx;
 					.avtarBox{
 						display: flex;
 						flex-direction: column;
 						justify-content: center;
 						align-items: center;
-						
-						image{
+						.imgBox{
 							width: 128rpx;
 							height: 128rpx;
-							border-radius: 50%;
+							image{
+								width: 100%;
+								height: 100%;
+								border-radius: 50%;
+							}
 						}
+						.nameDes{
+							width: 128rpx;
+							overflow: hidden;
+							white-space: nowrap;
+							text-overflow: ellipsis;
+						}
+						
 						.name{
-							margin-top: 10rpx;
+							margin-top: 0rpx;
 						}
 					}
 					.playBox{
@@ -646,7 +656,7 @@ page {
 				}
 				.sel{
 					border:6rpx solid #207CF7;
-					padding: 5rpx;
+					// padding: 5rpx;
 				}
 			}
 			
@@ -768,18 +778,18 @@ page {
 	
 	
 	.nameDes{
-		margin-top:  10rpx;
+		margin-top:  0rpx;
 		font-size: 24rpx;
 		color: #999;
 		text-align: center;
 		width: 132rpx;
 		
-		height: 65rpx;
-		text-overflow: ellipsis;
-		 display: -webkit-box;     /* 弹性盒旧式语法 */
-		  -webkit-box-orient: vertical;    /* 经过个人实测,vertical或horizontal都没问题,只是必须设置该属性 */
-		  -webkit-line-clamp: 2;    /* 限制两行 */
-		  overflow: hidden;
+		// height: 65rpx;
+		// text-overflow: ellipsis;
+		//  display: -webkit-box;    
+		//   -webkit-box-orient: vertical;
+		//   -webkit-line-clamp: 1;   
+		//   overflow: hidden;
 	}
 	
 	.selTxt{

+ 7 - 4
pages/digitalMen/generate/index.vue

xqd xqd
@@ -164,12 +164,13 @@
 									<image :class="[currTabIndexAll==index?'sel':'']" :src="item.url" mode="">
 								</view>
 								<!-- </image> -->
-								<view class="nameDes">
-									{{item.title}}
-								</view>
 								<view class="name" :class="[currTabIndexAll==index?'selTxt':'']">
 									{{item.name}}
 								</view>
+								<view class="nameDes">
+									{{item.title}}
+								</view>
+
 
 							</view>
 
@@ -662,10 +663,12 @@
 				this.allList = res1.msg
 				console.log('数字人声音列表返回值:', res1);
 				this.currTabIndexAll = res1.msg.findIndex((item, index) => {
-					return item.id == this.selVoiceId + 1
+					// return item.id == this.selVoiceId + 1
+					return item.id == this.selVoiceId
 				})
 				if (this.isCreate) {
 					this.selVoiceItem = this.allList[9]
+					console.log('创建数字人默认的指定项===', this.selVoiceItem);
 				}
 
 			} else {

+ 39 - 18
pages/digitalMen/generate/index1.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -1,6 +1,18 @@
 <template>
 	<view class="container">
 		<tn-nav-bar :isBack="true" backgroundColor="#fff" :bottomShadow="false">数字人创建</tn-nav-bar>
+		<div class="addFix" v-if="showInitLead">
+			<div class="leadBg">
+				<div class="leadBox1" v-if="showLead1">
+					<div class="nextBtn" @click="nextLead">
+					</div>
+				</div>
+				<div class="leadBox2" v-if="showLead2">
+					<div class="nextBtn" @click="finishLead">
+					</div>
+				</div>
+			</div>
+		</div>
 		<view class="pos">
 		</view>
 		<view class="context">
@@ -99,7 +111,7 @@
 				<view class="btn draft" @click="saveDraft">
 					存草稿
 				</view>
-				<view class="btn" @click="genRobot" style="background: linear-gradient(to right,#06C68E,#02BCCD);">
+				<view class="btn" @click="genRobot" style="background: linear-gradient(to right,#549DFF,#207CF7);">
 					合成
 				</view>
 			</view>
@@ -123,7 +135,7 @@
 				</view>
 				<view class="content" style="min-height: 300rpx;">
 					<u-slider height="50" min="0.7" max="1.3" step="0.1" class="slider" :showValue='false'
-						@change="handleChange" activeColor="#26b3a0" v-model="voiceRate"></u-slider>
+						@change="handleChange" activeColor="#207CF7" v-model="voiceRate"></u-slider>
 					<view class="sliderValue">
 						{{roundRate}}X
 					</view>
@@ -230,7 +242,7 @@
 								<image :class="[currTabIndexBg==index?'sel':'']" :src="item.url" mode=""
 									@click="handleSelBg(item,index)"></image>
 								<view class="ratio">
-									{{item.scale==1?'(9:16)':'(16:9)'}}
+									{{item.scale==1?'(9:16)':item.id==22?'(16:9)白色':'(16:9)'}}
 								</view>
 							</view>
 						</view>
@@ -376,8 +388,9 @@
 
 		<!-- <view class="" style="height: 500rpx;width:300rpx !important;" :style='genResBgImg'>
 		</view> -->
-	</view>
+
 
+	</view>
 	</view>
 </template>
 
@@ -398,6 +411,10 @@
 	export default {
 		data() {
 			return {
+				showInitLead: false,
+				showLead2: false,
+				showLead1: true,
+
 				bobaoMenuList: ['输入播报文本', '上传播报录音文件'],
 				curBobaoIndex: 0,
 
@@ -553,6 +570,9 @@
 
 		},
 		onLoad(o) {
+			this.showInitLead = !uni.getStorageSync('showInitLead_szr2')
+			console.log("uni.getStorageSync('showInitLead')", uni.getStorageSync('showInitLead_szr2'));
+
 			if (o.type == 'create') {
 				this.isCreate = true
 				this.selRoleId = 5
@@ -572,8 +592,7 @@
 			this.robotName = getApp().draftDetail.name
 			this.textAreaValue = getApp().draftDetail.content
 			this.selRoleId = getApp().draftDetail.role - 1
-			// this.selVoiceId = getApp().draftDetail.audio - 1
-			this.selVoiceId = getApp().draftDetail.audio - 2
+			this.selVoiceId = getApp().draftDetail.audio - 1
 			this.voiceRate = getApp().draftDetail.stage
 
 			this.selBgId = getApp().draftDetail.back - 1
@@ -582,8 +601,6 @@
 
 			this.roundRate = getApp().draftDetail.stage
 			this.selVoiceItem = getApp().draftDetail.audios
-
-			console.log('getApp().draftDetail.audios-----this.selVoiceItem', this.selVoiceItem);
 			this.selRoleItem = getApp().draftDetail.roles
 
 
@@ -645,13 +662,10 @@
 				this.allList = res1.msg
 				console.log('数字人声音列表返回值:', res1);
 				this.currTabIndexAll = res1.msg.findIndex((item, index) => {
-					// return item.id == this.selVoiceId + 1
-					return item.id == this.selVoiceId
+					return item.id == this.selVoiceId + 1
 				})
 				if (this.isCreate) {
 					this.selVoiceItem = this.allList[9]
-
-					console.log('this.isCreate-------this.selVoiceItem', this.selVoiceItem);
 				}
 
 			} else {
@@ -701,6 +715,18 @@
 		},
 
 		methods: {
+			nextLead() {
+				this.showLead1 = false
+				this.showLead2 = true
+			},
+			finishLead() {
+				this.showInitLead = false
+				this.showLead2 = false
+				uni.setStorageSync('showInitLead_szr2', true)
+			},
+
+
+
 			handleChangeBobao(index) {
 				this.curBobaoIndex = index
 				// if (index == 0) {
@@ -979,10 +1005,7 @@
 				}
 
 				this.selVoiceItem = item
-
-				console.log('this.selVoiceItem-----', this.selVoiceItem);
-				// this.selVoiceId = item.id - 1
-				this.selVoiceId = item.id
+				this.selVoiceId = item.id - 1
 				this.currTabIndexAll = index
 			},
 			async handleRoleSel(item, index) {
@@ -1244,8 +1267,6 @@
 					this.music = uni.createInnerAudioContext(); //创建播放器对象
 					this.music.autoplay = true;
 					this.show1 = true
-
-					// console.log('是否创建好this.music', this.music);
 				} else if (item.name == '角色') {
 
 					this.show3 = true

+ 1 - 0
pages/index/index.vue

xqd
@@ -107,6 +107,7 @@
 		},
 
 		onLoad(o) {
+
 			this.showInitLead = !uni.getStorageSync('showInitLead')
 
 			if (o.uniacid) {

+ 0 - 173
pages/index/index3.scss

xqd
@@ -1,173 +0,0 @@
-.outer{
-	position: relative;
-	.leadBg{
-		position: absolute;
-		width: 100vw;
-		height: 100vh;
-		left: 0;
-		top: 0;
-		z-index: 9999;
-		background: rgba(0, 0, 0, .69);
-		// padding-left: 38rpx;
-		// padding-right: 38rpx;
-		
-		display: flex;
-		justify-content: center;
-		.leadBox1{
-			// margin-bottom: 138rpx;
-			width: 646rpx;
-			height: 842rpx;
-			background-image: url(@/static/index_lead1.png);
-			background-size: cover;
-			margin-top: 280rpx;
-			position: relative;
-			
-			.nextBtn{
-				width: 350rpx;
-				height: 140rpx;
-				// background: red;
-				
-				position: absolute;
-				right: 0;
-				bottom: 0rpx;
-			}
-		}
-		.leadBox2{
-			width: 634rpx;
-			// width: 100%;
-			height: 1226rpx;
-			background-image: url(@/static/index_lead2.png);
-			background-size: cover;
-			// margin-top: 400rpx;
-			// position: relative;
-			
-			margin-left: -60rpx;
-			position: absolute;
-			
-			bottom: 0;
-			
-			.nextBtn{
-				width: 350rpx;
-				height: 140rpx;
-				// background: green;
-				position: absolute;
-				right: 0;
-				bottom:330rpx;
-			}
-		}
-	}
-}
-
-
-.subsection {
-		margin: 0rpx 25rpx 0;
-		position: fixed;
-		width: 93.8%;
-		top: 30rpx;
-		// top: 30rpx;
-		z-index: 9999;
-	}
-
-	/* 瀑布流*/
-	.product__item {
-		background-color: #FFFFFF;
-		overflow: hidden;
-		margin: 0 10rpx;
-		margin-bottom: 20rpx;
-		// box-shadow: 0rpx 0rpx 30rpx 0rpx rgba(0, 0, 0, 0.07);
-
-		.item {
-
-			/* 图片 start */
-			&__image {
-				width: 100%;
-				height: auto;
-				background-color: #FFFFFF;
-				border: 1rpx solid #F8F7F8;
-				// border-radius: 20rpx;
-				overflow: hidden;
-			}
-
-			/* 图片 end */
-
-			/* 内容 start */
-			&__data {
-				padding: 14rpx 0rpx;
-			}
-
-			/* 标题 start */
-			&__title-container {
-				text-align: justify;
-				line-height: 38rpx;
-				vertical-align: middle;
-			}
-
-			&__store-type {
-				height: 28rpx;
-				font-size: 20rpx;
-				position: relative;
-				display: inline-flex;
-				align-items: center;
-				justify-content: center;
-				padding: 4rpx;
-				border-radius: 6rpx;
-				white-space: nowrap;
-				text-align: center;
-				top: -2rpx;
-				margin-right: 6rpx;
-			}
-
-			&__title {
-				font-size: 30rpx;
-			}
-
-			/* 标题 end */
-
-			/* 标签 start */
-			&__tags-container {
-				display: flex;
-				flex-direction: row;
-				flex-wrap: nowrap;
-				align-items: center;
-				justify-content: flex-start;
-			}
-
-			&__tag {
-				margin: 10rpx;
-				color: #7C8191;
-				background-color: #F3F2F7;
-				padding: 4rpx 14rpx 6rpx;
-				border-radius: 10rpx;
-				font-size: 20rpx;
-
-				&:first-child {
-					margin-left: 0rpx !important;
-				}
-			}
-
-			/* 标签 end */
-			/* 内容 end */
-		}
-	}
-
-	.suspension {
-		background: linear-gradient(to right, #549DFF,#207CF7,);
-		color: #fff;
-		position: fixed;
-		left: 50%;;
-		bottom: 180rpx;
-		width: 648rpx;
-		height: 96rpx;
-		border-radius: 48rpx 12rpx 48rpx 12rpx;
-		transform: translateX(-50%);
-		
-		box-shadow: 0 3px 14px -2px  rgba(4, 89, 202,.6);
-	}
-
-	.wike_ad {
-		margin: 0 6px 11px;
-	}
-
-	.db {
-		height: 83px;
-	}

+ 0 - 260
pages/index/index3.vue

xqd
@@ -1,260 +0,0 @@
-<template>
-	<view class="outer">
-		<!-- <view class="subsection">
-			<tn-subsection :list="subsectionlist" mode="button" :borderRadius="50"
-				animationType="cubic-bezier" bold :height="90" @change="getsubsection"></tn-subsection>
-		</view> -->
-		<wike-skeleton :count="4" v-if="showskeleton"></wike-skeleton>
-		<view style="height: 66px;"></view>
-		<z-paging ref="paging" refresher-complete-delay="200" v-model="drawList" @query="queryList">
-			<!-- <view slot="top" class="z_tabs" :style="{ marginTop: 66 + 'px' ,background: 'none'}"></view> -->
-			<view class="subsection">
-				<tn-subsection :list="subsectionlist" mode="button" :borderRadius="50" animationType="cubic-bezier" bold
-					:height="90" @change="getsubsection"></tn-subsection>
-			</view>
-
-			<view style="padding: 150rpx 15rpx 30rpx 15rpx;">
-				<view v-if="homeTemplate&&homeTemplate.banner&&homeTemplate.banner.length>0" class="wike_ad">
-					<wike-ad></wike-ad>
-				</view>
-
-				<tn-waterfall v-if="drawList.length>0" ref="waterfall" v-model="drawList"
-					@finish="handleWaterFallFinish">
-					<template v-slot:left="{ leftList }">
-						<view v-for="(item, index) in leftList" :key="item.id" class="product__item"
-							@click="tnproduct(item.id)">
-							<view class="item__image">
-								<tn-lazy-load :threshold="6000" height="100%"
-									:image="item.imgs_file[0]?item.imgs_file[0]:item.origin_url" :index="item.id"
-									imgMode="widthFix"></tn-lazy-load>
-							</view>
-						</view>
-					</template>
-					<template v-slot:right="{ rightList }">
-						<view v-for="(item, index) in rightList" :key="item.id" class="product__item"
-							@click="tnproduct(item.id)">
-							<view class="item__image">
-								<tn-lazy-load :threshold="6000" height="100%"
-									:image="item.imgs_file[0]?item.imgs_file[0]:item.origin_url" :index="item.id"
-									imgMode="widthFix"></tn-lazy-load>
-							</view>
-						</view>
-					</template>
-				</tn-waterfall>
-				<!-- <wike-waterfall :dataList="data" :column="columns" @click="click" :radius="20" :margin="10"></wike-waterfall> -->
-			</view>
-			<view slot="bottom" class="z_tabs" :style="{ marginBottom: 72 + 'px' }"></view>
-		</z-paging>
-
-		<view @click="getcreate" class="suspension u-flex align-center justify-center">
-			AI创作
-		</view>
-
-
-		<wike-tabbar2 :currTabIndex='0' v-if="appInfo.page_template == 3" :is_aipainting="appInfo.is_aipainting"
-			:onTabbar="true" :isShowAnimate="true" :appInfos="appInfo.page_template"></wike-tabbar2>
-		<wike-tabbar :currTabIndex='0' v-else :onTabbar="true" :is_aipainting="appInfo.is_aipainting"
-			:isShowAnimate="true" :appInfos="appInfo.page_template"></wike-tabbar>
-
-		<u-modal @cancel="handleCancel" @confirm="handleConfirm" cancelText='退出登录' showCancelButton :show="showFixInfo"
-			confirmColor="#26b3a0" confirmText="完善信息" title="请完善个人手机号信息后使用本应用"
-			content='您已充值,但未绑定手机号,请完善信息以方便为您提供进一步的服务'></u-modal>
-
-
-
-		<!-- 初始引导界面 -->
-		<div class="leadBg" v-if="showInitLead">
-			<div class="leadBox1" v-if="showLead1">
-				<div class="nextBtn" @click="nextLead">
-				</div>
-			</div>
-			<div class="leadBox2" v-if="showLead2">
-				<div class="nextBtn" @click="finishLead">
-				</div>
-			</div>
-		</div>
-	</view>
-</template>
-
-<script>
-	import {
-		mapMutations,
-		mapActions,
-		mapState,
-		mapGetters
-	} from 'vuex';
-	import {
-		apiurl
-	} from '@/common/request/request';
-	import $platform from '@/common/platform';
-	let rewardedVideoAd = null;
-	export default {
-		mixins: [],
-		components: {},
-		data() {
-			return {
-				showInitLead: false,
-				showLead2: false,
-				showLead1: true,
-
-				list: [],
-				drawList: [],
-				subsectionlist: ['StableDiffusion绘图', 'MidJourney绘图'],
-				engine: 'mj',
-				showskeleton: true,
-
-				showFixInfo: false,
-			};
-		},
-		computed: {
-			...mapGetters(['appInfo', 'userInfo', 'homeTemplate'])
-		},
-
-		onLoad(o) {
-			this.showInitLead = !uni.getStorageSync('showInitLead')
-			console.log("uni.getStorageSync('showInitLead')", uni.getStorageSync('showInitLead'));
-
-			// this.getRandomData()
-			if (o.uniacid) {
-				// if (uni.getStorageSync('uniacid')) {
-				// 	return
-				// }
-				uni.setStorageSync('uniacid', o.uniacid)
-				console.log('onload获取的应用ID----paiting', uni.getStorageSync('uniacid'));
-			}
-		},
-		onShow() {
-			this.$http('user.info').then(res => {
-				if (res.code == 0) {
-					console.log('用户是否是首次支付成功,但未填写手机号', res.data.is_new);
-					this.showFixInfo = res.data.is_new;
-					// this.showFixInfo = true;
-				}
-			})
-
-			// 网络变化检测
-			uni.onNetworkStatusChange(res => {
-				this.isConnected = res.isConnected;
-
-			});
-		},
-		onReady() {
-			// #ifdef MP-WEIXIN
-			if (wx.createRewardedVideoAd && this.appInfo.video_status == 1) {
-				rewardedVideoAd = wx.createRewardedVideoAd({
-					adUnitId: this.appInfo.video_id
-				});
-				rewardedVideoAd.onLoad(() => {
-					console.log('onLoad event emit');
-				});
-				rewardedVideoAd.onError(err => {
-					console.log('onError event emit', err);
-				});
-				rewardedVideoAd.onClose(res => {
-					if (res && res.isEnded) {
-						// 正常播放结束,可以下发游戏奖励
-						this.memberAddCoin();
-						this.showcoin = false;
-					} else {
-						// 播放中途退出,不下发游戏奖励
-						uni.showToast({
-							title: '看完广告后才可获得积分哦',
-							icon: 'none'
-						});
-					}
-				});
-			}
-			// #endif
-			this.loading = false;
-		},
-		methods: {
-			...mapActions(['getUserInfo', 'showAuthModal', 'getUserData', 'logout']),
-			nextLead() {
-				this.showLead1 = false
-				this.showLead2 = true
-			},
-			finishLead() {
-				this.showInitLead = false
-				this.showLead2 = false
-				uni.setStorageSync('showInitLead', true)
-			},
-			handleCancel() {
-				this.showFixInfo = false
-				this.logout()
-				// uni.clearStorage()
-
-				uni.reLaunch({
-					url: '/pages/user/signin'
-				})
-			},
-			handleConfirm() {
-				uni.navigateTo({
-					url: '/pages/user/userinfo?isNewUser=true'
-				})
-			},
-			queryList(pageNo, pageSize) {
-				//这里的pageNo和pageSize会自动计算好,直接传给服务器即可
-				const params = {
-					page: pageNo,
-					limit: pageSize,
-					engine: this.engine
-				};
-				this.$http('gallery.all', params).then(res => {
-					if (res.code == 0) {
-						uni.setNavigationBarTitle({
-							title: this.appInfo.site_name
-						});
-						this.showskeleton = false
-						if (pageNo == 1) {
-							this.drawList = []
-						}
-						this.$refs.paging.complete(res.data.data);
-						this.isLoading = false;
-					}
-				});
-			},
-			getsubsection(e) {
-				// console.log(e);
-				this.engine = e.index == 1 ? 'mj' : 'sd'
-				this.drawList = []
-				this.$refs.paging.reload(true);
-			},
-			getcreate() {
-				uni.navigateTo({
-					url: '/pages/painting/draw'
-				})
-			},
-			/* 瀑布流*/
-			// 获取随机数据
-			getRandomData() {
-				// console.log(13);
-				// this.loadStatus = 'loading'
-				for (let i = 0; i < 10; i++) {
-					let index = this.$t.number.randomInt(0, this.data.length - 1)
-
-					let item = JSON.parse(JSON.stringify(this.data[index]))
-					item.id = this.$t.uuid()
-					this.list.push(item)
-					// console.log(this.list);
-				}
-			},
-			// 瀑布流加载完毕事件
-			handleWaterFallFinish() {
-				// this.loadStatus = 'loadmore'
-			},
-			tnproduct(id) {
-
-				uni.navigateTo({
-					url: '/pages/painting/details?urls=' + id + '&from=' + this.engine
-
-					// + '&form=' + JSON.stringify(
-					// this.form)
-				})
-			}
-		}
-	};
-</script>
-
-<style lang="scss" scoped>
-	@import './index.scss';
-</style>

+ 0 - 1443
pages/painting/details1.vue

xqd
@@ -1,1443 +0,0 @@
-<template>
-	<view class="template-details">
-		<block v-if="showdrawing">
-			<u-notice-bar v-if="drawingtitle=='正在努力绘制中...'||drawingtitle=='图片正在渲染中...'" :text="noticebar" step
-				bgColor="#000"></u-notice-bar>
-			<view class="lazy-loading tn-flex justify-center align-center flex-wrap">
-				<view class="preloader_1">
-					<view></view>
-					<view></view>
-					<view></view>
-					<view></view>
-					<view></view>
-				</view>
-				<view class="drawing">
-					{{drawingtitle}}
-				</view>
-				<view v-if="showprogress" class="progress">
-					<u-line-progress :percentage="percentage" activeColor="#9b59b6" height="18"></u-line-progress>
-				</view>
-			</view>
-		</block>
-
-		<swiper class="card-swiper" :circular="false" :autoplay="true" duration="500" interval="12000"
-			@change="cardSwiper">
-			<swiper-item v-for="(item,index) in swiperList" :key="index" :class="cardCur==index?'cur':''">
-				<view class="lazy-load" :style="{height: windowHeight+'px'}">
-					<u--image @load="previewload" @error="previewerror" width="100%" height="100%" :src="item.url"
-						mode="widthFix">
-						<view slot="error" style="font-size: 32rpx;text-align: center;">
-							图片加载失败
-						</view>
-					</u--image>
-				</view>
-			</swiper-item>
-		</swiper>
-		<view class="indication">
-			<block v-for="(item,index) in swiperList" :key="index">
-				<view v-if="swiperList.length>1" class="spot" :class="cardCur==index?'active':''"></view>
-			</block>
-		</view>
-
-		<view class="tabbar footerfixed dd-glass tn-color-white" style="border-radius: 100rpx;">
-			<view class="action" @click="getisback">
-				<view class="bar-icon">
-					<view class="tn-icon-left-circle">
-					</view>
-				</view>
-				<view class="">立即返回</view>
-			</view>
-
-			<view class="action" @click="getdownload(cardCur)">
-				<view class="bar-icon">
-					<view class="tn-icon-download">
-					</view>
-				</view>
-				<view class="">下载/分享</view>
-			</view>
-
-			<view class="action" @click="preViewImg_ys(1)" v-if="engin=='rh'">
-				<view class="bar-icon">
-					<view class="tn-icon-image">
-					</view>
-				</view>
-				<view class="">模板</view>
-			</view>
-
-			<view class="action" @click="preViewImg_ys(2)" v-if="engin=='rh'">
-				<view class="bar-icon">
-					<view class="tn-icon-image">
-					</view>
-				</view>
-				<view class="">照片</view>
-			</view>
-
-
-			<view class="action" @click="parameters" v-if="engin!='rh'">
-
-				<view class="bar-icon">
-					<view class="tn-icon-creative">
-					</view>
-				</view>
-				<view class="">绘画参数</view>
-			</view>
-
-
-			<view class="action" @click="preViewImg(1)" v-if="parameter.refImg&&$Route.query.urls">
-				<view class="bar-icon">
-					<view class="tn-icon-image">
-					</view>
-				</view>
-				<view class="">参考图</view>
-			</view>
-
-			<view class="action" @click="preViewImg(2)" v-if="form.init_image
-">
-				<view class="bar-icon">
-					<view class="tn-icon-image">
-					</view>
-				</view>
-				<view class="">参考图</view>
-			</view>
-
-			<view v-if="show2" class="action"
-				@click="tn(engin!='rh'?'/pages/painting/draw?prompt='+parameter.promptSame+'&engine='+engin+'&model_name='+parameter.model_name+'&refImg='
-	+parameter.refImg:'/pages/painting/draw?rh_modalId='+(parameter.templateId?parameter.templateId:-1)+'&rh_modalurl='+parameter.source_image_url)">
-				<view class="tn-flex-direction-column tn-flex-row-center tn-flex-col-center tn-button--clear-style">
-					<view class="bar-icon">
-						<view class="tn-icon-write">
-						</view>
-					</view>
-					<view class="">创作相似</view>
-				</view>
-			</view>
-			<view v-else class="action" @click="setOpen">
-				<view class="tn-flex-direction-column tn-flex-row-center tn-flex-col-center tn-button--clear-style">
-					<view class="bar-icon">
-						<view class="tn-icon-up-circle">
-						</view>
-					</view>
-					<view class="">{{showopen?'已公开':'公开作品'}}</view>
-				</view>
-			</view>
-		</view>
-
-
-		<tn-landscape :show="show1" @close="closeLandscape" closePosition="bottom" :closeSize="60">
-			<view class="tn-color-white" style="width: 100vw;">
-
-				<view class="" style="margin: 120rpx 60rpx;">
-					<view class="tn-flex tn-flex-row-between tn-flex-col-between tn-margin-top-xl tn-text-justify">
-						<text class="">AI绘画:{{parameter.engine == 'sd'?'StableDiffusion绘图':'MidJourney绘图'}}</text>
-					</view>
-					<view v-if="parameter.prompt&&$Route.query.urls"
-						class="tn-flex tn-flex-row-between tn-flex-col-between tn-margin-top-xl tn-text-justify">
-						<text class="">描述词:{{parameter.prompt}}</text>
-					</view>
-					<view v-if="form.keywords"
-						class="tn-flex tn-flex-row-between tn-flex-col-between tn-margin-top-xl tn-text-justify">
-						<text class="">描述词:{{form.keywords}}</text>
-					</view>
-					<view v-if="parameter.model_name"
-						class="tn-flex tn-flex-row-between tn-flex-col-between tn-margin-top-xl tn-text-justify">
-						<text class="">模型:{{form.name?form.name:parameter.model_name}}</text>
-					</view>
-					<view v-if="parameter.width"
-						class="tn-flex tn-flex-row-between tn-flex-col-between tn-margin-top-xl tn-text-justify">
-						<text class="">分辨率:{{parameter.width}}x{{parameter.height}}</text>
-					</view>
-				</view>
-			</view>
-		</tn-landscape>
-		<u-popup :show="show" @close="close" @open="open" mode="center">
-			<view
-				style="background: rgba(0, 0, 0, 0);width: 300rpx;height: 300rpx;display: flex;align-items: center;flex-direction: column;justify-content: center;color:#207CF7;">
-				<l-circularProgress :isBgShow="true" :lineWidth="10" boxWidth="100" boxHeight="100"
-					progressColor="#207CF7" fontColor="#207CF7" gradualColor="#207CF7"
-					:percent="progress"></l-circularProgress>
-				<view class="">
-					图片下载中...
-				</view>
-			</view>
-		</u-popup>
-
-		<wike-painter style="height:1px;margin-top: -9999999px;" :board="posterObj" @done="posterSuccess"
-			ref="painter"></wike-painter>
-	</view>
-</template>
-
-<script>
-	import {
-		mapMutations,
-		mapActions,
-		mapState,
-		mapGetters
-	} from 'vuex';
-	let timingr;
-	let asynchronous;
-	// 判断是否为微信环境
-	// const isWechat = () => {
-	// 	return String(navigator.userAgent.toLowerCase().match(/MicroMessenger/i)) === "micromessenger";
-	// }
-	export default {
-		data() {
-			return {
-				tobheight: 45,
-				showdrawing: true,
-				showprogress: true,
-				drawingtitle: '正在努力绘制中...',
-				percentage: 0,
-				show1: false,
-				show2: true,
-				cardCur: 0,
-				swiperList: [],
-				form: {},
-				parameter: {},
-				noticebar: ['精美图片需要时间打磨,预计20-30秒左右出图',
-					'图片生成中请不要退出此页面,否则可能会无法生成'
-					// '长时间未出图?可稍后在 我的-绘画记录 里查看'
-				],
-				parameterid: 0,
-				showopen: false,
-				failnum: 0,
-				windowHeight: 0,
-				engin: '',
-				progress: 0,
-				isDowload: false,
-				show: false,
-				sd_keywords: '',
-
-
-				// 生成海报data
-				platform: this.$platform.get(),
-
-				qrcode: '',
-				spmplatform: 0,
-				posterObj: {},
-				info: {
-					// poster_bg_img_path:"",
-
-					poster_bg_width: 347,
-					poster_bg_height: 574,
-
-					poster_qrcode_x: 278,
-					poster_qrcode_y: 495,
-					poster_qrcode_width: 52,
-					poster_qrcode_height: 52,
-				},
-			}
-		},
-
-		// 生成海报需要的数据由此开始
-		computed: {
-			...mapGetters(['appInfo', 'homeTemplate', 'isLogin', 'userInfo', 'userData'])
-		},
-		onShow() {
-			console.log('this.userInfo-----------------', this.option, this.userInfo);
-		},
-		onLoad(o) {
-			this.spmplatform = ['H5', 'wxOfficialAccount', 'wxMiniProgram', 'App'].indexOf(this.platform) + 1;
-			// this.commonqrcodePath()
-
-			var that = this;
-			this.windowHeight = uni.$u.sys().windowHeight - 60
-			this.engin = that.$Route.query.from
-			if (that.$Route.query.urls) {
-				this.showprogress = false
-				this.drawingtitle = '图片正在加载中...'
-				that.gallerydetail(that.$Route.query.urls)
-			}
-			if (that.$Route.query.form) {
-				this.form = that.$Route.query.form
-				console.log('生成绘画的参数:', this.form);
-				this.parameter.refImg = this.form.refer_img
-				this.parameter.prompt = this.form.init_image + this.form.prompt
-				this.parameter.model_name = this.form.model_id
-				this.parameter.width = this.form.width
-				this.parameter.height = this.form.height
-				this.parameter.engine = 'sd'
-				this.show2 = false
-				this.sd_keywords = this.form.keywords
-				this.aiPlay();
-			}
-		},
-		methods: {
-			preViewImg_ys(type) {
-				if (type == 1) {
-					uni.previewImage({
-						urls: [this.parameter.source_image_url],
-						longPressActions: {
-							itemList: ['发送给朋友', '保存图片', '收藏'],
-							success: function(data) {},
-							fail: function(err) {
-								console.log(err.errMsg);
-							}
-						}
-					});
-				} else {
-					uni.previewImage({
-						urls: [this.parameter.target_image_url],
-						longPressActions: {
-							itemList: ['发送给朋友', '保存图片', '收藏'],
-							success: function(data) {},
-							fail: function(err) {
-								console.log(err.errMsg);
-							}
-						}
-					});
-				}
-			},
-			downloadPic(e) {
-				return new Promise((resolve, reject) => {
-					uni.request({
-						url: e,
-						method: 'GET',
-						responseType: 'arraybuffer',
-						success: ress => {
-							let base64 = uni.arrayBufferToBase64(ress.data);
-							base64 = 'data:image/jpeg;base64,' + base64
-							resolve(base64);
-						},
-						fail: (e) => {
-							resolve('fail');
-						}
-					})
-				});
-			},
-			commonqrcodePath() {
-				let spm = this.userInfo.id + '.1.0.' + this.spmplatform + '.1';
-				// console.log(spm);
-				this.$http('common.qrcodePath', {
-					spm: spm
-				}).then(res => {
-					if (res.code == 0) {
-						this.qrcode = res.data;
-						this.createPoster()
-						console.log('二维码需要包含的url信息=============', this.qrcode);
-					}
-				});
-			},
-			async createPoster(e) {
-				let that = this;
-
-				let avatarUrl = '';
-				let mainUrl = '';
-				uni.showLoading({
-					title: '海报渲染中'
-				});
-
-				console.log("that.swiperList[0].url,that.userInfo.avatar", that.userInfo, that.swiperList[0].url, that
-					.userInfo.avatar);
-
-
-				if (that.swiperList[0].url.indexOf("https") < 0) {
-					mainUrl = await that.downloadPic(that.swiperList[0].url.replace("http:", "https:"));
-				} else {
-					mainUrl = await that.downloadPic(that.swiperList[0].url);
-				}
-				if (mainUrl == 'fail') {
-					uni.hideLoading();
-					uni.showToast({
-						title: '生成失败',
-						icon: 'none'
-					})
-					return;
-				}
-				that.userInfo.avatar =
-					"https://face.cdn.zhishuyun.com/attachments/1133012400174534792/1204009950465101866/0d47db66-1faf-42df-a732-22cf18697a65_ins.png?ex=65d32ca5&is=65c0b7a5&hm=7219a0f250453314cfbf9eefaf2e927ba8d6adea944774b3fe32e67c0787a877&"
-				if (that.userInfo.avatar) {
-					if (that.userInfo.avatar.indexOf("https") < 0) {
-						avatarUrl = await that.downloadPic(that.userInfo.avatar.replace("http:", "https:"));
-					} else {
-						avatarUrl = await that.downloadPic(that.userInfo.avatar);
-					}
-					if (avatarUrl == 'fail') {
-						uni.hideLoading();
-						uni.showToast({
-							title: '生成失败',
-							icon: 'none'
-						})
-						return;
-					}
-				}
-
-				let proportionally = this.info.poster_bg_width / uni.$u.sys().windowWidth;
-				(this.posterObj = {
-					width: (this.info.poster_bg_width / proportionally) + 'px',
-					height: (this.info.poster_bg_height / proportionally) + 'px',
-					background: 'rgba(0,0,0,0)',
-					borderRadius: '16rpx',
-					views: [
-						// 背景图
-						{
-							src: '/static/shareBg.png',
-							type: "image",
-							css: {
-								width: (this.info.poster_bg_width / proportionally) + 'px',
-								height: (this.info.poster_bg_height / proportionally) + 'px',
-							}
-						},
-						// 主图
-						{
-							type: 'view',
-							css: {
-								position: 'absolute',
-								left: '24rpx',
-								top: '24rpx',
-							},
-							views: [{
-								src: mainUrl,
-								type: "image",
-								css: {
-									width: 705 + 'rpx',
-									height: 936 + 'rpx',
-									borderRadius: '28rpx',
-								}
-							}, ],
-						},
-
-
-						// 头像
-						{
-							type: 'view',
-							css: {
-								display: 'flex',
-								position: 'absolute',
-								left: '24rpx',
-								top: '1060rpx',
-
-							},
-							views: [{
-								type: 'image',
-								src: that.userInfo.avatar ? avatarUrl : '/static/images/head.jpg',
-								css: {
-									marginTop: '-80rpx',
-									borderRadius: '50%',
-									width: '94rpx',
-									height: '94rpx',
-									objectFit: 'cover'
-								}
-							}, ],
-						},
-						// 昵称
-						{
-							type: 'view',
-							css: {
-								display: 'flex',
-								position: 'absolute',
-								left: '140rpx',
-								bottom: '196rpx',
-
-							},
-							views: [{
-								type: 'text',
-								text: that.userInfo.nickname ? that.userInfo.nickname : '默认用户',
-								css: {
-									fontSize: '28rpx',
-									color: '#333333',
-								}
-							}],
-						},
-
-						// 海报文案1
-						{
-							type: 'view',
-							css: {
-								display: 'flex',
-								position: 'absolute',
-								left: '24rpx',
-								bottom: '96rpx',
-
-							},
-							views: [{
-								type: 'text',
-								text: '免费体验Al生成个人质感艺术照',
-								css: {
-									fontSize: '32rpx',
-									color: '#333333',
-								}
-							}],
-						},
-						// 海报文案2
-						{
-							type: 'view',
-							css: {
-								display: 'flex',
-								position: 'absolute',
-								left: '24rpx',
-								bottom: '44rpx',
-
-							},
-							views: [{
-								type: 'text',
-								text: '设计微信/抖音/小红书专属头像',
-								css: {
-									fontSize: '32rpx',
-									color: '#333333',
-								}
-							}],
-						},
-
-						// 二维码上方文案
-						{
-							type: 'view',
-							css: {
-								position: 'absolute',
-								right: '40rpx',
-								bottom: '196rpx',
-							},
-							views: [{
-								type: 'text',
-								text: '微信扫码',
-								css: {
-									fontSize: '24rpx',
-									color: '#333333',
-								}
-							}],
-						},
-						{
-							type: 'view',
-							css: {
-								left: (this.info.poster_qrcode_x / proportionally) + 'px',
-								top: (this.info.poster_qrcode_y / proportionally) + 'px',
-								position: 'fixed',
-
-							},
-							views: [{
-									type: 'qrcode',
-									text: this.qrcode,
-									css: {
-										width: (this.info.poster_qrcode_width / proportionally) + 'px',
-										height: (this.info.poster_qrcode_width / proportionally) + 'px',
-										background: '#fff'
-									}
-								},
-								// {
-								// 	src: '/static/images/fanyunLogo.png',
-								// 	type: "image",
-								// 	css: {
-								// 		position: 'absolute',
-								// 		width: 30 + 'rpx',
-								// 		height: 30 + 'rpx',
-
-								// 		left: '44rpx',
-								// 		top: '44rpx',
-
-								// 	}
-								// }
-							],
-						},
-					]
-				}),
-				(
-					this.showPoster = true,
-					// this.revertUrl()
-
-					setTimeout(() => {
-						that.$refs.painter.canvasToTempFilePathSync({
-							// 在nvue里是jpeg
-							fileType: 'jpg',
-							quality: 1,
-							success: res => {
-								console.log('res.tempFilePath', res.tempFilePath);
-								// uni.showModal({
-								// 	title: '提示',
-								// 	content: '查看图片后长按图片即可保存或分享',
-								// 	confirmText: '查看',
-								// 	confirmColor: '#1F79F0',
-								// 	success: function(res2) {
-								// 		if (res2.confirm) {
-								uni.previewImage({
-									urls: [res.tempFilePath],
-									longPressActions: {
-										itemList: ['发送给朋友', '保存图片',
-											'收藏'
-										],
-										success: function(data) {},
-										fail: function(err) {
-											console.log(err
-												.errMsg);
-										}
-									}
-								});
-								// 		} else if (res2.cancel) {
-								// 			console.log('用户点击取消');
-								// 		}
-								// 	}
-								// });
-							}
-						})
-					}, 1000)
-				);
-			},
-			posterSuccess() {
-				uni.hideLoading();
-			},
-			// 生成海报需要的数据到此为止
-
-
-			preViewImg(type) {
-				if (type == 1) {
-					uni.previewImage({
-						urls: [this.parameter.refImg],
-						longPressActions: {
-							itemList: ['发送给朋友', '保存图片', '收藏'],
-							success: function(data) {},
-							fail: function(err) {
-								console.log(err.errMsg);
-							}
-						}
-					});
-				} else {
-					uni.previewImage({
-						urls: [this.form.init_image],
-						longPressActions: {
-							itemList: ['发送给朋友', '保存图片', '收藏'],
-							success: function(data) {},
-							fail: function(err) {
-								console.log(err.errMsg);
-							}
-						}
-					});
-				}
-			},
-			parameters() {
-				var that = this;
-				// if(that.showdrawing){
-				// 	uni.showToast({
-				// 		title:'图片生成中',
-				// 		icon:'none'
-				// 	})
-				// 	return;
-				// }
-				that.show1 = true
-
-			},
-			setOpen() {
-				var that = this;
-				if (that.showdrawing) {
-					uni.showToast({
-						title: '图片生成中',
-						icon: 'none'
-					})
-					return;
-				}
-				if (that.showopen) {
-					uni.showToast({
-						title: '图片已公开',
-						icon: 'none'
-					})
-					return;
-				}
-				uni.showModal({
-					confirmColor: '#207CF7',
-					confirmText: '确认公开',
-					title: '提示',
-					content: '是否确认公开此绘画作品',
-					success(src) {
-						if (src.confirm) {
-							that.$http('gallery.setOpen', {
-								id: that.parameterid
-							}).then(res => {
-								if (res.code == 0) {
-									uni.showToast({
-										title: '提交成功,等待审核'
-									})
-									that.showopen = true
-								}
-							});
-						}
-					}
-				});
-			},
-			gallerydetail(id) {
-				let that = this;
-				this.$http('gallery.detail', {
-					id: id,
-					type: this.engin
-				}).then(res => {
-					if (res.code == 0) {
-
-						if (this.engin == 'sd') {
-							for (var i = 0; i < res.data.imgs_file.length; i++) {
-								var url = {
-									id: res.data.id,
-									type: 'image',
-									url: res.data.imgs_file[i],
-									// url: res.data.origin_url,
-								}
-								that.swiperList.push(url)
-							}
-							this.done = true
-						} else if (this.engin == 'mj') {
-							var url = {
-								id: res.data.id,
-								type: 'image',
-								url: res.data.origin_url,
-							}
-							that.swiperList.push(url)
-							this.done = true
-						} else if (this.engin == 'rh') {
-							var url = {
-								id: res.data.id,
-								type: 'image',
-								url: res.data.imgs_file[0],
-							}
-							that.swiperList.push(url)
-
-							console.log("this.engin == 'rh'====", res.data.imgs_file, that.swiperList);
-							this.done = true
-
-							this.commonqrcodePath()
-						}
-
-						console.log('获取到的图片详情返回值:', res);
-						this.showdrawing = false
-
-						this.parameter = res.data
-
-						//this.parameter.prompt =
-						//'https://mjcdn.iduomi.cc/attachments/1124768570157564029/1129053571321712670/erinramirez_In_a_Chinese_ancient_garden_a_lady_is_playing_the_t_cff28ad6-6f7e-44f0-a7bb-2a8724e573f2.png 关键词测试测'
-						// this.parameter.prompt = '123'
-
-
-						if (this.parameter.prompt.includes('http') && this.parameter.prompt.includes('.png')) {
-							this.parameter.refImg = this.parameter.prompt.split('.png')[0] + '.png'
-
-							// 创作相似去参考图提示词
-							let tempKeyWord = ''
-							this.parameter.prompt.split('.png').forEach((item, index) => {
-								if (!item.includes('http')) {
-									tempKeyWord += item
-								}
-							})
-							this.parameter.promptSame = tempKeyWord
-							this.parameter.prompt = tempKeyWord
-						} else if (this.parameter.prompt.includes('http') && this.parameter.prompt.includes(
-								'.jpeg')) {
-							this.parameter.refImg = this.parameter.prompt.split('.jpeg')[0] + '.jpeg'
-
-							// 创作相似去参考图提示词
-							let tempKeyWord = ''
-							this.parameter.prompt.split('.jpeg').forEach((item, index) => {
-								if (!item.includes('http')) {
-									tempKeyWord += item
-								}
-							})
-							this.parameter.promptSame = tempKeyWord
-							this.parameter.prompt = tempKeyWord
-						} else if (this.parameter.prompt.includes('http') && this.parameter.prompt.includes(
-								'.jpg')) {
-							this.parameter.refImg = this.parameter.prompt.split('.jpg')[0] + '.jpg'
-
-							// 创作相似去参考图提示词
-							let tempKeyWord = ''
-							this.parameter.prompt.split('.jpg').forEach((item, index) => {
-								if (!item.includes('http')) {
-									tempKeyWord += item
-								}
-							})
-							this.parameter.promptSame = tempKeyWord
-							this.parameter.prompt = tempKeyWord
-						} else {
-							this.parameter.promptSame = this.parameter.prompt
-						}
-						console.log('进入这里了没有', this.parameter.promptSame);
-					} else {
-
-					}
-				});
-			},
-			aiPlay() {
-				let that = this;
-				this.showdrawing = true
-				if (that.failnum == 0) {
-					this.progressbar()
-				}
-
-				this.$http('gallery.create', this.form).then(res => {
-					if (res.code == 0) {
-						this.showTask(res.data.id)
-					} else {
-						uni.hideToast()
-						uni.showModal({
-							confirmText: '退出',
-							showCancel: false,
-							confirmColor: '#207CF7',
-							title: '提示',
-							content: res.msg,
-							success(tit) {
-								if (tit.confirm) {
-									uni.navigateBack()
-								}
-							}
-						})
-					}
-
-				});
-			},
-			progressbar() {
-				var that = this;
-				if (that.percentage < 99) {
-					timingr = setTimeout(() => {
-						that.percentage = uni.$u.range(0, 99, that.percentage + 1)
-						that.progressbar()
-					}, 300);
-				} else {
-					clearTimeout(timingr);
-				}
-			},
-			showTask(id) {
-				let that = this;
-				this.$http('gallery.getOpensdDetail', {
-					id: id,
-				}).then(res => {
-					if (res.code == 0) {
-						if (res.data.state == "success") {
-							this.percentage = 99
-							this.drawingtitle = '图片正在渲染中,请不要退出此页面'
-							this.parameterid = res.data.id
-							this.done = true
-							clearTimeout(asynchronous);
-							var url = {
-								id: 0,
-								type: 'image',
-								url: res.data.gen_img,
-							}
-							that.swiperList.push(url)
-						} else if (res.data.state == "in_create") {
-							asynchronous = setTimeout(() => {
-								that.showTask(id)
-							}, 1000);
-							return;
-						} else if (res.data.state == "in_wait") {
-							asynchronous = setTimeout(() => {
-								that.showTask(id)
-							}, 1000);
-							return;
-						} else {
-							uni.showModal({
-								confirmText: '退出',
-								showCancel: false,
-								confirmColor: '#207CF7',
-								title: '提示',
-								content: res.msg,
-								success(tit) {
-									if (tit.confirm) {
-										uni.navigateBack()
-									}
-								}
-							})
-						}
-					} else {
-						uni.showModal({
-							confirmText: '退出',
-							showCancel: false,
-							confirmColor: '#207CF7',
-							title: '提示',
-							content: res.msg,
-							success(tit) {
-								if (tit.confirm) {
-									uni.navigateBack()
-								}
-							}
-						})
-					}
-				})
-			},
-			previewload() {
-				// console.log('ch');
-				this.showdrawing = false
-				this.percentage = 0
-			},
-			previewerror() {
-				this.showdrawing = false
-				this.percentage = 0
-			},
-			preview(e) {
-				uni.previewImage({
-					urls: [e]
-				})
-			},
-			is_weixin() {
-				var ua = window.navigator.userAgent.toLowerCase();
-				if (ua.match(/MicroMessenger/i) == 'micromessenger') {
-					console.log('微信浏览器');
-					return true;
-				} else {
-					console.log("不是微信浏览器");
-					return false;
-				}
-			},
-			//下载分享
-			getdownload(index) {
-				if (this.showdrawing) {
-					uni.showToast({
-						title: '图片生成中',
-						icon: 'none'
-					})
-					return;
-				}
-				// if (!this.is_weixin()) {
-				// 	return uni.showModal({
-				// 		showCancel: false,
-				// 		title: '提示',
-				// 		content: '请在微信内置浏览器打开,长按图片下载/分享',
-				// 		confirmColor: '#207CF7'
-				// 	})
-				// }
-				this.createPoster()
-				return
-
-				uni.showModal({
-					showCancel: false,
-					title: '提示',
-					content: '请在微信内置浏览器打开,长按图片下载/分享',
-					confirmColor: '#207CF7'
-				})
-				return
-
-				if (this.engin == 'mj') {
-					uni.showModal({
-						showCancel: false,
-						title: '提示',
-						content: '请在微信内置浏览器打开,长按图片下载/分享',
-						confirmColor: '#207CF7'
-					})
-					return
-				}
-
-				console.log('要下载的图片地址:', this.parameter.imgs_file[index]);
-
-				let url = this.parameter.imgs_file[index]
-				// return
-				const detectDeviceType = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i
-					.test(
-						navigator.userAgent) ? false : true;
-				if (this.is_weixin()) {
-					uni.showModal({
-						showCancel: false,
-						title: '提示',
-						content: '请在微信内置浏览器打开,长按图片下载/分享',
-						confirmColor: '#207CF7'
-					})
-				} else {
-					if (detectDeviceType()) {
-						let _this = this
-
-						// if (_this.isDowload) {
-						// 	uni.showToast({
-						// 		icon: 'none',
-						// 		title: '请等待上一个视频下载完成后,再下载',
-						// 	});
-						// }
-						// PC端
-						// this.delItem.url = 'http://www.liwantao.top/test.mp4'
-
-						const downloadTask = uni.downloadFile({
-							url, //文件链接
-							timeout: 99999999,
-							success: (res) => {
-								if (res.statusCode === 200) {
-									var oA = document.createElement("a");
-									// oA.download = _this.delItem.name; // 设置下载的文件名,默认是'下载'	
-									oA.href = res.tempFilePath; //临时路径再保存到本地
-									document.body.appendChild(oA);
-									oA.click();
-									oA.remove(); // 下载之后把创建的元素删除
-								}
-							},
-							fail: (err) => {
-								_this.show = false;
-								_this.isDowload = false
-								_this.progress = 0
-
-								// console.log(_this.show, _this.isDowload, _this.progress, err);
-								uni.showToast({
-									icon: 'none',
-									mask: true,
-									title: '失败请重新下载',
-								});
-							},
-						})
-
-						downloadTask.onProgressUpdate((res) => {
-							if (res.progress > 0) {
-								_this.show = true;
-								_this.isDowload = true
-							}
-							_this.progress = res.progress;
-							if (res.progress == 100) {
-								_this.show = false;
-								_this.isDowload = false
-								_this.progress = 0
-
-								uni.showToast({
-									icon: 'success',
-									title: '图片下载成功!',
-								});
-							}
-						})
-					} else {
-						uni.showModal({
-							showCancel: false,
-							title: '提示',
-							content: '请在微信内置浏览器打开,长按图片下载/分享',
-							confirmColor: '#207CF7'
-						})
-						return
-						// 其他移动端浏览器
-						// window.open(this.delItem.url)
-
-						let _this = this
-						// this.delItem.url = 'http://www.liwantao.top/test.mp4'
-
-						var oA = document.createElement("a");
-						// oA.download = _this.delItem.name;
-						oA.href = url;
-						document.body.appendChild(oA);
-						oA.click();
-						oA.remove();
-					}
-				}
-			},
-			getisback() {
-				if (!this.done) {
-					uni.showModal({
-						confirmColor: '#207CF7',
-						confirmText: '立即退出',
-						title: '提示',
-						content: '图片生成中,退出此页面后可能无法生成',
-						success(src) {
-							if (src.confirm) {
-								uni.navigateBack()
-							}
-						}
-					})
-				} else {
-					uni.navigateBack()
-				}
-			},
-			// 跳转
-			tn(e) {
-				// console.log(e);
-				uni.navigateTo({
-					url: e,
-				});
-			},
-
-			// cardSwiper
-			cardSwiper(e) {
-				// console.log(e.detail);
-				this.cardCur = e.detail.current
-			},
-
-			// 弹出压屏窗
-			showLandscape() {
-				this.openLandscape()
-			},
-			// 打开压屏窗
-			openLandscape() {
-				this.show1 = true
-			},
-			// 关闭压屏窗
-			closeLandscape() {
-				this.show1 = false
-			},
-		},
-		onUnload() {
-			clearTimeout(timingr);
-			clearTimeout(asynchronous);
-		},
-	}
-</script>
-
-<style lang="scss" scoped>
-	// .shareBox {
-	// 	position: fixed;
-	// 	top: 0;
-	// 	left: 0;
-	// 	height: 100vh;
-	// 	width: 100vw;
-	// 	background: red;
-	// 	z-index: 9999999;
-	// }
-
-	.template-details {
-		margin: 0;
-		width: 100%;
-		height: 100vh;
-		color: #fff;
-		overflow: hidden;
-	}
-
-	/* 胶囊*/
-	.tn-custom-nav-bar__back {
-		width: 100%;
-		height: 100%;
-		position: relative;
-		display: flex;
-		justify-content: space-evenly;
-		align-items: center;
-		box-sizing: border-box;
-		background-color: rgba(0, 0, 0, 0.15);
-		border-radius: 1000rpx;
-		border: 1rpx solid rgba(255, 255, 255, 0.5);
-		color: #FFFFFF;
-		font-size: 18px;
-
-		.icon {
-			display: block;
-			flex: 1;
-			margin: auto;
-			text-align: center;
-		}
-
-		&:before {
-			content: " ";
-			width: 1rpx;
-			height: 110%;
-			position: absolute;
-			top: 22.5%;
-			left: 0;
-			right: 0;
-			margin: auto;
-			transform: scale(0.5);
-			transform-origin: 0 0;
-			pointer-events: none;
-			box-sizing: border-box;
-			opacity: 0.7;
-			background-color: #FFFFFF;
-		}
-	}
-
-
-
-	/* 图标容器15 start */
-	.icon15 {
-		&__item {
-			width: 30%;
-
-			border-radius: 10rpx;
-			padding: 30rpx;
-			margin: 20rpx 10rpx;
-			transform: scale(1);
-			transition: transform 0.3s linear;
-			transform-origin: center center;
-
-			&--icon {
-				width: 100rpx;
-				height: 100rpx;
-				font-size: 50rpx;
-				border-radius: 50%;
-				margin-bottom: 18rpx;
-				position: relative;
-				z-index: 1;
-
-				&::after {
-					content: " ";
-					position: absolute;
-					z-index: -1;
-					width: 100%;
-					height: 100%;
-					left: 0;
-					bottom: 0;
-					border-radius: inherit;
-					opacity: 1;
-					transform: scale(1, 1);
-					background-size: 100% 100%;
-
-
-				}
-			}
-		}
-	}
-
-	/* 按钮 */
-	.button-1 {
-		background-color: rgba(0, 0, 0, 0.15);
-		position: fixed;
-		/* bottom:200rpx;
-      right: 20rpx; */
-		top: 25%;
-		right: 30rpx;
-		z-index: 1001;
-		border-radius: 100px;
-	}
-
-	.button-2 {
-		background-color: rgba(0, 0, 0, 0.15);
-		position: fixed;
-		/* bottom:200rpx;
-      right: 20rpx; */
-		top: 35%;
-		right: 30rpx;
-		z-index: 1001;
-		border-radius: 100px;
-	}
-
-	.button-3 {
-		background-color: rgba(0, 0, 0, 0.15);
-		position: fixed;
-		/* bottom:200rpx;
-      right: 20rpx; */
-		top: 45%;
-		right: 30rpx;
-		z-index: 1001;
-		border-radius: 100px;
-	}
-
-
-	/* 用户头像 start */
-	.logo-image {
-		width: 100rpx;
-		height: 100rpx;
-		position: relative;
-	}
-
-	.logo-pic {
-		background-size: cover;
-		background-repeat: no-repeat;
-		// background-attachment:fixed;
-		background-position: top;
-		border: 6rpx solid rgba(255, 255, 255, 0.25);
-		box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.15);
-		border-radius: 50%;
-		overflow: hidden;
-		// background-color: #FFFFFF;
-	}
-
-	/* 底部tabbar start*/
-	/* 毛玻璃*/
-	.dd-glass {
-		width: 100%;
-		backdrop-filter: blur(20rpx);
-		-webkit-backdrop-filter: blur(20rpx);
-	}
-
-	.footerfixed {
-		position: fixed;
-		// margin: 20rpx;
-		margin: 40rpx 5%;
-		width: 90%;
-		bottom: calc(env(safe-area-inset-bottom) / 2);
-		;
-		z-index: 999;
-		background-color: rgba(0, 0, 0, 0.15);
-		box-shadow: 0rpx 0rpx 30rpx 0rpx rgba(0, 0, 0, 0.07);
-	}
-
-	.tabbar {
-		display: flex;
-		align-items: center;
-		min-height: 110rpx;
-		justify-content: space-between;
-		padding: 0;
-		height: calc(110rpx + env(safe-area-inset-bottom) / 2);
-		// padding-bottom: calc(env(safe-area-inset-bottom) / 2);
-	}
-
-	.tabbar .action {
-		font-size: 22rpx;
-		position: relative;
-		flex: 1;
-		text-align: center;
-		padding: 0;
-		display: block;
-		height: auto;
-		line-height: 1;
-		margin: 0;
-		overflow: initial;
-	}
-
-	.tabbar .action .bar-icon {
-		width: 100rpx;
-		position: relative;
-		display: block;
-		height: auto;
-		margin: 0 auto 10rpx;
-		text-align: center;
-		font-size: 42rpx;
-	}
-
-	.tabbar .action .bar-icon image {
-		width: 50rpx;
-		height: 50rpx;
-		display: inline-block;
-	}
-
-
-	/* 全屏轮播  start*/
-	.card-swiper {
-		height: 100vh !important;
-	}
-
-	.card-swiper swiper-item {
-		width: 750rpx !important;
-		left: 0rpx;
-		box-sizing: border-box;
-		overflow: initial;
-		background: #000;
-	}
-
-	.card-swiper swiper-item .swiper-item {
-		// width: 100%;
-		// display: block;
-		// height: 100vh;
-		// border-radius: 0rpx;
-		// transform: scale(0.9);
-		// transition: all 0.2s ease-in 0s;
-		// will-change: transform;
-		// overflow: hidden;
-		display: flex;
-		align-items: center;
-		justify-content: center;
-		height: 100%;
-		background: #000;
-	}
-
-	.card-swiper swiper-item.cur .swiper-item {
-		transform: scale(1);
-		transition: all 0.2s ease-in 0s;
-		will-change: transform;
-	}
-
-	.image-banner {
-		display: flex;
-		align-items: center;
-		justify-content: center;
-	}
-
-	.image-banner image {
-		width: 100%;
-		// height: 100%;
-	}
-
-	/* 轮播指示点 start*/
-	.indication {
-		z-index: 9999;
-		width: 100%;
-		height: 36rpx;
-		position: fixed;
-		display: flex;
-		flex-direction: row;
-		align-items: center;
-		justify-content: center;
-	}
-
-	.spot {
-		background-color: #FFFFFF;
-		opacity: 0.6;
-		width: 10rpx;
-		height: 10rpx;
-		border-radius: 20rpx;
-		top: calc(-280rpx - env(safe-area-inset-bottom) / 2);
-		top: calc(-280rpx - constant(safe-area-inset-bottom));
-		margin: 0 8rpx !important;
-		position: relative;
-	}
-
-	.spot.active {
-		opacity: 1;
-		width: 30rpx;
-		background-color: #FFFFFF;
-	}
-
-	.lazy-load {
-		background: #000;
-		display: grid;
-		align-items: center;
-		padding-bottom: env(safe-area-inset-bottom);
-		// height: 100%;
-	}
-
-	.lazy-load view {
-		width: 100%;
-
-	}
-
-	.lazy-loading {
-		background: #000;
-		height: 100%;
-
-	}
-
-	.drawing {
-		position: absolute;
-		top: 46%;
-		// color: #606266;
-		font-size: 18px;
-	}
-
-	.progress {
-		position: absolute;
-		top: 52%;
-		width: 60%;
-	}
-
-	.preloader_1 {
-		position: absolute;
-		// right: 8%;
-		// bottom: 12%;
-		// position: fixed;
-		// right: 58%;
-		margin-right: 65px;
-		top: 42%;
-	}
-
-	.preloader_1 view {
-		display: block;
-		bottom: 0px;
-		width: 9px;
-		height: 5px;
-		background: #9b59b6;
-		position: absolute;
-		animation: preloader_1 1.5s infinite ease-in-out;
-	}
-
-	.preloader_1 view:nth-child(2) {
-		left: 11px;
-		animation-delay: .2s;
-	}
-
-	.preloader_1 view:nth-child(3) {
-		left: 22px;
-		animation-delay: .4s;
-	}
-
-	.preloader_1 view:nth-child(4) {
-		left: 33px;
-		animation-delay: .6s;
-	}
-
-	.preloader_1 view:nth-child(5) {
-		left: 44px;
-		animation-delay: .8s;
-	}
-
-	@keyframes preloader_1 {
-		0% {
-			height: 5px;
-			transform: translateY(0px);
-			background: #9b59b6;
-		}
-
-		25% {
-			height: 30px;
-			transform: translateY(15px);
-			background: #3498db;
-		}
-
-		50% {
-			height: 5px;
-			transform: translateY(0px);
-			background: #9b59b6;
-		}
-
-		100% {
-			height: 5px;
-			transform: translateY(0px);
-			background: #9b59b6;
-		}
-	}
-</style>

+ 14 - 2
pages/painting/draw.scss

xqd
@@ -106,16 +106,28 @@ padding-bottom: 170rpx;
 				width: 256rpx;
 				
 				padding-top: 20rpx;
-				
+				.xxsm{
+					cursor: pointer;
+				}
 				.item{
 					margin-bottom: 32rpx;
 					display: flex;
 					align-items: center;
-					img{
+					img,.pimg{
 						width: 32rpx;
 						height: 32rpx;
 						margin-right: 12rpx;
 					}
+					.xxsmInfo{
+						width: 28rpx;
+						height: 28rpx;
+					}
+					span{
+						font-size: 26rpx;
+						font-family: PingFang-SC, PingFang-SC;
+						font-weight: 500;
+						color: #999999;
+					}
 				}
 			}
 		}

+ 122 - 1
pages/painting/draw.vue

xqd xqd xqd xqd xqd xqd xqd xqd
@@ -93,6 +93,7 @@
 						更多
 					</div>
 				</div>
+				<!-- 	<u-button @click="test">测试压缩</u-button> -->
 
 				<div class="upTitle">
 					上传图片
@@ -104,6 +105,12 @@
 							<img src="@/static/renx.png" alt="" />
 							{{item}}
 						</div>
+
+						<div class=" item xxsm" @click="toYszDetail">
+							<!-- <div class="pimg"></div> -->
+							<img class="xxsmInfo" src="@/static/b_info.png" alt="" />
+							<span>详细说明</span>
+						</div>
 					</div>
 					<div class="upList">
 						<div class="upBox">
@@ -269,6 +276,21 @@
 						</view>
 						<view class="describe">4:3</view>
 					</view>
+
+					<view v-if="showmj==1" class="radio flxe align-center justify-center flxe-column"
+						:class="ratioIndex == 3 ? 'active' : ''" @click="ratio(3)">
+						<view class="cu-proportion flxe align-center justify-center">
+							<view class="proportion2"></view>
+						</view>
+						<view class="describe">9:16</view>
+					</view>
+					<view v-if="showmj==1" class="radio flxe align-center justify-center flxe-column"
+						:class="ratioIndex == 4 ? 'active' : ''" @click="ratio(4)">
+						<view class="cu-proportion flxe align-center justify-center">
+							<view class="proportion3"></view>
+						</view>
+						<view class="describe">16:9</view>
+					</view>
 				</view>
 			</view>
 			<!-- sd和mj都要展示 -->
@@ -424,6 +446,12 @@
 	import {
 		apiurl
 	} from '@/common/request/request';
+
+	import {
+		translateapp,
+		translate,
+		mp_compressImage
+	} from "@/utils/compress.js"
 	let rewardedVideoAd = null;
 	export default {
 		mixins: [],
@@ -673,6 +701,16 @@
 		},
 		methods: {
 			...mapActions(['appInit', 'logout', 'getUserInfo', 'getUserData']),
+			toYszDetail() {
+				uni.previewImage({
+					urls: ['https://oaigc.oss-cn-chengdu.aliyuncs.com/face/demo.jpg'],
+					longPressActions: {
+						itemList: ['发送给朋友', '保存图片', '收藏'],
+						success: function(data) {},
+						fail: function(err) {}
+					}
+				});
+			},
 			handleOrder(item, index) {
 				this.seledRule = item
 				this.showRule = false
@@ -863,6 +901,32 @@
 				})
 				console.log('生成艺术照参数', p);
 			},
+			// 处理图片压缩
+			// test() {
+			// 	let _this = this
+			// 	uni.chooseImage({
+			// 		count: 1, //默认9
+			// 		sizeType: ['original', 'compressed'],
+			// 		sourceType: ['camera', 'album'], 
+			// 		success: function(res) {
+			// 			translate(res.tempFilePaths[0], 0.3, ' ', imgUrl => {
+			// 				uni.previewImage({
+			// 					urls: [imgUrl],
+			// 					longPressActions: {
+			// 						itemList: ['发送给朋友', '保存图片', '收藏'],
+			// 						success: function(data) {
+			// 							console.log('选中了第' + (data.tapIndex + 1) +
+			// 								'个按钮,第' + (data.index + 1) + '张图片');
+			// 						},
+			// 						fail: function(err) {
+			// 							console.log(err.errMsg);
+			// 						}
+			// 					}
+			// 				});
+			// 			})
+			// 		}
+			// 	});
+			// },
 			upYsImg(type) {
 				if (type == 0 && this.myModal) {
 					return uni.previewImage({
@@ -899,7 +963,7 @@
 				uni.chooseImage({
 					count: 1,
 					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
-					sourceType: ['album'], //从相册选择
+					sourceType: ['camera', 'album'], //从相册选择
 					success: function(res) {
 						console.log('上传参考图返回值:', res, res.tempFiles[0].name.toLowerCase());
 						if (!(res.tempFiles[0].name.toLowerCase().endsWith('.png') || res.tempFiles[0].name
@@ -920,7 +984,64 @@
 								duration: 2000
 							})
 						}
+
+						/**
+						 * H5端图片压缩
+						 *  参数说明:
+						 *  imgSrc 图片url
+						 *  scale缩放比例 0-1
+						 *  type 返回图片类型:base64、blob(默认blob)   
+						 *  callback 回调设置返回值 
+						 */
+						// uni.showLoading({
+						// 	title: '图片压缩中...'
+						// });
+						// translate(res.tempFilePaths[0], 0.3, ' ', imgUrl => {
+						// 	uni.hideLoading()
+						// 	console.log('imgUrl', imgUrl);
+
+						// 	if (type == 0) {
+						// 		that.showUpLoading1 = true
+						// 	} else {
+						// 		that.showUpLoading2 = true
+						// 	}
+						// 	uni.uploadFile({
+						// 		url: apiurl('common/upload'),
+						// 		filePath: imgUrl,
+						// 		name: 'file',
+						// 		formData: {
+						// 			accept: 'image',
+						// 			upload_type: 'ali-oss'
+						// 		},
+						// 		success: res2 => {
+						// 			let a = JSON.parse(res2.data);
+						// 			if (a.code == 0) {
+						// 				console.log('JSON.parse(res2.data)', a);
+						// 				if (type == 0) {
+						// 					that.seledCankaoImg = {
+						// 						id: -1
+						// 					}
+						// 					that.myModal = a.data.path;
+						// 					that.showUpLoading1 = false
+						// 				} else {
+						// 					that.myPhoto = a.data.path;
+						// 					that.showUpLoading2 = false
+						// 				}
+						// 			} else {
+						// 				uni.showToast({
+						// 					title: '上传图片失败',
+						// 					icon: 'none'
+						// 				});
+						// 			}
+						// 		}
+						// 	});
+						// })
+
+
+
+						// 原图片上传逻辑
 						const path = res.tempFilePaths[0];
+						console.log('path===================', path);
 						if (type == 0) {
 							that.showUpLoading1 = true
 						} else {

+ 13 - 4
pages/painting/ys.vue

xqd
@@ -544,10 +544,19 @@
 						console.log('this.swiperList--------------', this.swiperList);
 					} else if (res.msg.state == 2) {
 						clearInterval(this.timer)
-						uni.showToast({
-							title: '图片生成出错,请稍后重试',
-							icon: 'none'
-						})
+						uni.showModal({
+							title: '提示',
+							content: '图片生成出错,请稍后重试',
+							confirmColor: '#1F79F0',
+							showCancel: false,
+							success: function(res) {
+								if (res.confirm) {
+									uni.navigateBack()
+								} else if (res.cancel) {
+									console.log('用户点击取消');
+								}
+							}
+						});
 					}
 				}
 			},

+ 11 - 6
pages/user/commission/index.scss

xqd
@@ -9,25 +9,30 @@
 	
 	padding-top: 50rpx;
 	.haibao{
-		width: 60%;
-		// height: 40vh;
+		width: 450rpx;
+		height: 680rpx;
 		margin-bottom: 130rpx;
 	}
 	.bgList{
 		padding-left: 30rpx;
 		padding-right: 30rpx;
 		display: flex;
-		
-		// justify-content: space-between;
 		width: 100%;
-		// background: red;
-		
 		margin-bottom: 30rpx;
+		
+		flex-wrap: nowrap;
+		overflow-y: hidden;
+		overflow-x: scroll;
 		.item{
 			width: 16vw;
 			height: 200rpx;
 			border-radius: 15rpx;
 			margin-right: 20rpx;
+			
+			flex-shrink: 0;
+		}
+		.item:last-child{
+			margin-right: 0;
 		}
 		.item_a{
 			border: 6rpx solid #207CF5;

+ 1 - 2
pages/user/commission/index.vue

xqd xqd
@@ -150,7 +150,7 @@
 					<view class="bgList">
 						<image
 							@click="currBgIndex=index;poster_bg_img_path=info.poster_bg_img_path[index];createPoster();"
-							:src="item" mode="" class="item" :class="[currBgIndex==index?'item_a':'']" v-for="(item,index) in info.poster_bg_img_path.slice(0,5)
+							:src="item" mode="" class="item" :class="[currBgIndex==index?'item_a':'']" v-for="(item,index) in info.poster_bg_img_path
 "></image>
 					</view>
 					<view style="height: 78px;"></view>
@@ -600,7 +600,6 @@
 						})
 						this.showPoster = false;
 						uni.hideLoading();
-						// #endif
 						// #ifdef H5
 						this.showPoster = false;
 						uni.hideLoading();

+ 0 - 770
pages/user/commission/index1.vue

xqd
@@ -1,770 +0,0 @@
-<template>
-	<view>
-		<view style="color: #000000;">
-			<tn-nav-bar backgroundColor="#ffffff" :bottomShadow="false">{{commission_alias}}</tn-nav-bar>
-			<view :style="{height: tobheight+'px'}"></view>
-		</view>
-		<view style="width:100%;height: 100%;padding-right: 30rpx;">
-
-			<view class="commission-wrap" :class="{ blur: !hasAuth }">
-				<!-- 用户资料 -->
-				<view class="user-card">
-					<view class="card-top u-flex u-row-between">
-						<view class="u-flex">
-							<view class="head-img-box">
-								<image class="head-img" :src="userInfo.avatar?userInfo.avatar:'/static/images/head.jpg'"
-									mode=""></image>
-							</view>
-							<view class="u-flex-col">
-								<view class="user-name">{{ userInfo.nickname }}</view>
-								<view class="user-info-box u-flex">
-									<view class="tag-box u-flex">
-										<!-- <image v-if="commissionLv.image" class="tag-img" :src="commissionLv.image" mode=""></image> -->
-										<text class="tag-title">{{ commissionLv.name }}</text>
-										<!-- <view v-show="showLv" class="u-iconfont uicon-arrow-right" style="color: #fff;font-size: 28rpx;"></view> -->
-									</view>
-								</view>
-							</view>
-						</view>
-						<view class="u-flex-col">
-							<view class="u-flex-col u-col-center">
-								<button class="u-reset-button log-btn u-m-b-20" @tap="toTeam">明细</button>
-								<button class="u-reset-button look-btn" @tap="showMoney = !showMoney">
-									<!-- <view class="u-iconfont" :class="showMoney ? 'uicon-eye-fill' : 'uicon-eye-off'" style="color: #fff;font-size: 50rpx;"></view> -->
-									<u-icon :name="showMoney ? 'eye-fill':'eye-off'" color="#fff" size="22"></u-icon>
-								</button>
-							</view>
-						</view>
-					</view>
-					<!-- 收益 -->
-					<view class="card-bottom u-flex">
-						<view class="u-flex-1 ">
-							<view class="item-title">累计收入</view>
-							<view class="item-detail">{{showMoney? money_total || 0.00:'****'}}</view>
-						</view>
-						<view class="u-flex-1 u-col-center">
-							<view class="item-title">待入账佣金</view>
-							<view class="item-detail">{{showMoney? on_cashout_money || 0.00:'****'}}</view>
-						</view>
-					</view>
-				</view>
-
-				<!-- 滚动明细 -->
-				<view class="commission-log">
-					<scroll-view scroll-y="true" @scrolltolower="loadMore" class="scroll-box log-scroll">
-						<view class="log-item-box u-flex u-row-between" v-for="item in commissionLog" :key="item.id"
-							@tap="$u.toast(item.remark)">
-							<view class="log-item-wrap">
-								<view class="log-item u-flex u-ellipsis-1 u-col-center">
-									<view class="u-flex u-col-center ">
-										<!-- <image
-											class="log-img"
-											:src="item.oper_type !== 'user' ? logMap[item.oper_type] : item.oper ? item.oper.avatar : logMap['admin']"
-											mode=""
-										></image> -->
-										<!-- <image class="log-img" :src="appInfo.site_logo_path" mode=""></image> -->
-										<image class="log-img" :src="item.oper" mode=""></image>
-									</view>
-									<view class="log-text u-ellipsis-1">{{ item.remark }}</view>
-								</view>
-							</view>
-							<text class="log-time">{{ item.createtime }}</text>
-						</view>
-						<!-- 更多 -->
-						<!-- <view class="loadmore-wrap" v-if="commissionLog.length"><u-loadmore :status="loadStatus" icon-type="flower" color="#f6f6f6" /></view> -->
-					</scroll-view>
-				</view>
-
-				<!-- 功能菜单 -->
-				<view class="menu-box u-flex">
-					<view class="menu-item u-flex-col u-col-center" v-for="(menu, index) in menuList"
-						v-if="!menu.isAgentFrom" :key="index" @tap="jump(menu.path)">
-						<image class="item-img" :src="menu.img" mode=""></image>
-						<view class="item-title">{{ menu.title }}</view>
-					</view>
-					<!-- #ifdef H5 -->
-					<view @click="createPoster" class="menu-item u-flex-col u-col-center">
-						<image class="item-img" src="https://file.shopro.top/imgs/commission/commission_icon5.png"
-							mode=""></image>
-						<view class="item-title">分享海报</view>
-					</view>
-
-
-					<view @click="sharelink" class="menu-item u-flex-col u-col-center">
-						<image class="item-img" src="https://file.shopro.top/imgs/commission/commission_icon7.png"
-							mode=""></image>
-						<view class="item-title">分享链接</view>
-					</view>
-					<!-- #endif -->
-				</view>
-				<!-- #ifdef H5 -->
-				<!-- <view class="bill">
-					<u-button @click="createPoster" color="#ffc107" type="primary" shape="circle" text="推广海报"></u-button>
-				</view> -->
-				<!-- #endif -->
-
-
-			</view>
-
-			<!-- 佣金中心权限验证 -->
-			<u-popup class="auth-box" :mask="false" v-model="showAuthModal" mode="center" :mask-close-able="false"
-				close-icon-pos="top-left" border-radius="20">
-				<view class="notice-box">
-					<view class="img-wrap">
-						<image class="notice-img" :src="authNotice.img" mode=""></image>
-					</view>
-					<view class="notice-title">{{ authNotice.title }}</view>
-					<view class="notice-detail">{{ authNotice.detail }}</view>
-					<button class="u-reset-button notice-btn"
-						@tap="onAuthBtn(authNotice.btnPath)">{{ authNotice.btnText }}</button>
-					<button class="u-reset-button back-btn" @tap="$Router.back()" v-if="!authNotice.hideBtn">返回</button>
-					<button class="u-reset-button back-btn" @tap="hasAuth = true" v-else>取消</button>
-				</view>
-			</u-popup>
-
-			<!-- 成为分销商条件 -->
-			<u-popup v-if="showTerm" class="into-agent-modal" :bgStyle="{
-					background: 'none'
-				}" v-model="showTerm" mode="center" :mask="false" :mask-close-able="false">
-				<view class="condition-box u-flex u-row-center u-col-center">
-					<!-- 金额人数 -->
-					<view class="goods-condition u-flex u-row-between" v-if="showMoneyTerm">
-
-						<view class="btn-box u-flex-col u-p-20 u-col-center">
-							<button class="u-reset-button buy-btn u-m-b-10" @tap="$Router.back()">知道了</button>
-							<view class="tips">* 满足指定消费金额即可成为分销商</view>
-						</view>
-					</view>
-				</view>
-			</u-popup>
-		</view>
-		<u-popup :show="showPoster" mode="bottom" @close="showPoster = false">
-			<!-- <view :style="{height: tobheight+'px'}"></view> -->
-			<scroll-view scroll-y="true" :style="{maxHeight: posterheight +'px'}">
-
-
-
-				<view class="haibaoBox">
-					<image :src="genBgHaibaoUrl" mode="" class="haibao"></image>
-
-					<view class="bgList">
-						<image
-							@click="currBgIndex=index;poster_bg_img_path=info.poster_bg_img_path[index];createPoster();"
-							:src="item" mode="" class="item" :class="[currBgIndex==index?'item_a':'']" v-for="(item,index) in info.poster_bg_img_path.slice(0,5)
-"></image>
-					</view>
-					<view style="height: 78px;"></view>
-					<view class="dygbhg">
-						<view class="whole" @click="showPoster = false">取消</view>
-						<view class="distinguish" @click="toSave">保存/分享</view>
-					</view>
-				</view>
-			</scroll-view>
-		</u-popup>
-		<wike-painter :board="posterObj" style="height: 1px;margin-top: -99999999999999999999999px;"
-			@done="posterSuccess" ref="painter"></wike-painter>
-		<wike-loading-page :isLoading="isLoading"></wike-loading-page>
-	</view>
-</template>
-
-<script>
-	import {
-		mapMutations,
-		mapActions,
-		mapState,
-		mapGetters
-	} from 'vuex';
-	export default {
-		data() {
-			return {
-				currBgIndex: 0,
-
-				isLoading: true,
-				tobheight: 45,
-				platform: this.$platform.get(),
-				showAuthModal: true,
-				empty: false,
-				team: [{
-					headimg: 'https://dev.iduomi.cc/attachment/headimg_2.jpg?time=1673514485',
-					nickname: '多级火箭好',
-					times: '2020/12/24'
-				}, {
-					headimg: 'https://dev.iduomi.cc/attachment/headimg_2.jpg?time=1673514485',
-					nickname: '多级火箭好',
-					times: '2020/12/24'
-				}, {
-					headimg: 'https://dev.iduomi.cc/attachment/headimg_2.jpg?time=1673514485',
-					nickname: '多级火箭好',
-					times: '2020/12/24'
-				}],
-				pages: 1,
-				currentTab: 0,
-				navbar: [{
-						name: "下一级",
-						type: 'shareuid'
-					}, {
-						name: "下下级",
-						type: 'shareuid_grandpa'
-					},
-					// {
-					// 	name: "下三级",
-					// 	type:'shareuid_great_grandpa'
-					// },
-				],
-				showShare: false, //是否显示分享海报
-				showMoney: true, //是否显示金额
-				hasAuth: true, //是否有权限
-				commissionLv: {
-					name: '合伙人'
-				},
-				//合伙人等级
-				commissionWallet: null, //合伙人钱包
-				agentFrom: null, //是否显示我的资料
-				showLv: true,
-				commissionLog: [{
-					id: 1,
-					oper_type: 'gf',
-					// oper: 'https://file.shopro.top/imgs/commission/commission_icon1.png',
-					oper: require('@/static/images/fanyunLogo.png'),
-					remark: '恭喜您成为了合伙人',
-					createtime: 1676428876
-				}], //动态
-				loadStatus: 'loadmore', //loadmore-加载前的状态,loading-加载中的状态,nomore-没有更多的状态
-				currentPage: 1,
-				lastPage: 1,
-				logMap: {
-					system: this.$IMG_URL + '/imgs/commission/commission_base_notice.png',
-					admin: this.$IMG_URL + '/imgs/commission/commission_base_avatar.png'
-				},
-				showTerm: true, //条件弹窗
-				showGoodsTerm: false, //商品条件
-				showMoneyTerm: false, //金额条件
-				goodsTermList: [],
-				moneyTermNum: 0,
-				authNotice: {},
-				menuList: [
-					//menu
-					{
-						img: 'https://file.shopro.top/imgs/commission/commission_icon1.png',
-						title: '我的团队',
-						path: '/pages/user/commission/team'
-					},
-					{
-						img: 'https://file.shopro.top/imgs/commission/commission_icon2.png',
-						title: '佣金明细',
-						path: '/pages/user/commission/commission-log'
-					},
-					{
-						img: 'https://file.shopro.top/imgs/commission/commission_icon4.png',
-						title: '推广套餐',
-						path: '/pages/user/commission/goods',
-
-					},
-					{
-						img: 'https://file.shopro.top/imgs/commission/commission_icon3.png',
-						title: '提现佣金',
-						path: '/pages/user/commission/withdraw',
-
-					},
-
-
-					// {
-					// 	img: 'https://file.shopro.top/imgs/commission/commission_icon6.png',
-					// 	title: '排行榜',
-					// 	path: '/pages/user/commission/rankings'
-					// },
-					{
-						img: 'https://file.shopro.top/imgs/commission/commission_icon8.png',
-						title: '提现记录',
-						path: '/pages/user/commission/withdraw-log',
-
-					},
-					// {
-					// 	img: 'https://file.shopro.top/imgs/commission/commission_icon5.png',
-					// 	title: '分享海报',
-					// 	path: '/pages/user/commission/withdraw',
-					// },
-					// {
-					// 	img: 'https://file.shopro.top/imgs/commission/commission_icon7.png',
-					// 	title: '分享记录',
-					// 	path: '/pages/app/commission/share-log',
-
-					// }
-				],
-				money_total: '0.00',
-				on_cashout_money: '0.00',
-				showPoster: false,
-				posterObj: {},
-				posterfff: '您好,我是AI语言模型,可以帮助你做很多事情。例如:\n- 回答你的问题\n- 给你提供某些信息\n- 帮你搜索网页\n- 聊天和闲聊\n- 玩一些小游戏\n- 计算数学题\n- 翻译语言\n- 生成文本\n等等.....\n如果你有任何问题或需要帮助,请随时告诉我。',
-				spmplatform: 0,
-				is_examine: 1,
-				commission_price: 0,
-				info: {},
-				posterheight: 0,
-				poster_bg_img_path: '',
-				commission_alias: '',
-
-
-
-				genBgHaibaoUrl: ''
-			}
-		},
-		computed: {
-			...mapGetters(['appInfo', 'isLogin', 'userInfo'])
-		},
-		onLoad() {
-			// this.getInviteList()
-
-			const that = this;
-
-			if (this.platform == 'wxMiniProgram') {
-				var menumtop = uni.getMenuButtonBoundingClientRect().top - uni.getSystemInfoSync().statusBarHeight
-				var paddingtop = uni.getSystemInfoSync().statusBarHeight + menumtop
-				this.tobheight = (menumtop + paddingtop + uni.getMenuButtonBoundingClientRect().height)
-			}
-			this.posterheight = uni.$u.sys().windowHeight - this.tobheight
-			this.spmplatform = ['H5', 'wxOfficialAccount', 'wxMiniProgram', 'App'].indexOf(this.platform) + 1;
-
-			this.commonqrcodePath()
-			// console.log('http://vmoushivideomerge.oss-cn-shanghai.aliyuncs.com/20230422/96f1f662dcfc68cb3eff1dcbf660ed92.jpg');
-			// that.$base64.imageUrlToBase64('http://vmoushivideomerge.oss-cn-shanghai.aliyuncs.com/20230422/96f1f662dcfc68cb3eff1dcbf660ed92.jpg')
-
-		},
-		onShow() {
-
-			this.islogin();
-
-
-		},
-		methods: {
-			islogin() {
-				var that = this;
-				if (!this.isLogin) {
-					uni.navigateTo({
-						url: '../user/signin'
-					});
-				} else {
-					this.commission()
-					// this.getCheck()
-				}
-
-			},
-			commission() {
-				let that = this;
-				that.$http('conf.getGroupConf', {
-					group: 'system.commission'
-				}).then(res => {
-					if (res.code === 0) {
-						// res.data.poster_bg_img_path = [
-						// 	"https://face.cdn.zhishuyun.com/attachments/1133012400174534792/1204009950465101866/0d47db66-1faf-42df-a732-22cf18697a65_ins.png?ex=65d32ca5&is=65c0b7a5&hm=7219a0f250453314cfbf9eefaf2e927ba8d6adea944774b3fe32e67c0787a877&",
-						// 	"https://face.cdn.zhishuyun.com/attachments/1133012400174534792/1204010768786526248/a38d536d-7950-400c-bbc7-b37cd86c8de1_ins.png?ex=65d32d68&is=65c0b868&hm=fd5db147a0eb2e6b13719e1acc3f240a3a5ab8e81358df06c86808b68d0b0923"
-						// ]
-						that.info = res.data
-						that.poster_bg_img_path = res.data.poster_bg_img_path[0]
-						// uni.showToast({
-						// 	title: that.poster_bg_img_path
-						// })
-						console.log('生成海报需要的info信息=============', that.info);
-						that.commission_alias = res.data.commission_alias ? res.data.commission_alias : '分销中心'
-						if (res.data.is_examine) {
-							that.is_examine = res.data.is_examine
-							// console.log(that.is_examine);
-						}
-						if (res.data.commission_price) {
-							that.commission_price = res.data.commission_price
-						}
-						if (res.data.is_ranking == 1) {
-							if (that.menuList.length == 5) {
-								let obj = {
-									img: 'https://file.shopro.top/imgs/commission/commission_icon6.png',
-									title: '排行榜',
-									path: '/pages/user/commission/rankings'
-								};
-								that.menuList.splice(2, 0, obj);
-							}
-						}
-						that.getCheck()
-					}
-				});
-			},
-			commonqrcodePath() {
-				let spm = this.userInfo.id + '.1.0.' + this.spmplatform + '.1';
-				// console.log(spm);
-				this.$http('common.qrcodePath', {
-					spm: spm
-				}).then(res => {
-					if (res.code == 0) {
-						this.qrcode = res.data;
-						console.log('二维码需要包含的信息======', this.qrcode);
-
-						// setTimeout(() => {
-						// 	this.createPoster()
-						// }, 2000)
-					}
-				});
-			},
-			sharelink() {
-				let spm = this.userInfo.id + '.1.0.' + this.spmplatform + '.1';
-				// #ifdef MP-WEIXIN
-				let url = '/pages/index/index?' + 'spm=' + spm
-				uni.setClipboardData({
-					data: url,
-					success: function() {
-						uni.showToast({
-							title: '复制链接成功'
-						});
-					}
-				});
-				// #endif
-				// #ifdef H5
-				let uniacid = uni.getStorageSync('uniacid');
-				if (uniacid) {
-					let url = window.location.href.split('/h5')[0] + '/h5/?uniacid=' + uniacid + '&spm=' + spm;
-					uni.setClipboardData({
-						data: url,
-						success: function() {
-							uni.showToast({
-								title: '复制链接成功'
-							});
-						}
-					});
-				} else {
-					uni.showToast({
-						title: '复制链接失败',
-						icon: 'none'
-					})
-				}
-				// #endif
-
-			},
-			getdownload(e) {
-				return new Promise((resolve, reject) => {
-					uni.request({
-						url: e,
-						method: 'GET',
-						responseType: 'arraybuffer',
-						success: ress => {
-							let base64 = wx.arrayBufferToBase64(ress.data);
-							base64 = 'data:image/jpeg;base64,' + base64
-							resolve(base64);
-						},
-						fail: (e) => {
-							resolve('fail');
-						}
-					})
-				});
-			},
-			posterSuccess() {
-				uni.hideLoading();
-			},
-			async createPoster(e) {
-				let that = this;
-				let httpsurl = '';
-				uni.showLoading({
-					title: '海报渲染中'
-				});
-				console.log('that.poster_bg_img_path', that.poster_bg_img_path);
-				// if (that.poster_bg_img_path.indexOf("https") < 0) {
-				// 	httpsurl = await that.getdownload(that.poster_bg_img_path.replace("http:", "https:"));
-				// } else {
-				httpsurl = await that.getdownload(that.poster_bg_img_path);
-				// }
-
-
-				if (httpsurl == 'fail') {
-					uni.hideLoading();
-					uni.showToast({
-						title: '生成失败',
-						icon: 'none'
-					})
-					return;
-				}
-				let proportionally = this.info.poster_bg_width / uni.$u.sys().windowWidth;
-				(this.posterObj = {
-					width: (this.info.poster_bg_width / proportionally) + 'px',
-					height: (this.info.poster_bg_height / proportionally) + 'px',
-					background: '#fff',
-					borderRadius: '16rpx',
-
-					views: [{
-							src: httpsurl,
-							type: "image",
-							css: {
-								width: (this.info.poster_bg_width / proportionally) + 'px',
-								height: (this.info.poster_bg_height / proportionally) + 'px',
-							}
-						},
-						{
-							type: 'view',
-							css: {
-								left: ((this.info.poster_qrcode_x / proportionally) + 40) + 'px',
-								top: ((this.info.poster_qrcode_y / proportionally)) + 'px',
-								position: 'fixed',
-
-							},
-							views: [{
-									type: 'qrcode',
-									text: this.qrcode,
-									css: {
-										width: (this.info.poster_qrcode_width / proportionally) + 'px',
-										height: (this.info.poster_qrcode_width / proportionally) + 'px',
-										background: '#fff'
-									}
-								},
-								// {
-								// 	src: '/static/images/fanyunLogo.png',
-								// 	type: "image",
-								// 	css: {
-								// 		position: 'absolute',
-								// 		width: 30 + 'rpx',
-								// 		height: 30 + 'rpx',
-
-								// 		left: '60rpx',
-								// 		top: '50rpx',
-
-								// 	}
-								// }
-							],
-						},
-					]
-				}),
-				(
-					setTimeout(() => {
-						that.$refs.painter.canvasToTempFilePathSync({
-							// 在nvue里是jpeg
-							fileType: 'jpg',
-							quality: 1,
-							success: res => {
-								console.log('res.tempFilePath', res.tempFilePath);
-								this.genBgHaibaoUrl = res.tempFilePath
-								uni.hideLoading();
-							}
-						})
-						that.showPoster = true
-					}, 1000)
-				);
-			},
-
-			is_weixin() {
-				var ua = window.navigator.userAgent.toLowerCase();
-				if (ua.match(/MicroMessenger/i) == 'micromessenger') {
-					console.log('微信浏览器');
-					return true;
-				} else {
-					console.log("不是微信浏览器");
-					return false;
-				}
-			},
-
-			toSave() {
-				let _this = this
-				if (!this.is_weixin()) {
-					return uni.showModal({
-						showCancel: false,
-						title: '提示',
-						content: '请在微信内置浏览器打开,长按图片下载/分享',
-						confirmColor: '#207CF7'
-					})
-				}
-				uni.showModal({
-					confirmColor: '#207CF5',
-					confirmText: '查看图片',
-					title: '提示',
-					content: '查看图片后长按图片即可保存或分享',
-					success(src) {
-						if (src.confirm) {
-							_this.showPoster = false
-							uni.previewImage({
-								urls: [_this.genBgHaibaoUrl]
-							});
-						} else if (src.cancel) {
-							// this.showPoster = true;
-						}
-					}
-				});
-				return
-
-				uni.showLoading({
-					title: '海报生成中'
-				});
-				this.$refs.painter.canvasToTempFilePathSync({
-					// 在nvue里是jpeg
-					fileType: 'jpg',
-					quality: 1,
-					success: res => {
-						wx.showShareImageMenu({
-							path: res.tempFilePath
-						})
-						this.showPoster = false;
-						uni.hideLoading();
-						// #endif
-						// #ifdef H5
-						this.showPoster = false;
-						uni.hideLoading();
-						uni.showModal({
-							confirmColor: '#26B3A0',
-							confirmText: '查看图片',
-							title: '提示',
-							content: '查看图片后长按图片即可保存或分享',
-							success(src) {
-								if (src.confirm) {
-									uni.previewImage({
-										urls: [res.tempFilePath]
-									});
-								} else if (src.cancel) {
-									this.showPoster = true;
-								}
-							}
-						});
-						// #endif
-					}
-				});
-			},
-			getCheck() {
-				var that = this;
-				that.$http('commission.auth').then(res => {
-					if (res.code == 0) {
-						this.isLoading = false
-						uni.setNavigationBarTitle({
-							title: this.appInfo.site_name
-						});
-
-						that.money_total = res.data.money_total > 0 ? res.data.money_total : '0.00'
-						that.on_cashout_money = res.data.on_cashout_money > 0 ? res.data.on_cashout_money : '0.00'
-						that.commissionLog[0].createtime = res.data.create_time
-						if (res.data.status == 0 && that.is_examine == 1) {
-							uni.showModal({
-								confirmText: '确定',
-								showCancel: false,
-								confirmColor: '#5e49c3',
-								content: '分销商申请已提交,等待后台审核通过',
-								title: '提示',
-								success(res) {
-									if (res.confirm) {
-										uni.navigateBack()
-									}
-								}
-							})
-						}
-						if (res.data.status == 2) {
-							uni.showModal({
-								confirmText: '联系客服',
-								confirmColor: '#5e49c3',
-								content: '已被禁用,有疑问请咨询客服',
-								title: '提示',
-								success(res) {
-									if (res.confirm) {
-										uni.navigateTo({
-											url: '/pages/user/public/kefu'
-										})
-									} else if (res.cancel) {
-										uni.navigateBack()
-									}
-								}
-							})
-						}
-					} else {
-						// uni.showModal({
-						// 	confirmText:'申请',
-						// 	confirmColor:'#5e49c3',
-						// 	content:'立即申请成为合伙人',
-						// 	title:'提示',
-						// 	success(res) {
-						// 		if(res.confirm){
-						// 			that.commissionapply()
-						// 		}else if(res.cancel){
-						// 			uni.navigateBack()
-						// 		}
-						// 	}
-						// })
-						uni.redirectTo({
-							url: '/pages/user/commission/apply'
-						})
-					}
-				});
-			},
-			commissionapply() {
-				var that = this;
-				that.$http('commission.apply').then(res => {
-					if (res.code == 0) {
-						uni.showToast({
-							title: '申请成功'
-						})
-						that.getCheck()
-					} else {
-						uni.showModal({
-							confirmText: '重新申请',
-							confirmColor: '#5e49c3',
-							content: '合伙人申请失败',
-							title: '提示',
-							success(res) {
-								if (res.confirm) {
-									that.commissionapply()
-								} else if (res.cancel) {
-									uni.navigateBack()
-								}
-							}
-						})
-					}
-				});
-			},
-			// 我的团队
-			getInviteList() {
-				var that = this;
-				that.$api('distribution.ulist', {
-					uid: this.userInfo.id,
-					type: this.navbar[this.currentTab].type
-				}).then(res => {
-					// console.log(res)
-					if (res.data.length > 0) {
-						if (that.team.length > 0) {
-							var dd = this.team;
-							this.team = dd.concat(res.data);
-							this.pages++;
-						} else {
-							this.team = res.data;
-							this.pages++;
-						}
-					} else {
-						// this.empty = true
-					}
-				});
-			},
-			jump(e) {
-				uni.navigateTo({
-					url: e
-				})
-			},
-			change(index) {
-				this.currentTab = index;
-				this.team = [];
-				this.pages = 1;
-				this.getInviteList()
-			},
-			toTeam() {
-				// uni.navigateTo({
-				// 	url:'/pages/user/commission/team'
-				// })
-				uni.navigateTo({
-					url: '/pages/user/commission/commission-log'
-				})
-			}
-		},
-		onPullDownRefresh() {
-			var that = this;
-			// setTimeout(function() {
-			// 	this.pages = 1;
-			// 	this.team = [];
-			// 	that.getInviteList();
-			// 	uni.stopPullDownRefresh();
-			// }, 1000);
-		},
-		onReachBottom() {
-			// this.getInviteList();
-		},
-	}
-</script>
-
-<style lang="scss" scoped>
-	@import './index.scss';
-</style>

+ 96 - 0
utils/compress.js

xqd
@@ -0,0 +1,96 @@
+/**
+ * APP端图片压缩
+ *  参数说明:
+ *  img 图片url
+ *  scale缩放比例 1-100
+ *  callback 回调设置返回值 
+ */
+export function translateapp(img, scale, callback) {
+
+	plus.io.resolveLocalFileSystemURL(img, (entry) => { //通过URL参数获取目录对象或文件对象
+		entry.file((file) => { // 可通过entry对象操作图片 
+			console.log('压缩前图片信息:' + JSON.stringify(file)); //压缩前图片信息
+			if (file.size > 504800) { //   如果大于500Kb进行压缩
+				plus.zip.compressImage({ // 5+ plus.zip.compressImage 了解一下,有详细的示例
+					src: img, //src: 压缩原始图片的路径    
+					dst: img.replace('.png', 'yasuo.png').replace('.PNG',
+							'yasuo.PNG').replace('.jpg', 'yasuo.jpg')
+						.replace('.JPG', 'yasuo.JPG'),
+					width: '40%', //dst: (String 类型 )压缩转换目标图片的路径,这里先在后面原始名后面加一个yasuo区分一下
+					height: '40%', //width,height: (String 类型 )缩放图片的宽度,高度
+					quality: scale, //quality: (Number 类型 )压缩图片的质量
+					overwrite: true, //overwrite: (Boolean 类型 )覆盖生成新文件
+					// format:'jpg'   //format: (String 类型 )压缩转换后的图片格式
+				}, (event) => {
+					console.log('压缩后图片信息:' + JSON.stringify(event));
+					//返回压缩后的图片路径
+					callback(event.target);
+				}, function(err) {
+					console.log('Resolve file URL failed: ' + err.message);
+				});
+			} else { //else小于500kb跳过压缩,直接返回现有的src
+				callback(img);
+
+			}
+		});
+	}, (e) => { // 返回错误信息
+		console.log('Resolve file URL failed: ' + e.message);
+	});
+
+}
+/**
+ * H5端图片压缩
+ *  参数说明:
+ *  imgSrc 图片url
+ *  scale缩放比例 0-1
+ *  type 返回图片类型  默认blob 
+ *  callback 回调设置返回值 
+ */
+export function translate(imgSrc, scale, type, callback) {
+	var img = new Image();
+	img.src = imgSrc;
+	img.onload = function() {
+		var that = this;
+		var h = that.height; // 默认按比例压缩
+		var w = that.width;
+		var canvas = document.createElement('canvas');
+		var ctx = canvas.getContext('2d');
+		var width = document.createAttribute("width");
+		width.nodeValue = w;
+		var height = document.createAttribute("height");
+		height.nodeValue = h;
+		canvas.setAttributeNode(width);
+		canvas.setAttributeNode(height);
+		ctx.drawImage(that, 0, 0, w, h);
+		var base64 = canvas.toDataURL('image/jpeg', scale); //压缩比例
+		canvas = null;
+		if (type == 'base64') {
+			callback(base64);
+		} else {
+			var blob = base64ToBlob(base64);
+			var blobUrl = window.URL.createObjectURL(blob); //blob地址
+			callback(blobUrl);
+		}
+	}
+}
+// base转Blob
+export function base64ToBlob(base64) {
+	var arr = base64.split(','),
+		mime = arr[0].match(/:(.*?);/)[1],
+		bstr = atob(arr[1]),
+		n = bstr.length,
+		u8arr = new Uint8Array(n);
+	while (n--) {
+		u8arr[n] = bstr.charCodeAt(n);
+	}
+	return new Blob([u8arr], {
+		type: mime
+	});
+}
+
+
+/**
+ * 小程序端图片压缩
+ *  参数说明:
+ *  tempFilePaths:图片
+ */