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