Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wechat_baking
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
huahua
wechat_baking
Commits
5ca35981
Commit
5ca35981
authored
Jan 02, 2023
by
huahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改banner显示不全
parent
ccb579bb
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
325 additions
and
539 deletions
+325
-539
pages/index/head/head.vue
+1
-1
pages/index/index.vue
+195
-267
pages/index/js/drag.js
+3
-23
pages/index/machineDetail.vue
+1
-5
pages/index/scrollView.vue
+3
-3
pages/index/switchGoods.vue
+2
-2
pages/index/textsettings.vue
+1
-37
pages/index/tuya.vue
+12
-93
pages/mall/lineUp.vue
+3
-4
pages/mall/size.vue
+104
-103
util/wx-touch-event.js
+0
-1
No files found.
pages/index/head/head.vue
View file @
5ca35981
<
template
>
<view
:style=
"
{ height: height + 'px', background:background}" style="position: fixed; z-index:
888
;">
<view
:style=
"
{ height: height + 'px', background:background}" style="position: fixed; z-index:
9999
;">
<view
class=
"head"
:style=
"
{ height: height + 'px', background:background}">
<view
class=
"back"
@
click=
"back"
v-if=
"backShow"
:style=
"
{ top: top + 'px', color:color }">
<image
src=
"../../../static/recommend/icon_back_black.png"
mode=
"aspectFit"
...
...
pages/index/index.vue
View file @
5ca35981
<
template
>
<view
class=
"full-width full-height"
style=
"background: #FFFFFF; "
>
<!-- 自定义头部 -->
<!--
<myhead
:worksid=
"works_id"
:title=
"titlename"
:color=
"'#fff'"
:titleShow=
"true"
:backShow=
"true"
:background=
"'none'"
></myhead>
-->
<myhead
:worksid=
"works_id"
:title=
"titlename"
:color=
"'#131319'"
:titleShow=
"true"
:backShow=
"true"
:background=
"'#fff'"
></myhead>
<myhead
:worksid=
"works_id"
:title=
"titlename"
:color=
"'#131319'"
:titleShow=
"true"
:backShow=
"true"
:background=
"'#fff'"
></myhead>
<!-- 登录弹框 -->
<Signin
ref=
"Signin"
></Signin>
...
...
@@ -14,37 +12,28 @@
</view>
<!-- 设计区域 -->
<view
v-show=
"!state"
class=
"full-width content-color full-height"
:style=
"
{background: design_color }"
style=" ">
<!-- margin-top: 170upx; -->
<view
v-show=
"!state"
class=
"full-width content-color full-height"
:style=
"
{background: design_color }">
<!-- 取消选中 -->
<view
class=
"full-width full-height"
style=
"position: absolute; top: 0; left: 0;"
@
click
.
stop=
"itemCancel"
>
</view>
<view
class=
"full-width full-height"
style=
"position: absolute; top: 0; left: 0;"
@
click
.
stop=
"itemCancel"
>
</view>
<view
class=
"container"
@
click=
'itemCancel'
@
touchmove
.
stop=
"touchMove"
@
touchend
.
stop=
"touchEnd"
>
<view
:style=
"
{width: data.bgWidth +'px',height: data.bgHeight +'px'}" style="position: relative; ">
<!--
<image
:src=
"data.bgImage_old"
mode=
"widthFix"
:style=
"
{width: (data.bgWidth - 30) +'px',height: data.bgWidth +'px' ,left: '15px'}"
style="position: absolute; z-index: 0; top: 0; bottom: 0; margin: auto;">
</image>
-->
<!-- 底色 -->
<view
:style=
"
{width: data.editorWidth + 'px',height: data.editorHeight +'px',
background:background_color ? background_color : '#F5F5F5' ,borderRadius: isShowCircular ? '50%' : defalutFillet + 'px' }"
style="position: absolute; top: 0; bottom: 0; left: 0; right: 0;margin: auto;z-index: 1;
;
">
style="position: absolute; top: 0; bottom: 0; left: 0; right: 0;margin: auto;z-index: 1;">
</view>
<!-- 遮罩图 -->
<!--
<image
:src=
"data.bgImage"
mode=
"widthFix"
:style=
"
{width: (data.bgWidth - 30 ) +'px',height: data.bgWidth +'px',left: '15px'}"
style="position: absolute; z-index: 2; top: 0; bottom: 0; margin: auto;">
</image>
-->
<!-- 辅助线 -->
<view
v-if=
"guide_left"
style=
"border-left: 1px dashed #
43cf7c
;position: absolute; height: 100%; z-index: 999;"
style=
"border-left: 1px dashed #
F29F3D
;position: absolute; height: 100%; z-index: 999;"
:style=
"
{left: ((data.bgWidth / 2) - 0.5) +'px'}">
</view>
<view
v-if=
"guide_top"
style=
"width: 100%; border-top: 1px dashed #
43cf7c
;position: absolute; z-index: 999;"
style=
"width: 100%; border-top: 1px dashed #
F29F3D
;position: absolute; z-index: 999;"
:style=
"
{top: (editory + (data.editorHeight * location_scale - 0.5)) +'px'}">
</view>
<!-- 主干 -->
<view
:class=
"['item-list',
{ 'list-active': data.listActive == true }]"
...
...
@@ -79,7 +68,7 @@
'margin-top': item.image_top +'px','margin-left': item.image_left +'px'}">
</image>
<!--图片 @load="loadImage"-->
<image
v-else-if=
"item.type == 0"
mode=
'aspectFill'
style=
"min-height: 5
0px;min-width: 50
px;"
style=
"min-height: 5
px;min-width: 5zlzl
px;"
:src=
"item.content + '?x-oss-process=image/resize,lfit,w_1500'"
:data-id=
"item.id"
:style=
"
{width: item.initialWidth * item.initialScale + 'px',
height: item.initialHeight * item.initialScale +'px',
...
...
@@ -406,18 +395,7 @@
</view>
</view>
<!-- 替换选项 -->
<!--
<uni-popup
ref=
"replacebottom"
type=
"bottom"
@
change=
"change"
>
<view
class=
"uni-share"
style=
"width: 90%; margin: auto;"
>
<view
style=
"background: #FFFFFF; border-radius: 20upx;"
>
<view
style=
"font-size: 30upx; font-weight: 400; height: 100upx; line-height: 100upx; text-align: center; width: 100%;"
@
click=
"replaceimage()"
>
更换其他照片
</view>
</view>
<view
style=
"height: 90rpx; line-height: 90rpx; font-size: 14px; text-align: center; color: #666; background: #FFFFFF; border-radius: 20upx; margin: 20upx 0;"
@
click=
"cancel_replace()"
>
取消
</view>
</view>
</uni-popup>
-->
<!-- 字体 -->
<uni-popup
ref=
"textsettingsshare"
type=
"bottom"
@
change=
"change"
style=
"position: fixed; z-index: 9999;"
>
<view
class=
"uni-share"
style=
"width: 100%; height: 600upx;background: #292933;"
...
...
@@ -431,7 +409,7 @@
<!-- 文本,贴图,相框 1模板 2贴图 3字体 4编辑 22添加相框 -->
<uni-popup
ref=
"showshare"
:type=
"type"
@
change=
"change"
style=
"position: relative; z-index: 999
8
; width: 100%;"
:style=
"
{height: data.windowHeight +'px'}">
style=
"position: relative; z-index: 999
9
; width: 100%;"
:style=
"
{height: data.windowHeight +'px'}">
<!-- 文本 -->
<view
class=
"uni-share full-width"
:style=
"
{height: data.windowHeight +'px'}"
v-if="e_active == 3 || e_active == 4">
...
...
@@ -445,8 +423,10 @@
</textsettings>
</view>
</view>
<!-- 贴图/模板形状 -->
<view
v-else
class=
"uni-share full-width"
:style=
"
{height: data.windowHeight +'px'}">
<view
v-if=
"e_active == 2 || e_active == 23 || e_active == 99 || e_active == 24"
class=
"uni-share full-width"
:style=
"
{height: data.windowHeight +'px'}">
<!-- 遮罩 -->
<view
class=
"full-width"
style=
"position: absolute; bottom: 0; left: 0; height: 100%; z-index: 997; opacity: 0.8;"
...
...
@@ -455,17 +435,7 @@
<view
style=
"position: absolute; bottom: 0upx; left: 0; height: 100%; width: 120upx; z-index: 999; background: #1A1D33; overflow: hidden;"
>
<view
style=
"width: 120upx; height: 188upx;"
>
<!--
<view
style=
"position: relative;width: 120upx; height: 188upx;"
v-if=
"e_active == 2 || e_active == 23"
@
click=
"bgColorClick()"
>
<image
v-if=
"backgroundColor"
src=
"../../static/dise.png"
mode=
""
style=
"width: 66upx; height: 398upx; margin: auto; display: block;
position: absolute; top: -210upx; left: 0; right: 0;"
></image>
<view
v-if=
"backgroundColor"
style=
"text-align: center; position: absolute; left: 0; right: 0; bottom: 10upx; color: #FFFFFF;"
>
底
<br/>
色
</view>
<image
v-if=
"!backgroundColor"
src=
"../../static/bizhi.png"
mode=
""
style=
"width: 66upx; height: 231upx; margin: auto; display: block;
position: absolute; top: -40upx; left: 0; right: 0;"
></image>
<view
v-if=
"!backgroundColor"
style=
"text-align: center; position: absolute; left: 0; right: 0; bottom: 10upx; color: #000;"
>
贴
<br/>
图
</view>
</view>
-->
</view>
<view
style=
"width: 120upx;"
:style=
"
{height: (data.windowHeight - 188 * data.pixelRate) +'px'}"
v-if="e_active == 2 || e_active == 23 || e_active == 99 ">
...
...
@@ -483,12 +453,12 @@
</view>
</view>
<view
style=
"position: absolute; bottom: 0upx; left: 120upx; height: 100%; width: calc(100% - 240upx);
z-index: 999; overflow: hidden; background: #282932;"
>
z-index: 999; overflow: hidden; background: #282932;
"
>
<!-- 轮播图 -->
<view
style=
"position: relative; width: calc(100% - 40upx); z-index: 99; margin:30upx auto;"
>
<view
style=
"position: relative; width: calc(100% - 40upx); z-index: 99; margin:30upx auto;
"
>
<swiper
:autoplay=
"true"
:interval=
"3000"
:duration=
"1000"
:indicator-dots=
"true"
:indicator-active-color=
"'#ffffff'"
style=
"height: 15
0upx; width: 100%; border-radius: 10upx; overflow: hidden; margin:auto
;"
>
style=
"height: 15
5upx; width: 100%; border-radius: 10upx; overflow: hidden; margin:auto; margin-top:55upx
;"
>
<swiper-item
v-for=
"(item, index) in Adlists"
:key=
"index"
class=
"full-width"
>
<image
:src=
"item.content + '?x-oss-process=image/resize,lfit,w_375'"
mode=
"aspectFill"
class=
"full-width full-height"
...
...
@@ -496,8 +466,7 @@
</swiper-item>
</swiper>
</view>
<!-- material_series_list 二级分类 -->
<!--
<view
style=
"font-size: 40upx;color: #007AFF;"
>
11111
{{
material_series_list
.
length
}}
<view>
-->
<view
id=
"classification"
v-if=
"e_active == 2 || e_active == 23 || e_active == 99"
style=
"width: 100%; position: relative; z-index: 99; "
>
<view
style=
"overflow: hidden;"
v-if=
"material_series_list.length > 0"
>
...
...
@@ -509,9 +478,7 @@
</view>
</view>
</view>
<!-- 特效添加相框 -->
<!--
<shapeScrollView
v-if=
"e_active == 22"
ref=
"shapeScrollView"
@
Worksdetail=
"Worksdetail"
:windowHeight=
"(data.windowHeight * 0.8 - 160 * data.pixelRate)"
></shapeScrollView>
-->
<!-- 贴图 -->
<scrollList
v-if=
" e_active == 2 || e_active == 23 || e_active == 99 "
ref=
"scrollList"
@
Worksdetail=
"Worksdetail"
:classificationHeight=
"classificationHeight"
...
...
@@ -521,12 +488,12 @@
@
bgColorAssembly=
"bgColorAssembly"
:classificationHeight=
"classificationHeight"
:windowHeight=
"(data.windowHeight)"
>
</bgColor>
</view>
</view>
<view
v-else
style=
"width: 100%; width: 100%; opacity: 1;"
></view>
<view
v-if=
"e_active == 0"
style=
"width: 100%; height:100%; opacity: 1;"
></view>
</uni-popup>
<uni-popup
ref=
"showpicture"
type=
"bottom"
@
change=
"change"
style=
"position: fixed; z-index: 9999;"
>
<view
class=
"uni-share"
...
...
@@ -764,13 +731,14 @@
isCustomize
:
false
,
//是否自定义
options
:
{},
defalutFillet
:
0
,
//默认圆角
pixelScale
:
0.
55
,
pixelScale
:
0.
6
,
customize_size_id
:
""
,
//自定义尺寸Id
isUpLoadImage
:
false
,
//是否上传图片
design_widthrate
:
1
,
//宽度比率
design_heightrate
:
1
,
//高度比率
design_bgwidthrate
:
1
,
//背景宽度比率
design_bgheightrate
:
1
,
//背景高度比率
pixel_scale
:
1
,
};
},
...
...
@@ -825,8 +793,8 @@
//添加涂鸦
tuyaimg
(
e
)
{
console
.
log
(
e
)
let
index
=
items
.
length
;
items
.
push
({
support_zoom
:
1
,
// 0是不支持缩放,为1时支持缩放
support_drag
:
1
,
// 0是不支持拖动,为1时支持拖动
...
...
@@ -889,7 +857,7 @@
this
.
data
.
goods_id
=
item
.
id
;
snapshot
=
[];
// 操作历史记录清空
snapshotIndex
=
-
1
;
//
获取产品详情数据
//获取产品详情数据
this
.
goodslist
()
},
...
...
@@ -1005,6 +973,7 @@
});
});
},
drawImg
(
e
,
res
)
{
this
.
showtwo
=
true
},
...
...
@@ -1019,7 +988,6 @@
sourceType
:
[
'camera'
,
'album'
],
//从相册选择
count
:
1
,
success
:
(
res
)
=>
{
//console.log(res)
let
tempFilePaths
=
res
.
tempFilePaths
;
var
size
=
res
.
tempFiles
[
0
].
size
;
var
path
=
res
.
tempFiles
[
0
].
path
;
...
...
@@ -1049,7 +1017,6 @@
count
:
1
,
success
:
(
res
)
=>
{
this
.
$refs
[
'showpicture'
].
close
();
//console.log(res.tempFilePaths)
let
tempFilePaths
=
res
.
tempFilePaths
;
// let tempFilePaths = 'http://ws.colorpark.cn/static/alioss/images/icon_picture.png';
var
size
=
res
.
tempFiles
[
0
].
size
;
...
...
@@ -1079,7 +1046,6 @@
count
:
1
,
success
:
(
res
)
=>
{
this
.
$refs
[
'showpicture'
].
close
();
//console.log(res.tempFilePaths)
let
tempFilePaths
=
res
.
tempFilePaths
;
// let tempFilePaths = 'http://ws.colorpark.cn/static/alioss/images/icon_picture.png';
var
size
=
res
.
tempFiles
[
0
].
size
;
...
...
@@ -1112,9 +1078,6 @@
var
size
=
res
.
tempFiles
[
0
].
size
;
var
path
=
res
.
tempFiles
[
0
].
path
;
tempFilePaths
[
0
]
=
path
;
//let tempFilePaths =res.tempFiles.path;
//var size = res.tempFiles.size;
//console.log("微信上传图片" + tempFilePaths + size + path)
var
formatImage
=
path
.
split
(
"."
)[(
path
.
split
(
"."
)).
length
-
1
];
if
(
formatImage
!=
"png"
&&
formatImage
!=
"jpg"
&&
formatImage
!=
"jpeg"
)
{
return
wx
.
showToast
({
...
...
@@ -1129,18 +1092,20 @@
}
})
},
//选择微信相片跟本地相册弹框
selectPicturePop
()
{
this
.
delete_wrap_state
=
false
this
.
showone
=
false
this
.
$refs
[
'showpicture'
].
open
()
},
//选择微信相片跟本地相册弹框取消
selectPicturePopColse
()
{
//this.delete_wrap_state = false
this
.
showone
=
false
this
.
$refs
[
'showpicture'
].
close
();
},
/* 函数描述:作为上传文件时递归上传的函数体体;
* 参数描述:
* filePaths是文件路径数组
...
...
@@ -1148,7 +1113,6 @@
* failUp是上传失败的个数->0
* i是文件路径数组的指标->0
* length是文件路径数组的长度
* machine_id=user_id=
*/
uploadDIY
(
tempFilePaths
,
successUp
,
failUp
,
i
,
length
)
{
let
machine_id
=
this
.
machine_id
||
0
...
...
@@ -1183,7 +1147,6 @@
success
:
function
(
res
)
{
successUp
++
;
if
(
res
.
statusCode
!=
200
)
{
// console.log({errCode: '599', msg:'其他错误'})
return
;
}
if
(
res
.
statusCode
==
200
)
{
...
...
@@ -1192,7 +1155,7 @@
title
:
'上传成功'
,
icon
:
'none'
,
duration
:
3000
})
})
;
uni
.
getImageInfo
({
src
:
tempFilePaths
[
i
],
success
:
(
image
)
=>
{
...
...
@@ -1209,7 +1172,6 @@
width
=
_this
.
data
.
editorWidth
*
_this
.
mix_scale
height
=
image
.
height
*
ratiowidth
_this
.
isShowGif
=
true
;
let
index
=
items
.
length
;
items
.
push
({
...
...
@@ -1259,18 +1221,17 @@
initialScaley
:
1
,
// 图片高缩放比例
initialWidth
:
width
,
// 图片原始宽度
initialHeight
:
height
,
// 图片原始高度
frame_left
:
null
,
// 裁剪窗口x
image_left
:
null
,
// 图片x
frame_top
:
null
,
// 裁剪窗口y
image_top
:
null
,
// 图片y
frame_left
:
0
,
// 裁剪窗口x
image_left
:
0
,
// 图片x
frame_top
:
0
,
// 裁剪窗口y
image_top
:
0
,
// 图片y
})
_this
.
isUpLoadImage
=
false
;
_this
.
data
.
itemList
=
items
_this
.
data
.
itemList
=
items
;
_this
.
saveSnapshot
();
}
});
}
// console.log(atter.host + '/' + atter.dir + time + '.jpg')
},
fail
:
function
(
err
)
{
_this
.
isUpLoadImage
=
false
;
...
...
@@ -1282,17 +1243,17 @@
})
},
complete
:
function
(
err
)
{
//
console.log('总共' + successUp + '张上传成功,' + failUp + '张上传失败!');
//console.log('总共' + successUp + '张上传成功,' + failUp + '张上传失败!');
}
})
uploadTask
.
onProgressUpdate
((
res
)
=>
{
//
console.log('上传进度', res.progress + " " + new Date())// console.log('已经上传的数据长度', res.totalBytesSent)// console.log('预期需要上传的数据总长度', res.totalBytesExpectedToSend)
//console.log('上传进度', res.progress + " " + new Date())// console.log('已经上传的数据长度', res.totalBytesSent)// console.log('预期需要上传的数据总长度', res.totalBytesExpectedToSend)
_this
.
percent
=
res
.
progress
-
1
})
}
})
},
//
移除遮罩形状
//移除遮罩形状
empty
()
{
if
(
this
.
shape_image
!=
''
)
{
uni
.
showToast
({
...
...
@@ -1357,12 +1318,6 @@
})
}
});
// }).catch(err => {
// uni.showToast({
// title: '当前打印站正在维护',
// icon: 'none'
// });
// });
}
else
{
uni
.
showToast
({
title
:
'啊嘞,色彩定制站必须扫码才能使用'
,
...
...
@@ -1389,9 +1344,7 @@
item
.
rotate
=
item
.
angle
width
=
(
item
.
width
*
item
.
scale
);
height
=
(
item
.
height
*
item
.
scale
);
scalePos
=
this
.
calNoScalePos
(
item
.
left
,
item
.
top
,
item
.
width
,
item
.
height
);
left
=
item
.
left
;
top
=
item
.
top
;
...
...
@@ -1413,21 +1366,12 @@
let
widScale
=
1
;
let
heiScale
=
1
;
//console.log(this.isCustomize)
if
(
!
this
.
isCustomize
)
{
widScale
=
pixelRate
*
this
.
design_widthrate
/
(
this
.
real_width
/
150
);
//宽度比例
heiScale
=
pixelRate
*
this
.
design_heightrate
/
(
this
.
real_width
/
150
);
//高度比例
}
else
{
//this.data.editorWidth / this.options.real_width
//this.data.editorHeight / this.options.real_height
widScale
=
this
.
data
.
editorWidth
/
this
.
options
.
real_width
//宽度比例
heiScale
=
this
.
data
.
editorHeight
/
this
.
options
.
real_height
//高度比例
// console.log("this.data.editorWidth="+this.data.editorWidth+
// "this.options.real_width ="+this.options.real_width +
// "this.data.editorHeight="+this.data.editorHeight+
// "this.data.real_height="+this.options.real_height
// )
}
var
comlist
=
{
...
...
@@ -1504,9 +1448,7 @@
})
var
data
;
if
(
this
.
isCustomize
)
{
data
=
{
s
:
'Works.save'
,
components
:
components
,
...
...
@@ -1649,8 +1591,11 @@
},
touchEnd
(
ev
)
{
// 获取当前选中的部件
var
item
=
items
[
index
];
if
(
item
!=
undefined
)
{
if
(
item
!=
undefined
&&
item
!=
null
)
{
item
.
typetext
=
null
}
},
...
...
@@ -2025,7 +1970,6 @@
})
},
handleScroll
(
index
,
item
)
{
//选中
this
.
queryPage
.
material_series_id
=
0
this
.
material_series_currentId
=
0
...
...
@@ -2139,7 +2083,6 @@
//this.currentIndex = this.currentIndex;
this
.
collection_currentId
=
this
.
currentId
;
this
.
collection_currentIndex
=
this
.
currentIndex
;
this
.
$nextTick
(()
=>
{
setTimeout
(
function
()
{
this
.
$refs
[
'scrollList'
].
open
({
...
...
@@ -2154,7 +2097,6 @@
}
},
MaterialseriesList
()
{
//查询分类下二级分类
this
.
material_series_list
=
[]
homeservice
.
queryList
({
...
...
@@ -2207,7 +2149,6 @@
});
},
//打开弹框 1模板 2贴图 3字体 4编辑 22添加相框 23壁纸
showPopup
(
e
)
{
this
.
isShowGif
=
false
;
...
...
@@ -2223,39 +2164,11 @@
if
(
e
==
1
)
{
//模板
}
else
if
(
e
==
2
)
{
//贴图
this
.
Adlists
=
this
.
diy_bannerList
this
.
queryPage
.
goods_id
=
this
.
data
.
goods_id
this
.
brands
=
this
.
Material_category
this
.
currentId
=
this
.
currentId_Material
;
this
.
currentIndex
=
this
.
currentIndex_Material
;
this
.
queryPage
.
s
=
'Material.list'
this
.
queryPage
.
works_category_id
=
null
this
.
queryPage
.
material_category_id
=
null
if
(
this
.
brands
[
this
.
currentId
].
title
==
'热门'
)
{
this
.
queryPage
.
is_hot
=
'1'
this
.
queryPage
.
is_new
=
null
}
else
if
(
this
.
brands
[
this
.
currentId
].
title
==
'最新'
)
{
this
.
queryPage
.
is_new
=
'1'
this
.
queryPage
.
is_hot
=
null
}
else
{
this
.
queryPage
.
is_hot
=
null
this
.
queryPage
.
is_new
=
null
this
.
queryPage
.
material_category_id
=
this
.
Material_category
[
0
].
id
if
(
this
.
Material_category_id
)
{
this
.
queryPage
.
material_category_id
=
this
.
Material_category_id
}
}
if
(
this
.
mapping_material_series_currentId
!=
0
)
{
this
.
queryPage
.
material_series_id
=
this
.
mapping_material_series_currentId
this
.
material_series_currentId
=
this
.
mapping_material_series_currentId
}
this
.
MaterialseriesList
()
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'scrollList'
].
open
({
e
:
e
,
queryPage
:
this
.
queryPage
,
})
})
this
.
category
(
2
);
}
else
if
(
e
==
3
)
{
//文本
index
=
null
this
.
addtext
=
true
...
...
@@ -2277,40 +2190,10 @@
}
else
if
(
e
==
22
)
{
//形状
}
else
if
(
e
==
23
)
{
//壁纸
this
.
Adlists
=
this
.
diy_backList
this
.
queryPage
.
goods_id
=
this
.
data
.
goods_id
this
.
brands
=
this
.
wallpaper_category
//壁纸分类
this
.
currentId
=
this
.
currentId_wallpaper
;
/* 控制被选中 */
this
.
currentIndex
=
this
.
currentIndex_wallpaper
;
/* 控制位置 */
this
.
queryPage
.
s
=
'Material.list'
this
.
queryPage
.
works_category_id
=
null
//作品选中分类id
this
.
queryPage
.
material_category_id
=
null
//贴图选中分类
if
(
this
.
wallpaper_material_series_currentId
!=
0
)
{
this
.
queryPage
.
material_series_id
=
this
.
wallpaper_material_series_currentId
this
.
material_series_currentId
=
this
.
wallpaper_material_series_currentId
}
//console.log("brands="+this.currentId); /* this.brands.length */
if
(
this
.
brands
[
this
.
currentId
].
title
==
'热门'
)
{
this
.
queryPage
.
is_hot
=
'1'
this
.
queryPage
.
is_new
=
null
}
else
if
(
this
.
brands
[
this
.
currentId
].
title
==
'最新'
)
{
this
.
queryPage
.
is_new
=
'1'
this
.
queryPage
.
is_hot
=
null
}
else
{
this
.
queryPage
.
is_hot
=
null
this
.
queryPage
.
is_new
=
null
this
.
queryPage
.
material_category_id
=
this
.
wallpaper_category
[
0
].
id
if
(
this
.
wallpaper_category_id
)
{
this
.
queryPage
.
material_category_id
=
this
.
wallpaper_category_id
}
}
this
.
MaterialseriesList
()
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'scrollList'
].
open
({
e
:
e
,
queryPage
:
this
.
queryPage
,
})
})
this
.
category
(
23
);
}
else
if
(
e
==
24
)
{
this
.
Adlists
=
this
.
diy_bannerList
this
.
backgroundColor
=
true
;
...
...
@@ -2347,7 +2230,6 @@
this
.
currentId
=
0
;
this
.
currentIndex
=
0
;
/* 控制位置 */
}
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'scrollList'
].
open
({
e
:
e
,
...
...
@@ -2361,13 +2243,15 @@
},
cancel
(
type
)
{
//关闭弹框
this
.
e_active
=
0
console
.
log
(
"关闭弹框"
)
this
.
e_active
=
0
this
.
isShowGif
=
false
;
try
{
this
.
$refs
[
'show'
+
type
].
close
()
}
catch
(
e
)
{
}
this
.
$refs
[
'showshare'
].
close
()
this
.
isUpLoadImage
=
false
;
this
.
addtext
=
false
if
(
wx
.
pageScrollTo
)
{
...
...
@@ -2761,7 +2645,15 @@
items
[
index
].
activehorn
=
true
// 角状态
items
[
index
].
activeedge
=
true
// 边状态
}
//记录中心位置
items
[
i
].
centerPos
=
{
x
:
items
[
i
].
left
+
items
[
i
].
width
/
2
,
y
:
items
[
i
].
top
+
items
[
i
].
height
/
2
}
items
[
i
].
x
=
items
[
i
].
centerPos
.
x
;
items
[
i
].
y
=
items
[
i
].
centerPos
.
y
;
}
this
.
active
=
true
this
.
data
.
listActive
=
true
this
.
data
.
cidx
=
index
...
...
@@ -3378,65 +3270,47 @@
s
:
'Product.detail'
,
id
:
this
.
data
.
goods_id
}).
then
(
result
=>
{
this
.
titlename
=
result
.
name
+
" "
+
this
.
titlename
//修改头部名称
let
pixel_scale
=
1
if
(
this
.
options
.
WidthIndex
>
(
this
.
data
.
windowWidth
*
this
.
pixelScale
))
{
pixel_scale
=
(
this
.
data
.
windowWidth
*
this
.
pixelScale
)
/
this
.
options
.
WidthIndex
this
.
pixel_scale
=
(
this
.
data
.
windowWidth
*
this
.
pixelScale
)
/
this
.
options
.
WidthIndex
}
else
{
if
(
this
.
options
.
WidthIndex
<
(
this
.
data
.
windowWidth
*
this
.
pixelScale
)
&&
this
.
options
.
HeightIndex
<
(
this
.
data
.
windowHeight
*
this
.
pixelScale
))
{
pixel_scale
=
1
this
.
pixel_scale
=
1
}
}
if
(
this
.
options
.
HeightIndex
>
(
this
.
data
.
windowHeight
*
this
.
pixelScale
))
{
if
((
this
.
data
.
windowHeight
*
this
.
pixelScale
)
/
this
.
options
.
HeightIndex
<
this
.
pixel_scale
)
{
pixel_scale
=
(
this
.
data
.
windowHeight
*
this
.
pixelScale
)
/
this
.
options
.
HeightIndex
this
.
pixel_scale
=
(
this
.
data
.
windowHeight
*
this
.
pixelScale
)
/
this
.
options
.
HeightIndex
}
}
else
{
if
(
this
.
options
.
WidthIndex
<
(
this
.
data
.
windowWidth
*
this
.
pixelScale
)
&&
this
.
options
.
HeightIndex
<
(
this
.
data
.
windowHeight
*
this
.
pixelScale
))
{
pixel_scale
=
1
this
.
pixel_scale
=
1
}
}
// if (this.options.WidthIndex > (this.data.windowWidth * this.data.pixelRate)) {
// pixel_scale = (this.data.windowWidth * this.data.pixelRate) / this.options.WidthIndex
// } else {
// if (this.options.WidthIndex
<
(
this
.
data
.
windowWidth
*
this
.
data
.
pixelRate
)
&&
this
.
options
// .HeightIndex
<
(
this
.
data
.
windowHeight
*
this
.
data
.
pixelRate
))
{
// pixel_scale = 1
// }
// }
// if (this.options.HeightIndex > (this.data.windowHeight * this.data.pixelRate)) {
// if ((this.data.windowHeight * this.data.pixelRate) / this.options.HeightIndex
<
// pixel_scale) {
// pixel_scale = (this.data.windowHeight * this.data.pixelRate) / this.options.HeightIndex
// }
// } else {
// if (this.options.WidthIndex
<
(
this
.
data
.
windowWidth
*
this
.
data
.
pixelRate
)
&&
this
.
options
// .HeightIndex
<
(
this
.
data
.
windowHeight
*
this
.
data
.
pixelRate
))
{
// pixel_scale = 1
// }
//}
this
.
design_width
=
(
this
.
options
.
WidthIndex
*
pixel_scale
)
/
this
.
data
.
pixelRate
// 设计宽度
this
.
design_height
=
(
this
.
options
.
HeightIndex
*
pixel_scale
)
/
this
.
data
.
pixelRate
// 设计高度
this
.
design_width
=
(
this
.
options
.
WidthIndex
*
this
.
pixel_scale
)
/
this
.
data
.
pixelRate
// 设计宽度
this
.
design_height
=
(
this
.
options
.
HeightIndex
*
this
.
pixel_scale
)
/
this
.
data
.
pixelRate
// 设计高度
uni
.
getImageInfo
({
src
:
result
.
front_image_old
,
success
:
(
front_image
)
=>
{
this
.
data
.
bgHeight
=
this
.
data
.
bgHeight
// 画布高度
this
.
front_image_long
=
true
},
fail
:
err
=>
{
this
.
front_image_long
=
true
}
})
//this.front_image_long = true
this
.
data
.
editorWidth
=
this
.
design_width
*
this
.
data
.
pixelRate
// 设计宽度
this
.
data
.
editorHeight
=
this
.
design_height
*
this
.
data
.
pixelRate
// 设计高度
this
.
editory
=
(
this
.
data
.
windowHeight
-
this
.
data
.
editorHeight
)
/
2
;
//辅助线距离
//console.log(this.options)
this
.
design_widthrate
=
(
this
.
design_width
/
result
.
print_width
)
// 设计区放大宽度比率
this
.
design_heightrate
=
(
this
.
design_height
/
result
.
print_height
)
// 设计区放大高度比率
if
(
this
.
options
.
defalutFillet
!=
"0"
&&
this
.
options
.
defalutFillet
>=
0
)
{
...
...
@@ -3446,14 +3320,6 @@
this
.
defalutFillet
=
0
;
}
//this.design_bgwidthrate = this.options.WidthIndex / result.print_width // 设计区放大宽度比率
//this.design_bgheightrate = this.options.HeightIndex / result.print_height // 设计区放大高度比率
//this.design_widthrate = this.design_width / result.print_width // 设计区放大宽度比率
//this.design_heightrate = this.design_height / result.print_height // 设计区放大高度比率
this
.
data
.
bgImage
=
result
.
front_image
// 背景图
this
.
data
.
bgImage_old
=
result
.
front_image_old
// 旧背景图
this
.
data
.
bgImage_thumbnail
=
result
.
thumbnail
// 介绍图片(主图遮罩)
...
...
@@ -3491,11 +3357,9 @@
uni
.
getImageInfo
({
src
:
result
.
front_image_old
,
success
:
(
front_image
)
=>
{
// this.data.bgHeight = (front_image.height + 600) * (this.data.bgWidth / front_image.width) // 画布高度
this
.
data
.
bgHeight
=
this
.
data
.
bgHeight
// 画布高度
this
.
editory
=
(
this
.
data
.
bgHeight
-
(
result
.
design_height
*
this
.
data
.
pixelRate
))
/
2
;
//辅助线距离
.
data
.
pixelRate
))
/
2
;
//辅助线距离
this
.
data
.
editorWidth
=
result
.
design_width
*
this
.
data
.
pixelRate
// 设计宽度
this
.
data
.
editorHeight
=
result
.
design_height
*
this
.
data
...
...
@@ -3510,13 +3374,10 @@
}
})
this
.
data
.
bgImage
=
result
.
front_image
// 背景图
this
.
data
.
bgImage_old
=
result
.
front_image_old
// 旧背景图
this
.
data
.
bgImage_thumbnail
=
result
.
thumbnail
// 介绍图片(主图遮罩)
this
.
design_color
=
result
.
design_color
// 背景颜色
this
.
mix_scale
=
result
.
mix_scale
//上传图片比率
this
.
design_height
=
result
.
design_height
// 设计高度
this
.
design_width
=
result
.
design_width
// 设计宽度
...
...
@@ -3524,6 +3385,7 @@
this
.
print_width
=
result
.
print_width
// 设计基础高度
this
.
center_scale
=
result
.
center_scale
//设计器中心点位置对应底图高度占比(居中=0.5)
this
.
location_scale
=
result
.
location_scale
//参考线中心点对应设计器高度占比(居中=0.5)
}).
catch
(
err
=>
{
uni
.
showToast
({
title
:
err
.
msg
,
...
...
@@ -3531,58 +3393,125 @@
});
});
},
category
()
{
//查询贴图分类 key=0贴图
homeservice
.
queryList
({
s
:
'Material.category'
,
machine_id
:
this
.
machine_id
,
key
:
0
,
}).
then
(
result
=>
{
this
.
Material_category
=
result
this
.
Material_category
.
unshift
({
icon
:
"../../static/image/icon_new_default.png"
,
icon_click
:
"../../static/image/icon_new_pressed.png"
,
title
:
"最新"
},
)
}).
catch
(
err
=>
{
uni
.
showToast
({
title
:
err
.
msg
,
icon
:
'none'
})
});
//查询壁纸分类 key=1壁纸
homeservice
.
queryList
({
s
:
'Material.category'
,
machine_id
:
this
.
machine_id
,
key
:
1
,
}).
then
(
result
=>
{
console
.
log
(
"壁纸"
)
this
.
wallpaper_category
=
result
this
.
wallpaper_category
.
unshift
({
icon
:
"../../static/image/icon_new_default.png"
,
icon_click
:
"../../static/image/icon_new_pressed.png"
,
title
:
"最新"
},
)
category
(
type
)
{
if
(
type
==
2
)
{
//查询贴图分类 key=0贴图
homeservice
.
queryList
({
s
:
'Material.category'
,
machine_id
:
this
.
machine_id
,
key
:
0
,
}).
then
(
result
=>
{
this
.
Material_category
=
result
this
.
Material_category
.
unshift
({
icon
:
"../../static/image/icon_new_default.png"
,
icon_click
:
"../../static/image/icon_new_pressed.png"
,
title
:
"最新"
},
)
this
.
Adlists
=
this
.
diy_bannerList
//console.log(this.Adlists)
this
.
queryPage
.
goods_id
=
this
.
data
.
goods_id
this
.
brands
=
this
.
Material_category
this
.
currentId
=
this
.
currentId_Material
;
this
.
currentIndex
=
this
.
currentIndex_Material
;
this
.
queryPage
.
s
=
'Material.list'
this
.
queryPage
.
works_category_id
=
null
this
.
queryPage
.
material_category_id
=
null
if
(
this
.
brands
[
this
.
currentId
].
title
==
'热门'
)
{
this
.
queryPage
.
is_hot
=
'1'
this
.
queryPage
.
is_new
=
null
}
else
if
(
this
.
brands
[
this
.
currentId
].
title
==
'最新'
)
{
this
.
queryPage
.
is_new
=
'1'
this
.
queryPage
.
is_hot
=
null
}
else
{
this
.
queryPage
.
is_hot
=
null
this
.
queryPage
.
is_new
=
null
this
.
queryPage
.
material_category_id
=
this
.
Material_category
[
0
].
id
if
(
this
.
Material_category_id
)
{
this
.
queryPage
.
material_category_id
=
this
.
Material_category_id
}
}
if
(
this
.
mapping_material_series_currentId
!=
0
)
{
this
.
queryPage
.
material_series_id
=
this
.
mapping_material_series_currentId
this
.
material_series_currentId
=
this
.
mapping_material_series_currentId
}
this
.
MaterialseriesList
()
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'scrollList'
].
open
({
e
:
2
,
queryPage
:
this
.
queryPage
,
})
})
}).
catch
(
err
=>
{
uni
.
showToast
({
title
:
err
.
msg
,
icon
:
'none'
})
});
}
}).
catch
(
err
=>
{
uni
.
showToast
({
title
:
err
.
msg
,
icon
:
'none'
if
(
type
==
23
)
{
//查询壁纸分类 key=1壁纸
homeservice
.
queryList
({
s
:
'Material.category'
,
machine_id
:
this
.
machine_id
,
key
:
1
,
}).
then
(
result
=>
{
this
.
wallpaper_category
=
result
this
.
wallpaper_category
.
unshift
({
icon
:
"../../static/image/icon_new_default.png"
,
icon_click
:
"../../static/image/icon_new_pressed.png"
,
title
:
"最新"
},
)
this
.
Adlists
=
this
.
diy_backList
this
.
queryPage
.
goods_id
=
this
.
data
.
goods_id
this
.
brands
=
this
.
wallpaper_category
//壁纸分类
this
.
currentId
=
this
.
currentId_wallpaper
;
/* 控制被选中 */
this
.
currentIndex
=
this
.
currentIndex_wallpaper
;
/* 控制位置 */
this
.
queryPage
.
s
=
'Material.list'
this
.
queryPage
.
works_category_id
=
null
//作品选中分类id
this
.
queryPage
.
material_category_id
=
null
//贴图选中分类
if
(
this
.
wallpaper_material_series_currentId
!=
0
)
{
this
.
queryPage
.
material_series_id
=
this
.
wallpaper_material_series_currentId
this
.
material_series_currentId
=
this
.
wallpaper_material_series_currentId
}
if
(
this
.
brands
[
this
.
currentId
].
title
==
'热门'
)
{
this
.
queryPage
.
is_hot
=
'1'
this
.
queryPage
.
is_new
=
null
}
else
if
(
this
.
brands
[
this
.
currentId
].
title
==
'最新'
)
{
this
.
queryPage
.
is_new
=
'1'
this
.
queryPage
.
is_hot
=
null
}
else
{
this
.
queryPage
.
is_hot
=
null
this
.
queryPage
.
is_new
=
null
this
.
queryPage
.
material_category_id
=
this
.
wallpaper_category
[
0
].
id
if
(
this
.
wallpaper_category_id
)
{
this
.
queryPage
.
material_category_id
=
this
.
wallpaper_category_id
}
}
this
.
MaterialseriesList
()
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'scrollList'
].
open
({
e
:
23
,
queryPage
:
this
.
queryPage
,
})
})
}).
catch
(
err
=>
{
uni
.
showToast
({
title
:
err
.
msg
,
icon
:
'none'
});
});
});
}
},
itemlongtap
(
e
)
{
//长按事件
var
item
=
items
[
index
];
// 获取当前选中的部件
// if(!this.isRotate && this.system_config.golf_diy.value == 1){
// if (item.type != 1) {
// this.$nextTick(() => {
// this.$refs['replacebottom'].open()
// })
// }
// }
},
itemTouchStart
:
infoListTouchEvent
.
start
.
bind
(
infoListTouchEvent
),
itemTouchMove
:
infoListTouchEvent
.
move
.
bind
(
infoListTouchEvent
),
...
...
@@ -3619,7 +3548,7 @@
this
.
infoListTouchEvent
=
infoListTouchEvent
;
this
.
infoListTouchEvent
.
bind
({
doubleTap
:
function
(
e
)
{
th
is
.
isShowGif
=
false
;
th
at
.
isShowGif
=
false
;
if
(
items
[
index
].
type
==
0
)
{
that
.
state
=
true
that
.
$refs
.
index
.
init
();
...
...
@@ -3661,7 +3590,7 @@
touchEnd
:
function
(
e
)
{
that
.
dragEnd
(
e
)
let
item
=
items
[
index
];
if
(
item
.
scale
!=
1
)
{
if
(
item
!=
null
&&
item
.
scale
!=
1
)
{
//初始化的位置
drag
.
initPosscale
(
item
)
drag
.
getTransferPositionangle
(
item
.
left
,
item
.
top
,
item
.
width
,
item
.
height
,
item
.
angle
,
...
...
@@ -3678,7 +3607,6 @@
animationData
:
that
.
animation
.
export
()
})
if
(
that
.
deleteWrap
==
true
)
{
//that.deleteItem()
that
.
removedeleteItem
();
that
.
deleteWrap
=
false
}
...
...
@@ -3765,7 +3693,7 @@
}
else
{
that
.
goodslist
()
// 获取产品详情数据
}
that
.
category
()
// 作品分类 贴图分类
//
that.category() // 作品分类 贴图分类
}
})
},
...
...
pages/index/js/drag.js
View file @
5ca35981
...
...
@@ -3,7 +3,6 @@ const drag = {
* 部件缩放中事件四角缩放
*/
scaleMove
(
e
,
item
,
data
,
allLineListData
,
designWidth
,
designHeight
)
{
console
.
log
(
item
)
item
.
isShowLineV
=
false
;
//初始化默认不显示
item
.
isShowLineH
=
false
;
//初始化默认不显示
var
minwwidth
=
20
...
...
@@ -169,7 +168,6 @@ const drag = {
}
},
/**
* @description: 记录按下数据
*/
...
...
@@ -216,7 +214,6 @@ const drag = {
y
:
'top'
}
}
//记录对应坐标点坐标
if
(
fixed
!=
null
)
{
//初始化盒子上下左右位置
...
...
@@ -232,7 +229,6 @@ const drag = {
}
},
//计算旋转后坐标点
rotatedPoint
(
rect
,
rotate
,
point
)
{
let
{
...
...
@@ -259,7 +255,6 @@ const drag = {
//四边伸缩
edgeMove
(
e
,
item
,
data
,
allLineListData
,
designWidth
,
designHeight
)
{
//修改属性状态
item
.
active
=
true
//辅助线
item
.
activeguide
=
false
//辅助线
...
...
@@ -327,7 +322,6 @@ const drag = {
let
newScale
=
1
;
if
(
item
.
typetext
==
"right"
)
{
let
right
=
designWidth
-
(
item
.
left
+
item
.
width
);
item
.
left
=
item
.
elmX
;
//重新赋值左上角x位置
item
.
width
=
item
.
elmW
//重新设置宽度
...
...
@@ -339,7 +333,6 @@ const drag = {
}
}
else
if
(
item
.
typetext
==
"left"
)
{
newScale
=
item
.
elmW
/
item
.
lastElmW
//计算新比例
let
distanceLeft
=
0
if
(
item
.
lastImageLeft
>
0
)
{
...
...
@@ -357,7 +350,6 @@ const drag = {
}
}
else
if
(
item
.
typetext
==
"top"
)
{
newScale
=
item
.
elmH
/
item
.
lastElmH
//计算新比例
let
distanceTop
=
0
if
(
item
.
lastImageTop
>
0
)
{
...
...
@@ -365,7 +357,6 @@ const drag = {
}
else
{
distanceTop
=
item
.
lastImageTop
+
(
item
.
elmH
-
item
.
lastElmH
);
}
if
(
distanceTop
<
0
)
{
item
.
image_top
=
distanceTop
;
}
else
{
...
...
@@ -376,7 +367,6 @@ const drag = {
}
}
else
if
(
item
.
typetext
==
"bottom"
)
{
let
buttom
=
designHeight
-
(
item
.
top
+
item
.
height
);
newScale
=
item
.
elmH
/
item
.
lastElmH
//计算新比例
if
(
newScale
>
1
)
{
//开始放大处理
...
...
@@ -427,13 +417,10 @@ const drag = {
* @description: 计算移动前坐标值
*/
getRotatedPoint
(
curPos
,
centerPos
,
angle
)
{
let
radian
=
Math
.
PI
/
180
*
angle
;
return
{
x
:
Math
.
floor
((
curPos
.
x
-
centerPos
.
x
)
*
Math
.
cos
(
radian
)
-
(
curPos
.
y
-
centerPos
.
y
)
*
Math
.
sin
(
radian
)
+
centerPos
.
x
),
y
:
Math
.
floor
((
curPos
.
y
-
centerPos
.
y
)
*
Math
.
cos
(
radian
)
+
(
curPos
.
x
-
centerPos
.
x
)
*
Math
.
sin
(
radian
)
+
centerPos
.
y
)
x
:
Math
.
floor
((
curPos
.
x
-
centerPos
.
x
)
*
Math
.
cos
(
radian
)
-
(
curPos
.
y
-
centerPos
.
y
)
*
Math
.
sin
(
radian
)
+
centerPos
.
x
),
y
:
Math
.
floor
((
curPos
.
y
-
centerPos
.
y
)
*
Math
.
cos
(
radian
)
+
(
curPos
.
x
-
centerPos
.
x
)
*
Math
.
sin
(
radian
)
+
centerPos
.
y
)
}
},
...
...
@@ -491,7 +478,7 @@ const drag = {
* @description: 计算变换后的方框四个角的位置
*/
getTransferPositionangle
(
left
,
top
,
width
,
height
,
angle
,
center
,
item
)
{
// 计算变换后的方框四个角的位置
},
/**
...
...
@@ -581,13 +568,10 @@ const drag = {
},
/**
* 图片拖动中事件
*/
dragMove
(
e
,
item
,
data
,
editor_top
)
{
item
.
isShowLineV
=
false
;
item
.
isShowLineH
=
false
;
let
mouseX
=
e
.
touches
[
0
].
clientX
;
...
...
@@ -600,13 +584,10 @@ const drag = {
let
diffY
=
mouseY
-
item
.
startY
let
dX
=
diffX
let
dY
=
diffY
item
.
elmX
+=
diffX
item
.
elmY
+=
diffY
item
.
left
=
item
.
elmX
item
.
top
=
item
.
elmY
if
(
item
.
newRotate
==
0
)
{
if
(
item
.
left
>
(
data
.
editorWidth
/
2
-
5
)
&&
item
.
left
<
(
data
.
editorWidth
/
2
+
5
))
{
/* 辅助线左侧磁性吸附 */
...
...
@@ -659,7 +640,6 @@ const drag = {
//添加所有参考线x轴y轴
addallLineListDataXAndY
(
item
)
{
if
(
item
.
angle
!=
0
)
{
var
center
=
{
x
:
item
.
left
+
(
item
.
width
)
/
2
,
...
...
pages/index/machineDetail.vue
View file @
5ca35981
...
...
@@ -30,8 +30,7 @@
background: linear-gradient(92deg, #E6B01A, #F29F3D);
box-shadow: 0px 19px 48px 1px rgba(20, 31, 62, 0.35);
border-radius: 40px;"
>
<view
style=
" text-align: center; line-height: 100upx; font-size: 36upx; font-weight: 500; color: #FFFFFF;"
>
<view
style=
" text-align: center; line-height: 100upx; font-size: 36upx; font-weight: 500; color: #FFFFFF;"
>
立即定制
</view>
</view>
</view>
...
...
@@ -115,11 +114,8 @@
toCustomSize
()
{
uni
.
navigateTo
({
url
:
'../mall/size?machine_id='
+
this
.
machine_id
+
// + "&title=" + item.title + "&real_width=" + item.key +
"&isFirstPage=true"
+
"&machineDetail="
+
JSON
.
stringify
(
this
.
list
)
// url: '../index/size?machine_id=' + this.machine_id +
// '&key=' + this.key;
})
},
...
...
pages/index/scrollView.vue
View file @
5ca35981
<
template
>
<!-- 贴图 -->
<view
class=
"content"
style=
"width: 100%; height: 100%; position: relative;"
:style=
"
{height: (windowHeight
- classificationHeight
) +'px'}">
<view
class=
"content"
style=
"width: 100%; height: 100%; position: relative;
z-index: 999999;
"
:style=
"
{height: (windowHeight
+ 80
) +'px'}">
<refresh
@
interrupt=
"interrupt"
@
pushToInterrupt=
"pushToInterrupt"
@
finished=
"finished"
@
scrolltolower=
"g"
:scrollHeight=
"(windowHeight
- classificationHeight
)"
:scrollTop=
"scrollViewTop"
@
scroll=
"scroll"
>
:scrollHeight=
"(windowHeight
+ 80
)"
:scrollTop=
"scrollViewTop"
@
scroll=
"scroll"
>
<template
slot=
"top"
>
<view
style=
"color: #FFFFFF;position: absolute; top: 0;width: 100%; text-align: center;"
:style=
"'height:' + 40 + 'px; line-height:' + 40 + 'px;'"
>
{{
tip
}}
</view>
...
...
pages/index/switchGoods.vue
View file @
5ca35981
<
template
>
<view
v-if=
"isShow"
style=
" width: 100%;
height: 100%;
"
>
<view
v-if=
"isShow"
style=
" width: 100%; "
>
<view
style=
"position: absolute; top: 0; width: 100%; height: 100%; background: #999999; z-index:997; opacity: 0.5; "
...
...
@@ -77,7 +77,7 @@
margin: 0 auto;
line-height: 84upx;
margin-top:20upx;
text-align: center;"
>
自定义
</view>
text-align: center;"
>
自定义
尺寸
</view>
</view>
</view>
...
...
pages/index/textsettings.vue
View file @
5ca35981
...
...
@@ -763,9 +763,7 @@
this
.
inputBottom
=
0
},
typefaceClick
(
e
,
index
)
{
console
.
log
(
this
.
typefacedata
.
length
)
console
.
log
(
index
+
1
)
// console.log(index + 1)
if
((
index
+
1
)
==
this
.
typefacedata
.
length
){
if
(
e
.
textlong
==
true
){
this
.
$emit
(
'typefaceClick'
,
e
)
...
...
@@ -779,16 +777,6 @@
}
else
{
this
.
$emit
(
'typefaceClick'
,
e
)
}
// if(e.textlong == true){
// this.$emit('typefaceClick', e)
// }else{
// if(e.remark != ''){
// this.loadFont(e)
// }else{
// this.$emit('typefaceClick', e)
// }
// }
},
loadFont
(
textlist
)
{
let
that
=
this
;
...
...
@@ -811,7 +799,6 @@
},
complete
(
res
)
{
uni
.
hideLoading
();
// wx.showToast({title: '字体下载完成',icon: 'success',duration: 2000});
textlist
.
long
=
true
that
.
setData
({
typefacedata
:
that
.
typefacedata
});
that
.
$emit
(
'typefaceClick'
,
textlist
)
...
...
@@ -875,32 +862,9 @@
this
.
typeface
(
'typeface'
)
this
.
inputBottom
=
'none'
}
// 字体列表
// homeservice.queryList({
// s: 'Material.fontFamilyList'
// }).then(result => {
// result.forEach(item=>{
// item.long = false
// item.textlong = null
// })
// result.unshift({
// id: 0,
// key: "",
// remark: "",
// title: "思源黑体",
// textlong:true,
// long:true
// })
// this.typefacedata = result
// }).catch(err => {
// });
if
(
this
.
$base
.
typefacedata
.
length
>
0
){
this
.
typefacedata
=
this
.
$base
.
typefacedata
console
.
log
(
this
.
$base
.
typefacedata
)
}
}
}
}
...
...
pages/index/tuya.vue
View file @
5ca35981
...
...
@@ -52,38 +52,17 @@
begin
:
false
,
bgColor
:
'rgba(255, 255, 255, 0)'
,
toolArr
:
[
// {
// title: '清空',
// icon: '../../static/png/tool_clear.png',
// selectIcon: '../../static/png/tool_clear_s.png',
// select: false,
// url: 'clear'
// },
{
title
:
'撤销'
,
icon
:
'
../../static/png/tool_eraser.png'
,
selectIcon
:
'.
./../static/png/tool_eraser.png'
,
icon
:
'
'
,
//../../static/png/tool_eraser.png
selectIcon
:
'.
'
,
//../../static/png/tool_eraser.png
select
:
false
,
url
:
'eraser'
},
// {
// title: '画笔',
// icon: '../../static/png/tool_pen.png',
// selectIcon: '../../static/png/tool_pen_s.png',
// select: true,
// url: 'pen'
// },
// {
// title: '颜色',
// icon: '../../static/png/tool_color.png',
// selectIcon: '../../static/png/tool_color_s.png',
// select: false,
// url: 'color'
// },
{
title
:
'确认'
,
icon
:
'
../../static/png/icon_confirm.png'
,
selectIcon
:
'
../../static/png/icon_confirm.png'
,
icon
:
'
'
,
//../../static/png/icon_confirm.png
selectIcon
:
'
'
,
//../../static/png/icon_confirm.png
select
:
false
,
url
:
'save'
}
...
...
@@ -96,7 +75,6 @@
hollowCircleMode
:
false
,
lastHollowRect
:
{},
lastHollowCircle
:
{},
MobilePhoneHeight
:
0
,
MobilePhoneWidth
:
0
,
pixelRate
:
1
,
...
...
@@ -152,11 +130,11 @@
icon
:
'none'
,
duration
:
3000
})
// console.log(atter.host + '/' + atter.dir + time + '.png')
let
url
=
atter
.
host
+
'/'
+
atter
.
dir
+
time
+
'.png'
_this
.
$emit
(
'tuyaimg'
,
url
)
_this
.
$refs
[
'brandscenter'
].
close
()
_this
.
openState
=
false
_this
.
openState
=
false
_this
.
$emit
(
'tuyaimg'
,
url
)
}
},
fail
:
function
(
err
)
{
...
...
@@ -167,7 +145,7 @@
})
},
complete
:
function
(
err
)
{
// console.log('总共' + successUp + '张上传成功,' + failUp + '张上传失败!');
}
})
}
...
...
@@ -204,7 +182,6 @@
})
},
colorPickTapHandler
(
obj
)
{
// console.log('我点击的颜色:' + JSON.stringify(obj));
this
.
colorPanelShow
=
false
;
this
.
toolArr
.
forEach
(
item
=>
{
item
.
select
=
false
;
...
...
@@ -221,7 +198,6 @@
this
.
drawContext
.
strokeStyle
=
obj
.
color
;
},
penWidthChangeHandler
(
width
)
{
// console.log('画笔宽度:' + width);
this
.
lineWidth
=
width
;
this
.
drawContext
.
setLineWidth
(
width
);
this
.
drawContext
.
setLineCap
(
'round'
)
// 让线条圆润
...
...
@@ -235,7 +211,6 @@
break
;
case
'eraser'
:
this
.
canvas_restore
()
// this.drawContext.strokeStyle = 'rgba(255, 255, 255, 0)';
this
.
colorPanelShow
=
false
;
break
;
case
'pen'
:
...
...
@@ -249,7 +224,6 @@
break
;
case
'color'
:
this
.
colorPanelShow
=
!
this
.
colorPanelShow
;
// this.drawMode = this.colorPanelShow ? false : true;
break
;
case
'save'
:
if
(
that
.
canvas_neto
.
length
<
1
)
{
...
...
@@ -259,23 +233,7 @@
uni
.
canvasToTempFilePath
({
canvasId
:
'drawCanvas'
,
success
:
function
(
res
)
{
// console.log('回调参数:' + JSON.stringify(res))
that
.
uploadDIY
(
res
.
tempFilePath
);
// console.log('回调参数:' + JSON.stringify(res));
// 在H5平台下,tempFilePath 为 base64
// uni.saveImageToPhotosAlbum({
// filePath: res.tempFilePath,
// success: function(res) {
// console.log('回调参数:' + JSON.stringify(res))
// // console.log('成功回调参数:' + JSON.stringify(res));
// // that.$api.msgSuccess('保存成功');
// },
// fail: function(res) {
// console.log('回调参数:' + JSON.stringify(res))
// // console.log('失败回调参数:' + JSON.stringify(res));
// // that.$api.msgSuccess('保存成功');
// }
// });
},
fail
:
function
(
res
)
{
console
.
log
(
'fail'
+
JSON
.
stringify
(
res
));
...
...
@@ -285,43 +243,6 @@
case
'close'
:
this
.
cancelBrand
();
break
;
// case 'hollowRect':
// this.hollowRectMode = true;
// this.rectMode = false;
// this.circleMode = false;
// this.hollowCircleMode = false;
// this.penMode = false;
// this.colorPanelShow = false;
// this.drawContext.strokeStyle = this.currentColor;
// // this.drawContext.restore();
// break;
// case 'hollowCircle':
// this.hollowRectMode = false;
// this.rectMode = false;
// this.circleMode = false;
// this.hollowCircleMode = true;
// this.penMode = false;
// this.colorPanelShow = false;
// this.drawContext.strokeStyle = this.currentColor;
// break;
// case 'rect':
// this.hollowRectMode = false;
// this.rectMode = true;
// this.circleMode = false;
// this.hollowCircleMode = false;
// this.penMode = false;
// this.colorPanelShow = false;
// this.drawContext.strokeStyle = this.currentColor;
// break;
// case 'circle':
// this.hollowRectMode = false;
// this.rectMode = false;
// this.circleMode = true;
// this.hollowCircleMode = false;
// this.penMode = false;
// this.colorPanelShow = false;
// this.drawContext.strokeStyle = this.currentColor;
// break;
default
:
break
;
}
...
...
@@ -348,7 +269,6 @@
touchStart
(
e
)
{
this
.
initBoard
();
if
(
this
.
penMode
)
{
// console.log('我能够进行绘制--touchStart---x' + e.touches[0].x + '----y----' + e.touches[0].y);
this
.
lineBegin
(
e
.
touches
[
0
].
x
,
e
.
touches
[
0
].
y
)
this
.
canvas_neto
.
push
({
point_x
:
e
.
touches
[
0
].
x
,
...
...
@@ -359,13 +279,13 @@
})
this
.
draw
(
true
);
}
else
if
(
this
.
rectMode
)
{
// this.rectBegin(e.touches[0].x, e.touches[0].y)
}
else
if
(
this
.
hollowRectMode
)
{
// this.hollowRectBegin(e.touches[0].x, e.touches[0].y)
}
else
if
(
this
.
hollowCircleMode
)
{
// this.hollowCircleBegin(e.touches[0].x, e.touches[0].y)
}
else
if
(
this
.
circleMode
)
{
// this.circleBegin(e.touches[0].x, e.touches[0].y)
}
this
.
curDrawArr
.
push
({
x
:
e
.
touches
[
0
].
x
,
...
...
@@ -375,7 +295,6 @@
touchMove
(
e
)
{
if
(
this
.
begin
)
{
if
(
this
.
penMode
)
{
// console.log('我能够进行绘制--touchMove----x' + e.touches[0].x + '----y----' + e.touches[0].y);
this
.
lineAddPoint
(
e
.
touches
[
0
].
x
,
e
.
touches
[
0
].
y
);
this
.
draw
(
true
);
this
.
canvas_neto
[
this
.
canvas_neto
.
length
-
1
].
list
.
push
({
...
...
pages/mall/lineUp.vue
View file @
5ca35981
...
...
@@ -20,14 +20,14 @@
:style=
"
{background: designer.status.value == 1 ? '#ffffff' :'#EEEEEE;'}">
<view
style=
" display: flex; align-items: center;"
>
<view
v-if=
"designer.user_id != userId"
style=
"margin:20upx 20upx;width: 3
4
0upx; height: 140upx; position: relative; overflow: hidden; opacity: 0.3; "
>
style=
"margin:20upx 20upx;width: 3
8
0upx; height: 140upx; position: relative; overflow: hidden; opacity: 0.3; "
>
<view
style=
"width: 140upx; height: 140upx;border-radius: 20upx; background: #FFFFFF;"
>
</view>
<image
style=
"width: 90upx; height: 90upx; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
margin: auto; z-index:2;"
:src=
"designer.works_image + '?x-oss-process=image/resize,lfit,w_300'"
mode=
"aspectFit"
></image>
</view>
<view
v-if=
"designer.user_id == userId"
style=
"margin:20upx 20upx;width: 3
4
0upx; height: 140upx; position: relative; overflow: hidden; "
>
style=
"margin:20upx 20upx;width: 3
8
0upx; height: 140upx; position: relative; overflow: hidden; "
>
<view
style=
"width: 140upx; height: 140upx;border-radius: 20upx; background: #FFFFFF;"
></view>
<image
style=
"width: 90upx; height: 90upx; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
margin: auto; z-index:2;"
:src=
"designer.works_image + '?x-oss-process=image/resize,lfit,w_300'"
mode=
"aspectFit"
></image>
...
...
@@ -66,8 +66,7 @@
<view
style=
"width: 558upx;position: absolute; top: 40upx "
>
<view
style=
"display: flex; align-items: center; justify-content: center;
width: 100%; height: 200upx; margin: auto;"
>
<image
:src=
"designer.works_image + '?x-oss-process=image/resize,lfit,w_120'"
mode=
"aspectFit"
style=
" margin: auto; width: 120upx; max-height: 200upx; "
></image>
<image
:src=
"designer.works_image + '?x-oss-process=image/resize,lfit,w_120'"
mode=
"aspectFit"
style=
" margin: auto; width: 120upx; max-height: 200upx; "
></image>
</view>
<!-- 作品排队中 -->
<view
style=
"text-align: center; font-size: 34upx; margin-top: 50upx;"
>
{{
lineStatusText
}}
</view>
...
...
pages/mall/size.vue
View file @
5ca35981
<
template
>
<view
class=
"edit-address full-height full-width"
>
<!--
<myhead
:title=
"'自定义尺寸'"
:color=
"'#131319'"
:titleShow=
"true"
:backShow=
"true"
:background=
"'#fff'"
></myhead>
-->
<view
class=
"form full-width"
>
<view
style=
"width: 100%; height: 85upx; display: flex;align-items: center; justify-content: center; "
>
<view
style=
"width: 100%; height: 70upx; display: flex;align-items: center; justify-content: center; "
>
<view
style=
"display: flex;font-size: 30upx; margin:auto;
width: 300upx; height: 70upx; background: #282932; border-radius: 50upx; color: #FFFFFF;"
>
<view
:class=
"
{'previewAxtiveLeft':!preview}" @click=" onclickTitle(false) "
...
...
@@ -20,11 +17,10 @@
</view>
<!-- 宽
{{
pixel_Width
}}
高:
{{
pixel_Height
}}
比例
{{
pixel_scale
}}
-->
<!--
{{
pixel_scale
}}{{
pixel_Width
}}
-->
<view
v-if=
"!preview"
class=
"full-width"
scroll-y
style=
"height: calc(100% - 160upx);overflow: scroll;"
>
<view
style=
"
max-height: 630upx; height: 63
0upx; overflow: scroll;
<view
style=
"
height: 70
0upx; overflow: scroll;
overflow: hidden;
margin:0
auto 47upx;display: fle
x;
margin:0
upx auto 40upx;display: flex; margin-top: 10up
x;
justify-content: center; align-items: center; "
:style=
"
{width: (pixel_Width * pixel_scale) +'px', borderRadius: defalutFillet + 'px'}">
<view
...
...
@@ -34,7 +30,7 @@
</view>
<view
style=
"position: relative;"
>
<!-- 自定义高度 -->
<view
style=
"display: flex; align-items: center; justify-content: center; margin-top:
10
upx;"
>
<view
style=
"display: flex; align-items: center; justify-content: center; margin-top:
5
upx;"
>
<view
style=
"font-size: 30upx; font-weight: 400; color: #FFFFFF; width: 180upx;"
>
物料宽度:
</view>
<view
style=
"width: 282upx; height: 66upx; background: #282932; border-radius: 30upx;
display: flex; align-items: center;"
>
...
...
@@ -53,7 +49,6 @@
<view
style=
"color: #898989; font-size: 26upx; width: 82upx;"
>
{{
companyValue
}}
</view>
</view>
</view>
<view
style=
"display: flex; align-items: center;justify-content: center; margin-top: 25upx;"
>
<view
style=
"font-size: 30upx; font-weight: 400; color: #FFFFFF; width: 180upx;"
>
圆角半径:
</view>
<view
style=
"width: 282upx; height: 66upx;
...
...
@@ -64,7 +59,6 @@
</view>
</view>
</view>
</view>
<!-- 预置 -->
<view
v-if=
"preview"
class=
"full-width"
>
...
...
@@ -207,21 +201,19 @@
queryPage
:
{},
good_id
:
"217"
,
//产品Id
isFirstPage
:
true
,
machineDetail
:
null
//设备对象
machineDetail
:
null
,
//设备对象
pixelScale
:
0.6
,
//比例
}
},
methods
:
{
onclickTitle
(
preview
)
{
this
.
preview
=
preview
if
(
this
.
preview
)
{
this
.
defalutFillet
=
0
this
.
newDefalutFilletData
=
0
;
if
(
!
this
.
Specifications
)
{
this
.
dataLoadState
=
{
pullDownRefresh
:
false
,
...
...
@@ -234,8 +226,6 @@
this
.
queryPage
.
s
=
'CanvasSize.list'
this
.
loadGoodsList
(
Enums
.
DATA_DIRECTION
.
UP
);
}
}
},
...
...
@@ -262,7 +252,6 @@
.
inputWidth
))
},
//显示商品弹框
showManyGoodPop
()
{
this
.
$refs
[
'showManyGood'
].
open
();
...
...
@@ -274,31 +263,23 @@
},
refundNumorder
(
item
)
{
let
real_radius
=
Number
(
item
.
real_radius
);
let
real_height
=
Number
(
item
.
real_height
);
let
real_width
=
Number
(
item
.
real_width
);
//判断是否超过对应宽高比
let
minWidthAanHeight
=
0
;
if
(
real_height
>
real_width
)
{
minWidthAanHeight
=
real_width
}
else
{
minWidthAanHeight
=
real_height
}
if
(
real_radius
>
minWidthAanHeight
/
2
)
{
real_radius
=
Math
.
floor
(
minWidthAanHeight
/
2
)
}
let
WidthIndex
=
item
.
real_width
*
this
.
OldConvert_rate
let
HeightIndex
=
item
.
real_height
*
this
.
OldConvert_rate
let
nameStr
=
item
.
name
let
unit
=
item
.
unit
;
let
customize_size_id
=
item
.
id
//console.log(item)
if
(
this
.
isFirstPage
&&
this
.
isFirstPage
==
"true"
)
{
...
...
@@ -355,7 +336,6 @@
});
return
;
}
let
unit
=
null
let
real_width
=
null
let
real_height
=
null
...
...
@@ -406,7 +386,6 @@
title
:
'创建成功!'
,
duration
:
2000
});
//console.log(result)
if
(
this
.
isFirstPage
&&
this
.
isFirstPage
==
"true"
)
{
uni
.
redirectTo
({
url
:
'../index/index?machine_id='
+
this
.
parameter
.
machine_id
+
...
...
@@ -422,7 +401,6 @@
"&customize_size_id="
+
result
.
id
})
}
else
{
//console.log("defalutFilletData=" + defalutFilletData)
let
pages
=
getCurrentPages
();
var
prevPage
=
pages
[
pages
.
length
-
2
];
//上一个页面
//let machineDetail = encodeURIComponent(JSON.stringify(this.machineDetail));
...
...
@@ -450,7 +428,6 @@
icon
:
'none'
});
});
},
touchstart
(
item
,
index
)
{
...
...
@@ -490,9 +467,11 @@
});
}.
bind
(
this
),
500
);
},
touchend
()
{
clearInterval
(
this
.
Loop
);
},
OnclickSpecifications
(
e
)
{
this
.
dataLoadState
=
{
pullDownRefresh
:
false
,
...
...
@@ -510,6 +489,7 @@
}
this
.
loadGoodsList
(
Enums
.
DATA_DIRECTION
.
UP
);
},
direction
()
{
//横屏竖屏
this
.
directionState
=
!
this
.
directionState
// 赋值
...
...
@@ -517,24 +497,21 @@
let
h
=
this
.
pixel_Height
this
.
pixel_Width
=
h
this
.
pixel_Height
=
w
// if(this.companyValue == '毫米'){
// this.inputWidth = h / this.convert_rate
// this.inputHeight = w / this.convert_rate
// }else if(this.companyValue == '厘米'){
this
.
inputWidth
=
h
/
this
.
convert_rate
this
.
inputHeight
=
w
/
this
.
convert_rate
// }
//固定比率
this
.
wValue
=
h
this
.
hValue
=
w
},
equalRatio
()
{
//固定比率
this
.
equalRatioState
=
!
this
.
equalRatioState
//固定比率
this
.
wValue
=
this
.
pixel_Width
this
.
hValue
=
this
.
pixel_Height
},
// 确定 e.value[0]
//确定 e.value[0]
onConfirm
(
e
)
{
if
(
this
.
companyValue
==
e
.
label
)
{
return
...
...
@@ -590,31 +567,32 @@
inputHeight
:
Height
});
//文本
}
this
.
previewWidth
=
this
.
inputWidth
*
this
.
convert_rate
this
.
previewHeight
=
this
.
inputHeight
*
this
.
convert_rate
this
.
pixel_Width
=
this
.
previewWidth
this
.
pixel_Height
=
this
.
previewHeight
if
(
this
.
pixel_Width
>
(
this
.
data
.
windowWidth
*
0.5
))
{
this
.
pixel_scale
=
(
this
.
data
.
windowWidth
*
0.5
)
/
this
.
pixel_Width
}
else
{
if
(
this
.
pixel_Width
<
(
this
.
data
.
windowWidth
*
0.5
)
&&
this
.
pixel_Height
<
(
this
.
data
.
windowHeight
*
0.5
))
{
this
.
pixel_scale
=
1
}
}
if
(
this
.
pixel_Height
>
(
this
.
data
.
windowHeight
*
0.5
))
{
if
((
this
.
data
.
windowHeight
*
0.5
)
/
this
.
pixel_Height
<
this
.
pixel_scale
)
{
this
.
pixel_scale
=
(
this
.
data
.
windowHeight
*
0.5
)
/
this
.
pixel_Height
}
}
else
{
if
(
this
.
pixel_Width
<
(
this
.
data
.
windowWidth
*
0.5
)
&&
this
.
pixel_Height
<
(
this
.
data
.
windowHeight
*
this
.
pixelScale
))
{
this
.
pixel_scale
=
1
}
}
this
.
getWindowScale
();
// if (this.pixel_Width > (this.data.windowWidth * this.pixelScale)) {
// this.pixel_scale = (this.data.windowWidth * this.pixelScale) / this.pixel_Width
// } else {
// if (this.pixel_Width
<
(
this
.
data
.
windowWidth
*
this
.
pixelScale
)
&&
this
.
pixel_Height
<
(
this
.
data
// .windowHeight * this.pixelScale)) {
// this.pixel_scale = 1
// }
// }
// if (this.pixel_Height > (this.data.windowHeight * this.pixelScale)) {
// if ((this.data.windowHeight * this.pixelScale) / this.pixel_Height
<
this
.
pixel_scale
)
{
// this.pixel_scale = (this.data.windowHeight * this.pixelScale) / this.pixel_Height
// }
// } else {
// if (this.pixel_Width
<
(
this
.
data
.
windowWidth
*
this
.
pixelScale
)
&&
this
.
pixel_Height
<
(
this
.
data
.
windowHeight
*
this
.
pixelScale
))
{
// this.pixel_scale = 1
// }
// }
//console.log("pixel_scale="+this.pixel_scale+"pixel_Width="+this.pixel_Width)
let
real_width
=
Number
(
this
.
inputWidth
);
let
real_height
=
Number
(
this
.
inputHeight
);
...
...
@@ -623,12 +601,10 @@
}
else
{
this
.
filletScale
=
real_height
/
100
;
}
let
defalutFilletValue
=
Math
.
floor
(
this
.
newDefalutFilletData
*
this
.
filletScale
)
this
.
defalutFillet
=
Math
.
floor
(
defalutFilletValue
*
(
this
.
pixel_Width
*
this
.
pixel_scale
/
this
.
inputWidth
));
this
.
$refs
[
'NumSlider'
].
initFilletRadius
(
this
.
newDefalutFilletData
,
this
.
filletScale
);
return
Width
},
...
...
@@ -665,31 +641,32 @@
duration
:
2000
});
}
this
.
previewWidth
=
this
.
inputWidth
*
this
.
convert_rate
this
.
previewHeight
=
this
.
inputHeight
*
this
.
convert_rate
this
.
pixel_Width
=
this
.
previewWidth
this
.
pixel_Height
=
this
.
previewHeight
if
(
this
.
pixel_Width
>
(
this
.
data
.
windowWidth
*
0.5
))
{
this
.
pixel_scale
=
(
this
.
data
.
windowWidth
*
0.5
)
/
this
.
pixel_Width
}
else
{
if
(
this
.
pixel_Width
<
(
this
.
data
.
windowWidth
*
0.5
)
&&
this
.
pixel_Height
<
(
this
.
data
.
windowHeight
*
0.5
))
{
this
.
pixel_scale
=
1
}
}
if
(
this
.
pixel_Height
>
(
this
.
data
.
windowHeight
*
0.5
))
{
if
((
this
.
data
.
windowHeight
*
0.5
)
/
this
.
pixel_Height
<
this
.
pixel_scale
)
{
this
.
pixel_scale
=
(
this
.
data
.
windowHeight
*
0.5
)
/
this
.
pixel_Height
}
}
else
{
if
(
this
.
pixel_Width
<
(
this
.
data
.
windowWidth
*
0.5
)
&&
this
.
pixel_Height
<
(
this
.
data
.
windowHeight
*
this
.
pixelScale
))
{
this
.
pixel_scale
=
1
}
}
this
.
getWindowScale
();
// if (this.pixel_Width > (this.data.windowWidth * 0.5)) {
// this.pixel_scale = (this.data.windowWidth * 0.5) / this.pixel_Width
// } else {
// if (this.pixel_Width
<
(
this
.
data
.
windowWidth
*
0.5
)
&&
this
.
pixel_Height
<
(
this
.
data
// .windowHeight * 0.5)) {
// this.pixel_scale = 1
// }
// }
// if (this.pixel_Height > (this.data.windowHeight * 0.5)) {
// if ((this.data.windowHeight * 0.5) / this.pixel_Height
<
this
// .pixel_scale) {
// this.pixel_scale = (this.data.windowHeight * 0.5) / this.pixel_Height
// }
// } else {
// if (this.pixel_Width
<
(
this
.
data
.
windowWidth
*
0.5
)
&&
this
.
pixel_Height
<
(
this
.
data
// .windowHeight * this.pixelScale)) {
// this.pixel_scale = 1
// }
// }
let
real_width
=
Number
(
this
.
inputWidth
);
let
real_height
=
Number
(
this
.
inputHeight
);
if
(
real_width
>
real_height
)
{
...
...
@@ -704,6 +681,33 @@
return
Height
},
//获取屏幕比例
getWindowScale
()
{
if
(
this
.
pixel_Width
>
(
this
.
data
.
windowWidth
*
this
.
pixelScale
))
{
this
.
pixel_scale
=
(
this
.
data
.
windowWidth
*
this
.
pixelScale
)
/
this
.
pixel_Width
}
else
{
if
(
this
.
pixel_Width
<
(
this
.
data
.
windowWidth
*
this
.
pixelScale
)
&&
this
.
pixel_Height
<
(
this
.
data
.
windowHeight
*
this
.
pixelScale
))
{
this
.
pixel_scale
=
1
}
}
if
(
this
.
pixel_Height
>
(
this
.
data
.
windowHeight
*
this
.
pixelScale
))
{
if
((
this
.
data
.
windowHeight
*
this
.
pixelScale
)
/
this
.
pixel_Height
<
this
.
pixel_scale
)
{
this
.
pixel_scale
=
(
this
.
data
.
windowHeight
*
this
.
pixelScale
)
/
this
.
pixel_Height
}
}
else
{
if
(
this
.
pixel_Width
<
(
this
.
data
.
windowWidth
*
this
.
pixelScale
)
&&
this
.
pixel_Height
<
(
this
.
data
.
windowHeight
*
this
.
pixelScale
))
{
this
.
pixel_scale
=
1
}
}
},
setData
(
obj
)
{
let
that
=
this
;
let
keys
=
[];
...
...
@@ -801,7 +805,6 @@
//做滚动加载使用
loadMore
()
{
//this.queryPage.page = this.queryPage.page + 1;
//this.loadGoodsList(Enums.DATA_DIRECTION.DOWN);
},
...
...
@@ -813,13 +816,10 @@
machine_id
:
this
.
queryPage
.
machine_id
};
homeservice
.
queryList
(
data
).
then
(
res
=>
{
let
width
=
this
.
render_cove_width
/
this
.
OldConvert_rate
let
height
=
this
.
render_cove_height
/
this
.
OldConvert_rate
let
width
=
this
.
render_cove_width
/
this
.
OldConvert_rate
let
height
=
this
.
render_cove_height
/
this
.
OldConvert_rate
//this.render_cove_width = this.machineDetail.size.width * this.OldConvert_rate //最大宽度
//this.render_cove_height = this.machineDetail.size.height * this.OldConvert_rate //最大高度
this
.
good_id
=
res
.
id
this
.
good
=
res
this
.
wValue
=
width
*
this
.
OldConvert_rate
//固定宽高比率计算(像素)
...
...
@@ -831,24 +831,26 @@
this
.
pixel_Width
=
width
*
this
.
OldConvert_rate
//实际(像素)
this
.
pixel_Height
=
height
*
this
.
OldConvert_rate
//实际(像素)
if
(
this
.
pixel_Width
>
(
this
.
data
.
windowWidth
*
0.5
))
{
this
.
pixel_scale
=
(
this
.
data
.
windowWidth
*
0.5
)
/
this
.
pixel_Width
}
else
{
if
(
this
.
pixel_Width
<
(
this
.
data
.
windowWidth
*
0.5
)
&&
this
.
pixel_Height
<
(
this
.
data
.
windowHeight
*
0.5
))
{
this
.
pixel_scale
=
1
}
}
if
(
this
.
pixel_Height
>
(
this
.
data
.
windowHeight
*
0.5
))
{
if
((
this
.
data
.
windowHeight
*
0.5
)
/
this
.
pixel_Height
<
1
)
{
this
.
pixel_scale
=
(
this
.
data
.
windowHeight
*
0.5
)
/
this
.
pixel_Height
}
}
else
{
if
(
this
.
pixel_Width
<
(
this
.
data
.
windowWidth
*
0.5
)
&&
this
.
pixel_Height
<
(
this
.
data
.
windowHeight
*
this
.
pixelScale
))
{
this
.
pixel_scale
=
1
}
}
this
.
getWindowScale
();
// if (this.pixel_Width > (this.data.windowWidth * 0.5)) {
// this.pixel_scale = (this.data.windowWidth * 0.5) / this.pixel_Width
// } else {
// if (this.pixel_Width
<
(
this
.
data
.
windowWidth
*
0.5
)
&&
// this.pixel_Height
<
(
this
.
data
.
windowHeight
*
0.5
))
{
// this.pixel_scale = 1
// }
// }
// if (this.pixel_Height > (this.data.windowHeight * 0.5)) {
// if ((this.data.windowHeight * 0.5) / this.pixel_Height
<
1
)
{
// this.pixel_scale = (this.data.windowHeight * 0.5) / this.pixel_Height
// }
// } else {
// if (this.pixel_Width
<
(
this
.
data
.
windowWidth
*
0.5
)
&&
this
.
pixel_Height
<
(
this
.
data
// .windowHeight * this.pixelScale)) {
// this.pixel_scale = 1
// }
// }
let
real_width
=
Number
(
this
.
inputWidth
);
let
real_height
=
Number
(
this
.
inputHeight
);
...
...
@@ -867,8 +869,7 @@
//查设备明细
getDetailMachine
()
{
this
.
OldConvert_rate
=
10
//this.OldConvert_rate = 10
this
.
getCustomSizeInfo
();
// homeservice.WorksList({
// machine_id: this.queryPage.machine_id,
...
...
util/wx-touch-event.js
View file @
5ca35981
...
...
@@ -133,7 +133,6 @@ class WxTouchEvent {
},
0
)
}
else
{
this
.
tapTimeout
=
setTimeout
(
function
()
{
console
.
info
(
"tap"
);
evt
.
type
=
"tap"
;
self
.
tap
.
dispatch
(
evt
);
// trigger double tap immediately
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment