Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
self-support
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
李俊赕
self-support
Commits
8982de7c
Commit
8982de7c
authored
May 13, 2021
by
zhengzy
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://git.banshouhui.com/lijundan/self-support
parents
c75257bf
3f723232
Changes
41
Hide whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
3421 additions
and
2622 deletions
+3421
-2622
README.md
README.md
+23
-0
App.vue
src/App.vue
+0
-1
common.js
src/common/api/common.js
+0
-4
contract.js
src/common/api/contract.js
+0
-18
index.js
src/common/api/index.js
+0
-3
order.js
src/common/api/order.js
+62
-20
settled.js
src/common/api/settled.js
+4
-13
util.js
src/common/util.js
+1
-2
appoint-time.vue
src/components/appoint/appoint-time.vue
+5
-2
XhFiles.vue
src/components/createCom/XhFiles.vue
+103
-60
XhInput.vue
src/components/createCom/XhInput.vue
+37
-16
XhLabel.vue
src/components/createCom/XhLabel.vue
+77
-0
XhServiceMore.vue
src/components/createCom/XhServiceMore.vue
+106
-0
settlement.vue
src/components/mine/settlement.vue
+8
-2
statement.vue
src/components/mine/statement.vue
+6
-1
index.vue
src/components/order/index.vue
+23
-13
setting.vue
src/components/photo/setting.vue
+449
-449
index.vue
src/components/take/index.vue
+658
-637
pages.json
src/pages.json
+24
-46
index.vue
src/pages/index/index.vue
+26
-49
learn.vue
src/pages/index/learn.vue
+0
-1
mine.vue
src/pages/index/mine.vue
+29
-49
order.vue
src/pages/index/order.vue
+3
-3
index.vue
src/pages/login/index.vue
+68
-29
index.vue
src/pages/mine/cert/index.vue
+2
-2
index.vue
src/pages/mine/customer/index.vue
+1
-1
index.vue
src/pages/mine/wallet/index.vue
+287
-181
settlement.vue
src/pages/mine/wallet/settlement.vue
+7
-2
statement.vue
src/pages/mine/wallet/statement.vue
+7
-2
withdraw.vue
src/pages/mine/wallet/withdraw.vue
+2
-1
index.vue
src/pages/mine/warehouse/index.vue
+211
-0
complete.vue
src/pages/order/complete.vue
+226
-141
detail.vue
src/pages/order/detail.vue
+128
-99
feedback.vue
src/pages/order/feedback.vue
+17
-12
material.vue
src/pages/order/material.vue
+276
-221
list.vue
src/pages/photo/list.vue
+505
-504
preview.vue
src/pages/photo/preview.vue
+1
-1
setting.vue
src/pages/photo/setting.vue
+29
-29
file.vue
src/pages/settle/file.vue
+2
-2
pay-ensure.vue
src/pages/settle/pay-ensure.vue
+4
-3
sign-contract.vue
src/pages/settle/sign-contract.vue
+4
-3
No files found.
README.md
View file @
8982de7c
...
...
@@ -36,6 +36,28 @@ npm run build:mp-weixin // 运行生产环境
查看
[
配置参考
](
https://cli.vuejs.org/config/
)
#### pages配置说明
##### 启动页配置,只作用于开发环境
current--当前启动页
list--可选启动页列表
name--启动页标题
path--启动页路径
query--启动页参数,页面onLoad中获取
```
json
{
"condition"
:
{
"current"
:
0
,
"list"
:
[
{
"name"
:
"拍照小工具"
,
"path"
:
"pages/photo/index"
,
"query"
:
{}
}
]
}
}
```
### Easycom [组件模式](https://uniapp.dcloud.io/collocation/pages?id=easycom)
...
...
@@ -86,3 +108,4 @@ npm run build:mp-weixin // 运行生产环境
PS: 当前项目使用了:方式一,具体情况可以参考state目录下代码
vm.vuex_token
src/App.vue
View file @
8982de7c
...
...
@@ -5,7 +5,6 @@ import util from "@/utils/util.js";
import
login
from
"@/utils/login.js"
;
export
default
{
globalData
:
{
jumpLoginStatus
:
true
,
// 开发环境
uniEnv
:
process
.
uniEnv
,
// 微信小程序平台编号,空--家维广场,1--自营平台
...
...
src/common/api/common.js
View file @
8982de7c
let
commonApiFun
=
function
(
vm
){
let
loginWxByUser
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'/wxh-support-rest/rest/ssoinfo/v3/getUsersByCode'
,
params
);
let
loginWxByPhone
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
'/wxh-support-rest/rest/ssoinfo/v3/findByMobile'
,
params
,{
'content-type'
:
'application/x-www-form-urlencoded'
});
let
loginWechatAuth
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
'/wxh-support-rest/rest/ssoinfo/wxapp/unify/authorization'
,
params
,
{
'content-type'
:
'application/x-www-form-urlencoded'
});
// 水印-查询用户自定义设置
let
getUserWatermark
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
'http://apidoc.banshouhui.com:3000/mock/89/getUserWatermark'
,
params
);
...
...
@@ -10,8 +8,6 @@ let commonApiFun = function(vm){
let
saveImage
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
'http://apidoc.banshouhui.com:3000/mock/89/saveImage'
,
params
);
const
commonApi
=
{
loginWxByUser
,
loginWxByPhone
,
loginWechatAuth
,
getUserWatermark
,
saveUserWatermark
,
...
...
src/common/api/contract.js
deleted
100644 → 0
View file @
c75257bf
const
globalUrl
=
process
.
uniEnv
||
{}
const
ucenterApiUrl
=
globalUrl
.
ucenterUrl
.
apiUrl
const
collegeApiUrl
=
globalUrl
.
ucenterUrl
.
xueUrl
const
testApiUrl
=
globalUrl
.
systemUrl
.
apiUrl
let
contractApiFun
=
function
(
vm
){
//我的合同//
Mycontract
=
async
(
params
)
=>
await
vm
.
$u
.
get
(
ucenterApiUrl
+
'/v1/settled-contract/info'
+
'?Authorization='
+
vm
.
vuex_token
+
params
)
const
contract
=
{
Mycontract
}
return
contract
}
module
.
exports
=
{
contractApiFun
}
src/common/api/index.js
View file @
8982de7c
...
...
@@ -11,7 +11,6 @@ import {learnApiFun} from "@/common/api/learn.js";
import
{
orderApiFun
}
from
"@/common/api/order.js"
;
import
{
assessmentApiFun
}
from
"@/common/api/assessment.js"
import
{
certApiFun
}
from
"@/common/api/cert.js"
import
{
contractApiFun
}
from
"@/common/api/contract.js"
let
apiFun
=
function
(
vm
)
{
let
commonApi
=
commonApiFun
(
vm
);
let
settledApi
=
settledApiFun
(
vm
)
...
...
@@ -20,7 +19,6 @@ let apiFun = function(vm) {
let
assessmentApi
=
assessmentApiFun
(
vm
)
let
orderApi
=
orderApiFun
(
vm
)
let
certApi
=
certApiFun
(
vm
)
let
contractApi
=
contractApiFun
(
vm
)
let
apiUrl
=
{
...
commonApi
,
...
settledApi
,
...
...
@@ -29,7 +27,6 @@ let apiFun = function(vm) {
...
orderApi
,
...
assessmentApi
,
...
certApi
,
...
contractApi
}
return
apiUrl
}
...
...
src/common/api/order.js
View file @
8982de7c
import
util
from
'@/utils/util.js'
// 接口公共前缀
const
prefix
=
'/wxh-worker-rest/rest/'
const
jsonType
=
{
'content-type'
:
'application/json'
}
const
formType
=
{
'content-type'
:
'application/x-www-form-urlencoded'
}
let
orderApiFun
=
function
(
vm
){
// 接口公共前缀
const
prefix
=
'/wxh-worker-rest/rest/'
let
prefix2
=
'/wxh-worker-rest/rest/'
+
vm
.
vuex_token
let
order
=
'/wxh-worker-rest/rest/order/'
let
settle
=
'/wxh-worker-rest/rest/settle/'
+
vm
.
vuex_token
let
token
=
vm
.
vuex_token
let
listByRecommendOrder
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'/wxh-worker-rest/rest/recommend/order'
,
params
);
/**
* 工单数量查询接口
*/
let
listOrderCount
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
prefix
+
vm
.
vuex_token
+
'/wokerOrder/queryOrdersCount/V2'
,
params
);
let
listOrderCount
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
prefix
2
+
'/wokerOrder/queryOrdersCount/V2'
,
params
);
/**
* 工单列表接口
...
...
@@ -17,7 +25,7 @@ let orderApiFun = function(vm){
/**
* 获取师傅的预约日历
*/
let
workerCalendar
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
prefix
+
vm
.
vuex_token
+
'/wokerOrder/appointment/calendar'
,
params
);
let
workerCalendar
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
prefix
2
+
'/wokerOrder/appointment/calendar'
,
params
);
/**
* 师傅预约
...
...
@@ -29,7 +37,7 @@ let orderApiFun = function(vm){
/**
* 师傅签到接口
*/
let
maintainWorkerCheckin
=
async
(
params
=
{},
orderId
)
=>
await
vm
.
$u
.
post
(
prefix
+
vm
.
vuex_token
+
'/order/'
+
orderId
+
'/maintainWorkerCheckin'
,
params
,{
'content-type'
:
'application/x-www-form-urlencoded'
}
);
let
maintainWorkerCheckin
=
async
(
params
=
{},
orderId
)
=>
await
vm
.
$u
.
post
(
prefix
2
+
'/order/'
+
orderId
+
'/maintainWorkerCheckin'
,
params
,
formType
);
/**
* 订单详情查询
*/
...
...
@@ -42,7 +50,7 @@ let orderApiFun = function(vm){
let
traceAndAppointment
=
async
(
params
=
{},
orderId
)
=>
await
vm
.
$u
.
post
(
'/wxh-worker-rest/rest/order/traceAndAppointment/trace/V2/'
+
vm
.
vuex_token
+
`/`
+
orderId
,
params
)
/* 师傅拒单 */
let
rejectOrder
=
async
(
params
=
{},
orderId
)
=>
await
vm
.
$u
.
get
(
prefix
+
vm
.
vuex_token
+
`/order/
${
orderId
}
/workerReject/V2`
,
params
)
let
rejectOrder
=
async
(
params
=
{},
orderId
)
=>
await
vm
.
$u
.
get
(
prefix
2
+
`/order/
${
orderId
}
/workerReject/V2`
,
params
)
/**
...
...
@@ -53,37 +61,41 @@ let orderApiFun = function(vm){
/**
* 接单
*/
let
orderAccept
=
async
(
params
=
{},
orderId
)
=>
await
vm
.
$u
.
post
(
prefix
+
vm
.
vuex_token
+
'/order/'
+
orderId
+
'/accept'
,
params
,
{
'content-type'
:
'application/x-www-form-urlencoded'
}
);
let
orderAccept
=
async
(
params
=
{},
orderId
)
=>
await
vm
.
$u
.
post
(
prefix
2
+
'/order/'
+
orderId
+
'/accept'
,
params
,
formType
);
/**
* 抢单
*/
let
orderGan
=
async
(
params
=
{},
orderId
)
=>
await
vm
.
$u
.
post
(
'/wxh-worker-rest/rest/order/revision/applets/'
+
vm
.
vuex_token
+
'/order/acceptAppletsOrder'
,
params
,
{
'content-type'
:
'application/x-www-form-urlencoded'
}
);
let
orderGan
=
async
(
params
=
{},
orderId
)
=>
await
vm
.
$u
.
post
(
'/wxh-worker-rest/rest/order/revision/applets/'
+
vm
.
vuex_token
+
'/order/acceptAppletsOrder'
,
params
,
formType
);
/**
* 获取拍照标准
*/
let
orderStandard
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
prefix
+
vm
.
vuex_token
+
'/photo/standard'
,
params
);
let
orderStandard
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
prefix2
+
'/photo/standard'
,
params
);
/**
* 获取拍照标准单独项目
*/
let
orderStandardItem
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
prefix2
+
'/photo/standard/only'
,
params
);
/**
* 保存图片信息
*/
let
saveImage
=
async
(
params
=
{},
orderId
)
=>
await
vm
.
$u
.
post
(
prefix
+
vm
.
vuex_token
+
'/order/'
+
orderId
+
'/maintain/saveImage'
,
params
);
let
saveImage
=
async
(
params
=
{},
orderId
)
=>
await
vm
.
$u
.
post
(
prefix
2
+
'/order/'
+
orderId
+
'/maintain/saveImage'
,
params
);
/**
* 获取师傅水印 or 默认水印
*/
let
getWatermark
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
prefix
+
vm
.
vuex_token
+
'/photo/watermark'
,
params
);
let
getWatermark
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
prefix
2
+
'/photo/watermark'
,
params
);
/**
* 保存师傅水印
*/
let
saveWatermark
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
prefix
+
vm
.
vuex_token
+
'/photo/watermark'
,
params
);
let
saveWatermark
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
prefix
2
+
'/photo/watermark'
,
params
);
/**
* 获取师傅开放可选时间段
*/
let
openTimerange
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
prefix
+
vm
.
vuex_token
+
'/wokerOrder/appointment/timerange'
,
params
);
let
openTimerange
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
prefix
2
+
'/wokerOrder/appointment/timerange'
,
params
);
/**
* 联系时间接口
...
...
@@ -104,26 +116,31 @@ let orderApiFun = function(vm){
/**
* 获取订单的完工项目(配置+数据)
*/
let
getCompleteConfigAndData
=
async
(
orderId
)
=>
await
vm
.
$u
.
get
(
prefix
+
vm
.
vuex_token
+
'/order/'
+
orderId
+
'/maintain/info'
);
let
getCompleteConfigAndData
=
async
(
orderId
)
=>
await
vm
.
$u
.
get
(
prefix
2
+
'/order/'
+
orderId
+
'/maintain/info'
);
/**
* 查询措施
*/
let
getMeasure
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'wxh-worker-rest/rest/service/'
+
vm
.
vuex_token
+
'/measure/queryMeasureItems'
,
params
);
/**
* 查询工单材信息
*/
let
getOrderMaterial
=
async
(
orderId
)
=>
await
vm
.
$u
.
get
(
'/wxh-cloud-rest/rest/thirdparty/shzhida/material/'
+
orderId
);
/**
* 保存售后记录
*/
let
saveCompleteData
=
async
(
params
=
{},
orderId
)
=>
await
vm
.
$u
.
post
(
prefix
+
vm
.
vuex_token
+
'/order/'
+
orderId
+
'/maintain/saveMaintainInfoV2'
,
params
);
let
saveCompleteData
=
async
(
params
=
{},
orderId
)
=>
await
vm
.
$u
.
post
(
prefix
2
+
'/order/'
+
orderId
+
'/maintain/saveMaintainInfoV2'
,
params
);
/**
* 保内工单完工
*/
let
inOrderFinish
=
async
(
orderId
)
=>
await
vm
.
$u
.
post
(
prefix
+
vm
.
vuex_token
+
'/order/'
+
orderId
+
'/finishedAndConfirm'
,{},
{
'content-type'
:
'application/x-www-form-urlencoded'
}
);
let
inOrderFinish
=
async
(
orderId
)
=>
await
vm
.
$u
.
post
(
prefix
2
+
'/order/'
+
orderId
+
'/finishedAndConfirm'
,{},
formType
);
/**
* 保外工单完工
*/
let
outOrderFinish
=
async
(
params
=
{},
orderId
)
=>
await
vm
.
$u
.
post
(
prefix
+
vm
.
vuex_token
+
'/order/'
+
orderId
+
'/v1/finishedAndConfirmOutGuaranteePeriod'
,
params
,
{
'content-type'
:
'application/x-www-form-urlencoded'
}
);
let
outOrderFinish
=
async
(
params
=
{},
orderId
)
=>
await
vm
.
$u
.
post
(
prefix
2
+
'/order/'
+
orderId
+
'/v1/finishedAndConfirmOutGuaranteePeriod'
,
params
,
formType
);
/**
...
...
@@ -131,6 +148,23 @@ let orderApiFun = function(vm){
*/
let
addressToCoordinate
=
async
(
orderId
)
=>
await
vm
.
$u
.
get
(
prefix
+
'order/specialfee/'
+
vm
.
vuex_token
+
'/address/coordinate/'
+
orderId
);
/**
* 我的库存明细(物料)
*/
let
listBystock
=
async
()
=>
await
vm
.
$u
.
get
(
prefix2
+
'/myinfo/stock'
,
{},
jsonType
);
/**
* 我的出入库流水
*/
let
listAccessHistory
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
prefix2
+
'/myinfo/access/history'
,
params
,
jsonType
);
// 获取我的钱包-资产信息
let
getAssets
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
settle
+
'/v2/total'
,
params
);
// 获取我的钱包-结算明细
let
listStatement
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
settle
+
'/v2/statement'
,
params
);
// 获取我的钱包-支付单一览
let
payableRecord
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
settle
+
'/payable/v2/queryPayableRecord'
,
params
);
// 获取我的钱包-师傅提现
let
workerApplyPay
=
async
(
params
=
{},
payableRecordId
)
=>
await
vm
.
$u
.
post
(
`/wxh-worker-rest/rest/
${
token
}
/applypay/
${
payableRecordId
}
/workerApplyPay`
,
params
);
const
orderApi
=
{
listByRecommendOrder
,
...
...
@@ -147,6 +181,7 @@ let orderApiFun = function(vm){
traceAndAppointment
,
rejectOrder
,
orderStandard
,
orderStandardItem
,
saveImage
,
getWatermark
,
saveWatermark
,
...
...
@@ -156,10 +191,17 @@ let orderApiFun = function(vm){
getSignDistance
,
getCompleteConfigAndData
,
getMeasure
,
getOrderMaterial
,
saveCompleteData
,
inOrderFinish
,
outOrderFinish
,
addressToCoordinate
addressToCoordinate
,
listBystock
,
listAccessHistory
,
getAssets
,
listStatement
,
payableRecord
,
workerApplyPay
,
}
return
orderApi
}
...
...
src/common/api/settled.js
View file @
8982de7c
...
...
@@ -8,43 +8,33 @@ let settledApiFun = function(vm){
let
getSettleArea
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
ucenterApiUrl
+
'/v1/settled/area'
,
params
);
/* 提交用户基本信息 */
let
submitSettleBaseInfo
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
ucenterApiUrl
+
'/v1/settled/save-info'
,
params
);
/* 校验身份证正面 */
let
checkSettleIDCardFront
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
ucenterApiUrl
+
'/v1/settled/card-front'
,
params
);
/* 校验身份证反面 */
let
checkSettleIDCardBack
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
ucenterApiUrl
+
'/v1/settled/card-back'
,
params
);
/* 提交用户资料 */
let
submitSettleFileInfo
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
ucenterApiUrl
+
'/v1/settled/submit-info'
,
params
);
/* 缴纳保证金 */
let
paySettleDeposit
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
ucenterApiUrl
+
'/v2/settled/pay-deposit'
,
params
,{
'content-type'
:
'application/x-www-form-urlencoded'
});
let
getSettleDepositResult
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
ucenterApiUrl
+
'/v1/settled/check-oid'
,
params
,{
'content-type'
:
'application/x-www-form-urlencoded'
});
/* 校验银行卡 */
// let checkSettleBank = async (params = {}) => await vm.$u.get('/wxh-site-rest/rest/register/verifyBankCard', params);
/* 校验支付宝 */
// let checkSettleAlipay = async (params = {}) => await vm.$u.get('/wxh-site-rest/rest/register/verifyAlipayAccount', params);
/* 提交认证资料 */
let
checkSettleSignInfo
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
ucenterApiUrl
+
'/v1/settled/check-sign-info'
,
params
,{
'content-type'
:
'application/x-www-form-urlencoded'
});
/* 获取接单教程列表 */
let
listOrderingTutorials
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
ucenterApiUrl
+
'/v1/settled/get-course-rate'
,
params
);
/* 更新接单教程状态 */
let
saveCourseRate
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
ucenterApiUrl
+
'/v1/settled/save-course-rate'
,
params
);
/* 获取消息内容列表 */
let
listByNotice
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
ucenterApiUrl
+
'/v1/notice/home-list'
,
params
);
/**
* 我的-更新收货地址
*/
/** 我的-更新收货地址 */
let
syncAddress
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
ucenterApiUrl
+
'/v1/settled/sync-address'
,
params
);
//我的合同//
let
Mycontract
=
async
(
params
)
=>
await
vm
.
$u
.
get
(
ucenterApiUrl
+
'/v1/settled-contract/info'
+
'?Authorization='
+
vm
.
vuex_token
+
params
)
const
settledApi
=
{
getSettleBaseInfo
,
...
...
@@ -62,6 +52,7 @@ let settledApiFun = function(vm){
saveCourseRate
,
listByNotice
,
syncAddress
,
Mycontract
,
}
return
settledApi
}
...
...
src/common/util.js
View file @
8982de7c
function
strlen
(
value
)
{
//中文、中文标点、全角字符按1长度,英文、英文符号、数字按0.5长度计算
let
cnReg
=
/
([\u
4e00-
\u
9fa5
]
|
[\u
3000-
\u
303F
]
|
[\u
FF00-
\u
FF60
])
/g
;
...
...
@@ -184,5 +183,5 @@ export {
setDb
,
getDb
,
getDateTime
,
randStr
randStr
,
}
src/components/appoint/appoint-time.vue
View file @
8982de7c
...
...
@@ -36,7 +36,7 @@
:class=
"
{'time-item':true,'active': item.pkey===appointRange}" v-for="(item,index) in timeList"
:key="item.pkey">
<button
class=
"time"
:plain=
"true"
:disabled=
"item.disabled"
:hair-line=
"false"
:disabled=
"item.disabled
|| (currentDayIndex == 0 && item.pkey
<
=
currentPkey
)
"
:hair-line=
"false"
@
click=
"timeChange(item,index,timeList)"
>
{{
item
.
name
}}
</button>
...
...
@@ -101,7 +101,9 @@
appointRange
:
null
,
appointRangeText
:
''
,
num
:
0
,
hasLast
:
false
hasLast
:
false
,
currentPkey
:
'appointment_range_'
+
new
Date
().
getHours
(),
currentDayIndex
:
-
1
,
}
},
watch
:
{
...
...
@@ -125,6 +127,7 @@
this
.
appointTime
=
item
.
day
this
.
appointRange
=
null
this
.
appointRangeText
=
''
this
.
currentDayIndex
=
index
this
.
$emit
(
'date-change'
,
data
)
},
timeChange
(
item
,
index
,
list
)
{
...
...
src/components/createCom/XhFiles.vue
View file @
8982de7c
<!-- ******************* 文件上传 ******************* -->
<
template
>
<view>
<view
class=
"file-box"
v-if=
"!takeStatus"
>
<!--
<view
class=
"u-flex"
>
<view
class=
"txt u-flex-1"
>
{{
item
.
fieldsTitle
}}
</view>
<u-icon
name=
"arrow-right"
color=
"#666"
size=
"28"
></u-icon>
</view>
-->
<view
class=
"pics u-flex u-flex-wrap"
>
<view
class=
"img-list"
v-for=
"(item,index) in imgList"
:key=
"index"
>
<u-image
class=
"pic"
width=
"160"
height=
"160"
:src=
"item.path"
:border-radius=
"10"
@
click
.
stop=
"prviewImage(item.path,index)"
></u-image>
<view
class=
"icon-del-box"
@
click
.
stop=
"delFile(index)"
>
<view
class=
"icon-del"
></view>
<view
class=
"icon-del rotate"
></view>
</view>
</view>
<view
class=
"img-list"
>
<u-image
class=
"pic"
width=
"160rpx"
height=
"160rpx"
:border-radius=
"10"
@
click=
"selectUpload"
:src=
"uploadImage"
></u-image>
</view>
<!--
<u-image
class=
"pic"
v-for=
"item in 6"
width=
"170rpx"
height=
"170"
src=
"'https://cdn.uviewui.com/uview/example/fade.jpg"
></u-image>
-->
</view>
<u-action-sheet
:list=
"list"
v-model=
"maskShow"
:cancel-btn=
"true"
@
click=
"uploadSelect"
></u-action-sheet>
</view>
<take-photo
v-
else
@
close=
"closeTake"
></take-photo>
<
template
>
<view>
<view
class=
"file-box"
>
<!--
<view
class=
"u-flex"
>
<view
class=
"txt u-flex-1"
>
{{
item
.
fieldsTitle
}}
</view>
<u-icon
name=
"arrow-right"
color=
"#666"
size=
"28"
></u-icon>
</view>
-->
<view
class=
"pics u-flex u-flex-wrap"
>
<view
class=
"img-list"
v-for=
"(item,index) in imgList"
:key=
"index"
>
<u-image
class=
"pic"
width=
"160"
height=
"160"
:src=
"item.path"
:border-radius=
"10"
@
click
.
stop=
"prviewImage(item.path,index)"
></u-image>
<view
class=
"icon-del-box"
@
click
.
stop=
"delFile(index)"
>
<view
class=
"icon-del"
></view>
<view
class=
"icon-del rotate"
></view>
</view>
</view>
<view
class=
"img-list"
>
<u-image
class=
"pic"
width=
"160rpx"
height=
"160rpx"
:border-radius=
"10"
@
click=
"selectUpload"
:src=
"uploadImage"
></u-image>
</view>
<!--
<u-image
class=
"pic"
v-for=
"item in 6"
width=
"170rpx"
height=
"170"
src=
"'https://cdn.uviewui.com/uview/example/fade.jpg"
></u-image>
-->
</view>
<u-action-sheet
:list=
"list"
v-model=
"maskShow"
:cancel-btn=
"true"
@
click=
"uploadSelect"
></u-action-sheet>
</view>
<take-photo
v-
if=
"takeStatus"
@
close=
"closeTake"
:currentItem=
"currentItemDate"
></take-photo>
</view>
</
template
>
<
script
>
import
arrMixin
from
'./arrMixin'
import
baseFile
from
'@/components/upload/index'
;
import
baseFile
from
'@/components/upload/index'
;
import
takePhoto
from
'@/components/take/index.vue'
export
default
{
name
:
'XhFiles'
,
components
:
{
'take-photo'
:
takePhoto
components
:
{
'take-photo'
:
takePhoto
},
mixins
:
[
arrMixin
,
baseFile
],
props
:
{
files
:
{
type
:
Array
,
}
},
partnerCompanyId
:
{
type
:
String
,
default
:
''
},
categoryId
:
{
type
:
String
,
default
:
''
},
brandId
:
{
type
:
String
,
default
:
''
},
},
filters
:{},
data
()
{
return
{
return
{
maskShow
:
false
,
list
:
[
{
...
...
@@ -53,14 +65,15 @@
}
],
takeStatus
:
false
,
currentItemDate
:{},
}
},
computed
:
{
settings
()
{
return
this
.
item
.
settings
||
[]
},
uploadImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'upload-file.png'
},
uploadImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'upload-file.png'
},
},
mounted
()
{
...
...
@@ -72,12 +85,12 @@
}
},
methods
:
{
selectUpload
(){
if
(
this
.
imgList
.
length
===
10
)
{
selectUpload
(){
if
(
this
.
imgList
.
length
===
10
)
{
return
this
.
$refs
.
uToast
.
show
({
title
:
'图片已超出最大数量'
,
type
:
'error'
,
})
})
}
// 弹窗展示
this
.
maskShow
=
true
...
...
@@ -106,23 +119,26 @@
}
// 使用拍照工具拍摄
this
.
takeStatus
=
true
this
.
getWatermark
()
this
.
getPhotoStander
()
},
setValue
()
{
const
dataValue
=
[]
this
.
imgList
.
map
(
item
=>
{
dataValue
.
push
(
item
.
path
)
})
dataValue
.
push
(
item
.
src
)
})
this
.
valueChange
(
dataValue
)
},
closeTake
(
val
)
{
if
(
val
&&
val
.
length
>
0
){
val
.
forEach
((
item
,
index
,
array
)
=>
{
item
.
path
=
item
.
key
this
.
imgList
.
push
(
item
)
})
this
.
setValue
()
}
this
.
takeStatus
=
false
},
closeTake
(
val
)
{
if
(
val
&&
val
.
length
>
0
){
val
.
forEach
((
item
,
index
,
array
)
=>
{
item
.
path
=
item
.
key
item
.
src
=
item
.
key
this
.
imgList
.
push
(
item
)
})
this
.
setValue
()
}
this
.
takeStatus
=
false
},
prviewImage
(
url
,
index
)
{
uni
.
previewImage
({
...
...
@@ -133,27 +149,54 @@
delFile
(
index
)
{
this
.
imgList
.
splice
(
index
,
1
)
this
.
setValue
()
},
getPhotoStander
(){
// 获取拍照规范接口
let
self
=
this
let
param
=
{
"partnerCompanyId"
:
self
.
partnerCompanyId
,
"categoryId"
:
self
.
categoryId
,
"brandId"
:
self
.
brandId
,
"fieldName"
:
self
.
item
.
fieldsName
}
this
.
$u
.
api
.
orderStandardItem
(
param
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
&&
res
.
data
.
length
>
0
)
{
self
.
currentItemDate
=
res
.
data
[
0
]
}
else
{
console
.
log
(
"获取完工项的拍照标准异常"
,
res
.
data
.
message
)
}
})
},
getWatermark
(){
if
(
getApp
().
globalData
.
photo
.
waterSetting
){
return
}
var
data
=
{
partnerCompanyId
:
this
.
partnerCompanyId
}
this
.
$u
.
api
.
getWatermark
(
data
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
getApp
().
globalData
.
photo
.
waterSetting
=
res
.
data
}
else
{
console
.
log
(
"获取水印备注异常"
,
res
.
data
.
message
)
}
});
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.img-list
{
position
:
relative
;
margin
:
8rpx
;
width
:
160rpx
;
height
:
160rpx
;
.pic
{
// margin-right: 15rpx;
// margin-bottom: 15rpx;
&
:nth-child
(
3n
)
{
margin-right
:
0
;
}
}
height
:
160rpx
;
.pic
{
// margin-right: 15rpx;
// margin-bottom: 15rpx;
&
:nth-child
(
3n
)
{
margin-right
:
0
;
}
}
.icon-del-box
{
/* #ifndef APP-NVUE */
display
:
flex
;
...
...
@@ -170,14 +213,14 @@
z-index
:
2
;
transform
:
rotate
(
-45deg
);
}
.icon-del
{
width
:
30rpx
;
height
:
4rpx
;
background-color
:
#fff
;
border-radius
:
2px
;
}
.rotate
{
position
:
absolute
;
transform
:
rotate
(
90deg
);
...
...
src/components/createCom/XhInput.vue
View file @
8982de7c
...
...
@@ -17,6 +17,16 @@
type
:
String
,
default
:
'请输入'
},
item
:
{
type
:
Object
,
default
()
{
return
{}
}
},
type
:
{
type
:
String
,
default
:
'text'
}
// width: { // 例如:454rpx
// type: String,
// default: '100%'
...
...
@@ -24,25 +34,36 @@
},
data
()
{
return
{
maxlength
:
140
,
inputType
:
'text'
,
// type: 'text'
}
},
computed
:
{
type
()
{
let
ty
=
this
.
item
.
fieldsType
.
toLocaleLowerCase
()
if
(
this
.
item
.
fieldsId
==
200
)
{
this
.
maxlength
=
9
return
'digit'
}
else
{
if
(
this
.
item
&&
ty
==
'password'
)
{
return
this
.
item
.
fieldsType
}
else
if
(
this
.
item
&&
ty
==
'text'
)
{
return
'textarea'
}
else
{
return
'text'
}
}
// type() {
// if (this.item) {
// let ty = this.item.fieldsType.toLocaleLowerCase()
// switch (ty) {
// case 'text':
// return 'textarea'
// case 'password':
// return this.item.fieldsType
// case 'decimal':
// case 'number':
// case 'double':
// case 'integer':
// this.maxlength = 9
// return 'digit'
// case 'textarea':
// default:
// return 'text'
// }
// } else {
// return 'text'
// }
// },
maxlength
()
{
return
this
.
type
==
'digit'
?
9
:
140
},
fieldsWidth
()
{
return
this
.
item
.
fieldsWidth
?
(
this
.
item
.
fieldsWidth
+
'rpx'
)
:
'100%'
...
...
@@ -64,7 +85,7 @@
return
this
.
textarea
},
textarea
()
{
return
this
.
t
ype
==
'textarea'
return
this
.
inputT
ype
==
'textarea'
},
backgroundColor
()
{
return
this
.
textarea
?
'transparent'
:
'#F4F5F7'
...
...
src/components/createCom/XhLabel.vue
0 → 100644
View file @
8982de7c
<!-- ******************* 输入框 ******************* -->
<
template
>
<view>
<view
class=
"list u-flex u-row-between"
>
<image
class=
"item-image"
:src=
"mixingImage"
v-if=
"item.required"
></image>
<view
class=
"u-m-r-20 title-text"
>
{{
item
.
fieldsTitle
}}
</view>
<view
class=
"u-flex-1 location-name"
>
{{
valueTxt
}}
</view>
</view>
</view>
</
template
>
<
script
>
import
stringMixin
from
'./stringMixin'
export
default
{
name
:
'XhInput'
,
// 新建 input
components
:
{},
mixins
:
[
stringMixin
],
props
:
{
placeholder
:
{
type
:
String
,
default
:
'请输入'
},
},
data
()
{
return
{
maxlength
:
140
,
}
},
computed
:
{
valueTxt
()
{
let
str
=
'元'
const
dataValue
=
this
.
dataValue
if
(
dataValue
>
0
){
str
=
dataValue
+
str
}
return
str
},
mixingImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'mixing.png'
}
},
watch
:
{},
mounted
()
{
},
methods
:
{
}
}
</
script
>
<
style
scoped
>
.required
{
padding-right
:
10
rpx
;
font-size
:
28
rpx
;
line-height
:
40
rpx
;
color
:
#fa3534
;
}
.title-text
{
font-size
:
26
rpx
;
color
:
#333333
;
}
.item-image
{
width
:
24
rpx
;
height
:
24
rpx
;
margin-right
:
10
rpx
;
}
.location-name
{
color
:
#333333
;
font-size
:
26
rpx
;
text-align
:
right
;
}
.location
{
background
:
#F4F5F7
;
padding
:
10
rpx
20
rpx
;
border-radius
:
12
rpx
;
}
</
style
>
src/components/createCom/XhServiceMore.vue
0 → 100644
View file @
8982de7c
<!-- ******************* 输入框 ******************* -->
<
template
>
<view>
<view
class=
"list u-flex item-row-between"
>
<view
class=
"item-title"
>
<image
class=
"item-image"
:src=
"mixingImage"
v-if=
"item.required"
></image>
<view
class=
"u-m-r-20"
>
{{
item
.
fieldsTitle
}}
</view>
</view>
<view
class=
"location-name"
@
click=
"toMaterialPage"
>
<text
class=
"arrow-text"
>
{{
arrowText
}}
</text>
<u-icon
name=
"arrow-right"
color=
"#2979ff"
size=
"30"
></u-icon>
</view>
</view>
<!--
<view
class=
"u-flex-1 location"
>
{{
valueTxt
||
'正在获取中...'
}}
</view>
-->
</view>
</
template
>
<
script
>
import
arrMixin
from
'./arrMixin'
export
default
{
name
:
'XhInput'
,
// 新建 input
components
:
{},
mixins
:
[
arrMixin
],
props
:
{
placeholder
:
{
type
:
String
,
default
:
'请输入'
},
orderId
:
{
type
:
String
,
default
:
'请输入'
},
},
data
()
{
return
{
maxlength
:
140
,
}
},
computed
:
{
mixingImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'mixing.png'
},
arrowText
()
{
return
false
?
'已选择'
:
'请选择'
}
},
watch
:
{},
mounted
()
{},
methods
:
{
toMaterialPage
(){
let
self
=
this
uni
.
navigateTo
({
url
:
'pages/order/material?orderId='
+
this
.
orderId
+
'&fieldName='
+
this
.
item
.
fieldsName
,
// 接口调用成功的回调函数,即跳转到B页面 test.vue 后的回调函数
success
:
function
(
res
)
{
// 通过eventChannel向被打开页面传送数据
res
.
eventChannel
.
emit
(
'showMaterialData'
,
self
.
dataValue
);
}
})
},
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.required
{
padding-right
:
10rpx
;
font-size
:
28rpx
;
line-height
:
40rpx
;
color
:
#fa3534
;
}
.item-image
{
width
:
24rpx
;
height
:
24rpx
;
margin-right
:
10rpx
;
}
.item-row-between
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
.item-title
{
display
:
flex
;
font-size
:
26rpx
;
color
:
#333333
;
align-items
:
center
;
}
.location-name
{
color
:
#2272FF
;
text-align
:
right
;
font-size
:
26rpx
;
display
:
flex
;
align-items
:
center
;
.arrow-text
{
margin-right
:
6rpx
;
}
}
}
.location
{
background
:
#F4F5F7
;
padding
:
10rpx
20rpx
;
border-radius
:
12rpx
;
}
</
style
>
src/components/mine/settlement.vue
View file @
8982de7c
<
template
>
<view
class=
"settlement-view"
>
<view
class=
"settlement-com-view"
>
<view
class=
"settlement-com-view"
@
click=
"$u.throttle(handleClick, 500)"
>
<view
class=
"left-view"
>
<view
class=
"time-view"
>
{{
timeText
}}
</view>
<view
class=
"order-view"
>
...
...
@@ -55,13 +55,19 @@
timeText
()
{
return
this
.
$u
.
timeFormat
(
this
.
data
.
paymentTime
,
'mm.dd'
)
}
},
methods
:
{
handleClick
()
{
this
.
$emit
(
'click'
,
this
.
data
.
orderId
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.settlement-view
{
height
:
212rpx
;
height
:
212rpx
;
.settlement-com-view
{
display
:
flex
;
justify-content
:
space-between
;
...
...
src/components/mine/statement.vue
View file @
8982de7c
<
template
>
<view
class=
"statement-view"
>
<view
class=
"statement-com-view"
>
<view
class=
"statement-com-view"
@
click=
"$u.throttle(handleClick, 500)"
>
<view
class=
"left-view"
>
<view
class=
"time-view"
>
{{
timeText
}}
</view>
<view
class=
"order-view"
>
...
...
@@ -58,6 +58,11 @@
timeText
()
{
return
this
.
$u
.
timeFormat
(
this
.
data
.
paymentTime
,
'mm.dd'
)
}
},
methods
:{
handleClick
()
{
this
.
$emit
(
'click'
,
this
.
data
.
orderId
)
}
}
}
</
script
>
...
...
src/components/order/index.vue
View file @
8982de7c
...
...
@@ -19,15 +19,16 @@
<image
class=
"address-image"
:src=
"dizhiImage"
mode=
"widthFix"
></image>
<text>
{{
formatAddress
(
orderData
)
}}
</text>
</view>
<view
v-if=
"showDistance"
>
<view
v-if=
"showDistance"
class=
"address-right-view"
>
{{
orderDistance
}}
km
</view>
</view>
</view>
<view
class=
"line-view"
></view>
<view
class=
"reason-view"
v-if=
"showReason"
><text
class=
"reason-text"
>
未通过原因:
</text>
<text
v-for=
"(item, index) in orderData.auditResults"
:key=
"index"
>
{{
item
}}
</text>
<view
class=
"reason-view"
v-if=
"showReason"
>
<view><text
class=
"reason-title"
>
未通过原因:
</text></view>
<view
class=
"reason-text"
><text
v-for=
"(item, index) in orderData.auditResults"
:key=
"index"
>
{{
item
}}
</text></view>
</view>
<view
class=
"bottom-view"
>
<view>
...
...
@@ -187,8 +188,8 @@
return
this
.
timeout
?
'超'
:
'剩'
},
timeText
()
{
let
time
=
this
.
orderType
==
4
?
this
.
orderData
.
orderFinishDatetime
:
this
.
orderData
.
auditDatetime
return
t
his
.
$u
.
timeFormat
(
time
,
'yyyy.mm.dd hh:MM:ss'
)
let
time
=
this
.
orderType
==
4
?
this
.
orderData
.
orderFinishDatetime
:
this
.
orderData
.
auditDatetime
return
t
ime
?
this
.
$u
.
timeFormat
(
time
,
'yyyy.mm.dd hh:MM:ss'
)
:
''
},
timeTitle
()
{
return
this
.
orderType
==
4
?
'提交时间:'
:
'审核时间:'
...
...
@@ -215,6 +216,7 @@
}
},
created
()
{
console
.
log
(
'+++++++++++'
)
/*
orderStatus:
待接单 orderStatus<31 工单状态小于31
...
...
@@ -230,11 +232,11 @@
this
.
orderType
=
0
}
else
if
(
this
.
orderData
.
orderStatus
==
31
)
{
if
(
this
.
orderData
.
appointmentDatetime
)
{
return
this
.
orderType
=
2
this
.
orderType
=
2
}
else
{
this
.
orderType
=
1
}
}
else
if
(
this
.
orderData
.
orderStatus
>
31
||
this
.
orderData
.
orderStatus
<
80
)
{
}
else
if
(
this
.
orderData
.
orderStatus
>
31
&&
this
.
orderData
.
orderStatus
<
80
)
{
this
.
orderType
=
3
}
else
if
(
this
.
orderData
.
orderStatus
==
85
||
this
.
orderData
.
orderStatus
==
87
)
{
this
.
orderType
=
4
...
...
@@ -248,9 +250,9 @@
}
else
{
this
.
orderType
=
this
.
types
[
this
.
type
]
}
this
.
timeout
=
this
.
orderData
.
currentOverTime
<
new
Date
().
getTime
()
this
.
timestamp
=
Math
.
round
(
Math
.
abs
(
this
.
orderData
.
currentOverTime
-
new
Date
().
getTime
())
/
1000
)
console
.
log
(
'++++++'
,
this
.
timestamp
)
},
methods
:
{
handleClick
()
{
...
...
@@ -380,17 +382,20 @@
display
:
flex
;
align-items
:
center
;
align-items
:
flex-start
;
text-align
:
left
;
text-align
:
left
;
.address-image
{
width
:
26rpx
;
height
:
28rpx
;
margin-right
:
8rpx
;
flex-shrink
:
0
;
margin-top
:
4rpx
;
margin-top
:
4rpx
;
}
}
.address-right-view
{}
.address-right-view
{
margin-left
:
30rpx
;
}
}
}
...
...
@@ -407,10 +412,15 @@
font-size
:
26rpx
;
color
:
#FA5A49
;
display
:
flex
;
align-items
:
flex-start
;
.reason-text
{
align-items
:
flex-start
;
display
:
flex
;
.reason-title
{
flex-shrink
:
0
;
color
:
#666666
;
}
.reason-text
{
display
:
flex
;
flex-direction
:
column
;
}
}
...
...
src/components/photo/setting.vue
View file @
8982de7c
<
template
>
<view
class=
"backView"
>
<u-navbar
title=
"设置"
:title-size=
"26"
title-color=
"#000"
:custom-back=
"backTake"
></u-navbar>
<view
class=
"shadowBackView"
style=
"background-color: transparent;z-index: 1"
v-if=
"loading"
>
<u-loading
style=
"position: fixed;top: 50%;"
:show=
"loading"
size=
"36"
mode=
"flower"
></u-loading>
</view>
<view
class=
"itemView firstItem"
>
<view
class=
"itemTitleView"
>
<text
class=
"itemTitle"
>
保存原图
</text>
<text
class=
"itemNotice"
>
拍照后另保存一张无水印的图片
</text>
</view>
<switch
class=
"itemSwitch"
:checked=
"result['hasOrigin']"
@
change=
"handleOrigineChange"
color=
"#007AFF"
/>
</view>
<view
class=
"itemView"
v-if=
"showTitleSwitch"
>
<view
class=
"itemTitleView"
@
click=
"itemClick(
{},-1)">
<text
class=
"itemTitle"
>
水印标题
</text>
<text
class=
"itemNotice"
>
{{
result
[
'lowerLeft'
][
'title'
]
||
'点击可编辑更改'
}}
</text>
</view>
<switch
class=
"itemSwitch"
disabled
:checked=
"result['lowerLeft']['title'] != ''"
@
click=
"handleClickTitleSwitch"
color=
"#007AFF"
/>
</view>
<view
class=
"itemView"
v-for=
"(item,ikey) in itemList"
:key=
"ikey"
>
<view
class=
"itemTitleView"
@
click=
"itemClick(item,ikey)"
>
<text
class=
"itemTitle"
>
{{
item
[
'watemarkText'
]
||
'自定义'
+
(
ikey
+
1
)
}}
</text>
<text
class=
"itemNotice"
>
{{
item
[
'watemarkValue'
]
||
'点击可编辑更改'
}}
</text>
</view>
<switch
class=
"itemSwitch"
:checked=
"item['enable']"
@
change=
"itemChange(item, ikey)"
color=
"#007AFF"
/>
</view>
<u-popup
border-radius=
"10"
v-model=
"isPopShow"
safe-area-inset-bottom
:mask-close-able=
"false"
mode=
"center"
width=
"690rpx"
height=
"600rpx"
@
close=
"handlePopClose"
>
<view
class=
"popCenterView"
>
<text
class=
"popTitle"
>
设置自定义项
</text>
<view
class=
"inputBackView"
>
<view
class=
"ph-pop-left-view"
>
<view
class=
"leftInputView"
>
<input
class=
"leftInput"
type=
"text"
v-model=
"currenItem['watemarkText']"
@
input=
"leftInput()"
:disabled=
"currenItem.type === '备注'"
placeholder=
"请输入"
maxlength=
"10"
/>
</view>
<view
class=
"ph-pop-tip-view"
v-if=
"showTipLeft"
>
*必填项
</view>
</view>
<view
class=
"ph-pop-mid-view"
>
:
</view>
<view>
<view
class=
"rightInputView"
>
<input
class=
"rightInput"
type=
"text"
v-model=
"currenItem['watemarkValue']"
@
input=
"rightInput()"
placeholder=
"请输入内容"
maxlength=
"30"
/>
</view>
<view
class=
"ph-pop-tip-view"
v-if=
"showTipRight"
>
*必填项
</view>
</view>
</view>
<text
class=
"popNoticeText u-m-t-20"
>
示例:
</text>
<text
class=
"popNoticeText"
>
工程队名称:蓝天工程队
</text>
<view
class=
"popBtnView"
>
<u-button
:custom-style=
"customStyleCancel"
hover-class=
"none"
shape=
"circle"
type=
"primary"
@
click=
"popCancelClick()"
>
取消
</u-button>
<u-button
:custom-style=
"customStyleSave"
shape=
"circle"
type=
"primary"
@
click=
"popSaveClick()"
>
保存
</u-button>
</view>
</view>
</u-popup>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
systemId
:
''
,
isSaveOrigine
:
true
,
isPopShow
:
false
,
icon_close_new
:
''
,
result
:
{
hasOrigin
:
true
,
lowerLeft
:
{
body
:
[]
}
},
currenItem
:
{
'watemarkText'
:
''
,
'watemarkValue'
:
''
},
editingItem
:
{},
showTipLeft
:
false
,
showTipRight
:
false
,
loading
:
true
}
},
computed
:
{
itemList
()
{
console
.
log
(
this
.
result
)
if
(
this
.
result
[
'lowerLeft'
])
{
var
arr
=
this
.
result
[
'lowerLeft'
][
'body'
]
return
arr
.
filter
((
item
)
=>
{
return
item
.
watemarkType
===
'备注'
})
}
else
{
return
[]
}
},
showTitleSwitch
()
{
return
this
.
result
[
'lowerLeft'
].
hasOwnProperty
(
'title'
)
},
customStyleCancel
()
{
return
{
'background-color'
:
'#D1D4D4'
,
'width'
:
'280rpx'
,
'height'
:
'96rpx'
}
},
customStyleSave
()
{
return
{
'background-color'
:
'##2272FF'
,
'width'
:
'280rpx'
,
'height'
:
'96rpx'
,
'margin-left'
:
'50rpx'
}
}
},
created
(
e
)
{
getApp
().
trackPage
(
'水印设置页'
)
const
globalData
=
getApp
().
globalData
this
.
icon_close_new
=
globalData
.
icon_close_new
this
.
systemId
=
globalData
.
photo
.
currentItem
.
partnerCompanyId
this
.
getItemList
()
},
methods
:
{
getItemList
:
function
()
{
this
.
loading
=
true
this
.
$u
.
api
.
getWatermark
({
partnerCompanyId
:
this
.
systemId
}).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
result
=
res
.
data
}
else
{
uni
.
showToast
({
title
:
res
.
data
.
message
})
}
this
.
loading
=
false
})
},
saveUserWatermark
:
function
()
{
this
.
loading
=
true
this
.
$u
.
api
.
saveWatermark
(
this
.
result
).
then
(
res
=>
{
if
(
res
.
code
===
200
){
uni
.
showToast
({
title
:
'保存成功'
})
getApp
().
globalData
.
photo
.
waterSetting
=
this
.
result
this
.
$emit
(
"changeWatermark"
,
this
.
result
);
}
else
{
uni
.
showToast
({
title
:
res
.
message
})
}
this
.
loading
=
false
})
},
//保存原图 开关
handleOrigineChange
:
function
(
e
)
{
this
.
result
[
'hasOrigin'
]
=
!
this
.
result
[
'hasOrigin'
]
this
.
saveUserWatermark
()
},
handleClickTitleSwitch
:
function
(
e
)
{
var
string
=
this
.
result
[
'lowerLeft'
][
'title'
]
?
'水印标题不可关闭'
:
'请先编辑该自定义项'
uni
.
showToast
({
icon
:
'none'
,
title
:
string
})
},
//自定义 开关
itemChange
:
function
(
item
,
ikey
)
{
if
(
item
[
'watemarkValue'
])
{
// 修改
item
[
'enable'
]
=
!
item
[
'enable'
]
this
.
saveUserWatermark
()
}
else
{
uni
.
showToast
({
icon
:
'none'
,
title
:
'请先编辑该自定义项'
})
}
},
//自定义 点击
itemClick
:
function
(
item
,
ikey
)
{
if
(
ikey
===
-
1
)
{
this
.
currenItem
=
{
'watemarkText'
:
'水印标题'
,
'watemarkValue'
:
this
.
result
[
'lowerLeft'
][
'title'
],
'type'
:
'备注'
}
}
else
{
this
.
editingItem
=
item
this
.
currenItem
=
{
...
item
}
}
this
.
isPopShow
=
true
},
//左侧输入框
leftInput
:
function
(
e
)
{
if
(
this
.
currenItem
[
'watemarkText'
])
{
this
.
showTipLeft
=
false
}
},
//右侧输入框
rightInput
:
function
(
e
)
{
if
(
this
.
currenItem
[
'watemarkValue'
])
{
this
.
showTipRight
=
false
}
},
//自定义弹窗 关闭
popCancelClick
:
function
()
{
this
.
isPopShow
=
false
this
.
currenItem
=
{
'watemarkText'
:
''
,
'watemarkValue'
:
''
}
},
handlePopClose
()
{
this
.
showTipLeft
=
false
,
this
.
showTipRight
=
false
},
backTake
()
{
this
.
$emit
(
'changeType'
,
1
)
},
//自定义弹窗 保存
popSaveClick
:
function
()
{
if
(
this
.
currenItem
[
'watemarkText'
]
&&
this
.
currenItem
[
'watemarkValue'
])
{
this
.
isPopShow
=
false
if
(
this
.
currenItem
.
type
===
'备注'
)
{
this
.
result
[
'lowerLeft'
][
'title'
]
=
this
.
currenItem
[
'watemarkValue'
]
}
else
{
this
.
editingItem
[
'watemarkText'
]
=
this
.
currenItem
[
'watemarkText'
]
this
.
editingItem
[
'watemarkValue'
]
=
this
.
currenItem
[
'watemarkValue'
]
this
.
editingItem
[
'enable'
]
=
true
}
this
.
saveUserWatermark
()
}
else
{
// 提示
if
(
!
this
.
currenItem
[
'watemarkText'
])
{
this
.
showTipLeft
=
true
}
if
(
!
this
.
currenItem
[
'watemarkValue'
])
{
this
.
showTipRight
=
true
}
}
}
}
}
</
script
>
<
style
>
.backView
{
background-color
:
#FAFAFA
;
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
}
/*
.firstItemView{
background-color: #FFFFFF;
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding-top: 80rpx;
padding-bottom: 80rpx;
border-bottom: 2rpx solid #F4F5F7;
} */
.itemView
{
background-color
:
#FFFFFF
;
width
:
100%
;
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
justify-content
:
space-between
;
padding-top
:
54
rpx
;
padding-bottom
:
54
rpx
;
}
.itemView.firstItem
{
border-bottom
:
2
rpx
solid
#F4F5F7
;
}
.itemTitleView
{
background-color
:
#FFFFFF
;
width
:
80%
;
display
:
flex
;
flex-direction
:
column
;
padding-left
:
30
rpx
;
}
.itemTitle
{
font-size
:
32
rpx
;
font-weight
:
bold
;
color
:
#333333
;
}
.itemNotice
{
font-size
:
26
rpx
;
color
:
#666666
;
margin-top
:
4
rpx
;
}
.itemSwitch
{
margin-right
:
30
rpx
;
transform
:
scale
(
0.78
,
0.75
);
}
.shadowBackView
{
background-color
:
rgba
(
0
,
0
,
0
,
0.5
);
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
}
.popCenterView
{
background-color
:
#FFFFFF
;
display
:
flex
;
flex-direction
:
column
;
}
.popTitle
{
font-size
:
36
rpx
;
font-weight
:
bold
;
margin-top
:
50
rpx
;
padding-left
:
30
rpx
;
}
.inputBackView
{
margin-top
:
52
rpx
;
width
:
100%
;
height
:
90
rpx
;
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
justify-content
:
space-between
;
display
:
flex
;
align-items
:
flex-start
;
}
.leftInputView
{
width
:
220
rpx
;
height
:
72
rpx
;
border
:
2
rpx
solid
#666666
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
.leftInput
{
width
:
180
rpx
;
height
:
32
rpx
;
}
.ph-pop-left-view
{
margin-left
:
30
rpx
;
}
.ph-pop-tip-view
{
color
:
#F56C6C
;
}
.ph-pop-mid-view
{
margin-top
:
20
rpx
;
}
.rightInputView
{
width
:
360
rpx
;
height
:
72
rpx
;
border
:
2
rpx
solid
#666666
;
margin-right
:
30
rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
.rightInput
{
width
:
320
rpx
;
height
:
32
rpx
;
}
.popNoticeText
{
font-size
:
26
rpx
;
color
:
#666666
;
padding-left
:
30
rpx
;
}
.popBtnView
{
margin-top
:
110
rpx
;
width
:
100%
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
/* .popCancelBtn {
background-color: #D1D4D4;
width: 280rpx;
height: 96rpx;
border-radius: 48rpx;
margin-left: 40rpx;
display: flex;
align-items: center;
justify-content: center;
} */
/* .popSaveBtn {
background-color: #2272FF;
width: 280rpx;
height: 96rpx;
border-radius: 48rpx;
margin-right: 40rpx;
display: flex;
align-items: center;
justify-content: center;
} */
/* .popBtnText {
font-size: 32rpx;
color: #FFFFFF;
font-weight: 600;
} */
</
style
>
<
template
>
<view
class=
"backView"
>
<u-navbar
title=
"设置"
:title-size=
"26"
title-color=
"#000"
:custom-back=
"backTake"
></u-navbar>
<view
class=
"shadowBackView"
style=
"background-color: transparent;z-index: 1"
v-if=
"loading"
>
<u-loading
style=
"position: fixed;top: 50%;"
:show=
"loading"
size=
"36"
mode=
"flower"
></u-loading>
</view>
<view
class=
"itemView firstItem"
>
<view
class=
"itemTitleView"
>
<text
class=
"itemTitle"
>
保存原图
</text>
<text
class=
"itemNotice"
>
拍照后另保存一张无水印的图片
</text>
</view>
<switch
class=
"itemSwitch"
:checked=
"result['hasOrigin']"
@
change=
"handleOrigineChange"
color=
"#007AFF"
/>
</view>
<view
class=
"itemView"
v-if=
"showTitleSwitch"
>
<view
class=
"itemTitleView"
@
click=
"itemClick(
{},-1)">
<text
class=
"itemTitle"
>
水印标题
</text>
<text
class=
"itemNotice"
>
{{
result
[
'lowerLeft'
][
'title'
]
||
'点击可编辑更改'
}}
</text>
</view>
<switch
class=
"itemSwitch"
disabled
:checked=
"result['lowerLeft']['title'] != ''"
@
click=
"handleClickTitleSwitch"
color=
"#007AFF"
/>
</view>
<view
class=
"itemView"
v-for=
"(item,ikey) in itemList"
:key=
"ikey"
>
<view
class=
"itemTitleView"
@
click=
"itemClick(item,ikey)"
>
<text
class=
"itemTitle"
>
{{
item
[
'watemarkText'
]
||
'自定义'
+
(
ikey
+
1
)
}}
</text>
<text
class=
"itemNotice"
>
{{
item
[
'watemarkValue'
]
||
'点击可编辑更改'
}}
</text>
</view>
<switch
class=
"itemSwitch"
:checked=
"item['enable']"
@
change=
"itemChange(item, ikey)"
color=
"#007AFF"
/>
</view>
<u-popup
border-radius=
"10"
v-model=
"isPopShow"
safe-area-inset-bottom
:mask-close-able=
"false"
mode=
"center"
width=
"690rpx"
height=
"600rpx"
@
close=
"handlePopClose"
>
<view
class=
"popCenterView"
>
<text
class=
"popTitle"
>
设置自定义项
</text>
<view
class=
"inputBackView"
>
<view
class=
"ph-pop-left-view"
>
<view
class=
"leftInputView"
>
<input
class=
"leftInput"
type=
"text"
v-model=
"currenItem['watemarkText']"
@
input=
"leftInput()"
:disabled=
"currenItem.type === '备注'"
placeholder=
"请输入"
maxlength=
"10"
/>
</view>
<view
class=
"ph-pop-tip-view"
v-if=
"showTipLeft"
>
*必填项
</view>
</view>
<view
class=
"ph-pop-mid-view"
>
:
</view>
<view>
<view
class=
"rightInputView"
>
<input
class=
"rightInput"
type=
"text"
v-model=
"currenItem['watemarkValue']"
@
input=
"rightInput()"
placeholder=
"请输入内容"
maxlength=
"30"
/>
</view>
<view
class=
"ph-pop-tip-view"
v-if=
"showTipRight"
>
*必填项
</view>
</view>
</view>
<text
class=
"popNoticeText u-m-t-20"
>
示例:
</text>
<text
class=
"popNoticeText"
>
工程队名称:蓝天工程队
</text>
<view
class=
"popBtnView"
>
<u-button
:custom-style=
"customStyleCancel"
hover-class=
"none"
shape=
"circle"
type=
"primary"
@
click=
"popCancelClick()"
>
取消
</u-button>
<u-button
:custom-style=
"customStyleSave"
shape=
"circle"
type=
"primary"
@
click=
"popSaveClick()"
>
保存
</u-button>
</view>
</view>
</u-popup>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
systemId
:
''
,
isSaveOrigine
:
true
,
isPopShow
:
false
,
icon_close_new
:
''
,
result
:
{
hasOrigin
:
true
,
lowerLeft
:
{
body
:
[]
}
},
currenItem
:
{
'watemarkText'
:
''
,
'watemarkValue'
:
''
},
editingItem
:
{},
showTipLeft
:
false
,
showTipRight
:
false
,
loading
:
true
}
},
computed
:
{
itemList
()
{
console
.
log
(
this
.
result
)
if
(
this
.
result
[
'lowerLeft'
])
{
var
arr
=
this
.
result
[
'lowerLeft'
][
'body'
]
return
arr
.
filter
((
item
)
=>
{
return
item
.
watemarkType
===
'备注'
})
}
else
{
return
[]
}
},
showTitleSwitch
()
{
return
this
.
result
[
'lowerLeft'
].
hasOwnProperty
(
'title'
)
&&
this
.
result
[
'lowerLeft'
][
'title'
]
},
customStyleCancel
()
{
return
{
'background-color'
:
'#D1D4D4'
,
'width'
:
'280rpx'
,
'height'
:
'96rpx'
}
},
customStyleSave
()
{
return
{
'background-color'
:
'##2272FF'
,
'width'
:
'280rpx'
,
'height'
:
'96rpx'
,
'margin-left'
:
'50rpx'
}
}
},
created
(
e
)
{
getApp
().
trackPage
(
'水印设置页'
)
const
globalData
=
getApp
().
globalData
this
.
icon_close_new
=
globalData
.
icon_close_new
this
.
systemId
=
globalData
.
photo
.
currentItem
.
partnerCompanyId
this
.
getItemList
()
},
methods
:
{
getItemList
:
function
()
{
this
.
loading
=
true
this
.
$u
.
api
.
getWatermark
({
partnerCompanyId
:
this
.
systemId
}).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
result
=
res
.
data
}
else
{
uni
.
showToast
({
title
:
res
.
data
.
message
})
}
this
.
loading
=
false
})
},
saveUserWatermark
:
function
()
{
this
.
loading
=
true
this
.
$u
.
api
.
saveWatermark
(
this
.
result
).
then
(
res
=>
{
if
(
res
.
code
===
200
){
uni
.
showToast
({
title
:
'保存成功'
})
getApp
().
globalData
.
photo
.
waterSetting
=
this
.
result
this
.
$emit
(
"changeWatermark"
,
this
.
result
);
}
else
{
uni
.
showToast
({
title
:
res
.
message
})
}
this
.
loading
=
false
})
},
//保存原图 开关
handleOrigineChange
:
function
(
e
)
{
this
.
result
[
'hasOrigin'
]
=
!
this
.
result
[
'hasOrigin'
]
this
.
saveUserWatermark
()
},
handleClickTitleSwitch
:
function
(
e
)
{
var
string
=
this
.
result
[
'lowerLeft'
][
'title'
]
?
'水印标题不可关闭'
:
'请先编辑该自定义项'
uni
.
showToast
({
icon
:
'none'
,
title
:
string
})
},
//自定义 开关
itemChange
:
function
(
item
,
ikey
)
{
if
(
item
[
'watemarkValue'
])
{
// 修改
item
[
'enable'
]
=
!
item
[
'enable'
]
this
.
saveUserWatermark
()
}
else
{
uni
.
showToast
({
icon
:
'none'
,
title
:
'请先编辑该自定义项'
})
}
},
//自定义 点击
itemClick
:
function
(
item
,
ikey
)
{
if
(
ikey
===
-
1
)
{
this
.
currenItem
=
{
'watemarkText'
:
'水印标题'
,
'watemarkValue'
:
this
.
result
[
'lowerLeft'
][
'title'
],
'type'
:
'备注'
}
}
else
{
this
.
editingItem
=
item
this
.
currenItem
=
{
...
item
}
}
this
.
isPopShow
=
true
},
//左侧输入框
leftInput
:
function
(
e
)
{
if
(
this
.
currenItem
[
'watemarkText'
])
{
this
.
showTipLeft
=
false
}
},
//右侧输入框
rightInput
:
function
(
e
)
{
if
(
this
.
currenItem
[
'watemarkValue'
])
{
this
.
showTipRight
=
false
}
},
//自定义弹窗 关闭
popCancelClick
:
function
()
{
this
.
isPopShow
=
false
this
.
currenItem
=
{
'watemarkText'
:
''
,
'watemarkValue'
:
''
}
},
handlePopClose
()
{
this
.
showTipLeft
=
false
,
this
.
showTipRight
=
false
},
backTake
()
{
this
.
$emit
(
'changeType'
,
1
)
},
//自定义弹窗 保存
popSaveClick
:
function
()
{
if
(
this
.
currenItem
[
'watemarkText'
]
&&
this
.
currenItem
[
'watemarkValue'
])
{
this
.
isPopShow
=
false
if
(
this
.
currenItem
.
type
===
'备注'
)
{
this
.
result
[
'lowerLeft'
][
'title'
]
=
this
.
currenItem
[
'watemarkValue'
]
}
else
{
this
.
editingItem
[
'watemarkText'
]
=
this
.
currenItem
[
'watemarkText'
]
this
.
editingItem
[
'watemarkValue'
]
=
this
.
currenItem
[
'watemarkValue'
]
this
.
editingItem
[
'enable'
]
=
true
}
this
.
saveUserWatermark
()
}
else
{
// 提示
if
(
!
this
.
currenItem
[
'watemarkText'
])
{
this
.
showTipLeft
=
true
}
if
(
!
this
.
currenItem
[
'watemarkValue'
])
{
this
.
showTipRight
=
true
}
}
}
}
}
</
script
>
<
style
>
.backView
{
background-color
:
#FAFAFA
;
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
}
/*
.firstItemView{
background-color: #FFFFFF;
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding-top: 80rpx;
padding-bottom: 80rpx;
border-bottom: 2rpx solid #F4F5F7;
} */
.itemView
{
background-color
:
#FFFFFF
;
width
:
100%
;
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
justify-content
:
space-between
;
padding-top
:
54
rpx
;
padding-bottom
:
54
rpx
;
}
.itemView.firstItem
{
border-bottom
:
2
rpx
solid
#F4F5F7
;
}
.itemTitleView
{
background-color
:
#FFFFFF
;
width
:
80%
;
display
:
flex
;
flex-direction
:
column
;
padding-left
:
30
rpx
;
}
.itemTitle
{
font-size
:
32
rpx
;
font-weight
:
bold
;
color
:
#333333
;
}
.itemNotice
{
font-size
:
26
rpx
;
color
:
#666666
;
margin-top
:
4
rpx
;
}
.itemSwitch
{
margin-right
:
30
rpx
;
transform
:
scale
(
0.78
,
0.75
);
}
.shadowBackView
{
background-color
:
rgba
(
0
,
0
,
0
,
0.5
);
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
}
.popCenterView
{
background-color
:
#FFFFFF
;
display
:
flex
;
flex-direction
:
column
;
}
.popTitle
{
font-size
:
36
rpx
;
font-weight
:
bold
;
margin-top
:
50
rpx
;
padding-left
:
30
rpx
;
}
.inputBackView
{
margin-top
:
52
rpx
;
width
:
100%
;
height
:
90
rpx
;
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
justify-content
:
space-between
;
display
:
flex
;
align-items
:
flex-start
;
}
.leftInputView
{
width
:
220
rpx
;
height
:
72
rpx
;
border
:
2
rpx
solid
#666666
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
.leftInput
{
width
:
180
rpx
;
height
:
32
rpx
;
}
.ph-pop-left-view
{
margin-left
:
30
rpx
;
}
.ph-pop-tip-view
{
color
:
#F56C6C
;
}
.ph-pop-mid-view
{
margin-top
:
20
rpx
;
}
.rightInputView
{
width
:
360
rpx
;
height
:
72
rpx
;
border
:
2
rpx
solid
#666666
;
margin-right
:
30
rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
.rightInput
{
width
:
320
rpx
;
height
:
32
rpx
;
}
.popNoticeText
{
font-size
:
26
rpx
;
color
:
#666666
;
padding-left
:
30
rpx
;
}
.popBtnView
{
margin-top
:
110
rpx
;
width
:
100%
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
/* .popCancelBtn {
background-color: #D1D4D4;
width: 280rpx;
height: 96rpx;
border-radius: 48rpx;
margin-left: 40rpx;
display: flex;
align-items: center;
justify-content: center;
} */
/* .popSaveBtn {
background-color: #2272FF;
width: 280rpx;
height: 96rpx;
border-radius: 48rpx;
margin-right: 40rpx;
display: flex;
align-items: center;
justify-content: center;
} */
/* .popBtnText {
font-size: 32rpx;
color: #FFFFFF;
font-weight: 600;
} */
</
style
>
src/components/take/index.vue
View file @
8982de7c
<
template
>
<view
class=
"camera"
>
<view
class=
"camera-container"
v-if=
"showType === 1"
>
<cover-view
class=
"header-box"
:style=
"
{'height':navHeight/2 + 'px'}">
<cover-view
class=
"inner"
>
<cover-image
@
click=
"setCameraInfo('devicePosition')"
class=
"icon"
mode=
"aspectFit"
src=
"/static/photo/icon-switch.png"
></cover-image>
<cover-image
@
click=
"setCameraInfo('flash')"
class=
"icon"
mode=
"aspectFit"
:src=
"'/static/photo/icon-light-' + cameraInfo.flash +'.png'"
></cover-image>
<cover-image
v-if=
"currentItem.partnerCompanyId"
@
click=
"changeType(3)"
class=
"icon"
mode=
"aspectFit"
src=
"/static/photo/icon-setting.png"
></cover-image>
</cover-view>
</cover-view>
<camera
class=
"camera-box"
v-if=
"cameraChange&&!standardShow"
:device-position=
"cameraInfo.devicePosition"
:flash=
"cameraInfo.flash"
:style=
"
{'height':cameraHeight/2 + 'px','top':parseInt(navHeight/2) + 'px'}"
@error="cameraError">
<cover-view
class=
"mark-box"
>
<cover-view
class=
"txt big"
v-if=
"titleTxt"
>
{{
titleTxt
}}
</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
.
date
||
'正在获取中...'
}}
</cover-view>
-->
</cover-view>
<cover-image
class=
"mark-water"
mode=
"aspectFit"
:src=
"waterInfo.markImage"
></cover-image>
</camera>
<cover-view
class=
"bottom-box"
v-if=
"!standardShow"
>
<cover-image
class=
"icon"
src=
'/static/photo/icon-back.png'
mode=
""
@
click=
"goBack"
></cover-image>
<cover-image
class=
'icon-take icon'
src=
'/static/photo/icon-take.png'
@
click=
"$u.debounce(takePhoto, 500)"
>
</cover-image>
<cover-image
class=
'icon'
src=
'/static/photo/icon-standard.png'
@
click=
"standardShow = true"
v-if=
"standardStatus"
>
</cover-image>
<view
class=
'icon'
v-else
></view>
</cover-view>
<canvas
canvas-id=
"canvas"
id=
"photoCanvas"
class=
"canvas"
:style=
"
{'width':750 + 'rpx','height': cameraHeight + 'rpx'}">
</canvas>
<view
v-show=
"standardShow"
class=
"page-mask"
:z-index=
"10000"
>
<photo-standard
:currentItem=
"currentItem"
/>
<view
class=
"btn-close"
>
<image
@
click=
"closeShadow"
class=
"icon icon-close"
mode=
"aspectFit"
src=
"/static/photo/icon-close.png"
></image>
</view>
</view>
</view>
<photo-preview
v-if=
"showType === 2"
@
changeType=
"changeType"
@
finish=
"finish"
/>
<photo-setting
v-if=
"showType === 3"
@
changeType=
"changeType"
@
changeWatermark=
"changeWatermark"
/>
</view>
</
template
>
<
script
>
let
r
=
require
(
"@/libs/bmap-wx.min.js"
);
let
h
=
new
r
.
BMapWX
({
// ak: "rpVq5d3yxaRCoKzVwmFMo0o4iC524CAG",
ak
:
"iXsGdyEcm1iQONoUPyEp0hrBTLCuOaW2"
});
import
standard
from
'@/components/photo/standard.vue'
import
preview
from
'@/components/photo/preview.vue'
import
setting
from
'@/components/photo/setting.vue'
export
default
{
props
:
{
currentItem
:
{
// 对应的规范item
default
()
{
return
{
_id
:
''
,
// 规格ID
system_id
:
''
,
// 系统ID
brand_id
:
''
,
// 品牌ID
classify_id
:
''
,
// 分类ID
images
:
[],
// 拍照要求示意图
main_point
:
[]
// 要点
}
}
}
},
components
:
{
'photo-standard'
:
standard
,
'photo-preview'
:
preview
,
'photo-setting'
:
setting
,
},
data
()
{
return
{
showType
:
1
,
standardShow
:
false
,
cameraInfo
:
{
devicePosition
:
'back'
,
flash
:
'auto'
},
waterInfo
:
{
longitude
:
''
,
// 经度
latitude
:
''
,
// 维度
address
:
''
,
//地址
date
:
''
,
//日期
markImage
:
'https://qn-static.banshouhui.com/live_mark.png'
},
tempImgs
:
{
'markImage'
:
''
,
// 拍照水印
'origin'
:
''
,
// 无水印照片
'mixWater'
:
''
,
// 有水印照片
},
authSetting
:
{
camera
:
false
,
// 相机授权
location
:
false
,
// 位置授权
},
navHeight
:
130
,
cameraWidth
:
750
,
cameraHeight
:
1000
,
// (4 / 3 * 750) 图片比例4:3
ratio
:
0
,
cameraChange
:
false
,
waterSetting
:
null
,
shadowInitShow
:
false
,
// 第一次进入页面需显示弹窗
standardStatus
:
false
// 是否显示拍照要求
}
},
created
(
e
)
{
const
photo
=
getApp
().
globalData
.
photo
getApp
().
trackPage
(
'拍照页'
)
photo
.
allImages
=
[]
photo
.
currentItemLength
=
0
// this.ctx = uni.createCameraContext();
this
.
updateTime
()
this
.
getLocation
()
this
.
getMarkPath
()
this
.
initData
()
photo
.
currentItem
=
this
.
currentItem
if
(
this
.
currentItem
.
images
.
length
>
0
)
{
this
.
shadowInitShow
=
true
this
.
standardShow
=
true
this
.
standardStatus
=
true
}
},
computed
:
{
titleTxt
()
{
const
waterSetting
=
this
.
waterSetting
let
txt
=
''
if
(
!
waterSetting
||
!
waterSetting
.
lowerLeft
)
{
return
''
}
txt
=
waterSetting
.
lowerLeft
&&
waterSetting
.
lowerLeft
.
title
||
''
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
.
lowerLeft
||
!
waterSetting
.
lowerLeft
.
body
)
{
return
arr
}
const
settingArr
=
waterSetting
.
lowerLeft
.
body
settingArr
.
map
(
item
=>
{
const
idx
=
typeArr
.
indexOf
(
item
.
watemarkType
)
if
(
item
.
enable
&&
(
idx
>
-
1
||
(
item
.
watemarkValue
&&
item
.
watemarkText
)))
{
if
(
idx
>
-
1
)
{
settingTxtArr
.
push
(
arr
[
idx
])
}
else
{
settingTxtArr
.
push
(
item
.
watemarkText
+
':'
+
item
.
watemarkValue
)
}
}
})
return
settingTxtArr
}
},
watch
:
{},
mounted
()
{
// 默认开启弹窗
const
photo
=
getApp
().
globalData
.
photo
this
.
waterSetting
=
photo
.
waterSetting
this
.
standardShow
=
this
.
shadowInitShow
this
.
cameraChange
=
true
// this.initData()
},
destroyed
(){
this
.
cameraChange
=
false
},
methods
:
{
closeShadow
()
{
this
.
shadowInitShow
=
false
this
.
standardShow
=
false
},
goBack
()
{
uni
.
showTabBar
()
this
.
$emit
(
'close'
)
},
finish
()
{
uni
.
showTabBar
()
const
photo
=
getApp
().
globalData
.
photo
this
.
$emit
(
'close'
,
photo
.
allImages
)
},
changeType
(
type
)
{
this
.
showType
=
type
},
changeWatermark
(
watermark
){
this
.
waterSetting
=
watermark
},
updateTime
()
{
this
.
waterInfo
.
date
=
this
.
getTime
()
// let timer = setTimeout(() => {
// clearTimeout(timer);
// this.updateTime()
// }, 1000)
},
setCameraInfo
(
type
)
{
// 设置相机前置后置、闪关灯等
const
cameraInfo
=
this
.
cameraInfo
let
val
=
cameraInfo
[
type
]
switch
(
type
)
{
case
'devicePosition'
:
val
=
val
===
'back'
?
'front'
:
'back'
break
;
case
'flash'
:
val
=
val
===
'auto'
?
'on'
:
(
val
===
'on'
?
'off'
:
'auto'
)
break
;
defalut
:
break
;
}
this
.
cameraInfo
[
type
]
=
val
},
initData
()
{
const
globalData
=
getApp
().
globalData
this
.
navHeight
=
globalData
.
navHeight
this
.
cameraHeight
=
parseInt
(
globalData
.
safeHeight
*
2
-
globalData
.
navHeight
-
200
)
this
.
ratio
=
globalData
.
screenHeight
/
globalData
.
rpxScreenHeight
this
.
waterSetting
=
globalData
.
photo
.
waterSetting
},
baiduLocation
()
{
// 百度sdk解析经纬度
let
waterInfo
=
this
.
waterInfo
const
t
=
function
()
{
let
t
=
{
success
:
function
(
res
)
{
let
e
=
res
.
wxMarkerData
[
0
];
let
i
=
e
.
address
;
waterInfo
.
address
=
i
},
fail
:
function
(
err
)
{
//console.log(err, 'err')
}
};
if
(
waterInfo
.
latitude
&&
waterInfo
.
longitude
)
{
let
e
=
waterInfo
.
latitude
+
","
+
waterInfo
.
longitude
;
t
.
location
=
e
;
}
h
.
regeocoding
(
t
);
};
t
()
},
cameraError
(
e
)
{
const
{
errMsg
}
=
e
.
detail
// console.log(e.detail, 'e.detail')
if
(
errMsg
!==
'insertCamera:fail auth deny'
)
{
return
}
this
.
showSettingModal
(
'camera'
)
},
//获取位置
getLocation
()
{
let
that
=
this
const
waterInfo
=
this
.
waterInfo
uni
.
getLocation
({
type
:
'gcj02'
,
success
:
function
(
res
)
{
waterInfo
.
longitude
=
parseFloat
(
res
.
longitude
).
toFixed
(
4
)
waterInfo
.
latitude
=
parseFloat
(
res
.
latitude
).
toFixed
(
3
)
that
.
baiduLocation
()
},
fail
(
err
)
{
that
.
showSettingModal
(
'location'
)
// that.showLocationAuthModal('')
}
});
},
showSettingModal
(
type
)
{
type
=
type
||
'camera'
const
self
=
this
let
authSetting
=
{
'camera'
:
{
content
:
'将无法进行拍照'
,
method
:
''
},
'location'
:
{
content
:
'将无法定位当前位置'
,
method
:
''
},
'writePhotosAlbum'
:
{
content
:
'将无法保存图片到本地'
,
method
:
''
}
}
let
content
=
authSetting
[
type
].
content
uni
.
showModal
({
content
:
'拒绝授权'
+
content
+
',是否去设置打开?'
,
confirmText
:
"确认"
,
cancelText
:
'取消'
,
success
(
res
)
{
if
(
res
.
confirm
)
{
self
.
openSetting
()
}
},
fail
()
{}
})
},
openSetting
()
{
// 打开设置
let
self
=
this
this
.
cameraChange
=
false
wx
.
openSetting
({
success
(
res
)
{
const
authSetting
=
res
.
authSetting
self
.
cameraChange
=
true
if
(
authSetting
[
'scope.userLocation'
])
{
// 位置授权成功
self
.
authSetting
.
location
=
true
self
.
getLocation
()
}
if
(
res
.
authSetting
[
'scope.camera'
])
{
self
.
authSetting
.
camera
=
true
}
if
(
res
.
authSetting
[
'scope.writePhotosAlbum'
])
{
self
.
authSetting
.
writePhotosAlbum
=
true
}
}
})
},
//获取 水印 本地缓存路径
getMarkPath
:
function
()
{
uni
.
downloadFile
({
url
:
this
.
waterInfo
.
markImage
,
//仅为示例,并非真实的资源
success
:
(
res
)
=>
{
if
(
res
.
statusCode
===
200
)
{
this
.
tempImgs
.
markImage
=
res
.
tempFilePath
}
},
fail
()
{
console
.
log
(
'水印图片 下载失败'
)
}
})
},
/* ---------------------- 拍照流程 ---------------------- */
// 第一步:拍照
takePhoto
()
{
wx
.
createCameraContext
().
takePhoto
({
quality
:
"high"
}).
then
(
res
=>
{
this
.
tempImgs
.
origin
=
res
.
tempImagePath
this
.
drawCanvas
(
res
.
tempImagePath
)
})
},
// 第二步:绘制画布
drawCanvas
:
function
(
tempPath
)
{
uni
.
showLoading
({
title
:
'数据处理中...'
,
icon
:
'loading'
})
const
waterSetting
=
this
.
waterSetting
const
globalTempPath
=
getApp
().
globalData
.
photo
.
tempPath
const
ratio
=
this
.
ratio
console
.
log
(
this
.
ratio
,
'this.ratio'
)
// const ratio = 0.5
let
canvasWidth
=
this
.
cameraWidth
*
ratio
let
canvasHeight
=
this
.
cameraHeight
*
ratio
const
waterInfo
=
this
.
waterInfo
this
.
showImage
=
true
const
settingTxtArr
=
this
.
settingTxtArr
//将原图画到canvas上面
let
canvas
=
uni
.
createCanvasContext
(
"canvas"
,
this
)
canvas
.
rect
(
0
,
0
,
canvasWidth
,
canvasHeight
)
canvas
.
drawImage
(
tempPath
,
0
,
0
,
canvasWidth
,
canvasHeight
)
// this.canvas.draw()
let
txtHeight
=
18
let
h
=
1
//加入 水印文字
for
(
let
i
=
settingTxtArr
.
length
-
1
;
i
>=
0
;
i
--
)
{
txtHeight
=
20
canvas
.
setFontSize
(
15
)
canvas
.
setFillStyle
(
'#f2f2f2'
)
let
txt
=
settingTxtArr
[
i
]
if
(
txt
.
indexOf
(
'时间'
)
>=
0
){
canvas
.
fillText
(
txt
,
10
,
canvasHeight
-
txtHeight
*
h
++
);
}
else
{
if
(
txt
.
length
>
22
){
canvas
.
fillText
(
txt
.
substr
(
22
,
22
),
10
,
canvasHeight
-
txtHeight
*
h
++
);
canvas
.
fillText
(
txt
.
substr
(
0
,
22
),
10
,
canvasHeight
-
txtHeight
*
h
++
);
}
else
{
canvas
.
fillText
(
txt
,
10
,
canvasHeight
-
txtHeight
*
h
++
);
}
}
// canvas.fillText(txt, 10, canvasHeight - txtHeight * h++);
}
const
title
=
this
.
titleTxt
if
(
title
)
{
canvas
.
save
()
let
titleHeight
=
title
.
length
>
14
?
60
:
30
let
rectWidth
=
title
.
length
>
14
?
215
:
title
.
length
*
10
canvas
.
setFillStyle
(
'rgba(34, 114, 255, 0.6)'
)
canvas
.
fillRect
(
10
,
canvasHeight
-
txtHeight
*
h
-
titleHeight
,
215
,
titleHeight
)
canvas
.
restore
()
canvas
.
setFontSize
(
20
)
canvas
.
setFillStyle
(
'#f2f2f2'
)
// canvas.setTextAlign('center')
if
(
title
.
length
>
14
)
{
canvas
.
fillText
(
title
.
substr
(
14
,
14
),
10
,
canvasHeight
-
txtHeight
*
h
++
+
20
);
}
canvas
.
fillText
(
title
.
substr
(
0
,
14
),
10
,
canvasHeight
-
txtHeight
*
h
++
-
titleHeight
/
2
+
10
);
}
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
.
draw
(
false
,
setTimeout
(()
=>
{
uni
.
canvasToTempFilePath
({
width
:
canvasWidth
,
height
:
canvasHeight
,
canvasId
:
'canvas'
,
success
:
(
res
)
=>
{
this
.
tempImgs
.
mixWater
=
res
.
tempFilePath
globalTempPath
.
origin
=
this
.
tempImgs
.
origin
globalTempPath
.
mixWater
=
res
.
tempFilePath
let
timer
=
setTimeout
(()
=>
{
//this.goPage('/pages/photo/preview')
this
.
changeType
(
2
)
},
0
)
// this.saveToLocal(res.tempFilePath)
},
fail
:
(
res
)
=>
{
console
.
log
(
res
);
},
complete
:
()
=>
{
uni
.
hideLoading
();
}
},
this
);
},
50
))
},
// 第三步:保存到本地
saveToLocal
(
tempImagePath
)
{
//has_origin //是否保存原图
let
that
=
this
uni
.
saveImageToPhotosAlbum
({
filePath
:
tempImagePath
,
success
()
{
uni
.
showToast
({
icon
:
'none'
,
title
:
'已将照片保存到本地相册'
})
},
fail
()
{}
})
},
showPreviewFn
(
img
)
{
uni
.
previewImage
({
current
:
0
,
urls
:
[
img
]
});
},
//获取当前时间
getTime
:
function
()
{
let
d
=
new
Date
();
let
year
=
d
.
getFullYear
();
let
month
=
d
.
getMonth
()
+
1
;
let
date
=
d
.
getDate
();
let
days
=
new
Array
(
"日"
,
"一"
,
"二"
,
"三"
,
"四"
,
"五"
,
"六"
);
let
day
=
d
.
getDay
();
let
hour
=
(
d
.
getHours
()
<
10
)
?
(
"0"
+
d
.
getHours
())
:
d
.
getHours
();
let
min
=
(
d
.
getMinutes
()
<
10
)
?
(
"0"
+
d
.
getMinutes
())
:
d
.
getMinutes
();
let
sec
=
(
d
.
getSeconds
()
<
10
)
?
(
"0"
+
d
.
getSeconds
())
:
d
.
getSeconds
();
let
now
=
year
+
"年"
+
month
+
"月"
+
date
+
"日 "
+
hour
+
":"
+
min
+
":"
+
sec
;
return
now
},
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.camera
{
position
:fixed
;
padding
:
0
;
margin
:
0
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
z-index
:
999999
;
}
.camera-container
{
// padding-top:var(--status-bar-height);
min-height
:
100vh
;
background-color
:
black
;
}
.header-box
{
// padding:10rpx 20rpx;
position
:
relative
;
.inner
{
display
:
flex
;
position
:
absolute
;
left
:
0
;
right
:
0
;
bottom
:
0
;
}
.icon
{
margin
:
20rpx
;
display
:
block
;
width
:
44rpx
;
height
:
44rpx
;
}
}
.camera-box
{
position
:
absolute
;
left
:
0
;
width
:
100%
;
// height: 100vh;
z-index
:
1
;
}
.mark-water
{
position
:
absolute
;
left
:
50%
;
top
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
width
:
360rpx
;
height
:
90rpx
;
z-index
:
6
;
}
.mark-box
{
position
:
absolute
;
left
:
0
;
bottom
:
0
;
padding
:
20rpx
;
.txt
{
max-width
:
500rpx
;
max-height
:
80rpx
;
overflow
:
hidden
;
margin-top
:
5rpx
;
line-height
:
40rpx
;
white-space
:
normal
;
font-size
:
28rpx
;
color
:
#fff
;
&
.big
{
padding
:
10rpx
;
margin-bottom
:
10rpx
;
width
:
430rpx
;
line-height
:
40rpx
;
font-size
:
32rpx
;
background-color
:
rgba
(
34
,
114
,
255
,
0
.6
);
}
}
}
.bottom-box
{
position
:
absolute
;
left
:
0
;
right
:
0
;
bottom
:
0
;
// bottom: constant(safe-area-inset-bottom);
// bottom: env(safe-area-inset-bottom);
z-index
:
5
;
box-sizing
:
border-box
;
height
:
200rpx
;
display
:
flex
;
justify-content
:
space-between
;
padding
:
20rpx
78rpx
;
align-items
:
center
;
background-color
:
black
;
.txt
{
white-space
:
nowrap
;
line-height
:
60rpx
;
color
:
#fff
;
}
.icon
{
display
:
block
;
width
:
92rpx
;
height
:
92rpx
;
&
.icon-take
{
width
:
144rpx
;
height
:
144rpx
;
}
}
}
.canvas
{
position
:
fixed
;
left
:
-750rpx
;
top
:
0
;
}
// 拍照规范
.page-mask
{
position
:
fixed
;
bottom
:
0
;
bottom
:
constant
(
safe-area-inset-bottom
);
bottom
:
env
(
safe-area-inset-bottom
);
z-index
:
1000
;
width
:
750rpx
;
height
:
100vh
;
// padding: 0 30rpx;
box-sizing
:
border-box
;
background-color
:
rgba
(
0
,
0
,
0
,
0
.8
);
.icon
{
width
:
92rpx
;
height
:
92rpx
;
}
.btn-close
{
position
:
absolute
;
bottom
:
0
;
bottom
:
constant
(
safe-area-inset-bottom
);
bottom
:
env
(
safe-area-inset-bottom
);
left
:
0
;
right
:
0
;
height
:
200rpx
;
z-index
:
100
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
}
</
style
>
<
template
>
<view
class=
"camera"
>
<view
class=
"camera-container"
v-if=
"showType === 1"
>
<cover-view
class=
"header-box"
:style=
"
{'height':navHeight/2 + 'px'}">
<cover-view
class=
"inner"
>
<cover-image
@
click=
"setCameraInfo('devicePosition')"
class=
"icon"
mode=
"aspectFit"
src=
"/static/photo/icon-switch.png"
></cover-image>
<cover-image
@
click=
"setCameraInfo('flash')"
class=
"icon"
mode=
"aspectFit"
:src=
"'/static/photo/icon-light-' + cameraInfo.flash +'.png'"
></cover-image>
<cover-image
v-if=
"currentItem.partnerCompanyId"
@
click=
"changeType(3)"
class=
"icon"
mode=
"aspectFit"
src=
"/static/photo/icon-setting.png"
></cover-image>
</cover-view>
</cover-view>
<camera
class=
"camera-box"
v-if=
"cameraChange&&!standardShow"
:device-position=
"cameraInfo.devicePosition"
:flash=
"cameraInfo.flash"
:style=
"
{'height':cameraHeight/2 + 'px','top':parseInt(navHeight/2) + 'px'}"
@error="cameraError">
<cover-view
class=
"mark-box"
>
<cover-view
class=
"txt big"
v-if=
"titleTxt"
>
{{
titleTxt
}}
</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
.
date
||
'正在获取中...'
}}
</cover-view>
-->
</cover-view>
<cover-image
class=
"mark-water"
mode=
"aspectFit"
:src=
"waterInfo.markImage"
></cover-image>
</camera>
<cover-view
class=
"bottom-box"
v-if=
"!standardShow"
>
<cover-image
class=
"icon"
src=
'/static/photo/icon-back.png'
mode=
""
@
click=
"goBack"
></cover-image>
<cover-image
class=
'icon-take icon'
src=
'/static/photo/icon-take.png'
@
click=
"$u.debounce(takePhoto, 500)"
>
</cover-image>
<cover-image
class=
'icon'
src=
'/static/photo/icon-standard.png'
@
click=
"standardShow = true"
v-if=
"standardStatus"
>
</cover-image>
<view
class=
'icon'
v-else
></view>
</cover-view>
<canvas
canvas-id=
"canvas"
id=
"photoCanvas"
class=
"canvas"
:style=
"
{'width':750 + 'rpx','height': cameraHeight + 'rpx'}">
</canvas>
<view
v-show=
"standardShow"
class=
"page-mask"
:z-index=
"10000"
>
<photo-standard
:currentItem=
"currentItem"
/>
<view
class=
"btn-close"
>
<image
@
click=
"closeShadow"
class=
"icon icon-close"
mode=
"aspectFit"
src=
"/static/photo/icon-close.png"
></image>
</view>
</view>
</view>
<photo-preview
v-if=
"showType === 2"
@
changeType=
"changeType"
@
finish=
"finish"
/>
<photo-setting
v-if=
"showType === 3"
@
changeType=
"changeType"
@
changeWatermark=
"changeWatermark"
/>
</view>
</
template
>
<
script
>
let
r
=
require
(
"@/libs/bmap-wx.min.js"
);
let
h
=
new
r
.
BMapWX
({
// ak: "rpVq5d3yxaRCoKzVwmFMo0o4iC524CAG",
ak
:
"iXsGdyEcm1iQONoUPyEp0hrBTLCuOaW2"
});
import
standard
from
'@/components/photo/standard.vue'
import
preview
from
'@/components/photo/preview.vue'
import
setting
from
'@/components/photo/setting.vue'
export
default
{
props
:
{
currentItem
:
{
// 对应的规范item
default
()
{
return
{
_id
:
''
,
// 规格ID
system_id
:
''
,
// 系统ID
brand_id
:
''
,
// 品牌ID
classify_id
:
''
,
// 分类ID
images
:
[],
// 拍照要求示意图
main_point
:
[]
// 要点
}
}
}
},
components
:
{
'photo-standard'
:
standard
,
'photo-preview'
:
preview
,
'photo-setting'
:
setting
,
},
data
()
{
return
{
showType
:
1
,
standardShow
:
false
,
cameraInfo
:
{
devicePosition
:
'back'
,
flash
:
'auto'
},
waterInfo
:
{
longitude
:
''
,
// 经度
latitude
:
''
,
// 维度
address
:
''
,
//地址
date
:
''
,
//日期
markImage
:
'https://qn-static.banshouhui.com/live_mark.png'
},
tempImgs
:
{
'markImage'
:
''
,
// 拍照水印
'origin'
:
''
,
// 无水印照片
'mixWater'
:
''
,
// 有水印照片
},
authSetting
:
{
camera
:
false
,
// 相机授权
location
:
false
,
// 位置授权
},
navHeight
:
130
,
cameraWidth
:
750
,
cameraHeight
:
1000
,
// (4 / 3 * 750) 图片比例4:3
ratio
:
0
,
cameraChange
:
false
,
waterSetting
:
null
,
shadowInitShow
:
false
,
// 第一次进入页面需显示弹窗
standardStatus
:
false
// 是否显示拍照要求
}
},
created
(
e
)
{
const
photo
=
getApp
().
globalData
.
photo
getApp
().
trackPage
(
'拍照页'
)
photo
.
allImages
=
[]
photo
.
currentItemLength
=
0
// this.ctx = uni.createCameraContext();
this
.
updateTime
()
const
locationData
=
uni
.
getStorageSync
(
'locationData'
)
const
validityTime
=
60000
if
(
Date
.
now
()
-
locationData
.
locationTime
<
validityTime
)
{
// 1分钟内不重复请求位置信息
this
.
waterInfo
.
latitude
=
locationData
.
waterInfo
.
latitude
this
.
waterInfo
.
longitude
=
locationData
.
waterInfo
.
longitude
this
.
baiduLocation
()
}
else
{
this
.
getLocation
()
}
this
.
getMarkPath
()
this
.
initData
()
photo
.
currentItem
=
this
.
currentItem
if
(
this
.
currentItem
.
images
&&
this
.
currentItem
.
images
.
length
>
0
)
{
this
.
shadowInitShow
=
true
this
.
standardShow
=
true
this
.
standardStatus
=
true
}
},
computed
:
{
titleTxt
()
{
const
waterSetting
=
this
.
waterSetting
let
txt
=
''
if
(
!
waterSetting
||
!
waterSetting
.
lowerLeft
)
{
return
''
}
txt
=
waterSetting
.
lowerLeft
&&
waterSetting
.
lowerLeft
.
title
||
''
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
.
lowerLeft
||
!
waterSetting
.
lowerLeft
.
body
)
{
return
arr
}
const
settingArr
=
waterSetting
.
lowerLeft
.
body
settingArr
.
map
(
item
=>
{
const
idx
=
typeArr
.
indexOf
(
item
.
watemarkType
)
if
(
item
.
enable
&&
(
idx
>
-
1
||
(
item
.
watemarkValue
&&
item
.
watemarkText
)))
{
if
(
idx
>
-
1
)
{
settingTxtArr
.
push
(
arr
[
idx
])
}
else
{
settingTxtArr
.
push
(
item
.
watemarkText
+
':'
+
item
.
watemarkValue
)
}
}
})
return
settingTxtArr
}
},
watch
:
{},
mounted
()
{
// 默认开启弹窗
const
photo
=
getApp
().
globalData
.
photo
this
.
waterSetting
=
photo
.
waterSetting
this
.
standardShow
=
this
.
shadowInitShow
this
.
cameraChange
=
true
// this.initData()
},
destroyed
(){
this
.
cameraChange
=
false
},
methods
:
{
closeShadow
()
{
this
.
shadowInitShow
=
false
this
.
standardShow
=
false
},
goBack
()
{
uni
.
showTabBar
()
this
.
$emit
(
'close'
)
},
finish
()
{
uni
.
showTabBar
()
const
photo
=
getApp
().
globalData
.
photo
this
.
$emit
(
'close'
,
photo
.
allImages
)
},
changeType
(
type
)
{
this
.
showType
=
type
},
changeWatermark
(
watermark
){
this
.
waterSetting
=
watermark
},
updateTime
()
{
this
.
waterInfo
.
date
=
this
.
getTime
()
// let timer = setTimeout(() => {
// clearTimeout(timer);
// this.updateTime()
// }, 1000)
},
setCameraInfo
(
type
)
{
// 设置相机前置后置、闪关灯等
const
cameraInfo
=
this
.
cameraInfo
let
val
=
cameraInfo
[
type
]
switch
(
type
)
{
case
'devicePosition'
:
val
=
val
===
'back'
?
'front'
:
'back'
break
;
case
'flash'
:
val
=
val
===
'auto'
?
'on'
:
(
val
===
'on'
?
'off'
:
'auto'
)
break
;
defalut
:
break
;
}
this
.
cameraInfo
[
type
]
=
val
},
initData
()
{
const
globalData
=
getApp
().
globalData
this
.
navHeight
=
globalData
.
navHeight
this
.
cameraHeight
=
parseInt
(
globalData
.
safeHeight
*
2
-
globalData
.
navHeight
-
200
)
this
.
ratio
=
globalData
.
screenHeight
/
globalData
.
rpxScreenHeight
this
.
waterSetting
=
globalData
.
photo
.
waterSetting
},
baiduLocation
()
{
// 百度sdk解析经纬度
let
waterInfo
=
this
.
waterInfo
const
t
=
function
()
{
let
t
=
{
success
:
function
(
res
)
{
let
e
=
res
.
wxMarkerData
[
0
];
let
i
=
e
.
address
;
waterInfo
.
address
=
i
},
fail
:
function
(
err
)
{
//console.log(err, 'err')
}
};
if
(
waterInfo
.
latitude
&&
waterInfo
.
longitude
)
{
let
e
=
waterInfo
.
latitude
+
","
+
waterInfo
.
longitude
;
t
.
location
=
e
;
}
h
.
regeocoding
(
t
);
};
t
()
},
cameraError
(
e
)
{
const
{
errMsg
}
=
e
.
detail
// console.log(e.detail, 'e.detail')
if
(
errMsg
!==
'insertCamera:fail auth deny'
)
{
return
}
this
.
showSettingModal
(
'camera'
)
},
//获取位置
getLocation
()
{
let
that
=
this
const
waterInfo
=
this
.
waterInfo
uni
.
getLocation
({
type
:
'gcj02'
,
success
:
function
(
res
)
{
waterInfo
.
longitude
=
parseFloat
(
res
.
longitude
).
toFixed
(
4
)
waterInfo
.
latitude
=
parseFloat
(
res
.
latitude
).
toFixed
(
3
)
const
data
=
{
waterInfo
:
{
latitude
:
waterInfo
.
latitude
,
longitude
:
waterInfo
.
longitude
},
locationTime
:
Date
.
now
()
}
uni
.
setStorage
({
key
:
'locationData'
,
data
:
data
,
})
that
.
baiduLocation
()
},
fail
(
err
)
{
that
.
showSettingModal
(
'location'
)
// that.showLocationAuthModal('')
}
});
},
showSettingModal
(
type
)
{
type
=
type
||
'camera'
const
self
=
this
let
authSetting
=
{
'camera'
:
{
content
:
'将无法进行拍照'
,
method
:
''
},
'location'
:
{
content
:
'将无法定位当前位置'
,
method
:
''
},
'writePhotosAlbum'
:
{
content
:
'将无法保存图片到本地'
,
method
:
''
}
}
let
content
=
authSetting
[
type
].
content
uni
.
showModal
({
content
:
'拒绝授权'
+
content
+
',是否去设置打开?'
,
confirmText
:
"确认"
,
cancelText
:
'取消'
,
success
(
res
)
{
if
(
res
.
confirm
)
{
self
.
openSetting
()
}
},
fail
()
{}
})
},
openSetting
()
{
// 打开设置
let
self
=
this
this
.
cameraChange
=
false
wx
.
openSetting
({
success
(
res
)
{
const
authSetting
=
res
.
authSetting
self
.
cameraChange
=
true
if
(
authSetting
[
'scope.userLocation'
])
{
// 位置授权成功
self
.
authSetting
.
location
=
true
self
.
getLocation
()
}
if
(
res
.
authSetting
[
'scope.camera'
])
{
self
.
authSetting
.
camera
=
true
}
if
(
res
.
authSetting
[
'scope.writePhotosAlbum'
])
{
self
.
authSetting
.
writePhotosAlbum
=
true
}
}
})
},
//获取 水印 本地缓存路径
getMarkPath
:
function
()
{
uni
.
downloadFile
({
url
:
this
.
waterInfo
.
markImage
,
//仅为示例,并非真实的资源
success
:
(
res
)
=>
{
if
(
res
.
statusCode
===
200
)
{
this
.
tempImgs
.
markImage
=
res
.
tempFilePath
}
},
fail
()
{
console
.
log
(
'水印图片 下载失败'
)
}
})
},
/* ---------------------- 拍照流程 ---------------------- */
// 第一步:拍照
takePhoto
()
{
wx
.
createCameraContext
().
takePhoto
({
quality
:
"high"
}).
then
(
res
=>
{
this
.
tempImgs
.
origin
=
res
.
tempImagePath
this
.
drawCanvas
(
res
.
tempImagePath
)
})
},
// 第二步:绘制画布
drawCanvas
:
function
(
tempPath
)
{
uni
.
showLoading
({
title
:
'数据处理中...'
,
icon
:
'loading'
})
const
waterSetting
=
this
.
waterSetting
const
globalTempPath
=
getApp
().
globalData
.
photo
.
tempPath
const
ratio
=
this
.
ratio
console
.
log
(
this
.
ratio
,
'this.ratio'
)
// const ratio = 0.5
let
canvasWidth
=
this
.
cameraWidth
*
ratio
let
canvasHeight
=
this
.
cameraHeight
*
ratio
const
waterInfo
=
this
.
waterInfo
this
.
showImage
=
true
const
settingTxtArr
=
this
.
settingTxtArr
//将原图画到canvas上面
let
canvas
=
uni
.
createCanvasContext
(
"canvas"
,
this
)
canvas
.
rect
(
0
,
0
,
canvasWidth
,
canvasHeight
)
canvas
.
drawImage
(
tempPath
,
0
,
0
,
canvasWidth
,
canvasHeight
)
// this.canvas.draw()
let
txtHeight
=
18
let
h
=
1
//加入 水印文字
for
(
let
i
=
settingTxtArr
.
length
-
1
;
i
>=
0
;
i
--
)
{
txtHeight
=
20
canvas
.
setFontSize
(
15
)
canvas
.
setFillStyle
(
'#f2f2f2'
)
let
txt
=
settingTxtArr
[
i
]
if
(
txt
.
indexOf
(
'时间'
)
>=
0
){
canvas
.
fillText
(
txt
,
10
,
canvasHeight
-
txtHeight
*
h
++
);
}
else
{
if
(
txt
.
length
>
22
){
canvas
.
fillText
(
txt
.
substr
(
22
,
22
),
10
,
canvasHeight
-
txtHeight
*
h
++
);
canvas
.
fillText
(
txt
.
substr
(
0
,
22
),
10
,
canvasHeight
-
txtHeight
*
h
++
);
}
else
{
canvas
.
fillText
(
txt
,
10
,
canvasHeight
-
txtHeight
*
h
++
);
}
}
// canvas.fillText(txt, 10, canvasHeight - txtHeight * h++);
}
const
title
=
this
.
titleTxt
if
(
title
)
{
canvas
.
save
()
let
titleHeight
=
title
.
length
>
14
?
60
:
30
let
rectWidth
=
title
.
length
>
14
?
215
:
title
.
length
*
10
canvas
.
setFillStyle
(
'rgba(34, 114, 255, 0.6)'
)
canvas
.
fillRect
(
10
,
canvasHeight
-
txtHeight
*
h
-
titleHeight
,
215
,
titleHeight
)
canvas
.
restore
()
canvas
.
setFontSize
(
20
)
canvas
.
setFillStyle
(
'#f2f2f2'
)
// canvas.setTextAlign('center')
if
(
title
.
length
>
14
)
{
canvas
.
fillText
(
title
.
substr
(
14
,
14
),
10
,
canvasHeight
-
txtHeight
*
h
++
+
20
);
}
canvas
.
fillText
(
title
.
substr
(
0
,
14
),
10
,
canvasHeight
-
txtHeight
*
h
++
-
titleHeight
/
2
+
10
);
}
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
.
draw
(
false
,
setTimeout
(()
=>
{
uni
.
canvasToTempFilePath
({
width
:
canvasWidth
,
height
:
canvasHeight
,
canvasId
:
'canvas'
,
success
:
(
res
)
=>
{
this
.
tempImgs
.
mixWater
=
res
.
tempFilePath
globalTempPath
.
origin
=
this
.
tempImgs
.
origin
globalTempPath
.
mixWater
=
res
.
tempFilePath
let
timer
=
setTimeout
(()
=>
{
//this.goPage('/pages/photo/preview')
this
.
changeType
(
2
)
},
0
)
// this.saveToLocal(res.tempFilePath)
},
fail
:
(
res
)
=>
{
console
.
log
(
res
);
},
complete
:
()
=>
{
uni
.
hideLoading
();
}
},
this
);
},
50
))
},
// 第三步:保存到本地
saveToLocal
(
tempImagePath
)
{
//has_origin //是否保存原图
let
that
=
this
uni
.
saveImageToPhotosAlbum
({
filePath
:
tempImagePath
,
success
()
{
uni
.
showToast
({
icon
:
'none'
,
title
:
'已将照片保存到本地相册'
})
},
fail
()
{}
})
},
showPreviewFn
(
img
)
{
uni
.
previewImage
({
current
:
0
,
urls
:
[
img
]
});
},
//获取当前时间
getTime
:
function
()
{
let
d
=
new
Date
();
let
year
=
d
.
getFullYear
();
let
month
=
d
.
getMonth
()
+
1
;
let
date
=
d
.
getDate
();
let
days
=
new
Array
(
"日"
,
"一"
,
"二"
,
"三"
,
"四"
,
"五"
,
"六"
);
let
day
=
d
.
getDay
();
let
hour
=
(
d
.
getHours
()
<
10
)
?
(
"0"
+
d
.
getHours
())
:
d
.
getHours
();
let
min
=
(
d
.
getMinutes
()
<
10
)
?
(
"0"
+
d
.
getMinutes
())
:
d
.
getMinutes
();
let
sec
=
(
d
.
getSeconds
()
<
10
)
?
(
"0"
+
d
.
getSeconds
())
:
d
.
getSeconds
();
let
now
=
year
+
"年"
+
month
+
"月"
+
date
+
"日 "
+
hour
+
":"
+
min
+
":"
+
sec
;
return
now
},
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.camera
{
position
:fixed
;
padding
:
0
;
margin
:
0
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
z-index
:
999999
;
}
.camera-container
{
// padding-top:var(--status-bar-height);
min-height
:
100vh
;
background-color
:
black
;
}
.header-box
{
// padding:10rpx 20rpx;
position
:
relative
;
.inner
{
display
:
flex
;
position
:
absolute
;
left
:
0
;
right
:
0
;
bottom
:
0
;
}
.icon
{
margin
:
20rpx
;
display
:
block
;
width
:
44rpx
;
height
:
44rpx
;
}
}
.camera-box
{
position
:
absolute
;
left
:
0
;
width
:
100%
;
// height: 100vh;
z-index
:
1
;
}
.mark-water
{
position
:
absolute
;
left
:
50%
;
top
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
width
:
360rpx
;
height
:
90rpx
;
z-index
:
6
;
}
.mark-box
{
position
:
absolute
;
left
:
0
;
bottom
:
0
;
padding
:
20rpx
;
.txt
{
max-width
:
500rpx
;
max-height
:
80rpx
;
overflow
:
hidden
;
margin-top
:
5rpx
;
line-height
:
40rpx
;
white-space
:
normal
;
font-size
:
28rpx
;
color
:
#fff
;
&
.big
{
padding
:
10rpx
;
margin-bottom
:
10rpx
;
width
:
430rpx
;
line-height
:
40rpx
;
font-size
:
32rpx
;
background-color
:
rgba
(
34
,
114
,
255
,
0
.6
);
}
}
}
.bottom-box
{
position
:
absolute
;
left
:
0
;
right
:
0
;
bottom
:
0
;
// bottom: constant(safe-area-inset-bottom);
// bottom: env(safe-area-inset-bottom);
z-index
:
5
;
box-sizing
:
border-box
;
height
:
200rpx
;
display
:
flex
;
justify-content
:
space-between
;
padding
:
20rpx
78rpx
;
align-items
:
center
;
background-color
:
black
;
.txt
{
white-space
:
nowrap
;
line-height
:
60rpx
;
color
:
#fff
;
}
.icon
{
display
:
block
;
width
:
92rpx
;
height
:
92rpx
;
&
.icon-take
{
width
:
144rpx
;
height
:
144rpx
;
}
}
}
.canvas
{
position
:
fixed
;
left
:
-750rpx
;
top
:
0
;
}
// 拍照规范
.page-mask
{
position
:
fixed
;
bottom
:
0
;
bottom
:
constant
(
safe-area-inset-bottom
);
bottom
:
env
(
safe-area-inset-bottom
);
z-index
:
1000
;
width
:
750rpx
;
height
:
100vh
;
// padding: 0 30rpx;
box-sizing
:
border-box
;
background-color
:
rgba
(
0
,
0
,
0
,
0
.8
);
.icon
{
width
:
92rpx
;
height
:
92rpx
;
}
.btn-close
{
position
:
absolute
;
bottom
:
0
;
bottom
:
constant
(
safe-area-inset-bottom
);
bottom
:
env
(
safe-area-inset-bottom
);
left
:
0
;
right
:
0
;
height
:
200rpx
;
z-index
:
100
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
}
</
style
>
src/pages.json
View file @
8982de7c
...
...
@@ -41,7 +41,9 @@
{
"path"
:
"pages/login/index"
,
"style"
:
{
"navigationBarTitleText"
:
"授权登录"
"navigationBarTitleText"
:
"授权登录"
,
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
}
}
],
...
...
@@ -240,6 +242,14 @@
"navigationBarTitleText"
:
"配件押金"
,
"enablePullDownRefresh"
:
false
}
},
{
"path"
:
"warehouse/index"
,
"style"
:
{
"navigationStyle"
:
"custom"
,
"navigationBarTitleText"
:
"我的仓库"
,
"enablePullDownRefresh"
:
false
}
}
...
...
@@ -252,7 +262,7 @@
{
"path"
:
"complete"
,
"style"
:
{
"navigationBarTitleText"
:
"
订单-完工配置
"
,
"navigationBarTitleText"
:
""
,
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
}
...
...
@@ -260,7 +270,7 @@
{
"path"
:
"feedback"
,
"style"
:
{
"navigationBarTitleText"
:
"
订单-过程反馈
"
,
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"disableScroll"
:
true
...
...
@@ -269,27 +279,26 @@
{
"path"
:
"refuse"
,
"style"
:
{
"navigationBarTitleText"
:
"
订单-拒单
"
,
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"disableScroll"
:
true
}
},
{
//
订单详情页
"path"
:
"detail"
,
"style"
:
{
"navigationStyle"
:
"custom"
//
隐藏系统导航栏
"navigationBarTitleText"
:
"订单详情"
,
"navigationStyle"
:
"custom"
}
},
{
//
订单搜索页
"path"
:
"search"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"navigationBarTitleText"
:
"
订单搜索
"
,
"enablePullDownRefresh"
:
false
,
"navigationBarBackgroundColor"
:
"#F4F5F7"
}
...
...
@@ -323,9 +332,6 @@
"navigationBarTitleText"
:
"水印设置"
,
"navigationBarBackgroundColor"
:
"#FFFFFF"
,
"backgroundColor"
:
"#F4F5F7"
//
"navigationBarBackgroundColor"
:
"#333333"
,
//
"navigationBarTextStyle"
:
"#FFFFFF"
,
//
"disableScroll"
:
true
}
},
{
...
...
@@ -435,7 +441,7 @@
},
"globalStyle"
:
{
"navigationBarTextStyle"
:
"black"
,
"navigationBarTitleText"
:
"
uni-app
"
,
"navigationBarTitleText"
:
""
,
"navigationBarBackgroundColor"
:
"#F8F8F8"
,
"backgroundColor"
:
"#F4F5F7"
},
...
...
@@ -471,47 +477,19 @@
}
]
},
"condition"
:
{
//模式配置,仅开发期间生效
"current"
:
0
,
//当前激活的模式(list
的索引项)
"condition"
:
{
"current"
:
0
,
"list"
:
[
{
"name"
:
"拍照小工具"
,
//模式名称
"path"
:
"pages/photo/index"
,
//启动页面,必选
"query"
:
""
//启动参数,在页面的onLoad函数里面得到
"name"
:
"拍照小工具"
,
"path"
:
"pages/photo/index"
,
"query"
:
{}
},
{
//
gaomingbo
"name"
:
"工单-过程反馈"
,
"path"
:
"pages/order/feedback"
,
"query"
:
""
},
{
"name"
:
"在线考试"
,
//模式名称
"path"
:
"pages/learn/exam"
,
//启动页面,必选
"query"
:
""
//启动参数,在页面的onLoad函数里面得到
},
{
"name"
:
"入驻考试"
,
//模式名称
"path"
:
"pages/exam/index"
,
//启动页面,必选
"query"
:
""
//启动参数,在页面的onLoad函数里面得到
},
{
"name"
:
"完工配置"
,
//模式名称
"path"
:
"pages/order/complete"
,
//启动页面,必选
"query"
:
{
"id"
:
11880091
}
//启动参数,在页面的onLoad函数里面得到
},
{
"name"
:
"学习 - 首页"
,
//模式名称
"path"
:
"pages/index/learn"
,
//启动页面,必选
"query"
:
""
//启动参数,在页面的onLoad函数里面得到
},
{
"name"
:
"我的 - 我的证件 - 列表"
,
//模式名称
"path"
:
"pages/mine/cert/index"
,
//启动页面,必选
"query"
:
""
//启动参数,在页面的onLoad函数里面得到
}
}
]
}
}
\ No newline at end of file
src/pages/index/index.vue
View file @
8982de7c
...
...
@@ -33,7 +33,7 @@
<!-- 入驻前-->
<view
v-if=
"needSettled"
class=
"tip-view"
>
<image
:src=
"weiruzhuImage"
class=
"tip-view-image"
></image>
<view
class=
"tip-other"
>
入驻
通过后平台将向您
推荐订单
</view>
<view
class=
"tip-other"
>
入驻
后平台将向您分配或
推荐订单
</view>
<u-button
class=
"settle-button"
type=
"primary"
shape=
"circle"
@
click=
"immediatelyIn"
:custom-style=
"buttonStyle"
>
立即入驻
...
...
@@ -100,16 +100,17 @@
token
:
""
,
pageNumber
:
0
,
pageSize
:
100
,
},
},
waitInit
:
false
,
// 当token为空时,等待自动登录结束
triggered
:
false
,
_freshing
:
false
,
};
},
watch
:
{
//
vuex_token(val, oldVal) {
//
// 监听token变化,如果更新则重新加载页面数据
// val && this.initSettleInfo
()
//
}
vuex_token
(
val
,
oldVal
)
{
// 监听token变化,如果更新则重新加载页面数据
val
&&
this
.
waitInit
&&
this
.
getData
()
}
},
computed
:
{
buttonStyle
()
{
...
...
@@ -139,7 +140,11 @@
},
onLoad
()
{
this
.
_freshing
=
false
;
this
.
getOrderCount
()
if
(
this
.
vuex_token
)
{
this
.
getOrderCount
()
}
else
{
this
.
waitInit
=
true
}
},
onShow
()
{
// 每次进入页面都刷新入驻状态
...
...
@@ -164,6 +169,10 @@
// console.log('---------scroll---------', obj)
// },
methods
:
{
getData
()
{
this
.
getOrderCount
()
this
.
initSettleInfo
();
},
handleClick
(
orderId
)
{
// 点击了cell
console
.
log
(
'点击了cell'
)
this
.
viewOderItem
(
orderId
)
...
...
@@ -221,49 +230,17 @@
uni
.
stopPullDownRefresh
()
// 结束下拉刷新
self
.
loadedOrder
=
true
self
.
triggered
=
false
;
self
.
_freshing
=
false
;
/*↓↓↓↓↓↓↓↓↓↓测试数据↓↓↓↓↓↓↓↓↓↓*/
// if (res.data.list) {
// if (res.data.list.length == 0 && res.data.total > 0) {
// res.data.total = 15
// res.data.list = [{
// orderServiceType: '安装', // 服务类型:安装、维修
// categoryName: '充电桩', // 品类:充电桩
// orderBusinessTypeText: '分配单', // 业务类型:分配单、订单池
// orderNumber: 'OR2021041809827', // 工单编号
// contactName: '郭小清', // 客户信息
// contactPhone: '13631612077', // 联系方式
// contactAddress: '湾街道荔枝花园D座125号', // 详细地址
// contactAddressLatitud: '116.3896', // 联系人地址经度
// contactAddressLongitud: '39.91917', // 联系人地址纬度
// orderStatus: 0, // 工单状态
// appointmentDatetime: '', // 预约时间
// currentWillOverTime: 10000, // 剩余时间
// currentOverTime: new Date().getTime() + 10000, // 超过时间点
// auditDatetime: '2021.04.19 12:45:09', // 审核时间
// submissionTime: '2021.04.19 16:24:48', // 提交时间
// auditResults: {}, // 审核结果
// orderBusinessType: 'R', // 业务类型 R 为抢单
// orderId: '1100000216'
// }]
// res.data.list = [...res.data.list, ...res.data.list, ...res.data.list, ...res.data
// .list,
// ...res.data.list, ...res.data.list, ...res.data.list, ...res.data.list, ...
// res
// .data.list, ...res.data.list
// ]
// }
// }
/*↑↑↑↑↑↑↑↑↑↑测试数据↑↑↑↑↑↑↑↑↑↑↑↑↑*/
if
(
res
.
code
==
200
)
{
if
(
res
.
data
&&
res
.
data
.
list
&&
res
.
data
.
list
.
length
>
0
)
{
if
(
self
.
search
.
pageNumber
==
1
)
{
self
.
orderList
=
[]
}
self
.
orderList
.
push
(...
res
.
data
.
list
);
self
.
currentLoadStatus
=
res
.
data
.
total
>
self
.
orderList
.
length
&&
res
.
data
.
list
.
length
==
self
.
search
.
pageSize
?
'loadmore'
:
'nomore'
self
.
_freshing
=
false
;
if
(
res
.
code
==
200
&&
res
.
data
)
{
if
(
self
.
search
.
pageNumber
==
1
)
{
self
.
orderList
=
[]
}
if
(
res
.
data
.
list
)
{
self
.
orderList
.
push
(...
res
.
data
.
list
);
}
console
.
log
(
'this.orderlist;'
,
this
.
orderList
)
self
.
currentLoadStatus
=
res
.
data
.
total
>
self
.
orderList
.
length
&&
(
res
.
data
.
list
||
[]).
length
==
self
.
search
.
pageSize
?
'loadmore'
:
'nomore'
}
}
else
{
console
.
log
(
res
.
message
,
"初始化订单列表异常"
);
}
...
...
src/pages/index/learn.vue
View file @
8982de7c
...
...
@@ -667,7 +667,6 @@
url
:
"/pages/learn/answer?examId="
+
examInfo
.
id
,
});
}
else
if
(
examInfo
.
examStatus
==
1
)
{
// debugger;return;
// examInfo.status = '通过';
if
(
examInfo
.
status
==
'通过'
)
{
wx
.
navigateTo
({
...
...
src/pages/index/mine.vue
View file @
8982de7c
...
...
@@ -6,12 +6,12 @@
</u-navbar>
<view
class=
"mine-content"
>
<view
class=
"header-view"
>
<view
:class=
"['head-image',
{'has-image':
info.headImage
}]">
<view
:class=
"['head-image',
{'has-image':
avatar
}]">
<u-avatar
:src=
"headImageUrl"
:size=
"headSize"
mode=
"circle"
></u-avatar>
</view>
<view
class=
"header-content"
>
<view
class=
"name-view"
@
click=
"handleClickName"
>
{{
name
}}
</view>
<view
:class=
"['tel-view',
{'active':
info.tel
}]" @click="handleClickTel">
<view
class=
"name-view"
@
click=
"handleClickName"
>
{{
name
||
"点击登录"
}}
</view>
<view
:class=
"['tel-view',
{'active':
mobile
}]" @click="handleClickTel">
<text>
{{
telTip
}}
</text>
<u-icon
class=
"tel-arrow-icon"
name=
"arrow-up-fill"
></u-icon>
</view>
...
...
@@ -22,7 +22,7 @@
<u-cell-group
:border=
"false"
>
<view
v-for=
"(item, index) in items"
:key=
"index"
>
<u-cell-item
:value=
"item.value"
:border-bottom=
"false"
@
click=
"handleClick(index)"
>
<image
slot=
"icon"
:src=
"
imageUrl
+ item.icon"
:style=
"item.imageStyle"
></image>
<image
slot=
"icon"
:src=
"
qnPath
+ item.icon"
:style=
"item.imageStyle"
></image>
<view
slot=
"title"
class=
"item-title"
>
{{
item
.
title
}}
</view>
<view
slot=
"value"
class=
"item-value"
>
{{
value
}}
</view>
</u-cell-item>
...
...
@@ -30,13 +30,7 @@
</view>
</u-cell-group>
</view>
<!--
<view
class=
"u-m-t-20"
@
click=
"take"
>
<u-cell-group>
<u-cell-item
icon=
"setting"
title=
"相机组件测试"
></u-cell-item>
</u-cell-group>
</view>
-->
</view>
<!--
<take-photo
v-if=
"takeStatus"
:currentItem=
"testData"
@
close=
"closeTake"
></take-photo>
-->
</view>
</
template
>
...
...
@@ -48,26 +42,21 @@
},
data
()
{
return
{
qnPath
:
process
.
uniEnv
.
qn_base_url
,
serviceTel
:
'0755-81773817'
,
info
:
{},
// pic: 'https://uviewui.com/common/logo.png',
// show: true,
// takeStatus: false,
// testData: {
// _id: '1', // 规格ID
// system_id: '2', // 系统ID
// brand_id: '3', // 品牌ID
// classify_id: '4', // 分类ID
// images: [ // 拍照要求示意图
// 'https://qn-static.banshouhui.com/live_mark.png',
// 'https://qn-static.banshouhui.com/live_mark.png',
// 'https://qn-static.banshouhui.com/live_mark.png'
// ],
// main_point: [] // 要点
// }
}
},
computed
:
{
avatar
()
{
return
this
.
vuex_settled
&&
this
.
vuex_settled
.
avatar
||
''
},
name
()
{
return
this
.
vuex_settled
&&
this
.
vuex_settled
.
id_card_name
||
this
.
vuex_settled
.
nickname
||
this
.
vuex_settled
.
name
||
''
},
mobile
()
{
return
this
.
vuex_settled
&&
this
.
vuex_settled
.
mobile
||
''
},
items
()
{
return
[{
title
:
'我的钱包'
,
...
...
@@ -113,29 +102,23 @@
}
]
},
name
()
{
return
this
.
info
.
name
||
'点击登录'
},
telTip
()
{
return
this
.
info
.
tel
?
'已绑定手机号'
:
'绑定手机号'
},
imageUrl
()
{
return
process
.
uniEnv
.
qn_base_url
return
this
.
mobile
&&
'已绑定手机'
||
'绑定手机号'
},
pages
()
{
return
[
'wallet'
,
'deposit'
,
'contract'
,
'cert'
,
'address'
,
''
,
'customer'
]
return
[
'wallet'
,
'deposit'
,
'contract'
,
'cert'
,
'address'
,
'
warehouse
'
,
'customer'
]
},
headImageUrl
()
{
return
this
.
info
.
headImage
||
this
.
placeholderImage
return
this
.
avatar
||
this
.
placeholderImage
},
wodebeijingImage
()
{
return
this
.
imageUrl
+
'wodebeijing.png'
return
this
.
qnPath
+
'wodebeijing.png'
},
placeholderImage
()
{
return
this
.
imageUrl
+
'touxiang.png'
return
this
.
qnPath
+
'touxiang.png'
},
headSize
()
{
return
this
.
info
.
headImage
?
136
:
144
return
this
.
avatar
?
136
:
144
}
},
onLoad
()
{
...
...
@@ -143,25 +126,22 @@
},
methods
:
{
handleClick
(
index
)
{
console
.
log
(
'clicked:'
,
index
)
uni
.
navigateTo
({
url
:
'pages/mine/'
+
this
.
pages
[
index
]
+
'/index'
})
},
handleClickName
()
{
console
.
log
(
'click name'
)
if
(
this
.
vuex_token
&&
this
.
vuex_settled
)
{
return
false
}
this
.
$u
.
route
({
url
:
"pages/login/index"
})
},
handleClickTel
()
{
console
.
log
(
'click tel'
)
if
(
this
.
vuex_token
&&
this
.
vuex_settled
&&
this
.
mobile
)
{
return
false
}
this
.
$u
.
route
({
url
:
"pages/login/index"
})
},
// take() {
// uni.hideTabBar()
// this.takeStatus = true
// },
// closeTake(img) {
// console.log(img)
// this.takeStatus = false
// }
}
}
</
script
>
...
...
src/pages/index/order.vue
View file @
8982de7c
...
...
@@ -328,14 +328,14 @@
console
.
log
(
'click cell'
)
this
.
viewOderItem
(
item
.
orderId
)
},
filish
(
item
){
filish
(
item
){
// 去完工
uni
.
navigateTo
({
url
:
'pages/order/complete?orderId='
+
item
.
orderId
+
"&categoryId="
+
item
.
categoryId
+
"&orderServiceType="
+
item
.
orderServiceType
+
"&inGuaranteePeriod="
+
item
.
inGuaranteePeriod
+
"&auditResultsId="
+
Object
.
keys
(
item
.
auditResults
)[
0
]
+
"&inGuaranteePeriod="
+
item
.
inGuaranteePeriod
+
"&auditResultsId="
+
(
item
.
auditResults
?
Object
.
keys
(
item
.
auditResults
)[
Object
.
keys
(
item
.
auditResults
).
length
-
1
]:
''
)
})
},
handleAction
(
item
)
{
...
...
src/pages/login/index.vue
View file @
8982de7c
<
template
>
<view
class=
""
>
<view
class=
"backView"
>
<view
class=
"noticeView"
>
<image
class=
"noticeImage"
:src=
"icon_auth_notice_new"
mode=
""
></image>
<view
class=
"login-block"
v-if=
"needAuth"
>
<u-image
class=
"u-flex u-row-center logo"
:src=
"logo"
width=
"200"
height=
"200"
>
<u-loading
slot=
"loading"
></u-loading>
<view
slot=
"error"
style=
"font-size: 24rpx;"
>
加载失败
</view>
</u-image>
<u-image
class=
"u-flex u-row-center logo2"
:src=
"logo2"
width=
"214"
height=
"60"
>
<u-loading
slot=
"loading"
></u-loading>
<view
slot=
"error"
style=
"font-size: 24rpx;"
>
加载失败
</view>
</u-image>
</view>
<view
class=
"noticeTitleView"
>
<text
class=
"noticeTitle"
v-if=
"needAuth"
>
{{
authNoticeTitle
}}
</text>
<text
class=
"noticeTitle"
v-else
>
{{
suginNoticeTitle
}}
</text>
<view
class=
"bind-block"
v-else
>
<u-image
class=
"u-flex u-row-between logo"
:src=
"logo"
width=
"148"
height=
"148"
>
<u-loading
slot=
"loading"
></u-loading>
<view
slot=
"error"
style=
"font-size: 24rpx;"
>
加载失败
</view>
</u-image>
<view
class=
"bind-phone"
>
{{
bindPhone
}}
</view>
<view
class=
"bind-tips"
>
{{
bindTips
}}
</view>
</view>
<u-gap
height=
"570"
></u-gap>
<button
class=
"loginBtn"
v-if=
"needAuth"
lang=
"zh_CN"
@
tap=
"getUserProfile"
>
<text
class=
"u-font-32 white"
>
立即登录
</text>
<text
class=
"u-font-32 white"
>
{{
loginTitle
}}
</text>
</button>
<button
class=
"loginBtn"
v-else
open-type=
"getPhoneNumber"
throttle-time=
"1000"
@
getphonenumber=
"signupLogin"
>
<text
class=
"u-font-32 white"
>
授权登录
</text>
<text
class=
"u-font-32 white"
>
{{
bindTitle
}}
</text>
</button>
<view
class=
"cancelView"
>
<text
class=
"cancelText"
@
click=
"cancelClick()"
>
取消
</text>
</view>
</view>
</view>
</
template
>
...
...
@@ -29,24 +38,27 @@ const app = getApp()
export
default
{
data
()
{
return
{
isNewUser
:
false
,
qnPath
:
process
.
uniEnv
.
qn_base_url
,
needAuth
:
true
,
unionID
:
''
,
openID
:
''
,
icon_notice
:
''
,
TimeID
:
-
1
,
icon_auth_notice_new
:
''
,
authNoticeTitle
:
'申请获得您的公开信息(昵称,头像等)以便于为您提供更好的服务'
,
suginNoticeTitle
:
'申请获得您的公开信息(昵称,头像等)以便于为您提供更好的服务'
,
loginTitle
:
'用户登录'
,
bindTitle
:
'立即绑定'
,
bindPhone
:
'绑定手机'
,
bindTips
:
'首次登录的用户需绑定手机才可接单'
,
}
},
onLoad
()
{
computed
:
{
logo
()
{
return
this
.
qnPath
+
'logo.png'
},
logo2
()
{
return
this
.
qnPath
+
'logo-2.png'
},
},
onLoad
(
e
)
{
app
.
trackPage
(
'授权登录页'
)
this
.
icon_notice
=
app
.
globalData
.
icon_auth_notice
this
.
icon_auth_notice_new
=
app
.
globalData
.
icon_auth_notice_new
},
onShow
()
{
app
.
globalData
.
jumpLoginStatus
=
true
// 微信授权过用户信息,则无需重复授权
if
(
app
.
globalData
.
authUserInfo
)
{
this
.
needAuth
=
false
...
...
@@ -154,7 +166,6 @@ export default {
goBackPage
()
{
let
pages
=
getCurrentPages
();
debugger
if
(
pages
.
length
)
{
let
index
=
pages
.
length
-
1
;
if
(
index
)
{
...
...
@@ -212,7 +223,7 @@ export default {
}
</
script
>
<
style
>
<
style
lang=
"scss"
scoped
>
.backView
{
background-color
:
#FFFFFF
;
position
:
absolute
;
...
...
@@ -220,8 +231,32 @@ export default {
left
:
0
;
width
:
100%
;
height
:
100%
;
display
:
flex
;
flex-direction
:
column
;
.login-block
{
margin-top
:
240rpx
;
}
.bind-block
{
margin-top
:
202rpx
;
margin-left
:
50rpx
;
.bind-phone
{
font-size
:
52rpx
;
margin-top
:
48rpx
;
font-weight
:
bold
;
color
:
#333333
;
line-height
:
52rpx
;
margin-left
:
10rpx
;
}
.bind-tips
{
margin
:
24rpx
60rpx
14rpx
10rpx
;
font-size
:
28rpx
;
font-weight
:
400
;
color
:
#999999
;
line-height
:
40rpx
;
}
}
}
.logo2
{
margin-top
:
28rpx
;
}
.noticeView
{
...
...
@@ -258,10 +293,13 @@ export default {
.loginBtn
{
background-color
:
#2272FF
;
width
:
390
rpx
;
height
:
80
rpx
;
border-radius
:
40
rpx
;
margin-top
:
334
rpx
;
font-size
:
32rpx
;
font-weight
:
600
;
color
:
#FFFFFF
;
line-height
:
104px
;
width
:
600rpx
;
height
:
104rpx
;
border-radius
:
52rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
...
...
@@ -283,4 +321,5 @@ export default {
.white
{
color
:
#FFFFFF
;
}
</
style
>
src/pages/mine/cert/index.vue
View file @
8982de7c
...
...
@@ -11,7 +11,7 @@
></u-navbar>
<view
class=
"content-cody"
>
<u-cell-group
:border=
"false"
>
<u-cell-item
v-for=
"
item in list"
:title=
"item.name"
:value=
"item.isUploadName"
:arrow=
"true
"
<u-cell-item
v-for=
"
(item, index) in list"
:title=
"item.name"
:value=
"item.isUploadName"
:arrow=
"true"
:key=
"index
"
:value-style=
"
{'color': item.color}" @click="toDetail(item.keyName)" :title-style="{'padding-left':'20rpx'}">
<u-icon
slot=
"icon"
size=
"32"
name=
"checkmark-circle"
:color=
"item.iconColor"
></u-icon>
</u-cell-item>
...
...
@@ -112,7 +112,7 @@
},
toDetail
(
key
)
{
let
data
=
this
.
list
[
key
].
data
;
if
(
data
.
status
!=
1
){
if
(
!
data
.
isUpload
){
return
;
}
wx
.
navigateTo
({
...
...
src/pages/mine/customer/index.vue
View file @
8982de7c
...
...
@@ -2,7 +2,7 @@
<view
class=
"cus-wrap"
>
<w-navbar
title=
"联系客服"
></w-navbar>
<view
class=
"content"
>
<u-image
class=
"qrcode"
:src=
"cusQrcode"
width=
"400"
mode=
"widthFix"
@
longtap=
"download
"
>
<u-image
class=
"qrcode"
:src=
"cusQrcode"
width=
"400"
height=
"400"
mode=
"widthFix"
@
longtap=
"download"
:fade=
"true"
duration=
"450
"
>
<u-loading
slot=
"loading"
></u-loading>
<view
slot=
"error"
style=
"font-size: 24rpx;"
>
加载失败
</view>
</u-image>
...
...
src/pages/mine/wallet/index.vue
View file @
8982de7c
<
template
>
<view
class=
"wallet-view"
>
<u-navbar
back-icon-color=
"#333333"
background=
"#F4F5F7"
title=
"我的钱包"
titleColor=
"#333333"
:border-bottom=
"false"
></u-navbar>
<image
class=
"header-image"
mode=
"widthFix"
:src=
"qianbaobeijing"
></image>
<view
class=
"survey-view"
>
<view
class=
"survey-top-view"
>
<view
class=
"survey-top-left"
>
<view>
账户总资产(元)
</view>
<view>
{{
info
.
totalPayAmount
}}
</view>
</view>
<view
class=
"survey-top-right"
>
<u-button>
提现
</u-button>
</view>
</view>
<view
class=
"survey-bottom-view"
>
<view
v-for=
"(value, key) in items"
:key=
"key"
>
<view>
{{
value
}}
</view>
<view>
{{
info
[
key
]
}}
</view>
</view>
</view>
</view>
<view
class=
"content-view"
>
<view
v-for=
"(item, index) in lists"
:class=
"['content-list',
{ first: index == 0 }]"
:key="index"
>
<view
class=
"content-list-left"
>
<image
class=
"content-list-image"
:src=
"item.icon"
></image>
<view
class=
"content-list-text"
>
<view
class=
"content-list-text-title"
>
{{
item
.
title
}}
</view>
<view>
{{
item
.
content
}}
</view>
</view>
</view>
<view
class=
"content-list-right"
>
<text
class=
"content-list-right-text"
>
点击查看
</text>
<u-icon
name=
"arrow-right"
></u-icon>
</view>
</view>
</view>
<view
class=
"list-view"
>
</view>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
info
:
{
canApplyAmount
:
0
,
// 可提现金额
saveApplyCount
:
0
,
// 已申请提现的支付单数
canApplyCount
:
0
,
// 可申请提现的支付单数
saveAndApplyAmount
:
0
,
// 已申请提现金额
totalPayAmount
:
0
,
// 总共收入
/* 还没对字段名 */
dairuzhang
:
0
,
// 预计待入账
},
};
},
computed
:
{
lists
()
{
return
[
{
title
:
"结算账单"
,
content
:
"展示您已提现的账单信息"
,
icon
:
this
.
imageUrl
+
"jiesuan.png"
,
},
{
title
:
"收入流水"
,
content
:
"当前展示最近5条,点击查看全部"
,
icon
:
this
.
imageUrl
+
"liushui.png"
,
},
];
},
items
()
{
return
{
canApplyAmount
:
"可提现(元)"
,
dairuzhang
:
"预计待入账(元)"
,
};
},
imageUrl
()
{
return
process
.
uniEnv
.
qn_base_url
;
},
qianbaobeijing
()
{
return
this
.
imageUrl
+
"qianbaobeijing.png"
;
},
},
methods
:
{},
};
</
script
>
<
style
lang=
"scss"
scoped
>
.wallet-view
{
position
:
relative
;
height
:
100vh
;
overflow
:
auto
;
background-color
:
#f4f5f7
;
.header-image
{
position
:
absolute
;
width
:
100%
;
margin-left
:
4rpx
;
margin-top
:
10rpx
;
}
.survey-view
{
position
:
relative
;
height
:
400rpx
;
margin
:
30rpx
30rpx
10rpx
30rpx
;
color
:
#ffffff
;
padding
:
30rpx
;
.survey-top-view
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
flex-end
;
.survey-top-left
{
}
.survey-top-right
{
}
}
.survey-bottom-view
{
display
:
flex
;
justify-content
:
space-between
;
}
}
.content-view
{
position
:
relative
;
padding
:
0
30rpx
;
.content-list
{
height
:
140rpx
;
border-radius
:
12rpx
;
display
:
flex
;
justify-content
:
space-between
;
padding
:
30rpx
;
background-color
:
#ffffff
;
&
.first
{
margin-bottom
:
20rpx
;
}
.content-list-left
{
display
:
flex
;
.content-list-image
{
width
:
56rpx
;
height
:
56rpx
;
margin-top
:
2rpx
;
}
.content-list-text
{
font-size
:
24rpx
;
color
:
#666666
;
margin-left
:
20rpx
;
.content-list-text-title
{
font-size
:
32rpx
;
color
:
#333333
;
}
}
}
.content-list-right
{
color
:
#2272ff
;
font-size
:
26rpx
;
.content-list-right-text
{
margin-right
:
4rpx
;
}
}
}
}
.list-view
{
position
:
relative
;
}
}
<
template
>
<view
class=
"wallet-view"
>
<u-navbar
back-icon-color=
"#333333"
background=
"#F4F5F7"
title=
"我的钱包"
titleColor=
"#333333"
:border-bottom=
"false"
></u-navbar>
<view
class=
"wallet-content-view"
>
<image
class=
"header-image"
mode=
"widthFix"
:src=
"qianbaobeijing"
></image>
<view
class=
"survey-view"
>
<view
class=
"survey-top-view"
>
<view
class=
"survey-top-left"
>
<view>
账户总资产(元)
</view>
<view
class=
"survey-top-account"
>
{{
info
.
totalPayAmount
}}
</view>
</view>
<view
class=
"survey-top-right"
>
<u-button
type=
"primary"
shape=
"circle"
:custom-style=
"buttonStyle"
@
click=
"handleClickWithdraw"
>
提现
</u-button>
</view>
</view>
<view
class=
"survey-bottom-view"
>
<view
v-for=
"(value, key) in items"
:key=
"key"
>
<view>
{{
value
}}
</view>
<view
class=
"survey-bottom-account"
>
{{
info
[
key
]
}}
</view>
</view>
</view>
</view>
<view
class=
"content-view"
>
<view
v-for=
"(item, index) in lists"
:class=
"['content-list',
{'first': index==0}]" :key="index"
@click="handleClick(index)">
<view
class=
"content-list-left"
>
<image
class=
"content-list-image"
:src=
"item.icon"
></image>
<view
class=
"content-list-text"
>
<view
class=
"content-list-text-title"
>
{{
item
.
title
}}
</view>
<view>
{{
item
.
content
}}
</view>
</view>
</view>
<view
class=
"content-list-right"
>
<text
class=
"content-list-right-text"
>
点击查看
</text>
<u-icon
name=
"arrow-right"
></u-icon>
</view>
</view>
</view>
<view
class=
"line-view"
></view>
<view
class=
"list-view"
>
<view
v-for=
"(item, index) in statementList"
:key=
"index"
>
<Statement
:data=
"item"
@
click=
"handleClickCell"
></Statement>
</view>
</view>
</view>
</view>
</
template
>
<
script
>
import
Statement
from
"@/components/mine/statement.vue"
export
default
{
components
:
{
Statement
},
data
()
{
return
{
info
:
{
canApplyAmount
:
0
,
// 可提现金额
saveApplyCount
:
0
,
// 已申请提现的支付单数
canApplyCount
:
0
,
// 可申请提现的支付单数
totalPayAmount
:
0
,
// 总共收入
saveAndApplyAmount
:
0
,
// 预计待入账
},
statementList
:
[]
}
},
computed
:
{
lists
()
{
return
[{
title
:
'结算账单'
,
content
:
'展示您已提现的账单信息'
,
icon
:
this
.
imageUrl
+
'jiesuan.png'
},
{
title
:
'收入流水'
,
content
:
'当前展示最近5条,点击查看全部'
,
icon
:
this
.
imageUrl
+
'liushui.png'
}]
},
items
()
{
return
{
canApplyAmount
:
'可提现(元)'
,
saveAndApplyAmount
:
'预计待入账(元)'
}
},
imageUrl
()
{
return
process
.
uniEnv
.
qn_base_url
},
qianbaobeijing
()
{
return
this
.
imageUrl
+
'qianbaobeijing.png'
},
buttonStyle
()
{
return
{
width
:
"200rpx"
,
height
:
"80rpx"
,
"font-size"
:
"32rpx"
,
"font-weight"
:
"bold"
,
'background-color'
:
'#FFFFFF'
,
'color'
:
'#2272FF'
,
'margin-bottom'
:
'20rpx'
};
},
pages
()
{
return
[
'settlement'
,
'statement'
]
}
},
created
()
{
// var item = {
// paymentTime: new Date().getTime(),
// payableRecordStatusText: '预结',
// orderNumber: 'EE999777',
// orderServiceType: '安装',
// inGuaranteePeriod: false, // true 保内;false 保外
// payableAmount: 9899,
// orderId: 12313,
// }
// this.statementList = [item, item, item, item, item]
},
onLoad
()
{
if
(
!
this
.
vuex_token
)
{
this
.
$u
.
route
({
url
:
'pages/login/index'
})
}
this
.
loadAssets
()
this
.
loadStatement
()
},
methods
:
{
// 提现
handleClickWithdraw
()
{
uni
.
navigateTo
({
url
:
'pages/mine/wallet/'
+
'withdraw'
})
},
handleClick
(
index
)
{
uni
.
navigateTo
({
url
:
'pages/mine/wallet/'
+
this
.
pages
[
index
]
})
},
handleClickCell
(
orderId
)
{
uni
.
navigateTo
({
url
:
'pages/order/detail?id='
+
orderId
})
},
async
loadAssets
()
{
let
self
=
this
let
res
=
await
self
.
$u
.
api
.
getAssets
()
if
(
res
&&
res
.
code
==
200
)
{
self
.
info
=
res
.
data
||
self
.
info
}
},
async
loadStatement
()
{
let
self
=
this
let
res
=
await
self
.
$u
.
api
.
listStatement
()
if
(
res
&&
res
.
code
==
200
)
{
self
.
statementList
=
res
.
data
&&
res
.
data
.
orderList
||
[]
}
},
async
loadPayRecord
()
{
let
self
=
this
let
res
=
await
self
.
$u
.
api
.
payableRecord
()
// if(res && res.code == 200) {
// self.info = res.data || self.info
// }
},
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.wallet-view
{
display
:
flex
;
flex-direction
:
column
;
height
:
100vh
;
.wallet-content-view
{
position
:
relative
;
overflow
:
auto
;
background-color
:
#F4F5F7
;
.header-image
{
position
:
absolute
;
width
:
100%
;
margin-left
:
4rpx
;
margin-top
:
10rpx
;
}
.survey-view
{
position
:
relative
;
height
:
400rpx
;
margin
:
30rpx
30rpx
10rpx
30rpx
;
color
:
#FFFFFF
;
padding
:
30rpx
;
.survey-top-view
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
flex-end
;
margin-top
:
10rpx
;
.survey-top-left
{
font-size
:
28rpx
;
.survey-top-account
{
font-size
:
72rpx
;
font-weight
:
bold
;
margin-top
:
6rpx
;
}
}
.survey-top-right
{}
}
.survey-bottom-view
{
display
:
flex
;
justify-content
:
space-between
;
font-size
:
24rpx
;
margin-top
:
50rpx
;
.survey-bottom-account
{
margin-top
:
6rpx
;
font-size
:
40rpx
;
font-weight
:
bold
;
}
}
}
.content-view
{
position
:
relative
;
padding
:
0
30rpx
;
.content-list
{
height
:
140rpx
;
border-radius
:
12rpx
12rpx
0
0
;
display
:
flex
;
justify-content
:
space-between
;
padding
:
30rpx
;
background-color
:
#FFFFFF
;
&
.first
{
margin-bottom
:
20rpx
;
border-radius
:
12rpx
;
}
.content-list-left
{
display
:
flex
;
.content-list-image
{
width
:
56rpx
;
height
:
56rpx
;
margin-top
:
2rpx
;
}
.content-list-text
{
font-size
:
24rpx
;
color
:
#666666
;
margin-left
:
20rpx
;
.content-list-text-title
{
font-size
:
32rpx
;
color
:
#333333
;
}
}
}
.content-list-right
{
color
:
#2272FF
;
font-size
:
26rpx
;
.content-list-right-text
{
margin-right
:
4rpx
;
}
}
}
}
.line-view
{
background-color
:
#F4F5F7
;
height
:
2rpx
;
margin
:
0
30rpx
;
}
.list-view
{
position
:
relative
;
background-color
:
#FFFFFF
;
margin
:
0rpx
30rpx
30rpx
30rpx
;
padding-bottom
:
30rpx
;
border-radius
:
0
0
12rpx
12rpx
;
}
}
}
</
style
>
src/pages/mine/wallet/settlement.vue
View file @
8982de7c
...
...
@@ -23,7 +23,7 @@
<image
:src=
"liushuibeijingImage"
class=
"head-back-image"
mode=
"widthFix"
></image>
<view
class=
"list-view"
>
<view
v-for=
"(item, index) in info.payableRecordExtendDtos"
:key=
"index"
>
<Settlement
:data=
"item"
></Settlement>
<Settlement
:data=
"item"
@
click=
"handleClickCell"
></Settlement>
</view>
</view>
</view>
...
...
@@ -66,8 +66,13 @@
},
methods
:
{
bindDateChange
:
function
(
e
)
{
this
.
date
=
e
.
target
.
value
this
.
date
=
e
.
target
.
value
},
handleClickCell
(
orderId
)
{
uni
.
navigateTo
({
url
:
'pages/order/detail?id='
+
orderId
})
}
}
}
</
script
>
...
...
src/pages/mine/wallet/statement.vue
View file @
8982de7c
...
...
@@ -23,7 +23,7 @@
<image
:src=
"liushuibeijingImage"
class=
"head-back-image"
mode=
"widthFix"
></image>
<view
class=
"list-view"
>
<view
v-for=
"(item, index) in data.statementList"
:key=
"index"
>
<Statement
:data=
"item"
></Statement>
<Statement
:data=
"item"
@
click=
"handleClickCell"
></Statement>
</view>
</view>
</view>
...
...
@@ -82,8 +82,13 @@
},
methods
:
{
bindDateChange
:
function
(
e
)
{
this
.
date
=
e
.
target
.
value
this
.
date
=
e
.
target
.
value
},
handleClickCell
(
orderId
)
{
uni
.
navigateTo
({
url
:
'pages/order/detail?id='
+
orderId
})
}
}
}
</
script
>
...
...
src/pages/mine/wallet/withdraw.vue
View file @
8982de7c
...
...
@@ -36,7 +36,8 @@
},
methods
:
{
handleClick
()
{
let
self
=
this
self
.
$u
.
api
.
workerApplyPay
()
}
}
}
...
...
src/pages/mine/warehouse/index.vue
0 → 100644
View file @
8982de7c
<
template
>
<view
class=
"ware-wrap"
>
<w-navbar
title=
"我的仓库"
:background=
"
{backgroundColor: '#F4F5F7'}">
</w-navbar>
<view
class=
"content"
>
<view
class=
"panel"
>
<view
class=
"title"
>
物料明细
</view>
<view
class=
"item-table"
>
<view
class=
"item-header"
>
<view>
物料名称
</view>
<view>
库存数量
</view>
</view>
<u-divider
half-width=
"315"
border-color=
"#F4F5F7"
height=
"2"
></u-divider>
<view
class=
"item-row"
v-for=
"(item, index) in details"
:key=
"index"
>
<view
class=
"width-504 break"
>
{{
item
.
skuName
}}
</view>
<view
class=
"width-106 center"
>
{{
item
.
systemStock
}}
</view>
</view>
</view>
</view>
<view
class=
"panel"
>
<view
class=
"title"
>
操作记录
</view>
<view
class=
"item-table"
>
<view
class=
"item-header"
>
<view
class=
"width-132"
>
订单编号
</view>
<view
class=
"width-210"
>
物料名称
</view>
<view
class=
"width-80"
>
出库量
</view>
<view
class=
"width-140 right"
>
操作时间
</view>
</view>
<u-divider
half-width=
"315"
border-color=
"#F4F5F7"
height=
"2"
></u-divider>
<view
class=
"item-row"
v-for=
"(item, index) in record"
:key=
"index"
>
<view
class=
"width-132 break"
>
{{
item
.
businessNumber
}}
</view>
<view
class=
"width-210 break"
>
{{
item
.
skuName
}}
</view>
<view
class=
"width-80 center"
>
{{
item
.
outAmount
}}
</view>
<view
class=
"width-140 break"
>
{{
item
.
createTime
|
datefmt
(
'YYYY.MM.DD HH:mm:ss'
)
}}
</view>
</view>
<u-loadmore
:status=
"status"
@
loadmore=
"loadRecord"
/>
</view>
</view>
</view>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
status
:
'loadmore'
,
details
:
[],
record
:
[],
total
:
100
,
search
:
{
pageNumber
:
0
,
pageSize
:
20
,
},
};
},
onReachBottom
()
{
if
(
this
.
status
==
'nomore'
)
return
;
this
.
status
=
'loading'
;
this
.
search
.
pageNumber
=
++
this
.
search
.
pageNumber
;
this
.
loadAccess
()
},
computed
:
{},
onLoad
()
{
this
.
getData
();
},
methods
:
{
getData
()
{
let
self
=
this
self
.
initDetails
()
self
.
search
.
pageNumber
=
++
self
.
search
.
pageNumber
;
self
.
loadAccess
()
},
async
initDetails
()
{
let
self
=
this
let
res
=
await
self
.
$u
.
api
.
listBystock
()
if
(
res
&&
res
.
code
==
200
)
{
self
.
details
=
res
.
data
.
list
}
// 测试数据
self
.
details
=
[
{
skuName
:
'广汽新能源立柱-特来电'
,
systemStock
:
1
},
{
skuName
:
'广汽新能源-星星'
,
systemStock
:
14
}
]
},
loadRecord
()
{
if
(
this
.
status
==
'nomore'
)
return
;
this
.
status
=
'loading'
;
this
.
search
.
pageNumber
=
++
this
.
search
.
pageNumber
;
this
.
loadAccess
()
},
async
loadAccess
()
{
let
self
=
this
/*
/wxh-worker-rest/rest/{token}/myinfo/access/history
路径参数:
token=xxxx
Headers:
Content-Type: application/json
Query:
pageNumber=0
pageSize=10
*/
let
res
=
await
self
.
$u
.
api
.
listAccessHistory
(
self
.
search
)
if
(
res
&&
res
.
code
==
200
)
{
self
.
total
=
res
.
data
&&
res
.
data
.
total
||
self
.
total
let
list
=
res
.
data
&&
res
.
data
.
list
&&
self
.
$u
.
deepClone
(
res
.
data
.
list
)
||
[];
// 测试数据
list
=
[
{
businessNumber
:
'OR20210507332669'
,
skuName
:
'广汽新能源立柱红红火火恍恍惚惚'
,
outAmount
:
1
,
createTime
:
Date
.
now
()},
{
businessNumber
:
'OR20210507332775'
,
skuName
:
'广汽新能源星星点灯'
,
outAmount
:
1
,
createTime
:
Date
.
now
()},
{
businessNumber
:
'OR20210507332020'
,
skuName
:
'广汽新能源星星点灯'
,
outAmount
:
6
,
createTime
:
Date
.
now
()},
{
businessNumber
:
'OR20210507332333'
,
skuName
:
'广汽新能源立柱啦啦啦啦啦啦啦'
,
outAmount
:
1
,
createTime
:
Date
.
now
()},
{
businessNumber
:
'OR20210507334689'
,
skuName
:
'广汽新能源立柱'
,
outAmount
:
12
,
createTime
:
Date
.
now
()},
{
businessNumber
:
'OR20210507339991'
,
skuName
:
'广汽新能源立柱啦啦啦啦啦啦啦'
,
outAmount
:
12
,
createTime
:
Date
.
now
()},
{
businessNumber
:
'OR20210507332660'
,
skuName
:
'广汽新能源立柱'
,
outAmount
:
12
,
createTime
:
Date
.
now
()},
{
businessNumber
:
'OR20210507332669'
,
skuName
:
'广汽新能源立柱红红火火恍恍惚惚'
,
outAmount
:
1
,
createTime
:
Date
.
now
()},
{
businessNumber
:
'OR20210507332775'
,
skuName
:
'广汽新能源星星点灯'
,
outAmount
:
1
,
createTime
:
Date
.
now
()},
{
businessNumber
:
'OR20210507332333'
,
skuName
:
'广汽新能源立柱啦啦啦啦啦啦啦'
,
outAmount
:
1
,
createTime
:
Date
.
now
()},
]
if
(
list
&&
list
.
length
)
{
self
.
record
.
push
(...
list
)
if
(
self
.
total
>
self
.
record
.
length
)
{
self
.
status
=
"loadmore"
}
else
{
self
.
status
=
"nomore"
}
}
else
{
self
.
status
=
"nomore"
}
}
else
{
}
},
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.ware-wrap
{
background-color
:
#F4F5F7
;
.content
{
padding
:
34rpx
30rpx
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
.panel
{
.title
{
margin-bottom
:
30rpx
;
font-size
:
32rpx
;
font-weight
:
bold
;
color
:
#333333
;
line-height
:
44rpx
;
}
.item-table
{
margin-bottom
:
46rpx
;
padding
:
34rpx
30rpx
;
width
:
690rpx
;
background
:
#FFFFFF
;
border-radius
:
12rpx
;
.item-header
{
margin-bottom
:
24rpx
;
font-size
:
26rpx
;
font-weight
:
bold
;
color
:
#333333
;
line-height
:
38rpx
;
display
:
flex
;
justify-content
:
space-between
;
}
.item-row
{
margin
:
24rpx
0
;
font-size
:
26rpx
;
font-weight
:
400
;
color
:
#333333
;
line-height
:
38rpx
;
display
:
flex
;
justify-content
:
space-between
;
}
}
}
}
}
.width-504
{
width
:
504rpx
;
}
.width-106
{
width
:
106rpx
;
}
.width-132
{
width
:
132rpx
;
}
.width-210
{
width
:
210rpx
;
}
.width-80
{
width
:
80rpx
;
}
.width-140
{
width
:
140rpx
;
}
.center
{
text-align
:
center
;
}
.right
{
text-align
:
right
;
}
.break
{
word-break
:break-all
;
}
</
style
>
src/pages/order/complete.vue
View file @
8982de7c
...
...
@@ -10,78 +10,85 @@
:class=
"[current == index ? 'u-tab-item-active' : '']"
@
tap
.
stop=
"swichMenu(index)"
>
<text
class=
"u-line-1"
>
{{
item
.
name
}}
</text>
</view>
</scroll-view>
<view
class=
"right-boxs"
>
<scroll-view
:scroll-top=
"scrollRightTop"
scroll-y
scroll-with-animation
class=
"right-box"
@
scroll=
"rightScroll"
>
</scroll-view>
<view
class=
"form-list"
>
<u-form
:model=
"form"
ref=
"uForm"
>
<template
v-for=
"(groupItem, groupIndex) in (list.length>0?list[tabIndex].items:[])"
>
<view
class=
"class-item"
:key=
"groupIndex"
v-show=
"current == groupIndex"
>
<view
class=
"title"
v-if=
"groupItem.name !== '基本信息'"
>
{{
groupItem
.
name
}}
</view>
<view
class=
"class-bd"
>
<u-form-item
v-for=
"(item,itemIndex) in groupItem.items"
:key=
"itemIndex"
label-position=
"top"
:prop=
"item.fieldsName"
:border-bottom=
"false"
v-show=
"item.fieldsId != 200 || show200"
>
<view
:class=
"[
{'label-bold': groupItem.name === '基本信息'}, 'label']" v-if="typeToComponentType(item.fieldsType)!=='location'">
<image
class=
"item-image"
:src=
"mixingImage"
v-if=
"item.required"
></image>
{{
item
.
fieldsTitle
}}
</view>
<template
v-if=
"item.fieldsType"
>
<xh-input
v-if=
"typeToComponentType(item.fieldsType)==='input'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-input>
<xh-multi-input
v-else-if=
"typeToComponentType(item.fieldsType)==='multiinput'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-multi-input>
<xh-radio
v-else-if=
"typeToComponentType(item.fieldsType)==='radio'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-radio>
<xh-checkbox
v-else-if=
"typeToComponentType(item.fieldsType)==='checkbox'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-checkbox>
<xh-select
v-else-if=
"typeToComponentType(item.fieldsType)==='select'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-select>
<xh-files
v-else-if=
"typeToComponentType(item.fieldsType)==='file'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || []'
@
value-change=
"fieldValueChange"
>
</xh-files>
<xh-location
v-else-if=
"typeToComponentType(item.fieldsType)==='location'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-location>
<xh-scan
v-else-if=
"typeToComponentType(item.fieldsType)==='scan'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-scan>
<xh-picker
v-else-if=
"typeToComponentType(item.fieldsType)==='picker'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-picker>
<xh-service-measure
v-else-if=
"typeToComponentType(item.fieldsType)==='servicemeasure'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:orderId=
"orderId"
:categoryId=
"categoryId"
:orderServiceType=
"orderServiceType"
:specificationId=
"form['specificationId'] || 0"
:value=
"form[item.fieldsName]"
@
value-change=
"fieldValueChange"
>
</xh-service-measure>
<xh-time
v-else-if=
"typeToComponentType(item.fieldsType)==='time'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-time>
</
template
>
</u-form-item>
</view>
</view>
</template>
</u-form>
</view>
</scroll-view>
<view
class=
"right-boxs"
>
<scroll-view
:scroll-top=
"scrollRightTop"
scroll-y
scroll-with-animation
class=
"right-box"
@
scroll=
"rightScroll"
>
</scroll-view>
<view
class=
"form-list"
>
<u-form
:model=
"form"
ref=
"uForm"
>
<template
v-for=
"(groupItem, groupIndex) in (list.length>0?list[tabIndex].items:[])"
>
<view
class=
"class-item"
:key=
"groupIndex"
v-show=
"current == groupIndex"
>
<view
class=
"title"
v-if=
"groupItem.name !== '基本信息'"
>
{{
groupItem
.
name
}}
</view>
<view
class=
"class-bd"
>
<u-form-item
v-for=
"(item,itemIndex) in groupItem.items"
:key=
"itemIndex"
label-position=
"top"
:prop=
"item.fieldsName"
:border-bottom=
"false"
v-show=
"item.fieldsId != 200 || show200"
>
<view
:class=
"[
{'label-bold': groupItem.name === '基本信息'}, 'label']" v-if="typeToComponentType(item.fieldsType)!=='location'
&&
typeToComponentType(item.fieldsType)!=='form'
&&
typeToComponentType(item.fieldsType)!=='label'">
<image
class=
"item-image"
:src=
"mixingImage"
v-if=
"item.required"
></image>
{{
item
.
fieldsTitle
}}
</view>
<template
v-if=
"item.fieldsType"
>
<xh-input
v-if=
"typeToComponentType(item.fieldsType)==='input'"
:groupIndex=
"groupIndex"
:type=
"inputType(item.fieldsType)"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-input>
<xh-multi-input
v-else-if=
"typeToComponentType(item.fieldsType)==='multiinput'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-multi-input>
<xh-radio
v-else-if=
"typeToComponentType(item.fieldsType)==='radio'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-radio>
<xh-checkbox
v-else-if=
"typeToComponentType(item.fieldsType)==='checkbox'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-checkbox>
<xh-select
v-else-if=
"typeToComponentType(item.fieldsType)==='select'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-select>
<xh-files
v-else-if=
"typeToComponentType(item.fieldsType)==='file'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:partnerCompanyId=
"partnerCompanyId"
:categoryId=
"categoryId"
:value=
'form[item.fieldsName] || []'
@
value-change=
"fieldValueChange"
>
</xh-files>
<xh-location
v-else-if=
"typeToComponentType(item.fieldsType)==='location'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-location>
<xh-scan
v-else-if=
"typeToComponentType(item.fieldsType)==='scan'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-scan>
<xh-picker
v-else-if=
"typeToComponentType(item.fieldsType)==='picker'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-picker>
<xh-service-measure
v-else-if=
"typeToComponentType(item.fieldsType)==='servicemeasure'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:orderId=
"orderId"
:categoryId=
"categoryId"
:orderServiceType=
"orderServiceType"
:specificationId=
"form['specificationId'] || 0"
:value=
"form[item.fieldsName]"
@
value-change=
"fieldValueChange"
>
</xh-service-measure>
<xh-time
v-else-if=
"typeToComponentType(item.fieldsType)==='time'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-time>
<xh-service-more
v-else-if=
"typeToComponentType(item.fieldsType)==='form'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:order-id=
"orderId"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-service-more>
<xh-label
v-else-if=
"typeToComponentType(item.fieldsType)==='label'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
>
</xh-label>
</
template
>
</u-form-item>
</view>
</view>
</template>
</u-form>
</view>
</view>
</view>
<view
:class=
"['btn-wrap', 'flex-xc', {'btn-bottom': tabIndex > 0}]"
>
<u-button
class=
"btn-submit"
@
click=
"saveComplete"
...
...
@@ -97,7 +104,7 @@
下一步
</u-button>
</view>
</view>
</view>
<u-toast
ref=
"uToast"
/>
</view>
</template>
...
...
@@ -114,6 +121,8 @@
import
XhPicker
from
'@/components/createCom/XhPicker.vue'
import
XhTime
from
'@/components/createCom/XhTime.vue'
import
XhServiceMeasure
from
'@/components/createCom/XhServiceMeasure.vue'
import
XhServiceMore
from
"../../components/createCom/XhServiceMore"
;
import
XhLabel
from
"../../components/createCom/XhLabel"
;
// import XhRadio from '@/components/createCom/XhRadio.vue'
export
default
{
data
()
{
...
...
@@ -121,7 +130,8 @@
orderId
:
0
,
categoryId
:
0
,
orderServiceType
:
''
,
inGuaranteePeriod
:
''
,
inGuaranteePeriod
:
''
,
partnerCompanyId
:
''
,
auditResultsId
:
''
,
list
:
[],
tabIndex
:
0
,
...
...
@@ -169,7 +179,7 @@
completeCheckResult
:
[],
waitHandlerPanelIndex
:
0
,
waitHandlerGroupIndex
:
0
,
waitHandlerEleIndex
:
0
,
waitHandlerEleIndex
:
0
,
pass
:
false
,
}
},
...
...
@@ -184,18 +194,20 @@
XhScan
,
XhPicker
,
XhTime
,
XhServiceMeasure
XhServiceMeasure
,
XhServiceMore
,
XhLabel
},
created
()
{
// console.log(allComponents,'allComponents')
},
onLoad
(
option
)
{
console
.
log
(
option
)
if
(
option
)
{
this
.
orderId
=
option
.
orderId
this
.
categoryId
=
option
.
categoryId
this
.
orderServiceType
=
decodeURIComponent
(
option
.
orderServiceType
)
this
.
inGuaranteePeriod
=
option
.
inGuaranteePeriod
this
.
inGuaranteePeriod
=
option
.
inGuaranteePeriod
this
.
partnerCompanyId
=
option
.
partnerCompanyId
this
.
auditResultsId
=
option
.
auditResultsId
}
else
{
this
.
orderId
=
11880091
...
...
@@ -241,7 +253,7 @@
}
},
show200
()
{
return
this
.
form
.
paymentMethodsType
!=
'03'
return
this
.
form
.
paymentMethodsType
&&
this
.
form
.
paymentMethodsType
!=
'03'
}
},
methods
:
{
...
...
@@ -251,51 +263,60 @@
self
.
$u
.
api
.
getCompleteConfigAndData
(
self
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
self
.
list
=
res
.
data
.
config
self
.
form
=
res
.
data
.
value
||
{}
// 异常单处理
self
.
form
=
res
.
data
.
value
||
{}
uni
.
showLoading
({
title
:
'加载中'
})
setTimeout
(()
=>
{
uni
.
hideLoading
()
},
1000
)
// 异常单处理
if
(
self
.
auditResultsId
)
self
.
checkCompleteError
()
}
else
{
console
.
log
(
res
.
message
,
"获取订单完工项目失败!"
);
}
});
}
},
checkCompleteError
()
{
// 异常单定位错误项
let
self
=
this
self
.
list
.
forEach
((
panel
,
panelIndex
)
=>
{
panel
.
items
.
forEach
((
group
,
groupIndex
)
=>
{
group
.
items
.
forEach
((
ele
,
eleIndex
)
=>
{
if
(
ele
.
fieldsName
===
self
.
auditResultsId
)
{
self
.
waitHandlerPanelIndex
=
panelIndex
self
.
waitHandlerGroupIndex
=
groupIndex
self
.
waitHandlerEleIndex
=
eleIndex
}
})
})
})
this
.
locationCompleteItem
(
self
.
waitHandlerPanelIndex
,
self
.
waitHandlerGroupIndex
,
self
.
waitHandlerEleIndex
)
},
saveComplete
(){
// 保存完工信息
checkCompleteError
()
{
// 异常单定位错误项
let
self
=
this
let
param
=
{}
self
.
list
.
forEach
((
panel
)
=>
{
self
.
list
.
forEach
((
panel
,
panelIndex
)
=>
{
panel
.
items
.
forEach
((
group
,
groupIndex
)
=>
{
group
.
items
.
forEach
((
ele
,
eleIndex
)
=>
{
if
(
ele
.
fieldsName
===
self
.
auditResultsId
)
{
self
.
waitHandlerPanelIndex
=
panelIndex
self
.
waitHandlerGroupIndex
=
groupIndex
self
.
waitHandlerEleIndex
=
eleIndex
}
})
})
})
this
.
locationCompleteItem
(
self
.
waitHandlerPanelIndex
,
self
.
waitHandlerGroupIndex
,
self
.
waitHandlerEleIndex
)
},
handleSaveData
(){
let
param
=
{}
this
.
list
.
forEach
((
panel
)
=>
{
param
[
panel
.
panelFieldsName
]
=
[]
panel
.
items
.
forEach
((
group
)
=>
{
group
.
items
.
forEach
((
ele
)
=>
{
if
(
self
.
form
[
ele
.
fieldsName
]){
if
(
this
.
form
[
ele
.
fieldsName
]){
param
[
panel
.
panelFieldsName
].
push
({
"fieldsName"
:
ele
.
fieldsName
,
"fieldsType"
:
ele
.
fieldsType
,
"fieldsValue"
:
self
.
form
[
ele
.
fieldsName
],
"fieldsValue"
:
this
.
form
[
ele
.
fieldsName
],
"required"
:
ele
.
required
,
})
}
})
})
})
self
.
$u
.
api
.
saveCompleteData
(
param
,
self
.
orderId
).
then
((
res
)
=>
{
})
return
param
},
saveComplete
(){
// 保存完工信息
let
self
=
this
let
param
=
self
.
handleSaveData
()
self
.
$u
.
api
.
saveCompleteData
(
param
,
self
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
this
.
$refs
.
uToast
.
show
({
title
:
'保存成功'
,
...
...
@@ -303,7 +324,7 @@
})
}
else
{
this
.
$refs
.
uToast
.
show
({
title
:
res
.
data
,
title
:
res
.
message
,
type
:
'error'
,
})
}
...
...
@@ -325,7 +346,7 @@
panelResult
.
submitted
++
}
else
if
(
value
&&
Array
.
isArray
(
value
)
&&
value
.
length
>
0
){
panelResult
.
submitted
++
}
else
if
(
first
){
// 记录第一个 为空 并且需要必填的项 用于定位
}
else
if
(
first
){
// 记录第一个 为空 并且需要必填的项 用于定位
first
=
false
self
.
waitHandlerPanelIndex
=
panelIndex
self
.
waitHandlerGroupIndex
=
groupIndex
...
...
@@ -365,23 +386,33 @@
},
orderFinish
(){
let
self
=
this
let
pass
=
this
.
checkCompleteItem
()
let
pass
=
this
.
checkCompleteItem
()
if
(
!
pass
){
self
.
completeCheckStatus
=
true
}
else
{
console
.
log
(
"完工"
);
this
.
pass
=
pass
if
(
self
.
inGuaranteePeriod
===
'Y'
){
self
.
$u
.
api
.
inOrderFinish
(
self
.
orderId
).
then
((
res
)
=>
{
console
.
log
(
res
)
self
.
completeCheckStatus
=
true
})
}
else
{
self
.
$u
.
api
.
outOrderFinish
({
customerPayType
:
'CASH'
},
self
.
orderId
).
then
((
res
)
=>
{
console
.
log
(
res
)
self
.
completeCheckStatus
=
true
})
}
}
else
{
// 先保存完工项
let
param
=
self
.
handleSaveData
()
self
.
$u
.
api
.
saveCompleteData
(
param
,
self
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
//完工项信息保存成功再次完工工单
console
.
log
(
"完工"
);
this
.
pass
=
pass
if
(
self
.
inGuaranteePeriod
===
'Y'
){
self
.
$u
.
api
.
inOrderFinish
(
self
.
orderId
).
then
((
res
)
=>
{
console
.
log
(
res
)
self
.
completeCheckStatus
=
true
})
}
else
{
self
.
$u
.
api
.
outOrderFinish
({
customerPayType
:
'CASH'
},
self
.
orderId
).
then
((
res
)
=>
{
console
.
log
(
res
)
self
.
completeCheckStatus
=
true
})
}
}
else
{
this
.
$refs
.
uToast
.
show
({
title
:
res
.
message
,
type
:
'error'
,
})
}
})
}
},
tabsChange
(
index
){
...
...
@@ -394,6 +425,30 @@
this
.
getMenuItemTop
()
})
},
calMaterialCraftListAmount
(
arr
){
let
amount
=
0
if
(
arr
){
arr
.
forEach
(
item
=>
{
if
(
Number
(
item
.
useLength
)
&&
Number
(
item
.
freeLength
)
&&
Number
(
item
.
unitAmt
))
{
amount
+=
Math
.
max
(
Number
(
item
.
useLength
)
-
Number
(
item
.
freeLength
),
0
)
*
Number
(
item
.
unitAmt
)
}
if
(
Number
(
item
.
extraAmt
)){
amount
+=
Number
(
item
.
extraAmt
)
}
})
}
return
amount
},
setData
(
data
){
// 通过页面设置数据
Object
.
keys
(
data
).
forEach
(
key
=>
{
this
.
$set
(
this
.
form
,
key
,
data
[
key
])
})
// 更新预计超出金额
let
amount
=
this
.
calMaterialCraftListAmount
(
this
.
form
.
materialList
)
amount
+=
this
.
calMaterialCraftListAmount
(
this
.
form
.
craftList
)
this
.
$set
(
this
.
form
,
'overAmount'
,
amount
)
},
// 字段的值更新
fieldValueChange
(
data
)
{
const
groupItem
=
this
.
list
[
this
.
tabIndex
].
items
[
data
.
groupIndex
]
...
...
@@ -401,7 +456,7 @@
if
(
groupItem
.
items
)
{
innerItem
=
groupItem
.
items
[
data
.
itemIndex
]
}
if
(
innerItem
.
fieldsType
===
'multiInput'
){
// 多个输入框的值触发
let
key
=
Object
.
keys
(
data
.
value
)[
0
]
...
...
@@ -410,28 +465,52 @@
this
.
$set
(
this
.
form
,
innerItem
.
fieldsName
,
data
.
value
)
}
if
(
innerItem
.
fieldsId
==
199
)
{
// 选不需要收款的时候,收款金额修改为非必选
for
(
var
item
of
this
.
list
[
0
].
items
)
{
for
(
var
i
of
item
.
items
)
{
if
(
i
.
fieldsId
==
200
)
{
i
.
required
=
data
.
value
!=
'03'
for
(
var
list
of
this
.
list
)
{
// 同时修改基本信息和完工信息
for
(
var
item
of
list
.
items
)
{
for
(
var
i
of
item
.
items
)
{
if
(
i
.
fieldsId
==
200
)
{
i
.
required
=
data
.
value
!=
'03'
}
}
}
}
}
console
.
log
(
this
.
form
)
},
nextStep
()
{
if
(
this
.
tabIndex
<
this
.
list
.
length
-
1
)
{
this
.
tabIndex
++
this
.
arr
=
[]
this
.
scrollRightTop
=
0
this
.
arr
=
[]
this
.
scrollRightTop
=
0
this
.
leftMenuStatus
(
0
)
this
.
$nextTick
(
function
()
{
this
.
getMenuItemTop
()
})
}
},
inputType
(
type
)
{
var
inputType
=
''
let
ty
=
type
.
toLocaleLowerCase
()
switch
(
ty
)
{
case
'text'
:
inputType
=
'textarea'
break
case
'password'
:
inputType
=
ty
break
case
'decimal'
:
case
'number'
:
case
'double'
:
case
'integer'
:
inputType
=
'digit'
break
case
'textarea'
:
default
:
inputType
=
'text'
break
}
return
inputType
},
typeToComponentType
(
type
)
{
// 将fieldType类型统一转换为公共组件判定类型
let
formType
=
''
...
...
@@ -443,7 +522,7 @@
case
'number'
:
case
'decimal'
:
case
'double'
:
case
'integer'
:
case
'integer'
:
formType
=
'input'
break
case
'multiinput'
:
...
...
@@ -466,7 +545,7 @@
case
'location'
:
formType
=
'location'
break
case
'scan'
:
case
'scan'
:
case
'machine_code'
:
formType
=
'scan'
break
...
...
@@ -481,6 +560,12 @@
case
'date'
:
formType
=
'time'
break
case
'form'
:
formType
=
'form'
break
case
'label'
:
formType
=
'label'
break
}
return
formType
},
...
...
@@ -494,7 +579,7 @@
this
.
scrollRightTop
=
this
.
oldScrollTop
;
this
.
$nextTick
(
function
()
{
this
.
scrollRightTop
=
this
.
arr
[
index
];
this
.
current
=
index
;
this
.
current
=
index
;
this
.
leftMenuStatus
(
index
);
})
},
...
...
@@ -619,12 +704,12 @@
.label
{
color
:
#333
;
font-size
:
28rpx
;
line-height
:
40rpx
;
line-height
:
40rpx
;
padding-bottom
:
20rpx
;
}
.label-bold
{
font-size
:
32rpx
;
font-weight
:
bold
;
.label-bold
{
font-size
:
32rpx
;
font-weight
:
bold
;
}
.required
{
padding-right
:
10rpx
;
...
...
@@ -671,7 +756,7 @@
display
:
flex
;
overflow
:
hidden
;
border-radius
:
12rpx
12rpx
0
0
;
}
.u-search-inner
{
...
...
@@ -691,7 +776,7 @@
.u-tab-view
{
width
:
200rpx
;
height
:
100%
;
border
:
4rpx
solid
#F4F5F7
;
border
:
4rpx
solid
#F4F5F7
;
overflow
:
auto
;
}
...
...
@@ -729,8 +814,8 @@
.right-box
,
.right-boxs
{
// background-color: rgb(250, 250, 250);
background-color
:
#FFFFFF
;
overflow
:
auto
;
background-color
:
#FFFFFF
;
overflow
:
auto
;
width
:
100%
;
}
...
...
src/pages/order/detail.vue
View file @
8982de7c
...
...
@@ -30,7 +30,7 @@
<text>
{{
order
.
contactPhone
}}
</text>
</view>
<view
class=
"between-cell address-cell"
>
<view
class=
"left"
>
<view
class=
"left
-address
"
>
<u-icon
name=
"map"
size=
"28"
></u-icon>
<text
class=
"address-txt"
>
{{
formatAddress
}}
</text>
</view>
...
...
@@ -40,7 +40,7 @@
<view
v-if=
"readMore"
@
click=
"readMore = false"
class=
"read-more-toggle"
>
<u-icon
name=
"arrow-down"
></u-icon>
<text
class=
"read-more-text"
>
查看更多
</text>
</view>
</view>
<view
v-else
class=
"order-item-more"
>
<view
class=
"line-view"
></view>
<view
class=
"order-cell between-cell"
>
...
...
@@ -55,7 +55,7 @@
<text
class=
"cell-title"
>
充电桩信息:
</text>
<text>
{{
order
.
serviceContent
}}
</text>
</view>
<!--
<view
class=
"order-cell between-cell"
>
<!--
<view
class=
"order-cell between-cell"
>
<text>
备注:
</text>
...
...
@@ -85,11 +85,12 @@
</view>
<view
class=
"line-view-right"
>
<view>
<text>
{{
record
.
operationType
}}
</text>
<text>
{{
record
.
operationType
Text
}}
</text>
<text
style=
"color: red;"
>
{{
record
.
overTime
?
'(超时)'
:
''
}}{{
record
.
exception
?
'(异常)'
:
''
}}
</text>
<text
style=
"color: #2272FF;"
v-show=
"record.operationType==='报备'"
>
(跟进)
</text>
</view>
<view
v-show=
"record.operationType==='报备' || record.operationType==='改约'"
>
<text>
{{
record
.
operationType
===
'报备'
?
'下次联系时间:'
:
'改约时间:
'
}}
</text>
<view
v-show=
"record.operationType==='报备' || record.operationType==='
预约'|| record.operationType==='
改约'"
>
<text>
{{
record
.
operationType
===
'报备'
?
'下次联系时间:'
:
record
.
operationType
===
'改约'
?
'改约时间:'
:
'
'
}}
</text>
<text
style=
"color: #2272FF;"
>
{{
record
.
operationType
===
'报备'
&&
record
.
orderRecordRemark
&&
record
.
orderRecordRemark
.
length
>
1
?
record
.
orderRecordRemark
.
substring
(
record
.
orderRecordRemark
.
indexOf
(
':'
)
+
1
,
record
.
orderRecordRemark
.
length
)
...
...
@@ -102,7 +103,7 @@
<view
v-if=
"readMoreRecord"
@
click=
"readMoreRecord = false"
class=
"read-more-toggle"
>
<u-icon
name=
"arrow-down"
></u-icon>
<text
class=
"read-more-text"
>
查看更多
</text>
</view>
</view>
<view
v-else
class=
"read-more-toggle"
>
<u-icon
name=
"arrow-up"
></u-icon>
<text
class=
"read-more-text"
@
click=
"readMoreRecord = true"
>
点击收起
</text>
...
...
@@ -125,18 +126,18 @@
<view>
<u-toast
ref=
"uToast"
/>
</view>
<view
v-if=
"showCenterBtn"
@
click=
"
handleBtn
"
class=
"button"
:class=
"['center-button-view', btnClass]"
>
<view
v-if=
"showCenterBtn"
@
click=
"
$u.throttle(handleBtn, 500)
"
class=
"button"
:class=
"['center-button-view', btnClass]"
>
<text>
{{
centerButtonText
}}
</text>
<view
v-if=
"order.currentOverTime && showTimeOut"
class=
"time-view"
>
<text
style=
"padding-right: 8rpx;"
>
{{
order
.
currentOverTime
>
new
Date
().
getTime
()?
'剩'
:
'超'
}}
</text>
<u-count-down
:timestamp=
"timestampDiff(order.currentOverTime)"
font-size=
"20"
<u-count-down
:timestamp=
"timestampDiff(order.currentOverTime)"
font-size=
"20"
color=
"#FFFFFF"
bg-color=
"transparent"
separator-color=
"#FFFFFF"
separator-size=
"20"
:ref=
"'uCountDown'"
:ref=
"'uCountDown'"
show-days
height=
"20"
:show-days=
"threeDays()"
...
...
@@ -150,9 +151,9 @@
</view>
<!-- 异常预约 ,现场拍照 这里是调用拍照的两个组件-->
<view
class=
"right"
>
<view
v-if=
"errorSignIn || scenePhoto"
@
click=
"$u.
debounc
e(handleClickRight, 500)"
:class=
"['button',
{'active': scenePhoto}]">
<view
v-if=
"errorSignIn || scenePhoto"
@
click=
"$u.
throttl
e(handleClickRight, 500)"
:class=
"['button',
{'active': scenePhoto}]">
<text>
{{
errorSignIn
?
'异常'
:
'拍照'
}}
</text>
</view>
</view>
</view>
...
...
@@ -232,7 +233,8 @@
contactAddressLongitud
:
0
,
contactAddressLatitud
:
0
,
num
:
0
,
showTimeOut
:
true
showTimeOut
:
true
,
clicking
:
false
,
}
},
onLoad
(
option
)
{
...
...
@@ -240,14 +242,14 @@
console
.
log
(
"option"
,
option
)
if
(
option
&&
option
.
id
)
{
this
.
orderId
=
option
.
id
}
}
this
.
loadOrderDetail
()
this
.
loadOrderRecord
()
this
.
getLocation
()
this
.
getSignDistance
()
},
computed
:
{
phoneIcon
()
{
//self-support/icon/dianhua-0@2x.png
if
(
this
.
isAllowDianhuaAndDaohang
){
...
...
@@ -291,48 +293,48 @@
methods
:
{
openLocation
(
address
){
if
(
this
.
isAllowDianhuaAndDaohang
){
uni
.
getLocation
({
type
:
'gcj02'
,
//返回可以用于uni.openLocation的经纬度
success
:
function
(
res
)
{
const
latitude
=
res
.
latitude
;
const
longitude
=
res
.
longitude
;
// uni.getLocation({
// type: 'gcj02', //返回可以用于uni.openLocation的经纬度
// success: function (res) {
debugger
const
latitude
=
this
.
contactAddressLatitud
//res.latitude;
const
longitude
=
this
.
contactAddressLongitud
//res.longitude;
uni
.
openLocation
({
latitude
:
latitude
,
longitude
:
longitude
,
latitude
:
Number
(
this
.
contactAddressLatitud
)
,
longitude
:
Number
(
this
.
contactAddressLongitud
)
,
success
:
function
()
{
console
.
log
(
'success'
);
}
});
},
complete
:
function
(
res
)
{
console
.
log
(
'-------complete-----'
,
res
)
if
(
res
.
errMsg
.
indexOf
(
'auth'
)
!=
-
1
)
{
uni
.
showModal
(
{
title
:
'提示'
,
content
:
'获取权限失败,请到设置页面开启权限
'
,
confirmText
:
'好的
'
,
success
(
res
)
{
if
(
res
.
confirm
)
{
uni
.
openSetting
(
{
success
(
res
)
{
console
.
log
(
res
.
authSetting
)
}
});
}
}
})
}
else
{
uni
.
setClipboardData
(
{
data
:
address
,
success
:
function
()
{
console
.
log
(
'success'
);
}
});
}
}
});
// }
// ,
// complete: function(res) {
// console.log('-------complete-----', res)
// if (res.errMsg.indexOf('auth') != -1)
{
// uni.showModal({
// title: '提示
',
// content: '获取权限失败,请到设置页面开启权限
',
// confirmText: '好的',
// success(res
) {
// if (res.confirm)
{
// uni.openSetting(
{
// success(res) {
// console.log(res.authSetting)
// }
// });
// }
// }
// })
// } else if (res.errMsg)
{
// // uni.setClipboardData({
// // data: address,
// // success: function () {
// // console.log('success');
// // }
// // });
//
}
// }
}
},
phoneToCustomer
(
phone
){
// 联系客户
...
...
@@ -345,7 +347,7 @@
this
.
contactTime
()
}
},
contactTime
()
{
contactTime
()
{
let
self
=
this
var
data
=
{}
if
(
this
.
submitType
===
"workerAppointment"
){
...
...
@@ -414,7 +416,7 @@
self
.
$u
.
api
.
getSignDistance
(
data
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
self
.
signDistance
=
res
.
data
}
}
});
},
loadOrderRecord
()
{
...
...
@@ -424,6 +426,16 @@
};
self
.
$u
.
api
.
listOrderRecord
(
param
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
res
.
data
.
forEach
(
item
=>
{
if
(
item
.
operationType
===
'预约'
){
item
.
operationTypeText
=
'上门时间'
}
else
if
(
item
.
operationType
===
'报备'
){
let
arr
=
item
.
orderRecordRemark
.
split
(
','
)
item
.
operationTypeText
=
arr
[
0
]
}
else
{
item
.
operationTypeText
=
item
.
operationType
+
'时间'
}
})
self
.
orderRecords
=
res
.
data
}
else
{
console
.
log
(
res
.
message
,
"获取订单详情失败!"
);
...
...
@@ -549,9 +561,12 @@
this
.
scenePhoto
=
true
this
.
readMore
=
true
this
.
isAllowDianhuaAndDaohang
=
true
}
else
{}
}
else
{
this
.
isAllowDianhuaAndDaohang
=
true
}
},
handleBtn
()
{
console
.
log
(
'click button'
)
if
(
!
this
.
submitType
){
return
;
}
...
...
@@ -597,9 +612,14 @@
}
return
}
if
(
this
.
clicking
)
{
return
}
this
.
clicking
=
true
this
.
$u
.
api
[
this
.
submitType
](
data
,
this
.
order
.
orderId
).
then
(
res
=>
{
let
self
=
this
if
((
res
.
data
.
code
!==
undefined
&&
res
.
data
.
code
===
200
)
if
((
res
.
data
.
code
!==
undefined
&&
res
.
data
.
code
===
200
)
||
(
res
.
code
!==
undefined
&&
res
.
code
===
200
)
)
{
this
.
$refs
.
uToast
.
show
({
title
:
this
.
centerButtonText
+
'操作成功'
,
...
...
@@ -610,6 +630,7 @@
// id: this.order.orderId
// }
callback
:
function
(){
this
.
clicking
=
false
uni
.
redirectTo
({
url
:
'pages/order/detail?id='
+
self
.
order
.
orderId
});
...
...
@@ -620,7 +641,10 @@
title
:
res
.
data
.
message
!==
undefined
?
res
.
data
.
message
:
res
.
message
,
// 如果不传此type参数,默认为default,也可以手动写上 type: 'default'
type
:
'warning'
,
callback
:
res
.
data
.
message
===
'抱歉,手快的师傅已经抢到此单!'
?
this
.
isGan
():
''
callback
:
function
()
{
this
.
clicking
=
false
res
.
data
.
message
===
'抱歉,手快的师傅已经抢到此单!'
?
this
.
isGan
():
''
}
})
}
})
...
...
@@ -647,10 +671,11 @@
filish
(){
// 去完工
uni
.
navigateTo
({
url
:
'pages/order/complete?orderId='
+
this
.
order
.
orderId
+
"&categoryId="
+
this
.
order
.
categoryId
url
:
'pages/order/complete?orderId='
+
this
.
order
.
orderId
+
"&categoryId="
+
this
.
order
.
categoryId
+
"&orderServiceType="
+
this
.
order
.
orderServiceType
+
"&inGuaranteePeriod="
+
this
.
order
.
inGuaranteePeriod
+
"&partnerCompanyId="
+
this
.
order
.
partnerCompanyId
})
},
rejectOrder
()
{
// 拒单
...
...
@@ -682,23 +707,23 @@
self
.
dataValue
=
dataValue
},
fail
(
err
)
{
}
});
},
getDistance
(
Latitud
,
Longitud
){
return
this
.
distance
(
Latitud
,
Longitud
,
this
.
dataValue
[
1
],
this
.
dataValue
[
0
])
},
/**
/**
* echo distance(116.3896,39.91917,116.3940,39.91726);
* 计算两点之间直线距离
* @param float $lon1 经度
* @param float $lat1 维度
* @param float $lon2 经度
* @param float $lat2 维度
* @return float 浮点数
*/
distance
(
lat1
,
lng1
,
lat2
,
lng2
)
{
* 计算两点之间直线距离
* @param float $lon1 经度
* @param float $lat1 维度
* @param float $lon2 经度
* @param float $lat2 维度
* @return float 浮点数
*/
distance
(
lat1
,
lng1
,
lat2
,
lng2
)
{
console
.
log
(
lat1
,
lng1
,
lat2
,
lng2
)
var
radLat1
=
this
.
Rad
(
lat1
);
var
radLat2
=
this
.
Rad
(
lat2
);
...
...
@@ -708,7 +733,7 @@
Math
.
cos
(
radLat1
)
*
Math
.
cos
(
radLat2
)
*
Math
.
pow
(
Math
.
sin
(
b
/
2
),
2
)));
s
=
s
*
6378.137
;
// EARTH_RADIUS;
s
=
Math
.
round
(
s
*
10000
)
/
10
;
//输出为米
console
.
log
(
"计算结果"
,
s
,
'M'
);
console
.
log
(
"计算结果"
,
s
,
'M'
);
return
Number
(
s
?
s
.
toFixed
(
2
):
0
);
},
Rad
(
d
){
...
...
@@ -718,6 +743,7 @@
if
(
!
currentOverTime
){
return
0
}
console
.
log
(
'--------'
,
Math
.
round
(
Math
.
abs
(
this
.
order
.
currentOverTime
-
new
Date
().
getTime
())
/
1000
))
return
Math
.
round
(
Math
.
abs
(
this
.
order
.
currentOverTime
-
new
Date
().
getTime
())
/
1000
);
},
timeOutChange
(
currentOverTime
){
...
...
@@ -736,7 +762,7 @@
})
},
threeDays
()
{
return
this
.
timestampDiff
(
this
.
order
.
currentOverTime
)
>
3600
*
24
*
3
return
this
.
timestampDiff
(
this
.
order
.
currentOverTime
)
>
3600
*
24
*
3
}
}
};
...
...
@@ -814,7 +840,7 @@
color
:
#FFFFFF
;
line-height
:
40rpx
;
background-image
:
linear-gradient
(
to
right
,
#FF930D
,
#FFC174
);
&
.active
{
background-image
:
linear-gradient
(
to
right
,
#2272FF
,
#47ABFF
);
}
...
...
@@ -844,7 +870,6 @@
}
.address-cell
{
height
:
24rpx
;
font-size
:
24rpx
;
font-weight
:
400
;
color
:
#333333
;
...
...
@@ -854,14 +879,18 @@
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
.left
{
.left-address
{
display
:
flex
;
align-items
:
flex-start
;
.address-txt
{
line-height
:
30rpx
;
margin-left
:
8rpx
;
margin-right
:
30rpx
;
}
}
}
}
.read-more-toggle
{
text-align
:
center
;
color
:
#2272FF
;
...
...
@@ -869,11 +898,11 @@
margin-top
:
30rpx
;
padding-bottom
:
30rpx
;
}
.read-more-text
{
padding-left
:
8rpx
;
}
.order-item-more
{
font-size
:
26rpx
;
color
:
#333333
;
...
...
@@ -883,9 +912,9 @@
height
:
2rpx
;
margin-bottom
:
20rpx
;
}
}
.order-item
{
padding-bottom
:
6rpx
;
...
...
@@ -902,15 +931,15 @@
color
:
#333333
;
line-height
:
36rpx
;
}
}
.no-record-view
{
font-size
:
26rpx
;
color
:
#333333
;
margin-top
:
30rpx
;
}
.record-line-view
{
padding-left
:
30rpx
;
position
:
relative
;
...
...
@@ -923,7 +952,7 @@
.line-view-right
{
// text-align: right;
}
.
record-line-view
:
:
before
{
content
:
" "
;
position
:
absolute
;
...
...
@@ -946,19 +975,19 @@
z-index
:
1
;
}
.address-cell
{
height
:
24rpx
;
font-size
:
24rpx
;
font-weight
:
400
;
color
:
#333333
;
line-height
:
24rpx
;
//
.address-cell {
//
height: 24rpx;
//
font-size: 24rpx;
//
font-weight: 400;
//
color: #333333;
//
line-height: 24rpx;
.left
{
.address-txt
{
margin-left
:
8rpx
;
}
}
}
//
.left {
//
.address-txt {
//
margin-left: 8rpx;
//
}
//
}
//
}
}
.record-item
{
...
...
@@ -1013,7 +1042,7 @@
color
:
#FFFFFF
;
font-size
:
32rpx
;
font-weight
:
bold
;
.time-view
{
display
:
flex
;
font-size
:
20rpx
;
...
...
@@ -1069,7 +1098,7 @@
color
:
#333333
;
line-height
:
48rpx
;
margin-bottom
:
10rpx
;
}
.between-cell
{
...
...
src/pages/order/feedback.vue
View file @
8982de7c
...
...
@@ -173,18 +173,7 @@ export default {
let
params
=
{
categoryId
:
self
.
categoryId
};
let
res
=
await
self
.
$u
.
api
.
feedbackConfig
(
params
);
if
(
res
&&
res
.
code
==
200
)
{
if
(
!
self
.
showGY
)
{
delete
res
.
code
[
'改约'
]
}
var
data
=
{}
for
(
var
item
in
res
.
data
)
{
if
(
item
!=
'改约'
||
self
.
showGY
)
{
data
[
item
]
=
res
.
data
[
item
]
}
}
self
.
feedback
=
data
;
self
.
feedback
=
res
.
data
||
{};
self
.
buildConfig
();
}
uni
.
hideLoading
();
...
...
@@ -211,6 +200,22 @@ export default {
});
});
configs
.
map
((
item
,
key
)
=>
{
if
(
item
.
name
==
'报备'
)
{
configs
.
splice
(
key
,
1
);
configs
.
unshift
(
item
);
// 更新时间标题
let
title
=
self
.
appoint
[
key
]
self
.
appoint
.
splice
(
key
,
1
);
self
.
appoint
.
unshift
(
title
);
}
else
if
(
item
.
name
==
'改约'
&&
!
self
.
showGY
)
{
configs
.
splice
(
key
,
1
);
// 更新时间标题
self
.
appoint
.
splice
(
key
,
1
);
}
})
// 数组改写需要刷新绑定数据
self
.
options
=
configs
;
this
.
initParams
()
...
...
src/pages/order/material.vue
View file @
8982de7c
<
template
>
<view
class=
"mtr-content"
>
<
template
>
<view
class=
"mtr-content"
>
<view
class=
"content-view"
>
<!-- 材料列表 -->
<!-- 材料列表 -->
<view
class=
"mtr-tab"
>
<u-table
align=
"center"
border-color=
"#FFFFFF"
color=
"#333333"
font-size=
"rpx"
:th-style=
"thStyle"
padding=
"0"
>
<u-tr
class=
"u-tr"
>
<u-th
class=
"u-th content-tab-th"
v-for=
"(value, key) in titles"
:key=
"key"
width=
"auto"
>
<text
:class=
"['tab-th-txt',
{'left': key == firstKey}]">
{{
value
}}
</text>
</u-th>
</u-tr>
<view
class=
"line-view"
></view>
<u-tr
class=
"u-tr"
v-for=
"(item, index) in list"
:key=
"index"
>
<u-td
class=
"u-td"
v-for=
"(value, key) in titles"
:key=
"key"
>
<text
:class=
"['tab-th-txt',
{'left': key == firstKey}]">
{{
item
[
key
]
}}
</text>
</u-td>
</u-tr>
</u-table>
<u-table
align=
"center"
border-color=
"#FFFFFF"
color=
"#333333"
font-size=
"rpx"
:th-style=
"thStyle"
padding=
"0"
>
<u-tr
class=
"u-tr"
>
<u-th
class=
"u-th content-tab-th"
v-for=
"(value, key) in titles"
:key=
"key"
width=
"auto"
>
<text
:class=
"['tab-th-txt',
{'left': key == firstKey}]">
{{
value
}}
</text>
</u-th>
</u-tr>
<view
class=
"line-view"
></view>
<u-tr
class=
"u-tr"
v-for=
"(item, index) in list"
:key=
"index"
>
<u-td
class=
"u-td"
v-for=
"(value, key) in titles"
:key=
"key"
>
<text
:class=
"['tab-th-txt',
{'left': key == firstKey}]">
{{
item
[
key
]
}}
</text>
</u-td>
</u-tr>
</u-table>
</view>
<!-- 其他 -->
<view
class=
"mtr-other"
>
<view
class=
"line-view"
></view>
<view
class=
"other-space"
>
<text>
其他
</text>
<image
class=
"image-view"
:src=
"addImage"
@
click=
"handleAdd"
></image>
</view>
<view
v-if=
"other.length > 0"
class=
"other-content"
>
<view
class=
"other-space"
v-for=
"(item, index) in other"
:key=
"index"
>
<view
class=
"input-view"
>
<view
class=
"other-space"
>
<text
class=
"input-title"
>
说明:
</text>
<view
class=
"input-content"
>
<u-input
v-model=
"item.title"
:clearable=
"false"
placeholder-style=
"color:#999999;font-size:26rpx"
/>
</view>
</view>
<view
class=
"other-space"
>
<text
class=
"input-title"
>
金额:
</text>
<view
class=
"input-content"
>
<u-input
v-model=
"item.value"
type=
"number"
:clearable=
"false"
placeholder-style=
"color:#999999;font-size:26rpx"
/>
</view>
</view>
</view>
<image
class=
"image-view"
:src=
"subtractImage"
@
click=
"handleSubtract"
></image>
</view>
</view>
<view
class=
"other-space"
>
<text>
超出金额
</text>
<text>
{{
money
}}
元
</text>
</view>
</view>
<!-- 其他 -->
<view
class=
"mtr-other"
>
<view
class=
"line-view"
></view>
<view
class=
"other-space"
>
<text>
其他
</text>
<image
class=
"image-view"
:src=
"addImage"
@
click=
"handleAdd"
></image>
</view>
<view
v-if=
"other.length > 0"
class=
"other-content"
>
<view
class=
"other-space"
v-for=
"(item, index) in other"
:key=
"index"
>
<view
class=
"input-view"
>
<view
class=
"other-space"
>
<text
class=
"input-title"
>
说明:
</text>
<view
class=
"input-content"
>
<u-input
v-model=
"item.otherExplain"
:clearable=
"false"
placeholder-style=
"color:#999999;font-size:26rpx"
/>
</view>
</view>
<view
class=
"other-space"
>
<text
class=
"input-title"
>
金额:
</text>
<view
class=
"input-content"
>
<u-input
v-model=
"item.extraAmt"
type=
"number"
:clearable=
"false"
placeholder-style=
"color:#999999;font-size:26rpx"
/>
</view>
</view>
</view>
<image
class=
"image-view"
:src=
"subtractImage"
@
click=
"handleSubtract"
></image>
</view>
</view>
<view
class=
"other-space"
>
<text>
超出金额
</text>
<text>
{{
money
}}
元
</text>
</view>
</view>
</view>
<!-- 底部确定按钮 -->
<view
class=
"bottom-view"
>
<u-button
class=
"sure-button"
type=
"primary"
shape=
"circle"
@
click=
"handleSure"
:custom-style=
"buttonStyle"
>
确定
</u-button>
</view>
<!-- 底部确定按钮 -->
<view
class=
"bottom-view"
>
<u-button
class=
"sure-button"
type=
"primary"
shape=
"circle"
@
click=
"handleSure"
:custom-style=
"buttonStyle"
>
确定
</u-button>
</view>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
list
:
[],
// 材料列表
other
:
[],
// 其他列表
};
},
computed
:
{
buttonStyle
()
{
return
{
width
:
"600rpx"
,
height
:
"104rpx"
,
"font-size"
:
"32rpx"
,
"font-weight"
:
"bold"
,
};
},
titles
()
{
return
{
name
:
'材料名称'
,
unit
:
'单位'
,
freeAmount
:
'免费量'
,
price
:
'单价/元'
,
consumption
:
'预计用量'
}
},
thStyle
()
{
return
{
'font-weight'
:
'bold'
}
},
firstKey
()
{
return
Object
.
keys
(
this
.
titles
)[
0
]
},
subtractImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'qxiao.png'
},
addImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'tianjia.png'
},
money
()
{
// 总额
var
amount
=
0
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
orderId
:
''
,
fieldName
:
'materialList'
,
list
:
[],
// 材料列表
other
:
[],
// 其他列表
};
},
computed
:
{
buttonStyle
()
{
return
{
width
:
"600rpx"
,
height
:
"104rpx"
,
"font-size"
:
"32rpx"
,
"font-weight"
:
"bold"
,
};
},
titles
()
{
if
(
this
.
isMaterial
){
return
{
matName
:
'材料名称'
,
matUnit
:
'单位'
,
freeLength
:
'免费量'
,
unitAmt
:
'单价/元'
,
useLength
:
'用量'
}
}
else
{
return
{
matName
:
'工艺名称'
,
matUnit
:
'单位'
,
freeLength
:
'免费量'
,
unitAmt
:
'单价/元'
,
useLength
:
'用量'
}
}
},
thStyle
()
{
return
{
'font-weight'
:
'bold'
}
},
firstKey
()
{
return
Object
.
keys
(
this
.
titles
)[
0
]
},
subtractImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'qxiao.png'
},
addImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'tianjia.png'
},
money
()
{
// 总额
var
amount
=
0
for
(
var
item
of
this
.
list
)
{
if
(
Number
(
item
.
consumption
)
&&
Number
(
item
.
freeAmount
)
&&
Number
(
item
.
price
))
{
amount
+=
Math
.
max
(
Number
(
item
.
consumption
)
-
Number
(
item
.
freeAmount
),
0
)
*
Number
(
item
.
price
)
}
}
for
(
var
item
of
this
.
other
)
{
if
(
item
.
value
&&
Number
(
item
.
value
))
{
amount
+=
Number
(
item
.
value
)
}
}
return
amount
}
},
created
()
{
// 测试数据
console
.
log
(
'0000'
)
for
(
var
i
=
0
;
i
<
20
;
i
++
)
{
this
.
list
.
push
({
name
:
'开关发大法师放大范德萨发大水'
,
unit
:
'个'
,
freeAmount
:
'1'
,
price
:
'45.0'
,
consumption
:
'4'
,
})
}
},
if
(
Number
(
item
.
useLength
)
&&
Number
(
item
.
freeLength
)
&&
Number
(
item
.
unitAmt
))
{
amount
+=
Math
.
max
(
Number
(
item
.
useLength
)
-
Number
(
item
.
freeLength
),
0
)
*
Number
(
item
.
unitAmt
)
}
}
for
(
var
item
of
this
.
other
)
{
if
(
item
.
extraAmt
&&
Number
(
item
.
extraAmt
))
{
amount
+=
Number
(
item
.
extraAmt
)
}
}
return
amount
},
isMaterial
(){
return
this
.
fieldName
===
'materialList'
},
isCraft
(){
return
this
.
fieldName
===
'craftList'
},
priceType
(){
return
this
.
isMaterial
?
"01"
:
"02"
},
},
onLoad
(
option
)
{
this
.
orderId
=
option
.
orderId
this
.
fieldName
=
option
.
fieldName
const
eventChannel
=
this
.
getOpenerEventChannel
();
let
self
=
this
eventChannel
.
on
(
'showMaterialData'
,
function
(
data
)
{
if
(
!
data
||
data
.
length
===
0
){
self
.
getMaterialData
()
}
else
{
self
.
formatServiceMoreList
(
data
)
}
});
},
created
()
{
},
mounted
()
{
},
methods
:
{
/* 其他添加新的 */
handleAdd
()
{
this
.
other
.
push
({
title
:
''
,
value
:
''
})
getMaterialData
(){
let
self
=
this
self
.
$u
.
api
.
getOrderMaterial
(
self
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
!==
200
)
{
console
.
log
(
res
.
data
.
message
)
return
}
self
.
formatServiceMoreList
(
res
.
data
)
})
// let testData = [{"freeLength":30,"priceTypeName":"","priceType":"01","lastModifiedWhen":"2021-05-11 11:10:27","matNo":"MAT1594085500303","createdWhen":"2021-05-11 11:10:27","extraAmt":0,"matName":"φ32镀锌管","studErp":"","isDel":"N","orderNo":"D20210424296591GQF","createdByName":"李小平","matUnit":"米","useLength":0,"orderMaterialId":"32BDDH67P5BBJGBKQBVXYCoJAA","lastModifiedByName":"李小平","unitAmt":0,"otherExplain":"","matType":"01"},{"freeLength":1,"priceTypeName":"","priceType":"01","lastModifiedWhen":"2021-05-11 11:10:27","matNo":"MAT1594714122500","createdWhen":"2021-05-11 11:10:27","extraAmt":0,"matName":"无标准电表箱","studErp":"","isDel":"N","orderNo":"D20210424296591GQF","createdByName":"李小平","matUnit":"个","useLength":0,"orderMaterialId":"6GXHJEJIZ5FZ7oFESHB26EAYWY","lastModifiedByName":"李小平","unitAmt":0,"otherExplain":"","matType":"01"}]
// self.formatServiceMoreList(testData)
},
formatServiceMoreList
(
materialCraftsData
){
let
self
=
this
materialCraftsData
.
map
(
item
=>
{
if
(
item
.
priceType
===
self
.
priceType
)
{
item
.
matType
===
'04'
?
self
.
other
.
push
(
item
)
:
self
.
list
.
push
(
item
)
}
})
},
/* 其他添加新的 */
handleAdd
()
{
this
.
other
.
push
({
//orderNo:this.formInfo.orderNo,
isDel
:
'N'
,
isWebAdd
:
true
,
matName
:
'其他'
,
extraAmt
:
0
,
priceType
:
this
.
priceType
,
matType
:
'04'
,
otherExplain
:
''
})
},
/* 其他删除某个 */
handleSubtract
(
index
)
{
this
.
other
.
splice
(
index
,
1
)
},
/* 其他删除某个 */
handleSubtract
(
index
)
{
this
.
other
.
splice
(
index
,
1
)
},
handleSure
()
{
// 返回总额money
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.mtr-content
{
display
:
flex
;
flex-direction
:
column
;
background-color
:
#F4F5F7
;
height
:
100vh
;
.content-view
{
padding
:
30rpx
30rpx
60rpx
30rpx
;
margin
:
20rpx
30rpx
;
border-radius
:
12rpx
;
background-color
:
#FFFFFF
;
height
:
100%
;
overflow
:
auto
;
.line-view
{
background-color
:
#F4F5F7
;
height
:
2rpx
;
margin
:
20rpx
0
;
}
.mtr-tab
{
.tab-th-txt
{
background-color
:
#FFFFFF
;
padding
:
10rpx
0
;
&
.left
{
text-align
:
left
;
}
}
}
.mtr-other
{
.other-space
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
}
.other-content
{
margin-bottom
:
30rpx
;
}
.input-view
{
padding
:
10rpx
30rpx
;
width
:
100%
;
border-radius
:
12rpx
;
border
:
1px
#F4F5F7
solid
;
margin-bottom
:
30rpx
;
.input-title
{
width
:
80rpx
;
flex-shrink
:
0
;
color
:
#333333
;
font-size
:
26rpx
;
}
.input-content
{
width
:
100%
;
}
}
.image-view
{
width
:
52rpx
;
height
:
52rpx
;
flex-shrink
:
0
;
margin
:
30rpx
0
30rpx
30rpx
;
}
}
}
.bottom-view
{
margin-bottom
:
44rpx
;
margin-top
:
10rpx
;
height
:
104rpx
;
}
}
handleSure
()
{
let
pages
=
getCurrentPages
();
let
prevPage
=
pages
[
pages
.
length
-
2
];
//上一个页面
let
data
=
{}
data
[
this
.
fieldName
]
=
this
.
list
.
concat
(
this
.
other
)
// 将list合并给上以页面
prevPage
.
$vm
.
setData
(
data
)
//直接调用上一个页面的setData()方法,把数据存到上一个页面中去
uni
.
navigateBack
();
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.mtr-content
{
display
:
flex
;
flex-direction
:
column
;
background-color
:
#F4F5F7
;
height
:
100vh
;
.content-view
{
padding
:
30rpx
30rpx
60rpx
30rpx
;
margin
:
20rpx
30rpx
;
border-radius
:
12rpx
;
background-color
:
#FFFFFF
;
height
:
100%
;
overflow
:
auto
;
.line-view
{
background-color
:
#F4F5F7
;
height
:
2rpx
;
margin
:
20rpx
0
;
}
.mtr-tab
{
.tab-th-txt
{
background-color
:
#FFFFFF
;
padding
:
10rpx
0
;
&
.left
{
text-align
:
left
;
}
}
}
.mtr-other
{
.other-space
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
}
.other-content
{
margin-bottom
:
30rpx
;
}
.input-view
{
padding
:
10rpx
30rpx
;
width
:
100%
;
border-radius
:
12rpx
;
border
:
1px
#F4F5F7
solid
;
margin-bottom
:
30rpx
;
.input-title
{
width
:
80rpx
;
flex-shrink
:
0
;
color
:
#333333
;
font-size
:
26rpx
;
}
.input-content
{
width
:
100%
;
}
}
.image-view
{
width
:
52rpx
;
height
:
52rpx
;
flex-shrink
:
0
;
margin
:
30rpx
0
30rpx
30rpx
;
}
}
}
.bottom-view
{
margin-bottom
:
44rpx
;
margin-top
:
10rpx
;
height
:
104rpx
;
}
}
</
style
>
src/pages/photo/list.vue
View file @
8982de7c
<
template
>
<view
class=
"backView"
>
<u-navbar
:title-size=
"32"
title-color=
"#000"
:border-bottom=
"false"
:title=
"title"
></u-navbar>
<u-loading
style=
"position: fixed;top: 50%;"
:show=
"loading"
size=
"36"
mode=
"flower"
></u-loading>
<view
class=
"topView"
>
<view
:class=
"['topItemView',
{'active':activeTop===ikey}]" @click="handleTopItemChange(ikey,item)"
v-for="(item,ikey) in dataList" :key="ikey">
<text
:class=
"['ph-lst-top-index',
{'active':activeTop===ikey}]">
{{
ikey
+
1
}}
</text>
<text
class=
"topItemTitle"
>
{{
item
.
type
}}
</text>
</view>
</view>
<view
class=
"rightView"
>
<view
class=
"right-view-title"
>
拍照项有:
</view>
<scroll-view
scroll-y=
"true"
class=
"scroll-y"
>
<template
v-for=
"(item,ikey) in rightList"
>
<view
class=
"rightItemView"
@
click=
"take(item,ikey)"
:key=
"ikey"
>
<view
:class=
"['rightContentView',
{'active':item.orderImages[0]}]">
<text
class=
"ph-lst-item-index"
>
{{
ikey
+
1
}}
</text>
<text
class=
""
>
{{
item
.
name
}}
</text>
<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>
-->
</view>
<view
class=
"rightImageView"
v-if=
"item.orderImages && item.orderImages.length > 0"
>
<image
class=
"rightImage"
v-for=
"(image, index) in item.orderImages.slice(0 , 10)"
:src=
"image"
:key=
"index"
@
click
.
stop=
"handleClickImage(item, index)"
mode=
"aspectFill"
></image>
</view>
</view>
</
template
>
</scroll-view>
<take-photo
type=
"test"
v-if=
"takeStatus"
:currentItem=
"currentItemDate"
@
close=
"closeTake"
></take-photo>
<!-- <u-button v-if="activeTop + 1 === dataList.length" class="ph-list-button" type="error" shape="circle"
:disabled="buttonDisabled" :custom-style="buttonStyle" @click="isPopShow = true">一键清空展示图片</u-button> -->
</view>
<!-- <u-popup border-radius="10" v-model="isPopShow" safe-area-inset-bottom mode="center" width="690rpx"
height="600rpx">
<view class="ph-list-pop-title">
<text>是否一键清空系统展示的图片?</text>
</view>
<view class="ph-list-pop-text">
<text>点击"确定"则删除系统展示的所有图片</text>
</view>
<view class="ph-list-pop-btn-view">
<u-button :custom-style="customStyleCancel" hover-class="none" shape="circle" type="primary"
@click="isPopShow = false">
取消
</u-button>
<u-button :custom-style="customStyleSave" shape="circle" type="primary" @click="handleClickSure()">
确定
</u-button>
</view>
</u-popup> -->
</view>
</template>
<
script
>
import
takePhoto
from
'@/components/take/index.vue'
export
default
{
components
:
{
'take-photo'
:
takePhoto
},
data
()
{
return
{
takeStatus
:
false
,
currentItemDate
:{},
topList
:
[],
activeTop
:
0
,
leftList
:
[],
rightList
:
[],
classifyId
:
''
,
systemId
:
''
,
brand
:
''
,
brandId
:
''
,
orderId
:
''
,
dataList
:
[],
loading
:
true
,
isPopShow
:
false
,
userWatermark
:{},
title
:
'规范展示'
}
},
onLoad
(
e
)
{
getApp
().
trackPage
(
'照片规范列表页'
)
if
(
e
&&
e
.
brandId
)
{
this
.
brandId
=
e
.
brandId
}
if
(
e
&&
e
.
brand
)
{
this
.
brand
=
decodeURIComponent
(
e
.
brand
)
this
.
title
=
this
.
brand
}
if
(
e
&&
e
.
orderId
)
{
this
.
orderId
=
e
.
orderId
}
if
(
e
&&
e
.
systemId
)
{
this
.
systemId
=
e
.
systemId
}
if
(
e
&&
e
.
classifyId
)
{
this
.
classifyId
=
e
.
classifyId
}
// this.getListData()
this
.
getListDataNew
()
this
.
getWatermark
()
},
computed
:
{
buttonStyle
()
{
return
{
'color'
:
'#FFFFFF'
,
'width'
:
'600rpx'
,
'height'
:
'104rpx'
,
'font-size'
:
'36rpx'
}
},
buttonDisabled
()
{
for
(
var
item
of
this
.
dataList
)
{
for
(
var
i
of
item
.
list
)
{
if
((
i
.
imageList
||
[]).
length
>
0
)
{
return
false
}
}
}
return
true
},
customStyleCancel
()
{
return
{
'background-color'
:
'#D1D4D4'
,
'width'
:
'280rpx'
,
'height'
:
'96rpx'
}
},
customStyleSave
()
{
return
{
'background-color'
:
'##2272FF'
,
'width'
:
'280rpx'
,
'height'
:
'96rpx'
,
'margin-left'
:
'50rpx'
}
}
},
methods
:
{
getListData
:
function
()
{
this
.
loading
=
true
let
that
=
this
this
.
$u
.
cloudApi
.
getGroupStandardV2
({
'token'
:
this
.
vuex_token
,
'classify_id'
:
this
.
classifyId
,
'system_id'
:
this
.
systemId
,
'brand_id'
:
this
.
brandId
}).
then
(
res
=>
{
this
.
loading
=
false
if
(
res
&&
res
.
result
)
{
if
(
res
.
result
.
error_code
)
{
uni
.
showToast
({
title
:
res
.
result
.
error_msg
})
}
else
{
that
.
handleData
(
res
.
result
)
}
}
})
},
getListDataNew
()
{
this
.
loading
=
true
let
self
=
this
var
data
=
{
partnerCompanyId
:
this
.
systemId
,
orderId
:
this
.
orderId
,
categoryId
:
this
.
classifyId
,
brandId
:
this
.
brandId
};
self
.
$u
.
api
.
orderStandard
(
data
).
then
((
res
)
=>
{
this
.
loading
=
false
if
(
res
.
code
==
200
)
{
if
(
res
.
data
&&
res
.
data
.
length
>
0
){
let
dataList
=
[]
var
flag
=
false
;
res
.
data
.
forEach
(
item
=>
{
if
(
dataList
.
length
===
0
){
var
dataItem
=
{
type
:
''
,
list
:[]}
dataItem
.
type
=
item
.
type
dataItem
.
list
.
push
(
item
)
dataList
.
push
(
dataItem
)
}
else
{
dataList
.
forEach
(
dataListItem
=>
{
if
(
dataListItem
.
type
===
item
.
type
){
dataListItem
.
list
.
push
(
item
)
flag
=
true
return
false
;
}
else
{
flag
=
false
}
})
if
(
!
flag
){
var
dataItem
=
{
type
:
''
,
list
:[]}
dataItem
.
type
=
item
.
type
dataItem
.
list
.
push
(
item
)
dataList
.
push
(
dataItem
)
}
}
})
console
.
log
(
"==="
,
dataList
)
this
.
handleData
(
dataList
)
}
}
else
{
console
.
log
(
res
.
code
.
message
)
}
});
},
handleData
:
function
(
result
)
{
this
.
activeTop
=
0
this
.
dataList
=
result
if
(
result
.
length
>
0
)
{
var
item
=
result
[
0
]
this
.
rightList
=
item
.
list
}
},
//顶部点击
handleTopItemChange
:
function
(
ikey
,
item
)
{
this
.
activeTop
=
ikey
this
.
rightList
=
item
.
list
const
photo
=
getApp
().
globalData
.
photo
photo
.
topIndex
=
ikey
photo
.
waterSetting
=
item
.
userWatermark
uni
.
pageScrollTo
({
scrollTop
:
0
,
duration
:
0
});
},
// 点击图片
handleClickImage
(
item
,
index
)
{
uni
.
previewImage
({
urls
:
item
.
orderImages
,
current
:
index
})
},
//右侧点击
rightItemClick
:
function
(
item
,
ikey
)
{
const
photo
=
getApp
().
globalData
.
photo
photo
.
currentItem
=
item
photo
.
itemIndex
=
ikey
const
len
=
item
.
imageList
.
length
photo
.
currentItemLength
=
len
>
9
?
10
:
len
uni
.
navigateTo
({
url
:
'/pages/photo/take'
})
},
// 清除图片
handleClickSure
:
function
()
{
this
.
$u
.
cloudApi
.
cleanImage
({
'token'
:
this
.
vuex_token
,
}).
then
(
res
=>
{
this
.
isPopShow
=
false
if
(
res
&&
res
.
result
)
{
this
.
getListData
()
}
})
},
take
(
item
,
ikey
)
{
this
.
currentItemDate
=
item
const
photo
=
getApp
().
globalData
.
photo
photo
.
currentItem
=
item
photo
.
itemIndex
=
ikey
const
len
=
item
.
orderImages
?
item
.
orderImages
.
length
:
0
photo
.
currentItemLength
=
len
>
9
?
10
:
len
uni
.
hideTabBar
()
this
.
takeStatus
=
true
},
closeTake
(
img
)
{
if
(
img
!==
undefined
){
if
(
!
this
.
currentItemDate
.
orderImages
)
this
.
currentItemDate
.
orderImages
=
[]
// step1 添加图片
img
.
forEach
(
v
=>
{
this
.
currentItemDate
.
orderImages
.
push
(
v
.
key
)
})
// step2 保存图片
var
data
=
{
type
:
this
.
currentItemDate
.
type
,
images
:
Array
.
from
(
this
.
currentItemDate
.
orderImages
),
fieldsName
:
this
.
currentItemDate
.
fieldName
}
this
.
$u
.
api
.
saveImage
(
data
,
this
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
console
.
log
(
"==="
,
res
.
data
)
}
else
{
console
.
log
(
"保存图片异常"
,
res
.
data
.
message
)
}
});
}
this
.
takeStatus
=
false
},
getWatermark
(){
var
data
=
{
partnerCompanyId
:
this
.
systemId
}
this
.
$u
.
api
.
getWatermark
(
data
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
console
.
log
(
"==="
,
res
.
data
)
this
.
userWatermark
=
res
.
data
}
else
{
console
.
log
(
"获取水印备注异常"
,
res
.
data
.
message
)
}
});
}
}
}
</
script
>
<
style
>
.backView
{
background-color
:
#F4F5F7
;
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
height
:
100%
;
}
.centerBackView
{
display
:
flex
;
flex-direction
:
row
;
margin-top
:
80
rpx
;
width
:
100%
;
}
.ph-lst-top-index
{
font-size
:
26
rpx
;
font-weight
:
bold
;
color
:
#FFFFFF
;
border-radius
:
8
rpx
;
background-color
:
#999999
;
width
:
36
rpx
;
height
:
36
rpx
;
line-height
:
36
rpx
;
text-align
:
center
;
}
.ph-lst-top-index.active
{
background-color
:
#2272FF
;
}
.rightView
{
background-color
:
#F4F5F7
;
width
:
100%
;
display
:
flex
;
flex-direction
:
column
;
padding-bottom
:
50
rpx
;
}
.right-view-title
{
font-size
:
36
rpx
;
font-weight
:
bold
;
height
:
104
rpx
;
line-height
:
104
rpx
;
margin-left
:
30
rpx
;
}
.rightItemView
{
/* width: 100%; */
/* display: flex; */
/* flex-direction: row; */
/* justify-content: space-between; */
/* border-bottom: 20rpx solid #F3F3F3; */
margin
:
0
rpx
30
rpx
20
rpx
30
rpx
;
padding
:
36
rpx
30
rpx
30
rpx
30
rpx
;
border-radius
:
12
rpx
;
background-color
:
#FFFFFF
;
/* min-height: 108rpx; */
}
.ph-lst-item-index
{
font-size
:
24
rpx
;
font-weight
:
bold
;
border-radius
:
4
rpx
;
width
:
34
rpx
;
height
:
34
rpx
;
line-height
:
32
rpx
;
text-align
:
center
;
border-width
:
1px
;
border-style
:
solid
;
margin-right
:
10
rpx
;
margin-top
:
4
rpx
;
}
.rightContentView
{
display
:
flex
;
align-items
:
flex-start
;
width
:
100%
;
font-size
:
30
rpx
;
color
:
#2272FF
;
/* flex-direction: column; */
/* border-left: 2rpx solid #F3F3F3; */
}
.rightContentView.active
{
color
:
#666666
;
border-color
:
#666666
;
}
.ph-list-item-arrow
{
position
:
absolute
;
width
:
40
rpx
;
height
:
40
rpx
;
right
:
38
rpx
;
}
.rightContent
{
font-size
:
30
rpx
;
color
:
#333333
;
line-height
:
40
rpx
;
}
.rightImageView
{
/* width: 300rpx; */
/* height: 320rpx; */
display
:
flex
;
align-items
:
center
;
justify-content
:
flex-start
;
flex-wrap
:
wrap
;
margin-top
:
26
rpx
;
}
.rightImage
{
background-color
:
#F3F3F3
;
width
:
116
rpx
;
height
:
116
rpx
;
margin
:
0
rpx
12
rpx
12
rpx
0
rpx
;
}
.rightImage
:nth-child
(
5n
)
{
margin-right
:
0
;
}
.topView
{
background-color
:
#FAFAFA
;
width
:
100%
;
height
:
100
rpx
;
display
:
flex
;
flex-direction
:
row
;
z-index
:
1
;
}
.topItemView
{
/* width: 210rpx; */
height
:
100
rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
-webkit-flex
:
1
;
flex
:
1
;
background-color
:
#FFFFFF
;
color
:
#999999
;
}
.topItemView.active
{
color
:
#2272FF
;
}
.topItemTitle
{
font-size
:
36
rpx
;
font-weight
:
bold
;
padding-left
:
30
rpx
;
}
.greenBackColor
{
background-color
:
#4CD964
;
}
.ph-list-pop-text
{
color
:
#666666
;
text-align
:
center
;
margin-top
:
20
rpx
;
font-size
:
30
rpx
;
}
.ph-list-pop-title
{
font-size
:
40
rpx
;
padding-top
:
150
rpx
;
text-align
:
center
;
color
:
#333333
;
}
.ph-list-pop-btn-view
{
display
:
flex
;
justify-content
:
center
;
margin-top
:
150
rpx
;
}
.scroll-y
{
height
:
73vh
;
}
</
style
>
<
template
>
<view
class=
"backView"
>
<u-navbar
:title-size=
"32"
title-color=
"#000"
:border-bottom=
"false"
:title=
"title"
></u-navbar>
<u-loading
style=
"position: fixed;top: 50%;"
:show=
"loading"
size=
"36"
mode=
"flower"
></u-loading>
<view
class=
"topView"
>
<view
:class=
"['topItemView',
{'active':activeTop===ikey}]" @click="handleTopItemChange(ikey,item)"
v-for="(item,ikey) in dataList" :key="ikey">
<text
:class=
"['ph-lst-top-index',
{'active':activeTop===ikey}]">
{{
ikey
+
1
}}
</text>
<text
class=
"topItemTitle"
>
{{
item
.
type
}}
</text>
</view>
</view>
<view
class=
"rightView"
>
<view
class=
"right-view-title"
>
拍照项有:
</view>
<scroll-view
scroll-y=
"true"
class=
"scroll-y"
>
<template
v-for=
"(item,ikey) in rightList"
>
<view
class=
"rightItemView"
@
click=
"take(item,ikey)"
:key=
"ikey"
>
<view
:class=
"['rightContentView',
{'active':item.orderImages[0]}]">
<text
class=
"ph-lst-item-index"
>
{{
ikey
+
1
}}
</text>
<text
class=
""
>
{{
item
.
name
}}
</text>
<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>
-->
</view>
<view
class=
"rightImageView"
v-if=
"item.orderImages && item.orderImages.length > 0"
>
<image
class=
"rightImage"
v-for=
"(image, index) in item.orderImages.slice(0 , 10)"
:src=
"image"
:key=
"index"
@
click
.
stop=
"handleClickImage(item, index)"
mode=
"aspectFill"
></image>
</view>
</view>
</
template
>
</scroll-view>
<take-photo
type=
"test"
v-if=
"takeStatus"
:currentItem=
"currentItemDate"
@
close=
"closeTake"
></take-photo>
<!-- <u-button v-if="activeTop + 1 === dataList.length" class="ph-list-button" type="error" shape="circle"
:disabled="buttonDisabled" :custom-style="buttonStyle" @click="isPopShow = true">一键清空展示图片</u-button> -->
</view>
<!-- <u-popup border-radius="10" v-model="isPopShow" safe-area-inset-bottom mode="center" width="690rpx"
height="600rpx">
<view class="ph-list-pop-title">
<text>是否一键清空系统展示的图片?</text>
</view>
<view class="ph-list-pop-text">
<text>点击"确定"则删除系统展示的所有图片</text>
</view>
<view class="ph-list-pop-btn-view">
<u-button :custom-style="customStyleCancel" hover-class="none" shape="circle" type="primary"
@click="isPopShow = false">
取消
</u-button>
<u-button :custom-style="customStyleSave" shape="circle" type="primary" @click="handleClickSure()">
确定
</u-button>
</view>
</u-popup> -->
</view>
</template>
<
script
>
import
takePhoto
from
'@/components/take/index.vue'
export
default
{
components
:
{
'take-photo'
:
takePhoto
},
data
()
{
return
{
takeStatus
:
false
,
currentItemDate
:{},
topList
:
[],
activeTop
:
0
,
leftList
:
[],
rightList
:
[],
classifyId
:
''
,
systemId
:
''
,
brand
:
''
,
brandId
:
''
,
orderId
:
''
,
dataList
:
[],
loading
:
true
,
isPopShow
:
false
,
userWatermark
:{},
title
:
'全部'
}
},
onLoad
(
e
)
{
getApp
().
trackPage
(
'照片规范列表页'
)
if
(
e
&&
e
.
brandId
)
{
this
.
brandId
=
e
.
brandId
}
if
(
e
&&
e
.
brand
)
{
this
.
brand
=
decodeURIComponent
(
e
.
brand
)
// this.title = this.brand
}
if
(
e
&&
e
.
orderId
)
{
this
.
orderId
=
e
.
orderId
}
if
(
e
&&
e
.
systemId
)
{
this
.
systemId
=
e
.
systemId
}
if
(
e
&&
e
.
classifyId
)
{
this
.
classifyId
=
e
.
classifyId
}
// this.getListData()
this
.
getListDataNew
()
this
.
getWatermark
()
},
computed
:
{
buttonStyle
()
{
return
{
'color'
:
'#FFFFFF'
,
'width'
:
'600rpx'
,
'height'
:
'104rpx'
,
'font-size'
:
'36rpx'
}
},
buttonDisabled
()
{
for
(
var
item
of
this
.
dataList
)
{
for
(
var
i
of
item
.
list
)
{
if
((
i
.
imageList
||
[]).
length
>
0
)
{
return
false
}
}
}
return
true
},
customStyleCancel
()
{
return
{
'background-color'
:
'#D1D4D4'
,
'width'
:
'280rpx'
,
'height'
:
'96rpx'
}
},
customStyleSave
()
{
return
{
'background-color'
:
'##2272FF'
,
'width'
:
'280rpx'
,
'height'
:
'96rpx'
,
'margin-left'
:
'50rpx'
}
}
},
methods
:
{
getListData
:
function
()
{
this
.
loading
=
true
let
that
=
this
this
.
$u
.
cloudApi
.
getGroupStandardV2
({
'token'
:
this
.
vuex_token
,
'classify_id'
:
this
.
classifyId
,
'system_id'
:
this
.
systemId
,
'brand_id'
:
this
.
brandId
}).
then
(
res
=>
{
this
.
loading
=
false
if
(
res
&&
res
.
result
)
{
if
(
res
.
result
.
error_code
)
{
uni
.
showToast
({
title
:
res
.
result
.
error_msg
})
}
else
{
that
.
handleData
(
res
.
result
)
}
}
})
},
getListDataNew
()
{
this
.
loading
=
true
let
self
=
this
var
data
=
{
partnerCompanyId
:
this
.
systemId
,
orderId
:
this
.
orderId
,
categoryId
:
this
.
classifyId
,
brandId
:
this
.
brandId
};
self
.
$u
.
api
.
orderStandard
(
data
).
then
((
res
)
=>
{
this
.
loading
=
false
if
(
res
.
code
==
200
)
{
if
(
res
.
data
&&
res
.
data
.
length
>
0
){
let
dataList
=
[]
var
flag
=
false
;
res
.
data
.
forEach
(
item
=>
{
if
(
dataList
.
length
===
0
){
var
dataItem
=
{
type
:
''
,
list
:[]}
dataItem
.
type
=
item
.
type
dataItem
.
list
.
push
(
item
)
dataList
.
push
(
dataItem
)
}
else
{
dataList
.
forEach
(
dataListItem
=>
{
if
(
dataListItem
.
type
===
item
.
type
){
dataListItem
.
list
.
push
(
item
)
flag
=
true
return
false
;
}
else
{
flag
=
false
}
})
if
(
!
flag
){
var
dataItem
=
{
type
:
''
,
list
:[]}
dataItem
.
type
=
item
.
type
dataItem
.
list
.
push
(
item
)
dataList
.
push
(
dataItem
)
}
}
})
console
.
log
(
"==="
,
dataList
)
this
.
handleData
(
dataList
)
}
}
else
{
console
.
log
(
res
.
code
.
message
)
}
});
},
handleData
:
function
(
result
)
{
this
.
activeTop
=
0
this
.
dataList
=
result
if
(
result
.
length
>
0
)
{
var
item
=
result
[
0
]
this
.
rightList
=
item
.
list
}
},
//顶部点击
handleTopItemChange
:
function
(
ikey
,
item
)
{
this
.
activeTop
=
ikey
this
.
rightList
=
item
.
list
const
photo
=
getApp
().
globalData
.
photo
photo
.
topIndex
=
ikey
photo
.
waterSetting
=
item
.
userWatermark
uni
.
pageScrollTo
({
scrollTop
:
0
,
duration
:
0
});
},
// 点击图片
handleClickImage
(
item
,
index
)
{
uni
.
previewImage
({
urls
:
item
.
orderImages
,
current
:
index
})
},
//右侧点击
rightItemClick
:
function
(
item
,
ikey
)
{
const
photo
=
getApp
().
globalData
.
photo
photo
.
currentItem
=
item
photo
.
itemIndex
=
ikey
const
len
=
item
.
imageList
.
length
photo
.
currentItemLength
=
len
>
9
?
10
:
len
uni
.
navigateTo
({
url
:
'/pages/photo/take'
})
},
// 清除图片
handleClickSure
:
function
()
{
this
.
$u
.
cloudApi
.
cleanImage
({
'token'
:
this
.
vuex_token
,
}).
then
(
res
=>
{
this
.
isPopShow
=
false
if
(
res
&&
res
.
result
)
{
this
.
getListData
()
}
})
},
take
(
item
,
ikey
)
{
this
.
currentItemDate
=
item
const
photo
=
getApp
().
globalData
.
photo
photo
.
currentItem
=
item
photo
.
itemIndex
=
ikey
const
len
=
item
.
orderImages
?
item
.
orderImages
.
length
:
0
photo
.
currentItemLength
=
len
>
9
?
10
:
len
uni
.
hideTabBar
()
this
.
takeStatus
=
true
},
closeTake
(
img
)
{
if
(
img
!==
undefined
){
if
(
!
this
.
currentItemDate
.
orderImages
)
this
.
currentItemDate
.
orderImages
=
[]
// step1 添加图片
img
.
forEach
(
v
=>
{
this
.
currentItemDate
.
orderImages
.
push
(
v
.
key
)
})
// step2 保存图片
var
data
=
{
type
:
this
.
currentItemDate
.
type
,
images
:
Array
.
from
(
this
.
currentItemDate
.
orderImages
),
fieldsName
:
this
.
currentItemDate
.
fieldName
}
this
.
$u
.
api
.
saveImage
(
data
,
this
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
console
.
log
(
"==="
,
res
.
data
)
}
else
{
console
.
log
(
"保存图片异常"
,
res
.
data
.
message
)
}
});
}
this
.
takeStatus
=
false
},
getWatermark
(){
var
data
=
{
partnerCompanyId
:
this
.
systemId
}
this
.
$u
.
api
.
getWatermark
(
data
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
console
.
log
(
"==="
,
res
.
data
)
this
.
userWatermark
=
res
.
data
getApp
().
globalData
.
photo
.
waterSetting
=
this
.
userWatermark
}
else
{
console
.
log
(
"获取水印备注异常"
,
res
.
data
.
message
)
}
});
}
}
}
</
script
>
<
style
>
.backView
{
background-color
:
#F4F5F7
;
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
height
:
100%
;
}
.centerBackView
{
display
:
flex
;
flex-direction
:
row
;
margin-top
:
80
rpx
;
width
:
100%
;
}
.ph-lst-top-index
{
font-size
:
26
rpx
;
font-weight
:
bold
;
color
:
#FFFFFF
;
border-radius
:
8
rpx
;
background-color
:
#999999
;
width
:
36
rpx
;
height
:
36
rpx
;
line-height
:
36
rpx
;
text-align
:
center
;
}
.ph-lst-top-index.active
{
background-color
:
#2272FF
;
}
.rightView
{
background-color
:
#F4F5F7
;
width
:
100%
;
display
:
flex
;
flex-direction
:
column
;
padding-bottom
:
50
rpx
;
}
.right-view-title
{
font-size
:
36
rpx
;
font-weight
:
bold
;
height
:
104
rpx
;
line-height
:
104
rpx
;
margin-left
:
30
rpx
;
}
.rightItemView
{
/* width: 100%; */
/* display: flex; */
/* flex-direction: row; */
/* justify-content: space-between; */
/* border-bottom: 20rpx solid #F3F3F3; */
margin
:
0
rpx
30
rpx
20
rpx
30
rpx
;
padding
:
36
rpx
30
rpx
30
rpx
30
rpx
;
border-radius
:
12
rpx
;
background-color
:
#FFFFFF
;
/* min-height: 108rpx; */
}
.ph-lst-item-index
{
font-size
:
24
rpx
;
font-weight
:
bold
;
border-radius
:
4
rpx
;
width
:
34
rpx
;
height
:
34
rpx
;
line-height
:
32
rpx
;
text-align
:
center
;
border-width
:
1px
;
border-style
:
solid
;
margin-right
:
10
rpx
;
margin-top
:
4
rpx
;
}
.rightContentView
{
display
:
flex
;
align-items
:
flex-start
;
width
:
100%
;
font-size
:
30
rpx
;
color
:
#2272FF
;
/* flex-direction: column; */
/* border-left: 2rpx solid #F3F3F3; */
}
.rightContentView.active
{
color
:
#666666
;
border-color
:
#666666
;
}
.ph-list-item-arrow
{
position
:
absolute
;
width
:
40
rpx
;
height
:
40
rpx
;
right
:
38
rpx
;
}
.rightContent
{
font-size
:
30
rpx
;
color
:
#333333
;
line-height
:
40
rpx
;
}
.rightImageView
{
/* width: 300rpx; */
/* height: 320rpx; */
display
:
flex
;
align-items
:
center
;
justify-content
:
flex-start
;
flex-wrap
:
wrap
;
margin-top
:
26
rpx
;
}
.rightImage
{
background-color
:
#F3F3F3
;
width
:
116
rpx
;
height
:
116
rpx
;
margin
:
0
rpx
12
rpx
12
rpx
0
rpx
;
}
.rightImage
:nth-child
(
5n
)
{
margin-right
:
0
;
}
.topView
{
background-color
:
#FAFAFA
;
width
:
100%
;
height
:
100
rpx
;
display
:
flex
;
flex-direction
:
row
;
z-index
:
1
;
}
.topItemView
{
/* width: 210rpx; */
height
:
100
rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
-webkit-flex
:
1
;
flex
:
1
;
background-color
:
#FFFFFF
;
color
:
#999999
;
}
.topItemView.active
{
color
:
#2272FF
;
}
.topItemTitle
{
font-size
:
36
rpx
;
font-weight
:
bold
;
padding-left
:
30
rpx
;
}
.greenBackColor
{
background-color
:
#4CD964
;
}
.ph-list-pop-text
{
color
:
#666666
;
text-align
:
center
;
margin-top
:
20
rpx
;
font-size
:
30
rpx
;
}
.ph-list-pop-title
{
font-size
:
40
rpx
;
padding-top
:
150
rpx
;
text-align
:
center
;
color
:
#333333
;
}
.ph-list-pop-btn-view
{
display
:
flex
;
justify-content
:
center
;
margin-top
:
150
rpx
;
}
.scroll-y
{
height
:
73vh
;
}
</
style
>
src/pages/photo/preview.vue
View file @
8982de7c
...
...
@@ -216,7 +216,7 @@
flex-direction
:
column
;
}
/
deep
/
.u-image
{
height
:
100
%
!
important
;
height
:
100
vh
!
important
;
}
/
deep
/
.u-image__loading
{
background-color
:
transparent
!
important
;
...
...
src/pages/photo/setting.vue
View file @
8982de7c
...
...
@@ -8,20 +8,20 @@
<text
class=
"itemTitle"
>
保存原图
</text>
<text
class=
"itemNotice"
>
拍照后另保存一张无水印的图片
</text>
</view>
<switch
class=
"itemSwitch"
:checked=
"result['has
_o
rigin']"
@
change=
"handleOrigineChange"
color=
"#007AFF"
/>
<switch
class=
"itemSwitch"
:checked=
"result['has
O
rigin']"
@
change=
"handleOrigineChange"
color=
"#007AFF"
/>
</view>
<view
class=
"itemView"
v-if=
"showTitleSwitch"
>
<view
class=
"itemTitleView"
@
click=
"itemClick(
{},-1)">
<text
class=
"itemTitle"
>
水印标题
</text>
<text
class=
"itemNotice"
>
{{
result
[
'lower
_right'
][
'title_text
'
]
||
'点击可编辑更改'
}}
</text>
<text
class=
"itemNotice"
>
{{
result
[
'lower
Left'
][
'title
'
]
||
'点击可编辑更改'
}}
</text>
</view>
<switch
class=
"itemSwitch"
disabled
:checked=
"result['lower
_right']['title_text
'] != ''"
<switch
class=
"itemSwitch"
disabled
:checked=
"result['lower
Left']['title
'] != ''"
@
click=
"handleClickTitleSwitch"
color=
"#007AFF"
/>
</view>
<view
class=
"itemView"
v-for=
"(item,ikey) in itemList"
:key=
"ikey"
>
<view
class=
"itemTitleView"
@
click=
"itemClick(item,ikey)"
>
<text
class=
"itemTitle"
>
{{
item
[
'watemark
_t
ext'
]
||
'自定义'
+
(
ikey
+
1
)
}}
</text>
<text
class=
"itemNotice"
>
{{
item
[
'watemark
_v
alue'
]
||
'点击可编辑更改'
}}
</text>
<text
class=
"itemTitle"
>
{{
item
[
'watemark
T
ext'
]
||
'自定义'
+
(
ikey
+
1
)
}}
</text>
<text
class=
"itemNotice"
>
{{
item
[
'watemark
V
alue'
]
||
'点击可编辑更改'
}}
</text>
</view>
<switch
class=
"itemSwitch"
:checked=
"item['enable']"
@
change=
"itemChange(item, ikey)"
color=
"#007AFF"
/>
</view>
...
...
@@ -32,7 +32,7 @@
<view
class=
"inputBackView"
>
<view
class=
"ph-pop-left-view"
>
<view
class=
"leftInputView"
>
<input
class=
"leftInput"
type=
"text"
v-model=
"currenItem['watemark
_t
ext']"
<input
class=
"leftInput"
type=
"text"
v-model=
"currenItem['watemark
T
ext']"
@
input=
"leftInput()"
:disabled=
"currenItem.type === 'title_text'"
placeholder=
"请输入"
maxlength=
"10"
/>
</view>
...
...
@@ -41,7 +41,7 @@
<view
class=
"ph-pop-mid-view"
>
:
</view>
<view>
<view
class=
"rightInputView"
>
<input
class=
"rightInput"
type=
"text"
v-model=
"currenItem['watemark
_v
alue']"
<input
class=
"rightInput"
type=
"text"
v-model=
"currenItem['watemark
V
alue']"
@
input=
"rightInput()"
placeholder=
"请输入内容"
maxlength=
"30"
/>
</view>
<view
class=
"ph-pop-tip-view"
v-if=
"showTipRight"
>
*必填项
</view>
...
...
@@ -71,14 +71,14 @@
isPopShow
:
false
,
icon_close_new
:
''
,
result
:
{
has
_o
rigin
:
true
,
lower
_righ
t
:
{
has
O
rigin
:
true
,
lower
Lef
t
:
{
body
:
[]
}
},
currenItem
:
{
'watemark
_t
ext'
:
''
,
'watemark
_v
alue'
:
''
'watemark
T
ext'
:
''
,
'watemark
V
alue'
:
''
},
editingItem
:
{},
showTipLeft
:
false
,
...
...
@@ -88,8 +88,8 @@
},
computed
:
{
itemList
()
{
if
(
this
.
result
[
'lower
_righ
t'
])
{
var
arr
=
this
.
result
[
'lower
_righ
t'
][
'body'
]
if
(
this
.
result
[
'lower
Lef
t'
])
{
var
arr
=
this
.
result
[
'lower
Lef
t'
][
'body'
]
return
arr
.
filter
((
item
)
=>
{
return
item
.
watemark_type
===
'备注'
})
...
...
@@ -99,7 +99,7 @@
},
showTitleSwitch
()
{
return
this
.
result
[
'lower
_right'
].
hasOwnProperty
(
'title_text
'
)
return
this
.
result
[
'lower
Left'
].
hasOwnProperty
(
'title
'
)
},
customStyleCancel
()
{
return
{
...
...
@@ -164,12 +164,12 @@
//保存原图 开关
handleOrigineChange
:
function
(
e
)
{
this
.
result
[
'has
_origin'
]
=
!
this
.
result
[
'has_o
rigin'
]
this
.
result
[
'has
Origin'
]
=
!
this
.
result
[
'hasO
rigin'
]
this
.
saveUserWatermark
()
},
handleClickTitleSwitch
:
function
(
e
)
{
var
string
=
this
.
result
[
'lower
_right'
][
'title_text
'
]
?
'水印标题不可关闭'
:
'请先编辑该自定义项'
var
string
=
this
.
result
[
'lower
Left'
][
'title
'
]
?
'水印标题不可关闭'
:
'请先编辑该自定义项'
uni
.
showToast
({
icon
:
'none'
,
title
:
string
...
...
@@ -178,7 +178,7 @@
//自定义 开关
itemChange
:
function
(
item
,
ikey
)
{
if
(
item
[
'watemark
_v
alue'
])
{
if
(
item
[
'watemark
V
alue'
])
{
// 修改
item
[
'enable'
]
=
!
item
[
'enable'
]
this
.
saveUserWatermark
()
...
...
@@ -194,8 +194,8 @@
itemClick
:
function
(
item
,
ikey
)
{
if
(
ikey
===
-
1
)
{
this
.
currenItem
=
{
'watemark
_t
ext'
:
'水印标题'
,
'watemark
_value'
:
this
.
result
[
'lower_right'
][
'title_text
'
],
'watemark
T
ext'
:
'水印标题'
,
'watemark
Value'
:
this
.
result
[
'lowerLeft'
][
'title
'
],
'type'
:
'title_text'
}
}
else
{
...
...
@@ -210,7 +210,7 @@
//左侧输入框
leftInput
:
function
(
e
)
{
if
(
this
.
currenItem
[
'watemark
_t
ext'
])
{
if
(
this
.
currenItem
[
'watemark
T
ext'
])
{
this
.
showTipLeft
=
false
}
...
...
@@ -218,7 +218,7 @@
//右侧输入框
rightInput
:
function
(
e
)
{
if
(
this
.
currenItem
[
'watemark
_v
alue'
])
{
if
(
this
.
currenItem
[
'watemark
V
alue'
])
{
this
.
showTipRight
=
false
}
},
...
...
@@ -227,8 +227,8 @@
popCancelClick
:
function
()
{
this
.
isPopShow
=
false
this
.
currenItem
=
{
'watemark
_t
ext'
:
''
,
'watemark
_v
alue'
:
''
'watemark
T
ext'
:
''
,
'watemark
V
alue'
:
''
}
},
...
...
@@ -239,22 +239,22 @@
//自定义弹窗 保存
popSaveClick
:
function
()
{
if
(
this
.
currenItem
[
'watemark
_text'
]
&&
this
.
currenItem
[
'watemark_v
alue'
])
{
if
(
this
.
currenItem
[
'watemark
Text'
]
&&
this
.
currenItem
[
'watemarkV
alue'
])
{
this
.
isPopShow
=
false
if
(
this
.
currenItem
.
type
===
'title_text'
)
{
this
.
result
[
'lower
_right'
][
'title_text'
]
=
this
.
currenItem
[
'watemark_v
alue'
]
this
.
result
[
'lower
Left'
][
'title'
]
=
this
.
currenItem
[
'watemarkV
alue'
]
}
else
{
this
.
editingItem
[
'watemark
_text'
]
=
this
.
currenItem
[
'watemark_t
ext'
]
this
.
editingItem
[
'watemark
_value'
]
=
this
.
currenItem
[
'watemark_v
alue'
]
this
.
editingItem
[
'watemark
Text'
]
=
this
.
currenItem
[
'watemarkT
ext'
]
this
.
editingItem
[
'watemark
Value'
]
=
this
.
currenItem
[
'watemarkV
alue'
]
this
.
editingItem
[
'enable'
]
=
true
}
this
.
saveUserWatermark
()
}
else
{
// 提示
if
(
!
this
.
currenItem
[
'watemark
_t
ext'
])
{
if
(
!
this
.
currenItem
[
'watemark
T
ext'
])
{
this
.
showTipLeft
=
true
}
if
(
!
this
.
currenItem
[
'watemark
_v
alue'
])
{
if
(
!
this
.
currenItem
[
'watemark
V
alue'
])
{
this
.
showTipRight
=
true
}
}
...
...
src/pages/settle/file.vue
View file @
8982de7c
...
...
@@ -258,7 +258,7 @@ export default {
// 初始化入驻信息
async
initSettledInfo
()
{
let
self
=
this
let
settledInfo
=
app
.
globalData
.
settledInfo
let
settledInfo
=
self
.
vuex_settled
if
(
settledInfo
&&
settledInfo
.
length
)
{
self
.
fileInfo
.
id
=
settledInfo
.
id
}
else
{
...
...
@@ -267,7 +267,7 @@ export default {
vm
.
settledInfo
=
result
.
record
vm
.
fileInfo
.
id
=
result
.
record
.
id
}
settledInfo
=
await
app
.
getBaseInfo
(
this
,
callBack
)
settledInfo
=
await
app
.
getBaseInfo
(
self
,
callBack
)
uni
.
hideLoading
()
}
},
...
...
src/pages/settle/pay-ensure.vue
View file @
8982de7c
...
...
@@ -83,16 +83,17 @@
})
},
async
getBaseInfo
()
{
let
self
=
this
const
app
=
getApp
()
const
callBack
=
(
vm
,
result
)
=>
{
vm
.
settledInfo
=
result
}
let
settledInfo
=
app
.
globalData
.
settledInfo
let
settledInfo
=
self
.
vuex_settled
if
(
settledInfo
)
{
callBack
(
this
,
settledInfo
)
callBack
(
self
,
settledInfo
)
return
}
await
app
.
getBaseInfo
(
this
,
callBack
)
await
app
.
getBaseInfo
(
self
,
callBack
)
},
async
pending
()
{
...
...
src/pages/settle/sign-contract.vue
View file @
8982de7c
...
...
@@ -291,6 +291,7 @@
this
.
baseInfo
.
bank_site
=
''
},
async
getBaseInfo
()
{
let
self
=
this
const
app
=
getApp
()
const
callBack
=
(
vm
,
result
)
=>
{
vm
.
settledInfo
=
result
...
...
@@ -298,12 +299,12 @@
vm
.
baseInfo
.
name
=
record
.
id_card_name
vm
.
baseInfo
.
id
=
record
.
id
}
let
settledInfo
=
app
.
globalData
.
settledInfo
let
settledInfo
=
self
.
vuex_settled
if
(
settledInfo
)
{
callBack
(
this
,
settledInfo
)
callBack
(
self
,
settledInfo
)
return
}
await
app
.
getBaseInfo
(
this
,
callBack
)
await
app
.
getBaseInfo
(
self
,
callBack
)
},
async
submitInfo
()
{
// checkSettleSignInfo
...
...
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