瀏覽代碼

优化部分设置页面

LinWuTai 2 周之前
父節點
當前提交
e8e8f3664d
共有 4 個文件被更改,包括 84 次插入36 次删除
  1. 9 1
      pages/initial/initial.vue
  2. 50 6
      pages/setting/cancelAccount/cancelAccount.vue
  3. 21 25
      pages/setting/removeInfo/removeInfo.vue
  4. 4 4
      utils/baseurl.js

+ 9 - 1
pages/initial/initial.vue

@@ -40,10 +40,12 @@
 </template>
 
 <script setup>
+	import { onLoad } from '@dcloudio/uni-app'
 	import { wxLoginOpenid, wxloginPhone } from '@/api/login.js'
 	import {
 		msg,
-		msgSuccess
+		msgSuccess,
+		alert
 	} from "@/utils/common.js"
 	import { ref } from 'vue'
 	import {
@@ -141,6 +143,12 @@
 			msg('取消授权手机号');
 		}
 	}
+	
+	onLoad((load) => {
+		if (load.isCancelAccount) {
+			alert('账号注销7个工作日内,您无法通过相同手机号或身份证重新注册/登录广州市房地产中介协会会员中心小程序账号。', '提示')
+		}
+	})
 </script>
 <style lang="scss">
 	.form-item .u-input--border {

+ 50 - 6
pages/setting/cancelAccount/cancelAccount.vue

@@ -1,14 +1,17 @@
 <template>
 	<view class="container">
 		<view class="desc-box">
-			重要提醒:注销申请一旦提交,将无法撤销,且系统可能无法恢复相关数据,请您务必谨慎操作!
+			<view class="desc-text">您正在申请广州市房地产中介协会会员中心小程序账户注销,为保障您的权益,我们再次提醒您:</view>
+			<view class="desc-text">1、注销申请一旦提交,将无法撤销,且系统可能无法恢复相关数据,请您务必谨慎操作!我们将在您申请注销账号起15个工作日内完成与该账号相关的数据处理工作。</view>
+			<view class="desc-text">2、账号注销7个工作日内,您无法通过相同手机号或身份证重新注册/登录广州市房地产中介协会会员中心小程序账号。</view>
+			<view class="desc-text">3、如您在注销账号的过程中遇到任何问题,请拨打协会客服热线(020-66676400)与我们取得联系。</view>
 		</view>
 		<view class="form-box">
 			<u-form :model="formData.form" ref="formRef" label-width="120" :label-style="{fontWeight: 'bold', fontSize: '26rpx'}">
 				<u-form-item prop="phone">
 					<view class="input-code">
 						<view class="input">
-							<u-input v-model="formData.form.phone" :border="true" type="text" placeholder="请输入绑定手机号"/>
+							<u-input v-model="formData.form.phone" disabled :border="true" type="text" placeholder="请输入绑定手机号"/>
 						</view>
 						<view class="btn">
 							<text class="form-item-text" @click="getCode">{{tips}}</text>
@@ -21,7 +24,10 @@
 			</u-form>
 		</view>
 		<view class="bottom-box">
-			<u-button type="primary" shape="circle" @click="onSubmit">确定注销</u-button>
+			<u-checkbox-group style="display: flex;justify-content: center;margin-bottom: 20rpx;">
+				<u-checkbox v-model="cancelCheck" name="yes" shape="circle" label-size="26">我已阅读并同意&#x300A;会员中心小程序账号注销通知&#x300B;</u-checkbox>
+			</u-checkbox-group>
+			<u-button type="primary" shape="circle" @click="onSubmit">提交</u-button>
 		</view>
 	</view>
 </template>
@@ -30,12 +36,19 @@
 	import { ref, reactive } from 'vue'
 	import { onLoad, onReady } from '@dcloudio/uni-app'
 	import { msgError, msgSuccess, showConfirm } from '@/utils/common'
+	import { useAuthStore } from '@/store/authStore'
+	import {
+		smsSend
+	} from "@/api/login.js"
+	
+	const authStore = useAuthStore()
 	
 	const formRef = ref()
 	const formData = reactive({
 		form: {
 			phone: null,
-			code: null
+			code: null,
+			captchaUuid: null
 		},
 		rules: {
 			phone: [
@@ -56,7 +69,25 @@
 			],
 		}
 	})
+	const isAwaitCode = ref(false)
 	const tips = ref('获取验证码') // 59秒重新获取
+	const cancelCheck = ref(false)
+	function getCode() {
+		let {phone} = formData.form
+		if (!isAwaitCode.value) {
+			smsSend({phone}).then(res => {
+				if (res && res.data.captchaUuid) {
+					formData.form.captchaUuid = res.data.captchaUuid
+					isSendCode.value = true
+					setTimeout(() => {
+						
+					}, 60 * 1000)
+				}
+			})
+		} else {
+			msg('倒计时结束后再发送');
+		}
+	}
 	
 	function onSubmit() {
 		formRef.value.validate((valid) => {
@@ -64,6 +95,11 @@
 				// 提交
 				showConfirm('是否确认注销').then(res => {
 				 	if (res.confirm) {
+						authStore.clearAuthToken()
+						authStore.cleanUserInfo()
+						uni.reLaunch({
+							url: '/pages/initial/initial?isCancelAccount=1'
+						})
 				 	}
 				})
 			}
@@ -73,6 +109,9 @@
 	onReady(() => {
 		formRef.value.setRules(formData.rules)
 	})
+	 onLoad(() => {
+		 formData.form.phone = authStore.phone
+	 })
 </script>
 
 <style lang="scss" scoped>
@@ -83,10 +122,15 @@
 		padding: 20rpx;
 		
 		.desc-box {
-			text-indent: 2em;
-			line-height: 60rpx;
 			padding: 20rpx 0;
 			margin-bottom: 20rpx;
+			.desc-text {
+				text-indent: 2em;
+				line-height: 60rpx;
+				&:nth-child(1) {
+					text-indent: 0em;
+				}
+			}
 		}
 		
 		.form-box {

+ 21 - 25
pages/setting/removeInfo/removeInfo.vue

@@ -6,6 +6,8 @@
 		<view class="form-box">
 			<u-checkbox-group @change="checkboxGroupChange" shape="circle" wrap>
 				<u-checkbox
+				icon-size="42"
+				label-size="38"
 					v-model="item.checked" 
 					v-for="(item, index) in checkOption" :key="index" 
 					:name="item.name"
@@ -24,49 +26,43 @@
 	import { msgError, msgSuccess, showConfirm } from '@/utils/common'
 	import { removeInfo } from '@/api/setting.js'
 	
-	const params = [
+	const checkOption = ref([
 		{
 			value: 1,
-			name: '消息'
+			name: '消息',
+			checked: false,
+			disabled: false
 		},
 		{
 			value: 2,
-			name: '浏览历史'
+			name: '浏览历史',
+			checked: false,
+			disabled: false
 		},
 		{
 			value: 3,
-			name: '收藏'
+			name: '收藏',
+			checked: false,
+			disabled: false
 		},
 		{
 			value: 4,
-			name: '评论'
+			name: '评论',
+			checked: false,
+			disabled: false
 		},
 		{
 			value: 5,
-			name: '点赞'
-		},
-		{
-			value: 6,
-			name: '订单(关闭)'
-		},
-	]
-	
-	const checkOption = ref([
-		// {
-		// 	name: '浏览记录',
-		// 	checked: false,
-		// 	disabled: false
-		// },
-		{
-			name: '收藏',
+			name: '点赞',
 			checked: false,
 			disabled: false
 		},
 		{
-			name: '评论',
+			value: 6,
+			name: '订单(关闭)',
 			checked: false,
 			disabled: false
-		}
+		},
 	])
 	
 	const isSelect = computed(() => {
@@ -80,8 +76,7 @@
 	function onSubmit() {
 		showConfirm('是否确认删除').then(res => {
 		 	if (res.confirm) {
-				const selectOption = checkOption.value.filter(item => item.checked)
-				const selectType = params.filter(item => selectOption.find(s =>  s.name === item.name)).map(item => item.value)
+				const selectType = checkOption.value.filter(item => item.checked).map(item => item.value)
 				const form = {
 					type: `${selectType}`
 				}
@@ -116,6 +111,7 @@
 		
 		.form-box {
 			padding: 20rpx 0;
+			line-height: 2.8;
 			
 			.input-code {
 				display: flex;

+ 4 - 4
utils/baseurl.js

@@ -2,11 +2,11 @@ let BASE_URL = ''
 let FILE_URL = ''
 // baseurl  联调时改url
 if (process.env.NODE_ENV == 'development') {
-	BASE_URL = 'https://www.gzrea.cn:8443/wxmp/api';
-	FILE_URL = 'https://www.gzrea.cn:8443/wxmp/static/icon';
+	BASE_URL = 'https://www.gzrea.cn/wxmp/api';
+	FILE_URL = 'https://www.gzrea.cn/wxmp/static/icon';
 }else{
-	BASE_URL = 'https://www.gzrea.cn:8443/wxmp/api';
-	FILE_URL = 'https://www.gzrea.cn:8443/wxmp/static/icon';
+	BASE_URL = 'https://www.gzrea.cn/wxmp/api';
+	FILE_URL = 'https://www.gzrea.cn/wxmp/static/icon';
 }
 
 const configService = {