Commit 5b541354 authored by 李超鹏's avatar 李超鹏

Merge remote-tracking branch 'origin/master'

parents 4ef5c8fb 5ab23fbe
...@@ -24,8 +24,27 @@ ...@@ -24,8 +24,27 @@
</view> </view>
</view> </view>
</template> </template>
<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">
<text>是否一键清空系统展示的图片?</text>
</view>
<view class="ph-list-pop-text">
<text>点击"确定"则删除系统展示的所有图片</text>
</view> </view>
<view class="ph-list-pop-btn-view">
<u-button :custom-style="customStyleCancel" hover-class="none" shape="circle" type="primary"
@click="isPopShow = false">
取消
</u-button>
<u-button :custom-style="customStyleSave" shape="circle" type="primary" @click="handleClickSure()">
确定
</u-button>
</view>
</u-popup>
</view> </view>
</template> </template>
...@@ -42,7 +61,8 @@ ...@@ -42,7 +61,8 @@
brand: '', brand: '',
brandId: '', brandId: '',
dataList: [], dataList: [],
loading: true loading: true,
isPopShow: false
} }
}, },
onLoad(e) { onLoad(e) {
...@@ -71,6 +91,43 @@ ...@@ -71,6 +91,43 @@
}, },
computed: {
buttonStyle() {
return {
'color': '#FFFFFF',
'width': '600rpx',
'height': '104rpx',
'font-size': '36rpx'
}
},
buttonDisabled() {
for (var item of this.dataList) {
for (var i of item.list) {
if ((i.imageList || []).length > 0) {
return false
}
}
}
return true
},
customStyleCancel() {
return {
'background-color': '#D1D4D4',
'width': '280rpx',
'height': '96rpx'
}
},
customStyleSave() {
return {
'background-color': '##2272FF',
'width': '280rpx',
'height': '96rpx',
'margin-left': '50rpx'
}
}
},
methods: { methods: {
getListData: function() { getListData: function() {
this.loading = true this.loading = true
...@@ -83,9 +140,11 @@ ...@@ -83,9 +140,11 @@
}).then(res => { }).then(res => {
this.loading = false this.loading = false
if (res && res.result) { if (res && res.result) {
if(res.result.error_code){ if (res.result.error_code) {
uni.showToast({title: res.result.error_msg}) uni.showToast({
}else{ title: res.result.error_msg
})
} else {
that.handleData(res.result) that.handleData(res.result)
} }
} }
...@@ -94,6 +153,7 @@ ...@@ -94,6 +153,7 @@
}, },
handleData: function(result) { handleData: function(result) {
this.activeTop = 0
const globalData = getApp().globalData const globalData = getApp().globalData
globalData.photo.productList = result globalData.photo.productList = result
this.dataList = result this.dataList = result
...@@ -131,13 +191,23 @@ ...@@ -131,13 +191,23 @@
photo.currentItem = item photo.currentItem = item
photo.itemIndex = ikey photo.itemIndex = ikey
const len = item.imageList.length const len = item.imageList.length
photo.currentItemLength = len>9 ? 10 : len photo.currentItemLength = len > 9 ? 10 : len
uni.navigateTo({ uni.navigateTo({
url: '/pages/photo/take' url: '/pages/photo/take'
}) })
}, },
// 清除图片
handleClickSure: function() {
this.$u.cloudApi.cleanImage({
'token': getApp().globalData.token,
}).then(res => {
this.isPopShow = false
if (res && res.result) {
this.getListData()
}
})
}
} }
} }
</script> </script>
...@@ -268,8 +338,9 @@ ...@@ -268,8 +338,9 @@
margin: 0rpx 12rpx 12rpx 0rpx; margin: 0rpx 12rpx 12rpx 0rpx;
} }
.rightImage:nth-child(5n){
margin-right:0; .rightImage:nth-child(5n) {
margin-right: 0;
} }
...@@ -308,4 +379,24 @@ ...@@ -308,4 +379,24 @@
.greenBackColor { .greenBackColor {
background-color: #4CD964; background-color: #4CD964;
} }
.ph-list-pop-text {
color: #666666;
text-align: center;
margin-top: 20rpx;
font-size: 30rpx;
}
.ph-list-pop-title {
font-size: 40rpx;
padding-top: 150rpx;
text-align: center;
color: #333333;
}
.ph-list-pop-btn-view {
display: flex;
justify-content: center;
margin-top: 150rpx;
}
</style> </style>
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
<!-- <image class="pic" :src="files[0]" v-lazy mode="aspectFit"></image> --> <!-- <image class="pic" :src="files[0]" v-lazy mode="aspectFit"></image> -->
</view> </view>
<view class="bottomView"> <view class="bottomView">
<image class="btn" :src="btn_remake" @click="$u.debounce(remakePhoto, 500)"></image> <image class="btn" :src="btn_remake" @click="$u.throttle(remakePhoto, 3000)"></image>
<image class="btn" :src="btn_continue" @click="$u.debounce(continuePhoto, 500)"></image> <image class="btn" :src="btn_continue" @click="$u.throttle(continuePhoto, 3000)"></image>
</view> </view>
<image class="btn finish" src="/static/photo/finish.png" @click="$u.debounce(finishPhoto, 500)"></image> <image class="btn finish" src="/static/photo/finish.png" @click="$u.throttle(finishPhoto, 3000)"></image>
</view> </view>
</template> </template>
......
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