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