Commit 0f00f0af authored by 刘用法's avatar 刘用法
parents 5358c81b e08c2dd7
...@@ -75,6 +75,11 @@ let orderApiFun = function(vm){ ...@@ -75,6 +75,11 @@ let orderApiFun = function(vm){
*/ */
let getWatermark = async (params = {}) => await vm.$u.get(prefix + vm.vuex_token + '/photo/watermark', params); 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){ ...@@ -144,6 +149,7 @@ let orderApiFun = function(vm){
orderStandard, orderStandard,
saveImage, saveImage,
getWatermark, getWatermark,
saveWatermark,
openTimerange, openTimerange,
contactTime, contactTime,
checkRejectable, checkRejectable,
......
...@@ -73,6 +73,12 @@ ...@@ -73,6 +73,12 @@
}, },
methods: { methods: {
selectUpload(){ selectUpload(){
if (this.imgList.length === 10) {
return this.$refs.uToast.show({
title: '图片已超出最大数量',
type: 'error',
})
}
// 弹窗展示 // 弹窗展示
this.maskShow = true this.maskShow = true
}, },
......
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
photo.currentItemLength = 10 photo.currentItemLength = 10
this.continuePhoto() this.continuePhoto()
// 完成本项 // 完成本项
this.$emit('finish') //this.$emit('finish')
}, },
// 确认图片 // 确认图片
continuePhoto() { continuePhoto() {
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
}, },
submitFile() { submitFile() {
const photo = getApp().globalData.photo const photo = getApp().globalData.photo
photo.currentItemLength = photo.currentItemLength + 1 if (photo.currentItemLength < 10) photo.currentItemLength = photo.currentItemLength + 1
uni.hideLoading() uni.hideLoading()
// 当前项的图片显示 // 当前项的图片显示
// 拍照项张数目增加 等于10张 // 拍照项张数目增加 等于10张
......
...@@ -9,20 +9,20 @@ ...@@ -9,20 +9,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>
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
<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 === '备注'" 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>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,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>
...@@ -72,14 +72,14 @@ ...@@ -72,14 +72,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,
...@@ -89,10 +89,11 @@ ...@@ -89,10 +89,11 @@
}, },
computed: { computed: {
itemList() { itemList() {
if (this.result['lower_right']) { console.log(this.result)
var arr = this.result['lower_right']['body'] if (this.result['lowerLeft']) {
var arr = this.result['lowerLeft']['body']
return arr.filter((item) => { return arr.filter((item) => {
return item.watemark_type === '备注' return item.watemarkType === '备注'
}) })
} else { } else {
return [] return []
...@@ -100,7 +101,7 @@ ...@@ -100,7 +101,7 @@
}, },
showTitleSwitch() { showTitleSwitch() {
return this.result['lower_right'].hasOwnProperty('title_text') return this.result['lowerLeft'].hasOwnProperty('title')
}, },
customStyleCancel() { customStyleCancel() {
return { return {
...@@ -122,54 +123,43 @@ ...@@ -122,54 +123,43 @@
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.systemId this.systemId = globalData.photo.currentItem.partnerCompanyId
this.getItemList() this.getItemList()
}, },
methods: { methods: {
getItemList: function() { getItemList: function() {
// this.systemId = '79550af260555cc20afb34156c94b32c' // 测试数据
this.loading = true this.loading = true
this.$u.api.getUserWatermark({ this.$u.api.getWatermark({partnerCompanyId:this.systemId}).then(res => {
'token': this.vuex_token, if (res.code == 200) {
'system_id': this.systemId this.result = res.data
}).then(res => { } else {
if (res && res.result) { uni.showToast({title: res.data.message})
if(res.result.error_code){
uni.showToast({title: res.result.error_msg})
}else{
this.result = res.result
}
}else{
uni.showToast({title: '网络异常'})
} }
this.loading = false this.loading = false
}) })
}, },
saveUserWatermark: function() { saveUserWatermark: function() {
this.loading = true this.loading = true
this.$u.api.saveUserWatermark({ this.$u.api.saveWatermark(this.result).then(res=>{
'token': this.vuex_token, if(res.code === 200){
'watermark': this.result uni.showToast({title:'保存成功'})
}).then(res => { getApp().globalData.photo.waterSetting = this.result
if (res.result.code == true) { this.$emit("changeWatermark", this.result);
const photo = getApp().globalData.photo
photo.waterSetting = this.result
}else{ }else{
uni.showToast({title: res.result.msg}) uni.showToast({title: res.message})
} }
this.loading = false this.loading = false
}) })
}, },
//保存原图 开关 //保存原图 开关
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 +168,7 @@ ...@@ -178,7 +168,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,9 +184,9 @@ ...@@ -194,9 +184,9 @@
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': '备注'
} }
} else { } else {
this.editingItem = item this.editingItem = item
...@@ -210,7 +200,7 @@ ...@@ -210,7 +200,7 @@
//左侧输入框 //左侧输入框
leftInput: function(e) { leftInput: function(e) {
if (this.currenItem['watemark_text']) { if (this.currenItem['watemarkText']) {
this.showTipLeft = false this.showTipLeft = false
} }
...@@ -218,7 +208,7 @@ ...@@ -218,7 +208,7 @@
//右侧输入框 //右侧输入框
rightInput: function(e) { rightInput: function(e) {
if (this.currenItem['watemark_value']) { if (this.currenItem['watemarkValue']) {
this.showTipRight = false this.showTipRight = false
} }
}, },
...@@ -227,8 +217,8 @@ ...@@ -227,8 +217,8 @@
popCancelClick: function() { popCancelClick: function() {
this.isPopShow = false this.isPopShow = false
this.currenItem = { this.currenItem = {
'watemark_text': '', 'watemarkText': '',
'watemark_value': '' 'watemarkValue': ''
} }
}, },
...@@ -241,22 +231,22 @@ ...@@ -241,22 +231,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 === '备注') {
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
} }
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
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.system_id" @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>
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</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" /> <photo-setting v-if="showType === 3" @changeType="changeType" @changeWatermark="changeWatermark"/>
</view> </view>
</template> </template>
...@@ -128,10 +128,10 @@ ...@@ -128,10 +128,10 @@
titleTxt() { titleTxt() {
const waterSetting = this.waterSetting const waterSetting = this.waterSetting
let txt = '' let txt = ''
if (!waterSetting || !waterSetting.lower_right) { if (!waterSetting || !waterSetting.lowerLeft) {
return '' return ''
} }
txt = waterSetting.lower_right && waterSetting.lower_right.title_text || '' txt = waterSetting.lowerLeft && waterSetting.lowerLeft.title || ''
return txt return txt
}, },
settingTxtArr() { settingTxtArr() {
...@@ -144,17 +144,17 @@ ...@@ -144,17 +144,17 @@
let settingTxtArr = [] let settingTxtArr = []
const typeArr = ['经度', '纬度', '地址', '时间'] const typeArr = ['经度', '纬度', '地址', '时间']
const waterSetting = this.waterSetting const waterSetting = this.waterSetting
if (!waterSetting || !waterSetting.lower_right || !waterSetting.lower_right.body) { if (!waterSetting || !waterSetting.lowerLeft || !waterSetting.lowerLeft.body) {
return arr return arr
} }
const settingArr = waterSetting.lower_right.body const settingArr = waterSetting.lowerLeft.body
settingArr.map(item => { settingArr.map(item => {
const idx = typeArr.indexOf(item.watemark_type) const idx = typeArr.indexOf(item.watemarkType)
if (item.enable && (idx > -1 || (item.watemark_value && item.watemark_text))) { if (item.enable && (idx > -1 || (item.watemarkValue && item.watemarkText))) {
if (idx > -1) { if (idx > -1) {
settingTxtArr.push(arr[idx]) settingTxtArr.push(arr[idx])
} else { } else {
settingTxtArr.push(item.watemark_text + ':' + item.watemark_value) settingTxtArr.push(item.watemarkText + ':' + item.watemarkValue)
} }
} }
}) })
...@@ -191,6 +191,9 @@ ...@@ -191,6 +191,9 @@
changeType(type) { changeType(type) {
this.showType = type this.showType = type
}, },
changeWatermark(watermark){
this.waterSetting = watermark
},
updateTime() { updateTime() {
this.waterInfo.date = this.getTime() this.waterInfo.date = this.getTime()
// let timer = setTimeout(() => { // let timer = setTimeout(() => {
......
...@@ -124,6 +124,7 @@ ...@@ -124,6 +124,7 @@
inGuaranteePeriod:'', inGuaranteePeriod:'',
list: [], list: [],
tabIndex: 0, tabIndex: 0,
show200: true, // 基础信息显示金额输入框
scrollTop: 0, //tab标题的滚动条位置 scrollTop: 0, //tab标题的滚动条位置
oldScrollTop: 0, oldScrollTop: 0,
current: 0, // 预设当前项的值 current: 0, // 预设当前项的值
...@@ -238,9 +239,6 @@ ...@@ -238,9 +239,6 @@
'font-size': '32rpx', 'font-size': '32rpx',
} }
}, },
show200() { /// 基础信息显示金额输入框
return this.form.paymentMethodsType != '03'
}
}, },
methods: { methods: {
getCompleteData() {//获取工单配置的完工项目 getCompleteData() {//获取工单配置的完工项目
...@@ -400,6 +398,7 @@ ...@@ -400,6 +398,7 @@
} }
} }
} }
console.log(this.form) console.log(this.form)
}, },
nextStep() { nextStep() {
......
...@@ -177,7 +177,6 @@ ...@@ -177,7 +177,6 @@
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) {
console.log("===", res.data)
if(res.data && res.data.length > 0){ if(res.data && res.data.length > 0){
let dataList = [] let dataList = []
var flag = false; var flag = false;
...@@ -205,6 +204,7 @@ ...@@ -205,6 +204,7 @@
} }
} }
}) })
console.log("===", dataList)
this.handleData(dataList) this.handleData(dataList)
} }
} else { } else {
...@@ -217,7 +217,6 @@ ...@@ -217,7 +217,6 @@
this.dataList = result this.dataList = result
if (result.length > 0) { if (result.length > 0) {
var item = result[0] var item = result[0]
getApp().globalData.photo.waterSetting = this.userWatermark
this.rightList = item.list this.rightList = item.list
} }
}, },
...@@ -448,7 +447,6 @@ ...@@ -448,7 +447,6 @@
background-color: #FAFAFA; background-color: #FAFAFA;
width: 100%; width: 100%;
height: 100rpx; height: 100rpx;
position: fixed;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
z-index: 1; z-index: 1;
...@@ -501,6 +499,6 @@ ...@@ -501,6 +499,6 @@
} }
.scroll-y { .scroll-y {
height: 80vh; height: 73vh;
} }
</style> </style>
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