Browse Source

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

zhengkaixin 3 years ago
parent
commit
25923ad5b9

+ 2 - 0
apis/index.js

@@ -6,6 +6,8 @@ export function codeOperation(res) {
 	// res="jp_team51_charge_id:A_11111"
 	if(res&&res.length>22){
 		
+	}else if(res == 'toLogin') {
+		return	'/pages/login/login'
 	}else{
 		return false
 	}

+ 2 - 2
apis/user.js

@@ -66,7 +66,7 @@ export function carPersonAccount (data) {
 export function deleteUser (data) {
 	 
 	return request({
-		method: 'post',
+		method: 'get',
 		data:data ,
 		url: '/mobile/regUser/deleteUser'
 	})
@@ -75,7 +75,7 @@ export function deleteUser (data) {
 export function changePhone  (data) {
 	 
 	return request({
-		method: 'post',
+		method: 'get',
 		data:data ,
 		url: '/mobile/regUser/changePhone '
 	})

+ 2 - 7
pages/index/index.vue

@@ -250,13 +250,7 @@
 						url:k
 					})
 				}
-				if(op.jpcode == 'toLogin') {
-					uni.navigateTo({
-						url: '/pages/login/login'
-					})
-				}
 			}
-			
 		},
 		onReachBottom() {
 			if (this.newsList.length < this.recordsTotal) {
@@ -411,7 +405,8 @@
 					}
 				}).catch(error => {
 					uni.showToast({
-						title: JSON.stringify(error)
+						title: error,
+						icon: "none"
 					})
 				})
 			},

+ 8 - 6
pages/login/login.vue

@@ -20,12 +20,14 @@
 						<u-input v-model="form.verifyCode" type="number" placeholder="请输入验证码" placeholder-style="font-size:16px;color:#ccc;"/>
 						<view class="code" @click="getCode">{{codeTips}}</view>
 					</view>
-					<u-checkbox-group>
-						<u-checkbox class="tips" v-model="value" shape="circle" @change="checkboxChange()">
-							<view v-if="!form.telephone && !value">我已阅读并同意<span>《会员协议》</span>和<span>《隐私协议》</span></view>
-							<view v-else>我已阅读并同意<span style="color: #000000;">《会员协议》</span>和<span style="color: #000000;">《隐私协议》</span></view>
-						</u-checkbox>
-					</u-checkbox-group>
+					<view>
+						<u-checkbox-group>
+								<u-checkbox class="tips" active-color="green" v-model="value" shape="circle" @change="checkboxChange()"></u-checkbox>				
+						</u-checkbox-group>
+						<span>我已阅读并同意</span>
+						<span @click="gotoUrl('pages/article/details?code=YHXY')" style="color: #3fbd70;">《会员协议》</span>和
+						<span @click="gotoUrl('pages/article/details?code=YSZC')" style="color: #3fbd70;">《隐私协议》</span>
+					</view>
 				</view>
 			</view>		
 			<u-button :style="[inputStyle]" class="login-btn" type="success" shape="circle" @click="login">登录</u-button>

+ 79 - 10
pages/user/finance/refundList.vue

@@ -4,10 +4,10 @@
 		<view class="balance">
 			<view class="balanceHead">
 				<view class="payPrice">
-					<span>¥</span><font>15.00</font>
+					<span>¥</span><font>{{account.totalAmount}}</font>
 				</view>
 				<view class="tips">
-					<p>可退费金额(元)</p><u-icon name="question-line" custom-prefix="custom-icon" color="#00B962" size="32"></u-icon>
+					<p>可退费金额(元)</p><u-icon name="question-line" custom-prefix="custom-icon" color="#00B962" size="32" @click="showtip = true"></u-icon>
 				</view>
 			</view>
 			<view class="balanceMain">
@@ -22,16 +22,17 @@
 					</view>
 				</view>
 				<view class="refundList">
-					<view class="refundList-item">
+					<view class="refundList-item" v-for="(item,index) in items" :key="index"> 
 						<view class="refundList-row">
-							<font>退至 微信</font>
-							<span class="state1">退款中</span>
+							<font>退至 {{item.refundChannelText}}</font>
+							<span :class="item.status == '0'? 'state1':'state2' ">{{item.statusText}}</span>
 						</view>
 						<view class="refundList-row">
-							<p>2021-12-31 09:00</p>
-							<p>¥15.00</p>
+							<p>{{item.applicationTime}}</p>
+							<p>¥{{item.refundAmount.toFixed(2)}}</p>
 						</view>
 					</view>
+					<!--
 					<view class="refundList-item">
 						<view class="refundList-row">
 							<font>退至 微信</font>
@@ -41,26 +42,45 @@
 							<p>2021-12-31 09:00</p>
 							<p>¥15.00</p>
 						</view>
-					</view>
+					</view>-->
+					
 					<!-- <view class="refundList-none">
 						<u-image width="200px" height="200px" src="/static/img/none.svg"></u-image>
 					</view> -->
 				</view>
 			</view>
 		</view>	
+		<view>
+			<u-modal v-model="show" :title="title" :content='content'  :show-confirm-button="true" :show-cancel-button='true' @confirm="confirm"></u-modal> 
+		</view>
+		<view>
+			<u-modal v-model="showtip" :title="title" :content='content1' :show-confirm-button="true" confirm-text="知道了" ></u-modal> 
+		</view>
+				
+		<view style="bottom:0rpx;position:absolute;background-color: green;width: 100%;">
+			<u-button style="background-color: green;color:white" @click="show=true">申请退款</u-button>
+		</view>
 	</view>
 </template>
 
 <script>
+	let _self;
 	import * as api from "@/apis/refund.js"
 	export default {
 		data() {
 			return {
+				content1:'本平台仅支持可支持金额全额退费,申请成功后退费金额将于5个工作日内退还至您的充值账户.在本平台,三个月内的支付宝充值,微信支付可申请退费.		退费成功后,您可以在退费记录查看退费信息和审核进度.',
+				title:'提示',
+				content:'是否确定提交退费申请?申请成功后退费金额将于5个工作日内退还至您的充值账户',
+				show:false,
+				showtip:false,
 				userId:'',
+				account:{},
+				items:[],
 			}
 		},
 		onLoad(){
-			
+			_self = this;
 		},
 		onReady(){
 			if (this.carhelp.getPersonInfo()) {
@@ -69,13 +89,62 @@
 			}
  
 			api.personAccount().then(function(res){
+				if(res.result)
+				{
+					_self.account = res.data;
+					
+				}
 				console.log('个人余额信息'+JSON.stringify(res));
 			},function(err){
 				console.log('个人信息余额错误'+JSON.stringify(err));
 			});
+			let data = {pageIndex:1,pageSize:10};
+			api.personAccountRefundList(data).then(function(res){
+				if(res.result){
+					console.log('res'+JSON.stringify(res));
+					_self.items = res.data.data;
+					for(let i = 0;i< _self.items.length;i++){
+						if(_self.items[i].refundChannel == 'wechat')
+							_self.items[i].refundChannelText = "微信"
+						else if (_self.items[i].refundChannel == 'alipay')
+							_self.items[i].refundChannelText = "支付宝"
+							
+						if(_self.items[i].status == '0')
+							_self.items[i].statusText = "退款中"
+						else if (_self.items[i].status == '1')
+							_self.items[i].statusText = "退款成功"
+						else if (_self.items[i].status == '2')
+							_self.items[i].statusText = "退款拒绝"
+						else if (_self.items[i].status == '3')
+							_self.items[i].statusText = "退款失败"
+										 
+					}
+					console.log('res'+JSON.stringify(_self.items));
+				}
+			});
 		},
 		methods: {
-
+			confirm(){
+				let data = {amount:_self.account.availableAmount,refundChannel:'wechat'}
+				api.personAccountRefundApplication(data).then(function(res){
+					if(res.result){
+						
+						console.log('personAccountRefundApplication'+JSON.stringify(res));
+						uni.navigateTo({
+							url:'refundApp'
+						})
+						
+					}
+					
+				},function(err){
+					
+				}
+				);
+				//console.log('confirm')
+			},
+			showTips(){
+				
+			}
 		}
 	}
 </script>

+ 2 - 1
pages/user/index.vue

@@ -105,6 +105,8 @@
 				var phone1 = phone.slice(0,3);
 				var phone2 = phone.slice(-4);
 				this.userPhone = phone1 + '****' + phone2;
+				
+				this.getCarPersonAccount();
 			}
 		},
 		onReady() {
@@ -113,7 +115,6 @@
 			if(consumerPhone){
 				this.content=consumerPhone
  			}
-			this.getCarPersonAccount();
 		},
 		methods: {
 			toData() {			

+ 9 - 7
pages/user/logout.vue

@@ -28,7 +28,7 @@
 	export default {
 		data() {
 			return {
-				
+				jpcode: 'toLogin',
 			}
 		},
 		methods: {
@@ -45,13 +45,15 @@
 				userApi.deleteUser().then((res) => {
 					uni.hideLoading();
 					
-					uni.reLaunch({
-						url: '/pages/index/index?id=' + 'toLogin'
-					})
+					if(res.data == "0") {
+						this.carhelp.logoff();
+						uni.reLaunch({
+							url: '/pages/index/index?jpcode=' + this.jpcode
+						})
+					}
 				}).catch(error => {
-					uni.showToast({
-						title: error,
-						icon: "none"
+					uni.navigateTo({
+						url: '/pages/user/finance/refundList'
 					})
 				})
 			}

+ 2 - 1
pages/user/phone.vue

@@ -39,6 +39,7 @@
 				isSendMsgIng: false,
 				sendMsgSecond: 60,
 				codeTips: '',
+				jpcode: 'toLogin',
 			}
 		},
 		methods: {
@@ -124,7 +125,7 @@
 					uni.hideLoading();
 					
 					uni.reLaunch({
-						url: '/pages/index/index?id=' + 'toLogin'
+						url: '/pages/index/index?jpcode=' + this.jpcode
 					})
 				}).catch(error => {
 					uni.showToast({