Commit 8e587958 authored by 李超鹏's avatar 李超鹏

Merge remote-tracking branch 'origin/dev-photo-v2' into dev-photo-v2

parents d19ab5f5 3229c76a
......@@ -101,6 +101,7 @@
globalData.photo.productList = result
this.dataList = result
var item = result[0]
globalData.photo.waterSetting = item.userWatermark
this.rightList = item.list
},
......@@ -108,6 +109,8 @@
handleTopItemChange: function(ikey, item) {
this.activeTop = ikey
this.rightList = item.list
const photo = getApp().globalData.photo
photo.waterSetting = item.userWatermark
uni.pageScrollTo({
scrollTop: 0,
duration: 0
......
......@@ -5,40 +5,45 @@
<text class="itemTitle">保存原图</text>
<text class="itemNotice">拍照后另保存一张无水印的图片</text>
</view>
<switch class="itemSwitch" :checked="result['has_origin']" @change="handleOrigineChange" color="#007AFF"
style="transform:scale(0.8)" />
<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" :checked="result['lower_right']['title_text']" @change="itemChange({},-1)"
color="#007AFF" style="transform:scale(0.8)" />
<switch class="itemSwitch" disabled :checked="result['lower_right']['title_text']"
@change="itemChange({},-1)" 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['watemark_value']" @change="itemChange(item, ikey)"
color="#007AFF" style="transform:scale(0.8)" />
<switch class="itemSwitch" :disabled="!item['enable']" :checked="item['enable']"
@change="itemChange(item, ikey)" color="#007AFF" />
</view>
<view class="shadowBackView" v-if="isPopShow">
<view class="popCenterView">
<text class="popTitle">设置自定义项</text>
<view class="inputBackView">
<view class="leftInputView">
<input class="leftInput" type="text" v-model="currenItem['watemark_text']"
:disabled="currenItem.type === 'title_text'" placeholder="请输入" maxlength="10" />
<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="rightInputView">
<input class="rightInput" type="text" v-model="currenItem['watemark_value']" placeholder="请输入内容"
maxlength="30" />
<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-40">示例:</text>
<text class="popNoticeText u-m-t-20">示例:</text>
<text class="popNoticeText">工程队名称:蓝天工程队</text>
<view class="popBtnView">
<view class="popCancelBtn" @click="popCancelClick()">
......@@ -71,7 +76,9 @@
'watemark_text': '',
'watemark_value': ''
},
editingItem: {}
editingItem: {},
showTipLeft: false,
showTipRight: false
}
},
computed: {
......@@ -92,17 +99,15 @@
},
onLoad(e) {
getApp().trackPage('水印设置页')
this.icon_close_new = getApp().globalData.icon_close_new
if (e && e.systemId) {
this.systemId = e.systemId
}
const globalData = getApp().globalData
this.icon_close_new = globalData.icon_close_new
this.systemId = globalData.photo.product.systemId
this.getItemList()
},
methods: {
getItemList: function() {
this.systemId = '79550af260555cc20afb34156c94b32c' // 测试数据
// this.systemId = '79550af260555cc20afb34156c94b32c' // 测试数据
uni.showLoading();
this.$u.cloudApi.getUserWatermark({
'system_id': this.systemId
......@@ -134,28 +139,28 @@
//保存原图 开关
handleOrigineChange: function(e) {
this.result['has_origin'] = !this.result['has_origin']
console.log('保存原图 开关 发生 change 事件,携带值为', this.result['has_origin'])
this.result['has_origin'] = !this.result['has_origin']
this.saveUserWatermark()
},
//自定义 开关
itemChange: function(item, ikey) {
if (ikey === -1) { // 水印标题
if (this.result['lower_right']['title_text']) {
// 修改
this.saveUserWatermark()
} else {
// 弹出修改框
this.itemClick(item, ikey)
}
// if (this.result['lower_right']['title_text']) {
// 修改
this.saveUserWatermark()
// } else {
// // 弹出修改框
// this.itemClick(item, ikey)
// }
} else { // 其他自定义
if (item['watemark_value']) {
// 修改
this.saveUserWatermark()
} else {
// 弹出修改框
this.itemClick(item, ikey)
}
// if (item['watemark_value']) {
// 修改
this.saveUserWatermark()
// } else {
// // 弹出修改框
// this.itemClick(item, ikey)
// }
}
},
......@@ -180,12 +185,17 @@
//左侧输入框
leftInput: function(e) {
console.log('左侧输入框 发生 input 事件,携带值为', e.detail.value)
if (this.currenItem['watemark_text']) {
this.showTipLeft = false
}
},
//右侧输入框
rightInput: function(e) {
console.log('右侧输入框 发生 input 事件,携带值为', e.detail.value)
if (this.currenItem['watemark_value']) {
this.showTipRight = false
}
},
//自定义弹窗 关闭
......@@ -199,15 +209,26 @@
//自定义弹窗 保存
popSaveClick: function() {
this.isPopShow = false
debugger
if (this.currenItem.type === 'title_text') {
this.result['lower_right']['title_text'] = this.currenItem['watemark_value']
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 {
this.editingItem['watemark_text'] = this.currenItem['watemark_text']
this.editingItem['watemark_value'] = this.currenItem['watemark_value']
// 提示
if (!this.currenItem['watemark_text']) {
this.showTipLeft = true
}
if (!this.currenItem['watemark_value']) {
this.showTipRight = true
}
}
this.saveUserWatermark()
}
......@@ -272,13 +293,13 @@
.itemNotice {
font-size: 26rpx;
font-weight: bold;
color: #666666;
margin-top: 4rpx;
}
.itemSwitch {
margin-right: 30rpx;
transform: scale(0.78, 0.75);
}
.shadowBackView {
......@@ -314,18 +335,21 @@
.inputBackView {
margin-top: 52rpx;
width: 100%;
width: 100%;
height: 90rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
justify-content: space-between;
display: flex;
align-items: flex-start;
}
.leftInputView {
width: 220rpx;
height: 72rpx;
border: 2rpx solid #666666;
margin-left: 30rpx;
display: flex;
align-items: center;
justify-content: center;
......@@ -334,6 +358,17 @@
.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 {
......
......@@ -96,9 +96,11 @@
this.currentItem = photo.currentItem
},
compute: {
setting() {
waterSetting() {
// photo.waterSetting
const photo = getApp().globalData.photo
return photo.setting || null
console.log(photo.waterSetting,'photo.waterSetting')
return photo.waterSetting || null
}
},
watch: {
......
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