|
@ -1,121 +1,111 @@ |
|
|
<template> |
|
|
<template> |
|
|
<uv-popup |
|
|
|
|
|
ref="popup" |
|
|
|
|
|
:overlayOpacity="0.8" |
|
|
|
|
|
:customStyle="{ |
|
|
|
|
|
backgroundColor: 'transparent', |
|
|
|
|
|
}" |
|
|
|
|
|
> |
|
|
|
|
|
<view class="flex content"> |
|
|
|
|
|
<template v-if="mode === 'activate'"> |
|
|
|
|
|
<image class="popup-bg" src="@/pages_order/static/center/activate-code.png"></image> |
|
|
|
|
|
|
|
|
<uv-popup ref="popup" :overlayOpacity="0.8" :customStyle="{ |
|
|
|
|
|
backgroundColor: 'transparent', |
|
|
|
|
|
}"> |
|
|
|
|
|
<view class="flex content"> |
|
|
|
|
|
<template v-if="mode === 'activate'"> |
|
|
|
|
|
<image class="popup-bg" src="@/pages_order/static/center/activate-code.png"></image> |
|
|
|
|
|
|
|
|
<view class="flex popup-btns"> |
|
|
|
|
|
<button plain class="btn-simple" @click="close"> |
|
|
|
|
|
<image class="popup-btn" src="@/pages_order/static/center/cancel.png"></image> |
|
|
|
|
|
</button> |
|
|
|
|
|
<button plain class="btn-simple" @click="onConfirm"> |
|
|
|
|
|
<image class="popup-btn" src="@/pages_order/static/center/confirm.png"></image> |
|
|
|
|
|
</button> |
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
<view class="flex popup-btns"> |
|
|
|
|
|
<button plain class="btn-simple" @click="close"> |
|
|
|
|
|
<image class="popup-btn" src="@/pages_order/static/center/cancel.png"></image> |
|
|
|
|
|
</button> |
|
|
|
|
|
<button plain class="btn-simple" @click="onConfirm"> |
|
|
|
|
|
<image class="popup-btn" src="@/pages_order/static/center/confirm.png"></image> |
|
|
|
|
|
</button> |
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
<uv-input |
|
|
|
|
|
v-model="code" |
|
|
|
|
|
:focus="true" |
|
|
|
|
|
inputAlign="center" |
|
|
|
|
|
color="#3DFEE0" |
|
|
|
|
|
fontSize="45rpx" |
|
|
|
|
|
border="none" |
|
|
|
|
|
:customStyle="{ |
|
|
|
|
|
backgroundColor: 'transparent', |
|
|
|
|
|
width: '250rpx', |
|
|
|
|
|
height: '63rpx', |
|
|
|
|
|
position: 'absolute', |
|
|
|
|
|
top: '216rpx', |
|
|
|
|
|
left: '160rpx', |
|
|
|
|
|
}" |
|
|
|
|
|
></uv-input> |
|
|
|
|
|
</template> |
|
|
|
|
|
<template v-else> |
|
|
|
|
|
<image class="popup-bg" src="@/pages_order/static/center/not-agent.png"></image> |
|
|
|
|
|
<view class="flex popup-btns"> |
|
|
|
|
|
<button plain class="btn-simple" @click="close"> |
|
|
|
|
|
<image class="popup-btn" src="@/pages_order/static/center/cancel.png"></image> |
|
|
|
|
|
</button> |
|
|
|
|
|
<button plain class="btn-simple" @click="mode = 'activate'" > |
|
|
|
|
|
<image class="popup-btn" src="@/pages_order/static/center/activate.png"></image> |
|
|
|
|
|
</button> |
|
|
|
|
|
|
|
|
<uv-input v-model="code" :focus="true" inputAlign="center" color="#3DFEE0" fontSize="45rpx" |
|
|
|
|
|
border="none" :customStyle="{ |
|
|
|
|
|
backgroundColor: 'transparent', |
|
|
|
|
|
width: '250rpx', |
|
|
|
|
|
height: '63rpx', |
|
|
|
|
|
position: 'absolute', |
|
|
|
|
|
top: '216rpx', |
|
|
|
|
|
left: '160rpx', |
|
|
|
|
|
}"></uv-input> |
|
|
|
|
|
</template> |
|
|
|
|
|
<template v-else> |
|
|
|
|
|
<image class="popup-bg" src="@/pages_order/static/center/not-agent.png"></image> |
|
|
|
|
|
<view class="flex popup-btns"> |
|
|
|
|
|
<button plain class="btn-simple" @click="close"> |
|
|
|
|
|
<image class="popup-btn" src="@/pages_order/static/center/cancel.png"></image> |
|
|
|
|
|
</button> |
|
|
|
|
|
<button plain class="btn-simple" @click="mode = 'activate'"> |
|
|
|
|
|
<image class="popup-btn" src="@/pages_order/static/center/activate.png"></image> |
|
|
|
|
|
</button> |
|
|
|
|
|
</view> |
|
|
|
|
|
</template> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
|
|
|
</view> |
|
|
|
|
|
</uv-popup> |
|
|
|
|
|
|
|
|
</uv-popup> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
export default { |
|
|
|
|
|
|
|
|
export default { |
|
|
props: { |
|
|
props: { |
|
|
role: { |
|
|
|
|
|
default: null |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
role: { |
|
|
|
|
|
default: null |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
|
|
|
return { |
|
|
|
|
|
mode: '', |
|
|
|
|
|
code: '', |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
data() { |
|
|
|
|
|
return { |
|
|
|
|
|
mode: '', |
|
|
|
|
|
code: '', |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
open(role) { |
|
|
|
|
|
this.mode = role ? 'activate' : '' |
|
|
|
|
|
this.$refs.popup.open(); |
|
|
|
|
|
}, |
|
|
|
|
|
close() { |
|
|
|
|
|
this.$refs.popup.close(); |
|
|
|
|
|
}, |
|
|
|
|
|
async onConfirm() { |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
|
open(role) { |
|
|
|
|
|
this.mode = role ? 'activate' : '' |
|
|
|
|
|
this.$refs.popup.open(); |
|
|
|
|
|
}, |
|
|
|
|
|
close() { |
|
|
|
|
|
this.$refs.popup.close(); |
|
|
|
|
|
}, |
|
|
|
|
|
async onConfirm() { |
|
|
|
|
|
|
|
|
await this.$fetch('openVip', { code: this.code }) |
|
|
|
|
|
|
|
|
|
|
|
this.$store.commit('getUserInfo') |
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: '激活成功', |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
this.close() |
|
|
|
|
|
} catch (err) { |
|
|
|
|
|
|
|
|
await this.$fetch('openVip', { code: this.code }) |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.$store.commit('getUserInfo') |
|
|
|
|
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: '激活成功', |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.close() |
|
|
|
|
|
} catch (err) { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
<style scoped lang="scss"> |
|
|
.content { |
|
|
.content { |
|
|
position: relative; |
|
|
|
|
|
flex-direction: column; |
|
|
|
|
|
width: 570rpx; |
|
|
|
|
|
|
|
|
position: relative; |
|
|
|
|
|
flex-direction: column; |
|
|
|
|
|
width: 570rpx; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.popup { |
|
|
.popup { |
|
|
&-bg { |
|
|
|
|
|
width: 514rpx; height: 355rpx; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
&-bg { |
|
|
|
|
|
width: 514rpx; |
|
|
|
|
|
height: 355rpx; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
&-btns { |
|
|
|
|
|
justify-content: space-between; |
|
|
|
|
|
margin-top: 56rpx; |
|
|
|
|
|
width: 100%; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
&-btns { |
|
|
|
|
|
justify-content: space-between; |
|
|
|
|
|
margin-top: 56rpx; |
|
|
|
|
|
width: 100%; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
&-btn { |
|
|
|
|
|
width: 265rpx; |
|
|
|
|
|
height: 84rpx; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
&-btn { |
|
|
|
|
|
width: 265rpx; |
|
|
|
|
|
height: 84rpx; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |