瀏覽代碼

Merge branch 'master' of http://47.92.161.104:10080/zkx/JP-ChargeTeam51

zhengkaixin 3 年之前
父節點
當前提交
d50d903689
共有 7 個文件被更改,包括 65 次插入20 次删除
  1. 17 0
      apis/user.js
  2. 6 1
      pages/index/index.vue
  3. 1 1
      pages/user/car/carAdd.vue
  4. 1 1
      pages/user/index.vue
  5. 17 2
      pages/user/logout.vue
  6. 13 15
      pages/user/phone.vue
  7. 10 0
      pages/user/setting.vue

+ 17 - 0
apis/user.js

@@ -63,4 +63,21 @@ export function carPersonAccount (data) {
 	})
 }
 
+export function deleteUser (data) {
+	 
+	return request({
+		method: 'post',
+		data:data ,
+		url: '/mobile/regUser/deleteUser'
+	})
+}
+
+export function changePhone  (data) {
+	 
+	return request({
+		method: 'post',
+		data:data ,
+		url: '/mobile/regUser/changePhone '
+	})
+}
 

+ 6 - 1
pages/index/index.vue

@@ -37,7 +37,7 @@
 				</view>
 
 			</view>
-			<view class="list-item">
+			<view class="list-item" @click="toSearchPile">
 				<view class="icon iconfont" style="background-color: #9D9FFF;">
 					&#xe622;
 				</view>
@@ -272,6 +272,11 @@
 			this.getActivityInfoList();
 		},
 		methods: {
+			toSearchPile() {
+				uni.navigateTo({
+					url: '/pages/searchPile/searchPile'
+				})
+			},
 			toLogin() {
 				uni.navigateTo({
 					url: '/pages/login/login'

+ 1 - 1
pages/user/car/carAdd.vue

@@ -11,7 +11,7 @@
 		<view class="carDet">
 			<u-form :model="form" ref="uForm">
 				<u-keyboard ref="uKeyboard" mode="car" v-model="keyShow" @change="valChange" @backspace="backspace"></u-keyboard>
-				<u-form-item label="车牌号码" label-width="150rpx"><u-input input-align="right" v-model="form.carNum" @click="keyShow=true" /></u-form-item>
+				<u-form-item label="车牌号码" label-width="150rpx"><u-input input-align="right" v-model="form.carNum" @click="keyShow=true" readonly="readonly" /></u-form-item>
 				<u-form-item label="车辆类型" label-width="150rpx"><u-input input-align="right" placeholder="新能源车" placeholder-style="color:black" disabled /></u-form-item>
 				<u-form-item label="设为默认车辆" label-width="180rpx"><u-switch slot="right" v-model="form.defaultFlag"></u-switch></u-form-item>
 			</u-form>

+ 1 - 1
pages/user/index.vue

@@ -10,7 +10,7 @@
 		</view>
 		<view class="userData">
 			<view class="userData-num" @click="toBalance">
-				<view class="userData-data">{{userId ? personAccount.availableAmount.toFixed(2) : '0.00'}}</view>
+				<view class="userData-data">{{personAccount.availableAmount != null ? personAccount.availableAmount.toFixed(2) : '0.00'}}</view>
 				<view class="userData-foot">可用余额</view>
 			</view>
 			<view class="userInfo-btn" @click="toRecharge">充值</view>

+ 17 - 2
pages/user/logout.vue

@@ -23,6 +23,8 @@
 </template>
 
 <script>
+	import * as userApi from '@/apis/user.js'
+	
 	export default {
 		data() {
 			return {
@@ -36,8 +38,21 @@
 				})
 			},
 			logout() {
-				uni.redirectTo({
-					url: '/pages/login/login'
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})		
+				userApi.deleteUser().then((res) => {
+					uni.hideLoading();
+					
+					uni.redirectTo({
+						url: '/pages/login/login'
+					})
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
 				})
 			}
 		}

+ 13 - 15
pages/user/phone.vue

@@ -23,6 +23,7 @@
 </template>
 
 <script>
+	import * as loginApi from '@/apis/login.js'
 	import {
 		checkPhone
 	} from '@/utils'
@@ -114,25 +115,22 @@
 					return
 				}
 				
-				// uni.showLoading({
-				// 	title: "加载中",
-				// 	mask: true,
-				// })		
-				// loginApi.validateCode({
-				// 	verifyCode: this.form.verifyCode,
-				// 	telephone: this.form.telephone,
-				// }).then((response) => {
-				// 	uni.hideLoading();
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})		
+				loginApi.changePhone(this.form).then((response) => {
+					uni.hideLoading();
 					
 					uni.redirectTo({
 						url: '/pages/login/login'
 					})
-				// }).catch(error => {
-				// 	uni.showToast({
-				// 		title: error,
-				// 		icon: "none"
-				// 	})
-				// })
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
 			}
 		}
 	}

+ 10 - 0
pages/user/setting.vue

@@ -8,6 +8,9 @@
 		<view class="logout-btn" @click="signOut">
 			退出帐号
 		</view>
+		<view>
+			<u-modal v-model="show" @confirm="confirm":show-cancel-button="true" ref="uModal" :asyncClose="true" :title="title" :content="content"></u-modal>
+		</view>
 	</view>
 </template>
 
@@ -17,6 +20,9 @@
 	export default {
 		data() {
 			return {
+				show: false,
+				title: '退出账号',
+				content: '是否退出当前账号?',
 				userId: '',
 				userPhone: '',
 				valueStyle: {
@@ -36,12 +42,16 @@
 		},
 		methods: {
 			signOut() {
+				this.show = true;
+			},
+			confirm() {
 				uni.showLoading({
 					title: "加载中",
 					mask: true,
 				})		
 				userApi.logout().then((res) => {
 					uni.hideLoading();
+					this.show = false;
 					this.carhelp.logoff()
 					uni.reLaunch({
 						url: '/pages/login/login'