Ver código fonte

feat:提交代码,完成花费充值相关开发

longzc 1 ano atrás
pai
commit
520a1caddf

+ 12 - 1
src/apis/user.ts

@@ -237,10 +237,21 @@ enum API {
237
 	AUTH_VERIFY ='/api/auth/verify',
237
 	AUTH_VERIFY ='/api/auth/verify',
238
 	//提现
238
 	//提现
239
 	EXTRACT_CREATE='/api/user/extract/create',
239
 	EXTRACT_CREATE='/api/user/extract/create',
240
+	//获取话费数据
241
+	HUAFEI_RECORD ='/api/huafei/record',
240
 	
242
 	
241
-	
242
 }
243
 }
243
 
244
 
245
+export function apiGetHuafeiList(data:any) {
246
+    return defHttp.post({
247
+        url: API.HUAFEI_RECORD,
248
+		data:{
249
+			limit:10,
250
+		page:data.page}
251
+    })
252
+}
253
+
254
+
244
 export function apiExtractCreate(data:any) {
255
 export function apiExtractCreate(data:any) {
245
     return defHttp.post({
256
     return defHttp.post({
246
         url: API.EXTRACT_CREATE,
257
         url: API.EXTRACT_CREATE,

+ 4 - 1
src/components/CXBPhoneLoginButton/CXBPhoneLoginButton.vue

@@ -3,6 +3,7 @@ import { authAppletPhone, bindPhone, getUserUnionId } from "~/apis/user";
3
 import { useUserStore } from "~/stores/userStore";
3
 import { useUserStore } from "~/stores/userStore";
4
 import Cache from "~/utils/cache";
4
 import Cache from "~/utils/cache";
5
 const userStore = useUserStore()
5
 const userStore = useUserStore()
6
+let openId =''
6
 const props = defineProps({
7
 const props = defineProps({
7
   text: {
8
   text: {
8
     type: String,
9
     type: String,
@@ -29,6 +30,7 @@ function getPhoneNumber(e) {
29
             encryptedData: e.detail.encryptedData,
30
             encryptedData: e.detail.encryptedData,
30
             iv: e.detail.iv,
31
             iv: e.detail.iv,
31
           }
32
           }
33
+		  openId= unionRes.openid
32
           if (shareId) {
34
           if (shareId) {
33
             params.share_id = shareId
35
             params.share_id = shareId
34
           }
36
           }
@@ -45,6 +47,7 @@ function getPhoneNumber(e) {
45
             userStore.login(authRes.token, authRes.exp)
47
             userStore.login(authRes.token, authRes.exp)
46
             userStore.setUID(authRes.user.uid)
48
             userStore.setUID(authRes.user.uid)
47
             userStore.setUserInfo(authRes.user)
49
             userStore.setUserInfo(authRes.user)
50
+			console.log("===unionRes",unionRes);
48
 
51
 
49
             // 绑定手机号
52
             // 绑定手机号
50
             bindPhone({
53
             bindPhone({
@@ -52,7 +55,7 @@ function getPhoneNumber(e) {
52
               sms: 1,
55
               sms: 1,
53
               sms_code: '1024',
56
               sms_code: '1024',
54
               password: '12345678',
57
               password: '12345678',
55
-              third_user_id: unionRes.unionid,
58
+              third_user_id: openId,
56
               type: 1
59
               type: 1
57
             }).then(bindRes => {
60
             }).then(bindRes => {
58
               Cache.clear('SHARE_ID')
61
               Cache.clear('SHARE_ID')

Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
src/pages.json


+ 8 - 8
src/pages/my-rules/index.vue

@@ -4,7 +4,7 @@ import mpHtml from 'mp-html/dist/uni-app/components/mp-html/mp-html'
4
 
4
 
5
 import { encodePhone } from "../../utils";
5
 import { encodePhone } from "../../utils";
6
 import { getAgentInfo, getRules, getUserInfo } from "~/apis/user";
6
 import { getAgentInfo, getRules, getUserInfo } from "~/apis/user";
7
-import { CDM_URL ,ICON_CDN_URL} from '~/config/app';
7
+import { CDM_URL ,IMG_CDN_NEW_URL} from '~/config/app';
8
 
8
 
9
 const userStore = useUserStore()
9
 const userStore = useUserStore()
10
 const ruleDetail = ref<{
10
 const ruleDetail = ref<{
@@ -38,20 +38,20 @@ const userType = computed(() => {
38
   // console.log('我是大哥',userStore.userInfo)
38
   // console.log('我是大哥',userStore.userInfo)
39
   const bangfu = userStore.userInfo?.is_bangfu ? '帮扶中心 ' : ''
39
   const bangfu = userStore.userInfo?.is_bangfu ? '帮扶中心 ' : ''
40
   // console.log('我是帮扶',bangfu);
40
   // console.log('我是帮扶',bangfu);
41
-
41
+ 
42
   // 普通用户
42
   // 普通用户
43
   if (userRichType == 0) {
43
   if (userRichType == 0) {
44
     // if (bangfu) {
44
     // if (bangfu) {
45
     //   return ['../../static/img-hy/帮扶中心.png', bangfu]
45
     //   return ['../../static/img-hy/帮扶中心.png', bangfu]
46
     // }
46
     // }
47
-    return [ICON_CDN_URL+'用户.png']
47
+    return [IMG_CDN_NEW_URL+'用户.png']
48
   }
48
   }
49
   // 会员
49
   // 会员
50
   if (userRichType == 1) {
50
   if (userRichType == 1) {
51
     // if (bangfu) {
51
     // if (bangfu) {
52
     //   return ['../../static/img-hy/帮扶中心.png', bangfu]
52
     //   return ['../../static/img-hy/帮扶中心.png', bangfu]
53
     // }
53
     // }
54
-    return [ICON_CDN_URL+'会员.png']
54
+    return [IMG_CDN_NEW_URL+'会员.png']
55
 
55
 
56
   }
56
   }
57
   // 创始人
57
   // 创始人
@@ -59,7 +59,7 @@ const userType = computed(() => {
59
     // if (bangfu) {
59
     // if (bangfu) {
60
     //   return ['../../static/img-hy/帮扶中心.png', bangfu]
60
     //   return ['../../static/img-hy/帮扶中心.png', bangfu]
61
     // }
61
     // }
62
-    return [ICON_CDN_URL+'创始人.png']
62
+    return [IMG_CDN_NEW_URL+'创始人.png']
63
   }
63
   }
64
   // 合伙人
64
   // 合伙人
65
   if (userRichType == 4) {
65
   if (userRichType == 4) {
@@ -67,19 +67,19 @@ const userType = computed(() => {
67
     // if (bangfu) {
67
     // if (bangfu) {
68
     //   return ['../../static/img-hy/帮扶中心.png', bangfu]
68
     //   return ['../../static/img-hy/帮扶中心.png', bangfu]
69
     // }
69
     // }
70
-    return [ICON_CDN_URL+'高级会员.png']
70
+    return [IMG_CDN_NEW_URL+'高级会员.png']
71
   }
71
   }
72
   if (userRichType == 8) {
72
   if (userRichType == 8) {
73
     // if (bangfu) {
73
     // if (bangfu) {
74
     //   return ['../../static/img-hy/帮扶中心.png', bangfu]
74
     //   return ['../../static/img-hy/帮扶中心.png', bangfu]
75
     // }
75
     // }
76
-    return [ICON_CDN_URL+'合伙人.png']
76
+    return [IMG_CDN_NEW_URL+'合伙人.png']
77
   }
77
   }
78
   if (userRichType == 9) {
78
   if (userRichType == 9) {
79
     // if (bangfu) {
79
     // if (bangfu) {
80
     //   return ['../../static/img-hy/帮扶中心.png', bangfu]
80
     //   return ['../../static/img-hy/帮扶中心.png', bangfu]
81
     // }
81
     // }
82
-    return [ICON_CDN_URL+'联合创始人.png']
82
+    return [IMG_CDN_NEW_URL+'联合创始人.png']
83
   }
83
   }
84
   if (!userRichType) {
84
   if (!userRichType) {
85
     // if (bangfu) {
85
     // if (bangfu) {

+ 9 - 1
src/pages/payment/index.vue

@@ -15,7 +15,7 @@ const state = reactive({
15
   orderId: '',
15
   orderId: '',
16
   code: '',
16
   code: '',
17
   memberType: 0,
17
   memberType: 0,
18
-
18
+  initType:0,
19
   tabIndex: Number.NaN,
19
   tabIndex: Number.NaN,
20
 })
20
 })
21
 onLoad((options) => {
21
 onLoad((options) => {
@@ -26,6 +26,7 @@ onLoad((options) => {
26
     state.orderList = options.OrderList
26
     state.orderList = options.OrderList
27
     state.payPrice = options.pay_price
27
     state.payPrice = options.pay_price
28
     state.orderId = options.order_id
28
     state.orderId = options.order_id
29
+	state.initType =options.initType
29
 
30
 
30
     console.log('options')
31
     console.log('options')
31
     console.log(options)
32
     console.log(options)
@@ -80,6 +81,13 @@ function handleConfirm() {
80
 }
81
 }
81
 
82
 
82
 function onClickLeft() {
83
 function onClickLeft() {
84
+	
85
+	if(	state.initType==1){
86
+	 uni.navigateBack({
87
+	   delta: 1,
88
+	 })
89
+		return
90
+	}
83
   uni.showModal({
91
   uni.showModal({
84
     title: '确认要离开收银台?',
92
     title: '确认要离开收银台?',
85
     content: '您的订单在24小时内未支付将被取消,请尽快完成支付。',
93
     content: '您的订单在24小时内未支付将被取消,请尽快完成支付。',

+ 10 - 10
src/pages/user/index.vue

@@ -226,29 +226,29 @@
226
 		// 普通用户
226
 		// 普通用户
227
 		if (userRichType == 0)
227
 		if (userRichType == 0)
228
 
228
 
229
-			return ICON_CDN_URL+'用户.png'
229
+			return IMG_CDN_NEW_URL+'用户.png'
230
 
230
 
231
 		// 会员
231
 		// 会员
232
 		if (userRichType == 1)
232
 		if (userRichType == 1)
233
 
233
 
234
-			return ICON_CDN_URL+'会员.png'
234
+			return IMG_CDN_NEW_URL+'会员.png'
235
 
235
 
236
 		if (userRichType == 3)
236
 		if (userRichType == 3)
237
 
237
 
238
-			return ICON_CDN_URL+'创始人.png'
238
+			return IMG_CDN_NEW_URL+'创始人.png'
239
 
239
 
240
 		// 高级会员
240
 		// 高级会员
241
 		if (userRichType == 4)
241
 		if (userRichType == 4)
242
 
242
 
243
-			return ICON_CDN_URL+'高级会员.png'
243
+			return IMG_CDN_NEW_URL+'高级会员.png'
244
 
244
 
245
 		if (userRichType == 8)
245
 		if (userRichType == 8)
246
 
246
 
247
-			return ICON_CDN_URL+'合伙人.png'
247
+			return IMG_CDN_NEW_URL+'合伙人.png'
248
 
248
 
249
 		if (userRichType == 9)
249
 		if (userRichType == 9)
250
 
250
 
251
-			return ICON_CDN_URL+'联合创始人.png'
251
+			return IMG_CDN_NEW_URL+'联合创始人.png'
252
 
252
 
253
 		if (!userRichType)
253
 		if (!userRichType)
254
 
254
 
@@ -266,7 +266,7 @@
266
 			return ''
266
 			return ''
267
 		// 股东
267
 		// 股东
268
 		if (stockholder == 1)
268
 		if (stockholder == 1)
269
-			return ICON_CDN_URL+'股东.png'
269
+			return IMG_CDN_NEW_URL+'股东.png'
270
 	})
270
 	})
271
 	// '':普通用户 district-区/县代 city-市代',
271
 	// '':普通用户 district-区/县代 city-市代',
272
 	const areaType = computed(() => {
272
 	const areaType = computed(() => {
@@ -473,7 +473,7 @@
473
 							<div class="group_2 flex-col lolr ">
473
 							<div class="group_2 flex-col lolr ">
474
 								<div class="div_box pong1 ">
474
 								<div class="div_box pong1 ">
475
 									<div class="blue_1">
475
 									<div class="blue_1">
476
-										<image lazy-load class="off_3" :src="ICON_CDN_URL+'DLqy.png'" />
476
+										<image lazy-load class="off_3" :src="IMG_CDN_NEW_URL+'DLqy.png'" />
477
 										<span class="pan">代理区域</span>
477
 										<span class="pan">代理区域</span>
478
 									</div>
478
 									</div>
479
 									<div class="blue_2 height1 ">
479
 									<div class="blue_2 height1 ">
@@ -482,7 +482,7 @@
482
 								</div>
482
 								</div>
483
 								<div class="div_box pong2 ">
483
 								<div class="div_box pong2 ">
484
 									<div class="blue_1">
484
 									<div class="blue_1">
485
-										<image lazy-load class="off_3" :src="ICON_CDN_URL+'QYDL.png'" />
485
+										<image lazy-load class="off_3" :src="IMG_CDN_NEW_URL+'QYDL.png'" />
486
 										<span class="pan">代理权益</span>
486
 										<span class="pan">代理权益</span>
487
 									</div>
487
 									</div>
488
 									<div class="block_1 flex-col blue_2 height2 ">
488
 									<div class="block_1 flex-col blue_2 height2 ">
@@ -499,7 +499,7 @@
499
 							</div>
499
 							</div>
500
 						</div>
500
 						</div>
501
 						<div class="off_1" @click="onCancel">
501
 						<div class="off_1" @click="onCancel">
502
-							<image lazy-load class="off_2" src="../../static/img-hy/关闭.png" />
502
+							<image lazy-load class="off_2" :src="IMG_CDN_NEW_URL+'关闭.png'" />
503
 						</div>
503
 						</div>
504
 					</FPopup>
504
 					</FPopup>
505
 				</div>
505
 				</div>

+ 2 - 2
src/pages/user/login/index.vue

@@ -82,7 +82,7 @@ async function handleWexinLogin() {
82
         // params.share_id = shareId
82
         // params.share_id = shareId
83
         // params = Object.assign({}, params, { shareId })
83
         // params = Object.assign({}, params, { shareId })
84
         // }
84
         // }
85
-        wechatCheck(unionRes.unionid).then((checkRes) => {
85
+        wechatCheck(unionRes.openid).then((checkRes) => {
86
           userStore.login(checkRes.token, checkRes.exp)
86
           userStore.login(checkRes.token, checkRes.exp)
87
           userStore.setUID(checkRes.user.uid)
87
           userStore.setUID(checkRes.user.uid)
88
           userStore.setUserInfo(checkRes.user)
88
           userStore.setUserInfo(checkRes.user)
@@ -163,7 +163,7 @@ async function handleWexinLogin() {
163
 
163
 
164
             setTimeout(() => {
164
             setTimeout(() => {
165
               uni.navigateTo({
165
               uni.navigateTo({
166
-                url: `/pages/user/login/bind-phone?type=1&third_user_id=${unionRes.unionid}&key=0`,
166
+                url: `/pages/user/login/bind-phone?type=1&third_user_id=${unionRes.openid}&key=0`,
167
               })
167
               })
168
             }, 1000)
168
             }, 1000)
169
           }
169
           }

+ 0 - 2
src/subPages/pages/order/index.vue

@@ -202,8 +202,6 @@ function onClickLeft() {
202
       uni.navigateBack()
202
       uni.navigateBack()
203
     }
203
     }
204
   } else {
204
   } else {
205
-    // uni.navigateBack({
206
-    // })
207
     uni.switchTab({
205
     uni.switchTab({
208
       url: '/pages/user/index'
206
       url: '/pages/user/index'
209
     })
207
     })

+ 17 - 2
src/subPages/pages/phone-bill/index.vue

@@ -59,8 +59,15 @@
59
 	}
59
 	}
60
 	
60
 	
61
 	function onHistoryClick(){
61
 	function onHistoryClick(){
62
-		
62
+		uni.navigateTo({url:'/subPages/pages/phone-bill/list'})
63
+	}
64
+	
65
+	function isValidChineseMobile(phone) {
66
+	    const regex = /^1[3-9]\d{9}$/;
67
+	    return regex.test(phone);
63
 	}
68
 	}
69
+	 
70
+	
64
 	
71
 	
65
 	function onSubmitClick(){
72
 	function onSubmitClick(){
66
 		
73
 		
@@ -72,9 +79,17 @@
72
 			})
79
 			})
73
 			 return
80
 			 return
74
 		}
81
 		}
82
+		if(!isValidChineseMobile(phoneNum.value)){
83
+			uni.showToast({
84
+				title:'请输入正确手机号',
85
+				icon:'none'
86
+			})
87
+			 return
88
+		}
89
+		
75
 		apiRecharge(phoneNum.value,tabList.value[currentIndex.value ].money).then(res=>{
90
 		apiRecharge(phoneNum.value,tabList.value[currentIndex.value ].money).then(res=>{
76
 				uni.navigateTo({
91
 				uni.navigateTo({
77
-					url: '/pages/payment/index?' + `pay_price=${tabList.value[currentIndex.value ].money}&order_id=${res.oid}&OrderList=${JSON.stringify({group_order_sn:order_sn})}`,
92
+					url: '/pages/payment/index?' + `initType=1&pay_price=${tabList.value[currentIndex.value ].money}&order_id=${res.oid}`,
78
 				})
93
 				})
79
 		})
94
 		})
80
 	}
95
 	}

+ 141 - 0
src/subPages/pages/phone-bill/list.vue

@@ -0,0 +1,141 @@
1
+<template>
2
+	<view class="contribute-container">
3
+		<view @click='onItemClick(item)' v-if="listInfo && listInfo.length!=0" class="phone-item-out" :key="'phone-item-'+index" v-for="(item,index) in listInfo">
4
+			<text class="phone">{{item.mobile}}</text>
5
+			<view class="phone-item">
6
+				<text class="price">充值金额:{{item.pay_money}}</text>
7
+				<text class="phone">{{dealType(item.status)}}</text>
8
+			</view>
9
+			<text class="data">{{item.create_time}}</text>
10
+			<view  class="item-line"></view>
11
+		</view>
12
+		<CXBEmpty v-else />
13
+	</view>
14
+</template>
15
+
16
+<script setup>
17
+	
18
+	import {
19
+		apiGetHuafeiList
20
+	} from '~/apis/user'
21
+	import {formatDate} from '~/utils/util'
22
+	import { getProductShare } from "~/apis/common";
23
+	import { useUserStore } from '~/stores/userStore'
24
+	import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
25
+	import{IMG_CDN_URL} from '~/config/app.ts'
26
+	
27
+	const currentIndex = ref(0)
28
+	const count=ref(1)
29
+    
30
+	const listInfo=ref([])
31
+	const state = reactive({
32
+		page :1
33
+	})
34
+	
35
+	onLoad((option) => {
36
+		getList()
37
+	})
38
+	
39
+	function onItemClick (item){
40
+		if(item.type==0){
41
+			// uni.navigateTo({
42
+			// 	url: '/pages/payment/index?' + `initType=1&pay_price=${tabList.value[currentIndex.value ].money}&order_id=${res.oid}`,
43
+			// })
44
+		}
45
+	}
46
+	
47
+	function dealType(types){
48
+		let type=''
49
+		if(types==0){
50
+			type='待支付'
51
+		}else if(types==1){
52
+			type='充值中'
53
+		}else if(types==2){
54
+			type='充值成功'
55
+		}else if(types==3){
56
+			type='充值失败'
57
+		}
58
+		return type
59
+	}
60
+	
61
+	function getList(){
62
+		uni.showLoading({
63
+			title:'加载中...'
64
+		})
65
+	    apiGetHuafeiList({page:state.page}).then(res => {
66
+			console.log("+==",res);
67
+	    	listInfo.value= res.list
68
+			count.value = res.count
69
+			uni.hideLoading()
70
+	    })
71
+	}
72
+	
73
+	
74
+	onReachBottom(() => {
75
+		if(dataList.value.length <count.value ){
76
+			state.page += 1
77
+			getList()
78
+		}
79
+	})
80
+	
81
+	onPullDownRefresh(() => {
82
+	   state.page=1
83
+	   getList()
84
+	   uni.stopPullDownRefresh()
85
+	})
86
+	
87
+</script>
88
+
89
+<style lang="scss" scoped>
90
+	.contribute-container {
91
+		display: flex;
92
+		flex-direction: column;
93
+		min-height: 100VH;
94
+		background-color: #fff;
95
+		box-sizing: border-box;
96
+		position: relative;
97
+		
98
+		.phone-item-out{
99
+			display: flex;
100
+			flex-direction: column;
101
+			padding-left: 20rpx;
102
+			box-sizing: border-box;
103
+			padding-right: 20rpx;
104
+			
105
+			.phone{
106
+				font-size: 28rpx;
107
+				color:#333;
108
+				margin-bottom: 20rpx;
109
+				margin-top: 20rpx;
110
+			}
111
+			.price{
112
+				font-size: 28rpx;
113
+				color:#333;
114
+				margin-bottom: 24rpx;
115
+				flex: 1;
116
+			}
117
+			.phone-item{
118
+				display: flex;
119
+				flex-direction: row;
120
+				align-items: center;
121
+			}
122
+			.data{
123
+				font-size: 26rpx;
124
+				color:#999;
125
+				margin-bottom: 20rpx;
126
+			}
127
+			.item-line{
128
+				height: 2rpx;
129
+				width: 100%;
130
+				background-color: #f8f8f8;
131
+			}
132
+		}
133
+		
134
+	}
135
+</style>
136
+
137
+<route lang="yaml">
138
+style:
139
+  navigationBarTitleText: 充值记录
140
+  enablePullDownRefresh: true
141
+</route>

+ 1 - 0
uni-pages.d.ts

@@ -110,6 +110,7 @@ interface NavigateToOptions {
110
        "/subPages/pages/order/third-order" |
110
        "/subPages/pages/order/third-order" |
111
        "/subPages/pages/pension_account/index" |
111
        "/subPages/pages/pension_account/index" |
112
        "/subPages/pages/phone-bill/index" |
112
        "/subPages/pages/phone-bill/index" |
113
+       "/subPages/pages/phone-bill/list" |
113
        "/subPages/pages/quick-fuc/business" |
114
        "/subPages/pages/quick-fuc/business" |
114
        "/subPages/pages/quick-fuc/life" |
115
        "/subPages/pages/quick-fuc/life" |
115
        "/subPages/pages/quick-fuc/shop" |
116
        "/subPages/pages/quick-fuc/shop" |