Files
aida_front/src/component/Account/frontPage/cancelRenewal.vue

244 lines
5.5 KiB
Vue
Raw Normal View History

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">
2024-12-23 16:23:18 +08:00
<div>{{ $t('cancelRenewal.cancelling') }}</div>
2024-12-11 16:26:36 +08:00
</div>
2025-01-24 13:41:13 +08:00
<div class="cause_list">
<label class="cause_item" v-for="item in causeList" :key="item.vlaue">
<input type="checkbox" name="cause" v-model="selectedOptions" :value="item.value">
<div>{{ item.str }}</div>
</label>
<textarea v-model="textareaValue" placeholder="Share your feedback here..."></textarea>
</div>
2024-12-11 16:26:36 +08:00
</div>
2024-12-18 17:38:43 +08:00
<div class="cancel_box_item cancel_box_item2">
<div class="modal_title_text">
2024-12-23 16:23:18 +08:00
<div>{{ $t('cancelRenewal.subscription') }}</div>
2024-12-18 17:38:43 +08:00
<div>
<i class="fi fi-sr-circle-xmark"></i>
2024-12-23 16:23:18 +08:00
<div class="modal_title_text_assistant">{{ $t('cancelRenewal.looseDate') }}</div>
2024-12-18 17:38:43 +08:00
</div>
<div>
<i class="fi fi-sr-circle-xmark"></i>
2024-12-23 16:23:18 +08:00
<div class="modal_title_text_assistant">{{ $t('cancelRenewal.looseCustomizations') }}</div>
2024-12-18 17:38:43 +08:00
</div>
</div>
<div class="tips">
<i class="fi fi-sr-triangle-warning"></i>
2024-12-23 16:23:18 +08:00
<div>{{ $t('cancelRenewal.DonWorry') }}</div>
2024-12-18 17:38:43 +08:00
</div>
<div class="button_box">
2024-12-23 16:23:18 +08:00
<div class="gallery_btn white" @click="subscribe">{{ $t('cancelRenewal.Continue') }}</div>
<div class="gallery_btn" @click="cancelSubscription">{{ $t('cancelRenewal.cancel') }}</div>
2024-12-18 17:38:43 +08:00
</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">
2024-12-23 16:23:18 +08:00
{{ $t('cancelRenewal.subscriptionRenewal') }}
2024-12-18 17:38:43 +08:00
</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();
2025-01-24 13:41:13 +08:00
const {t} = useI18n()
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({
2024-12-18 17:38:43 +08:00
textareaValue:'',
isShowMark:false,
2025-01-24 13:41:13 +08:00
causeList:[
{
vlaue:'Too expensive',
str:t('account.jsContent1'),
},{
value:'Sytem not user friendly',
str:t('account.jsContent2'),
},{
value:'Too Slowy',
str:t('account.jsContent3'),
},{
value:'Difficult to edit',
str:t('account.jsContent4'),
},{
value:'Insufficlent Tutorial/Support',
str:t('account.jsContent5'),
},{
value:'Unable to generate what you need',
str:t('account.jsContent6'),
}
],
selectedOptions:[]
2024-12-11 16:26:36 +08:00
})
let renew = ref()
const subscribe = ()=>{
renew.value.init()
}
2024-12-18 17:38:43 +08:00
const cancelSubscription = ()=>{
2025-01-24 13:41:13 +08:00
let str = ''
accountHomeData.selectedOptions.forEach((item:any)=>{
str += ' #' + item
})
2024-12-18 17:38:43 +08:00
let data = {
subscriptionId:userDetail.value.subscriptionId,
2025-01-24 13:41:13 +08:00
reason:accountHomeData.textareaValue + str,
2024-12-18 17:38:43 +08:00
}
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
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{
2025-01-17 17:16:01 +08:00
height: 100%;
overflow-y: auto;
2025-01-24 13:41:13 +08:00
padding-bottom: 2rem;
2024-12-18 17:38:43 +08:00
>div{
display: flex;
2024-12-23 11:17:41 +08:00
flex-direction: column;
2024-12-18 17:38:43 +08:00
align-items: center;
&.no_renewal{
font-size: 2rem;
font-weight: 400;
}
}
2024-12-11 16:26:36 +08:00
.cancel_box_item{
2024-12-23 11:17:41 +08:00
margin-bottom: 3rem;
width: 100%;
2024-12-11 16:26:36 +08:00
>.modal_title_text{
2024-12-23 11:17:41 +08:00
margin: 0;
2024-12-11 16:26:36 +08:00
>div{
font-weight: 600;
}
.modal_title_text_assistant{
margin-top: 1rem;
2024-12-23 11:17:41 +08:00
font-weight: 600;
2024-12-11 16:26:36 +08:00
}
}
>.gallerySelect{
width: 100%;
:deep(.ant-select-selector){
border-radius: 1.4rem;
}
}
2025-01-24 13:41:13 +08:00
>.cause_list{
> .cause_item{
display: flex;
input{
margin-right: 1rem;
}
}
>textarea{
margin-top: 1.5rem;
width: 100%;
border-radius: 1.4rem;
border: 1px solid #D0D0D0;
height: 11rem !important;
font-size: 1.6rem;
transition: border .3s;
padding: 1.5rem;
}
>textarea:hover{
border: 1px solid #000;
}
2024-12-11 16:26:36 +08:00
}
2025-01-24 13:41:13 +08:00
2024-12-11 16:26:36 +08:00
>.button_box{
display: flex;
margin-top: 2.5rem;
2024-12-23 11:17:41 +08:00
justify-content: flex-end;
>div:nth-child(1){
margin-right: 1rem;
// width: calc((100% - 1rem) / 2);
2024-12-11 16:26:36 +08:00
}
}
}
.cancel_box_item:last-child{
margin: 0;
}
.cancel_box_item2{
.modal_title_text{
>div:nth-child(1){
2024-12-23 11:17:41 +08:00
margin-bottom: 2rem;
2024-12-11 16:26:36 +08:00
}
>div:nth-child(2){
margin-bottom: 1.5rem;
}
>div:nth-child(2),>div:nth-child(3){
display: flex;
align-items: center;
>.modal_title_text_assistant{
margin: 0;
}
>i{
margin-right: 1.5rem;
display: flex;
}
}
2024-12-23 11:17:41 +08:00
>div:nth-child(3){
margin-bottom: 2rem;
}
2024-12-11 16:26:36 +08:00
}
.tips{
padding: 1.5rem 1rem;
display: flex;
align-items: center;
margin-bottom: 3rem;
background: #f3f3f6;
border-radius: 1.4rem;
border: 1px solid #D0D0D0;
>i{
margin-right: 1.3rem;
}
>div{
font-size: 1.6rem;
font-weight: 400;
}
}
}
}
</style>