2024-12-11 16:26:36 +08:00
< template >
< div class = "cancelRenewal_page" >
2024-12-18 17:38:43 +08:00
< div v-if = "userDetail.status != 'canceled'" >
< div class = "cancel_box_item" >
< div class = "modal_title_text" >
< div > Sorry to see you go < / div >
2024-12-11 16:26:36 +08:00
< div class = "modal_title_text_assistant" > What is your reason for cancelling AiDA ? < / div >
< / div >
2024-12-18 17:38:43 +08:00
< a-select class = "gallerySelect" v -model :value = "currentState.value" size = "large" optionFilterProp = "label" :options = "state" placeholder = "Select a reason" allowClear show -search > < / a-select >
< textarea v-model = "textareaValue" placeholder="Share your feedback here..." > < / textarea >
< div class = "button_box" >
2024-12-19 17:59:00 +08:00
< div class = "gallery_btn white gallery_btn_radius" @click ="subscribe" > stay subscribed < / div >
2024-12-18 17:38:43 +08:00
< div class = "gallery_btn gallery_btn_radius" @click ="cancelSubscription" > Yes , cancel it < / div >
2024-12-11 16:26:36 +08:00
< / div >
< / div >
2024-12-18 17:38:43 +08:00
< div class = "cancel_box_item cancel_box_item2" >
< div class = "modal_title_text" >
< div > You ’ re about to cancel your subscription < / div >
< div >
< i class = "fi fi-sr-circle-xmark" > < / i >
< div class = "modal_title_text_assistant" > You will loose all your date < / div >
< / div >
< div >
< i class = "fi fi-sr-circle-xmark" > < / i >
< div class = "modal_title_text_assistant" > You will loose your settings and customizations < / div >
< / div >
< / div >
< div class = "tips" >
< i class = "fi fi-sr-triangle-warning" > < / i >
< div > Don ’ t worry ! The data you have in AiDA will be
safe . < / div >
< / div >
< div class = "button_box" >
2024-12-19 17:59:00 +08:00
< div class = "gallery_btn white gallery_btn_radius" @click ="subscribe" > stay subscribed < / div >
2024-12-18 17:38:43 +08:00
< div class = "gallery_btn gallery_btn_radius" @click ="cancelSubscription" > Yes , cancel it < / div >
< / div >
2024-12-11 16:26:36 +08:00
< / div >
< / div >
2024-12-18 17:38:43 +08:00
< div v-else class = "no_renewal" >
There are no subscription plans with automatic renewal .
< / div >
< div class = "mark_loading" v-show = "isShowMark" >
< a-spin size = "large" / >
< / div >
2024-12-11 16:26:36 +08:00
< renew ref = "renew" > < / renew >
< / div >
< / template >
< script lang = "ts" >
import { defineComponent , computed , ref , reactive , nextTick , toRefs , createVNode , onMounted } from 'vue'
import { Https } from "@/tool/https" ;
import { Modal , message } from 'ant-design-vue' ;
import { useStore } from "vuex" ;
import { useI18n } from 'vue-i18n'
import renew from "@/component/HomePage/renew.vue" ;
export default defineComponent ( {
components : {
renew ,
} ,
setup ( ) {
const store = useStore ( ) ;
2024-12-18 17:38:43 +08:00
let userDetail : any = computed ( ( ) => {
return store . state . UserHabit . userDetail
2024-12-11 16:26:36 +08:00
} )
let accountHomeData : any = reactive ( {
currentState : { value : 'income' } , //裁剪的原始文件数据
2024-12-18 17:38:43 +08:00
textareaValue : '' ,
isShowMark : false ,
2024-12-11 16:26:36 +08:00
} )
let state : any = ref ( [
{
label : useI18n ( ) . t ( 'allOrder.Income' ) ,
value : 'income' ,
} ,
{
label : useI18n ( ) . t ( 'allOrder.Expend' ) ,
value : 'expend' ,
} ,
] )
let renew = ref ( )
const subscribe = ( ) => {
renew . value . init ( )
}
2024-12-18 17:38:43 +08:00
const cancelSubscription = ( ) => {
let data = {
subscriptionId : userDetail . value . subscriptionId ,
reason : '' ,
}
accountHomeData . isShowMark = true
Https . axiosGet ( Https . httpUrls . cancelSubscription , { params : data } )
. then ( ( rv : any ) => {
message . success ( rv )
let value = {
status : 'canceled' ,
}
accountHomeData . isShowMark = false
store . commit ( "upUserDetail" , value )
} )
. catch ( ( res ) => {
accountHomeData . isShowMark = false
} ) ;
}
2024-12-11 16:26:36 +08:00
return {
... toRefs ( accountHomeData ) ,
2024-12-18 17:38:43 +08:00
userDetail ,
2024-12-11 16:26:36 +08:00
state ,
renew ,
subscribe ,
2024-12-18 17:38:43 +08:00
cancelSubscription ,
2024-12-11 16:26:36 +08:00
}
} ,
data ( ) {
return {
}
} ,
} )
< / script >
< style lang = "less" scoped >
. cancelRenewal _page {
2024-12-18 17:38:43 +08:00
> div {
display : flex ;
justify - content : center ;
align - items : flex - start ;
height : 45 rem ;
align - items : center ;
& . no _renewal {
font - size : 2 rem ;
font - weight : 400 ;
}
}
2024-12-11 16:26:36 +08:00
. cancel _box _item {
border : 2 px solid # 000 ;
border - radius : 2 rem ;
padding : 3 rem ;
margin - right : 3 rem ;
width : 48 rem ;
height : 45 rem ;
> . modal _title _text {
> div {
font - weight : 600 ;
}
. modal _title _text _assistant {
margin - top : 1 rem ;
}
}
> . gallerySelect {
width : 100 % ;
: deep ( . ant - select - selector ) {
border - radius : 1.4 rem ;
}
}
> textarea {
margin - top : 1.5 rem ;
width : 100 % ;
border - radius : 1.4 rem ;
border : 1 px solid # D0D0D0 ;
height : 11 rem ! important ;
font - size : 1.6 rem ;
transition : border .3 s ;
padding : 1.5 rem ;
}
> textarea : hover {
border : 1 px solid # 000 ;
}
> . button _box {
display : flex ;
justify - content : space - between ;
margin - top : 2.5 rem ;
> div {
width : calc ( ( 100 % - 1 rem ) / 2 ) ;
}
}
}
. cancel _box _item : last - child {
margin : 0 ;
}
. cancel _box _item2 {
. modal _title _text {
> div : nth - child ( 1 ) {
margin - bottom : 3.4 rem ;
}
> div : nth - child ( 2 ) {
margin - bottom : 1.5 rem ;
}
> div : nth - child ( 2 ) , > div : nth - child ( 3 ) {
display : flex ;
align - items : center ;
> . modal _title _text _assistant {
margin : 0 ;
}
> i {
margin - right : 1.5 rem ;
display : flex ;
}
}
}
. tips {
padding : 1.5 rem 1 rem ;
display : flex ;
align - items : center ;
margin - bottom : 3 rem ;
background : # f3f3f6 ;
border - radius : 1.4 rem ;
border : 1 px solid # D0D0D0 ;
> i {
margin - right : 1.3 rem ;
}
> div {
font - size : 1.6 rem ;
font - weight : 400 ;
}
}
}
}
< / style >