Commit 0667be6b by huahua

提交

parent 9cdf6526
......@@ -32,7 +32,6 @@
<view :style="{width: data.bgWidth +'px',height: data.bgHeight +'px' }" style="position: relative; ">
<!-- background: #ffaa00; -->
<!-- 底图 -->
<!-- <image :src="data.bgImage_old" mode="widthFix"
:style="{width: data.bgWidth +'px',height: data.bgWidth +'px' }"
style="position: absolute; z-index: 0; top: 0; bottom: 0; margin: auto;"></image> -->
......@@ -316,10 +315,12 @@
<!-- 菜单栏目 -->
<view v-if="!active && !guide_left" class="toolRight">
<view class="tool_li">
<view class="tool_li" @click="showPopup(99)">
<image class="tool_li_img" src="../../static/icon_diy_shoucang.png" mode=""></image>
<view class="tool_li_text">我的收藏</view>
<image class="tool_li_img" src="../../static/img/icon_history_image.png" mode=""></image>
<view class="tool_li_text">历史作品</view>
</view>
<view class="tool_li" @click="showPopup(23)">
<image class="tool_li_img" src="../../static/icon_diy_wallpaper.png" mode=""></image>
<view class="tool_li_text">全幅壁纸</view>
......@@ -333,35 +334,37 @@
<image class="tool_li_img" src="../../static/icon_make_diy_uplaod_image.png" mode=""></image>
<view class="tool_li_text">背景底色</view>
</view>
<!-- <view class="tool_li" @click="showPopup(28)">
<image class="tool_li_img" src="../../static/icon_make_diy_uplaod_image.png" mode=""></image>
<view class="tool_li_text">背景底色</view>
</view> -->
<view class="tool_li" @click="showone = !showone">
<image @click="cancel('share')" class="tool_li_img"
src="../../static/icon_make_diy_back_color.png" mode=""></image>
<view @click="cancel()" class="tool_li_text">上传相片</view>
</view>
<view class="tool_li" @click="showPopup(3)">
<image class="tool_li_img" src="../../static/icon_diy_typeface.png"
style="width: 45upx; height: 40upx;" mode=""></image>
<view @click="cancel()" class="tool_li_text">添加文字</view>
</view>
<view class="tool_li" @click="ontuya()" v-if="machine_id">
<image class="tool_li_img" style="width: 62upx; height: 55upx;" src="../../static/icon_tuya.png"
mode=""></image>
<view class="tool_li_text">添加涂鸦</view>
</view>
<view class="tool_li" @click="wallpaperOnclick()" v-if="machine_id">
<image class="tool_li_img" style="width: 71upx; height: 59upx;"
src="../../static/randomwallpaper.png" mode=""></image>
<view class="tool_li_text">智能推荐</view>
</view>
<view class="tool_li" @click.stop="removedeleteItem" v-if="data.itemList.length > 0">
<image class="tool_li_img" style="width: 50upx; height: 50upx;"
src="../../static/diy_icon_middle_default.png" mode=""></image>
<view class="tool_li_text">移除图片</view>
</view>
<view class="tool_li" style="height: 70upx;" v-if="background_color"
@click.stop="background_color = null">
<image class="tool_li_img" style="width: 51upx; height: 51upx;"
......@@ -376,18 +379,6 @@
align-items: center;" @click="oclikGifImage()" @touchstart="oclikGifImage()">
</image>
<!-- <view style="height: 200upx;"></view>
<view class="tool_li" v-if="background_color" @click.stop="background_color = null">
<image class="tool_li_img" style="width: 50upx; height: 50upx;"
src="../../static/diy_icon_replace_default.png" mode=""></image>
</view>
<view class="tool_li" @click.stop="removedeleteItem" v-if="data.itemList.length > 0">
<image class="tool_li_img" style="width: 50upx; height: 50upx;"
src="../../static/diy_icon_middle_default.png" mode=""></image>
</view> -->
<!-- <view class="tool_li" @click="showPopup(30)">
<image class="tool_li_img" src="../../static/color.png" mode=""></image>
</view> -->
</view>
</view>
......@@ -419,21 +410,13 @@
<view @click.stop="createWorks" hover-class="hover-class-bg"
:class="['tool_add',!machine_id ? 'grey' : '']">立即下单</view>
</view>
<!-- 单指可拖拽 -->
<!-- && data.itemList.length > 0 -->
<view v-if="!guide_left "
style="position: fixed; font-size: 22upx; color: #999999; bottom: 280upx;left: 50%;transform: translate(-50%, 0%);z-index: 999; ">
<view>单指拖拽,双指伸缩</view>
<!-- <view>双指可缩放</view>
<view>双击可裁剪</view> -->
</view>
<!-- <view style="text-align: center; color: #FFFFFF; position: fixed; z-index: 99;
left: 0; right: 0; bottom: 227upx;">
<view>打印时,自动生成 4 x 3 排版</view>
<text style="color: #0CA457; padding: 20upx;" @click="drawImg">预览></text>
</view> -->
<!-- 预览 -->
<view v-if="showtwo">
<view
......@@ -1340,7 +1323,6 @@
},
//选择微信相片跟本地相册弹框取消
selectPicturePopColse() {
//console.log("取消进来")
//this.delete_wrap_state = false
this.showone = false
this.$refs['showpicture'].close();
......@@ -1385,8 +1367,6 @@
'callback': atter.callback,
},
success: function(res) {
//console.log(res);
//console.log("上传图片"+successUp+"res.statusCode="+res.statusCode)
successUp++;
if (res.statusCode != 200) {
// console.log({errCode: '599', msg:'其他错误'})
......@@ -1412,12 +1392,22 @@
let ratioheight = (_this.data
.editorHeight * _this.mix_scale) /
image.height
// console.log(_this.mix_scale)
// if (ratio >= 1) { //长方形
width = _this.data.editorWidth * _this
.mix_scale
height = image.height * ratiowidth
// if (height / 2 > _this.editor_top) {
// width = width * (_this.editor_top * 2 /
// height)
// height = _this.editor_top * 2
// }
// console.log(_this.mix_scale)
// if (ratio >= 1) { //长方形
//width = _this.data.editorWidth * _this.mix_scale
//height = image.height * ratiowidth
// if (height / 2 > _this.editor_top) {
// width = width * (_this.editor_top * 2 / height)
// height = _this.editor_top * 2
// }
......@@ -1925,7 +1915,6 @@
//''console.log("进来壁纸")
that.Worksdetaildata(item)
} else if (this.e_active == 22) { //特效
// console.log(item)
this.shape_image = item.image
this.shape_id = item.id
this.shape_price = item.sales_price
......@@ -1939,13 +1928,16 @@
},
Worksdetaildata(item) { //this.e_active 1模板 2贴图 3字体 4编辑 22添加相框
let s_data = 'Works'
let isWork = item.isWork;
if (this.e_active == 1) {
items = []
} else if (this.e_active == 2 || this.e_active == 23) {
s_data = 'Material'
} else if (this.e_active == 99) {
} else if (this.e_active == 2 || this.e_active == 23 || this.e_active == 99) {
if (isWork) {
s_data = 'Works'
} else {
s_data = 'Material'
}
}
uni.showLoading({
title: '正在加载中...',
mask: true
......@@ -2030,9 +2022,30 @@
title: '加载中...',
mask: true
})
let support_zoom = 1; // 0是不支持缩放,为1时支持缩放
let support_drag = 1; // 0是不支持拖动,为1时支持拖动
let is_under = 0; //贴图是否为背景图
let is_discount = 0; //贴图是否用卷
let urlData;
let material_id = 0; //贴图id
let original_id = 0;
if (isWork) {
urlData = result.image
result.mix_scale = 1;
result.is_under = 0;
} else {
urlData = result.url
support_zoom = result.support_zoom; // 0是不支持缩放,为1时支持缩放
support_drag = result.support_drag; // 0是不支持拖动,为1时支持拖动
is_under = result.is_under; //贴图是否为背景图
is_discount = result.is_discount; //贴图是否用卷
}
// 读取主图遮罩
uni.getImageInfo({
src: result.url,
src: urlData,
success: (image) => {
if (this.e_active == 23) {
......@@ -2054,13 +2067,13 @@
let ratioheight = (this.data.editorHeight * this.mix_scale) / image
.height
let resultmix_scale = result.mix_scale || 1
if (ratio >= 1) { //长方形
// if (ratio >= 1) { //长方形
width = this.data.editorWidth * this.mix_scale * resultmix_scale
height = image.height * ratiowidth * resultmix_scale
} else if (ratio < 1) { //长高方形
height = this.data.editorHeight * this.mix_scale * resultmix_scale
width = image.width * ratioheight * resultmix_scale
}
// } else if (ratio < 1) { //长高方形
// height = this.data.editorHeight * this.mix_scale * resultmix_scale
// width = image.width * ratioheight * resultmix_scale
// }
if (result.is_under == 1) {
let number_index = 0
for (var item of items) {
......@@ -2073,31 +2086,27 @@
index = number_index
}
//this.isShowGif = true;
items.push({
support_zoom: result.support_zoom, // 0是不支持缩放,为1时支持缩放
support_drag: result.support_drag, // 0是不支持拖动,为1时支持拖动
is_under: result.is_under, //贴图是否为背景图
is_discount: result.is_discount, //贴图是否用卷
support_zoom: support_zoom, // 0是不支持缩放,为1时支持缩放
support_drag: support_drag, // 0是不支持拖动,为1时支持拖动
is_under: is_under, //贴图是否为背景图
is_discount: is_discount, //贴图是否用卷
id: items.length + 1,
type: 2, //0图片 1文字 2贴图
material_id: result.id, //贴图id
original_id: result.id,
material_id: material_id, //贴图id
original_id: original_id,
index: index,
font_family: '',
font_style: '',
font_size: '',
font_color: '',
under_color: '',
content: result.url, // 贴图地址
content: urlData, // 贴图地址
top: this.editor_top - height / 2, // 初始图片Y坐标,根据画布高/2-图片高/2
// top: this.data.editorHeight / 2 - height / 2, // 初始图片Y坐标,根据画布高/2-图片高/2
left: this.data.editorWidth / 2 - width /
2, // 初始图片X坐标,因为div是相对定位,所以计算是要多减一次移动的距离
x: this.data.editorWidth /
2, // 初始圆心位置,可再downImg之后又宽高和初始的图片位置得出
// y: this.data.editorHeight / 2,
y: this.editor_top,
scale: 1, // 缩放比例 1为不缩放
lastScale: 1, // 上一次的绽放比例
......@@ -2112,7 +2121,6 @@
activescale: false, // 开启旋转状态
activehorn: false, // 开启角状态
activeedge: false, // 开启边状态
// 分界线
initialScale: 1, // 图片缩放比例
initialscaling: 1, // 图片初始时缩放比例
initialScalex: 1, // 图片宽缩放比例
......@@ -2124,6 +2132,7 @@
frame_top: null, // 裁剪窗口y
image_top: null, // 图片y
})
// 提示用户此贴图可用卷
if (result.is_discount == '1') {
if (this.$base.coupon_flag_desc == '') return;
......@@ -2140,7 +2149,7 @@
fail: function(err) {
uni.hideLoading()
uni.showToast({
title: '图片不在以下 downloadFile 合法域名列表中',
title: '图片加载失败',
icon: 'none'
});
}
......@@ -2362,6 +2371,7 @@
setTimeout(function() {
this.$refs['scrollList'].open({
e: this.e_active,
goods_id: this.data.goods_id,
queryPage: {
currentId: this.currentId,
},
......@@ -2537,19 +2547,24 @@
} else if (e == 99) { //收藏
this.Adlists = this.diy_bannerList
this.brands = [{
icon: "../../static/icon/my.png",
icon_click: "../../static/icon/my-o.png",
title: "我的"
icon: "../../static/img/icon_history_sticker.png",
icon_click: "../../static/img/icon_history_sticker-o.png",
title: "我的历史"
},
{
icon: "../../static/icon/icon_collection_@2x.png",
icon_click: "../../static/icon/icon_collection_@2x.png",
title: "收藏"
icon: "../../static/img/my.png",
icon_click: "../../static/img/my-o.png",
title: "我的作品"
},
{
icon: "../../static/icon/icon_good@2x.png",
icon_click: "../../static/icon/icon_good@2x.png",
title: "点赞"
icon: "../../static/img/icon_collection_@2x.png",
icon_click: "../../static/img/icon_collection_@2x-o.png",
title: "我的收藏"
},
{
icon: "../../static/img/icon_good@2x.png",
icon_click: "../../static/img/icon_good@2x-o.png",
title: "我的点赞"
},
]
if (this.collection_currentId != 0) {
......@@ -2563,6 +2578,7 @@
this.$nextTick(() => {
this.$refs['scrollList'].open({
e: e,
goods_id: this.data.goods_id,
queryPage: {
currentId: this.currentId,
}
......
......@@ -18,6 +18,7 @@
<view class="start_title" style="margin-top: 120upx;">定制站必须扫码才能使用</view>
</view>
</view>
<!-- 扫码定制 -->
<view @click="scanning" style="width: 460upx; position: fixed; bottom: 180upx; margin: auto;
height: 164upx; background: #FAD9B1 ; left: 0; right: 0; z-index: 99; border-radius: 20upx;
......
......@@ -73,6 +73,13 @@
material_series_id: "",
},
Material_categorydatalist: [], //作品、贴图列表
historyQueryPage: {
goods_id: "", //产品Id
s: 'Works.myList',
}, //历史对象
datalist: [], //作品、贴图列表
Material_category: [], //贴图分类
currentId: 0,
......@@ -82,6 +89,7 @@
tip: '',
scrollViewTop: 0, //滑动高度
e: 0, //弹窗类型
isWork: false, //是否作品
};
},
mounted() {
......@@ -91,10 +99,10 @@
* 组件的公有方法列表
*/
methods: {
//作品详情
Worksdetail(item) {
//console.log(item)
item.isWork = this.isWork
this.$emit('Worksdetail', item)
},
......@@ -131,7 +139,6 @@
setTimeout(e, 500);
this.tip = '刷新成功';
this.queryPage.page = 1
//this.getShapeList()
if (this.type == 99) {
this.queryCollectionPage.page = 1;
this.getExcellentMaterial(this.item.queryPage)
......@@ -159,11 +166,10 @@
if (this.e != item.e) {
this.datalist = [];
}
this.isWork = false;
this.type = 0;
this.e = item.e;
this.scrollViewTop = 0;
//let loadData = true;
let loadData = false;
if (item.e == 23 || item.e == 2) {
if (this.queryPage.material_category_id == item.queryPage.material_category_id) {
......@@ -231,6 +237,9 @@
this.item = item;
this.getExcellentMaterial(item.queryPage)
} else {
if (item.queryPage.currentId == 0) {
this.isWork = true;
}
this.scrollViewTop = this.oldScrollViewTop
this.showState = true;
}
......@@ -261,13 +270,20 @@
getExcellentMaterialMore(e) {
if (e.currentId == 0) {
} else {
let url = ''
uni.showLoading({
title: '正在加载中...'
})
let url = ''
if (e.currentId == 0) url = '/douyin/Material/getMeMaterial'
else if (e.currentId == 1) url = '/douyin/Material/getMeCollection'
else if (e.currentId == 2) url = '/douyin/Material/getFollowMaterials'
if (e.currentId == 1) {
url = '/douyin/Material/getMeMaterial'
} else if (e.currentId == 2) {
url = '/douyin/Material/getMeCollection'
} else if (e.currentId == 3) {
url = '/douyin/Material/getFollowMaterials'
}
this.$http.post(url, this.queryCollectionPage).then(result => {
this.showState = true
if (result.data == null || result.data == "") {
......@@ -276,7 +292,8 @@
icon: 'none'
});
} else {
this.Material_categorydatalist = this.Material_categorydatalist.concat(result.data.data);
this.Material_categorydatalist = this.Material_categorydatalist.concat(result.data
.data);
this.datalist = this.datalist.concat(result.data.data);
this.queryCollectionPage.page += 1;
if (Math.ceil(result.total / result.per_page) <= this.queryCollectionPage.page) {
......@@ -297,36 +314,54 @@
})
uni.hideLoading();
});
}
},
//获取条件
getExcellentMaterial(e) {
this.datalist = []
uni.showLoading({
title: '正在加载中...'
})
let url = ''
this.currentId = e.currentId;
if (e.currentId == 0) url = '/douyin/Material/getMeMaterial'
else if (e.currentId == 1) url = '/douyin/Material/getMeCollection'
else if (e.currentId == 2) url = '/douyin/Material/getFollowMaterials'
if (e.currentId == 0) {
this.isWork = true;
this.historyQueryPage.goods_id = this.item.goods_id;
homeservice.WorksList(this.historyQueryPage).then(result => {
this.datalist = result.data
uni.hideLoading();
}).catch(err => {
uni.showToast({
title: err.msg,
icon: 'none'
})
uni.hideLoading();
});
} else {
this.isWork = false;
if (e.currentId == 1) {
url = '/douyin/Material/getMeMaterial'
} else if (e.currentId == 2) {
url = '/douyin/Material/getMeCollection'
} else if (e.currentId == 3) {
url = '/douyin/Material/getFollowMaterials'
}
this.$http.post(url, this.queryCollectionPage).then(result => {
this.showState = true
this.Material_categorydatalist = result.data.data
this.datalist = result.data.data;
this.queryCollectionPage.page += 1;
uni.hideLoading();
this.tip = '';
}).catch(err => {
this.showState = true
uni.showToast({
title: err.msg,
icon: 'none'
})
uni.hideLoading();
});
}
},
},
}
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment