Explorar o código

自行车退费

zhengkaixin %!s(int64=2) %!d(string=hai) anos
pai
achega
173eb6c6e7
Modificáronse 5 ficheiros con 392 adicións e 4 borrados
  1. 2 0
      .env.dev.js
  2. 60 0
      apis/refund.js
  3. 9 1
      pages.json
  4. 22 3
      pages/user/rechargeList.vue
  5. 299 0
      pages/user/refundList.vue

+ 2 - 0
.env.dev.js

@@ -9,6 +9,8 @@ const UNI_APP = {
 	//openId:"oHjCawgwCGen5k1-hAsimdEX5lZo",
 	//openId:"1000",
 	openId:"oK9Wr59rru-i3bm7dtTtxnkR-i4s",
+	openId:"oK9Wr54VbEh3xvWYmD_zT5NbH4AY",//zkx
+	
 	//小鹏管家appid
 	//VUE_APP_WXAPPID:"wx7e70eb62a8459869",
 	VUE_APP_WXAPPID:"wx3afdb1b60188c1e5",

+ 60 - 0
apis/refund.js

@@ -0,0 +1,60 @@
+import request from '../utils/request.js';
+import requestWhite from '../utils/requestWhite.js';
+
+/**
+ * 汽车充电个人余额信息
+ * result 	true 	boolean 	结果集
+ * message 	- 	Object 	
+ * data 	- 	Object 	返回数据
+ * data.giftAmount 	0 	Number 	赠送余额
+ * data.totalAmount 	0 	Number 	总余额
+ * data.availableAmount 	0 	Number 	可用总余额
+ * data.rechargeAmount 	0 	Number 	充值余额
+ * code 	200 	Number 	
+ */
+export function personAccount(){
+	return request({
+		method: 'post', 
+		url: '/mobile/regUser/carPersonAccount'
+	}) 
+}
+
+/**
+ * 手机端个人账户申请退费详情
+ * id 	16 	Text 	是 	-
+ */
+export function personAccountRefundDetail(data){
+	return request({
+		method: 'post',
+		data: data,
+		url: '/mobile/regUser/personAccountRefundDetail'
+	}) 
+}
+
+
+/**
+ * 手机端个人账户申请退费列表
+ * pageIndex 	1 	Text 	是 	
+ * pageSize 	10 	Text 	是 	-
+ */
+export function personAccountRefundList(data){
+	return request({
+		method: 'post',
+		data: data,
+		url: '/mobile/regUser/personAccountRefundList'
+	}) 
+}
+
+
+/**
+ * 手机端个人账户申请退费
+ * amount 	333 	Text 	是 	退款金额
+ * refundChannel 	wechat 	Text 	是 	退款通道(wechat:微信,alipay:支付宝)
+ */
+export function personAccountRefundApplication(data){
+	return request({
+		method: 'post',
+		data: data,
+		url: '/mobile/regUser/personAccountRefundApplication'
+	}) 
+}

+ 9 - 1
pages.json

@@ -62,7 +62,15 @@
 			"style": {
 				//"navigationStyle": "custom" // 隐藏系统导航栏
 			}
-		},
+		},
+		{
+			"name": "余额充值",
+			"path": "pages/user/refundList",
+			"style": {
+				//"navigationStyle": "custom" // 隐藏系统导航栏
+			}
+		},
+		
 
 		{
 			"name": "充值记录",

+ 22 - 3
pages/user/rechargeList.vue

@@ -1,9 +1,15 @@
 
 <template>
 	<view>
-		<u-navbar title="充值记录"></u-navbar>
+		<u-navbar title="充值记录">
+			<view class="slot-wrap">
+				<span class="navBtn "  @click="toRefundList">退余额</span>
+			</view>
+		</u-navbar>
 		<view class="rechargeTime" @click="show = true">
-			<u-picker mode="time" v-model="show" :params="params" @confirm="confirmTime" @cancel="cancelTime"></u-picker>
+			<u-picker mode="time" v-model="show" :params="params" 
+			:default-time="dateMonth"
+			@confirm="confirmTime" @cancel="cancelTime"></u-picker>
 			<span>{{month}}月</span>
 			<u-icon name="arrow-down-s-fill" custom-prefix="custom-icon" color="#B3B3B3" size="32"></u-icon>
 		</view>
@@ -18,7 +24,7 @@
 		</view> -->
 		<view class="rechargeList" v-if="accountList.length > 0">
 			<view class="rechargeList-item" v-for="(item,index) in accountList" :key="item.id" @click="gotoUrl('pages/user/finance/rechargeDet?id=' + item.id)">
-				<view class="rechargeList-row"><span>充值金额</span><h4>{{item.amount}}</h4></view>
+				<view class="rechargeList-row"><span>充值金额</span><h4>{{item.amount}}</h4></view>
 				<view class="rechargeList-row"><p>{{item.payNameStr}}</p><p>{{item.createTime}}</p></view>
 			</view>
 		</view>
@@ -65,6 +71,11 @@
 			this.getAccountRecordData();
 		},
 		methods: {
+			toRefundList() {
+				uni.navigateTo({
+					url: '/pages/user/refundList'
+				})
+			},
 			getAccountRecordData() {
 				uni.showLoading({
 					title: "加载中",
@@ -101,6 +112,14 @@
 </script>
 
 <style lang="scss" scoped>
+	.slot-wrap{
+		flex: 1;
+	}
+	.navBtn{
+		float: right;
+		margin-right: 15px;
+		color:#3fbd70;
+	}
 	.carNone{
 		display: flex;
 		flex-direction: column;

+ 299 - 0
pages/user/refundList.vue

@@ -0,0 +1,299 @@
+<template>
+	<view>
+		<u-navbar title="退费记录"></u-navbar>
+		<view class="balance">
+			<view class="balanceHead">
+				<view class="payPrice">
+					<font>{{account.availableAmount!=null ? account.availableAmount.toFixed(2) : '0.00'}}</font><span>元</span>
+				</view>
+				<view class="tips">
+					<p>可退费金额(元)</p><u-icon name="question-circle" color="#00B962" size="32" @click="showtip = true"></u-icon>
+				</view>
+			</view>
+			<view class="balanceMain">
+				<view class="balanceMain-title">
+					<view class="title">
+						<u-icon name="todo-fill" custom-prefix="custom-icon" color="#6BC6A7" size="40"></u-icon>
+						<span>退费记录</span>
+					</view>
+				</view>
+				<view class="refundList">
+					<view class="refundList-item" v-for="(item,index) in items" :key="index" @click="refundItem(item)"> 
+						<view class="refundList-row">
+							<font>原路退回</font>
+							<span :class=" 'state'+item.status ">{{item.statusText}}</span>
+						</view>
+						<view class="refundList-row" >
+							<p>{{item.applicationTime}}</p>
+							<p>{{item.refundAmount!=null ? item.refundAmount.toFixed(2) : '0.00'}}元</p>
+						</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" :show-confirm-button="true" confirm-text="知道了" confirm-color="#00B962">
+				<view class="slot-content">
+					<rich-text :nodes="content1"></rich-text>
+				</view>
+			</u-modal> 
+		</view>
+				
+		<view style="bottom:0;position:absolute;width: 100%;padding: 40rpx;" v-show="account.availableAmount>0">
+			<u-button shape="circle"    style="background-color:#00b962;color:white" @click="show=true">申请退款</u-button>
+		</view>
+	</view>
+</template>
+
+<script>
+	let _self;
+	import * as api from "@/apis/refund.js"
+	export default {
+		data() {
+			return {
+				elderMode:false,
+				content1:`本平台仅支持金额全额退费,申请成功后退费金额将于5个工作日内退还至您的充值账户.在本平台,三个月内的支付宝充值,微信支付可申请退费.<br />退费成功后,您可以在退费记录查看退费信息和审核进度.`,
+				title:'提示',
+				content:'是否确定提交退费申请?申请成功后退费金额将于5个工作日内退还至您的充值账户',
+				show:false,
+				showtip:false,
+				userId:'',
+				account:{},
+				items:[],
+			}
+		},
+		onLoad(){
+			_self = this;
+		},
+		onReady(){
+		
+			this.elderMode = this.carhelp.get('getElderModeClass') == '长辈模式';
+			if(this.elderMode)
+				this.theme('elder')
+			else
+				this.theme('standard')
+
+			if (this.carhelp.getPersonInfo()) {
+				this.userId = this.carhelp.getPersonInfo().id;
+				//('userId'+this.userId)
+			}
+ 
+			api.personAccount().then(function(res){
+				if(res.result)
+				{
+					_self.account = res.data;
+					
+				}
+				//('个人余额信息'+JSON.stringify(res));
+			},function(err){
+				uni.showToast({
+					title: err,
+					icon: "none"
+				})
+				////('err'+JSON.stringify(err));
+			});
+			this.getList();
+		},
+		methods: {
+			
+			getList(){
+				let data = {pageIndex:1,pageSize:100};
+							api.personAccountRefundList(data).then(function(res){
+								if(res.result){
+									//('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 = "退款失败"
+														 
+									}
+				//					//('res'+JSON.stringify(_self.items));
+								}
+							},function(err){
+								uni.showToast({
+									title: err,
+									icon: "none"
+								})
+								////('err'+JSON.stringify(err));
+							});
+			},
+			theme(type) {
+			  if(type == 'elder')	
+			  {
+				document.getElementsByTagName('body')[0].setAttribute('data-theme',type);
+				  
+			  }
+			  else
+			  {
+				document.getElementsByTagName('body')[0].setAttribute('data-theme',type);
+				  
+			  } 
+			},
+			refundItem(item){
+				uni.navigateTo({
+					url:'refundDet?id='+item.id
+				})
+				
+			},
+			confirm(){
+				uni.showLoading({
+					
+				})
+				var _this=this
+				let data = {amount:_self.account.availableAmount,refundChannel:'wechat'}
+				api.personAccountRefundApplication(data).then(function(res){
+					uni.hideLoading()
+					if(res.result){
+						
+						api.personAccount().then(function(res){
+							if(res.result)
+							{
+								_self.account = res.data;
+								
+							}
+							//('个人余额信息'+JSON.stringify(res));
+						},function(err){
+							uni.showToast({
+								title: err,
+								icon: "none"
+							})
+							////('err'+JSON.stringify(err));
+						});
+						
+						_this.getList();
+						
+					}
+					
+				},function(err){
+					// uni.showToast({
+					// 	title:err
+					// })
+						uni.hideLoading();
+					uni.showModal({
+							content:err,
+						title:'提示',
+						showCancel:false,
+						confirmText:'知道了'
+					})
+				}
+				);
+				////('confirm')
+			},
+			showTips(){
+				
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped> 
+
+	.slot-content {
+	
+		font-size: 28rpx;
+		color: $u-content-color;
+		padding-left: 30rpx;
+		padding-right: 30rpx;
+		padding-top: 40rpx;
+		padding-bottom: 40rpx;
+	}
+	.refundList-none{
+		display: flex;
+		align-items: center;
+		justify-content: center;
+	}
+	.balanceHead{
+		background-color: #fff;
+		padding: 48rpx 0;
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		.payPrice{
+			display: flex;
+			align-items: flex-end;
+			justify-content: center;
+			font{
+				font-size: 36px;
+				line-height: 36px;
+			
+			}
+		}
+		.tips{
+			display: flex;
+			align-items: center;
+			margin-top: 8rpx;
+			p{
+				color:#999;
+				margin-right: 8rpx;
+			}
+		}
+	}
+	.balanceMain{
+		background-color: #fff;
+		margin-top: 24rpx;
+		.balanceMain-title{
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			height: 96rpx;
+			border-bottom: 2rpx solid #f7f7f7;
+			padding: 0 32rpx;
+			.title{
+				display: flex;
+				align-items: center;
+				span{
+					margin-left: 16rpx;
+					font-size: 16px;
+			
+				}
+			}
+		}
+		.refundList-item{
+			padding: 12px 16px;
+			.refundList-row{
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				p{
+					
+					font-size: 12px;
+					color:#888;
+					margin-top: 6rpx;
+				}
+				.state0{
+					color:#FF9600;
+				}
+				.state1{
+					color:#00B962;
+				}
+				
+				.state2{
+					color:red;
+				}
+				.state3{
+					color:red;
+				}
+			}
+		}
+		
+	}
+</style>