Commit 18df65d1 authored by Morson's avatar Morson
parents 9af987a2 a226fa84
const globalUrl = process.uniEnv || {}
const ucenterApiUrl = globalUrl.ucenterUrl.apiUrl
let certApiFun = function(vm){
let getCertList = async (params = {}) => await vm.$u.get(ucenterApiUrl+'/v1/settled/get-cert-list', params);
const certApi = {
getCertList
}
return certApi
}
module.exports = {
certApiFun
}
\ No newline at end of file
......@@ -10,6 +10,7 @@ import {
import {learnApiFun} from "@/common/api/learn.js";
import { orderApiFun } from "@/common/api/order.js";
import {assessmentApiFun} from"@/common/api/assessment.js"
import {certApiFun} from"@/common/api/cert.js"
let apiFun = function(vm) {
let commonApi = commonApiFun(vm);
let settledApi = settledApiFun(vm)
......@@ -17,13 +18,15 @@ let apiFun = function(vm) {
let learnApi=learnApiFun(vm)
let assessmentApi = assessmentApiFun(vm)
let orderApi=orderApiFun(vm)
let certApi=certApiFun(vm)
let apiUrl = {
...commonApi,
...settledApi,
...cloudApi,
...learnApi,
...orderApi,
...assessmentApi
...assessmentApi,
...certApi
}
return apiUrl
}
......
......@@ -74,6 +74,11 @@ let orderApiFun = function(vm){
* 获取师傅水印 or 默认水印
*/
let getWatermark = async (params = {}) => await vm.$u.get(prefix + vm.vuex_token + '/photo/watermark', params);
/**
* 保存师傅水印
*/
let saveWatermark = async (params = {}) => await vm.$u.post(prefix + vm.vuex_token + '/photo/watermark', params);
/**
* 获取师傅开放可选时间段
......@@ -144,6 +149,7 @@ let orderApiFun = function(vm){
orderStandard,
saveImage,
getWatermark,
saveWatermark,
openTimerange,
contactTime,
checkRejectable,
......
......@@ -72,7 +72,13 @@
}
},
methods: {
selectUpload(){
selectUpload(){
if (this.imgList.length === 10) {
return this.$refs.uToast.show({
title: '图片已超出最大数量',
type: 'error',
})
}
// 弹窗展示
this.maskShow = true
},
......
......@@ -64,5 +64,7 @@
}
.input-item{
background: #F4F5F7;
border-radius: 12rpx;
padding-left: 20rpx;
}
</style>
......@@ -27,7 +27,7 @@
<view class="line-view"></view>
<view class="reason-view" v-if="showReason"><text class="reason-text">未通过原因:</text>
<text>{{orderData.auditResults.remark}}</text>
<text v-for="(item, index) in orderData.auditResults" :key="index">{{item}}</text>
</view>
<view class="bottom-view">
<view>
......
......@@ -61,8 +61,8 @@
if(!photo.tempPath){
return
}
let path = ''
if(photo.tempPath.origin && photo.waterSetting && photo.waterSetting.has_origin){
let path = ''
if(photo.tempPath.origin){
// 保存原图到本地
path = photo.tempPath.origin
let result = await this.saveLocal(path)
......@@ -73,18 +73,18 @@
})
}
}
// if(photo.currentItem){
// photo.currentItem.imageList.unshift(photo.tempPath.mixWater)
// }
if(photo.currentItem){
photo.currentItem.imageList.unshift(photo.tempPath.mixWater)
}
// if(photo.productList && photo.productList[photo.topIndex]){
// const topArr = photo.productList[photo.topIndex]
// if(topArr[photo.itemIndex]){
// topArr[photo.itemIndex].imageList.push(photo.tempPath.mixWater)
// }
// }
// photo.
if(photo.tempPath.mixWater){
// photo.
if(photo.tempPath.mixWater){
// 保存水印处理图片到本地
path = photo.tempPath.mixWater
let result1 = await this.saveLocal(path)
......@@ -125,7 +125,7 @@
photo.currentItemLength = 10
this.continuePhoto()
// 完成本项
this.$emit('finish')
//this.$emit('finish')
},
// 确认图片
continuePhoto() {
......@@ -139,7 +139,7 @@
},
submitFile() {
const photo = getApp().globalData.photo
photo.currentItemLength = photo.currentItemLength + 1
if (photo.currentItemLength < 10) photo.currentItemLength = photo.currentItemLength + 1
uni.hideLoading()
// 当前项的图片显示
// 拍照项张数目增加 等于10张
......
<template>
<template>
<view class="backView">
<u-navbar title="设置" :title-size="26" title-color="#000" :custom-back="backTake"></u-navbar>
<view class="shadowBackView" style="background-color: transparent;z-index: 1" v-if="loading">
<u-loading style="position: fixed;top: 50%;" :show="loading" size="36" mode="flower"></u-loading>
</view>
<view class="itemView firstItem">
<view class="itemTitleView">
<text class="itemTitle">保存原图</text>
<text class="itemNotice">拍照后另保存一张无水印的图片</text>
</view>
<switch class="itemSwitch" :checked="result['has_origin']" @change="handleOrigineChange" color="#007AFF" />
</view>
<view class="itemView" v-if="showTitleSwitch">
<view class="itemTitleView" @click="itemClick({},-1)">
<text class="itemTitle">水印标题</text>
<text class="itemNotice">{{result['lower_right']['title_text'] || '点击可编辑更改'}}</text>
</view>
<switch class="itemSwitch" disabled :checked="result['lower_right']['title_text'] != ''"
@click="handleClickTitleSwitch" color="#007AFF" />
</view>
<view class="itemView" v-for="(item,ikey) in itemList" :key="ikey">
<view class="itemTitleView" @click="itemClick(item,ikey)">
<text class="itemTitle">{{item['watemark_text'] || '自定义' + (ikey + 1)}}</text>
<text class="itemNotice">{{item['watemark_value'] || '点击可编辑更改'}}</text>
</view>
<switch class="itemSwitch" :checked="item['enable']" @change="itemChange(item, ikey)" color="#007AFF" />
</view>
<u-popup border-radius="10" v-model="isPopShow" safe-area-inset-bottom :mask-close-able="false" mode="center"
width="690rpx" height="600rpx" @close="handlePopClose">
<view class="popCenterView">
<text class="popTitle">设置自定义项</text>
<view class="inputBackView">
<view class="ph-pop-left-view">
<view class="leftInputView">
<input class="leftInput" type="text" v-model="currenItem['watemark_text']"
@input="leftInput()" :disabled="currenItem.type === 'title_text'" placeholder="请输入"
maxlength="10" />
</view>
<view class="ph-pop-tip-view" v-if="showTipLeft">*必填项</view>
</view>
<view class="ph-pop-mid-view">:</view>
<view>
<view class="rightInputView">
<input class="rightInput" type="text" v-model="currenItem['watemark_value']"
@input="rightInput()" placeholder="请输入内容" maxlength="30" />
</view>
<view class="ph-pop-tip-view" v-if="showTipRight">*必填项</view>
</view>
</view>
<text class="popNoticeText u-m-t-20">示例:</text>
<text class="popNoticeText">工程队名称:蓝天工程队</text>
<view class="popBtnView">
<u-button :custom-style="customStyleCancel" hover-class="none" shape="circle" type="primary" @click="popCancelClick()">
取消
</u-button>
<u-button :custom-style="customStyleSave" shape="circle" type="primary" @click="popSaveClick()">
保存
</u-button>
</view>
</view>
</u-popup>
</view>
</template>
<script>
export default {
data() {
return {
systemId: '',
isSaveOrigine: true,
isPopShow: false,
icon_close_new: '',
result: {
has_origin: true,
lower_right: {
body: []
}
},
currenItem: {
'watemark_text': '',
'watemark_value': ''
},
editingItem: {},
showTipLeft: false,
showTipRight: false,
loading: true
}
},
computed: {
itemList() {
if (this.result['lower_right']) {
var arr = this.result['lower_right']['body']
return arr.filter((item) => {
return item.watemark_type === '备注'
})
} else {
return []
}
},
showTitleSwitch() {
return this.result['lower_right'].hasOwnProperty('title_text')
},
customStyleCancel() {
return {
'background-color': '#D1D4D4',
'width': '280rpx',
'height': '96rpx'
}
},
customStyleSave() {
return {
'background-color': '##2272FF',
'width': '280rpx',
'height': '96rpx',
'margin-left': '50rpx'
}
}
},
created(e) {
getApp().trackPage('水印设置页')
const globalData = getApp().globalData
this.icon_close_new = globalData.icon_close_new
this.systemId = globalData.photo.currentItem.systemId
this.getItemList()
},
methods: {
<u-navbar title="设置" :title-size="26" title-color="#000" :custom-back="backTake"></u-navbar>
<view class="shadowBackView" style="background-color: transparent;z-index: 1" v-if="loading">
<u-loading style="position: fixed;top: 50%;" :show="loading" size="36" mode="flower"></u-loading>
</view>
<view class="itemView firstItem">
<view class="itemTitleView">
<text class="itemTitle">保存原图</text>
<text class="itemNotice">拍照后另保存一张无水印的图片</text>
</view>
<switch class="itemSwitch" :checked="result['hasOrigin']" @change="handleOrigineChange" color="#007AFF" />
</view>
<view class="itemView" v-if="showTitleSwitch">
<view class="itemTitleView" @click="itemClick({},-1)">
<text class="itemTitle">水印标题</text>
<text class="itemNotice">{{result['lowerLeft']['title'] || '点击可编辑更改'}}</text>
</view>
<switch class="itemSwitch" disabled :checked="result['lowerLeft']['title'] != ''"
@click="handleClickTitleSwitch" color="#007AFF" />
</view>
<view class="itemView" v-for="(item,ikey) in itemList" :key="ikey">
<view class="itemTitleView" @click="itemClick(item,ikey)">
<text class="itemTitle">{{item['watemarkText'] || '自定义' + (ikey + 1)}}</text>
<text class="itemNotice">{{item['watemarkValue'] || '点击可编辑更改'}}</text>
</view>
<switch class="itemSwitch" :checked="item['enable']" @change="itemChange(item, ikey)" color="#007AFF" />
</view>
<u-popup border-radius="10" v-model="isPopShow" safe-area-inset-bottom :mask-close-able="false" mode="center"
width="690rpx" height="600rpx" @close="handlePopClose">
<view class="popCenterView">
<text class="popTitle">设置自定义项</text>
<view class="inputBackView">
<view class="ph-pop-left-view">
<view class="leftInputView">
<input class="leftInput" type="text" v-model="currenItem['watemarkText']"
@input="leftInput()" :disabled="currenItem.type === '备注'" placeholder="请输入"
maxlength="10" />
</view>
<view class="ph-pop-tip-view" v-if="showTipLeft">*必填项</view>
</view>
<view class="ph-pop-mid-view">:</view>
<view>
<view class="rightInputView">
<input class="rightInput" type="text" v-model="currenItem['watemarkValue']"
@input="rightInput()" placeholder="请输入内容" maxlength="30" />
</view>
<view class="ph-pop-tip-view" v-if="showTipRight">*必填项</view>
</view>
</view>
<text class="popNoticeText u-m-t-20">示例:</text>
<text class="popNoticeText">工程队名称:蓝天工程队</text>
<view class="popBtnView">
<u-button :custom-style="customStyleCancel" hover-class="none" shape="circle" type="primary" @click="popCancelClick()">
取消
</u-button>
<u-button :custom-style="customStyleSave" shape="circle" type="primary" @click="popSaveClick()">
保存
</u-button>
</view>
</view>
</u-popup>
</view>
</template>
<script>
export default {
data() {
return {
systemId: '',
isSaveOrigine: true,
isPopShow: false,
icon_close_new: '',
result: {
hasOrigin: true,
lowerLeft: {
body: []
}
},
currenItem: {
'watemarkText': '',
'watemarkValue': ''
},
editingItem: {},
showTipLeft: false,
showTipRight: false,
loading: true
}
},
computed: {
itemList() {
console.log(this.result)
if (this.result['lowerLeft']) {
var arr = this.result['lowerLeft']['body']
return arr.filter((item) => {
return item.watemarkType === '备注'
})
} else {
return []
}
},
showTitleSwitch() {
return this.result['lowerLeft'].hasOwnProperty('title')
},
customStyleCancel() {
return {
'background-color': '#D1D4D4',
'width': '280rpx',
'height': '96rpx'
}
},
customStyleSave() {
return {
'background-color': '##2272FF',
'width': '280rpx',
'height': '96rpx',
'margin-left': '50rpx'
}
}
},
created(e) {
getApp().trackPage('水印设置页')
const globalData = getApp().globalData
this.icon_close_new = globalData.icon_close_new
this.systemId = globalData.photo.currentItem.partnerCompanyId
this.getItemList()
},
methods: {
getItemList: function() {
// this.systemId = '79550af260555cc20afb34156c94b32c' // 测试数据
this.loading = true
this.$u.api.getUserWatermark({
'token': this.vuex_token,
'system_id': this.systemId
}).then(res => {
if (res && res.result) {
if(res.result.error_code){
uni.showToast({title: res.result.error_msg})
}else{
this.result = res.result
}
}else{
uni.showToast({title: '网络异常'})
}
this.loading = false
})
},
saveUserWatermark: function() {
this.loading = true
this.$u.api.saveUserWatermark({
'token': this.vuex_token,
'watermark': this.result
}).then(res => {
if (res.result.code == true) {
const photo = getApp().globalData.photo
photo.waterSetting = this.result
}else{
uni.showToast({title: res.result.msg})
}
this.loading = false
})
},
//保存原图 开关
handleOrigineChange: function(e) {
this.result['has_origin'] = !this.result['has_origin']
this.saveUserWatermark()
},
handleClickTitleSwitch: function(e) {
var string = this.result['lower_right']['title_text'] ? '水印标题不可关闭' : '请先编辑该自定义项'
uni.showToast({
icon: 'none',
title: string
})
},
//自定义 开关
itemChange: function(item, ikey) {
if (item['watemark_value']) {
// 修改
item['enable'] = !item['enable']
this.saveUserWatermark()
} else {
uni.showToast({
icon: 'none',
title: '请先编辑该自定义项'
})
}
},
//自定义 点击
itemClick: function(item, ikey) {
if (ikey === -1) {
this.currenItem = {
'watemark_text': '水印标题',
'watemark_value': this.result['lower_right']['title_text'],
'type': 'title_text'
}
} else {
this.editingItem = item
this.currenItem = {
...item
}
}
this.isPopShow = true
},
//左侧输入框
leftInput: function(e) {
if (this.currenItem['watemark_text']) {
this.showTipLeft = false
}
},
//右侧输入框
rightInput: function(e) {
if (this.currenItem['watemark_value']) {
this.showTipRight = false
}
},
//自定义弹窗 关闭
popCancelClick: function() {
this.isPopShow = false
this.currenItem = {
'watemark_text': '',
'watemark_value': ''
}
},
handlePopClose() {
this.showTipLeft = false,
this.showTipRight = false
},
this.$u.api.getWatermark({partnerCompanyId:this.systemId}).then(res => {
if (res.code == 200) {
this.result = res.data
} else {
uni.showToast({title: res.data.message})
}
this.loading = false
})
},
saveUserWatermark: function() {
this.loading = true
this.$u.api.saveWatermark(this.result).then(res=>{
if(res.code === 200){
uni.showToast({title:'保存成功'})
getApp().globalData.photo.waterSetting = this.result
this.$emit("changeWatermark", this.result);
}else{
uni.showToast({title: res.message})
}
this.loading = false
})
},
//保存原图 开关
handleOrigineChange: function(e) {
this.result['hasOrigin'] = !this.result['hasOrigin']
this.saveUserWatermark()
},
handleClickTitleSwitch: function(e) {
var string = this.result['lowerLeft']['title'] ? '水印标题不可关闭' : '请先编辑该自定义项'
uni.showToast({
icon: 'none',
title: string
})
},
//自定义 开关
itemChange: function(item, ikey) {
if (item['watemarkValue']) {
// 修改
item['enable'] = !item['enable']
this.saveUserWatermark()
} else {
uni.showToast({
icon: 'none',
title: '请先编辑该自定义项'
})
}
},
//自定义 点击
itemClick: function(item, ikey) {
if (ikey === -1) {
this.currenItem = {
'watemarkText': '水印标题',
'watemarkValue': this.result['lowerLeft']['title'],
'type': '备注'
}
} else {
this.editingItem = item
this.currenItem = {
...item
}
}
this.isPopShow = true
},
//左侧输入框
leftInput: function(e) {
if (this.currenItem['watemarkText']) {
this.showTipLeft = false
}
},
//右侧输入框
rightInput: function(e) {
if (this.currenItem['watemarkValue']) {
this.showTipRight = false
}
},
//自定义弹窗 关闭
popCancelClick: function() {
this.isPopShow = false
this.currenItem = {
'watemarkText': '',
'watemarkValue': ''
}
},
handlePopClose() {
this.showTipLeft = false,
this.showTipRight = false
},
backTake() {
this.$emit('changeType', 1)
},
//自定义弹窗 保存
popSaveClick: function() {
if (this.currenItem['watemark_text'] && this.currenItem['watemark_value']) {
this.isPopShow = false
if (this.currenItem.type === 'title_text') {
this.result['lower_right']['title_text'] = this.currenItem['watemark_value']
} else {
this.editingItem['watemark_text'] = this.currenItem['watemark_text']
this.editingItem['watemark_value'] = this.currenItem['watemark_value']
this.editingItem['enable'] = true
}
this.saveUserWatermark()
} else {
// 提示
if (!this.currenItem['watemark_text']) {
this.showTipLeft = true
}
if (!this.currenItem['watemark_value']) {
this.showTipRight = true
}
}
}
}
}
</script>
<style>
.backView {
background-color: #FAFAFA;
position: absolute;
top: 0;
left: 0;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
/*
.firstItemView{
background-color: #FFFFFF;
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding-top: 80rpx;
padding-bottom: 80rpx;
border-bottom: 2rpx solid #F4F5F7;
} */
.itemView {
background-color: #FFFFFF;
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding-top: 54rpx;
padding-bottom: 54rpx;
}
.itemView.firstItem {
border-bottom: 2rpx solid #F4F5F7;
}
.itemTitleView {
background-color: #FFFFFF;
width: 80%;
display: flex;
flex-direction: column;
padding-left: 30rpx;
}
.itemTitle {
font-size: 32rpx;
font-weight: bold;
color: #333333;
}
.itemNotice {
font-size: 26rpx;
color: #666666;
margin-top: 4rpx;
}
.itemSwitch {
margin-right: 30rpx;
transform: scale(0.78, 0.75);
}
.shadowBackView {
background-color: rgba(0, 0, 0, 0.5);
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.popCenterView {
background-color: #FFFFFF;
display: flex;
flex-direction: column;
}
.popTitle {
font-size: 36rpx;
font-weight: bold;
margin-top: 50rpx;
padding-left: 30rpx;
}
.inputBackView {
margin-top: 52rpx;
width: 100%;
height: 90rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
display: flex;
align-items: flex-start;
}
.leftInputView {
width: 220rpx;
height: 72rpx;
border: 2rpx solid #666666;
display: flex;
align-items: center;
justify-content: center;
}
.leftInput {
width: 180rpx;
height: 32rpx;
}
.ph-pop-left-view {
margin-left: 30rpx;
}
.ph-pop-tip-view {
color: #F56C6C;
}
.ph-pop-mid-view {
margin-top: 20rpx;
}
.rightInputView {
width: 360rpx;
height: 72rpx;
border: 2rpx solid #666666;
margin-right: 30rpx;
display: flex;
align-items: center;
justify-content: center;
}
.rightInput {
width: 320rpx;
height: 32rpx;
}
.popNoticeText {
font-size: 26rpx;
color: #666666;
padding-left: 30rpx;
}
.popBtnView {
margin-top: 110rpx;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
}
/* .popCancelBtn {
background-color: #D1D4D4;
width: 280rpx;
height: 96rpx;
border-radius: 48rpx;
margin-left: 40rpx;
display: flex;
align-items: center;
justify-content: center;
} */
/* .popSaveBtn {
background-color: #2272FF;
width: 280rpx;
height: 96rpx;
border-radius: 48rpx;
margin-right: 40rpx;
display: flex;
align-items: center;
justify-content: center;
} */
/* .popBtnText {
font-size: 32rpx;
color: #FFFFFF;
font-weight: 600;
} */
</style>
},
//自定义弹窗 保存
popSaveClick: function() {
if (this.currenItem['watemarkText'] && this.currenItem['watemarkValue']) {
this.isPopShow = false
if (this.currenItem.type === '备注') {
this.result['lowerLeft']['title'] = this.currenItem['watemarkValue']
} else {
this.editingItem['watemarkText'] = this.currenItem['watemarkText']
this.editingItem['watemarkValue'] = this.currenItem['watemarkValue']
this.editingItem['enable'] = true
}
this.saveUserWatermark()
} else {
// 提示
if (!this.currenItem['watemarkText']) {
this.showTipLeft = true
}
if (!this.currenItem['watemarkValue']) {
this.showTipRight = true
}
}
}
}
}
</script>
<style>
.backView {
background-color: #FAFAFA;
position: absolute;
top: 0;
left: 0;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
/*
.firstItemView{
background-color: #FFFFFF;
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding-top: 80rpx;
padding-bottom: 80rpx;
border-bottom: 2rpx solid #F4F5F7;
} */
.itemView {
background-color: #FFFFFF;
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding-top: 54rpx;
padding-bottom: 54rpx;
}
.itemView.firstItem {
border-bottom: 2rpx solid #F4F5F7;
}
.itemTitleView {
background-color: #FFFFFF;
width: 80%;
display: flex;
flex-direction: column;
padding-left: 30rpx;
}
.itemTitle {
font-size: 32rpx;
font-weight: bold;
color: #333333;
}
.itemNotice {
font-size: 26rpx;
color: #666666;
margin-top: 4rpx;
}
.itemSwitch {
margin-right: 30rpx;
transform: scale(0.78, 0.75);
}
.shadowBackView {
background-color: rgba(0, 0, 0, 0.5);
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.popCenterView {
background-color: #FFFFFF;
display: flex;
flex-direction: column;
}
.popTitle {
font-size: 36rpx;
font-weight: bold;
margin-top: 50rpx;
padding-left: 30rpx;
}
.inputBackView {
margin-top: 52rpx;
width: 100%;
height: 90rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
display: flex;
align-items: flex-start;
}
.leftInputView {
width: 220rpx;
height: 72rpx;
border: 2rpx solid #666666;
display: flex;
align-items: center;
justify-content: center;
}
.leftInput {
width: 180rpx;
height: 32rpx;
}
.ph-pop-left-view {
margin-left: 30rpx;
}
.ph-pop-tip-view {
color: #F56C6C;
}
.ph-pop-mid-view {
margin-top: 20rpx;
}
.rightInputView {
width: 360rpx;
height: 72rpx;
border: 2rpx solid #666666;
margin-right: 30rpx;
display: flex;
align-items: center;
justify-content: center;
}
.rightInput {
width: 320rpx;
height: 32rpx;
}
.popNoticeText {
font-size: 26rpx;
color: #666666;
padding-left: 30rpx;
}
.popBtnView {
margin-top: 110rpx;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
}
/* .popCancelBtn {
background-color: #D1D4D4;
width: 280rpx;
height: 96rpx;
border-radius: 48rpx;
margin-left: 40rpx;
display: flex;
align-items: center;
justify-content: center;
} */
/* .popSaveBtn {
background-color: #2272FF;
width: 280rpx;
height: 96rpx;
border-radius: 48rpx;
margin-right: 40rpx;
display: flex;
align-items: center;
justify-content: center;
} */
/* .popBtnText {
font-size: 32rpx;
color: #FFFFFF;
font-weight: 600;
} */
</style>
<template>
<view class="camera">
<view class="camera-container" v-if="showType === 1">
<cover-view class="header-box" :style="{'height':navHeight/2 + 'px'}">
<cover-view class="inner">
<cover-image @click="setCameraInfo('devicePosition')" class="icon" mode="aspectFit"
src="/static/photo/icon-switch.png"></cover-image>
<cover-image @click="setCameraInfo('flash')" class="icon" mode="aspectFit"
:src="'/static/photo/icon-light-' + cameraInfo.flash +'.png'"></cover-image>
<cover-image v-if="currentItem.system_id" @click="changeType(3)" class="icon" mode="aspectFit"
src="/static/photo/icon-setting.png"></cover-image>
</cover-view>
</cover-view>
<camera class="camera-box" v-if="cameraChange&&!standardShow" :device-position="cameraInfo.devicePosition"
:flash="cameraInfo.flash" :style="{'height':cameraHeight/2 + 'px','top':parseInt(navHeight/2) + 'px'}"
@error="cameraError">
<cover-view class="mark-box">
<cover-view class="txt big" v-if="titleTxt">{{titleTxt}}</cover-view>
<cover-view class="txt" v-for="(txt,index) in settingTxtArr" :key="index">{{txt || '获取中'}}</cover-view>
<!-- <cover-view class="txt u-m-t-10">维度:{{waterInfo.latitude || '正在获取中...'}}</cover-view>
<cover-view class="txt u-m-t-10">地址:{{waterInfo.address || '正在获取中...'}}</cover-view>
<cover-view class="txt u-m-t-10">时间:{{waterInfo.date || '正在获取中...'}}</cover-view> -->
</cover-view>
<cover-image class="mark-water" mode="aspectFit" :src="waterInfo.markImage"></cover-image>
</camera>
<cover-view class="bottom-box" v-if="!standardShow">
<cover-image class="icon" src='/static/photo/icon-back.png' mode="" @click="goBack"></cover-image>
<cover-image class='icon-take icon' src='/static/photo/icon-take.png' @click="$u.debounce(takePhoto, 500)"> </cover-image>
<view class="camera">
<view class="camera-container" v-if="showType === 1">
<cover-view class="header-box" :style="{'height':navHeight/2 + 'px'}">
<cover-view class="inner">
<cover-image @click="setCameraInfo('devicePosition')" class="icon" mode="aspectFit"
src="/static/photo/icon-switch.png"></cover-image>
<cover-image @click="setCameraInfo('flash')" class="icon" mode="aspectFit"
:src="'/static/photo/icon-light-' + cameraInfo.flash +'.png'"></cover-image>
<cover-image v-if="currentItem.partnerCompanyId" @click="changeType(3)" class="icon" mode="aspectFit"
src="/static/photo/icon-setting.png"></cover-image>
</cover-view>
</cover-view>
<camera class="camera-box" v-if="cameraChange&&!standardShow" :device-position="cameraInfo.devicePosition"
:flash="cameraInfo.flash" :style="{'height':cameraHeight/2 + 'px','top':parseInt(navHeight/2) + 'px'}"
@error="cameraError">
<cover-view class="mark-box">
<cover-view class="txt big" v-if="titleTxt">{{titleTxt}}</cover-view>
<cover-view class="txt" v-for="(txt,index) in settingTxtArr" :key="index">{{txt || '获取中'}}</cover-view>
<!-- <cover-view class="txt u-m-t-10">维度:{{waterInfo.latitude || '正在获取中...'}}</cover-view>
<cover-view class="txt u-m-t-10">地址:{{waterInfo.address || '正在获取中...'}}</cover-view>
<cover-view class="txt u-m-t-10">时间:{{waterInfo.date || '正在获取中...'}}</cover-view> -->
</cover-view>
<cover-image class="mark-water" mode="aspectFit" :src="waterInfo.markImage"></cover-image>
</camera>
<cover-view class="bottom-box" v-if="!standardShow">
<cover-image class="icon" src='/static/photo/icon-back.png' mode="" @click="goBack"></cover-image>
<cover-image class='icon-take icon' src='/static/photo/icon-take.png' @click="$u.debounce(takePhoto, 500)"> </cover-image>
<cover-image class='icon' src='/static/photo/icon-standard.png' @click="standardShow = true" v-if="standardStatus"> </cover-image>
<view class='icon' v-else></view>
</cover-view>
<canvas canvas-id="canvas" id="photoCanvas" class="canvas"
:style="{'width':750 + 'rpx','height': cameraHeight + 'rpx'}"></canvas>
<view v-show="standardShow" class="page-mask" :z-index="10000">
<photo-standard :currentItem="currentItem" />
<view class="btn-close">
<image @click="closeShadow" class="icon icon-close" mode="aspectFit" src="/static/photo/icon-close.png"></image>
</view>
</view>
<view class='icon' v-else></view>
</cover-view>
<canvas canvas-id="canvas" id="photoCanvas" class="canvas"
:style="{'width':750 + 'rpx','height': cameraHeight + 'rpx'}"></canvas>
<view v-show="standardShow" class="page-mask" :z-index="10000">
<photo-standard :currentItem="currentItem" />
<view class="btn-close">
<image @click="closeShadow" class="icon icon-close" mode="aspectFit" src="/static/photo/icon-close.png"></image>
</view>
</view>
</view>
<photo-preview v-if="showType === 2" @changeType="changeType" @finish="finish" />
<photo-setting v-if="showType === 3" @changeType="changeType" />
</view>
<photo-setting v-if="showType === 3" @changeType="changeType" @changeWatermark="changeWatermark"/>
</view>
</template>
<script>
let r = require("@/libs/bmap-wx.min.js");
let h = new r.BMapWX({
// ak: "rpVq5d3yxaRCoKzVwmFMo0o4iC524CAG",
ak: "iXsGdyEcm1iQONoUPyEp0hrBTLCuOaW2"
});
<script>
let r = require("@/libs/bmap-wx.min.js");
let h = new r.BMapWX({
// ak: "rpVq5d3yxaRCoKzVwmFMo0o4iC524CAG",
ak: "iXsGdyEcm1iQONoUPyEp0hrBTLCuOaW2"
});
import standard from '@/components/photo/standard.vue'
import preview from '@/components/photo/preview.vue'
import setting from '@/components/photo/setting.vue'
import setting from '@/components/photo/setting.vue'
export default {
props: {
currentItem: { // 对应的规范item
......@@ -66,417 +66,420 @@
}
}
}
},
components: {
},
components: {
'photo-standard': standard,
'photo-preview': preview,
'photo-setting': setting,
},
data() {
'photo-setting': setting,
},
data() {
return {
showType: 1,
standardShow: false,
cameraInfo: {
devicePosition: 'back',
flash: 'auto'
},
waterInfo: {
longitude: '', // 经度
latitude: '', // 维度
address: '', //地址
date: '', //日期
markImage: 'https://qn-static.banshouhui.com/live_mark.png'
},
tempImgs: {
'markImage': '', // 拍照水印
'origin': '', // 无水印照片
'mixWater': '', // 有水印照片
},
authSetting: {
camera: false, // 相机授权
location: false, // 位置授权
},
navHeight: 130,
cameraWidth: 750,
cameraHeight: 1000, // (4 / 3 * 750) 图片比例4:3
ratio: 0,
cameraChange: false,
waterSetting: null,
showType: 1,
standardShow: false,
cameraInfo: {
devicePosition: 'back',
flash: 'auto'
},
waterInfo: {
longitude: '', // 经度
latitude: '', // 维度
address: '', //地址
date: '', //日期
markImage: 'https://qn-static.banshouhui.com/live_mark.png'
},
tempImgs: {
'markImage': '', // 拍照水印
'origin': '', // 无水印照片
'mixWater': '', // 有水印照片
},
authSetting: {
camera: false, // 相机授权
location: false, // 位置授权
},
navHeight: 130,
cameraWidth: 750,
cameraHeight: 1000, // (4 / 3 * 750) 图片比例4:3
ratio: 0,
cameraChange: false,
waterSetting: null,
shadowInitShow: false, // 第一次进入页面需显示弹窗
standardStatus: false // 是否显示拍照要求
}
},
standardStatus: false // 是否显示拍照要求
}
},
created(e) {
const photo = getApp().globalData.photo
const photo = getApp().globalData.photo
getApp().trackPage('拍照页')
photo.allImages = []
photo.currentItemLength = 0
// this.ctx = uni.createCameraContext();
this.updateTime()
this.getLocation()
this.getMarkPath()
this.initData()
photo.currentItemLength = 0
// this.ctx = uni.createCameraContext();
this.updateTime()
this.getLocation()
this.getMarkPath()
this.initData()
photo.currentItem = this.currentItem
if (this.currentItem.images.length > 0) {
this.shadowInitShow = true
this.standardShow = true
this.standardStatus = true
}
},
computed: {
titleTxt() {
const waterSetting = this.waterSetting
let txt = ''
if (!waterSetting || !waterSetting.lower_right) {
return ''
}
txt = waterSetting.lower_right && waterSetting.lower_right.title_text || ''
return txt
},
settingTxtArr() {
let arr = []
// 包含经纬度
const waterInfo = this.waterInfo
arr = ['经度:' + waterInfo.longitude, '纬度:' + waterInfo.latitude, '地址:' + waterInfo.address, '时间:' +
waterInfo.date
]
let settingTxtArr = []
const typeArr = ['经度', '纬度', '地址', '时间']
const waterSetting = this.waterSetting
if (!waterSetting || !waterSetting.lower_right || !waterSetting.lower_right.body) {
return arr
}
const settingArr = waterSetting.lower_right.body
settingArr.map(item => {
const idx = typeArr.indexOf(item.watemark_type)
if (item.enable && (idx > -1 || (item.watemark_value && item.watemark_text))) {
if (idx > -1) {
settingTxtArr.push(arr[idx])
} else {
settingTxtArr.push(item.watemark_text + ':' + item.watemark_value)
}
}
})
return settingTxtArr
}
},
watch: {},
mounted() {
// 默认开启弹窗
const photo = getApp().globalData.photo
this.waterSetting = photo.waterSetting
this.standardShow = this.shadowInitShow
this.cameraChange = true
// this.initData()
},
destroyed(){
this.cameraChange = false
},
methods: {
closeShadow() {
this.shadowInitShow = false
this.standardShow = false
},
},
computed: {
titleTxt() {
const waterSetting = this.waterSetting
let txt = ''
if (!waterSetting || !waterSetting.lowerLeft) {
return ''
}
txt = waterSetting.lowerLeft && waterSetting.lowerLeft.title || ''
return txt
},
settingTxtArr() {
let arr = []
// 包含经纬度
const waterInfo = this.waterInfo
arr = ['经度:' + waterInfo.longitude, '纬度:' + waterInfo.latitude, '地址:' + waterInfo.address, '时间:' +
waterInfo.date
]
let settingTxtArr = []
const typeArr = ['经度', '纬度', '地址', '时间']
const waterSetting = this.waterSetting
if (!waterSetting || !waterSetting.lowerLeft || !waterSetting.lowerLeft.body) {
return arr
}
const settingArr = waterSetting.lowerLeft.body
settingArr.map(item => {
const idx = typeArr.indexOf(item.watemarkType)
if (item.enable && (idx > -1 || (item.watemarkValue && item.watemarkText))) {
if (idx > -1) {
settingTxtArr.push(arr[idx])
} else {
settingTxtArr.push(item.watemarkText + ':' + item.watemarkValue)
}
}
})
return settingTxtArr
}
},
watch: {},
mounted() {
// 默认开启弹窗
const photo = getApp().globalData.photo
this.waterSetting = photo.waterSetting
this.standardShow = this.shadowInitShow
this.cameraChange = true
// this.initData()
},
destroyed(){
this.cameraChange = false
},
methods: {
closeShadow() {
this.shadowInitShow = false
this.standardShow = false
},
goBack() {
uni.showTabBar()
this.$emit('close')
this.$emit('close')
},
finish() {
uni.showTabBar()
const photo = getApp().globalData.photo
this.$emit('close', photo.allImages)
},
changeType(type) {
this.showType = type
},
updateTime() {
this.waterInfo.date = this.getTime()
// let timer = setTimeout(() => {
// clearTimeout(timer);
// this.updateTime()
// }, 1000)
},
setCameraInfo(type) {
// 设置相机前置后置、闪关灯等
const cameraInfo = this.cameraInfo
let val = cameraInfo[type]
switch (type) {
case 'devicePosition':
val = val === 'back' ? 'front' : 'back'
break;
case 'flash':
val = val === 'auto' ? 'on' : (val === 'on' ? 'off' : 'auto')
break;
defalut:
break;
}
this.cameraInfo[type] = val
},
initData() {
const globalData = getApp().globalData
this.navHeight = globalData.navHeight
this.cameraHeight = parseInt(globalData.safeHeight*2 - globalData.navHeight - 200)
this.ratio = globalData.screenHeight / globalData.rpxScreenHeight
this.waterSetting = globalData.photo.waterSetting
},
baiduLocation() {
// 百度sdk解析经纬度
},
changeType(type) {
this.showType = type
},
changeWatermark(watermark){
this.waterSetting = watermark
},
updateTime() {
this.waterInfo.date = this.getTime()
// let timer = setTimeout(() => {
// clearTimeout(timer);
// this.updateTime()
// }, 1000)
},
setCameraInfo(type) {
// 设置相机前置后置、闪关灯等
const cameraInfo = this.cameraInfo
let val = cameraInfo[type]
switch (type) {
case 'devicePosition':
val = val === 'back' ? 'front' : 'back'
break;
case 'flash':
val = val === 'auto' ? 'on' : (val === 'on' ? 'off' : 'auto')
break;
defalut:
break;
}
this.cameraInfo[type] = val
},
initData() {
const globalData = getApp().globalData
this.navHeight = globalData.navHeight
this.cameraHeight = parseInt(globalData.safeHeight*2 - globalData.navHeight - 200)
this.ratio = globalData.screenHeight / globalData.rpxScreenHeight
this.waterSetting = globalData.photo.waterSetting
},
baiduLocation() {
// 百度sdk解析经纬度
let waterInfo = this.waterInfo
const t = function() {
let t = {
const t = function() {
let t = {
success: function(res) {
let e = res.wxMarkerData[0];
let i = e.address;
waterInfo.address = i
},
fail: function(err) {
//console.log(err, 'err')
}
};
if (waterInfo.latitude && waterInfo.longitude) {
let e = waterInfo.latitude + "," + waterInfo.longitude;
t.location = e;
}
h.regeocoding(t);
};
t()
},
cameraError(e) {
const {
errMsg
} = e.detail
// console.log(e.detail, 'e.detail')
if (errMsg !== 'insertCamera:fail auth deny') {
return
}
this.showSettingModal('camera')
},
//获取位置
getLocation() {
let that = this
let e = res.wxMarkerData[0];
let i = e.address;
waterInfo.address = i
},
fail: function(err) {
//console.log(err, 'err')
}
};
if (waterInfo.latitude && waterInfo.longitude) {
let e = waterInfo.latitude + "," + waterInfo.longitude;
t.location = e;
}
h.regeocoding(t);
};
t()
},
cameraError(e) {
const {
errMsg
} = e.detail
// console.log(e.detail, 'e.detail')
if (errMsg !== 'insertCamera:fail auth deny') {
return
}
this.showSettingModal('camera')
},
//获取位置
getLocation() {
let that = this
const waterInfo = this.waterInfo
uni.getLocation({
type: 'gcj02',
success: function(res) {
waterInfo.longitude = parseFloat(res.longitude).toFixed(4)
waterInfo.latitude = parseFloat(res.latitude).toFixed(3)
that.baiduLocation()
},
fail(err) {
that.showSettingModal('location')
// that.showLocationAuthModal('')
}
});
},
showSettingModal(type) {
type = type || 'camera'
const self = this
let authSetting = {
'camera': {
content: '将无法进行拍照',
method: ''
},
'location': {
content: '将无法定位当前位置',
method: ''
},
'writePhotosAlbum': {
content: '将无法保存图片到本地',
method: ''
}
}
let content = authSetting[type].content
uni.showModal({
content: '拒绝授权' + content + ',是否去设置打开?',
confirmText: "确认",
cancelText: '取消',
success(res) {
if (res.confirm) {
self.openSetting()
}
},
fail() {}
})
},
openSetting() {
// 打开设置
let self = this
this.cameraChange = false
wx.openSetting({
success(res) {
const authSetting = res.authSetting
self.cameraChange = true
if (authSetting['scope.userLocation']) {
// 位置授权成功
self.authSetting.location = true
self.getLocation()
}
if (res.authSetting['scope.camera']) {
self.authSetting.camera = true
}
if (res.authSetting['scope.writePhotosAlbum']) {
self.authSetting.writePhotosAlbum = true
}
}
})
},
//获取 水印 本地缓存路径
getMarkPath: function() {
uni.downloadFile({
url: this.waterInfo.markImage, //仅为示例,并非真实的资源
success: (res) => {
if (res.statusCode === 200) {
this.tempImgs.markImage = res.tempFilePath
}
},
fail() {
console.log('水印图片 下载失败')
}
})
},
/* ---------------------- 拍照流程 ---------------------- */
// 第一步:拍照
takePhoto() {
wx.createCameraContext().takePhoto({
quality: "high"
}).then(res => {
this.tempImgs.origin = res.tempImagePath
this.drawCanvas(res.tempImagePath)
})
},
// 第二步:绘制画布
drawCanvas: function(tempPath) {
uni.showLoading({
title: '数据处理中...',
icon: 'loading'
})
const waterSetting = this.waterSetting
const globalTempPath = getApp().globalData.photo.tempPath
const ratio = this.ratio
console.log(this.ratio,'this.ratio')
// const ratio = 0.5
let canvasWidth = this.cameraWidth * ratio
let canvasHeight = this.cameraHeight * ratio
const waterInfo = this.waterInfo
uni.getLocation({
type: 'gcj02',
success: function(res) {
waterInfo.longitude = parseFloat(res.longitude).toFixed(4)
waterInfo.latitude = parseFloat(res.latitude).toFixed(3)
that.baiduLocation()
},
fail(err) {
that.showSettingModal('location')
// that.showLocationAuthModal('')
}
});
},
showSettingModal(type) {
type = type || 'camera'
const self = this
let authSetting = {
'camera': {
content: '将无法进行拍照',
method: ''
},
'location': {
content: '将无法定位当前位置',
method: ''
},
'writePhotosAlbum': {
content: '将无法保存图片到本地',
method: ''
}
}
let content = authSetting[type].content
uni.showModal({
content: '拒绝授权' + content + ',是否去设置打开?',
confirmText: "确认",
cancelText: '取消',
success(res) {
if (res.confirm) {
self.openSetting()
}
},
fail() {}
})
},
openSetting() {
// 打开设置
let self = this
this.cameraChange = false
wx.openSetting({
success(res) {
const authSetting = res.authSetting
self.cameraChange = true
if (authSetting['scope.userLocation']) {
// 位置授权成功
self.authSetting.location = true
self.getLocation()
}
if (res.authSetting['scope.camera']) {
self.authSetting.camera = true
}
if (res.authSetting['scope.writePhotosAlbum']) {
self.authSetting.writePhotosAlbum = true
}
}
})
},
//获取 水印 本地缓存路径
getMarkPath: function() {
uni.downloadFile({
url: this.waterInfo.markImage, //仅为示例,并非真实的资源
success: (res) => {
if (res.statusCode === 200) {
this.tempImgs.markImage = res.tempFilePath
}
},
fail() {
console.log('水印图片 下载失败')
}
})
},
/* ---------------------- 拍照流程 ---------------------- */
// 第一步:拍照
takePhoto() {
wx.createCameraContext().takePhoto({
quality: "high"
}).then(res => {
this.tempImgs.origin = res.tempImagePath
this.drawCanvas(res.tempImagePath)
})
},
// 第二步:绘制画布
drawCanvas: function(tempPath) {
uni.showLoading({
title: '数据处理中...',
icon: 'loading'
})
const waterSetting = this.waterSetting
const globalTempPath = getApp().globalData.photo.tempPath
const ratio = this.ratio
console.log(this.ratio,'this.ratio')
// const ratio = 0.5
let canvasWidth = this.cameraWidth * ratio
let canvasHeight = this.cameraHeight * ratio
const waterInfo = this.waterInfo
this.showImage = true
const settingTxtArr = this.settingTxtArr
//将原图画到canvas上面
let canvas = uni.createCanvasContext("canvas", this)
canvas.rect(0, 0, canvasWidth, canvasHeight)
canvas.drawImage(tempPath, 0, 0, canvasWidth, canvasHeight)
// this.canvas.draw()
let txtHeight = 18
let h = 1
//加入 水印文字
for (let i = settingTxtArr.length - 1; i >= 0; i--) {
txtHeight = 20
canvas.setFontSize(15)
canvas.setFillStyle('#f2f2f2')
let txt = settingTxtArr[i]
if(txt.indexOf('时间')>=0){
canvas.fillText(txt, 10, canvasHeight - txtHeight * h++);
}else{
if(txt.length>22){
canvas.fillText(txt.substr(22,22), 10, canvasHeight - txtHeight * h++);
canvas.fillText(txt.substr(0,22), 10, canvasHeight - txtHeight * h++);
}else{
canvas.fillText(txt, 10, canvasHeight - txtHeight * h++);
}
}
// canvas.fillText(txt, 10, canvasHeight - txtHeight * h++);
}
const title = this.titleTxt
if (title) {
canvas.save()
let titleHeight = title.length > 14 ? 60 : 30
let rectWidth = title.length > 14 ? 215 : title.length*10
canvas.setFillStyle('rgba(34, 114, 255, 0.6)')
canvas.fillRect(10, canvasHeight - txtHeight * h - titleHeight, 215, titleHeight)
canvas.restore()
canvas.setFontSize(20)
canvas.setFillStyle('#f2f2f2')
// canvas.setTextAlign('center')
if (title.length > 14) {
canvas.fillText(title.substr(14, 14), 10, canvasHeight - txtHeight * h++ + 20);
}
canvas.fillText(title.substr(0, 14), 10, canvasHeight - txtHeight * h++ - titleHeight / 2 + 10);
}
if (this.waterSetting && this.waterSetting.mid_text) {
//加入 水印图片
canvas.drawImage(this.tempImgs.markImage, canvasWidth / 2 - 100, canvasHeight / 2 - 25, 200, 50)
}
// canvas.drawImage(this.tempImgs.markImage, canvasWidth / 2 - 100, canvasHeight / 2 - 25, 200, 50)
canvas.draw(false,
setTimeout(() => {
uni.canvasToTempFilePath({
width: canvasWidth,
height: canvasHeight,
canvasId: 'canvas',
success: (res) => {
this.tempImgs.mixWater = res.tempFilePath
globalTempPath.origin = this.tempImgs.origin
globalTempPath.mixWater = res.tempFilePath
let timer = setTimeout(()=>{
this.showImage = true
const settingTxtArr = this.settingTxtArr
//将原图画到canvas上面
let canvas = uni.createCanvasContext("canvas", this)
canvas.rect(0, 0, canvasWidth, canvasHeight)
canvas.drawImage(tempPath, 0, 0, canvasWidth, canvasHeight)
// this.canvas.draw()
let txtHeight = 18
let h = 1
//加入 水印文字
for (let i = settingTxtArr.length - 1; i >= 0; i--) {
txtHeight = 20
canvas.setFontSize(15)
canvas.setFillStyle('#f2f2f2')
let txt = settingTxtArr[i]
if(txt.indexOf('时间')>=0){
canvas.fillText(txt, 10, canvasHeight - txtHeight * h++);
}else{
if(txt.length>22){
canvas.fillText(txt.substr(22,22), 10, canvasHeight - txtHeight * h++);
canvas.fillText(txt.substr(0,22), 10, canvasHeight - txtHeight * h++);
}else{
canvas.fillText(txt, 10, canvasHeight - txtHeight * h++);
}
}
// canvas.fillText(txt, 10, canvasHeight - txtHeight * h++);
}
const title = this.titleTxt
if (title) {
canvas.save()
let titleHeight = title.length > 14 ? 60 : 30
let rectWidth = title.length > 14 ? 215 : title.length*10
canvas.setFillStyle('rgba(34, 114, 255, 0.6)')
canvas.fillRect(10, canvasHeight - txtHeight * h - titleHeight, 215, titleHeight)
canvas.restore()
canvas.setFontSize(20)
canvas.setFillStyle('#f2f2f2')
// canvas.setTextAlign('center')
if (title.length > 14) {
canvas.fillText(title.substr(14, 14), 10, canvasHeight - txtHeight * h++ + 20);
}
canvas.fillText(title.substr(0, 14), 10, canvasHeight - txtHeight * h++ - titleHeight / 2 + 10);
}
if (this.waterSetting && this.waterSetting.mid_text) {
//加入 水印图片
canvas.drawImage(this.tempImgs.markImage, canvasWidth / 2 - 100, canvasHeight / 2 - 25, 200, 50)
}
// canvas.drawImage(this.tempImgs.markImage, canvasWidth / 2 - 100, canvasHeight / 2 - 25, 200, 50)
canvas.draw(false,
setTimeout(() => {
uni.canvasToTempFilePath({
width: canvasWidth,
height: canvasHeight,
canvasId: 'canvas',
success: (res) => {
this.tempImgs.mixWater = res.tempFilePath
globalTempPath.origin = this.tempImgs.origin
globalTempPath.mixWater = res.tempFilePath
let timer = setTimeout(()=>{
//this.goPage('/pages/photo/preview')
this.changeType(2)
},0)
// this.saveToLocal(res.tempFilePath)
},
fail: (res) => {
console.log(res);
},
complete: () => {
uni.hideLoading();
}
}, this);
}, 50))
},
// 第三步:保存到本地
saveToLocal(tempImagePath) {
//has_origin //是否保存原图
let that = this
uni.saveImageToPhotosAlbum({
filePath: tempImagePath,
success() {
uni.showToast({
icon: 'none',
title: '已将照片保存到本地相册'
})
},
fail() {}
})
},
showPreviewFn(img) {
uni.previewImage({
current: 0,
urls: [img]
});
},
//获取当前时间
getTime: function() {
let d = new Date();
let year = d.getFullYear();
let month = d.getMonth() + 1;
let date = d.getDate();
let days = new Array("日", "一", "二", "三", "四", "五", "六");
let day = d.getDay();
let hour = (d.getHours() < 10) ? ("0" + d.getHours()) : d.getHours();
let min = (d.getMinutes() < 10) ? ("0" + d.getMinutes()) : d.getMinutes();
let sec = (d.getSeconds() < 10) ? ("0" + d.getSeconds()) : d.getSeconds();
let now = year + "年" + month + "月" + date + "日 " + hour + ":" + min + ":" + sec;
return now
},
}
}
</script>
this.changeType(2)
},0)
// this.saveToLocal(res.tempFilePath)
},
fail: (res) => {
console.log(res);
},
complete: () => {
uni.hideLoading();
}
}, this);
}, 50))
},
// 第三步:保存到本地
saveToLocal(tempImagePath) {
//has_origin //是否保存原图
let that = this
uni.saveImageToPhotosAlbum({
filePath: tempImagePath,
success() {
uni.showToast({
icon: 'none',
title: '已将照片保存到本地相册'
})
},
fail() {}
})
},
showPreviewFn(img) {
uni.previewImage({
current: 0,
urls: [img]
});
},
//获取当前时间
getTime: function() {
let d = new Date();
let year = d.getFullYear();
let month = d.getMonth() + 1;
let date = d.getDate();
let days = new Array("日", "一", "二", "三", "四", "五", "六");
let day = d.getDay();
let hour = (d.getHours() < 10) ? ("0" + d.getHours()) : d.getHours();
let min = (d.getMinutes() < 10) ? ("0" + d.getMinutes()) : d.getMinutes();
let sec = (d.getSeconds() < 10) ? ("0" + d.getSeconds()) : d.getSeconds();
let now = year + "年" + month + "月" + date + "日 " + hour + ":" + min + ":" + sec;
return now
},
}
}
</script>
<style scoped lang="scss">
.camera {
position:fixed;
......@@ -487,148 +490,148 @@
width: 100%;
height: 100%;
z-index: 999999;
}
.camera-container {
// padding-top:var(--status-bar-height);
min-height: 100vh;
}
.camera-container {
// padding-top:var(--status-bar-height);
min-height: 100vh;
background-color: black;
}
.header-box {
// padding:10rpx 20rpx;
position: relative;
.inner {
display: flex;
position: absolute;
left: 0;
right: 0;
bottom: 0;
}
.icon {
margin: 20rpx;
display: block;
width: 44rpx;
height: 44rpx;
}
}
.camera-box {
position: absolute;
left:0;
width: 100%;
// height: 100vh;
z-index: 1;
}
.mark-water {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 360rpx;
height: 90rpx;
z-index: 6;
}
.mark-box {
position: absolute;
left: 0;
bottom: 0;
padding: 20rpx;
.txt {
max-width: 500rpx;
max-height: 80rpx;
overflow: hidden;
margin-top: 5rpx;
line-height: 40rpx;
white-space: normal;
font-size: 28rpx;
color: #fff;
&.big {
padding: 10rpx;
margin-bottom: 10rpx;
width: 430rpx;
line-height: 40rpx;
font-size: 32rpx;
background-color: rgba(34, 114, 255, 0.6);
}
}
}
.bottom-box {
position: absolute;
left: 0;
right: 0;
bottom:0;
// bottom: constant(safe-area-inset-bottom);
// bottom: env(safe-area-inset-bottom);
z-index: 5;
box-sizing: border-box;
height: 200rpx;
display: flex;
justify-content: space-between;
padding: 20rpx 78rpx;
align-items: center;
background-color: black;
.txt {
white-space: nowrap;
line-height: 60rpx;
color: #fff;
}
.icon {
display: block;
width: 92rpx;
height: 92rpx;
&.icon-take {
width: 144rpx;
height: 144rpx;
}
}
}
.canvas {
position: fixed;
left: -750rpx;
top: 0;
}
// 拍照规范
.page-mask {
position: fixed;
bottom: 0;
bottom: constant(safe-area-inset-bottom);
bottom: env(safe-area-inset-bottom);
z-index: 1000;
width: 750rpx;
height: 100vh;
// padding: 0 30rpx;
box-sizing: border-box;
background-color: rgba(0, 0, 0, 0.8);
.icon {
width: 92rpx;
height: 92rpx;
}
.btn-close {
position: absolute;
bottom: 0;
bottom: constant(safe-area-inset-bottom);
bottom: env(safe-area-inset-bottom);
left: 0;
right: 0;
height: 200rpx;
z-index: 100;
display: flex;
justify-content: center;
align-items: center;
}
}
</style>
}
.header-box {
// padding:10rpx 20rpx;
position: relative;
.inner {
display: flex;
position: absolute;
left: 0;
right: 0;
bottom: 0;
}
.icon {
margin: 20rpx;
display: block;
width: 44rpx;
height: 44rpx;
}
}
.camera-box {
position: absolute;
left:0;
width: 100%;
// height: 100vh;
z-index: 1;
}
.mark-water {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 360rpx;
height: 90rpx;
z-index: 6;
}
.mark-box {
position: absolute;
left: 0;
bottom: 0;
padding: 20rpx;
.txt {
max-width: 500rpx;
max-height: 80rpx;
overflow: hidden;
margin-top: 5rpx;
line-height: 40rpx;
white-space: normal;
font-size: 28rpx;
color: #fff;
&.big {
padding: 10rpx;
margin-bottom: 10rpx;
width: 430rpx;
line-height: 40rpx;
font-size: 32rpx;
background-color: rgba(34, 114, 255, 0.6);
}
}
}
.bottom-box {
position: absolute;
left: 0;
right: 0;
bottom:0;
// bottom: constant(safe-area-inset-bottom);
// bottom: env(safe-area-inset-bottom);
z-index: 5;
box-sizing: border-box;
height: 200rpx;
display: flex;
justify-content: space-between;
padding: 20rpx 78rpx;
align-items: center;
background-color: black;
.txt {
white-space: nowrap;
line-height: 60rpx;
color: #fff;
}
.icon {
display: block;
width: 92rpx;
height: 92rpx;
&.icon-take {
width: 144rpx;
height: 144rpx;
}
}
}
.canvas {
position: fixed;
left: -750rpx;
top: 0;
}
// 拍照规范
.page-mask {
position: fixed;
bottom: 0;
bottom: constant(safe-area-inset-bottom);
bottom: env(safe-area-inset-bottom);
z-index: 1000;
width: 750rpx;
height: 100vh;
// padding: 0 30rpx;
box-sizing: border-box;
background-color: rgba(0, 0, 0, 0.8);
.icon {
width: 92rpx;
height: 92rpx;
}
.btn-close {
position: absolute;
bottom: 0;
bottom: constant(safe-area-inset-bottom);
bottom: env(safe-area-inset-bottom);
left: 0;
right: 0;
height: 200rpx;
z-index: 100;
display: flex;
justify-content: center;
align-items: center;
}
}
</style>
......@@ -34,7 +34,8 @@
"path": "pages/index/mine",
"style": {
"navigationBarTitleText": "我的",
"navigationStyle": "custom"
"navigationStyle": "custom" ,
"disableScroll": true
}
},
{
......@@ -155,7 +156,31 @@
"navigationStyle": "custom", // 隐藏系统导航栏
"disableScroll": true
}
}
},
{
"path": "wallet/index",
"style": {
"navigationBarTitleText": "我的钱包",
"enablePullDownRefresh": false,
"disableScroll": true,
"navigationStyle": "custom", // 隐藏系统导航栏
"navigationBarBackgroundColor":"#F4F5F7"
}
},
{
"path": "cert/list",
"style": {
"navigationBarTitleText": "我的证件",
"navigationStyle":"custom"
}
},
{
"path": "cert/detail",
"style": {
"navigationBarTitleText": "",//证件详情
"navigationStyle":"custom"
}
}
]
},
{
......@@ -458,7 +483,12 @@
"name": "学习 - 首页", //模式名称
"path": "pages/index/learn", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
}
},
{
"name": "我的 - 我的证件 - 列表", //模式名称
"path": "pages/mine/cert/list", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
}
]
}
}
\ No newline at end of file
<template>
<view class="mine-view">
<image class="header-image" mode="widthFix" :src="imageUrl + 'wodebeijing.png'"></image>
<u-navbar :is-back="false" :background="{ background: 'transparent' }" :border-bottom="false">
<text class="title-view">我的</text>
<view class="mine-view">
<image class="header-image" mode="widthFix" :src="wodebeijingImage"></image>
<u-navbar :is-back="false" :background="{ background: 'transparent' }" :border-bottom="false">
<text class="title-view">我的</text>
</u-navbar>
<view class="mine-content">
<view class="header-view">
<view class="head-image">
<u-avatar :src="headImageUrl" size="142" mode="circle"></u-avatar>
<view :class="['head-image', {'has-image': info.headImage}]">
<u-avatar :src="headImageUrl" :size="headSize" mode="circle"></u-avatar>
</view>
<view class="header-content">
<view class="name-view">{{name}}</view>
<view :class="['tel-view', {'active': info.tel}]">
<text>{{tel}}</text>
<icon name="arrow-left-fill"></icon>
</view>
<view class="name-view" @click="handleClickName">{{name}}</view>
<view :class="['tel-view', {'active': info.tel}]" @click="handleClickTel">
<text>{{telTip}}</text>
<u-icon class="tel-arrow-icon" name="arrow-up-fill"></u-icon>
</view>
</view>
</view>
<view class="list-view">
<u-cell-group>
<u-cell-group :border="false">
<view v-for="(item, index) in items" :key="index">
<u-cell-item :value="item.value" :border-bottom="false" @click="handleClick(index)">
<image slot="icon" :src="imageUrl + item.icon" :style="item.imageStyle"></image>
......@@ -30,13 +30,13 @@
</view>
</u-cell-group>
</view>
<view class="u-m-t-20" @click="take">
<!-- <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>
<!-- <take-photo v-if="takeStatus" :currentItem="testData" @close="closeTake"></take-photo> -->
</view>
</template>
......@@ -48,23 +48,23 @@
},
data() {
return {
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: [] // 要点
}
// 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: {
......@@ -112,97 +112,139 @@
imageStyle: 'width:32rpx;height:32rpx'
}
]
},
name() {
return this.info.name || '点击登录'
},
tel() {
return this.info.tel ? '已绑定手机号' : '绑定手机号'
},
name() {
return this.info.name || '点击登录'
},
telTip() {
return this.info.tel ? '已绑定手机号' : '绑定手机号'
},
imageUrl() {
return process.uniEnv.qn_base_url
},
pages() {
return ['', '', '', '', 'address', '', '']
},
headImageUrl() {
return this.info.headImage || this.placeholderImage
},
placeholderImage() {
return this.imageUrl + 'touxiang.png'
return ['wallet', '', 'contract', '', 'address', '', '']
},
headImageUrl() {
return this.info.headImage || this.placeholderImage
},
wodebeijingImage() {
return this.imageUrl + 'wodebeijing.png'
},
placeholderImage() {
return this.imageUrl + 'touxiang.png'
},
headSize() {
return this.info.headImage ? 136 : 144
}
},
onLoad() {
},
methods: {
methods: {
handleClick(index) {
uni.navigateTo({
url: 'pages/mine/' + this.pages[index]
})
console.log('clicked:', index)
uni.navigateTo({
url: 'pages/mine/' + this.pages[index] + '/index'
})
},
take() {
uni.hideTabBar()
this.takeStatus = true
handleClickName() {
console.log('click name')
},
closeTake(img) {
console.log(img)
this.takeStatus = false
}
handleClickTel() {
console.log('click tel')
},
// take() {
// uni.hideTabBar()
// this.takeStatus = true
// },
// closeTake(img) {
// console.log(img)
// this.takeStatus = false
// }
}
}
</script>
<style lang="scss" scoped>
.mine-view {
position: relative;
.header-image {
position: absolute;
width: 100%;
}
.title-view {
color: #FFFFFF;
font-weight: bold;
font-size: 40rpx;
position: relative;
height: 100vh;
overflow: auto;
background-color: #FFFFFF;
.header-image {
position: absolute;
width: 100%;
}
.title-view {
color: #FFFFFF;
font-weight: bold;
font-size: 40rpx;
padding-left: 30rpx;
}
.mine-content {
background-color: #F4F5F7;
.header-view {
padding: 30rpx;
display: flex;
.head-image {
width: 142rpx;
height: 142rpx;
}
.header-content {
color: #FFFFFF;
z-index: 0;
.name-view {
}
.tel-view {
background-color: #FFFFFF;
border-radius: 26rpx;
color: #2272FF;
width: 164rpx;
height: 52rpx;
&.active {
color: #FFFFFF;
border: 1rpx bold #FFFFFF;
}
}
}
.mine-content {
position: relative;
.header-view {
padding: 30rpx 30rpx 80rpx 30rpx;
display: flex;
align-items: center;
.head-image {
width: 144rpx;
height: 144rpx;
background-color: #FFFFFF;
border-radius: 72rpx;
&.has-image {
border: 4rpx solid #FFFFFF;
}
}
.header-content {
color: #FFFFFF;
z-index: 1;
margin-left: 24rpx;
.name-view {
font-size: 44rpx;
font-weight: bold;
margin-bottom: 14rpx;
margin-top: 6rpx;
}
.tel-view {
background-color: #FFFFFF;
border-radius: 26rpx;
color: #2272FF;
width: 164rpx;
height: 52rpx;
font-size: 20rpx;
display: flex;
align-items: center;
justify-content: center;
&.active {
color: #FFFFFF;
border: 2rpx solid #FFFFFF;
background-color: #2272FF;
}
.tel-arrow-icon {
transform: rotate(90deg);
margin-left: 6rpx;
}
}
}
}
.list-view {
background-color: #FFFFFF;
border-radius: 16rpx 16rpx 0 0;
overflow: hidden;
.item-title {
font-size: 32rpx;
......@@ -219,8 +261,7 @@
.line-view {
height: 2rpx;
background-color: #F4F5F7;
margin-top: 30rpx;
margin-bottom: 30rpx;
margin: 30rpx;
}
}
}
......
......@@ -328,13 +328,14 @@
console.log('click cell')
this.viewOderItem(item.orderId)
},
filish(item){
filish(item){
// 去完工
uni.navigateTo({
url: 'pages/order/complete?orderId='+item.orderId
+ "&categoryId=" + item.categoryId
+ "&orderServiceType=" + item.orderServiceType
+ "&inGuaranteePeriod=" + item.inGuaranteePeriod
+ "&inGuaranteePeriod=" + item.inGuaranteePeriod
+ "&auditResultsId=" + Object.keys(item.auditResults)[0]
})
},
handleAction(item) {
......
<template>
<view class="cert-page">
<u-navbar
back-icon-color="#000000"
:background="background"
title-color="#000"
:border-bottom="false"
title="我的证件"
title-bold="true"
></u-navbar>
<view class="content-cody">
<view class="title">{{ info.type }}</view>
<view class="content" v-for="item in info.url"><image :src="item" mode=""></image></view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
info: {
type: "",
url: null
}
}
},
onLoad() {
var that = this;
const eventChannel = this.getOpenerEventChannel()
eventChannel.on('acceptDataFromCert', function(data) {
try{
let urlArr = data.url.split(',');
that.info.type = data.type;
that.info.url = urlArr;
console.log(urlArr);
}catch(e){}
console.log(that.info);
})
},
}
</script>
<style>
.cert-page {
font-size: 28rpx;
margin: 30rpx;
}
.content-cody {
padding-left: 30rpx;
padding-right: 30rpx;
background-color: #F4F5F7;
border-radius: 12rpx;
}
.title {
font-size: 32rpx;
font-weight: bold;
}
.content {
padding-top: 30rpx;
}
</style>
<template>
<view class="cert-page">
<u-navbar
back-icon-color="#000000"
:background="background"
title-color="#000"
:border-bottom="false"
title="我的证件"
title-bold="true"
></u-navbar>
<view class="content-cody">
<u-cell-group>
<u-cell-item v-for="item in list" :title="item.name" :value="item.isUploadName" :arrow="true"
:value-style="{'color': item.color}" @click="toDetail(item.keyName)">
<u-icon slot="icon" size="32" name="checkmark-circle" :color="item.iconColor"></u-icon>
</u-cell-item>
</u-cell-group>
</view>
</view>
</template>
<script>
export default {
data() {
return {
list: {
id_card: {
name: "身份证",
isUpload: false,
isUploadName: "",
keyName: "id_card",
color: "#999999"
},
electrician_certificate: {
name: "电工证",
isUpload: false,
isUploadName: "",
keyName: "electrician_certificate",
color: "#999999"
},
driver_license: {
name: "驾驶证",
isUpload: false,
isUploadName: "",
keyName: "driver_license",
color: "#999999"
},
driving_license: {
name: "行驶证",
isUpload: false,
isUploadName: "",
keyName: "driving_license",
color: "#999999"
},
vehicle: {
name: "车辆照",
isUpload: false,
isUploadName: "",
keyName: "vehicle",
color: "#999999"
},
high_sky_license: {
name: "高空证",
isUpload: false,
isUploadName: "",
keyName: "high_sky_license",
color: "#999999"
},
refrigeration_license: {
name: "制冷证",
isUpload: false,
isUploadName: "",
keyName: "refrigeration_license",
color: "#999999"
},
business_license: {
name: "营业执照",
isUpload: false,
isUploadName: "",
keyName: "business_license",
color: "#999999"
},
}
}
},
onLoad() {
let that = this;
this.$u.api
.getCertList()
.then((res) => {
if(res.code != 200){
return
}
for(let key in this.list){
let getData = res.data[key];
this.list[key].isUpload = getData.status;
this.list[key].isUploadName = getData.status == 1 ? '已上传' : '未上传';
this.list[key].color = getData.status == 1 ? "#999999" : "#2272FF";
this.list[key].iconColor = getData.status == 1 ? "#2272FF" : "#999999";
this.list[key].data = getData;
}
console.log(this.list);
console.log(res);
}).catch((err) => {
console.log(err);
});
},
methods: {
isUpload(typeBool) {
return typeBool ? '已上传' : '未上传'
},
toDetail(key) {
let data = this.list[key].data;
if(data.status != 1){
return;
}
wx.navigateTo({
url: '/pages/mine/cert/detail',
success: function(res) {
res.eventChannel.emit('acceptDataFromCert', data)
}
});
}
}
}
</script>
<style>
.cert-page {
font-size: 28rpx;
margin: 30rpx;
}
.content-cody {
/* padding-left: 30rpx;
padding-right: 30rpx; */
padding-left: 30rpx;
padding-right: 30rpx;
background-color: #ffffff;
border-radius: 12rpx;
}
.rightBlue {
color: #007AFF;
}
</style>
<template>
<view class="contract">
<u-navbar
title="我的合同"
b:is-back="false"
:background="background"
:border-bottom="false"
></u-navbar>
<view class="content">
<text class="title">合同清单</text>
<view class="jf-currency-class">
<view class="left"> 自营平台技 工入驻签约 合同 </view>
<view class="text1">《自营平台技工入驻签约合同》</view>
<view class="text2">下载时间: 2021.05.06 14:25:00</view>
</view>
<view class="jf-currency-class">
<view class="left">新风机技工入驻签约合同</view>
<view class="text1">《新风机技工入驻签约合同》</view>
<view class="text2">下载时间: 2021.05.06 15:01:48</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
background: {
backgroundColor: "#F4F5F7",
// 导航栏背景图
// background: 'url(https://cdn.uviewui.com/uview/swiper/1.jpg) no-repeat',
// 还可以设置背景图size属性
// backgroundSize: 'cover',
// 渐变色
// backgroundImage: 'linear-gradient(45deg, rgb(28, 187, 180), rgb(141, 198, 63))'
},
};
},
onLoad() {},
methods: {},
};
</script>
<style lang="scss" scoped>
.contract {
width: 100%;
height: 100vh;
background: #f4f5f7;
}
.content {
width: 100%;
height: 100%;
padding: 40rpx 30rpx 0 30rpx;
}
.title {
width: 65px;
height: 16px;
font-size: 16px;
font-family: PingFang-SC-Bold, PingFang-SC;
font-weight: bold;
color: #333333;
line-height: 16px;
}
.jf-currency-class {
width: 100%;
height: 180rpx;
border-radius: 12rpx;
padding-top: 40rpx;
margin-top: 74rpx;
background: #ffffff;
position: relative;
.left {
width: 160rpx;
height: 200rpx;
padding: 30rpx 14rpx 0 14rpx;
position: absolute;
top: -40rpx;
left: 30rpx;
background: url(@/static/photo/hetong.png);
border-radius: 6px;
color: #ffffff;
font-size: 26rpx;
line-height: 38rpx;
font-family: PingFang-SC-Bold, PingFang-SC;
font-weight: bold;
}
.text1 {
font-size: 32rpx;
font-family: PingFang-SC-Bold, PingFang-SC;
font-weight: bold;
color: #2272ff;
margin-left: 208rpx;
}
.text2 {
font-size: 24rpx;
color: #999999;
margin-left: 220rpx;
margin-top: 22rpx;
}
}
.current-img {
width: 100%;
height: 100%;
position: absolute;
}
</style>
\ No newline at end of file
<template>
<view class="wallet-view">
<u-navbar back-icon-color="#333333" background="#F4F5F7" title="我的钱包" titleColor="#333333" :border-bottom="false"></u-navbar>
<image class="header-image" mode="widthFix" :src="qianbaobeijing"></image>
<view class="survey-view">
<view class="survey-top-view">
<view class="survey-top-left">
<view>账户总资产(元)</view>
<view>{{info.totalPayAmount}}</view>
</view>
<view class="survey-top-right">
<u-button>提现</u-button>
</view>
</view>
<view class="survey-bottom-view">
<view v-for="(value, key) in items" :key="key">
<view>{{value}}</view>
<view>{{info[key]}}</view>
</view>
</view>
</view>
<view class="content-view">
<view v-for="(item, index) in lists" :class="['content-list', {'first': index==0}]" :key="index">
<view class="content-list-left">
<image class="content-list-image" :src="item.icon"></image>
<view class="content-list-text">
<view class="content-list-text-title">{{item.title}}</view>
<view>{{item.content}}</view>
</view>
</view>
<view class="content-list-right">
<text class="content-list-right-text">点击查看</text>
<u-icon name="arrow-right"></u-icon>
</view>
</view>
</view>
<view class="list-view">
</view>
</view>
</template>
<script>
export default {
data() {
return {
info: {
canApplyAmount: 0, // 可提现金额
saveApplyCount: 0, // 已申请提现的支付单数
canApplyCount: 0, // 可申请提现的支付单数
saveAndApplyAmount: 0, // 已申请提现金额
totalPayAmount: 0, // 总共收入
/* 还没对字段名 */
dairuzhang: 0, // 预计待入账
}
}
},
computed: {
lists() {
return [{
title: '结算账单',
content: '展示您已提现的账单信息',
icon: this.imageUrl + 'jiesuan.png'
},{
title: '收入流水',
content: '当前展示最近5条,点击查看全部',
icon: this.imageUrl + 'liushui.png'
}]
},
items() {
return {canApplyAmount:'可提现(元)', dairuzhang:'预计待入账(元)'}
},
imageUrl() {
return process.uniEnv.qn_base_url
},
qianbaobeijing() {
return this.imageUrl + 'qianbaobeijing.png'
},
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.wallet-view {
position: relative;
height: 100vh;
overflow: auto;
background-color: #F4F5F7;
.header-image {
position: absolute;
width: 100%;
margin-left: 4rpx;
margin-top: 10rpx;
}
.survey-view {
position: relative;
height: 400rpx;
margin: 30rpx 30rpx 10rpx 30rpx;
color: #FFFFFF;
padding: 30rpx;
.survey-top-view {
display: flex;
justify-content: space-between;
align-items: flex-end;
.survey-top-left {
}
.survey-top-right {
}
}
.survey-bottom-view {
display: flex;
justify-content: space-between;
}
}
.content-view {
position: relative;
padding: 0 30rpx;
.content-list {
height: 140rpx;
border-radius: 12rpx;
display: flex;
justify-content: space-between;
padding: 30rpx;
background-color: #FFFFFF;
&.first {
margin-bottom: 20rpx;
}
.content-list-left {
display: flex;
.content-list-image {
width: 56rpx;
height: 56rpx;
margin-top: 2rpx;
}
.content-list-text {
font-size: 24rpx;
color: #666666;
margin-left: 20rpx;
.content-list-text-title {
font-size: 32rpx;
color: #333333;
}
}
}
.content-list-right {
color: #2272FF;
font-size: 26rpx;
.content-list-right-text {
margin-right: 4rpx;
}
}
}
}
.list-view {
position: relative;
}
}
</style>
......@@ -121,7 +121,8 @@
orderId:0,
categoryId:0,
orderServiceType:'',
inGuaranteePeriod:'',
inGuaranteePeriod:'',
auditResultsId: '',
list: [],
tabIndex: 0,
scrollTop: 0, //tab标题的滚动条位置
......@@ -194,7 +195,8 @@
this.orderId = option.orderId
this.categoryId = option.categoryId
this.orderServiceType = decodeURIComponent(option.orderServiceType)
this.inGuaranteePeriod = option.inGuaranteePeriod
this.inGuaranteePeriod = option.inGuaranteePeriod
this.auditResultsId = option.auditResultsId
} else {
this.orderId = 11880091
this.categoryId = 1100000214
......@@ -238,7 +240,7 @@
'font-size': '32rpx',
}
},
show200() { /// 基础信息显示金额输入框
show200() {
return this.form.paymentMethodsType != '03'
}
},
......@@ -249,12 +251,29 @@
self.$u.api.getCompleteConfigAndData(self.orderId).then((res) => {
if (res.code == 200) {
self.list = res.data.config
self.form = res.data.value || {}
self.form = res.data.value || {}
// 异常单处理
if (self.auditResultsId) self.checkCompleteError()
} else {
console.log(res.message, "获取订单完工项目失败!");
}
});
}
},
checkCompleteError() { // 异常单定位错误项
let self = this
self.list.forEach((panel, panelIndex)=>{
panel.items.forEach((group, groupIndex) =>{
group.items.forEach((ele, eleIndex)=>{
if (ele.fieldsName === self.auditResultsId) {
self.waitHandlerPanelIndex = panelIndex
self.waitHandlerGroupIndex = groupIndex
self.waitHandlerEleIndex = eleIndex
}
})
})
})
this.locationCompleteItem(self.waitHandlerPanelIndex, self.waitHandlerGroupIndex, self.waitHandlerEleIndex)
},
saveComplete(){// 保存完工信息
let self = this
......@@ -307,7 +326,6 @@
}else if(value&&Array.isArray(value)&&value.length > 0){
panelResult.submitted++
}else if(first){// 记录第一个 为空 并且需要必填的项 用于定位
console.log(ele)
first = false
self.waitHandlerPanelIndex = panelIndex
self.waitHandlerGroupIndex = groupIndex
......@@ -387,12 +405,20 @@
if(innerItem.fieldsType ==='multiInput'){
// 多个输入框的值触发
let key = Object.keys(data.value)[0]
debugger
this.form[key] = data.value[key]
}else{
this.$set(this.form,innerItem.fieldsName,data.value)
}
if (innerItem.fieldsId == 199) { // 选不需要收款的时候,收款金额修改为非必选
for (var item of this.list[0].items) {
for (var i of item.items) {
if (i.fieldsId == 200) {
i.required = data.value !='03'
}
}
}
}
console.log(this.form)
},
nextStep() {
......@@ -440,7 +466,8 @@
case 'location':
formType = 'location'
break
case 'scan':
case 'scan':
case 'machine_code':
formType = 'scan'
break
case 'picker':
......
......@@ -5,12 +5,12 @@
<view class="topView">
<view :class="['topItemView', {'active':activeTop===ikey}]" @click="handleTopItemChange(ikey,item)"
v-for="(item,ikey) in dataList" :key="ikey">
<text :class="['ph-lst-top-index', {'active':activeTop===ikey}]">{{ ikey + 1 }}</text>
<text class="topItemTitle">{{item.type}}</text>
</view>
</view>
<view class="rightView">
<view class="right-view-title">拍照项有:</view>
<scroll-view scroll-y="true" class="scroll-y">
......@@ -33,7 +33,7 @@
<!-- <u-button v-if="activeTop + 1 === dataList.length" class="ph-list-button" type="error" shape="circle"
:disabled="buttonDisabled" :custom-style="buttonStyle" @click="isPopShow = true">一键清空展示图片</u-button> -->
</view>
<!-- <u-popup border-radius="10" v-model="isPopShow" safe-area-inset-bottom mode="center" width="690rpx"
height="600rpx">
<view class="ph-list-pop-title">
......@@ -165,7 +165,7 @@
}
})
},
getListDataNew() {
getListDataNew() {
this.loading = true
let self = this
var data = {
......@@ -177,7 +177,6 @@
self.$u.api.orderStandard(data).then((res) => {
this.loading = false
if (res.code == 200) {
console.log("===", res.data)
if(res.data && res.data.length > 0){
let dataList = []
var flag = false;
......@@ -196,7 +195,7 @@
}else{
flag = false
}
})
})
if(!flag){
var dataItem = {type:'',list:[]}
dataItem.type = item.type
......@@ -205,6 +204,7 @@
}
}
})
console.log("===", dataList)
this.handleData(dataList)
}
} else {
......@@ -217,7 +217,6 @@
this.dataList = result
if (result.length > 0) {
var item = result[0]
getApp().globalData.photo.waterSetting = this.userWatermark
this.rightList = item.list
}
},
......@@ -253,28 +252,28 @@
})
},
// 清除图片
handleClickSure: function() {
this.$u.cloudApi.cleanImage({
'token': this.vuex_token,
}).then(res => {
this.isPopShow = false
if (res && res.result) {
this.getListData()
}
handleClickSure: function() {
this.$u.cloudApi.cleanImage({
'token': this.vuex_token,
}).then(res => {
this.isPopShow = false
if (res && res.result) {
this.getListData()
}
})
},
take(item,ikey) {
this.currentItemDate = item
const photo = getApp().globalData.photo
photo.currentItem = item
photo.itemIndex = ikey
const len = item.orderImages?item.orderImages.length:0
photo.currentItemLength = len > 9 ? 10 : len
uni.hideTabBar()
this.takeStatus = true
},
uni.hideTabBar()
this.takeStatus = true
},
closeTake(img) {
if(img !==undefined ){
if (!this.currentItemDate.orderImages) this.currentItemDate.orderImages = []
......@@ -448,7 +447,6 @@
background-color: #FAFAFA;
width: 100%;
height: 100rpx;
position: fixed;
display: flex;
flex-direction: row;
z-index: 1;
......@@ -501,6 +499,6 @@
}
.scroll-y {
height: 80vh;
height: 73vh;
}
</style>
</style>
......@@ -26,6 +26,7 @@
:send-message-img="sendMessageImg"
:show-message-card="showMessageCard"
@getphonenumber="getphonenumber"
@getuserinfo="getuserinfo"
@error="error"
@opensetting="opensetting"
@launchapp="launchapp"
......@@ -324,9 +325,9 @@ export default {
getphonenumber(res) {
this.$emit('getphonenumber', res);
},
// getuserinfo(res) {
// this.$emit('getuserinfo', res);
// },
getuserinfo(res) {
this.$emit('getuserinfo', res);
},
error(res) {
this.$emit('error', res);
},
......
......@@ -24,7 +24,6 @@
* @property {Boolean} bold 激活选项的字体是否加粗(默认true)
* @property {String} bg-color 组件背景颜色,mode为button时有效(默认#eeeeef)
* @property {String} button-color 按钮背景颜色,mode为button时有效(默认#ffffff)
* @property {String Number} border-radius 圆角值,单位rpx(默认5)
* @event {Function} change 分段器选项发生改变时触发
* @example <u-subsection active-color="#ff9900"></u-subsection>
*/
......@@ -92,12 +91,7 @@
vibrateShort: {
type: Boolean,
default: false
},
// 圆角值
borderRadius: {
type: [Number, String],
default: 5
},
}
},
data() {
return {
......@@ -111,7 +105,7 @@
},
currentIndex: this.current,
buttonPadding: 3, // mode = button 时,组件的内边距
// borderRadius: 5, // 圆角值
borderRadius: 5, // 圆角值
firstTimeVibrateShort: true // 组件初始化时,会触发current变化,此时不应震动
};
},
......
......@@ -2,8 +2,8 @@ module.exports = {
onLoad() {
// 设置默认的转发参数
this.$u.mpShare = {
title: '充电桩安装火爆进行中...就等你', // 默认为小程序名称
path: '/pages/index/index', // 默认为当前页面路径
title: '', // 默认为小程序名称
path: '', // 默认为当前页面路径
imageUrl: '' // 默认为当前页面的截图
}
},
......
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