ufutx_love_mp/src/pages/users/logout.wpy
2024-09-29 11:01:17 +08:00

470 lines
13 KiB
Plaintext

<template>
<view class="wrapper font_28">
<view class="ui-logout-tip">关闭资料将被移出所有群聊及删除相关聊天信息</view>
<view class="head bold text-black">关闭资料将无法使用福恋平台,他人也无法再看到你的个人信息,请谨慎考虑</view>
<view class="font_28 color-999" style="padding-top: 60rpx">请选择关闭资料的原因,帮助福恋更好地改进</view>
<view class="container">
<radio-group class="radio-group">
<view class="radio" v-for="(item,index) in items" :key="index" @tap="radioChange(item.text)">
<radio value="{{item.text}}" class="itemRadio flo_l mainColor" checked="{{item.checked}}" />
<view class="flo_l _text">{{item.text}}</view>
</view>
</radio-group>
</view>
<view class="themes" v-if="selectId==6">
<textarea class="textarea font_28 color-666 text-left" maxlength="50" placeholder="请告诉福恋,你关闭资料的其他原因吧" @input="typing('content')" @blur="typing('content')" adjust-position="true" value="{{content}}" />
<view class="font_24 text-right" style="color: #c2c2c2">{{content.length}}/50</view>
</view>
<view class="font_32 sendButton" @tap="ShutDown">关闭资料</view>
</view>
<view class="cu-modal {{modalName=='Modal2'?'show':''}}">
<view class="audit_photo_box">
<view class="_bgModal1"></view>
</view>
</view>
<view class="cu-modal {{modalName=='Modal1'?'show':''}}">
<view class="audit_photo_box">
<view class="cancel_icon_box" @tap="hideModal1">
<!-- <image src="https://images.ufutx.com/202012/21/7bc531d74f41cce95ede5582232fd2f3.png" mode="widthFix" class="cancel_icon"></image> -->
<view style="font-size: 24px" class="font_family cuIcon-roundclose white"></view>
</view>
<view style="text-align: center">
<view class="_bgModal">
<view class="_text textarea">
<view class="font_26 bold">联系脱单姐领取脱单彩蛋</view>
<view class="font_26 bold">18922809346</view>
</view>
<view class="_gif"></view>
<view class="_bgBtn" @tap="callPhone('18922809346')"></view>
</view>
</view>
</view>
</view>
<view class="cu-modal {{modalName=='Modal'?'show':''}}">
<view class="prompt_box">
<image class="prompt_icon" src="https://images.ufutx.com/202105/31/7074259ebed4ba2688afcdeadc429db1.png" mode="widthFix"></image>
<view class="font_36 color-333 bold">是否确定关闭资料</view>
<view class="prompt_text font_28 color-333">关闭资料后,用户将视为已找到伴侣,再打开将影响匹配准确度,您将被移出所有群聊及删除相关聊天信息~</view>
<view class="know_that_box">
<view class="know_that" @tap="getLogout">确定</view>
<view class="know_thatV2" @tap="hideModal">取消</view>
</view>
</view>
</view>
<view class="cu-modal {{modalName=='secondType'?'show':''}}">
<view class="prompt_box">
<image class="prompt_icon" src="https://images.ufutx.com/202105/31/7074259ebed4ba2688afcdeadc429db1.png" mode="widthFix"></image>
<view class="font_36 color-333 bold">是否转为介绍人</view>
<view class="prompt_text font_28 color-333">有对应婚姻课程也可帮助其他单身找对象~</view>
<view class="know_that_box">
<view class="know_that" @tap="getLogoutV2">确定</view>
<view class="know_thatV2" @tap="hideModalV2">取消</view>
</view>
</view>
</view>
</template>
<script>
import wepy from '@wepy/core'
import { service } from '../../config.js'
import https from '../../mixins/https'
import base from '../../mixins/base'
wepy.page({
mixins: [base, https],
config: {
navigationBarTitleText: '关闭资料'
},
components: {},
data: {
throttling: true,
loaded: false,
init: false,
modalName: '',
content: '',
items: [],
value: '',
showSecondType: false, // 找到伴侣二次确认
selectId: 0
},
async onLoad(e) {
this.profileOptions()
setTimeout(() => {
this.init = true
}, 500)
},
onShow() {
},
onPullDownRefresh() {
},
onReachBottom() {
},
methods: {
profileOptions () {
let that = this
that.$get({url: `${service.host}/setting/hidden/profile/options`}).then(({code, data}) => {
try {
data.forEach(item => {
item.checked = false
})
that.items = data
} catch (e) {}
})
},
typing(type, e) {
this[type] = e.detail.value
console.log(this[type])
},
callPhone (phone) {
let vm = this
wx.makePhoneCall({
phoneNumber: phone,
success: function () {
vm.modalName = ''
wx.redirectTo({url: '/pages/users/logoutDefault'})
console.log('拨打电话成功!')
// resolve(res)
},
fail: function () {
console.log('拨打电话失败!')
vm.modalName = ''
wx.redirectTo({url: '/pages/users/logoutDefault'})
}
})
},
hideModal1 () {
this.modalName = ''
console.log(this.showSecondType, '77777777777')
if (!this.showSecondType) {
wx.redirectTo({url: '/pages/users/logoutDefault'})
} else {
wx.redirectTo({url: '/pages/marriedPage/home'})
}
},
hideModal () {
this.modalName = ''
wx.navigateBack({
back: 1
})
},
ShutDown() {
let vm = this
vm.showSecondType = false
if (!vm.value) {
vm.$showToast('请选择你想要关闭资料的原因')
return
}
if (vm.value == '其它原因' && !vm.content) {
vm.$showToast('请输入其它原因')
return
}
if (vm.value == '其它原因' && vm.content) {
vm.value = `其它原因:${vm.content}`
}
if (vm.value == '已经在福恋找到伴侣了' || vm.value == '通过其它方式找到伴侣了') {
vm.showSecondType = true
}
console.log(vm.value)
vm.modalName = 'Modal'
},
radioChange(text) {
let that = this
try {
that.value = text
that.items.forEach((item, index) => {
if (item.text == text) {
item.checked = true
that.selectId = item.id
} else {
item.checked = false
}
})
} catch (e) {}
},
goto(url) {
wx.navigateTo({url: url})
},
getLogout() {
let vm = this,
data = {
type: 'ALLSEX',
reason: vm.value
}
if (vm.throttling) {
vm.throttling = false
vm.$post({url: `${service.host}/setting/hidden/profile`, data}).then(({code, res}) => {
if (vm.selectId == 1 || vm.selectId == 2) {
wx.vibrateLong({
success: () => {
setTimeout(() => {
vm.modalName = 'Modal2'
}, 200)
}
})
setTimeout(() => {
vm.modalName = 'Modal1'
}, 1600)
return
}
wx.redirectTo({url: '/pages/users/logoutDefault'})
vm.throttling = true
})
}
},
getLogoutV2() {
let vm = this,
data = {
type: 'ALLSEX',
reason: vm.value,
convert_marriage: '1'
}
console.log(vm.value)
if (vm.throttling) {
vm.throttling = false
vm.$put({url: `${service.host}/setting/hidden/profile`, data}).then(({code, res}) => {
if (vm.selectId == 1 || vm.selectId == 2) {
wx.vibrateLong({
success: () => {
setTimeout(() => {
vm.modalName = 'Modal2'
}, 200)
}
})
setTimeout(() => {
vm.modalName = 'Modal1'
}, 1600)
return
}
wx.redirectTo({url: '/pages/users/logoutDefault'})
vm.throttling = true
})
}
},
hideModalV2 () {
let vm = this,
data = {
type: 'ALLSEX',
reason: vm.value
}
console.log(vm.value)
if (vm.throttling) {
vm.throttling = false
vm.$put({url: `${service.host}/setting/hidden/profile`, data}).then(({code, res}) => {
vm.showSecondType = false
if (vm.selectId == 1 || vm.selectId == 2) {
wx.vibrateLong({
success: () => {
setTimeout(() => {
vm.modalName = 'Modal2'
}, 200)
}
})
setTimeout(() => {
vm.modalName = 'Modal1'
}, 1600)
return
}
wx.redirectTo({url: '/pages/users/logoutDefault'})
vm.throttling = true
})
}
}
}
})
</script>
<style lang="less">
page{
.container{
background:#fff;
}
.ui-logout-tip{
width: 100%;
padding: 12rpx 20rpx;
border: 2rpx solid #ffc780;
background: #fff4e6;
border-radius: 16rpx;
//background: ;
}
background: white;
.audit_photo_box {
position: relative;
display: inline-block;
vertical-align: middle;
margin-left: auto;
margin-right: auto;
width: 100%;
max-width: 100%;
.cancel_icon_box {
width: 100rpx;
height: 100rpx;
position: absolute;
transform: translateX(-50%);
right: -4%;
top: 0rpx;
z-index: 2;
.cancel_icon {
width: 40rpx;
height: 40rpx;
margin-top: 20rpx;
}
}
._bgModal1{
background-image: url("https://image.fulllinkai.com/202203/09/f500112df1961fe312cd707e4debbcc3.gif");
background-size: contain;
background-position: center;
background-repeat: no-repeat;
width: 92%;
min-height: 600rpx;
}
._bgModal{
background-image: url("https://image.fulllinkai.com/202203/09/59b753f504fe91737952050744b5dd86.png");
background-size: cover;
background-position: center;
width: 100%;
min-height: 800rpx;
._gif{
background-image: url("https://image.fulllinkai.com/202203/09/ba2331d0820651c13e9360485334f7b6.gif");
background-size: cover;
background-position: center;
width: 220rpx;
min-height: 220rpx;
position: absolute;
bottom: 150rpx;
left: 7%;
}
._text{
position: absolute;
bottom: 24%;
left: 1%;
}
}
._bgBtn{
width: 280rpx;
height: 86rpx;
//background: red;
position: absolute;
bottom: 130rpx;
left: 32%;
}
}
.wrapper{
padding: 30rpx;
.radio-group{
width: 100%;
.radio{
overflow: hidden;
}
.itemRadio{
transform: scale(.8);
}
._text{
margin-left: 6rpx;
margin-top: 4rpx;
}
}
.btn-box{
width:88%;
background: #ff5380;
border-radius: 6rpx;
padding: 16rpx;
margin: 42rpx auto;
margin-bottom: -28rpx;
letter-spacing: 8rpx;
}
}
.head{
padding-top: 22rpx;
}
.container{
margin-top: 12rpx;
.radio{
padding: 18rpx 0;
}
}
.closeBtn{
width: 220rpx;
height: 60rpx;
line-height: 60rpx;
margin: 32rpx auto;
border-radius: 6rpx;
}
}
.themes{
width: 636rpx;
margin-left: 50rpx;
overflow: hidden;
padding: 16rpx 26rpx;
background: #f5f5f5;
border-radius: 16rpx;
}
.textarea{
width: 100%;
height: 130rpx;
}
.sendButton{
width: 400rpx;
height: 80rpx;
border-radius: 40rpx;
background: linear-gradient(90deg, #ff5380 0%, #ff85a5 100%);
color: #ffffff;
display: flex;
justify-content: center;
align-items: center;
margin: 66rpx auto 0 auto;
}
.prompt_box{
position: relative;
display: inline-block;
vertical-align: middle;
margin-left: auto;
margin-right: auto;
width: 600rpx;
max-width: 100%;
background-color: #ffffff;
border-radius: 24rpx;
overflow: hidden;
.prompt_icon{
width: 560rpx;
height: 320rpx;
display: block;
margin: 20rpx auto 2rpx auto;
}
.prompt_text{
padding-top: 40rpx;
margin: 0 36rpx;
}
.know_that_box{
margin: 60rpx 80rpx;
display: flex;
justify-content: space-between;
}
.know_that, .know_thatV2{
width: 190rpx;
height: 66rpx;
background: #ff5380;
border-radius: 34rpx;
color: #ffffff;
display: flex;
justify-content: center;
align-items: center;
border: 2rpx solid #FF5380;
}
.know_that{
color: #999999;
background: none;
border: 2rpx solid #D8D8D8;
}
}
</style>