Commit 9ade4a34 by songbingqi

区分出两张图片

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