Commit 9ade4a34 by songbingqi

区分出两张图片

parent 3eb9bf9e
<template> <template>
<u-popup :overlayStyle="{'z-index':'10073'}" bgColor="transparent" :show="show" mode="center" @close="close"> <u-popup :overlayStyle="{'z-index':'10073'}" bgColor="transparent" :show="show" mode="center" @close="close">
<image mode="widthFix" v-if="urlImg&&width&&height" class="empty_icon" :src="urlImg" :style="{'width':width+'rpx','height':height+'rpx'}"></image> <image mode="widthFix" v-if="urlImg&&width&&height" class="empty_icon" :src="urlImg" :style="{'width':width+'rpx','height':height+'rpx'}"></image>
<image mode="widthFix" @click="close" v-if="urlImg&&titleWidth&&titleHeight" class="tititle" :src="buttonImg" :style="{'width':titleWidth+'rpx','height':titleHeight+'rpx'}"></image>
</u-popup> </u-popup>
</template> </template>
...@@ -13,6 +14,9 @@ ...@@ -13,6 +14,9 @@
}, },
urlImg() { urlImg() {
return this.$popupStore.state.url return this.$popupStore.state.url
},
buttonImg() {
return this.$popupStore.state.title
} }
}, },
watch:{ watch:{
...@@ -26,6 +30,17 @@ ...@@ -26,6 +30,17 @@
this.height = image.height>wheight?wheight:image.height this.height = image.height>wheight?wheight:image.height
} }
}) })
},
buttonImg(val) {
uni.getImageInfo({
src: val,
success:(image)=> {
const wheight = uni.getSystemInfoSync().windowHeight;
const wwidth = uni.getSystemInfoSync().windowWidth;
this.titleWidth = image.width>wwidth?wwidth:image.width
this.titleHeight = image.height>wheight?wheight:image.height
}
})
} }
}, },
data() { data() {
...@@ -33,6 +48,8 @@ ...@@ -33,6 +48,8 @@
percent: 0, percent: 0,
width:0, width:0,
height:0, height:0,
titleWidth:0,
titleHeight:0,
flag:false flag:false
}; };
}, },
...@@ -45,4 +62,7 @@ ...@@ -45,4 +62,7 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.tititle {
margin: 80rpx auto;
}
</style> </style>
\ No newline at end of file
...@@ -5,14 +5,14 @@ export default function initPopup(v) { ...@@ -5,14 +5,14 @@ export default function initPopup(v) {
v.prototype.$popupStore = new Vuex.Store({ v.prototype.$popupStore = new Vuex.Store({
state: { state: {
show:false, show:false,
url:"" url:"",
title:""
}, },
mutations: { mutations: {
closePopup(state,data) { closePopup(state,data) {
state.show = false state.show = false
}, },
showPopup(state,data) { showPopup(state,data) {
console.log(data)
state = Object.assign(state,data) state = Object.assign(state,data)
state.show = true state.show = true
}, },
......
...@@ -252,9 +252,9 @@ export default { ...@@ -252,9 +252,9 @@ export default {
return uni.$u.http return uni.$u.http
.post("/v1/issue/return/user/coupon", params) .post("/v1/issue/return/user/coupon", params)
.then((res) => { .then((res) => {
const { url,flag } = res.data.data const { url,flag,title } = res.data.data
if(flag===1) { if(flag===1) {
context.showPopup({ url: url }); context.showPopup({ url: url,title: title });
} }
return res; return res;
}) })
......
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