zhengkaixin 1 år sedan
förälder
incheckning
db5bf6e33f

+ 19 - 0
apis/otherRecharge.js

@@ -0,0 +1,19 @@
+import requestWhite from '../utils/requestWhite.js';
+
+export function rechargeData(data) {
+	var url='/mobile/otherRecharge/rechargeData';
+	return requestWhite({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
+export function rechargeDetails(data) {
+	var url='/mobile/otherRecharge/rechargeDetails';
+	return requestWhite({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}

+ 15 - 0
apis/weixin.js

@@ -1,4 +1,5 @@
 import request from '@/utils/request'
+ import requestWhite from '../utils/requestWhite.js';
  
 import Qs from 'qs';
 
@@ -27,6 +28,20 @@ export function wxpay2(data) {
 	})
 }
 
+
+//微信支付
+export function wxJsapiPayByPhone(data) {
+	if(data){
+		data.type="D"
+	}
+	return requestWhite({
+		url: '/wxPay/wxJsapiPayByPhone',
+		data: data,
+		method: 'post',
+	})
+}
+
+
 //根据code换取openid
 export function getDataByCode(code) {
 	return request({

+ 6 - 0
assets/img/iconPark-wallet.svg

@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 48 48" width="20" height="20" style="border-color: rgba(0,0,0,0);border-width: bpx;border-style: undefined" filter="none">
+    
+    <g>
+    <rect width="48" height="48" fill="rgba(21.93,119.08500000000001,255,1)" fill-opacity="0.01" stroke="none"></rect><path fill-rule="evenodd" clip-rule="evenodd" d="M17.9821 11.9689L31.7847 4L36.3971 11.9889L17.9821 11.9689Z" stroke="rgba(21.93,119.08500000000001,255,1)" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" fill="none"></path><path d="M4 14C4 12.8954 4.89543 12 6 12H42C43.1046 12 44 12.8954 44 14V42C44 43.1046 43.1046 44 42 44H6C4.89543 44 4 43.1046 4 42V14Z" fill="none" stroke="rgba(21.93,119.08500000000001,255,1)" stroke-width="4" stroke-linejoin="round"></path><path d="M35.25 33H44V23H35.25C32.3505 23 30 25.2386 30 28C30 30.7614 32.3505 33 35.25 33Z" fill="none" stroke="rgba(21.93,119.08500000000001,255,1)" stroke-width="4" stroke-linejoin="round"></path><path d="M44 16.5V40.5" stroke="rgba(21.93,119.08500000000001,255,1)" stroke-width="4" stroke-linecap="round" fill="none"></path>
+    </g>
+  </svg>

+ 4 - 3
config/.env.dev.js

@@ -1,6 +1,7 @@
 const UNI_APP = {  
 	ProjectName :"51充电联盟",
-	 BASE_URL: 'https://charging.xiaoxinda.com/charging-station-test/',
+	BASE_URL: 'http://charging.xiaoxinda.com/charging-station-test/',
+	//BASE_URL: ' http://charging.xiaoxinda.com/charging-station-test/',
 	//BASE_URL: 'https://51team.xiaoxinda.com/charging-station-server/',
 	// BASE_URL: 'http://192.168.77.162:8080/charging-station/' ,
 	branchParameter:"51team",//team51,youdian
@@ -12,8 +13,8 @@ const UNI_APP = {
 	//openId:"oHjCawgwCGen5k1-hAsimdEX5lZo",
 	openId:"1000",
 	openId:"oK9Wr59rru-i3bm7dtTtxnkR-i4s",
-	//openId:"oK9Wr54VbEh3xvWYmD_zT5NbH4AY",//zkx
-	
+	openId:"oK9Wr54VbEh3xvWYmD_zT5NbH4AY",//zkx
+	//openId:"olKSH04B8VadTQEg64RapG2CRxqU",
 	//小鹏管家appid
 	//VUE_APP_WXAPPID:"wx7e70eb62a8459869",
 	VUE_APP_WXAPPID:"wx3afdb1b60188c1e5",

+ 1 - 1
config/.env.js

@@ -9,7 +9,7 @@
 	console.log(NODE_NAME,branchParameter,envjs)
     if (process.env.NODE_ENV === "development") {  
 		 
-         ENV_VAR = require('@/config/.env.dev.ud.js');
+         ENV_VAR = require('@/config/.env.dev.js');
 		 
 		
     } else if (process.env.NODE_ENV === "production") {  

+ 1 - 1
config/.env.test.js

@@ -3,7 +3,7 @@ const UNI_APP = {
 	ProjectName :"51充电联盟",
 
    //  BASE_URL: 'http://192.168.77.162:8080/charging-station/' ,
-	BASE_URL: 'https://charging.xiaoxinda.com/charging-station-test/',
+	BASE_URL: 'http://charging.xiaoxinda.com/charging-station-test/',
    // BASE_URL: 'https://charging.xiaoxinda.com/charging-station-server/',
    branchParameter:"51team",//team51,youdian
    wechatUrl:"/wechat",

+ 21 - 0
pages.json

@@ -93,6 +93,27 @@
 			"style": {
 				//"navigationStyle": "custom" // 隐藏系统导航栏
 			}
+		},
+		{
+			"path" : "pages/user/rechargeListByPhone",
+			"style" : 
+			{
+				"enablePullDownRefresh" : false
+			}
+		},
+		{
+			"path" : "pages/user/rechargeByPhone",
+			"style" : 
+			{
+				"enablePullDownRefresh" : false
+			}
+		},
+		{
+			"path" : "pages/user/rechargeDeatilsByPhone",
+			"style" : 
+			{
+				"enablePullDownRefresh" : false
+			}
 		}
 		
     ],

+ 14 - 0
pages/user/index.vue

@@ -38,6 +38,18 @@
 					</view>
 					<view class="user-cell-value"></view>
 				</view>
+				
+				<view
+				@click="gotoUrl('pages/user/rechargeByPhone?site=1')"
+				
+				class="user-cell-item">
+					<view class="user-cell-title">
+						<img src="@/assets/img/iconPark-wallet.svg" style="height: 32rpx;" />
+						<span>帮人充值</span>
+					</view>
+					<view class="user-cell-value"></view>
+				</view>
+				
 				<view 
 				@click="gotoUrl('pages/charge/chargeList')"
 				class="user-cell-item">
@@ -204,6 +216,8 @@
 			color:#999;
 		}
 		.user-cell-title{
+			    display: flex;
+			    align-items: center;
 			span{
 				margin-left: 5px;
 			}

+ 4 - 3
pages/user/recharge.vue

@@ -53,7 +53,7 @@
 		<view class="foot-btn">
 			<view class="foot-pirce">
 				<u-icon name="tikuan" custom-prefix="custom-icon" color="#FF9502" size="48"></u-icon>
-				<span>支付 ¥{{selectItem.rechargeAmount}}</span>
+				<span>支付 ¥{{selectItem.rechargeAmount}}</span>
 			</view>
 			<u-button type="primary" @click="submit" :custom-style="customStyle" shape="square">确定充值</u-button>
 		</view>
@@ -107,8 +107,9 @@
 					wxPayJs(data);
 						
 				}).catch(error => {
-					this.$refs.common.showLoading(false, error);
-						
+					uni.showToast({
+						title: error
+					})	
 				})
 			},
 			init1(){

+ 286 - 0
pages/user/rechargeByPhone.vue

@@ -0,0 +1,286 @@
+<template>
+	<view>
+		<ujp-navbar title="帮人充值"  :isBack="isBack">
+			<view class="slot-wrap">
+			
+				<span class="navBtn "  @click="toRefundList">	<u-icon name="clock"></u-icon>充值记录</span>
+			</view>
+		</ujp-navbar>
+		<view class="recharge">
+			<view class="recharge-text">
+				<p>充值账户</p>
+				<u-input v-model="phone"
+				:custom-style="{
+					'font-size': '48rpx',
+					'line-height': '48rpx',
+				}"
+				 :placeholder-style="{
+					'font-size': '48rpx',
+					'line-height': '48rpx',
+					'color':' rgba(204, 204, 204, 1)',
+				}"
+				 height="82" placeholder="请输入充值手机号" ></u-input>
+			</view>
+			
+		</view>
+		<view class="charge">
+			<view class="chargeTit">
+				选择充值金额
+			</view>
+			<view class="chargeMain">
+				<template v-for="(item,i) in list">
+				
+				<view  :key="i" :class="{
+					'active':amount==item
+				}"  @click="amount=item"
+				class="chargeMain-item "><p>{{item}}元</p></view>
+				
+				
+				</template>
+			</view>
+		</view>
+		<view style=" padding-bottom: 120px; ">
+			<view class="charge">
+			<view class="chargeRadio">
+				<view class="u-flex">
+					<u-icon name="weixinzhifu" custom-prefix="custom-icon" color="#22ac38" size="80"></u-icon>
+					<view class="chargeRadio-text">
+						<h4>微信支付</h4>
+						<p>推荐微信支付</p>
+					</view>
+				</view>
+				<u-radio-group>
+					<u-radio></u-radio>
+				</u-radio-group>
+			</view>
+		</view>
+			
+		</view>
+		
+		<view class="foot-btn">
+			<view class="foot-pirce">
+				<u-icon name="tikuan" custom-prefix="custom-icon" color="#FF9502" size="48"></u-icon>
+				<span>支付 {{amount}} 元</span>
+			</view>
+			<u-button type="primary" @click="submit" :custom-style="customStyle" shape="square">确定充值</u-button>
+		</view>
+	</view>
+</template>
+
+<script>
+	import * as Pay from '@/apis/weixin.js'
+	 import {
+	 	checkPhone
+	 } from '@/utils'
+	import {
+		wxPayJs
+	} from '@/utils/wxpay'
+	import * as API from '@/apis/index.js'
+	
+	
+	export default {
+		data() {
+			return {
+				isReady:false,
+				customStyle: {
+					background: '#1677ff'
+				},
+				detail:{},
+				isBack:false,
+				chargingMarketingId:'',
+				selectItem:{},
+				list:[0.05,5,10,20,50,100,200],
+				amount:5,
+				phone:"",
+			}
+		},
+		onLoad(op){
+			if(op.site){
+				this.isBack=true;
+			}
+			
+		},
+		onReady() {
+		
+		},
+		methods: {
+			toRefundList() {
+				uni.navigateTo({
+					url: '/pages/user/rechargeListByPhone'
+				})
+			},
+			submit(){
+				var checkPhoneResult = checkPhone(this.phone);
+				
+				if ( checkPhoneResult !== true) {
+					uni.showToast({
+						title: checkPhoneResult,
+				
+					})
+					return;
+				}
+				
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				Pay.wxJsapiPayByPhone({
+					openId:this.carhelp.getOpenId(),
+					phone:this.phone,
+					amount:this.amount
+				}).then((response) => {
+					if(!response.result){		
+						uni.showToast({
+							title:  response.message
+						})
+						return
+					}
+					var data = response.data
+					uni.hideLoading()
+					console.log("Pay+"+new Date().getTime())		
+					wxPayJs(data);
+						
+				}).catch(error => {
+					uni.showToast({
+						title: error
+					})	
+				})
+			},
+			
+			
+		},onShow(){
+			if(this.isReady){
+				
+			}
+		}
+	}
+</script>
+<style>
+	page{
+		background-color: #f7f7f7;
+	}
+</style>
+<style lang="scss" scoped>
+	.slot-wrap{
+		flex: 1;
+	}
+	.navBtn{
+		float: right;
+		margin-right: 15px;
+		color:#1677FF ;
+	}
+	.recharge{
+		padding: 15px;
+		//background-color: #1677FF;
+		background-color: #fff;
+		margin-bottom: 10px;
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		.recharge-text{
+			//color:#fff;
+			    width: 100%;
+		}
+		.recharge-btn{
+			width: 60px;
+			height: 30px;
+			text-align: center;
+			line-height: 30px;
+			background-color: #589EFF;
+			color:#fff;
+			border-radius: 15px;
+		}
+	}
+	.charge{
+		padding: 15px;
+		background-color: #fff;
+		margin-bottom: 10px;
+	}
+	.chargeRadio{
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		width: 100%;
+		.chargeRadio-text{
+			margin-left: 5px;
+			h4{
+				font-weight: normal;
+				font-size: 15px;
+			}
+			p{
+				font-size: 12px;
+				color:#999;
+				margin-top: 5px;
+			}
+		}
+	}
+	.chargeTit{
+		border-bottom: 1px solid #f7f7f7;
+		padding-bottom: 10px;
+		font-size: 15px;
+	}
+	.chargeMain{
+		display: flex;
+		flex-wrap: wrap;
+		justify-content: space-between;
+		margin-top: 20px;
+		.chargeMain-item{
+			width: 32%;
+			text-align: center;
+			padding: 10px 10px;
+			border: 1px solid rgba(22, 119, 255, 1);
+			margin-bottom: 10px;
+			border-radius: 5px;
+			color:#333;
+			color: rgba(22, 119, 255, 1);
+			position: relative;
+			p{
+				font-size: 20px;
+			}
+			span{
+				background-color: #ff8d00;
+				color:#fff;
+				padding: 2px 10px;
+				border-radius:0 10px 0 10px;
+				position: absolute;
+				font-size: 12px;
+				right: -2px;
+				top: -2px;
+			}
+		}
+		.active{
+			border-color:rgba(22, 119, 255, 1);
+			
+			background-color: rgba(22, 119, 255, 1);
+			color: rgba(255, 255, 255, 1);
+		}
+		.fault{
+			background-color:#e1e1e1;
+			color:#666;
+			border: 1px solid #ccc;
+		}
+		.occupy{
+			color:#FF4F3F;
+			border: 1px solid #FF4F3F;
+		}
+	}
+	.foot-btn{
+		padding: 10px;
+		position: fixed;
+		left: 0;
+		right: 0;
+		bottom: 0;
+		background-color: #fff;
+		.foot-pirce{
+			display: flex;
+			align-items: center;
+			span{
+				margin-left: 5px;
+				font-size: 16px;
+			}
+			padding-bottom: 10px;
+			border-bottom: 1px solid #f7f7f7;
+			margin-bottom: 10px;
+		}
+	}
+</style>

+ 94 - 0
pages/user/rechargeDeatilsByPhone.vue

@@ -0,0 +1,94 @@
+<template>
+	<view>
+		<ujp-navbar title="充值详情">
+		</ujp-navbar>
+		<view class="chargeDetails">
+			<view class="chargeDetails-item">
+				<span>充值金额</span>
+				<p class="price">{{detail.orderInfo.totalFee}}元</p>
+			</view>
+			<view class="chargeDetails-item">
+				<span>充值类型</span>
+				<p>{{detail.orderInfo.payNameStr}}</p>
+			</view>
+			<view class="chargeDetails-item">
+				<span>创建时间</span>
+				<p>{{detail.orderInfo.createTime}}</p>
+			</view>
+			<view class="chargeDetails-item">
+				<span>订单号</span>
+				<p>{{detail.orderInfo.outOrderNo}}</p>
+			</view>
+			<view class="chargeDetails-item">
+				<span>交易号</span>
+				<p>{{detail.orderInfo.transactionId}}</p>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import * as API from '@/apis/otherRecharge.js'
+	
+	export default {
+		data() {
+			return {
+				id:'',
+				detail:{
+					accountRecord:{},
+					orderInfo:{},
+				}
+			}
+		},
+		onLoad(op){
+			this.id=op.id;
+			this.getInfo()
+		},
+		methods: {
+			getInfo(){
+				uni.showLoading({
+					title:"加载中",mask:true,
+				})
+				API.rechargeDetails({
+					id:this.id
+				}).then((res) => {
+					this.detail=res.data	 
+					
+					uni.hideLoading()
+					 
+				}).catch(error => {
+						uni.showToast({
+							
+							title:error
+						})
+				})
+			}
+		}
+	}
+</script>
+<style>
+	page{
+		background-color: #f7f7f7;
+	}
+</style>
+<style lang="scss" scoped>
+	.chargeDetails{
+		background-color: #FFFFFF;
+		.chargeDetails-item{
+			margin:0 10px;
+			border-bottom: 1px solid #F7F7F7;
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			padding: 15px;
+			span{
+				color:#999;
+			}
+		}
+		.price{
+			font-size: 20px;
+			color:#FF3D00;
+			font-weight: bold;
+		}
+	}
+</style>

+ 1 - 1
pages/user/rechargeList.vue

@@ -23,7 +23,7 @@
 			<p>暂无充值记录</p>
 		</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-item" v-for="(item,index) in accountList" :key="item.id" @click="gotoUrl('pages/user/rechargeDeatils?id=' + item.id)">
 				<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>

+ 25 - 6
pages/user/rechargeList-test.vue → pages/user/rechargeListByPhone.vue

@@ -1,9 +1,13 @@
 
 <template>
 	<view>
-		<ujp-navbar title="充值记录"></ujp-navbar>
+		<ujp-navbar title="充值记录">
+		
+		</ujp-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>
@@ -17,8 +21,8 @@
 			<p>暂无充值记录</p>
 		</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-item" v-for="(item,index) in accountList" :key="item.id" @click="gotoUrl('pages/user/rechargeDeatilsByPhone?id=' + item.id)">
+				<view class="rechargeList-row"><span>充值金额</span><h4>{{item.rechargeTotal}}元</h4></view>
 				<view class="rechargeList-row"><p>{{item.payNameStr}}</p><p>{{item.createTime}}</p></view>
 			</view>
 		</view>
@@ -26,7 +30,7 @@
 </template>
 
 <script>
-	import * as API from '@/apis/index.js'
+	import * as API from '@/apis/otherRecharge.js'
 	
 	export default {
 		data() {
@@ -65,13 +69,20 @@
 			this.getAccountRecordData();
 		},
 		methods: {
+			toRefundList() {
+				uni.navigateTo({
+					url: '/pages/user/refundList'
+				})
+			},
 			getAccountRecordData() {
 				uni.showLoading({
 					title: "加载中",
 					mask: true,
 				})		
-				API.accountRecordData({
+				API.rechargeData({
+					openId:this.carhelp.getOpenId(),
 					queryDate: this.dateMonth,
+					pageSize: 50,
 				}).then((res) => {
 					uni.hideLoading();
 					
@@ -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;