diff --git a/linkwe-ui/.env.development b/linkwe-ui/.env.development
index ae6e34c6c0fc98a11f9b7994c66f603da0022c1e..a88570b980f14b42fb180c611e5fb589e8e67c31 100644
--- a/linkwe-ui/.env.development
+++ b/linkwe-ui/.env.development
@@ -2,7 +2,7 @@
ENV = 'development'
# 仟微管理系统/开发环境
-VUE_APP_BASE_API = 'http://146.56.222.200'
+VUE_APP_BASE_API = 'http://146.56.222.200/api'
# VUE_APP_BASE_API = 'http://n3rpzt.natappfree.cc'
# 开发环境IP
diff --git a/linkwe-ui/.env.production b/linkwe-ui/.env.production
index 8a1041d419109e4dc719af6130e1f12d189e2b1b..c82064af90d6101d6b43d47d7c8a88a3d80a4d83 100644
--- a/linkwe-ui/.env.production
+++ b/linkwe-ui/.env.production
@@ -5,4 +5,4 @@ ENV = 'production'
VUE_APP_BASE_API = 'http://146.56.222.200'
# 生产环境IP
-VUE_APP_BASE_URL = 'http://106.13.236.58:8080'
+VUE_APP_BASE_URL = 'http://146.56.222.200'
diff --git a/linkwe-ui/src/assets/poster/img/Thumbs.db b/linkwe-ui/src/assets/poster/img/Thumbs.db
new file mode 100644
index 0000000000000000000000000000000000000000..b6b81b5de850e669935bcc71d64576cfe77d231f
Binary files /dev/null and b/linkwe-ui/src/assets/poster/img/Thumbs.db differ
diff --git a/linkwe-ui/src/assets/poster/img/qrCodeImage.png b/linkwe-ui/src/assets/poster/img/qrCodeImage.png
index b76e1d78533e0a54019822651f899cc57972e751..a3eeef51aeb9345511935606ef789858139ce2a2 100644
Binary files a/linkwe-ui/src/assets/poster/img/qrCodeImage.png and b/linkwe-ui/src/assets/poster/img/qrCodeImage.png differ
diff --git a/linkwe-ui/src/components/SelectMaterial/list.vue b/linkwe-ui/src/components/SelectMaterial/list.vue
index 38b8b02219d72809737a4eca7f4f43c0609909d5..2c9c1d8027e8c0fc7d15da612455a3d87384724d 100644
--- a/linkwe-ui/src/components/SelectMaterial/list.vue
+++ b/linkwe-ui/src/components/SelectMaterial/list.vue
@@ -134,7 +134,7 @@ export default {
v-model="radio"
>
-
+
{{ item.materialName }}
diff --git a/linkwe-ui/src/views/material/components/PosterPage.vue b/linkwe-ui/src/views/material/components/PosterPage.vue
index d0f947f7b24a2a1a6acd52ecd436e56a0f1bff3b..814a902c57aad15ef2463c9436af8b48f9bd74fe 100644
--- a/linkwe-ui/src/views/material/components/PosterPage.vue
+++ b/linkwe-ui/src/views/material/components/PosterPage.vue
@@ -1,6 +1,6 @@
@@ -17,8 +17,7 @@ const includeUIOptions = {
}
};
const editorDefaultOptions = {
- cssMaxWidth: 640,
- cssMaxHeight: 1136
+ cssMaxHeight: 700
};
export default {
name: 'PosterPage',
@@ -61,12 +60,6 @@ export default {
},500)
});
}
- this.editorInstance.loadImageFromURL('https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2980445260,41238050&fm=26&gp=0.jpg', 'imagePoster').then(async result => {
- console.log('old : ' + result.oldWidth + ', ' + result.oldHeight);
- console.log('new : ' + result.newWidth + ', ' + result.newHeight);
- // await this.addImage('https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2980445260,41238050&fm=26&gp=0.jpg')
- // await this.addText('aloha');
- });
// hack UI
this.editorInstance.events.addText = []
@@ -86,6 +79,14 @@ export default {
this.editorInstance = null;
},
methods: {
+ getBackgroundUrl(bacUrl) {
+ this.editorInstance.loadImageFromURL(bacUrl, 'imagePoster').then(async result => {
+ console.log('old : ' + result.oldWidth + ', ' + result.oldHeight);
+ console.log('new : ' + result.newWidth + ', ' + result.newHeight);
+ // await this.addImage('https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2980445260,41238050&fm=26&gp=0.jpg')
+ // await this.addText('aloha');
+ });
+ },
initBtn () {
this.activeObjectId = null;
diff --git a/linkwe-ui/src/views/material/poster.vue b/linkwe-ui/src/views/material/poster.vue
index f8f9be79499f8d2ab94162265dfd10bd6ef1cd3e..ffbdf2f97c01e3b6c89b7718ca723864b1227e40 100644
--- a/linkwe-ui/src/views/material/poster.vue
+++ b/linkwe-ui/src/views/material/poster.vue
@@ -7,7 +7,7 @@ import {
removePoster,
} from '@/api/material/poster.js'
import MaPage from '@/views/material/components/MaPage'
-
+import SelectMaterial from '@/components/SelectMaterial'
// Load Style Code
import "tui-image-editor/dist/tui-image-editor.css";
import "tui-color-picker/dist/tui-color-picker.css";
@@ -26,12 +26,14 @@ export default {
name: 'Poster',
components: {
MaPage,
+ SelectMaterial,
"tui-image-editor": PosterPage
},
data () {
return {
imgList: {},
imgData: [],
+ dialogVisibleSelectMaterial: false,
dialog: {
preview: false, // 预览弹出显示隐藏
edit: false // 编辑弹出显示隐藏
@@ -39,6 +41,8 @@ export default {
posterEdit: {
step: 0
},
+ materialSelected: '', // 图片url
+ rangeErrorMsg: '',
posterForm: {
title: '', // 海报名称
categoryId: '', // 所属分类
@@ -47,7 +51,8 @@ export default {
// count: '', // 虚拟次数
// sort: '', // 海报排序
// jump: [], // 跳转页面
- delFlag: 0 // 是否启用
+ delFlag: 0, // 是否启用
+ mediaId: '', // 图片id
},
rules: {
title: {
@@ -80,6 +85,9 @@ export default {
// path: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg1.gtimg.com%2Fsports%2Fpics%2Fhv1%2F171%2F106%2F1472%2F95744001.jpg&refer=http%3A%2F%2Fimg1.gtimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1612444990&t=6589254fe9669cc6a45fd3688f269612',
// name: "posterImage"
// },
+ uiSize: {
+ height: '700px' // 设置固定高度
+ },
usageStatistics: false,
menuBarPosition: "right",
menu: ['text'], // FIXME 因为借用了CANVAS的UI 所以需要使用TEXT,需要额外注释,后面创建自己的UI在去掉
@@ -168,8 +176,9 @@ export default {
title: data.title,
categoryId: data.categoryId,
type: data.type,
- delFlag: data.delFlag
+ delFlag: data.delFlag,
}
+ this.materialSelected = data.backgroundImgPath
this.posterEdit.step = 0
this.dialog.edit = true
} catch (error) {
@@ -262,9 +271,16 @@ export default {
imageEditor.stopDrawingMode();
},
toNextStep () {
+ if (this.materialSelected === '') {
+ this.rangeErrorMsg = '请选择背景图片'
+ return
+ } else {
+ this.rangeErrorMsg = ''
+ }
this.$refs.form.validate((valid) => {
if (valid) {
this.posterEdit.step = 1
+ this.$refs.tuiImageEditor.getBackgroundUrl(this.materialSelected)
} else {
return false;
}
@@ -364,6 +380,16 @@ export default {
this.imgData.push(data)
// console.log(this.imgData)
},
+ // 选择素材确认按钮
+ submitSelectMaterial(text, image, file) {
+ this.posterForm.mediaId = image.id
+ this.materialSelected = image.materialUrl
+ this.dialogVisibleSelectMaterial = false
+ },
+ removeMaterial() {
+ this.posterForm.mediaId = ''
+ this.materialSelected = ''
+ },
//
async save() {
let list =[];
@@ -395,6 +421,11 @@ export default {
let i = 0, len = list.length;
while (i < len) {
let vo = list[i];
+ if (!this.imgData[i]) {
+ console.log('this.imgData[i] is null')
+ i++;
+ continue;
+ }
vo.objType = this.imgData[i].objType;
vo.url = this.imgData[i].url;
vo.randomId = this.imgData[i].randomId;
@@ -436,13 +467,15 @@ export default {
if (posterForm.id) {
// 编辑海报
res = await updatePoster(Object.assign({}, {
- backgroundImgPath: 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2980445260,41238050&fm=26&gp=0.jpg',
- posterSubassemblyList: []
+ // backgroundImgPath: 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2980445260,41238050&fm=26&gp=0.jpg',
+ backgroundImgPath: this.materialSelected,
+ posterSubassemblyList: posterSubList
}, this.posterForm))
} else {
// 新建海报
res = await addPoster(Object.assign({}, {
- backgroundImgPath: 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2980445260,41238050&fm=26&gp=0.jpg',
+ // backgroundImgPath: 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2980445260,41238050&fm=26&gp=0.jpg',
+ backgroundImgPath: this.materialSelected,
posterSubassemblyList: posterSubList
}, this.posterForm))
}
@@ -457,6 +490,7 @@ export default {
+
否
+
+
+
+
+
+
+ 添加图片
+
前往设计海报
@@ -645,6 +695,15 @@ export default {
+
+
+
+