Explorar o código

修改海报变形前提交

李万涛 hai 1 ano
pai
achega
7ef62ed946

+ 2 - 2
pages.json

xqd xqd
@@ -56,7 +56,7 @@
 		{
 			"path": "pages/digitalMen/index",
 			"style": {
-				"navigationBarTitleText": "",
+				"navigationBarTitleText": "数字人",
 				"navigationStyle": "custom",
 				"navigationBarTextStyle": "black",
 				"navigationBarBackgroundColor": "#fff",
@@ -71,7 +71,7 @@
 		{
 			"path": "pages/digitalMen/generate/index",
 			"style": {
-				"navigationBarTitleText": "凡云AI数字人",
+				"navigationBarTitleText": "数字人创建",
 				"navigationStyle": "custom",
 				"navigationBarTextStyle": "black",
 				"navigationBarBackgroundColor": "#fff",

+ 1 - 1
pages/digitalMen/generate/index.vue

xqd
@@ -242,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>

+ 1 - 1
pages/digitalMen/index.vue

xqd
@@ -56,7 +56,7 @@
 				<view class="draftLabel" style="padding-left: 30rpx;padding-right: 30rpx;">
 					<image style="width: 34rpx;height: 34rpx;" src="/static/zuopin_icon.png" mode="" class="labelIcon">
 					</image>
-					{{isLogin?'数字人作品':'精选案例'}}
+					{{isLogin?'作品':'精选案例'}}
 				</view>
 				<view style="padding-left: 15rpx;padding-right: 15rpx;">
 					<empty v-if="workList.length==0" :tipTxt="isLogin?'暂无作品':'暂无案例'"></empty>

+ 1 - 1
pages/index/index.vue

xqd
@@ -94,7 +94,7 @@
 
 				list: [],
 				drawList: [],
-				subsectionlist: ['Face', 'MJ绘图', 'SD绘图'],
+				subsectionlist: ['艺术照', 'MJ绘图', 'SD绘图'],
 				engine: 'rh',
 				current: 0,
 				showskeleton: true,

+ 260 - 225
pages/painting/details.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -47,6 +47,7 @@
 				</view>
 				<view class="">立即返回</view>
 			</view>
+
 			<view class="action" @click="getdownload(cardCur)">
 				<view class="bar-icon">
 					<view class="tn-icon-download">
@@ -55,7 +56,24 @@
 				<view class="">下载/分享</view>
 			</view>
 
-			<view class="action" @click="parameters">
+			<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">
@@ -82,9 +100,9 @@
 				<view class="">参考图</view>
 			</view>
 
-
-			<view v-if="show2" class="action" @click="tn('/pages/painting/draw?prompt='+parameter.promptSame+'&engine='+parameter.engine+'&model_name='+parameter.model_name+'&refImg='
-	+parameter.refImg)">
+			<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">
@@ -104,6 +122,7 @@
 			</view>
 		</view>
 
+
 		<tn-landscape :show="show1" @close="closeLandscape" closePosition="bottom" :closeSize="60">
 			<view class="tn-color-white" style="width: 100vw;">
 
@@ -142,7 +161,8 @@
 			</view>
 		</u-popup>
 
-		<wike-painter style="display: none;" :board="posterObj" @done="posterSuccess" ref="painter"></wike-painter>
+		<wike-painter style="height:1px;margin-top: -9999999px;" :board="posterObj" @done="posterSuccess"
+			ref="painter"></wike-painter>
 	</view>
 </template>
 
@@ -186,28 +206,28 @@
 				isDowload: false,
 				show: false,
 				sd_keywords: '',
-				
+
 
 				// 生成海报data
 				platform: this.$platform.get(),
-				
-				qrcode:'',
+
+				qrcode: '',
 				spmplatform: 0,
 				posterObj: {},
-				info:{
+				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,
+
+					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'])
@@ -218,7 +238,7 @@
 		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
@@ -242,6 +262,31 @@
 			}
 		},
 		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({
@@ -266,7 +311,7 @@
 					spm: spm
 				}).then(res => {
 					if (res.code == 0) {
-						this.qrcode= res.data;
+						this.qrcode = res.data;
 						// this.createPoster()
 						console.log('二维码需要包含的url信息=============', this.qrcode);
 					}
@@ -274,35 +319,23 @@
 			},
 			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.indexOf("https") < 0) {
-					avatarUrl = await that.downloadPic(that.userInfo.avatar.replace("http:", "https:"));
+
+				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 {
-					avatarUrl = await that.downloadPic(that.userInfo.avatar);
+					mainUrl = await that.downloadPic(that.swiperList[0].url);
 				}
-				if (avatarUrl == 'fail') {
+				if (mainUrl == 'fail') {
 					uni.hideLoading();
 					uni.showToast({
 						title: '生成失败',
@@ -310,189 +343,194 @@
 					})
 					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: [
+						// 背景图
+						{
+							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: [
-									{
-									type: 'image',
-									src:  avatarUrl,
-									css: {
-										marginTop: '-80rpx',
-										borderRadius: '50%',
-										width: '94rpx',
-										height: '94rpx',
-										objectFit: 'cover'
-										}
-									},
-								],
-				},
-				// 昵称
-				{
-					type: 'view',
-						css: {
-							display: 'flex',
-							position:'absolute',
-							left: '140rpx',
-							bottom: '196rpx',
-									
+							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: 'text',
-										text: that.userInfo.nickname,
-										css: {
-											fontSize: '28rpx',
-											color: '#333333',
-										}
-									}
-								],
-				},
-				
-				// 海报文案1
-				{
-					type: 'view',
-						css: {
-							display: 'flex',
-							position:'absolute',
-							left: '24rpx',
-							bottom: '96rpx',
-									
+							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: '免费体验Al生成个人质感艺术照',
-										css: {
-											fontSize: '32rpx',
-											color: '#333333',
-										}
-									}
-								],
-				},
-				// 海报文案2
-				{
-					type: 'view',
-						css: {
-							display: 'flex',
-							position:'absolute',
-							left: '24rpx',
-							bottom: '44rpx',
-									
+							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: '设计微信/抖音/小红书专属头像',
-										css: {
-											fontSize: '32rpx',
-											color: '#333333',
-										}
-									}
-								],
-				},
-									
-			// 二维码上方文案
-			{
-				type: 'view',
-					css: {
-						position:'absolute',
-						right: '40rpx',
-						bottom: '196rpx',	
+							views: [{
+								type: 'text',
+								text: '免费体验Al生成个人质感艺术照',
+								css: {
+									fontSize: '32rpx',
+									color: '#333333',
+								}
+							}],
 						},
-						views: [
-								{
-									type: 'text',
-									text: '微信扫码',
-									css: {
-										fontSize: '24rpx',
-										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: {
-						left: (this.info.poster_qrcode_x / proportionally) + 'px',
-						top: (this.info.poster_qrcode_y / proportionally) + 'px',
-						position: 'fixed',
-					
+							}],
 						},
-						views: [{
-								type: 'qrcode',
-								text: this.qrcode,
+
+						// 二维码上方文案
+						{
+							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',
-											
-										}
-								}
-								],
-				},
-			]
+								// {
+								// 	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
@@ -502,7 +540,7 @@
 								console.log('res.tempFilePath', res.tempFilePath);
 								uni.showModal({
 									title: '提示',
-									content: '查看图片后长按图片保存',
+									content: '查看图片后长按图片即可保存或分享',
 									confirmText: '查看',
 									confirmColor: '#1F79F0',
 									success: function(res2) {
@@ -510,10 +548,13 @@
 											uni.previewImage({
 												urls: [res.tempFilePath],
 												longPressActions: {
-													itemList: ['发送给朋友', '保存图片', '收藏'],
+													itemList: ['发送给朋友', '保存图片',
+														'收藏'
+													],
 													success: function(data) {},
 													fail: function(err) {
-														console.log(err.errMsg);
+														console.log(err
+															.errMsg);
 													}
 												}
 											});
@@ -531,7 +572,7 @@
 				uni.hideLoading();
 			},
 			// 生成海报需要的数据到此为止
-			
+
 
 			preViewImg(type) {
 				if (type == 1) {
@@ -618,17 +659,17 @@
 						if (this.engin == 'sd') {
 							for (var i = 0; i < res.data.imgs_file.length; i++) {
 								var url = {
-									id: i,
+									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: 0,
+								id: res.data.id,
 								type: 'image',
 								url: res.data.origin_url,
 							}
@@ -636,7 +677,7 @@
 							this.done = true
 						} else if (this.engin == 'rh') {
 							var url = {
-								id: 0,
+								id: res.data.id,
 								type: 'image',
 								url: res.data.imgs_file[0],
 							}
@@ -644,7 +685,7 @@
 
 							console.log("this.engin == 'rh'====", res.data.imgs_file, that.swiperList);
 							this.done = true
-							
+
 							// this.commonqrcodePath()
 						}
 
@@ -699,13 +740,7 @@
 						} else {
 							this.parameter.promptSame = this.parameter.prompt
 						}
-
-
-
 						console.log('进入这里了没有', this.parameter.promptSame);
-
-
-
 					} else {
 
 					}
@@ -841,14 +876,14 @@
 					})
 					return;
 				}
-				if(!this.is_weixin()){
-					return uni.showModal({
-						showCancel: false,
-						title: '提示',
-						content: '请在微信内置浏览器打开,长按图片下载/分享',
-						confirmColor: '#207CF7'
-					})
-				}
+				// if (!this.is_weixin()) {
+				// 	return uni.showModal({
+				// 		showCancel: false,
+				// 		title: '提示',
+				// 		content: '请在微信内置浏览器打开,长按图片下载/分享',
+				// 		confirmColor: '#207CF7'
+				// 	})
+				// }
 				this.createPoster()
 				return
 

+ 58 - 33
pages/painting/draw.scss

xqd xqd xqd xqd xqd
@@ -60,7 +60,15 @@
 					font-family: PingFang-SC, PingFang-SC;
 					font-weight: 500;
 					color: #333333;
-					margin-top: 12rpx;
+					margin-top: 6rpx;
+					
+					
+					white-space: nowrap;
+					text-overflow: ellipsis;
+					overflow: hidden;
+					width: 100%;
+					
+					text-align: center;
 				}
 			}
 		}
@@ -123,7 +131,7 @@ padding-bottom: 170rpx;
 				width: 100vw;
 				background: rgba(0, 0, 0, .35);
 				z-index:9999;
-				
+				// background: red;
 				.con{
 					position: absolute;
 					box-sizing: border-box;
@@ -175,46 +183,63 @@ padding-bottom: 170rpx;
 			color: #333333;
 			margin-bottom: 24rpx;
 			padding-left: 28rpx;
-		}
-		.selList{
-			margin-bottom: 24rpx;
-			display: flex;
-			flex-wrap: nowrap;
-			white-space: nowrap;
 			
-			// background: red;
-			width: 100%;
-			overflow-y: hidden;
-			overflow-x: scroll;
-			padding-left: 28rpx;
 			
-			// z-index: 3;
+			display: flex;
+			align-items: center;
 			
-			.item_a{
-				background: #DCEAFD!important;
-				color:#1F79F0;
+			.le{
+				width: 130rpx;
+				// display: flex;
+				// align-items: center;
+				// line-height: 62rpx;
+				// height: 63rpx;
+				// background: red;
 			}
 			
-			.item{
-				// width: 200rpx;
-				height: 62rpx;
-				background: #F4F4F4;
-				border-radius: 31rpx;
+			.selList{
+				// margin-bottom: 24rpx;
 				display: flex;
-				align-items: center;
-				justify-content: center;
-				margin-right: 16rpx;
-				padding-left: 24rpx;
-				padding-right: 26rpx;
+				flex-wrap: nowrap;
+				white-space: nowrap;
+				// background: red;
+				width:calc(100% - 130rpx);
+				overflow-y: hidden;
+				overflow-x: scroll;
+				// padding-left: 28rpx;
 				
+				// z-index: 3;
 				
-				.arrD{
-					width: 23rpx;
-					height: 14rpx;
-					margin-left: 14rpx;
+				.item_a{
+					background: #DCEAFD!important;
+					color:#1F79F0;
+				}
+				
+				.item{
+					// width: 200rpx;
+					height: 62rpx;
+					background: #F4F4F4;
+					border-radius: 31rpx;
+					display: flex;
+					align-items: center;
+					justify-content: center;
+					margin-right: 16rpx;
+					padding-left: 24rpx;
+					padding-right: 26rpx;
+					font-size: 14px;
+					font-family: PingFang-SC, PingFang-SC;
+					font-weight: 500;
+					color: #333333;
+					
+					.arrD{
+						width: 23rpx;
+						height: 14rpx;
+						margin-left: 14rpx;
+					}
 				}
 			}
 		}
+		
 		.addLpd{
 			padding-left: 28rpx;
 			.moreBtn{
@@ -240,7 +265,7 @@ padding-bottom: 170rpx;
 			font-weight: 800;
 			color: #333333;
 			
-			margin-top:64rpx;
+			margin-top:16rpx;
 			padding-left: 28rpx;
 		}
 		.upList{
@@ -379,7 +404,7 @@ padding-bottom: 170rpx;
 	.top{
 		display: flex;
 		align-items: center;
-		margin-bottom: 32rpx;
+		margin-bottom:12rpx;
 		.title{
 			font-size: 30rpx;
 			font-family: PingFang-SC, PingFang-SC;

+ 65 - 29
pages/painting/draw.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -28,19 +28,17 @@
 		<view class="ysBox" v-if="current==0">
 			<div class="selBox">
 				<div class="title">
-					模板选择
-				</div>
-				<div class="selList" @click.stop="">
-					<div class="item" v-for="(item,index) in selOptList" @click.stop="handleOpenOpt(index)">
-						{{item}}
-						<img src="@/static/arrD.png" alt="" class="arrD" />
+					<div class="le">
+						模板选择
 					</div>
-
-					<div class="item" v-for="(item,index) in sexList" @click.stop="handleSelSex(item,index)"
-						:class="[item==seledSex?'item_a':'']">
-						{{item}}
+					<div class="selList" @click.stop="">
+						<div class="item" v-for="(item,index) in selOptList" @click.stop="handleOpenOpt(index)">
+							{{item}}
+							<img src="@/static/arrD.png" alt="" class="arrD" />
+						</div>
 					</div>
 				</div>
+
 				<div class="addPo">
 					<div class="optDetailBox" v-if="showRule" @click.stop="closeOver">
 						<div class="con" @click.stop="">
@@ -64,16 +62,16 @@
 					</div>
 
 
-					<!-- 	<div class="optDetailBox" v-if="showSex" @click.stop="closeOver">
+					<div class="optDetailBox" v-if="showSex" @click.stop="closeOver">
 						<div class="con" @click.stop="">
 							<div class="optList" @click.stop="">
-								<div class="item" @click.stop="handleSelSex(item,index)" v-for="(item,index) in sexs"
+								<div class="item" @click.stop="handleSelSex(item,index)" v-for="(item,index) in sexList"
 									:class="[item==seledSex?'item_a':'']">
 									{{item}}
 								</div>
 							</div>
 						</div>
-					</div> -->
+					</div>
 				</div>
 
 
@@ -150,7 +148,7 @@
 				<div class="tipBox">
 					<img src="@/static/b_info.png" alt="" />
 					模板可直接选择上面的现成模板,可点击自己上传<br>
-					仅支持JPG/PNG格式,大小5M以下
+					仅支持JPG/PNG格式,大小10M以下
 				</div>
 
 
@@ -443,7 +441,7 @@
 				selOptList: [
 					'排序规则',
 					'主题风格',
-					// '性别',
+					'性别',
 				],
 
 				sexList: [
@@ -561,7 +559,7 @@
 				noticebar: ['精美图片需要时间打磨,预计20秒-120秒出图',
 					// '图片生成中请不要退出,否则可能会生成失败'
 				],
-				tabslist: ['Face', 'MJ绘图', 'SD绘图'],
+				tabslist: ['艺术照', 'MJ绘图', 'SD绘图'],
 				curNow: 0,
 				cardswiper: [
 					'https://cos.iseeds.xyz/cover/3.0-1.jpg',
@@ -588,10 +586,7 @@
 			this.showHuiHuaLead = !uni.getStorageSync('showHuiHuaLead')
 			console.log("uni.getStorageSync('showHuiHuaLead')", uni.getStorageSync('showHuiHuaLead'));
 
-			// mj优先展示
-			this.getsubsection({
-				index: 0
-			})
+
 
 			if (this.platform == 'wxMiniProgram') {
 				var menumtop = uni.getMenuButtonBoundingClientRect().top - uni.getSystemInfoSync().statusBarHeight;
@@ -607,22 +602,28 @@
 				}
 
 				this.cursor = this.$Route.query.prompt.length
-				this.current = this.$Route.query.engine == 'sd' ? 0 : 1
-				this.showmj = this.$Route.query.engine == 'sd' ? false : true
+				this.current = this.$Route.query.engine == 'rh' ? 0 : this.$Route.query.engine == 'mj' ? 1 : 2
+				this.showmj = this.$Route.query.engine == 'rh' ? 0 : this.$Route.query.engine == 'mj' ? 1 : 2
 				if (this.$Route.query.engine == 'sd') {
 					this.form.samples = 1
 					this.engine = 'sd'
 					this.modelslist = []
 					this.getModels();
 
-				} else {
+				} else if (this.$Route.query.engine == 'mj') {
 					this.form.samples = 4
 					this.engine = 'mj'
 					this.modelslist = []
 					this.getModels();
+				} else {
+					// 艺术照-----创作相似待处理
+					// this.$Route.query.rh_modalurl
 				}
-
-
+			} else {
+				// rh优先展示
+				this.getsubsection({
+					index: 0
+				})
 			}
 			this.gallery();
 			this.getModels();
@@ -739,9 +740,36 @@
 						}
 						this.seledSex = '女'
 					}
-					this.seledCankaoImg = this.cankaoImgList[0]
-					this.seledCankaoImg_temp = this.cankaoImgList[0]
-					this.myModal = this.cankaoImgList[0].path
+					// 当没有点击创作相似,直接进入时
+					if (!this.$Route.query.rh_modalurl) {
+						this.seledCankaoImg = this.cankaoImgList[0]
+						this.seledCankaoImg_temp = this.cankaoImgList[0]
+						this.myModal = this.cankaoImgList[0].path
+
+						console.log('直接进入', this.$Route.query.rh_modalId);
+					} else {
+						// 如果使用了模版
+						if (this.$Route.query.rh_modalId != -1) {
+							let sameCankaoImg = this.cankaoImgList.find((item, index) => {
+								return item.id == this.$Route.query.rh_modalId
+							})
+							this.seledCankaoImg = sameCankaoImg
+							this.seledCankaoImg_temp = sameCankaoImg
+							this.myModal = sameCankaoImg.path
+							console.log('使用了模版', this.$Route.query.rh_modalId);
+							// 用户自己上传的模版图
+						} else {
+							console.log('用户自己上传的模版图', this.$Route.query.rh_modalId);
+							this.seledCankaoImg = {
+								id: -1
+							}
+							this.seledCankaoImg_temp = {
+								id: -1
+							}
+							this.myModal = this.$Route.query.rh_modalurl
+						}
+					}
+
 
 					uni.hideLoading()
 					console.log('艺术照模板列表返回值---', this.cankaoImgList, res);
@@ -872,7 +900,7 @@
 					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
 					sourceType: ['album'], //从相册选择
 					success: function(res) {
-						console.log('上传参考图返回值:', res.tempFiles[0].name, res.tempFiles[0].name.toLowerCase());
+						console.log('上传参考图返回值:', res, res.tempFiles[0].name.toLowerCase());
 						if (!(res.tempFiles[0].name.toLowerCase().endsWith('.png') || res.tempFiles[0].name
 								.toLowerCase().endsWith(
 									'.jpeg') || res.tempFiles[0].name.toLowerCase().endsWith('.jpg'))) {
@@ -883,6 +911,14 @@
 							})
 							return
 						}
+						console.log(res.tempFiles[0].size, res.tempFiles[0].size / 1048576);
+						if (res.tempFiles[0].size > 10 * 1048576) {
+							return uni.showToast({
+								title: '上传失败,图片大小超10M',
+								icon: 'none',
+								duration: 2000
+							})
+						}
 						const path = res.tempFilePaths[0];
 						if (type == 0) {
 							that.showUpLoading1 = true

+ 259 - 263
pages/painting/generate.vue

xqd xqd xqd xqd xqd xqd
@@ -138,8 +138,9 @@
 				</view>
 			</view>
 		</u-modal>
-		
-		<wike-painter style="display: none;" :board="posterObj" @done="posterSuccess" ref="painter"></wike-painter>
+
+		<wike-painter style="height:1px;margin-top: -9999999px;" :board="posterObj" @done="posterSuccess"
+			ref="painter"></wike-painter>
 	</view>
 </template>
 
@@ -216,21 +217,21 @@
 				mj_refImg: '',
 				showparameters: false,
 				keywords: '',
-				
-				
-				qrcode:'',
+
+
+				qrcode: '',
 				spmplatform: 0,
 				posterObj: {},
-				info:{
+				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,
+
+					poster_bg_width: 347,
+					poster_bg_height: 574,
+
+					poster_qrcode_x: 278,
+					poster_qrcode_y: 495,
+					poster_qrcode_width: 52,
+					poster_qrcode_height: 52,
 				},
 			}
 		},
@@ -243,8 +244,8 @@
 		onLoad(o) {
 			this.spmplatform = ['H5', 'wxOfficialAccount', 'wxMiniProgram', 'App'].indexOf(this.platform) + 1;
 			this.commonqrcodePath()
-			
-			
+
+
 			if (o.refImg) {
 				this.mj_refImg = o.refImg
 				console.log('mj参考图:', this.mj_refImg);
@@ -301,64 +302,67 @@
 		},
 		methods: {
 			...mapActions(['appInit', 'logout', 'getUserInfo', 'getUserData']),
-			
+
 			downloadPic(e) {
-					return new Promise((resolve, reject) => {
-						uni.request({
-							url: e,
-							method: 'GET',
-							responseType: 'arraybuffer',
-							timeout:999999,
-							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);
+				return new Promise((resolve, reject) => {
+					uni.request({
+						url: e,
+						method: 'GET',
+						responseType: 'arraybuffer',
+						timeout: 999999,
+						success: ress => {
+							let base64 = uni.arrayBufferToBase64(ress.data);
+							base64 = 'data:image/jpeg;base64,' + base64
+							resolve(base64);
+						},
+						fail: (e) => {
+							resolve('fail');
 						}
-					});
-				},
-				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.mjurl,that.userInfo.avatar);
-			
-			// that.mjurl="https://midjourney.cdn.zhishuyun.com/attachments/1124768570157564029/1204440835731751012/kylejohnsongfa8_Very_detailed_CGUnity8K_wallpaper_masterpiece_b_796b67e5-8890-434b-937d-2c36d1d0a371.png?ex=65d4bdf0&is=65c248f0&hm=81256bc90f3a9bc1a51538da2654bb885db81ea1d28fa136417c8a30d356584a&width=1024&height=1024"
-			// if (that.mjurl.indexOf("https") < 0) {
-			// 	mainUrl = await that.downloadPic(that.mjurl.replace("http:", "https:"));
-			// } else {
+					})
+				});
+			},
+			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.mjurl, that.userInfo
+					.avatar);
+
+				// that.mjurl="https://midjourney.cdn.zhishuyun.com/attachments/1124768570157564029/1204440835731751012/kylejohnsongfa8_Very_detailed_CGUnity8K_wallpaper_masterpiece_b_796b67e5-8890-434b-937d-2c36d1d0a371.png?ex=65d4bdf0&is=65c248f0&hm=81256bc90f3a9bc1a51538da2654bb885db81ea1d28fa136417c8a30d356584a&width=1024&height=1024"
+				// if (that.mjurl.indexOf("https") < 0) {
+				// 	mainUrl = await that.downloadPic(that.mjurl.replace("http:", "https:"));
+				// } else {
 				mainUrl = await that.downloadPic(that.mjurl);
-			// }
-			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 (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 {
@@ -372,227 +376,219 @@
 						})
 						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: {
+				}
+
+				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',
+						},
+						// 主图
+						{
+							type: 'view',
 							css: {
-								position:'absolute',
+								position: 'absolute',
 								left: '24rpx',
-								top: '24rpx',	
-								},
-								views: [
-										{
-											src: mainUrl,
-											type: "image",
-											css: {
-													width: 705 + 'rpx',
-													height:936+ 'rpx',
-													borderRadius: '28rpx',
-												}
-										},
-									],
-					},
-								
-					// 头像
-					{
-						type: 'view',
+								top: '24rpx',
+							},
+							views: [{
+								src: mainUrl,
+								type: "image",
+								css: {
+									width: 705 + 'rpx',
+									height: 936 + 'rpx',
+									borderRadius: '28rpx',
+								}
+							}, ],
+						},
+
+						// 头像
+						{
+							type: 'view',
 							css: {
 								display: 'flex',
-								position:'absolute',
+								position: 'absolute',
 								left: '24rpx',
 								top: '1060rpx',
-										
-								},
-								views: [
-										{
-										type: 'image',
-										src:  avatarUrl,
-										css: {
-											marginTop: '-80rpx',
-											borderRadius: '50%',
-											width: '94rpx',
-											height: '94rpx',
-											objectFit: 'cover'
-											}
-										},
-									],
-					},
-					// 昵称
-					{
-						type: 'view',
+
+							},
+							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',
+								position: 'absolute',
 								left: '140rpx',
 								bottom: '196rpx',
-										
-								},
-								views: [
-										{
-											type: 'text',
-											text: that.userInfo.nickname,
-											css: {
-												fontSize: '28rpx',
-												color: '#333333',
-											}
-										}
-									],
-					},
-					
-					// 海报文案1
-					{
-						type: 'view',
+							},
+							views: [{
+								type: 'text',
+								text: that.userInfo.nickname ? that.userInfo.nickname : '默认用户',
+								css: {
+									fontSize: '28rpx',
+									color: '#333333',
+								}
+							}],
+						},
+
+						// 海报文案1
+						{
+							type: 'view',
 							css: {
 								display: 'flex',
-								position:'absolute',
+								position: 'absolute',
 								left: '24rpx',
 								bottom: '96rpx',
-										
-								},
-								views: [
-										{
-											type: 'text',
-											text: '免费体验Al生成个人质感艺术照',
-											css: {
-												fontSize: '32rpx',
-												color: '#333333',
-											}
-										}
-									],
-					},
-					// 海报文案2
-					{
-						type: 'view',
+
+							},
+							views: [{
+								type: 'text',
+								text: '免费体验Al生成个人质感艺术照',
+								css: {
+									fontSize: '32rpx',
+									color: '#333333',
+								}
+							}],
+						},
+						// 海报文案2
+						{
+							type: 'view',
 							css: {
 								display: 'flex',
-								position:'absolute',
+								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: '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',
-												
-											}
+										width: (this.info.poster_qrcode_width / proportionally) + 'px',
+										height: (this.info.poster_qrcode_width / proportionally) + 'px',
+										background: '#fff'
 									}
-									],
-					},
-				]
-					}),
-					(
-						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);
-														}
+								},
+								// {
+								// 	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('用户点击取消');
-											}
+												}
+											});
+										} else if (res2.cancel) {
+											console.log('用户点击取消');
 										}
-									});
-								}
-							})
-						}, 1000)
-					);
-				},
-				posterSuccess() {
-					uni.hideLoading();
-				},
-				// 生成海报需要的数据到此为止
+									}
+								});
+							}
+						})
+					}, 1000)
+				);
+			},
+			posterSuccess() {
+				uni.hideLoading();
+			},
+			// 生成海报需要的数据到此为止
 			preViewImg() {
 				uni.previewImage({
 					urls: [this.mj_refImg],
@@ -1131,7 +1127,7 @@
 					})
 					return;
 				}
-				
+
 				// if(!this.is_weixin()){
 				// 	return uni.showModal({
 				// 		showCancel: false,

+ 255 - 258
pages/painting/ys.vue

xqd xqd xqd xqd xqd xqd
@@ -82,7 +82,8 @@
 		</view>
 
 
-		<wike-painter style="display: none;" :board="posterObj" @done="posterSuccess" ref="painter"></wike-painter>
+		<wike-painter style="height:1px;margin-top: -9999999px;" :board="posterObj" @done="posterSuccess"
+			ref="painter"></wike-painter>
 	</view>
 </template>
 
@@ -138,22 +139,22 @@
 				timer: null,
 
 				faceId: -1,
-				
-				
+
+
 				platform: this.$platform.get(),
-				qrcode:'',
+				qrcode: '',
 				spmplatform: 0,
 				posterObj: {},
-				info:{
+				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,
+
+					poster_bg_width: 347,
+					poster_bg_height: 574,
+
+					poster_qrcode_x: 278,
+					poster_qrcode_y: 495,
+					poster_qrcode_width: 52,
+					poster_qrcode_height: 52,
 				},
 			}
 		},
@@ -163,7 +164,7 @@
 		async onLoad(o) {
 			this.spmplatform = ['H5', 'wxOfficialAccount', 'wxMiniProgram', 'App'].indexOf(this.platform) + 1;
 			this.commonqrcodePath()
-			
+
 			// this.parmas = JSON.parse(o.ysParmas)
 			this.parmas = getApp().ysParmas
 			var that = this;
@@ -202,60 +203,63 @@
 
 		methods: {
 			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);
+				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');
 						}
-					});
-				},
-				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],that.userInfo.avatar);
-			
-			if (that.swiperList[0].indexOf("https") < 0) {
-				mainUrl = await that.downloadPic(that.swiperList[0].replace("http:", "https:"));
-			} else {
-				mainUrl = await that.downloadPic(that.swiperList[0]);
-			}
-			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&"
+					})
+				});
+			},
+			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], that
+					.userInfo.avatar);
+
+				if (that.swiperList[0].indexOf("https") < 0) {
+					mainUrl = await that.downloadPic(that.swiperList[0].replace("http:", "https:"));
+				} else {
+					mainUrl = await that.downloadPic(that.swiperList[0]);
+				}
+				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 {
@@ -269,226 +273,219 @@
 						})
 						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: {
+				}
+
+				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',
+						},
+						// 主图
+						{
+							type: 'view',
 							css: {
-								position:'absolute',
+								position: 'absolute',
 								left: '24rpx',
-								top: '24rpx',	
-								},
-								views: [
-										{
-											src: mainUrl,
-											type: "image",
-											css: {
-													width: 705 + 'rpx',
-													height:936+ 'rpx',
-													borderRadius: '28rpx',
-												}
-										},
-									],
-					},
-								
-					// 头像
-					{
-						type: 'view',
+								top: '24rpx',
+							},
+							views: [{
+								src: mainUrl,
+								type: "image",
+								css: {
+									width: 705 + 'rpx',
+									height: 936 + 'rpx',
+									borderRadius: '28rpx',
+								}
+							}, ],
+						},
+
+						// 头像
+						{
+							type: 'view',
 							css: {
 								display: 'flex',
-								position:'absolute',
+								position: 'absolute',
 								left: '24rpx',
 								top: '1060rpx',
-										
-								},
-								views: [
-										{
-										type: 'image',
-										src:  avatarUrl,
-										css: {
-											marginTop: '-80rpx',
-											borderRadius: '50%',
-											width: '94rpx',
-											height: '94rpx',
-											objectFit: 'cover'
-											}
-										},
-									],
-					},
-					// 昵称
-					{
-						type: 'view',
+
+							},
+							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',
+								position: 'absolute',
 								left: '140rpx',
 								bottom: '196rpx',
-										
-								},
-								views: [
-										{
-											type: 'text',
-											text: that.userInfo.nickname,
-											css: {
-												fontSize: '28rpx',
-												color: '#333333',
-											}
-										}
-									],
-					},
-					
-					// 海报文案1
-					{
-						type: 'view',
+
+							},
+							views: [{
+								type: 'text',
+								text: that.userInfo.nickname ? that.userInfo.nickname : '默认用户',
+								css: {
+									fontSize: '28rpx',
+									color: '#333333',
+								}
+							}],
+						},
+
+						// 海报文案1
+						{
+							type: 'view',
 							css: {
 								display: 'flex',
-								position:'absolute',
+								position: 'absolute',
 								left: '24rpx',
 								bottom: '96rpx',
-										
-								},
-								views: [
-										{
-											type: 'text',
-											text: '免费体验Al生成个人质感艺术照',
-											css: {
-												fontSize: '32rpx',
-												color: '#333333',
-											}
-										}
-									],
-					},
-					// 海报文案2
-					{
-						type: 'view',
+
+							},
+							views: [{
+								type: 'text',
+								text: '免费体验Al生成个人质感艺术照',
+								css: {
+									fontSize: '32rpx',
+									color: '#333333',
+								}
+							}],
+						},
+						// 海报文案2
+						{
+							type: 'view',
 							css: {
 								display: 'flex',
-								position:'absolute',
+								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: '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',
-												
-											}
+										width: (this.info.poster_qrcode_width / proportionally) + 'px',
+										height: (this.info.poster_qrcode_width / proportionally) + 'px',
+										background: '#fff'
 									}
-									],
-					},
-				]
-					}),
-					(
-						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);
-														}
+								},
+								// {
+								// 	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('用户点击取消');
-											}
+												}
+											});
+										} else if (res2.cancel) {
+											console.log('用户点击取消');
 										}
-									});
-								}
-							})
-						}, 1000)
-					);
-				},
-				posterSuccess() {
-					uni.hideLoading();
-				},
+									}
+								});
+							}
+						})
+					}, 1000)
+				);
+			},
+			posterSuccess() {
+				uni.hideLoading();
+			},
 			async public() {
 				var that = this;
 				if (this.showdrawing) {
@@ -845,7 +842,7 @@
 					})
 					return;
 				}
-				
+
 				// if(!this.is_weixin()){
 				// 	return uni.showModal({
 				// 		showCancel: false,

+ 39 - 0
pages/user/commission/index.scss

xqd
@@ -1,3 +1,42 @@
+::v-deep .u-transition{
+	z-index: 99!important;
+}
+
+.haibaoBox{
+	display: flex;
+	flex-direction: column;
+	align-items: center;
+	
+	padding-top: 50rpx;
+	.haibao{
+		width: 50%;
+		height: 40vh;
+		margin-bottom: 30rpx;
+	}
+	.bgList{
+		padding-left: 30rpx;
+		padding-right: 30rpx;
+		display: flex;
+		
+		// justify-content: space-between;
+		width: 100%;
+		// background: red;
+		
+		margin-bottom: 100rpx;
+		.item{
+			width: 16vw;
+			height: 200rpx;
+			border-radius: 15rpx;
+			margin-right: 20rpx;
+		}
+		.item_a{
+			border: 6rpx solid #207CF5;
+		}
+	}
+}
+
+
+
 .commission-wrap {
 		background: url('http://file.shopro.top/imgs/commission/commission_bg1.jpg') no-repeat;
 		background-size: cover;

+ 127 - 324
pages/user/commission/index.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -138,30 +138,31 @@
 				</view>
 			</u-popup>
 		</view>
-		<!-- <wike-loading-page :isLoading="isLoading"></wike-loading-page> -->
-		<!-- <u-popup :show="showPoster" mode="bottom" :round="10" @close="close">
-			<view class="poster">
-				<wike-painter :board="posterObj" @success="posterSuccess" ref="painter"></wike-painter>
-				<view class="footer-btn">
-					<view class="" @click="showPoster = false">退出</view>
-					<view class="save" @click="toSave">保存/分享</view>
-				</view>
-			</view>
-		</u-popup> -->
 		<u-popup :show="showPoster" mode="bottom" @close="showPoster = false">
 			<!-- <view :style="{height: tobheight+'px'}"></view> -->
 			<scroll-view scroll-y="true" :style="{maxHeight: posterheight +'px'}">
 
-				<wike-painter :board="posterObj" @done="posterSuccess" ref="painter"></wike-painter>
-				<view style="height: 78px;"></view>
-				<view class="dygbhg">
-					<view class="whole" @click="showPoster = false">取消</view>
-					<view class="distinguish" @click="toSave">保存/分享</view>
-				</view>
-			</scroll-view>
 
 
+				<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>
@@ -176,6 +177,8 @@
 	export default {
 		data() {
 			return {
+				currBgIndex: 0,
+
 				isLoading: true,
 				tobheight: 45,
 				platform: this.$platform.get(),
@@ -299,7 +302,11 @@
 				info: {},
 				posterheight: 0,
 				poster_bg_img_path: '',
-				commission_alias: ''
+				commission_alias: '',
+
+
+
+				genBgHaibaoUrl: ''
 			}
 		},
 		computed: {
@@ -326,6 +333,8 @@
 		onShow() {
 
 			this.islogin();
+
+
 		},
 		methods: {
 			islogin() {
@@ -346,7 +355,16 @@
 					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
@@ -377,7 +395,11 @@
 				}).then(res => {
 					if (res.code == 0) {
 						this.qrcode = res.data;
+						console.log('二维码需要包含的信息======', this.qrcode);
 
+						// setTimeout(() => {
+						// 	this.createPoster()
+						// }, 2000)
 					}
 				});
 			},
@@ -441,12 +463,14 @@
 				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 (that.info.poster_bg_img_path.indexOf("https") < 0) {
-					httpsurl = await that.getdownload(that.info.poster_bg_img_path.replace("http:", "https:"));
-				} else {
-					httpsurl = await that.getdownload(that.info.poster_bg_img_path);
-				}
 				if (httpsurl == 'fail') {
 					uni.hideLoading();
 					uni.showToast({
@@ -456,11 +480,6 @@
 					return;
 				}
 				let proportionally = this.info.poster_bg_width / uni.$u.sys().windowWidth;
-				// console.log(this.info.poster_bg_width,(this.info.poster_bg_width / proportionally));
-				// console.log(this.info.poster_bg_height,(this.info.poster_bg_height / proportionally));
-				// console.log(this.info.poster_qrcode_x,(this.info.poster_qrcode_x / proportionally));
-				// console.log(this.info.poster_qrcode_y,(this.info.poster_qrcode_y / proportionally));
-				// console.log(this.info.poster_qrcode_width,(this.info.poster_qrcode_width / proportionally));
 				(this.posterObj = {
 					width: (this.info.poster_bg_width / proportionally) + 'px',
 					height: (this.info.poster_bg_height / proportionally) + 'px',
@@ -475,283 +494,96 @@
 								height: (this.info.poster_bg_height / proportionally) + 'px',
 							}
 						},
-						// {
-						// 	src: this.userInfo.avatar ? this.userInfo.avatar : '/static/images/head.jpg',
-						// 	type: "image",
-						// 	css: {
-						// 		width: '100rpx',
-						// 		height: '100rpx',
-						// 		borderRadius: '50%',
-						// 		position:'fixed',
-						// 		left: '286rpx',
-						// 		top: '258rpx',
-						// 		objectFit:'cover'
-						// 	}
-						// },
 						{
 							type: 'view',
 							css: {
-								left: (this.info.poster_qrcode_x / proportionally) + 'px',
-								top: (this.info.poster_qrcode_y / proportionally) + 'px',
+								left: ((this.info.poster_qrcode_x / proportionally) + 40) + 'px',
+								top: ((this.info.poster_qrcode_y / proportionally)) + 'px',
 								position: 'fixed',
 
 							},
-							// #ifdef H5
 							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'
-								}
-							}],
-							// #endif
-							// #ifdef MP-WEIXIN
-							views: [{
-								type: 'image',
-								src: this.qrcode,
-								css: {
-									width: (this.info.poster_qrcode_width / proportionally) + 'px',
-									height: (this.info.poster_qrcode_width / proportionally) + 'px',
-									background: '#fff'
-								}
-							}]
-							// #endif
-						}
+									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',
+
+								// 	}
+								// }
+							],
+						},
 					]
-
-					// views: [
-					// 	{
-					// 		type: 'view',
-					// 		css: {
-					// 			marginTop: '20rpx',
-					// 			paddingLeft: '10rpx',
-					// 			display: 'flex'
-					// 		},
-					// 		views: [
-					// 			{
-					// 				type: 'image',
-					// 				src: this.userInfo.avatar ? this.userInfo.avatar : '/static/images/head.jpg',
-					// 				css: {
-					// 					marginTop: '10rpx',
-					// 					marginLeft: '10rpx',
-					// 					borderRadius: '16rpx',
-					// 					width: '80rpx',
-					// 					height: '80rpx',
-					// 					border: '2rpx solid #fff',
-					// 					objectFit: 'cover'
-					// 				}
-					// 			},
-					// 			{
-					// 				type: 'view',
-					// 				css: {
-					// 					marginTop: '10rpx',
-					// 					marginLeft: '20rpx'
-					// 				},
-					// 				views: [
-					// 					{
-					// 						type: 'view',
-					// 						views: [
-					// 							{
-					// 								type: 'text',
-					// 								text: this.userInfo.nickname?this.userInfo.nickname:'提问者',
-					// 								css: {
-					// 									marginTop: '10rpx',
-					// 									fontSize: '28rpx',
-					// 									fontWeight: 'bold',
-					// 									color: '#1A2033',
-					// 									lineHeight: '28rpx'
-					// 								}
-					// 							}
-					// 						]
-					// 					},
-					// 					{
-					// 						type: 'view',
-					// 						views: [
-					// 							{
-					// 								type: 'text',
-					// 								text: '我的提问',
-					// 								css: {
-					// 									marginTop: '15rpx',
-					// 									fontSize: '22rpx',
-					// 									color: '#999',
-					// 									lineHeight: '25rpx'
-					// 								}
-					// 							}
-					// 						]
-					// 					}
-					// 				]
-					// 			}
-					// 		]
-					// 	},
-					// 	{
-					// 		type: 'view',
-					// 		css: {
-					// 			marginTop: '20rpx',
-					// 			width: '610rpx',
-					// 			padding: '10rpx',
-					// 			background: '#d2f8d3',
-					// 			borderRadius: '16rpx',
-					// 			marginLeft: '20rpx',
-					// 			marginRight: '10rpx'
-					// 		},
-					// 		views: [
-					// 			{
-					// 				type: 'text',
-					// 				text: 'hello!你可以帮我做些什么呢?',
-					// 				css: {
-					// 					fontSize: '28rpx',
-					// 					color: '#1A2033',
-					// 					lineHeight: '45rpx',
-					// 					lineClamp: 2,
-					// 					paddingLeft: '10rpx',
-					// 					paddingRight: '10rpx',
-					// 					width: '590rpx'
-					// 				}
-					// 			}
-					// 		]
-					// 	},
-					// 	{
-					// 		type: 'view',
-					// 		css: {
-					// 			marginTop: '20rpx',
-					// 			paddingLeft: '10rpx',
-					// 			display: 'flex'
-					// 		},
-					// 		views: [
-					// 			{
-					// 				type: 'image',
-					// 				src: this.appInfo.page_template == 3?'/static/images/open1.png':'/static/images/open.png',
-					// 				css: {
-					// 					marginTop: '10rpx',
-					// 					marginLeft: '10rpx',
-					// 					borderRadius: '16rpx',
-					// 					width: '80rpx',
-					// 					height: '80rpx',
-					// 					border: '2rpx solid #fff',
-					// 					objectFit: 'cover'
-					// 				}
-					// 			},
-					// 			{
-					// 				type: 'view',
-					// 				css: {
-					// 					marginTop: '10rpx',
-					// 					marginLeft: '20rpx'
-
-					// 				},
-					// 				views: [
-					// 					{
-					// 						type: 'view',
-					// 						views: [
-					// 							{
-					// 								type: 'text',
-					// 								text: this.appInfo.site_name,
-					// 								css: {
-					// 									marginTop: '10rpx',
-					// 									fontSize: '28rpx',
-					// 									fontWeight: 'bold',
-					// 									color: '#1A2033',
-					// 									lineHeight: '28rpx'
-					// 								}
-					// 							}
-					// 						]
-					// 					},
-					// 					{
-					// 						type: 'view',
-					// 						views: [
-					// 							{
-					// 								type: 'text',
-					// 								text: '回答结果',
-					// 								css: {
-					// 									marginTop: '15rpx',
-					// 									fontSize: '22rpx',
-
-					// 									color: '#999',
-					// 									lineHeight: '25rpx'
-					// 								}
-					// 							}
-					// 						]
-					// 					}
-					// 				]
-					// 			}
-					// 		]
-					// 	},
-					// 	{
-					// 		type: 'view',
-					// 		css: {
-					// 			marginTop: '20rpx',
-					// 			width: '610rpx',
-					// 			padding: '10rpx',
-					// 			background: '#f5f6f8',
-					// 			borderRadius: '16rpx',
-					// 			marginLeft: '20rpx',
-					// 			marginRight: '10rpx'
-					// 		},
-					// 		views: [
-					// 			{
-					// 				type: 'text',
-					// 				text: uni.$u.trim(that.posterfff),
-					// 				css: {
-					// 					fontSize: '28rpx',
-					// 					color: '#1A2033',
-					// 					lineHeight: '45rpx',
-					// 					lineClamp: 11,
-					// 					width: '590rpx',
-					// 					padding: '10rpx'
-					// 				}
-					// 			}
-					// 		]
-					// 	},
-					// 	{
-					// 		type: 'view',
-					// 		css: {
-					// 			marginTop: '20rpx',
-					// 			width: '100%',
-					// 			textAlign: 'center'
-					// 		},
-					// #ifdef H5
-					// views: [
-					// 	{
-					// 		type: 'qrcode',
-					// 		text: this.qrcode,
-					// 		css: {
-					// 			width: '200rpx',
-					// 			height: '200rpx'
-					// 		}
-					// 	}
-					// ],
-					// #endif
-					// #ifdef MP-WEIXIN
-					// views: [
-					// 	{
-					// 		type: 'image',
-					// 		src: this.qrcode,
-					// 		css: {
-					// 			width: '200rpx',
-					// 			height: '200rpx'
-					// 		}
-					// 	}
-					// ]
-					// #endif
-					// 	},
-					// 	{
-					// 		type: 'text',
-					// 		text: '————  ' + '长按识别 | 欢迎使用' + '  ————',
-					// 		css: {
-					// 			marginTop: '20rpx',
-					// 			width: '100%',
-					// 			textAlign: 'center',
-					// 			fontSize: '24rpx',
-					// 			color: '#989FB3',
-					// 			lineHeight: '33rpx'
-					// 		}
-					// 	}
-					// ]
 				}),
-				(this.showPoster = true);
+				(
+					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: '海报生成中'
 				});
@@ -760,24 +592,6 @@
 					fileType: 'jpg',
 					quality: 1,
 					success: res => {
-						// this.path = res.tempFilePath;
-						// this.$refs.posterImg.open();
-						// this.show_poster = true;
-
-						// console.log(res.tempFilePath);
-						// 非H5 保存到相册
-						// H5 提示用户长按图另存
-						// #ifdef MP-WEIXIN
-						// uni.saveImageToPhotosAlbum({
-						// 	filePath: res.tempFilePath,
-						// 	success: function() {
-						// 		uni.showToast({
-						// 			title: '保存成功'
-						// 		});
-						// 		that.showPoster = false;
-						// 	}
-						// });
-
 						wx.showShareImageMenu({
 							path: res.tempFilePath
 						})
@@ -818,17 +632,6 @@
 						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
-
-						// console.log(res.data.paid,this.commission_price);
-						// console.log(Number(this.commission_price));
-
-						// if(Number(this.commission_price)>0&&res.data.paid == 0){
-						// 	uni.redirectTo({
-						// 		url:'/pages/user/commission/apply'
-						// 	})
-						// }
-
-						// console.log(res.data.status,that.is_examine);
 						if (res.data.status == 0 && that.is_examine == 1) {
 							uni.showModal({
 								confirmText: '确定',
@@ -964,4 +767,4 @@
 
 <style lang="scss" scoped>
 	@import './index.scss';
-</style>
+</style>