|
@@ -47,6 +47,7 @@
|
|
</view>
|
|
</view>
|
|
<view class="">立即返回</view>
|
|
<view class="">立即返回</view>
|
|
</view>
|
|
</view>
|
|
|
|
+
|
|
<view class="action" @click="getdownload(cardCur)">
|
|
<view class="action" @click="getdownload(cardCur)">
|
|
<view class="bar-icon">
|
|
<view class="bar-icon">
|
|
<view class="tn-icon-download">
|
|
<view class="tn-icon-download">
|
|
@@ -55,7 +56,24 @@
|
|
<view class="">下载/分享</view>
|
|
<view class="">下载/分享</view>
|
|
</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="bar-icon">
|
|
<view class="tn-icon-creative">
|
|
<view class="tn-icon-creative">
|
|
@@ -82,9 +100,9 @@
|
|
<view class="">参考图</view>
|
|
<view class="">参考图</view>
|
|
</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="tn-flex-direction-column tn-flex-row-center tn-flex-col-center tn-button--clear-style">
|
|
<view class="bar-icon">
|
|
<view class="bar-icon">
|
|
<view class="tn-icon-write">
|
|
<view class="tn-icon-write">
|
|
@@ -104,6 +122,7 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
+
|
|
<tn-landscape :show="show1" @close="closeLandscape" closePosition="bottom" :closeSize="60">
|
|
<tn-landscape :show="show1" @close="closeLandscape" closePosition="bottom" :closeSize="60">
|
|
<view class="tn-color-white" style="width: 100vw;">
|
|
<view class="tn-color-white" style="width: 100vw;">
|
|
|
|
|
|
@@ -142,7 +161,8 @@
|
|
</view>
|
|
</view>
|
|
</u-popup>
|
|
</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>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -186,28 +206,28 @@
|
|
isDowload: false,
|
|
isDowload: false,
|
|
show: false,
|
|
show: false,
|
|
sd_keywords: '',
|
|
sd_keywords: '',
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
// 生成海报data
|
|
// 生成海报data
|
|
platform: this.$platform.get(),
|
|
platform: this.$platform.get(),
|
|
-
|
|
|
|
- qrcode:'',
|
|
|
|
|
|
+
|
|
|
|
+ qrcode: '',
|
|
spmplatform: 0,
|
|
spmplatform: 0,
|
|
posterObj: {},
|
|
posterObj: {},
|
|
- info:{
|
|
|
|
|
|
+ info: {
|
|
// poster_bg_img_path:"",
|
|
// 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: {
|
|
computed: {
|
|
...mapGetters(['appInfo', 'homeTemplate', 'isLogin', 'userInfo', 'userData'])
|
|
...mapGetters(['appInfo', 'homeTemplate', 'isLogin', 'userInfo', 'userData'])
|
|
@@ -218,7 +238,7 @@
|
|
onLoad(o) {
|
|
onLoad(o) {
|
|
this.spmplatform = ['H5', 'wxOfficialAccount', 'wxMiniProgram', 'App'].indexOf(this.platform) + 1;
|
|
this.spmplatform = ['H5', 'wxOfficialAccount', 'wxMiniProgram', 'App'].indexOf(this.platform) + 1;
|
|
this.commonqrcodePath()
|
|
this.commonqrcodePath()
|
|
-
|
|
|
|
|
|
+
|
|
var that = this;
|
|
var that = this;
|
|
this.windowHeight = uni.$u.sys().windowHeight - 60
|
|
this.windowHeight = uni.$u.sys().windowHeight - 60
|
|
this.engin = that.$Route.query.from
|
|
this.engin = that.$Route.query.from
|
|
@@ -242,6 +262,31 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
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) {
|
|
downloadPic(e) {
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|
|
uni.request({
|
|
uni.request({
|
|
@@ -266,7 +311,7 @@
|
|
spm: spm
|
|
spm: spm
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (res.code == 0) {
|
|
if (res.code == 0) {
|
|
- this.qrcode= res.data;
|
|
|
|
|
|
+ this.qrcode = res.data;
|
|
// this.createPoster()
|
|
// this.createPoster()
|
|
console.log('二维码需要包含的url信息=============', this.qrcode);
|
|
console.log('二维码需要包含的url信息=============', this.qrcode);
|
|
}
|
|
}
|
|
@@ -274,35 +319,23 @@
|
|
},
|
|
},
|
|
async createPoster(e) {
|
|
async createPoster(e) {
|
|
let that = this;
|
|
let that = this;
|
|
-
|
|
|
|
|
|
+
|
|
let avatarUrl = '';
|
|
let avatarUrl = '';
|
|
let mainUrl = '';
|
|
let mainUrl = '';
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
title: '海报渲染中'
|
|
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 {
|
|
} 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.hideLoading();
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: '生成失败',
|
|
title: '生成失败',
|
|
@@ -310,189 +343,194 @@
|
|
})
|
|
})
|
|
return;
|
|
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;
|
|
let proportionally = this.info.poster_bg_width / uni.$u.sys().windowWidth;
|
|
(this.posterObj = {
|
|
(this.posterObj = {
|
|
width: (this.info.poster_bg_width / proportionally) + 'px',
|
|
width: (this.info.poster_bg_width / proportionally) + 'px',
|
|
height: (this.info.poster_bg_height / proportionally) + 'px',
|
|
height: (this.info.poster_bg_height / proportionally) + 'px',
|
|
background: 'rgba(0,0,0,0)',
|
|
background: 'rgba(0,0,0,0)',
|
|
borderRadius: '16rpx',
|
|
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: {
|
|
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',
|
|
width: (this.info.poster_qrcode_width / proportionally) + 'px',
|
|
height: (this.info.poster_qrcode_width / proportionally) + 'px',
|
|
height: (this.info.poster_qrcode_width / proportionally) + 'px',
|
|
background: '#fff'
|
|
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.showPoster = true,
|
|
// this.revertUrl()
|
|
// this.revertUrl()
|
|
-
|
|
|
|
|
|
+
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
that.$refs.painter.canvasToTempFilePathSync({
|
|
that.$refs.painter.canvasToTempFilePathSync({
|
|
// 在nvue里是jpeg
|
|
// 在nvue里是jpeg
|
|
@@ -502,7 +540,7 @@
|
|
console.log('res.tempFilePath', res.tempFilePath);
|
|
console.log('res.tempFilePath', res.tempFilePath);
|
|
uni.showModal({
|
|
uni.showModal({
|
|
title: '提示',
|
|
title: '提示',
|
|
- content: '请查看图片后长按图片保存',
|
|
|
|
|
|
+ content: '查看图片后长按图片即可保存或分享',
|
|
confirmText: '查看',
|
|
confirmText: '查看',
|
|
confirmColor: '#1F79F0',
|
|
confirmColor: '#1F79F0',
|
|
success: function(res2) {
|
|
success: function(res2) {
|
|
@@ -510,10 +548,13 @@
|
|
uni.previewImage({
|
|
uni.previewImage({
|
|
urls: [res.tempFilePath],
|
|
urls: [res.tempFilePath],
|
|
longPressActions: {
|
|
longPressActions: {
|
|
- itemList: ['发送给朋友', '保存图片', '收藏'],
|
|
|
|
|
|
+ itemList: ['发送给朋友', '保存图片',
|
|
|
|
+ '收藏'
|
|
|
|
+ ],
|
|
success: function(data) {},
|
|
success: function(data) {},
|
|
fail: function(err) {
|
|
fail: function(err) {
|
|
- console.log(err.errMsg);
|
|
|
|
|
|
+ console.log(err
|
|
|
|
+ .errMsg);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -531,7 +572,7 @@
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
},
|
|
},
|
|
// 生成海报需要的数据到此为止
|
|
// 生成海报需要的数据到此为止
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
preViewImg(type) {
|
|
preViewImg(type) {
|
|
if (type == 1) {
|
|
if (type == 1) {
|
|
@@ -618,17 +659,17 @@
|
|
if (this.engin == 'sd') {
|
|
if (this.engin == 'sd') {
|
|
for (var i = 0; i < res.data.imgs_file.length; i++) {
|
|
for (var i = 0; i < res.data.imgs_file.length; i++) {
|
|
var url = {
|
|
var url = {
|
|
- id: i,
|
|
|
|
|
|
+ id: res.data.id,
|
|
type: 'image',
|
|
type: 'image',
|
|
url: res.data.imgs_file[i],
|
|
url: res.data.imgs_file[i],
|
|
|
|
+ // url: res.data.origin_url,
|
|
}
|
|
}
|
|
that.swiperList.push(url)
|
|
that.swiperList.push(url)
|
|
-
|
|
|
|
}
|
|
}
|
|
this.done = true
|
|
this.done = true
|
|
} else if (this.engin == 'mj') {
|
|
} else if (this.engin == 'mj') {
|
|
var url = {
|
|
var url = {
|
|
- id: 0,
|
|
|
|
|
|
+ id: res.data.id,
|
|
type: 'image',
|
|
type: 'image',
|
|
url: res.data.origin_url,
|
|
url: res.data.origin_url,
|
|
}
|
|
}
|
|
@@ -636,7 +677,7 @@
|
|
this.done = true
|
|
this.done = true
|
|
} else if (this.engin == 'rh') {
|
|
} else if (this.engin == 'rh') {
|
|
var url = {
|
|
var url = {
|
|
- id: 0,
|
|
|
|
|
|
+ id: res.data.id,
|
|
type: 'image',
|
|
type: 'image',
|
|
url: res.data.imgs_file[0],
|
|
url: res.data.imgs_file[0],
|
|
}
|
|
}
|
|
@@ -644,7 +685,7 @@
|
|
|
|
|
|
console.log("this.engin == 'rh'====", res.data.imgs_file, that.swiperList);
|
|
console.log("this.engin == 'rh'====", res.data.imgs_file, that.swiperList);
|
|
this.done = true
|
|
this.done = true
|
|
-
|
|
|
|
|
|
+
|
|
// this.commonqrcodePath()
|
|
// this.commonqrcodePath()
|
|
}
|
|
}
|
|
|
|
|
|
@@ -699,13 +740,7 @@
|
|
} else {
|
|
} else {
|
|
this.parameter.promptSame = this.parameter.prompt
|
|
this.parameter.promptSame = this.parameter.prompt
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
console.log('进入这里了没有', this.parameter.promptSame);
|
|
console.log('进入这里了没有', this.parameter.promptSame);
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
} else {
|
|
} else {
|
|
|
|
|
|
}
|
|
}
|
|
@@ -841,14 +876,14 @@
|
|
})
|
|
})
|
|
return;
|
|
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()
|
|
this.createPoster()
|
|
return
|
|
return
|
|
|
|
|