Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
take_order
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
和慭琛
take_order
Commits
4ef5bba2
Commit
4ef5bba2
authored
Mar 30, 2021
by
李超鹏
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev-photo-v2' into dev-photo-v2
parents
2972153b
8784c284
Changes
10
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
956 additions
and
991 deletions
+956
-991
App.vue
take-order/App.vue
+352
-369
standard.vue
take-order/components/photo/standard.vue
+1
-7
pages.json
take-order/pages.json
+6
-2
wxlogin.vue
take-order/pages/login/wxlogin.vue
+368
-420
index.vue
take-order/pages/photo/index.vue
+6
-2
list.vue
take-order/pages/photo/list.vue
+12
-20
preview.vue
take-order/pages/photo/preview.vue
+12
-10
setting.vue
take-order/pages/photo/setting.vue
+72
-80
take.vue
take-order/pages/photo/take.vue
+86
-40
login.js
take-order/utils/login.js
+41
-41
No files found.
take-order/App.vue
View file @
4ef5bba2
This diff is collapsed.
Click to expand it.
take-order/components/photo/standard.vue
View file @
4ef5bba2
...
@@ -50,13 +50,7 @@
...
@@ -50,13 +50,7 @@
},
{
},
{
name
:
'之约'
name
:
'之约'
}],
}],
swiperList
:[{
swiperList
:[],
title
:
'记录的距离大家零点九零杰拉德杰拉德建立的连接就111111111111'
,
},{
title
:
'记录的距离大家零点九零杰拉德杰拉德建立的连接就222222'
,
},{
title
:
'记录的距离大家零点九零杰拉德杰拉德建立的连接就333333'
,
},],
// 因为内部的滑动机制限制,请将tabs组件和swiper组件的current用不同变量赋值
// 因为内部的滑动机制限制,请将tabs组件和swiper组件的current用不同变量赋值
current
:
0
,
// tabs组件的current值,表示当前活动的tab选项
current
:
0
,
// tabs组件的current值,表示当前活动的tab选项
swiperCurrent
:
0
,
// swiper组件的current值,表示当前那个swiper-item是活动的
swiperCurrent
:
0
,
// swiper组件的current值,表示当前那个swiper-item是活动的
...
...
take-order/pages.json
View file @
4ef5bba2
...
@@ -288,6 +288,10 @@
...
@@ -288,6 +288,10 @@
"name"
:
"照片预览"
,
//模式名称
"name"
:
"照片预览"
,
//模式名称
"path"
:
"pages/photo/preview"
,
//启动页面,必选
"path"
:
"pages/photo/preview"
,
//启动页面,必选
"query"
:
"standardId=1&img=https://papers.co/wallpaper/papers.co-bk57-art-illust-girl-pink-tomboy-red-6-wallpaper.jpg"
//启动参数,在页面的onLoad函数里面得到
"query"
:
"standardId=1&img=https://papers.co/wallpaper/papers.co-bk57-art-illust-girl-pink-tomboy-red-6-wallpaper.jpg"
//启动参数,在页面的onLoad函数里面得到
},{
"name"
:
"授权登录"
,
"path"
:
"pages/login/wxlogin"
,
"query"
:
""
}]
}]
}
}
}
}
take-order/pages/login/wxlogin.vue
View file @
4ef5bba2
This diff is collapsed.
Click to expand it.
take-order/pages/photo/index.vue
View file @
4ef5bba2
...
@@ -74,8 +74,6 @@
...
@@ -74,8 +74,6 @@
methods
:
{
methods
:
{
getRelationDictionaryV2
:
function
()
{
getRelationDictionaryV2
:
function
()
{
this
.
$u
.
cloudApi
.
getRelationDictionaryV2
().
then
(
res
=>
{
this
.
$u
.
cloudApi
.
getRelationDictionaryV2
().
then
(
res
=>
{
console
.
log
(
'V2:'
)
console
.
log
(
res
)
if
(
res
&&
res
.
result
)
{
if
(
res
&&
res
.
result
)
{
this
.
classifyList
=
res
.
result
this
.
classifyList
=
res
.
result
this
.
param
.
classifyId
=
res
.
result
[
0
].
id
this
.
param
.
classifyId
=
res
.
result
[
0
].
id
...
@@ -123,6 +121,12 @@
...
@@ -123,6 +121,12 @@
handleClick
()
{
handleClick
()
{
// 点击下一步设置全局拍照品牌品类
// 点击下一步设置全局拍照品牌品类
const
globalData
=
getApp
().
globalData
const
globalData
=
getApp
().
globalData
if
(
!
globalData
.
token
)
{
uni
.
navigateTo
({
url
:
'/pages/login/wxlogin'
})
return
}
let
keys
=
[
'brandId'
,
'brandName'
,
'classifyId'
,
'systemId'
]
let
keys
=
[
'brandId'
,
'brandName'
,
'classifyId'
,
'systemId'
]
keys
.
map
(
key
=>
{
keys
.
map
(
key
=>
{
globalData
.
photo
.
product
[
key
]
=
this
[
key
]
||
this
.
param
[
key
]
globalData
.
photo
.
product
[
key
]
=
this
[
key
]
||
this
.
param
[
key
]
...
...
take-order/pages/photo/list.vue
View file @
4ef5bba2
<
template
>
<
template
>
<view
class=
"backView"
>
<view
class=
"backView"
>
<u-loading
style=
"position: absolute;top: 50%;"
:show=
"loading"
size=
"36"
mode=
"flower"
></u-loading>
<view
class=
"topView"
>
<view
class=
"topView"
>
<view
:class=
"['topItemView',
{'active':activeTop===ikey}]" @click="handleTopItemChange(ikey,item)" v-for="(item,ikey) in dataList" :key="ikey">
<view
:class=
"['topItemView',
{'active':activeTop===ikey}]" @click="handleTopItemChange(ikey,item)" v-for="(item,ikey) in dataList" :key="ikey">
<text
<text
...
@@ -11,14 +12,14 @@
...
@@ -11,14 +12,14 @@
<view
class=
"right-view-title"
>
拍照项有:
</view>
<view
class=
"right-view-title"
>
拍照项有:
</view>
<template
v-for=
"(item,ikey) in rightList"
>
<template
v-for=
"(item,ikey) in rightList"
>
<view
class=
"rightItemView"
@
click=
"rightItemClick(item,ikey)"
:key=
"ikey"
>
<view
class=
"rightItemView"
@
click=
"rightItemClick(item,ikey)"
:key=
"ikey"
>
<view
:class=
"['rightContentView',
{'active':item.images.length > 0}]">
<view
:class=
"['rightContentView',
{'active':item.image
List.length > 0 || item.image
s.length > 0}]">
<text
class=
"ph-lst-item-index"
>
{{
ikey
+
1
}}
</text>
<text
class=
"ph-lst-item-index"
>
{{
ikey
+
1
}}
</text>
<text
class=
""
>
{{
item
.
name
}}
(
{{
item
.
image_count
}}
张)
</text>
<text
class=
""
>
{{
item
.
name
}}
</text>
<image
class=
"ph-list-item-arrow"
src=
"/static/photo/arrow.png"
></image>
<image
class=
"ph-list-item-arrow"
src=
"/static/photo/arrow.png"
></image>
<!--
<text
class=
"rightContent u-m-t-14 u-m-l-30 u-p-b-30"
>
{{
item
.
describe
}}
</text>
-->
<!--
<text
class=
"rightContent u-m-t-14 u-m-l-30 u-p-b-30"
>
{{
item
.
describe
}}
</text>
-->
</view>
</view>
<view
class=
"rightImageView"
v-if=
"item.image
s
"
>
<view
class=
"rightImageView"
v-if=
"item.image
List.length > 0 || item.images.length > 0
"
>
<image
class=
"rightImage"
v-for=
"(image, index) in
item.images
"
:src=
"image"
:key=
"image"
<image
class=
"rightImage"
v-for=
"(image, index) in
(item.imageList.length > 0 ? item.imageList : item.images)
"
:src=
"image"
:key=
"image"
@
click
.
stop=
"handleClickImage(item, index)"
mode=
""
></image>
@
click
.
stop=
"handleClickImage(item, index)"
mode=
""
></image>
</view>
</view>
</view>
</view>
...
@@ -41,7 +42,7 @@
...
@@ -41,7 +42,7 @@
brand
:
''
,
brand
:
''
,
brandId
:
''
,
brandId
:
''
,
dataList
:
[],
dataList
:
[],
loading
:
true
}
}
},
},
onLoad
(
e
)
{
onLoad
(
e
)
{
...
@@ -70,25 +71,17 @@
...
@@ -70,25 +71,17 @@
},
},
onShow
()
{
console
.
log
(
'onShow 里的rightList:'
)
console
.
log
(
this
.
rightList
)
},
methods
:
{
methods
:
{
getListData
:
function
()
{
getListData
:
function
()
{
this
.
loading
=
true
let
that
=
this
let
that
=
this
this
.
$u
.
cloudApi
.
getGroupStandardV2
({
this
.
$u
.
cloudApi
.
getGroupStandardV2
({
'token'
:
getApp
().
globalData
.
token
,
'token'
:
getApp
().
globalData
.
token
,
'classify_id'
:
this
.
classifyId
,
'classify_id'
:
this
.
classifyId
,
'system_id'
:
this
.
systemId
,
'system_id'
:
this
.
systemId
,
'brand_id'
:
this
.
brandId
'brand_id'
:
this
.
brandId
}).
then
(
res
=>
{
}).
then
(
res
=>
{
console
.
log
(
'获取规范标准数据:'
)
this
.
loading
=
false
console
.
log
(
res
)
if
(
res
&&
res
.
result
)
{
if
(
res
&&
res
.
result
)
{
that
.
handleData
(
res
.
result
)
that
.
handleData
(
res
.
result
)
}
}
...
@@ -120,14 +113,13 @@
...
@@ -120,14 +113,13 @@
// 点击图片
// 点击图片
handleClickImage
(
item
,
index
)
{
handleClickImage
(
item
,
index
)
{
uni
.
previewImage
({
uni
.
previewImage
({
urls
:
item
.
images
,
urls
:
item
.
image
List
.
length
>
0
?
item
.
imageList
:
item
.
image
s
,
current
:
index
current
:
index
})
})
},
},
//右侧点击
//右侧点击
rightItemClick
:
function
(
item
,
ikey
)
{
rightItemClick
:
function
(
item
,
ikey
)
{
console
.
log
(
item
,
'item'
)
const
photo
=
getApp
().
globalData
.
photo
const
photo
=
getApp
().
globalData
.
photo
photo
.
currentItem
=
item
photo
.
currentItem
=
item
uni
.
navigateTo
({
uni
.
navigateTo
({
...
...
take-order/pages/photo/preview.vue
View file @
4ef5bba2
<
template
>
<
template
>
<view>
<view>
<view
class=
"contentView"
>
<view
class=
"contentView"
>
<image
class=
"pic"
:src=
"files[0]"
mode=
"aspectFi
ll
"
@
click=
"showPreviewFn"
></image>
<image
class=
"pic"
:src=
"files[0]"
mode=
"aspectFi
t
"
@
click=
"showPreviewFn"
></image>
</view>
</view>
<view
class=
"bottomView"
>
<view
class=
"bottomView"
>
<image
class=
"btn"
:src=
"btn_remake"
@
click=
"remakePhoto"
></image>
<image
class=
"btn"
:src=
"btn_remake"
@
click=
"remakePhoto"
></image>
...
@@ -137,6 +137,7 @@
...
@@ -137,6 +137,7 @@
// photo.currentItem.
// photo.currentItem.
// 当前项的图片显示
// 当前项的图片显示
// 拍照项张数目增加 等于10张
// 拍照项张数目增加 等于10张
let
timer
=
setTimeout
(()
=>
{
if
(
photo
.
currentItemLength
<
10
){
if
(
photo
.
currentItemLength
<
10
){
uni
.
navigateBack
({
uni
.
navigateBack
({
delta
:
1
delta
:
1
...
@@ -146,6 +147,7 @@
...
@@ -146,6 +147,7 @@
url
:
"pages/photo/list"
url
:
"pages/photo/list"
})
})
}
}
},
2000
)
}
else
{
}
else
{
uni
.
showToast
({
uni
.
showToast
({
title
:
'图片上传失败'
title
:
'图片上传失败'
...
...
take-order/pages/photo/setting.vue
View file @
4ef5bba2
<
template
>
<
template
>
<view
class=
"backView"
>
<view
class=
"backView"
>
<u-loading
style=
"position: absolute;top: 50%;"
:show=
"loading"
size=
"36"
mode=
"flower"
></u-loading>
<view
class=
"itemView firstItem"
>
<view
class=
"itemView firstItem"
>
<view
class=
"itemTitleView"
>
<view
class=
"itemTitleView"
>
<text
class=
"itemTitle"
>
保存原图
</text>
<text
class=
"itemTitle"
>
保存原图
</text>
...
@@ -12,33 +13,34 @@
...
@@ -12,33 +13,34 @@
<text
class=
"itemTitle"
>
水印标题
</text>
<text
class=
"itemTitle"
>
水印标题
</text>
<text
class=
"itemNotice"
>
{{
result
[
'lower_right'
][
'title_text'
]
||
'点击可编辑更改'
}}
</text>
<text
class=
"itemNotice"
>
{{
result
[
'lower_right'
][
'title_text'
]
||
'点击可编辑更改'
}}
</text>
</view>
</view>
<switch
class=
"itemSwitch"
disabled
:checked=
"result['lower_right']['title_text']"
<switch
class=
"itemSwitch"
disabled
:checked=
"result['lower_right']['title_text']
!= ''
"
@
c
hange=
"itemChange(
{},-1)
" color="#007AFF" />
@
c
lick=
"handleClickTitleSwitch
"
color=
"#007AFF"
/>
</view>
</view>
<view
class=
"itemView"
v-for=
"(item,ikey) in itemList"
:key=
"ikey"
>
<view
class=
"itemView"
v-for=
"(item,ikey) in itemList"
:key=
"ikey"
>
<view
class=
"itemTitleView"
@
click=
"itemClick(item,ikey)"
>
<view
class=
"itemTitleView"
@
click=
"itemClick(item,ikey)"
>
<text
class=
"itemTitle"
>
{{
item
[
'watemark_text'
]
||
'自定义'
+
(
ikey
+
1
)
}}
</text>
<text
class=
"itemTitle"
>
{{
item
[
'watemark_text'
]
||
'自定义'
+
(
ikey
+
1
)
}}
</text>
<text
class=
"itemNotice"
>
{{
item
[
'watemark_value'
]
||
'点击可编辑更改'
}}
</text>
<text
class=
"itemNotice"
>
{{
item
[
'watemark_value'
]
||
'点击可编辑更改'
}}
</text>
</view>
</view>
<switch
class=
"itemSwitch"
:disabled=
"!item['enable']"
:checked=
"item['enable']"
<switch
class=
"itemSwitch"
:checked=
"item['enable']"
@
change=
"itemChange(item, ikey)"
color=
"#007AFF"
/>
@
change=
"itemChange(item, ikey)"
color=
"#007AFF"
/>
</view>
</view>
<view
class=
"shadowBackView"
v-if=
"isPopShow"
>
<u-popup
border-radius=
"10"
v-model=
"isPopShow"
safe-area-inset-bottom
:mask-close-able=
"false"
mode=
"center"
width=
"690rp"
height=
"600rpx"
>
<view
class=
"popCenterView"
>
<view
class=
"popCenterView"
>
<text
class=
"popTitle"
>
设置自定义项
</text>
<text
class=
"popTitle"
>
设置自定义项
</text>
<view
class=
"inputBackView"
>
<view
class=
"inputBackView"
>
<view
class=
"ph-pop-left-view"
>
<view
class=
"ph-pop-left-view"
>
<view
class=
"leftInputView"
>
<view
class=
"leftInputView"
>
<input
class=
"leftInput"
type=
"text"
v-model=
"currenItem['watemark_text']"
@
input=
"leftInput()"
<input
class=
"leftInput"
type=
"text"
v-model=
"currenItem['watemark_text']"
:disabled=
"currenItem.type === 'title_text'"
placeholder=
"请输入"
maxlength=
"10"
/>
@
input=
"leftInput()"
:disabled=
"currenItem.type === 'title_text'"
placeholder=
"请输入"
maxlength=
"10"
/>
</view>
</view>
<view
class=
"ph-pop-tip-view"
v-if=
"showTipLeft"
>
*必填项
</view>
<view
class=
"ph-pop-tip-view"
v-if=
"showTipLeft"
>
*必填项
</view>
</view>
</view>
<view
class=
"ph-pop-mid-view"
>
:
</view>
<view
class=
"ph-pop-mid-view"
>
:
</view>
<view>
<view>
<view
class=
"rightInputView"
>
<view
class=
"rightInputView"
>
<input
class=
"rightInput"
type=
"text"
v-model=
"currenItem['watemark_value']"
@
input=
"rightInput()"
<input
class=
"rightInput"
type=
"text"
v-model=
"currenItem['watemark_value']"
placeholder=
"请输入内容"
maxlength=
"30"
/>
@
input=
"rightInput()"
placeholder=
"请输入内容"
maxlength=
"30"
/>
</view>
</view>
<view
class=
"ph-pop-tip-view"
v-if=
"showTipRight"
>
*必填项
</view>
<view
class=
"ph-pop-tip-view"
v-if=
"showTipRight"
>
*必填项
</view>
</view>
</view>
...
@@ -54,7 +56,7 @@
...
@@ -54,7 +56,7 @@
</view>
</view>
</view>
</view>
</view>
</view>
</
view
>
</
u-popup
>
</view>
</view>
</
template
>
</
template
>
...
@@ -78,7 +80,8 @@
...
@@ -78,7 +80,8 @@
},
},
editingItem
:
{},
editingItem
:
{},
showTipLeft
:
false
,
showTipLeft
:
false
,
showTipRight
:
false
showTipRight
:
false
,
loading
:
true
}
}
},
},
computed
:
{
computed
:
{
...
@@ -108,38 +111,30 @@
...
@@ -108,38 +111,30 @@
getItemList
:
function
()
{
getItemList
:
function
()
{
// this.systemId = '79550af260555cc20afb34156c94b32c' // 测试数据
// this.systemId = '79550af260555cc20afb34156c94b32c' // 测试数据
uni
.
showLoading
();
this
.
loading
=
true
this
.
$u
.
cloudApi
.
getUserWatermark
({
this
.
$u
.
cloudApi
.
getUserWatermark
({
'token'
:
getApp
().
globalData
.
token
,
'token'
:
getApp
().
globalData
.
token
,
'system_id'
:
this
.
systemId
'system_id'
:
this
.
systemId
}).
then
(
res
=>
{
}).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
&&
res
.
result
)
{
if
(
res
&&
res
.
result
)
{
this
.
result
=
res
.
result
this
.
result
=
res
.
result
}
}
this
.
$nextTick
(
function
()
{
this
.
loading
=
false
uni
.
hideLoading
();
})
})
})
},
},
saveUserWatermark
:
function
()
{
saveUserWatermark
:
function
()
{
uni
.
showLoading
();
this
.
loading
=
true
this
.
$u
.
cloudApi
.
saveUserWatermark
({
this
.
$u
.
cloudApi
.
saveUserWatermark
({
'token'
:
getApp
().
globalData
.
token
,
'token'
:
getApp
().
globalData
.
token
,
'watermark'
:
this
.
result
'watermark'
:
this
.
result
}).
then
(
res
=>
{
}).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
.
result
==
true
)
{
if
(
res
.
result
==
true
)
{
const
photo
=
getApp
().
globalData
.
photo
const
photo
=
getApp
().
globalData
.
photo
photo
.
waterSetting
=
this
.
result
photo
.
waterSetting
=
this
.
result
}
}
this
.
$nextTick
(
function
()
{
this
.
loading
=
false
uni
.
hideLoading
();
})
})
})
},
},
...
@@ -149,25 +144,25 @@
...
@@ -149,25 +144,25 @@
this
.
saveUserWatermark
()
this
.
saveUserWatermark
()
},
},
handleClickTitleSwitch
:
function
(
e
)
{
var
string
=
this
.
result
[
'lower_right'
][
'title_text'
]
?
'水印标题不可关闭'
:
'请先编辑该自定义项'
uni
.
showToast
({
icon
:
'none'
,
title
:
string
})
},
//自定义 开关
//自定义 开关
itemChange
:
function
(
item
,
ikey
)
{
itemChange
:
function
(
item
,
ikey
)
{
if
(
ikey
===
-
1
)
{
// 水印标题
if
(
item
[
'watemark_value'
])
{
// if (this.result['lower_right']['title_text']) {
// 修改
// 修改
item
[
'enable'
]
=
!
item
[
'enable'
]
this
.
saveUserWatermark
()
this
.
saveUserWatermark
()
// } else {
}
else
{
// // 弹出修改框
uni
.
showToast
({
// this.itemClick(item, ikey)
icon
:
'none'
,
// }
title
:
'请先编辑该自定义项'
}
else
{
// 其他自定义
})
// if (item['watemark_value']) {
// 修改
this
.
saveUserWatermark
()
// } else {
// // 弹出修改框
// this.itemClick(item, ikey)
// }
}
}
},
},
...
@@ -206,11 +201,11 @@
...
@@ -206,11 +201,11 @@
//自定义弹窗 关闭
//自定义弹窗 关闭
popCancelClick
:
function
()
{
popCancelClick
:
function
()
{
this
.
isPopShow
=
false
this
.
currenItem
=
{
this
.
currenItem
=
{
'watemark_text'
:
''
,
'watemark_text'
:
''
,
'watemark_value'
:
''
'watemark_value'
:
''
}
}
this
.
isPopShow
=
false
},
},
//自定义弹窗 保存
//自定义弹窗 保存
...
@@ -323,10 +318,6 @@
...
@@ -323,10 +318,6 @@
.popCenterView
{
.popCenterView
{
background-color
:
#FFFFFF
;
background-color
:
#FFFFFF
;
width
:
690
rpx
;
height
:
600
rpx
;
margin-top
:
300
rpx
;
border-radius
:
12
rpx
;
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column
;
...
@@ -365,12 +356,13 @@
...
@@ -365,12 +356,13 @@
width
:
180
rpx
;
width
:
180
rpx
;
height
:
32
rpx
;
height
:
32
rpx
;
}
}
.ph-pop-left-view
{
.ph-pop-left-view
{
margin-left
:
30
rpx
;
margin-left
:
30
rpx
;
}
}
.ph-pop-tip-view
{
.ph-pop-tip-view
{
color
:
#F56C6C
;
color
:
#F56C6C
;
}
}
.ph-pop-mid-view
{
.ph-pop-mid-view
{
...
...
take-order/pages/photo/take.vue
View file @
4ef5bba2
...
@@ -13,10 +13,11 @@
...
@@ -13,10 +13,11 @@
<camera
class=
"camera-box"
v-if=
"cameraChange&&!standardShow"
:device-position=
"cameraInfo.devicePosition"
<camera
class=
"camera-box"
v-if=
"cameraChange&&!standardShow"
:device-position=
"cameraInfo.devicePosition"
:flash=
"cameraInfo.flash"
:style=
"
{'height':cameraHeight + 'rpx'}" @error="cameraError">
:flash=
"cameraInfo.flash"
:style=
"
{'height':cameraHeight + 'rpx'}" @error="cameraError">
<cover-view
class=
"mark-box"
>
<cover-view
class=
"mark-box"
>
<cover-view
class=
"txt u-m-t-30"
>
经度:
{{
waterInfo
.
longitude
||
'正在获取中...'
}}
</cover-view>
<cover-view
class=
"txt big"
>
{{
titleTxt
}}
</cover-view>
<cover-view
class=
"txt u-m-t-10"
>
维度:
{{
waterInfo
.
latitude
||
'正在获取中...'
}}
</cover-view>
<cover-view
class=
"txt"
v-for=
"(txt,index) in settingTxtArr"
:key=
"index"
>
{{
txt
||
'获取中'
}}
</cover-view>
<!--
<cover-view
class=
"txt u-m-t-10"
>
维度:
{{
waterInfo
.
latitude
||
'正在获取中...'
}}
</cover-view>
<cover-view
class=
"txt u-m-t-10"
>
地址:
{{
waterInfo
.
address
||
'正在获取中...'
}}
</cover-view>
<cover-view
class=
"txt u-m-t-10"
>
地址:
{{
waterInfo
.
address
||
'正在获取中...'
}}
</cover-view>
<cover-view
class=
"txt u-m-t-10"
>
时间:
{{
waterInfo
.
date
||
'正在获取中...'
}}
</cover-view>
<cover-view
class=
"txt u-m-t-10"
>
时间:
{{
waterInfo
.
date
||
'正在获取中...'
}}
</cover-view>
-->
</cover-view>
</cover-view>
<cover-image
class=
"mark-water"
mode=
"aspectFit"
:src=
"waterInfo.markImage"
></cover-image>
<cover-image
class=
"mark-water"
mode=
"aspectFit"
:src=
"waterInfo.markImage"
></cover-image>
</camera>
</camera>
...
@@ -83,6 +84,7 @@
...
@@ -83,6 +84,7 @@
cameraHeight
:
1000
,
// (4 / 3 * 750) 图片比例4:3
cameraHeight
:
1000
,
// (4 / 3 * 750) 图片比例4:3
ratio
:
0
,
ratio
:
0
,
cameraChange
:
true
,
cameraChange
:
true
,
waterSetting
:
null
,
}
}
},
},
onLoad
(
e
)
{
onLoad
(
e
)
{
...
@@ -95,13 +97,45 @@
...
@@ -95,13 +97,45 @@
this
.
getMarkPath
()
this
.
getMarkPath
()
this
.
currentItem
=
photo
.
currentItem
this
.
currentItem
=
photo
.
currentItem
},
},
compute
:
{
compute
d
:
{
waterSetting
()
{
titleTxt
()
{
// photo
.waterSetting
const
waterSetting
=
this
.
waterSetting
const
photo
=
getApp
().
globalData
.
photo
let
txt
=
''
console
.
log
(
photo
.
waterSetting
,
'photo.waterSetting'
)
if
(
!
waterSetting
||
!
waterSetting
.
lower_right
){
return
photo
.
waterSetting
||
null
return
''
}
}
txt
=
waterSetting
.
lower_right
&&
waterSetting
.
lower_right
.
title_text
||
''
console
.
log
(
txt
,
'title_text'
,
'waterSetting'
,
waterSetting
)
return
txt
},
settingTxtArr
(){
let
arr
=
[]
// 包含经纬度
const
waterInfo
=
this
.
waterInfo
arr
=
[
'经度嘟嘟嘟激励大家了杰拉德杰拉德了大量聚集的决定立即登录: '
+
waterInfo
.
longitude
,
'纬度: '
+
waterInfo
.
latitude
,
'地址: '
+
waterInfo
.
address
,
'时间: '
+
waterInfo
.
date
]
let
settingTxtArr
=
[]
const
typeArr
=
[
'经度'
,
'纬度'
,
'地址'
,
'时间'
]
const
waterSetting
=
this
.
waterSetting
if
(
!
waterSetting
||
!
waterSetting
.
lower_right
||
!
waterSetting
.
lower_right
.
body
)
{
return
arr
}
const
settingArr
=
waterSetting
.
lower_right
.
body
settingArr
.
map
(
item
=>
{
const
idx
=
typeArr
.
indexOf
(
item
.
watemark_type
)
if
(
item
.
enable
&&
(
idx
>
-
1
||
(
item
.
watemark_value
&&
item
.
watemark_text
)))
{
if
(
idx
>
-
1
)
{
settingTxtArr
.
push
(
arr
[
idx
])
}
else
{
settingTxtArr
.
push
(
item
.
watemark_text
+
': '
+
item
.
watemark_value
)
}
}
})
console
.
log
(
settingTxtArr
,
'settingTxtArr'
)
return
settingTxtArr
}
},
},
watch
:
{
watch
:
{
'authSetting.camera'
(
val
)
{
'authSetting.camera'
(
val
)
{
...
@@ -126,7 +160,7 @@
...
@@ -126,7 +160,7 @@
methods
:
{
methods
:
{
goBack
()
{
goBack
()
{
uni
.
navigateBack
({
uni
.
navigateBack
({
delta
:
2
delta
:
1
})
})
// uni.redirectTo({
// uni.redirectTo({
// url: '/pages/photo/list'
// url: '/pages/photo/list'
...
@@ -141,10 +175,10 @@
...
@@ -141,10 +175,10 @@
},
},
updateTime
()
{
updateTime
()
{
this
.
waterInfo
.
date
=
this
.
getTime
()
this
.
waterInfo
.
date
=
this
.
getTime
()
let
timer
=
setTimeout
(()
=>
{
//
let timer = setTimeout(() => {
clearTimeout
(
timer
);
//
clearTimeout(timer);
this
.
updateTime
()
//
this.updateTime()
},
1000
)
//
}, 1000)
},
},
setCameraInfo
(
type
)
{
setCameraInfo
(
type
)
{
// 设置相机前置后置、闪关灯等
// 设置相机前置后置、闪关灯等
...
@@ -168,6 +202,7 @@
...
@@ -168,6 +202,7 @@
const
globalData
=
getApp
().
globalData
const
globalData
=
getApp
().
globalData
this
.
navHeight
=
globalData
.
navHeight
this
.
navHeight
=
globalData
.
navHeight
this
.
ratio
=
globalData
.
screenHeight
/
globalData
.
rpxScreenHeight
this
.
ratio
=
globalData
.
screenHeight
/
globalData
.
rpxScreenHeight
this
.
waterSetting
=
getApp
().
globalData
.
photo
.
waterSetting
// this.cameraHeight = globalData.rpxScreenHeight
// this.cameraHeight = globalData.rpxScreenHeight
},
},
baiduLocation
()
{
baiduLocation
()
{
...
@@ -291,16 +326,6 @@
...
@@ -291,16 +326,6 @@
})
})
},
},
getDrawTxtArr
()
{
// 获取绘制数组
let
arr
=
[]
// 包含经纬度
const
waterInfo
=
this
.
waterInfo
arr
=
[
'经度: '
+
waterInfo
.
longitude
,
'维度: '
+
waterInfo
.
latitude
,
'地址: '
+
waterInfo
.
address
,
'时间: '
+
waterInfo
.
date
]
return
arr
},
/* ---------------------- 拍照流程 ---------------------- */
/* ---------------------- 拍照流程 ---------------------- */
// 第一步:拍照
// 第一步:拍照
takePhoto
()
{
takePhoto
()
{
...
@@ -317,34 +342,48 @@
...
@@ -317,34 +342,48 @@
title
:
'数据处理中...'
,
title
:
'数据处理中...'
,
icon
:
'loading'
icon
:
'loading'
})
})
const
waterSetting
=
this
.
waterSetting
const
globalTempPath
=
getApp
().
globalData
.
photo
.
tempPath
const
globalTempPath
=
getApp
().
globalData
.
photo
.
tempPath
const
ratio
=
this
.
ratio
const
ratio
=
this
.
ratio
let
canvasWidth
=
this
.
cameraWidth
*
ratio
let
canvasWidth
=
this
.
cameraWidth
*
ratio
let
canvasHeight
=
this
.
cameraHeight
*
ratio
let
canvasHeight
=
this
.
cameraHeight
*
ratio
const
waterInfo
=
this
.
waterInfo
const
waterInfo
=
this
.
waterInfo
this
.
showImage
=
true
this
.
showImage
=
true
const
drawTxtArr
=
this
.
getDrawTxtArr
()
const
settingTxtArr
=
this
.
settingTxtArr
//将原图画到canvas上面
//将原图画到canvas上面
let
canvas
=
uni
.
createCanvasContext
(
"canvas"
,
this
)
let
canvas
=
uni
.
createCanvasContext
(
"canvas"
,
this
)
canvas
.
rect
(
0
,
0
,
canvasWidth
,
canvasHeight
)
canvas
.
rect
(
0
,
0
,
canvasWidth
,
canvasHeight
)
canvas
.
drawImage
(
tempPath
,
0
,
0
,
canvasWidth
,
canvasHeight
)
canvas
.
drawImage
(
tempPath
,
0
,
0
,
canvasWidth
,
canvasHeight
)
// this.canvas.draw()
// this.canvas.draw()
let
txtHeight
=
18
let
h
=
1
//加入 水印文字
//加入 水印文字
for
(
let
i
=
settingTxtArr
.
length
-
1
;
i
>=
0
;
i
--
)
{
txtHeight
=
18
canvas
.
setFontSize
(
14
)
canvas
.
setFontSize
(
14
)
canvas
.
setFillStyle
(
'#f2f2f2'
)
canvas
.
setFillStyle
(
'#f2f2f2'
)
let
h
=
1
let
txt
=
settingTxtArr
[
i
]
let
txtHeight
=
18
if
(
txt
.
length
>
14
){
for
(
let
i
=
0
;
i
<
drawTxtArr
.
length
;
i
++
)
{
canvas
.
fillText
(
txt
.
substr
(
0
,
14
),
10
,
canvasHeight
-
txtHeight
*
h
++
);
const
txt
=
drawTxtArr
[
i
]
canvas
.
fillText
(
txt
.
substr
(
14
,
14
),
10
,
canvasHeight
-
txtHeight
*
h
++
);
}
else
{
canvas
.
fillText
(
txt
,
10
,
canvasHeight
-
txtHeight
*
h
++
);
canvas
.
fillText
(
txt
,
10
,
canvasHeight
-
txtHeight
*
h
++
);
}
}
// canvas.fillText('经度: ' + waterInfo.longitude, 10, canvasHeight - txtHeight * h++);
// canvas.fillText(txt, 10, canvasHeight - txtHeight * h++);
// canvas.fillText('维度: ' + waterInfo.latitude, 10, canvasHeight - txtHeight * h++);
}
// canvas.fillText('地址: ' + waterInfo.address, 10, canvasHeight - txtHeight * h++);
const
title
=
this
.
titleTxt
// canvas.fillText('时间: ' + waterInfo.date, 10, canvasHeight - txtHeight * h++);
if
(
title
){
txtHeight
=
20
canvas
.
setFontSize
(
20
)
canvas
.
setFillStyle
(
'#f2f2f2'
)
canvas
.
fillText
(
title
,
10
,
canvasHeight
-
txtHeight
*
h
++
);
}
if
(
this
.
waterSetting
&&
this
.
waterSetting
.
mid_text
){
//加入 水印图片
//加入 水印图片
canvas
.
drawImage
(
this
.
tempImgs
.
markImage
,
canvasWidth
/
2
-
100
,
canvasHeight
/
2
-
25
,
200
,
50
)
canvas
.
drawImage
(
this
.
tempImgs
.
markImage
,
canvasWidth
/
2
-
100
,
canvasHeight
/
2
-
25
,
200
,
50
)
}
// canvas.drawImage(this.tempImgs.markImage, canvasWidth / 2 - 100, canvasHeight / 2 - 25, 200, 50)
canvas
.
draw
(
false
,
canvas
.
draw
(
false
,
setTimeout
(()
=>
{
setTimeout
(()
=>
{
uni
.
canvasToTempFilePath
({
uni
.
canvasToTempFilePath
({
...
@@ -455,11 +494,18 @@
...
@@ -455,11 +494,18 @@
.mark-box
{
.mark-box
{
position
:
absolute
;
position
:
absolute
;
left
:
0
;
left
:
0
;
bottom
:
20rpx
;
bottom
:
0
;
padding
:
20rpx
;
padding
:
20rpx
;
.txt
{
.txt
{
margin-top
:
5rpx
;
line-height
:
40rpx
;
white-space
:
normal
;
font-size
:
28rpx
;
color
:
#fff
;
color
:
#fff
;
.big
{
font-size
:
32rpx
;
}
}
}
}
}
...
...
take-order/utils/login.js
View file @
4ef5bba2
...
@@ -4,7 +4,7 @@ const app = getApp();
...
@@ -4,7 +4,7 @@ const app = getApp();
function
appLogin
()
{
function
appLogin
()
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
uni
.
login
({
uni
.
login
({
success
:
res
=>
{
success
(
res
)
{
if
(
!
res
.
code
)
{
if
(
!
res
.
code
)
{
uni
.
hideLoading
();
uni
.
hideLoading
();
uni
.
showModal
({
uni
.
showModal
({
...
@@ -17,7 +17,7 @@ function appLogin() {
...
@@ -17,7 +17,7 @@ function appLogin() {
fail
()
{
fail
()
{
uni
.
hideLoading
();
uni
.
hideLoading
();
uni
.
showModal
({
uni
.
showModal
({
content
:
'登录失败'
,
content
:
'
小程序
登录失败'
,
showCancel
:
false
showCancel
:
false
});
});
reject
();
reject
();
...
@@ -28,51 +28,51 @@ function appLogin() {
...
@@ -28,51 +28,51 @@ function appLogin() {
// 小程序授权
// 小程序授权
function
authorization
(
data
)
{
function
authorization
(
data
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
return
new
Promise
(
async
function
(
resolve
,
reject
)
{
data
=
data
||
{}
const
res
=
await
app
.
$vm
.
$u
.
api
.
loginWechatAuth
(
data
)
const
res
=
await
app
.
$u
.
api
.
loginWechatAuth
(
data
)
if
(
res
)
{
if
(
res
&&
res
.
status
)
{
if
(
res
.
code
==
200
&&
res
.
data
)
{
let
data
=
res
.
data
app
.
setUserData
(
res
.
data
)
app
.
setUserData
(
data
)
uni
.
hideLoading
();
resolve
(
res
);
resolve
(
res
);
}
else
()
{
}
else
{
uni
.
hideLoading
();
uni
.
showModal
({
uni
.
showModal
({
title
:
'请求
失败'
,
title
:
'用户登录
失败'
,
content
:
err
.
message
,
content
:
res
.
message
,
showCancel
:
false
showCancel
:
false
});
});
reject
();
reject
(
res
);
},
}
}
else
{
uni
.
showModal
({
title
:
'请求失败'
,
content
:
res
.
message
});
}
});
});
}
}
// 小程序注册
// 小程序注册
function
signup
(
data
)
{
function
signup
(
data
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
return
new
Promise
(
async
function
(
resolve
,
reject
)
{
const
res
=
await
app
.
$u
.
api
.
loginWechatAuth
(
data
)
const
res
=
await
app
.
$vm
.
$u
.
api
.
loginWechatAuth
(
data
)
if
(
res
)
{
api
.
request
(
'login/signup-login'
,
{
if
(
res
.
code
==
200
&&
res
.
data
)
{
method
:
"post"
,
app
.
setUserData
(
res
.
data
)
data
:
{
code
:
data
.
code
,
encryptedData
:
data
.
encryptedData
,
iv
:
data
.
iv
},
success
:
function
(
res
)
{
if
(
res
&&
res
.
status
)
{
let
data
=
res
.
data
app
.
setUserData
(
data
)
resolve
(
res
);
}
else
{
if
(
!
res
.
status
&&
res
.
message
===
'用户授权信息失效,请重新授权'
){
api
.
setAuthToken
(
''
)
}
resolve
(
res
);
resolve
(
res
);
}
else
{
uni
.
showModal
({
title
:
'用户授权失败'
,
content
:
res
.
message
,
showCancel
:
false
});
reject
(
res
);
}
}
}
}
else
{
uni
.
showModal
({
title
:
'请求失败'
,
content
:
res
.
message
});
});
}
});
});
}
}
...
...
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