李万涛 1 年之前
父節點
當前提交
6c5f5b7fb4

+ 31 - 3
common/wechat/sdk.js

xqd xqd xqd
@@ -14,11 +14,12 @@ export default {
 	// 鉴权页面
 	initJssdk(callback) {
 		let url = window.location.href.split('#')[0]
-		
+		console.log('url', url);
+
 		http("wechat.wechatJssdk", {
 			uri: url
 		}).then(res => {
-			// console.log(res);
+			console.log(res);
 			jweixin.config({
 				debug: res.data.debug,
 				appId: res.data.appId,
@@ -34,6 +35,33 @@ export default {
 		});
 	},
 
+	// 在需要已授权订阅的页面调用
+	authSubscribe(callback) {
+		this.isWechat() && this.initJssdk(function(res) {
+			jweixin.ready(function() {
+				uni.showToast({
+					title: '1213122425'
+				})
+				// 调用wx.requestSubscribeMessage方法请求用户授权消息订阅
+				jweixin.requestSubscribeMessage({
+					success: function(res) {
+						if (res.subscribe) {
+							// 用户已同意授权消息订阅
+							alert('用户已同意授权消息订阅');
+						} else {
+							// 用户不同意授权消息订阅
+							alert('用户不同意授权消息订阅');
+						}
+					},
+					fail: function(err) {
+						console.log('请求授权消息订阅失败:', err);
+					}
+				});
+			});
+		});
+	},
+
+
 	//在需要定位页面调用
 	getLocation(callback) {
 		this.isWechat() && this.initJssdk(function(res) {
@@ -175,4 +203,4 @@ export default {
 			});
 		});
 	}
-};
+};

+ 30 - 0
pages/haibao.scss

xqd
@@ -0,0 +1,30 @@
+.haibaoBox{	
+		padding-top: 50rpx;	
+		
+		
+	.picBox{
+		display: flex;
+		justify-content: center;
+		.image{
+			width: 60%;
+			height: 500rpx
+		}
+	}
+	
+	.bgList{
+		margin-top: 50rpx;
+		display: flex;
+		// .item{
+			.image2{
+				width: 150rpx;
+				height: 200rpx;
+				
+				margin-right: 10rpx;
+			}
+			
+			.image2_a{
+				border: 4rpx solid #1F79F0;
+			}
+		// }
+	}
+}

+ 74 - 7
pages/haibao.vue

xqd xqd
@@ -1,29 +1,69 @@
 <template>
 	<view>
+		<view style="color: #fff;">
+			<tn-nav-bar :isBack="isBack" backgroundColor="#207cf7" :bottomShadow="false">生成海报</tn-nav-bar>
+			<view :style="{ height: tobheight + 'px' }"></view>
+		</view>
+
+
 		<!-- <u-button type="primary" @click="share_qrcode()">生成海报</u-button> -->
 		<!-- <xq-generate-poster ref="draw" /> -->
-		<XQ-GeneratePoster ref="draw" />
+
+
+		<!-- <button @click="authSub">授权</button> -->
+
+
+		<view class="haibaoBox">
+			<view class="picBox">
+				<!-- <image class="image"
+					src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2F5d88a972-1b34-43ed-8b3a-4a7ebbb900a1%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1709774078&t=fdeadb95e331fcac8780960e7f2e1629">
+				</image> -->
+
+				<XQ-GeneratePoster ref="draw" />
+			</view>
+			<view class="bgList">
+				<!-- <view class="item"> -->
+				<image @click="handleChangeBg(item,index)" class="image2 " :class="[curBgIndex==index?'image2_a':'']"
+					v-for="(item,index) in bgList" :src="item">
+				</image>
+				<!-- </view> -->
+			</view>
+		</view>
+
 	</view>
 </template>
 
 <script>
 	// import XqGeneratePoster from '@/components/XQGeneratePoster.vue';
 	// import XqGeneratePoster from '@/uni_modules/XQ-GeneratePoster/components/XQ-GeneratePoster/XQ-GeneratePoster.vue';
+	import wechat from '@/common/wechat/sdk.js';
 	export default {
 		// components: { XqGeneratePoster },
 		data() {
 			return {
+				tobheight: 45,
+
+				curBgIndex: 0,
+				bgList: [
+					'https://pic1.zhimg.com/80/v2-2714df42147132464a71af391ed04be4_720w.jpg',
+					'https://pic1.zhimg.com/80/v2-2714df42147132464a71af391ed04be4_720w.jpg',
+					'https://pic1.zhimg.com/80/v2-2714df42147132464a71af391ed04be4_720w.jpg',
+					'https://pic1.zhimg.com/80/v2-2714df42147132464a71af391ed04be4_720w.jpg',
+					'https://pic1.zhimg.com/80/v2-2714df42147132464a71af391ed04be4_720w.jpg'
+				],
+
+
 				option: {
 					//绘制海报内容
 					codeUrl: 'https://pic1.zhimg.com/80/v2-2714df42147132464a71af391ed04be4_720w.jpg', //小程序太阳码
-					coverUrl: 'https://pic1.zhimg.com/80/v2-2714df42147132464a71af391ed04be4_720w.jpg', //题库图片
+					picUrl: 'https://pic1.zhimg.com/80/v2-2714df42147132464a71af391ed04be4_720w.jpg', //题库图片
 					headUrl: 'https://pic1.zhimg.com/80/v2-b9df1fdfe67f2177d5c84af90dcadfc1_720w.jpg?source=1940ef5c', //头像
-					bgUrl: 'https://pic3.zhimg.com/v2-8fbde0f9ac6a19a23aa839e73394618a_b.jpg', //图片背景填充,和 fillStyle 只能传一个,bgUrl 优先级高于 fillStyle
+					bgUrl: require('@/static/shareBg.png'), //图片背景填充,和 fillStyle 只能传一个,bgUrl 优先级高于 fillStyle
 					fillStyle: '#0688ff', //纯色背景填充颜色
-					nickName: 'UNDEFINED', //授权登录的用户名
-					miniName: '答题考试助手', //小程序名称
-					tkName: '题库名称题库名称题库名称题库名称题库名称题库名称题库名称题库名称题库名称题库名称题库名称题库名称题库名称题库名称题库名称题库名称题库名称题库名称题库名称题库名称~~', //题库名称
-					tkAuthor: '题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者', //题库作者
+					nickName: 'X艾拉', //授权登录的用户名
+					miniName: '', //小程序名称
+					tkName: '免费体验Al生成个人质感艺术照', //题库名称
+					tkAuthor: '设计微信/抖音/小红书专属头像', //题库作者
 					tkType: '考试', //题库类型
 					cost: '免费', //是否需要收费   免费/付费
 					isPub: '公开' //公开 还是 私有
@@ -35,8 +75,35 @@
 			this.$nextTick(() => {
 				this.share_qrcode()
 			})
+
+			// wechat.authSubscribe()
+
+			// setTimeout(() => {
+			// 	wechat.getLocation(() => {
+
+			// 	})
+			// }, 5000)
+
+
 		},
 		methods: {
+			handleChangeBg(item, index) {
+
+				this.curBgIndex = index
+				console.log('handleChangeBg------------------', item);
+				this.option.bgUrl = item
+				this.share_qrcode()
+			},
+			authSub() {
+				wechat.initJssdk()
+				console.log('weichat---', wechat.authSubscribe);
+				// wechat.authSubscribe((res) => {
+				// 	uni.showToast({
+				// 		title: res
+				// 	})
+				// })
+			},
+
 			share_qrcode() {
 				this.$refs.draw.share_qrcode(this.option);
 			}

+ 9 - 19
pages/index/index.vue

xqd xqd xqd xqd xqd
@@ -1,16 +1,11 @@
 <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>
+				<tn-subsection :current="current" :list="subsectionlist" mode="button" :borderRadius="50"
+					animationType="cubic-bezier" bold :height="90" @change="getsubsection"></tn-subsection>
 			</view>
 
 			<view style="padding: 150rpx 15rpx 30rpx 15rpx;">
@@ -99,8 +94,9 @@
 
 				list: [],
 				drawList: [],
-				subsectionlist: ['StableDiffusion绘图', 'MidJourney绘图'],
-				engine: 'mj',
+				subsectionlist: ['Face', 'MJ绘图', 'SD绘图'],
+				engine: 'rh',
+				current: 0,
 				showskeleton: true,
 
 				showFixInfo: false,
@@ -112,13 +108,8 @@
 
 		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'));
 			}
@@ -126,16 +117,13 @@
 		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() {
@@ -214,8 +202,10 @@
 				});
 			},
 			getsubsection(e) {
-				// console.log(e);
-				this.engine = e.index == 1 ? 'mj' : 'sd'
+				console.log(e.index);
+
+				this.current = e.index
+				this.engine = e.index == 0 ? 'rh' : e.index == 1 ? 'mj' : 'sd'
 				this.drawList = []
 				this.$refs.paging.reload(true);
 			},

+ 0 - 0
pages/index/index2.scss → pages/index/index3.scss


+ 16 - 3
pages/index/index2.vue → pages/index/index3.vue

xqd xqd xqd xqd xqd
@@ -1,8 +1,13 @@
 <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>
@@ -94,7 +99,7 @@
 
 				list: [],
 				drawList: [],
-				subsectionlist: ['艺术照', 'MJ绘图', 'SD绘图'],
+				subsectionlist: ['StableDiffusion绘图', 'MidJourney绘图'],
 				engine: 'mj',
 				showskeleton: true,
 
@@ -107,8 +112,13 @@
 
 		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'));
 			}
@@ -116,13 +126,16 @@
 		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() {
@@ -201,8 +214,8 @@
 				});
 			},
 			getsubsection(e) {
-				console.log(e.index);
-				this.engine = e.index == 0 ? 'ys' : e.index == 1 ? 'mj' : 'sd'
+				// console.log(e);
+				this.engine = e.index == 1 ? 'mj' : 'sd'
 				this.drawList = []
 				this.$refs.paging.reload(true);
 			},

+ 138 - 21
pages/painting/details.vue

xqd xqd xqd xqd xqd xqd xqd xqd
@@ -165,10 +165,22 @@
 				</view>
 			</view>
 		</u-popup>
+
+		<!-- 	<div class="shareBox">
+			shareBox
+		</div> -->
+
+		<XQ-GeneratePoster ref="draw" @genSuc="receiveUrl" />
 	</view>
 </template>
 
 <script>
+	import {
+		mapMutations,
+		mapActions,
+		mapState,
+		mapGetters
+	} from 'vuex';
 	let timingr;
 	let asynchronous;
 	// 判断是否为微信环境
@@ -178,6 +190,27 @@
 	export default {
 		data() {
 			return {
+				option: {
+					//绘制海报内容
+					codeUrl: 'https://pic1.zhimg.com/80/v2-2714df42147132464a71af391ed04be4_720w.jpg', //小程序太阳码
+					picUrl: 'https://pic1.zhimg.com/80/v2-2714df42147132464a71af391ed04be4_720w.jpg', //题库图片
+					headUrl: 'https://pic1.zhimg.com/80/v2-b9df1fdfe67f2177d5c84af90dcadfc1_720w.jpg?source=1940ef5c', //头像
+					bgUrl: require('@/static/shareBg.png'), //图片背景填充,和 fillStyle 只能传一个,bgUrl 优先级高于 fillStyle
+					fillStyle: '#0688ff', //纯色背景填充颜色
+					nickName: 'X艾拉', //授权登录的用户名
+					miniName: '', //小程序名称
+					tkName: '免费体验Al生成个人质感艺术照', //题库名称
+					tkAuthor: '设计微信/抖音/小红书专属头像', //题库作者
+					tkType: '考试', //题库类型
+					cost: '免费', //是否需要收费   免费/付费
+					isPub: '公开' //公开 还是 私有
+				},
+
+
+
+
+				showShare: true,
+
 				tobheight: 45,
 				platform: this.$platform.get(),
 				showdrawing: true,
@@ -206,13 +239,29 @@
 				show: false,
 
 				sd_keywords: '',
+
+				spmplatform: 0,
+
 			}
 		},
+		computed: {
+			...mapGetters(['appInfo', 'homeTemplate', 'isLogin', 'userInfo', 'userData'])
+		},
 		onUnload() {
 			clearTimeout(timingr);
 			clearTimeout(asynchronous);
 		},
+		onShow() {
+			this.option.headUrl = this.userInfo.avatar
+			this.option.nickName = this.userInfo.nickname
+			console.log('this.userInfo-----------------', this.option, this.userInfo);
+		},
 		onLoad(o) {
+			this.spmplatform = ['H5', 'wxOfficialAccount', 'wxMiniProgram', 'App'].indexOf(this.platform) + 1;
+			this.commonqrcodePath()
+
+
+
 			// if (o.keywords) {
 			// 	this.sd_refImg = o.keywords
 			// 	console.log('sd绘画关键词', this.sd_refImg);
@@ -251,6 +300,45 @@
 			// this.sd_keywords = this.form.keywords
 		},
 		methods: {
+			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.option.codeUrl = res.data;
+
+						console.log('二维码地址=============', this.option.codeUrl);
+
+					}
+				});
+			},
+			receiveUrl(e) {
+				// console.log('接收到的海报url------', e);
+				uni.showModal({
+					title: '提示',
+					content: '请查看图片后长按图片保存',
+					confirmText: '查看',
+					confirmColor: '#1F79F0',
+					success: function(res) {
+						if (res.confirm) {
+							uni.previewImage({
+								urls: [e],
+								longPressActions: {
+									itemList: ['发送给朋友', '保存图片', '收藏'],
+									success: function(data) {},
+									fail: function(err) {
+										console.log(err.errMsg);
+									}
+								}
+							});
+						} else if (res.cancel) {
+							console.log('用户点击取消');
+						}
+					}
+				});
+			},
 			preViewImg(type) {
 				if (type == 1) {
 					uni.previewImage({
@@ -328,10 +416,42 @@
 			gallerydetail(id) {
 				let that = this;
 				this.$http('gallery.detail', {
-					id: id
+					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: i,
+									type: 'image',
+									url: res.data.imgs_file[i],
+								}
+								that.swiperList.push(url)
+
+							}
+							this.done = true
+						} else if (this.engin == 'mj') {
+							var url = {
+								id: 0,
+								type: 'image',
+								url: res.data.origin_url,
+							}
+							that.swiperList.push(url)
+							this.done = true
+						} else if (this.engin == 'rh') {
+							var url = {
+								id: 0,
+								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
+						}
+
 						console.log('获取到的图片详情返回值:', res);
 						this.showdrawing = false
 
@@ -386,29 +506,10 @@
 
 
 
-						console.log('创作相似prompt', this.parameter.promptSame);
+						console.log('进入这里了没有', this.parameter.promptSame);
 
 
-						if (this.engin == 'sd') {
-							for (var i = 0; i < res.data.imgs_file.length; i++) {
-								var url = {
-									id: i,
-									type: 'image',
-									url: res.data.imgs_file[i],
-								}
-								that.swiperList.push(url)
 
-							}
-							this.done = true
-						} else {
-							var url = {
-								id: 0,
-								type: 'image',
-								url: res.data.origin_url,
-							}
-							that.swiperList.push(url)
-							this.done = true
-						}
 					} else {
 
 					}
@@ -537,6 +638,12 @@
 			},
 			//下载分享
 			getdownload(index) {
+				this.$nextTick(() => {
+					this.$refs.draw.share_qrcode(this.option);
+				})
+				return
+
+
 				if (this.showdrawing) {
 					uni.showToast({
 						title: '图片生成中',
@@ -705,6 +812,16 @@
 </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%;

+ 141 - 65
pages/painting/draw.scss

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -1,6 +1,14 @@
 // 艺术照部分样式
+::v-deep .u-transition{
+	z-index: 999!important;
+}
+
+
+
+
 
 .conList{
+	padding-left: 28rpx;
 			display: flex;
 			flex-wrap: wrap;
 			// justify-content: space-between;
@@ -52,78 +60,121 @@
 					font-family: PingFang-SC, PingFang-SC;
 					font-weight: 500;
 					color: #333333;
-					margin-top: 24rpx;
+					margin-top: 12rpx;
 				}
 			}
 		}
 
 .ysBox{
 	padding-top: 24rpx;
-	padding-left: 28rpx;
+	// padding-left: 28rpx;
 	padding-right: 28rpx;
 	
-
+padding-bottom: 170rpx;
 	.selBox{
 		// background: red;
 		position: relative;
-		.optDetailBox{
-			position: absolute;
+		.line{
+			border-bottom: 1rpx solid #E7E7E7;
+			width: calc(100% - 28rpx);
+			margin-left: 50%;
+			transform: translateX(-50%);
+			margin-top: 32rpx;
+		}
+		.tipAndUpBox{
+			box-sizing: border-box;
+			// background: red;
+			display: flex;
+			padding-left: 28rpx;
 			
-			top: 126rpx;
-			left: -28rpx;
+			margin-top: 24rpx;
 			
-			height: calc(100vh - 290rpx);
-			width: 100vw;
-			background: rgba(0, 0, 0, .35);
-			z-index: 1;
-			.con{
-				position: absolute;
-				box-sizing: border-box;
-				z-index: 2;
-				width:100%;
-				min-height: 112rpx;
-				background: #FFFFFF;
-				border-radius:  0rpx 0rpx 32rpx 32rpx;
-				padding: 32rpx 30rpx;
+			.left{
+				font-size: 28rpx;
+				font-family: PingFang-SC, PingFang-SC;
+				font-weight: 500;
+				color: #333333;
 				
-				// margin-top: 48rpx;
+				width: 256rpx;
 				
+				padding-top: 20rpx;
 				
-				.optList{
+				.item{
+					margin-bottom: 32rpx;
 					display: flex;
-					flex-wrap: wrap;
+					align-items: center;
+					img{
+						width: 32rpx;
+						height: 32rpx;
+						margin-right: 12rpx;
+					}
+				}
+			}
+		}
+		.addPo{
+			position: relative;
+			.optDetailBox{
+				position: absolute;
+				
+				top: 0rpx;
+				left: 0rpx;
+				
+				height: calc(100vh);
+				width: 100vw;
+				background: rgba(0, 0, 0, .35);
+				z-index:9999;
+				
+				.con{
+					position: absolute;
+					box-sizing: border-box;
+					z-index: 2;
+					width:100%;
+					min-height: 112rpx;
+					background: #FFFFFF;
+					border-radius:  0rpx 0rpx 32rpx 32rpx;
+					padding: 32rpx 30rpx;
 					
-					.item{
-						width: 144rpx;
-						height: 48rpx;
-						background: #F4F4F4;
-						border-radius: 31rpx;
-						
-						margin-right: 24rpx;
-						
+					// margin-top: 48rpx;
+					
+					// background: red;
+					.optList{
 						display: flex;
-						justify-content: center;
-						align-items: center;
+						flex-wrap: wrap;
 						
-						font-size: 24rpx;
-						font-family: PingFang-SC, PingFang-SC;
-						font-weight: 500;
-						color: #333333;
-						
-						margin-bottom: 24rpx;
-					}
-					.item_a{
-						border: 2rpx solid #333333;
+						.item{
+							width: 144rpx;
+							height: 48rpx;
+							background: #F4F4F4;
+							border-radius: 31rpx;
+							
+							margin-right: 24rpx;
+							
+							display: flex;
+							justify-content: center;
+							align-items: center;
+							
+							font-size: 24rpx;
+							font-family: PingFang-SC, PingFang-SC;
+							font-weight: 500;
+							color: #333333;
+							
+							margin-bottom: 24rpx;
+						}
+						.item_a{
+							border: 2rpx solid #333333;
+						}
 					}
 				}
 			}
 		}
+		
 		.title{
 			font-size: 30rpx;
 			font-family: PingFang-SC, PingFang-SC;
 			font-weight: 800;
 			color: #333333;
 			margin-bottom: 24rpx;
+			padding-left: 28rpx;
 		}
 		.selList{
 			margin-bottom: 24rpx;
@@ -135,9 +186,15 @@
 			width: 100%;
 			overflow-y: hidden;
 			overflow-x: scroll;
+			padding-left: 28rpx;
 			
 			// z-index: 3;
 			
+			.item_a{
+				background: #DCEAFD!important;
+				color:#1F79F0;
+			}
+			
 			.item{
 				// width: 200rpx;
 				height: 62rpx;
@@ -158,22 +215,24 @@
 				}
 			}
 		}
-		
-		.moreBtn{
-			height: 76rpx;
-			background: #D6E7FE;
-			border-radius: 38rpx;
-			
-			display: flex;
-			align-items: center;
-			justify-content: center;
-			
-			font-size: 28rpx;
-			font-family: PingFang-SC, PingFang-SC;
-			font-weight: bold;
-			color: #1F79F0;
+		.addLpd{
+			padding-left: 28rpx;
+			.moreBtn{
+				height: 76rpx;
+				background: #D6E7FE;
+				border-radius: 38rpx;
+				
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				
+				font-size: 28rpx;
+				font-family: PingFang-SC, PingFang-SC;
+				font-weight: bold;
+				color: #1F79F0;
+			}
+				
 		}
-	
 	}
 	.upTitle{
 			font-size: 30rpx;
@@ -181,22 +240,26 @@
 			font-weight: 800;
 			color: #333333;
 			
-			margin-top: 64rpx;
+			margin-top:64rpx;
+			padding-left: 28rpx;
 		}
 		.upList{
 			display: flex;
 			align-items: center;
-			margin-top: 24rpx;
+			// margin-top: 24rpx;
+			// padding-left: 28rpx;
 			
 			.upBox{
 				display: flex;
 				flex-direction: column;
 				align-items: center;
 				justify-content: center;
-				margin-right: 18rpx;
+				margin-right: 32rpx;
+				width: 212rpx;
+				height: 330rpx;
 				.up{
-					width: 160rpx;
-					height: 212rpx;
+					width: 100%;
+					height: 100%;
 					background: #F4F4F4;
 					border-radius: 20rpx;
 					
@@ -210,6 +273,10 @@
 					font-weight: 500;
 					color: #999999;
 					
+					span{
+						text-align: center;
+					}
+					
 					.loading{
 						position: absolute;
 						z-index: 9;
@@ -266,7 +333,7 @@
 		}
 		.tipBox{
 			display: flex;
-			align-items: center;
+			align-items: flex-start;
 			
 			font-size: 24rpx;
 			font-family: PingFang-SC, PingFang-SC;
@@ -274,10 +341,15 @@
 			color: #999999;
 			
 			margin-top: 32rpx;
+			
+			padding-left: 28rpx;
+			
+			margin-bottom: 64rpx;
 			img{
 				width: 28rpx;
 				height: 28rpx;
 				margin-right: 8rpx;
+				margin-top: 6rpx;
 			}
 		}
 		.ysBtn{
@@ -326,6 +398,7 @@
 			font-family: PingFang-SC, PingFang-SC;
 			font-weight: 500;
 			color: #999999;
+			
 		}
 	}
 	.conList{
@@ -340,11 +413,14 @@
 			.name{
 				margin-top: 0;
 			}
-			
 		}
-		
 	}
 	
+	// .dygbhg{
+	// 	position: fixed!important;
+	// 	left: 0!important;
+	// }
+	
 	.btnBox{
 		display: flex;
 		justify-content: space-between;

+ 233 - 83
pages/painting/draw.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -35,41 +35,51 @@
 						{{item}}
 						<img src="@/static/arrD.png" alt="" class="arrD" />
 					</div>
+
+					<div class="item" v-for="(item,index) in sexList" @click.stop="handleSelSex(item,index)"
+						:class="[item==seledSex?'item_a':'']">
+						{{item}}
+					</div>
 				</div>
-				<div class="optDetailBox" v-if="showRule" @click.stop="closeOver">
-					<div class="con" @click.stop="">
-						<div class="optList" @click.stop="">
-							<div class="item" @click.stop="handleOrder(item,index)" v-for="(item,index) in rules"
-								:class="[item==seledRule?'item_a':'']">
-								{{item}}
+				<div class="addPo">
+					<div class="optDetailBox" v-if="showRule" @click.stop="closeOver">
+						<div class="con" @click.stop="">
+							<div class="optList" @click.stop="">
+								<div class="item" @click.stop="handleOrder(item,index)" v-for="(item,index) in rules"
+									:class="[item==seledRule?'item_a':'']">
+									{{item}}
+								</div>
 							</div>
 						</div>
 					</div>
-				</div>
-				<div class="optDetailBox" v-if="showThem" @click.stop="closeOver">
-					<div class="con" @click.stop="">
-						<div class="optList" @click.stop="">
-							<div class="item" @click.stop="handleSelStyle(item)" v-for="(item,index) in styles"
-								:class="[item.id==seledStyle.id?'item_a':'']">
-								{{item.title}}
+					<div class="optDetailBox" v-if="showThem" @click.stop="closeOver">
+						<div class="con" @click.stop="">
+							<div class="optList" @click.stop="">
+								<div class="item" @click.stop="handleSelStyle(item)" v-for="(item,index) in styles"
+									:class="[item.id==seledStyle.id?'item_a':'']">
+									{{item.title}}
+								</div>
 							</div>
 						</div>
 					</div>
-				</div>
-				<div class="optDetailBox" v-if="showAvail" @click.stop="closeOver">
-					<div class="con" @click.stop="">
-						<div class="optList" @click.stop="">
-							<div class="item" @click.stop="seledAvail=item" v-for="(item,index) in availables"
-								:class="[item==seledAvail?'item_a':'']">
-								{{item}}
+
+
+					<!-- 	<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"
+									:class="[item==seledSex?'item_a':'']">
+									{{item}}
+								</div>
 							</div>
 						</div>
-					</div>
+					</div> -->
 				</div>
 
+
 				<div class="conList">
 					<div class="item" v-for="(item,index) in cankaoImgList.slice(0,8)"
-						@click="seledCankaoImg=item;seledCankaoImg_temp=item;myModal=item.path;">
+						@click="handleSelModal(item,index)">
 						<div class="top" :class="[item.id==seledCankaoImg.id?'item_a':'']"
 							:style="{backgroundImage:`url(${item.path})`}">
 							<img v-if="item.id==seledCankaoImg.id" src="@/static/b_seled.png" alt="" class="tag" />
@@ -80,58 +90,82 @@
 					</div>
 				</div>
 
-				<div class="moreBtn" @click="handleMorePopup">
-					更多
+				<div class="addLpd">
+					<div class="moreBtn" @click="handleMorePopup">
+						更多
+					</div>
 				</div>
 
-
 				<div class="upTitle">
 					上传图片
 				</div>
-				<div class="upList">
-					<div class="upBox">
-						<div class="up1 up " @click.stop="upYsImg(0)" :class="[myModal?'up_a':'']"
-							:style="{'background-image':`url(${myModal})`}">
-							<span v-if="!myModal&&!showUpLoading1">上传模板图</span>
-							<img src="@/static/b_camera.png" alt="" class="camera" />
-
-							<div v-if="myModal" class="del" @click.stop="myModal='';">
-								<u-icon name="trash" @click.stop="myModal='';" color="#1F79F0" size="20"></u-icon>
-							</div>
-							<u-loading-icon v-if="showUpLoading1" class="loading" text='' textSize="18" mode="circle"
-								vertical duration="1000"></u-loading-icon>
-						</div>
-						<div class="des">
-							上传模板图
+
+				<div class="tipAndUpBox">
+					<div class="left">
+						<div class="item" v-for="(item,index) in tipList">
+							<img src="@/static/renx.png" alt="" />
+							{{item}}
 						</div>
 					</div>
+					<div class="upList">
+						<div class="upBox">
+							<div class="up1 up " @click.stop="upYsImg(0)" :class="[myModal?'up_a':'']"
+								:style="{'background-image':`url(${myModal})`}">
+								<span v-if="!myModal&&!showUpLoading1">点击<br>上传模板</span>
+								<img src="@/static/b_camera.png" alt="" class="camera" />
+
+								<div v-if="myModal" class="del" @click.stop="myModal='';">
+									<u-icon name="trash" @click.stop="myModal='';" color="#1F79F0" size="20"></u-icon>
+								</div>
+								<u-loading-icon v-if="showUpLoading1" class="loading" text='' textSize="18"
+									mode="circle" vertical duration="1000"></u-loading-icon>
+							</div>
+							<div class="des">
+								上传模板
+							</div>
+						</div>
 
-					<div class="upBox">
-						<div class="up2 up" :class="[myPhoto?'up_a':'']" :style="{'background-image':`url(${myPhoto})`}"
-							@click.stop="upYsImg(1)">
-							<span v-if="!myPhoto&&!showUpLoading2">上传照片</span>
-							<img src="@/static/b_camera.png" alt="" class="camera" />
+						<div class="upBox">
+							<div class="up2 up" :class="[myPhoto?'up_a':'']"
+								:style="{'background-image':`url(${myPhoto})`}" @click.stop="upYsImg(1)">
+								<span v-if="!myPhoto&&!showUpLoading2">点击<br>上传照片</span>
+								<img src="@/static/b_camera.png" alt="" class="camera" />
 
-							<div v-if="myPhoto" class="del" @click.stop="myPhoto=''">
-								<u-icon @click.stop="myPhoto=''" name="trash" color="#1F79F0" size="20"></u-icon>
-							</div>
+								<div v-if="myPhoto" class="del" @click.stop="myPhoto=''">
+									<u-icon @click.stop="myPhoto=''" name="trash" color="#1F79F0" size="20"></u-icon>
+								</div>
 
-							<u-loading-icon v-if="showUpLoading2" class="loading" text='' textSize="18" mode="circle"
-								vertical duration="1000"></u-loading-icon>
-						</div>
-						<div class="des">
-							上传照片
+								<u-loading-icon v-if="showUpLoading2" class="loading" text='' textSize="18"
+									mode="circle" vertical duration="1000"></u-loading-icon>
+							</div>
+							<div class="des">
+								上传照片
+							</div>
 						</div>
 					</div>
+
 				</div>
+				<div class="line"></div>
+
 				<div class="tipBox">
 					<img src="@/static/b_info.png" alt="" />
-					模板可直接选择上面的现成模板,可点击自己上传
+					模板可直接选择上面的现成模板,可点击自己上传<br>
+					仅支持JPG/PNG格式,大小5M以下
 				</div>
 
-				<div class="ysBtn" @click="genYishuZhao">
+
+
+				<!-- <div class="ysBtn" @click="genYishuZhao">
 					生成艺术照
-				</div>
+				</div> -->
+				<view class="dygbhg">
+					<navigator class="whole" open-type="navigateBack">退出</navigator>
+
+					<view @click="genYishuZhao" class="distinguish">生成艺术照 |
+						<!-- 需要消耗{{ plan.unlock_aipainting*form.samples}}{{appInfo.number_alias ? appInfo.number_alias : '点数'}} -->
+						需要消耗1{{appInfo.number_alias ? appInfo.number_alias : '点数'}}
+					</view>
+				</view>
 			</div>
 		</view>
 
@@ -351,7 +385,7 @@
 					<span>选择后直接作为生成照片参照</span>
 				</div>
 				<div class="conList">
-					<div class="item" v-for="(item,index) in cankaoImgList" @click="seledCankaoImg_temp=item">
+					<div class="item" v-for="(item,index) in cankaoImgList" @click="handleSelMoreModal(item,index)">
 						<div class="top" :class="[item.id==seledCankaoImg_temp.id?'item_a':'']"
 							:style="{backgroundImage:`url(${item.path})`}">
 							<img v-if="item.id==seledCankaoImg_temp.id" src="@/static/b_seled.png" alt="" class="tag" />
@@ -398,6 +432,8 @@
 		data() {
 			return {
 				// 艺术照
+				tipList: ['五官清晰', '人像证明', '人脸无遮挡', '照片清晰'],
+
 				showUpLoading1: false,
 				showUpLoading2: false,
 				// modal: '',
@@ -407,7 +443,13 @@
 				selOptList: [
 					'排序规则',
 					'主题风格',
-					// '是否可用',
+					// '性别',
+				],
+
+				sexList: [
+					'男',
+					'女',
+					'全部'
 				],
 
 				cankaoImgList: [],
@@ -427,15 +469,11 @@
 				],
 				seledStyle: '国风',
 
-				availables: [
-					'是',
-					'否',
-				],
-				seledAvail: '是',
+				seledSex: '是',
 
 				showRule: false,
 				showThem: false,
-				showAvail: false,
+				showSex: false,
 
 				showMorePopup: false,
 
@@ -523,7 +561,7 @@
 				noticebar: ['精美图片需要时间打磨,预计20秒-120秒出图',
 					// '图片生成中请不要退出,否则可能会生成失败'
 				],
-				tabslist: ['艺术照', 'MJ绘图', 'SD绘图'],
+				tabslist: ['Face', 'MJ绘图', 'SD绘图'],
 				curNow: 0,
 				cardswiper: [
 					'https://cos.iseeds.xyz/cover/3.0-1.jpg',
@@ -543,6 +581,7 @@
 
 			console.log('isLogin================', this.isLogin);
 			this.getTempLiast({
+				sex: 1,
 				init: true
 			})
 
@@ -635,12 +674,53 @@
 			handleOrder(item, index) {
 				this.seledRule = item
 				this.showRule = false
-				this.getTempLiast({
-					init: false,
-					order: index
-				})
+
+				let p = {
+					order: this.seledRule == '降序' ? 0 : 1,
+					init: false
+				}
+				if (this.seledStyle.id != -1) {
+					p['styleId'] = this.seledStyle.id
+				}
+				if (this.seledSex != '全部') {
+					p['sex'] = this.seledSex == '男' ? 0 : 1
+				}
+				this.getTempLiast(p)
+			},
+			handleSelStyle(item) {
+				this.seledStyle = item
+				this.showThem = false
+
+				let p = {
+					order: this.seledRule == '降序' ? 0 : 1,
+					init: false
+				}
+				if (this.seledStyle.id != -1) {
+					p['styleId'] = this.seledStyle.id
+				}
+				if (this.seledSex != '全部') {
+					p['sex'] = this.seledSex == '男' ? 0 : 1
+				}
+				this.getTempLiast(p)
+			},
+			handleSelSex(item, index) {
+				this.seledSex = item
+				this.showSex = false
+
+				let p = {
+					order: this.seledRule == '降序' ? 0 : 1,
+					init: false
+				}
+				if (this.seledStyle.id != -1) {
+					p['styleId'] = this.seledStyle.id
+				}
+				if (this.seledSex != '全部') {
+					p['sex'] = this.seledSex == '男' ? 0 : 1
+				}
+				this.getTempLiast(p)
 			},
 			async getTempLiast(p = {}) {
+				console.log('getTempLiast----参数', p);
 				uni.showLoading({
 					title: '模板加载中...'
 				})
@@ -648,9 +728,16 @@
 
 				if (res.code == 0) {
 					this.cankaoImgList = res.msg.data
-					this.styles = res.msg.style
+					this.styles = [...res.msg.style, {
+						id: -1,
+						title: '全部'
+					}]
 					if (p.init) {
-						this.seledStyle = res.msg.style[0]
+						this.seledStyle = {
+							id: -1,
+							title: '全部'
+						}
+						this.seledSex = '女'
 					}
 					this.seledCankaoImg = this.cankaoImgList[0]
 					this.seledCankaoImg_temp = this.cankaoImgList[0]
@@ -660,14 +747,46 @@
 					console.log('艺术照模板列表返回值---', this.cankaoImgList, res);
 				}
 			},
-			handleSelStyle(item) {
-				this.seledStyle = item
-				this.showThem = false
-				this.getTempLiast({
-					styleId: item.id,
-					init: false
-				})
+			handleSelModal(item, index) {
+				this.seledCankaoImg = item;
+				this.myModal = item.path;
+				if (this.seledCankaoImg_temp.id == item.id) {
+					uni.previewImage({
+						urls: [item.path],
+						longPressActions: {
+							itemList: ['发送给朋友', '保存图片', '收藏'],
+							success: function(data) {
+								console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
+							},
+							fail: function(err) {
+								console.log(err.errMsg);
+							}
+						}
+					});
+				}
+				this.seledCankaoImg_temp = item;
 			},
+
+			handleSelMoreModal(item, index) {
+				if (this.seledCankaoImg_temp.id == item.id) {
+					uni.previewImage({
+						urls: [item.path],
+						longPressActions: {
+							itemList: ['发送给朋友', '保存图片', '收藏'],
+							success: function(data) {
+								console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
+							},
+							fail: function(err) {
+								console.log(err.errMsg);
+							}
+						}
+					});
+				}
+				this.seledCankaoImg_temp = item
+			},
+
+
+
 			async genYishuZhao() {
 				if (!this.myModal) {
 					return uni.showToast({
@@ -716,6 +835,37 @@
 				console.log('生成艺术照参数', p);
 			},
 			upYsImg(type) {
+				if (type == 0 && this.myModal) {
+					return uni.previewImage({
+						urls: [this.myModal],
+						longPressActions: {
+							itemList: ['发送给朋友', '保存图片', '收藏'],
+							success: function(data) {
+								console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
+							},
+							fail: function(err) {
+								console.log(err.errMsg);
+							}
+						}
+					});
+				}
+				if (type == 1 && this.myPhoto) {
+					return uni.previewImage({
+						urls: [this.myPhoto],
+						longPressActions: {
+							itemList: ['发送给朋友', '保存图片', '收藏'],
+							success: function(data) {
+								console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
+							},
+							fail: function(err) {
+								console.log(err.errMsg);
+							}
+						}
+					});
+				}
+
+
+
 				let that = this;
 				uni.chooseImage({
 					count: 1,
@@ -786,24 +936,24 @@
 			closeOver() {
 				this.showRule = false
 				this.showThem = false
-				this.showAvail = false
+				this.showSex = false
 			},
 			handleOpenOpt(index) {
 				if (index == 0) {
 					this.showRule = !this.showRule
 					this.showThem = false
-					this.showAvail = false
+					this.showSex = false
 
 				} else if (index == 1) {
 					this.showRule = false
 					this.showThem = !this.showThem
-					this.showAvail = false
+					this.showSex = false
 				} else if (index == 2) {
 					this.showRule = false
 					this.showThem = false
-					this.showAvail = !this.showAvail
+					this.showSex = !this.showSex
 				}
-				console.log('index============', index, this.showRule, this.showThem, this.showAvail);
+				console.log('index============', index, this.showRule, this.showThem, this.showSex);
 			},
 			nextLead() {
 				this.showLead1 = false

+ 56 - 10
pages/painting/ys.vue

xqd xqd xqd xqd xqd xqd xqd
@@ -52,13 +52,7 @@
 				<view class="">下载/分享</view>
 			</view>
 
-			<!-- 	<view class="action" @click="parameters">
-				<view class="bar-icon">
-					<view class="tn-icon-creative">
-					</view>
-				</view>
-				<view class="">绘画参数</view>
-			</view> -->
+
 
 
 			<view class="action" @click="preViewImg(1)" v-if="true">
@@ -66,7 +60,7 @@
 					<view class="tn-icon-image">
 					</view>
 				</view>
-				<view class="">上传模板</view>
+				<view class="">模板</view>
 			</view>
 
 			<view class="action" @click="preViewImg(2)" v-if="true
@@ -75,8 +69,16 @@
 					<view class="tn-icon-image">
 					</view>
 				</view>
-				<view class="">上传照片</view>
+				<view class="">照片</view>
 			</view>
+
+			<!-- 	<view class="action" @click="public">
+				<view class="bar-icon">
+					<view class="tn-icon-up-circle">
+					</view>
+				</view>
+				<view class="">{{showopen?'已公开':'公开作品'}}</view>
+			</view> -->
 		</view>
 
 	</view>
@@ -98,6 +100,8 @@
 		components: {},
 		data() {
 			return {
+				showopen: false,
+
 				showdrawing: true,
 				drawingtitle: '正在努力绘制中...',
 				showprogress: false,
@@ -129,7 +133,9 @@
 				show: false,
 
 				sd_keywords: '',
-				timer: null
+				timer: null,
+
+				faceId: -1
 			}
 		},
 		async onLoad(o) {
@@ -170,6 +176,45 @@
 		},
 
 		methods: {
+			async public() {
+				var that = this;
+				if (this.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.faceId
+							}).then(res => {
+								if (res.code == 0) {
+									uni.showToast({
+										title: '提交成功,等待审核'
+									})
+									that.showopen = true
+								}
+							});
+						}
+					}
+				});
+			},
+
 			async getGenStatus(p) {
 				let res = await this.$http('ys.checkDescribe', p)
 
@@ -183,6 +228,7 @@
 						this.showdrawing = false
 						clearInterval(this.timer)
 						this.swiperList = [res.msg.build_url]
+						this.faceId = res.msg.id
 						console.log('this.swiperList--------------', this.swiperList);
 					} else if (res.msg.state == 2) {
 						clearInterval(this.timer)

+ 0 - 11
pages/user/draw/draw.vue

xqd
@@ -25,17 +25,6 @@
 							</view>
 						</view>
 
-
-
-						<!-- <view v-else class="draw_done u-flex align-center justify-center">
-							<block v-if="item.done == 1">
-								{{item.status == 0?'图片正在审核中...':item.status == 2?'图片审核不通过':'图片审核通过'}}
-							</block>
-							<block v-else>
-								{{item.done == 0?'图片正在生成中...':item.done == 2?'图片生成失败':'图片生成成功'}}
-							</block>
-						</view> -->
-
 						<!-- 只显示生成成功的绘画记录 -->
 						<view class="" v-if="item.status">
 							<view class="prompt"><u-parse :content="item.prompt|filterPro(item.prompt)"

二進制
static/renx.png


二進制
static/shareBg.png


+ 93 - 59
uni_modules/XQ-GeneratePoster/components/XQ-GeneratePoster/XQ-GeneratePoster.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -1,22 +1,18 @@
 <template>
-	<view class="content">
-		<!-- <u-mask :show="share_qrcode_flag" :zoom="false" :custom-style="{ background: 'rgba(0,0,0,.8)' }" :duration="0"> -->
+	<!-- 		<view class="content">
 		<view class="sq_box">
 			<view class="tz_box qrcode_box">
 				<view class="close_box" @click="share_qrcode_flag = false"><u-icon name="close"
 						color="#ffffff"></u-icon></view>
-				<view class="share_qrcode">
-					<canvas canvas-id="myCanvas"
-						style="width: 600px;height:1040px; position: fixed;top: -10000px;"></canvas>
-					<image @longpress="showSaveImgWin = true" style="width: 100%; height: 100%;"
+				<view class="share_qrcode"> -->
+	<canvas canvas-id="myCanvas" style="width: 347px;height:574px; position: fixed;top: -10000px;"></canvas>
+	<!-- <image @longpress="showSaveImgWin = true" style="width:347px; height: 574px;"
 						:src="canvasToTempFilePath"></image>
 				</view>
 			</view>
 		</view>
-		<!-- </u-mask> -->
-
 		<u-modal v-model="showSaveImgWin" content="确定要保存图片吗" @confirm="saveShareImg(canvasToTempFilePath)"
-			@cancel="showSaveImgWin = false" :show-cancel-button="true"></u-modal>
+			@cancel="showSaveImgWin = false" :show-cancel-button="true"></u-modal> -->
 	</view>
 </template>
 
@@ -36,12 +32,13 @@
 
 		methods: {
 			share_qrcode(option) {
-				if (option) {
-					if (!this.canvasToTempFilePath) {
-						this.createCanvasImage(option);
-					}
-					this.share_qrcode_flag = true;
-				}
+				this.createCanvasImage(option);
+				// if (option) {
+				// 	if (!this.canvasToTempFilePath) {
+				// 		this.createCanvasImage(option);
+				// 	}
+				// 	this.share_qrcode_flag = true;
+				// }
 			},
 
 			//获取图片信息
@@ -64,13 +61,15 @@
 			},
 			// 生成海报
 			async createCanvasImage(option) {
+				let _this = this
 				// 点击生成海报数据埋点
 				if (!this.ctx) {
 					uni.showLoading({
 						title: '生成中...'
 					});
+
 					let code = this.downloadFileImg(option.codeUrl);
-					let cover = this.downloadFileImg(option.coverUrl);
+					let cover = this.downloadFileImg(option.picUrl);
 					let headImg = this.downloadFileImg(option.headUrl);
 					let bgUrl = '';
 					if (option.bgUrl) {
@@ -92,29 +91,36 @@
 					}
 					Promise.all([headImg, code, cover, bgUrl]).then(result => {
 						const ctx = uni.createCanvasContext('myCanvas', this);
-						let canvasWidthPx = 640 * this.ratio,
-							canvasHeightPx = 1040 * this.ratio,
-							avatarurl_width = 120, //绘制的头像宽度
-							avatarurl_heigth = 120, //绘制的头像高度
-							avatarurl_x = 40, //绘制的头像在画布上的位置
-							avatarurl_y = 28, //绘制的头像在画布上的位置
-							codeurl_width = 180, //绘制的二维码宽度
-							codeurl_heigth = 180, //绘制的二维码高度
-							codeurl_x = 70, //绘制的二维码在画布上的位置
-							codeurl_y = 800, //绘制的二维码在画布上的位置
-							coverurl_width = 610, //绘制的封面宽度
-							coverurl_heigth = 350, //绘制的封面高度
-							coverurl_x = 40, //绘制的封面在画布上的位置
-							coverurl_y = 190; //绘制的封面在画布上的位置
+						let canvasWidthPx = 347 * this.ratio,
+							canvasHeightPx = 574 * this.ratio,
+
+
+							avatarurl_width = 47, //绘制的头像宽度
+							avatarurl_heigth = 47, //绘制的头像高度
+
+
+							avatarurl_x = 12, //绘制的头像在画布上的位置
+							avatarurl_y = 455, //绘制的头像在画布上的位置
+							codeurl_width = 52, //绘制的二维码宽度
+							codeurl_heigth = 52, //绘制的二维码高度
+							codeurl_x = 278, //绘制的二维码在画布上的位置
+							codeurl_y = 495, //绘制的二维码在画布上的位置
+
+
+							picUrl_width = 327, //绘制的主图宽度
+							picUrl_heigth = 433, //绘制的主图高度
+							picUrl_x = 10, //绘制的主图在画布上的位置
+							picUrl_y = 10; //绘制的主图在画布上的位置
 
 						if (option.bgUrl) {
-							ctx.drawImage(result[3], 0, 0, 690, 1040); // 背景图片需要本地
+							ctx.drawImage(result[3], 0, 0, 347, 574); // 背景图片需要本地
+
 						} else {
 							//绘制圆角矩形
 							ctx.save();
 							ctx.translate(0, 0);
 							//绘制圆角矩形的各个边
-							this.drawRoundRectPath(ctx, 690, 1040, 14);
+							this.drawRoundRectPath(ctx, 347, 574, 14);
 							ctx.fillStyle = option.fillStyle || '#0688ff'; //若是给定了值就用给定的值否则给予默认值
 							ctx.fill();
 							ctx.restore();
@@ -136,15 +142,15 @@
 						ctx.restore(); //恢复之前保存的绘图上下文状态 可以继续绘制
 
 						ctx.font = 'normal bold 45px sans-serif';
-						ctx.setFillStyle('#ffffff'); // 文字颜色
+						ctx.setFillStyle('#333'); // 文字颜色
 						if (option.nickName) {
 							this.dealWords({
 								ctx: ctx, //画布上下文
-								fontSize: 45, //字体大小
+								fontSize: 14, //字体大小
 								word: option.nickName, //需要处理的文字
 								maxWidth: 480, //一行文字最大宽度
-								x: 190, //文字在x轴要显示的位置
-								y: 40, //文字在y轴要显示的位置
+								x: 69, //文字在x轴要显示的位置
+								y: 445, //文字在y轴要显示的位置
 								maxLine: 1 //文字最多显示的行数
 							});
 						}
@@ -152,18 +158,30 @@
 						ctx.setFontSize(30); // 文字字号
 						ctx.fillText(option.miniName, 190, 130); // 绘制文字
 
-						ctx.setFillStyle('#222222');
-						// if (option.tkName) {
-						// 	this.dealWords({
-						// 		ctx: ctx, //画布上下文
-						// 		fontSize: 32, //字体大小
-						// 		word: option.tkName, //需要处理的文字
-						// 		maxWidth: 610, //一行文字最大宽度
-						// 		x: 40, //文字在x轴要显示的位置
-						// 		y: 550, //文字在y轴要显示的位置
-						// 		maxLine: 2 //文字最多显示的行数
-						// 	});
-						// }
+						ctx.setFillStyle('#333');
+						if (option.tkName) {
+							this.dealWords({
+								ctx: ctx, //画布上下文
+								fontSize: 14, //字体大小
+								word: option.tkName, //需要处理的文字
+								maxWidth: 220, //一行文字最大宽度
+								x: 12, //文字在x轴要显示的位置
+								y: 490, //文字在y轴要显示的位置
+								maxLine: 2 //文字最多显示的行数
+							});
+						}
+
+						if (option.tkAuthor) {
+							this.dealWords({
+								ctx: ctx, //画布上下文
+								fontSize: 14, //字体大小
+								word: option.tkAuthor, //需要处理的文字
+								maxWidth: 220, //一行文字最大宽度
+								x: 12, //文字在x轴要显示的位置
+								y: 510, //文字在y轴要显示的位置
+								maxLine: 2 //文字最多显示的行数
+							});
+						}
 
 						// ctx.font = 'normal normal 26px sans-serif';
 						// ctx.setFillStyle('#555555'); // 文字颜色
@@ -232,19 +250,31 @@
 						// ctx.setFillStyle('#222222'); // 文字颜色
 						// ctx.fillText('查看题库详细信息', 300, 920); // 绘制孩子百分比
 
-						// ctx.drawImage(result[2], coverurl_x, coverurl_y, coverurl_width,
-						// 	coverurl_heigth); // 绘制封面
-						// ctx.drawImage(result[1], codeurl_x, codeurl_y, codeurl_width, codeurl_heigth); // 绘制头像
+						ctx.drawImage(result[2], picUrl_x, picUrl_y, picUrl_width,
+							picUrl_heigth); // 绘制封面
+
+						ctx.drawImage(result[1], codeurl_x, codeurl_y, codeurl_width,
+							codeurl_heigth); // 绘制二维码
+						// ctx.drawImage(result[1], codeurl_x, codeurl_y, codeurl_width, codeurl_heigth); // 绘制二维码
 						ctx.draw(false, () => {
 							// canvas画布转成图片并返回图片地址
 							uni.canvasToTempFilePath({
 									canvasId: 'myCanvas',
-									width: 690,
-									height: 1040,
-									destWidth: 690,
-									destHeight: 1040,
+									quality: 1,
+									width: 347,
+									height: 574,
+									// destWidth: 347,
+									// destHeight: 574,
 									success: res => {
 										this.canvasToTempFilePath = res.tempFilePath;
+
+										// console.log(
+										// 	"this.$emit('receiveUrl', res.tempFilePath)",
+										// 	this.canvasToTempFilePath);
+
+										this.$emit('genSuc', this.canvasToTempFilePath)
+
+
 										this.showShareImg = true;
 										uni.showToast({
 											title: '绘制成功'
@@ -297,8 +327,10 @@
 			//处理文字多出省略号显示
 			dealWords(options) {
 				options.ctx.setFontSize(options.fontSize); //设置字体大小
-				let allRow = Math.ceil(options.ctx.measureText(options.word).width / options.maxWidth); //实际总共能分多少行
-				let count = allRow >= options.maxLine ? options.maxLine : allRow; //实际能分多少行与设置的最大显示行数比,谁小就用谁做循环次数
+				let allRow = Math.ceil(options.ctx.measureText(options.word).width / options
+					.maxWidth); //实际总共能分多少行
+				let count = allRow >= options.maxLine ? options.maxLine :
+					allRow; //实际能分多少行与设置的最大显示行数比,谁小就用谁做循环次数
 				let endPos = 0; //当前字符串的截断点
 				for (let j = 0; j < count; j++) {
 					let nowStr = options.word.slice(endPos); //当前剩余的字符串
@@ -310,10 +342,12 @@
 							if (rowWid > options.maxWidth) {
 								if (j === options.maxLine - 1) {
 									//如果是最后一行
-									options.ctx.fillText(nowStr.slice(0, m - 1) + '...', options.x, options.y + (j + 1) *
+									options.ctx.fillText(nowStr.slice(0, m - 1) + '...', options.x, options.y +
+										(j + 1) *
 										40); //(j+1)*18这是每一行的高度
 								} else {
-									options.ctx.fillText(nowStr.slice(0, m), options.x, options.y + (j + 1) * 40);
+									options.ctx.fillText(nowStr.slice(0, m), options.x, options.y + (j + 1) *
+										40);
 								}
 								endPos += m; //下次截断点
 								break;

+ 6 - 6
uni_modules/XQ-GeneratePoster/components/XQ-GeneratePoster/index.scss

xqd xqd xqd
@@ -1,10 +1,10 @@
 .sq_box {
 		display: flex;
-		height: 100vh;
+		width:347px;
+		height: 574px;
 		overflow-y: hidden;
 		justify-content: center;
 		color: #333333;
-		width: 100%;
 		background: red;
 
 		.tz_box {
@@ -13,8 +13,8 @@
 			flex-direction: column;
 			align-items: center;
 			position: relative;
-			width: 100%;
-			height: 100%;
+			width:347px;
+			height: 574px;
 
 			.close_box {
 				position: absolute;
@@ -31,8 +31,8 @@
 			}
 
 			.share_qrcode {
-				width: 100%;
-				height: 100%;
+				width:347px;
+				height: 574px;
 			}
 
 			.tz_title {