20912bef by 华明祺

feat(personal): 实现个人中心页面及绑定/解绑学员功能

- 新增个人中心页面,包含会员卡展示、用户信息、功能入口
- 实现绑定学员弹框,支持输入姓名和证件号进行绑定
- 添加绑定状态判断,已绑定时按钮切换为解绑
- 实现解绑功能,调用unbindUser接口
- 新增退出登录按钮
- 添加bindUser和unbindUser API接口
1 parent dc453c5f
1 <script> 1 <script>
2 import config from '@/config.js';
2 import { 3 import {
3 getInfo 4 getInfo,
5 getWebInfo
4 } from '@/common/login.js'; 6 } from '@/common/login.js';
5 import * as api from '@/common/api.js';
6 import config from '@/config.js';
7 7
8 let loginUrl = ['login/login', 'login/register', 'personal/addVip_per']
9 let firstload = false
10 export default { 8 export default {
11 globalData: { 9 globalData: {
12 isLogin: false, 10 isLogin: false,
13 baseUrl_api: '', 11 baseUrl_api: '',
14 user: null, 12 user: null
15 userType: '',
16 userInfo: null,
17 deptType: '',
18 genFlag: '',
19 authenticationStatus: '',
20 memberInfo: null,
21 isExam: false
22 }, 13 },
23 onLaunch: function(options) { 14 onLaunch: function(options) {
24 console.log('App Launch', options); 15 console.log('App Launch', options);
25
26 this.globalData.baseUrl_api = config.baseUrl_api; 16 this.globalData.baseUrl_api = config.baseUrl_api;
27 if (loginUrl.indexOf(options.path) == -1) { 17
28 let userName = uni.getStorageSync('userName') 18 let userName = uni.getStorageSync('userName')
29 if (userName) { 19 if (userName) {
30 getInfo().then(() => { 20 getInfo().then(() => {
31 this.globalData.isLogin = true; 21 this.globalData.isLogin = true
32 firstload = true 22 uni.reLaunch({
33 let firstLoadCallback = getApp().firstLoadCallback; 23 url: '/pages/index/home'
34 if (firstLoadCallback) { 24 })
35 firstLoadCallback();
36 }
37 }).catch(() => { 25 }).catch(() => {
38 firstload = true 26 uni.reLaunch({
39 uni.redirectTo({
40 url: '/login/login' 27 url: '/login/login'
41 }) 28 })
42 }) 29 })
43 } else { 30 return
44 this.globalData.isLogin = false; 31 }
45 firstload = true 32
46 uni.redirectTo({ 33 let webUserName = uni.getStorageSync('webUserName')
34 if (webUserName) {
35 getWebInfo().then(() => {
36 uni.reLaunch({
37 url: '/personal/home'
38 })
39 }).catch(() => {
40 uni.reLaunch({
47 url: '/login/login' 41 url: '/login/login'
48 }) 42 })
43 })
44 return
49 } 45 }
50 } 46
47 this.globalData.isLogin = false
48 uni.reLaunch({
49 url: '/login/login'
50 })
51 }, 51 },
52 onShow: function() { 52 onShow: function() {
53 console.log('App Show', firstload, this.globalData.isLogin); 53 console.log('App Show');
54 // if (firstload && !this.globalData.isLogin) {
55 // uni.redirectTo({
56 // url: '/login/login'
57 // })
58 // }
59 }, 54 },
60 onHide: function() { 55 onHide: function() {
61 console.log('App Hide'); 56 console.log('App Hide');
......
1 import request from './request.js' 1 import request from './request.js'
2 import config from '@/config.js' 2 import config from '@/config.js'
3 import * as loginServer from '@/common/login.js';
4 3
5 // 激活 4 // 激活
6 export function active(data) { 5 export function active(data) {
...@@ -1415,6 +1414,14 @@ export function createMemberPayRange(data) { ...@@ -1415,6 +1414,14 @@ export function createMemberPayRange(data) {
1415 }) 1414 })
1416 } 1415 }
1417 1416
1417 // 获取最近认证记录
1418 export function getMyRecent() {
1419 return request({
1420 url: '/system/certifiedNew/getMyRecent',
1421 method: 'get'
1422 })
1423 }
1424
1418 // 获取订单详情 1425 // 获取订单详情
1419 export function getOrderInfo(orderId) { 1426 export function getOrderInfo(orderId) {
1420 return request({ 1427 return request({
...@@ -1422,3 +1429,19 @@ export function getOrderInfo(orderId) { ...@@ -1422,3 +1429,19 @@ export function getOrderInfo(orderId) {
1422 method: 'get' 1429 method: 'get'
1423 }) 1430 })
1424 } 1431 }
1432
1433 // 绑定学员
1434 export function bindUser(data) {
1435 return request({
1436 url: `/person/info/bindUser`,
1437 method: 'post',
1438 params: data
1439 })
1440 }
1441
1442 export function unbindUser() {
1443 return request({
1444 url: `/person/info/unbindUser`,
1445 method: 'post'
1446 })
1447 }
...\ No newline at end of file ...\ No newline at end of file
......
1 import {
2 useUserStore
3 } from '../store/modules/user'
1 import request from './request' 4 import request from './request'
2 import * as api from '@/common/api.js'
3 5
4 function pcLogin(data) { 6 function pcLogin(data) {
5 return request({ 7 return request({
...@@ -39,8 +41,15 @@ function logout() { ...@@ -39,8 +41,15 @@ function logout() {
39 url: '/logout', 41 url: '/logout',
40 method: 'post' 42 method: 'post'
41 }).then(() => { 43 }).then(() => {
44 const userStore = useUserStore()
45 const app = getApp()
46
42 uni.removeStorageSync('token') 47 uni.removeStorageSync('token')
43 uni.removeStorageSync('userName') 48 uni.removeStorageSync('userName')
49 uni.removeStorageSync('webUserName')
50
51 userStore.setUser(null)
52 app.globalData.isLogin = false
44 }) 53 })
45 } 54 }
46 55
...@@ -85,15 +94,17 @@ function getInfo() { ...@@ -85,15 +94,17 @@ function getInfo() {
85 url: '/getInfo', 94 url: '/getInfo',
86 method: 'get' 95 method: 'get'
87 }).then(res => { 96 }).then(res => {
97 const userStore = useUserStore()
88 const app = getApp() 98 const app = getApp()
89 const user = res.data.user 99 const user = res.data.user
90 // const personInfo = res.data.personInfo 100
91 uni.setStorageSync('userName', user.userName) 101 uni.setStorageSync('userName', user.userName)
92 // uni.setStorageSync('perId', personInfo.perId||-1) 102 uni.removeStorageSync('webUserName')
93 app.globalData.user = res.data.user 103 userStore.setUser(user)
104
94 app.globalData.deptType = user.dept.deptType 105 app.globalData.deptType = user.dept.deptType
95 app.globalData.genFlag = user.dept.genFlag 106 app.globalData.genFlag = user.dept.genFlag
96 // user.dept.deptType = '3' 107 app.globalData.changePassFlag = user.changePassFlag
97 switch (user.dept.deptType) { 108 switch (user.dept.deptType) {
98 case '1': // 中跆协 109 case '1': // 中跆协
99 app.globalData.userType = '1' 110 app.globalData.userType = '1'
...@@ -109,8 +120,24 @@ function getInfo() { ...@@ -109,8 +120,24 @@ function getInfo() {
109 app.globalData.userType = '3' 120 app.globalData.userType = '3'
110 break 121 break
111 } 122 }
123 })
124 }
112 125
113 app.globalData.userInfo = user 126 function getWebInfo() {
127 return request({
128 url: '/person/info/getInfo',
129 method: 'get'
130 }).then(res => {
131 const userStore = useUserStore()
132 const user = res.data.user
133
134 delete res.data.user
135 const perInfo = res.data
136
137 uni.setStorageSync('webUserName', user.userName)
138 uni.removeStorageSync('userName')
139 userStore.setUser(user)
140 userStore.setPerInfo(perInfo)
114 }) 141 })
115 } 142 }
116 143
...@@ -134,6 +161,38 @@ function getMyOwnMemberInfo() { ...@@ -134,6 +161,38 @@ function getMyOwnMemberInfo() {
134 app.globalData.isExam = res.data?.memberInfo?.isPoints 161 app.globalData.isExam = res.data?.memberInfo?.isPoints
135 }) 162 })
136 } 163 }
164
165
166 function wxLogin() {
167 return new Promise((resolve, reject) => {
168 uni.login({
169 provider: 'weixin',
170 success: (res) => {
171 resolve(res)
172 },
173 fail: (res) => {
174 uni.showToast({
175 title: '获取用户信息失败',
176 icon: 'none',
177 duration: 2000
178 })
179 reject(res)
180 }
181 })
182 }).then(res => {
183 return pcLoginByCode(res.code)
184 })
185 }
186
187 function pcLoginByCode(code) {
188 return request({
189 url: `/loginByJsCode?jsCode=${code}`,
190 method: "POST"
191 }).then((res) => {
192 uni.setStorageSync('token', 'Bearer ' + res.data);
193 }).then(getWebInfo)
194 }
195
137 export { 196 export {
138 pcLogin, 197 pcLogin,
139 getCodeImg, 198 getCodeImg,
...@@ -144,5 +203,7 @@ export { ...@@ -144,5 +203,7 @@ export {
144 groupMemberRegister, 203 groupMemberRegister,
145 getMyOwnMemberInfo, 204 getMyOwnMemberInfo,
146 logout, 205 logout,
147 getInfo 206 getInfo,
207 getWebInfo,
208 wxLogin
148 } 209 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
26 考试信息 26 考试信息
27 </view> 27 </view>
28 <view class="userlist"> 28 <view class="userlist">
29 <view class="item" v-for="(n,index) in infoList" :key="index" @click="goDetail(n)" style="background-color: #fffafa;"> 29 <view class="item" v-for="(n,index) in infoList" :key="index" @click="goDetail(n)"
30 style="background-color: #fffafa;">
30 <view class="w100"> 31 <view class="w100">
31 <view class="text-primary">{{n.examCode}}</view> 32 <view class="text-primary">{{n.examCode}}</view>
32 <view class="name">{{n.name}}</view> 33 <view class="name">{{n.name}}</view>
...@@ -82,7 +83,6 @@ ...@@ -82,7 +83,6 @@
82 onLoad((option) => { 83 onLoad((option) => {
83 if ('form' in option) { 84 if ('form' in option) {
84 form.value = JSON.parse(decodeURIComponent(option.form)) 85 form.value = JSON.parse(decodeURIComponent(option.form))
85 console.log(111,form.value)
86 } 86 }
87 type.value = option.type 87 type.value = option.type
88 // console.log(222,form.value) 88 // console.log(222,form.value)
...@@ -120,13 +120,13 @@ ...@@ -120,13 +120,13 @@
120 }) 120 })
121 } 121 }
122 122
123 function goDetail(item){ 123 function goDetail(item) {
124 const form = encodeURIComponent(JSON.stringify(item)) 124 const form = encodeURIComponent(JSON.stringify(item))
125 let path = `/level/applyDetail?examId=${item.examId}&form=${form}` 125 let path = `/level/applyDetail?examId=${item.examId}&form=${form}`
126 uni.navigateTo({ 126 uni.navigateTo({
127 url: path 127 url: path
128 }); 128 });
129 } 129 }
130 </script> 130 </script>
131 131
132 <style scoped lang="scss"> 132 <style scoped lang="scss">
...@@ -139,15 +139,25 @@ function goDetail(item){ ...@@ -139,15 +139,25 @@ function goDetail(item){
139 border-radius: 15rpx; 139 border-radius: 15rpx;
140 140
141 .tt { 141 .tt {
142 color: #0A1629;margin: 0 0 30rpx; 142 color: #0A1629;
143 margin: 0 0 30rpx;
143 font-size: 30rpx; 144 font-size: 30rpx;
144 } 145 }
145 146
146 .ddd{font-size: 28rpx;color: #333; margin: 0 0 10rpx; 147 .ddd {
147 .lab{color: #999;display: inline-block;text-align: justify; 148 font-size: 28rpx;
148 text{word-break: break-all;} 149 color: #333;
150 margin: 0 0 10rpx;
151
152 .lab {
153 color: #999;
154 display: inline-block;
155 text-align: justify;
156
157 text {
158 word-break: break-all;
159 }
149 } 160 }
150 } 161 }
151 } 162 }
152
153 </style> 163 </style>
...\ No newline at end of file ...\ No newline at end of file
......
1 <template> 1 <template>
2 <view class="page-bg"> 2 <view class="page-bg">
3 <view class="nav-bar" style="margin-top:-30px" > 3 <view class="nav-bar" style="margin-top:-30px">
4 <view class="back-btn" @click="goBack"> 4 <view class="back-btn" @click="goBack">
5 <uni-icons type="left" size="20" color="#fff"></uni-icons> 5 <uni-icons type="left" size="20" color="#fff"></uni-icons>
6 </view> 6 </view>
...@@ -134,9 +134,11 @@ ...@@ -134,9 +134,11 @@
134 }); 134 });
135 } 135 }
136 }) 136 })
137 function goBack(){ 137
138 function goBack() {
138 uni.navigateBack() 139 uni.navigateBack()
139 } 140 }
141
140 function changeActive(n) { 142 function changeActive(n) {
141 isActive.value = n 143 isActive.value = n
142 } 144 }
...@@ -173,7 +175,7 @@ ...@@ -173,7 +175,7 @@
173 pcLogin(form.value).then((res) => { 175 pcLogin(form.value).then((res) => {
174 app.globalData.isLogin = true 176 app.globalData.isLogin = true
175 uni.redirectTo({ 177 uni.redirectTo({
176 url: '/pages/index/index' 178 url: '/pages/index/home'
177 }) 179 })
178 }) 180 })
179 } else if (isActive.value == 1) { 181 } else if (isActive.value == 1) {
...@@ -205,7 +207,7 @@ ...@@ -205,7 +207,7 @@
205 .then(() => { 207 .then(() => {
206 app.globalData.isLogin = true 208 app.globalData.isLogin = true
207 uni.redirectTo({ 209 uni.redirectTo({
208 url: '/pages/index/index' 210 url: '/pages/index/home'
209 }) 211 })
210 }) 212 })
211 } 213 }
...@@ -286,7 +288,10 @@ ...@@ -286,7 +288,10 @@
286 </script> 288 </script>
287 289
288 <style scoped lang="scss"> 290 <style scoped lang="scss">
289 .wNumber {position: absolute;width: 100%;bottom:-50rpx; 291 .wNumber {
292 position: absolute;
293 width: 100%;
294 bottom: -50rpx;
290 text-align: center; 295 text-align: center;
291 color: rgba(255, 255, 255, 0.7); 296 color: rgba(255, 255, 255, 0.7);
292 font-size: 24rpx; 297 font-size: 24rpx;
...@@ -330,7 +335,9 @@ ...@@ -330,7 +335,9 @@
330 position: relative; 335 position: relative;
331 } 336 }
332 337
333 .loginbox {position: relative; 338 .loginbox {
339 position: relative;
340
334 .loginNav { 341 .loginNav {
335 width: 700rpx; 342 width: 700rpx;
336 margin: 0 auto -53rpx; 343 margin: 0 auto -53rpx;
......
1 import App from './App' 1 import App from './App'
2 import store from './store'
3
2 // #ifndef VUE3 4 // #ifndef VUE3
3 import Vue from 'vue' 5 import Vue from 'vue'
4 Vue.config.productionTip = false 6 Vue.config.productionTip = false
...@@ -6,6 +8,7 @@ App.mpType = 'app' ...@@ -6,6 +8,7 @@ App.mpType = 'app'
6 const app = new Vue({ 8 const app = new Vue({
7 ...App 9 ...App
8 }) 10 })
11 app.use(store)
9 app.$mount() 12 app.$mount()
10 // #endif 13 // #endif
11 14
...@@ -15,6 +18,7 @@ import { ...@@ -15,6 +18,7 @@ import {
15 } from 'vue' 18 } from 'vue'
16 export function createApp() { 19 export function createApp() {
17 const app = createSSRApp(App) 20 const app = createSSRApp(App)
21 app.use(store)
18 return { 22 return {
19 app 23 app
20 } 24 }
......
...@@ -129,10 +129,10 @@ ...@@ -129,10 +129,10 @@
129 if (orderErr) { 129 if (orderErr) {
130 uni.hideLoading() 130 uni.hideLoading()
131 isPaying.value = false 131 isPaying.value = false
132 uni.showToast({ 132 // uni.showToast({
133 title: '创建订单失败', 133 // title: '创建订单失败',
134 icon: 'none' 134 // icon: 'none'
135 }) 135 // })
136 return 136 return
137 } 137 }
138 138
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
141 if (data.payFlag == 0) { 141 if (data.payFlag == 0) {
142 uni.hideLoading() 142 uni.hideLoading()
143 isPaying.value = false 143 isPaying.value = false
144 uni.navigateTo({ 144 uni.redirectTo({
145 url: `/myCenter/sucPay?orderId=${data.orderId}` 145 url: `/myCenter/sucPay?orderId=${data.orderId}`
146 }) 146 })
147 return 147 return
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
153 uni.hideLoading() 153 uni.hideLoading()
154 isPaying.value = false 154 isPaying.value = false
155 155
156 uni.navigateTo({ 156 uni.redirectTo({
157 url: `/myCenter/sucPay?orderId=${data.orderId}` 157 url: `/myCenter/sucPay?orderId=${data.orderId}`
158 }) 158 })
159 } 159 }
......
...@@ -49,44 +49,59 @@ ...@@ -49,44 +49,59 @@
49 </template> 49 </template>
50 50
51 <script setup> 51 <script setup>
52 import { ref } from 'vue' 52 import {
53 import { onLoad } from '@dcloudio/uni-app'; 53 ref
54 import * as api from '@/common/api.js' 54 } from 'vue'
55 55 import {
56 // 核心数据 56 onLoad
57 const formData = ref({}) // 订单统计数据 57 } from '@dcloudio/uni-app';
58 const rangeId = ref('') // 核心业务ID 58 import * as api from '@/common/api.js'
59 const payType = ref('0') // 支付方式(默认0=民生付) 59
60 const payLoading = ref(false) // 支付按钮加载状态 60 // 核心数据
61 61 const formData = ref({}) // 订单统计数据
62 // 页面加载接收参数 62 const rangeId = ref('') // 核心业务ID
63 onLoad(async (options) => { 63 const payType = ref('0') // 支付方式(默认0=民生付)
64 const payLoading = ref(false) // 支付按钮加载状态
65
66 // 页面加载接收参数
67 onLoad(async (options) => {
64 console.log('订单ID:', options.rangeId) 68 console.log('订单ID:', options.rangeId)
65 if (options.rangeId) { 69 if (options.rangeId) {
66 rangeId.value = options.rangeId 70 rangeId.value = options.rangeId
67 await getCount() 71 await getCount()
68 } 72 }
69 }) 73 })
70 74
71 async function getCount() { 75 async function getCount() {
72 try { 76 try {
73 const res = await api.getNewCountByRangeId(rangeId.value) 77 const res = await api.getNewCountByRangeId(rangeId.value)
74 formData.value = res.data || { all: 0, new: 0, old: 0 } 78 formData.value = res.data || {
79 all: 0,
80 new: 0,
81 old: 0
82 }
75 } catch (e) { 83 } catch (e) {
76 formData.value = { all: 0, new: 0, old: 0 } 84 formData.value = {
85 all: 0,
86 new: 0,
87 old: 0
88 }
89 }
77 } 90 }
78 }
79 91
80 // 支付方式切换 92 // 支付方式切换
81 function handlePayTypeChange(e) { 93 function handlePayTypeChange(e) {
82 payType.value = e.detail.value 94 payType.value = e.detail.value
83 } 95 }
84 96
85 // 立即支付核心逻辑 97 // 立即支付核心逻辑
86 async function handlePay() { 98 async function handlePay() {
87 // 基础校验 99 // 基础校验
88 if (!rangeId.value || rangeId.value === '-1') { 100 if (!rangeId.value || rangeId.value === '-1') {
89 return uni.showToast({ title: '订单ID异常', icon: 'none' }) 101 return uni.showToast({
102 title: '订单ID异常',
103 icon: 'none'
104 })
90 } 105 }
91 106
92 try { 107 try {
...@@ -95,7 +110,7 @@ async function handlePay() { ...@@ -95,7 +110,7 @@ async function handlePay() {
95 110
96 if (res.data?.orderId) { 111 if (res.data?.orderId) {
97 api.pcallBack2(res.data.orderId) 112 api.pcallBack2(res.data.orderId)
98 uni.navigateTo({ 113 uni.redirectTo({
99 url: `/myCenter/sucPay?rangeId=${rangeId.value}from=payOrder` 114 url: `/myCenter/sucPay?rangeId=${rangeId.value}from=payOrder`
100 }) 115 })
101 } 116 }
...@@ -104,25 +119,30 @@ async function handlePay() { ...@@ -104,25 +119,30 @@ async function handlePay() {
104 119
105 } catch (err) { 120 } catch (err) {
106 const errMsg = err?.data?.msg || err?.message || '支付失败,请稍后重试' 121 const errMsg = err?.data?.msg || err?.message || '支付失败,请稍后重试'
107 uni.showToast({ title: errMsg, icon: 'none' }) 122 uni.showToast({
123 title: errMsg,
124 icon: 'none'
125 })
108 } finally { 126 } finally {
109 payLoading.value = false 127 payLoading.value = false
110 } 128 }
111 } 129 }
112 </script> 130 </script>
113 131
114 <style scoped lang="scss"> 132 <style scoped lang="scss">
115 .pay-order-container { 133 .pay-order-container {
116 padding: 30rpx; 134 padding: 30rpx;
117 background-color: #fff; 135 background-color: #fff;
118 min-height: 100vh; 136 min-height: 100vh;
119 box-sizing: border-box; 137 box-sizing: border-box;
120 } 138 }
121 .icon{ 139
122 width:30px; 140 .icon {
123 } 141 width: 30px;
124 // 页面头部 142 }
125 .page-header { 143
144 // 页面头部
145 .page-header {
126 text-align: center; 146 text-align: center;
127 padding: 20rpx 0; 147 padding: 20rpx 0;
128 border-bottom: 1px solid #eee; 148 border-bottom: 1px solid #eee;
...@@ -133,10 +153,10 @@ async function handlePay() { ...@@ -133,10 +153,10 @@ async function handlePay() {
133 font-weight: 600; 153 font-weight: 600;
134 color: #333; 154 color: #333;
135 } 155 }
136 } 156 }
137 157
138 // 订单信息区域 158 // 订单信息区域
139 .order-info { 159 .order-info {
140 margin-bottom: 60rpx; 160 margin-bottom: 60rpx;
141 161
142 .info-item { 162 .info-item {
...@@ -174,10 +194,10 @@ async function handlePay() { ...@@ -174,10 +194,10 @@ async function handlePay() {
174 font-size: 38rpx; 194 font-size: 38rpx;
175 } 195 }
176 } 196 }
177 } 197 }
178 198
179 // 支付方式区域 199 // 支付方式区域
180 .pay-type-section { 200 .pay-type-section {
181 margin-bottom: 80rpx; 201 margin-bottom: 80rpx;
182 202
183 .section-title { 203 .section-title {
...@@ -205,10 +225,10 @@ async function handlePay() { ...@@ -205,10 +225,10 @@ async function handlePay() {
205 } 225 }
206 } 226 }
207 } 227 }
208 } 228 }
209 229
210 // 底部支付按钮 230 // 底部支付按钮
211 .fixed-bottom { 231 .fixed-bottom {
212 position: fixed; 232 position: fixed;
213 bottom: 0; 233 bottom: 0;
214 left: 0; 234 left: 0;
...@@ -230,5 +250,5 @@ async function handlePay() { ...@@ -230,5 +250,5 @@ async function handlePay() {
230 background-color: #E60012; 250 background-color: #E60012;
231 color: #fff; 251 color: #fff;
232 } 252 }
233 } 253 }
234 </style> 254 </style>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -9,14 +9,12 @@ ...@@ -9,14 +9,12 @@
9 <view class="time">{{n.auditTime||'待审批'}}</view> 9 <view class="time">{{n.auditTime||'待审批'}}</view>
10 <view class="content"> 10 <view class="content">
11 <view class="status"> 11 <view class="status">
12 <text v-if="n.auditResult==0"> 审核中</text>
13 <text v-if="n.auditResult==1" class="text-success">审核通过</text> 12 <text v-if="n.auditResult==1" class="text-success">审核通过</text>
14 <text v-if="n.auditResult==2" class="text-danger"> 审核拒绝</text> 13 <text v-if="n.auditResult==0" class="text-danger"> 审核拒绝</text>
15 <text v-if="n.auditResult==3" class="text-warning"> 已撤回</text>
16 </view> 14 </view>
17 <!-- <view class="name">{{index+1}}</view> --> 15 <!-- <view class="name">{{index+1}}</view> -->
18 <view class="deptName">{{n.auditDeptName}}</view> 16 <view class="deptName">{{n.auditDeptName}}</view>
19 <view v-if="n.auditStatus==2"> 17 <view v-if="n.auditResult==0">
20 备注:{{n.auditMsg||'/' }} 18 备注:{{n.auditMsg||'/' }}
21 </view> 19 </view>
22 </view> 20 </view>
...@@ -31,6 +29,7 @@ ...@@ -31,6 +29,7 @@
31 import * as api from '@/common/api.js' 29 import * as api from '@/common/api.js'
32 import config from '@/config.js' 30 import config from '@/config.js'
33 import _ from 'underscore' 31 import _ from 'underscore'
32 import to from 'await-to-js'
34 import { 33 import {
35 onMounted, 34 onMounted,
36 ref 35 ref
...@@ -42,16 +41,15 @@ ...@@ -42,16 +41,15 @@
42 const app = getApp(); 41 const app = getApp();
43 const userType = ref('') 42 const userType = ref('')
44 const recordList = ref([]) 43 const recordList = ref([])
45 onLoad((option) => { 44 onLoad(async (option) => {
46 getMyCertStageFN() 45 await getMyRecentFN()
47 })
48
49 function getMyCertStageFN() {
50 api.getMyCertStage().then(res => {
51 recordList.value = res.data
52 console.log(res)
53 }) 46 })
54 47
48 async function getMyRecentFN() {
49 const [err, res] = await to(api.getMyRecent())
50 if (!err && res.data && res.data.auditLogs) {
51 recordList.value = JSON.parse(res.data.auditLogs)
52 }
55 } 53 }
56 </script> 54 </script>
57 55
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
4 "crypto-js": "^4.1.1", 4 "crypto-js": "^4.1.1",
5 "dayjs": "^1.11.6", 5 "dayjs": "^1.11.6",
6 "lodash": "^4.17.21", 6 "lodash": "^4.17.21",
7 "pinia": "^3.0.4",
7 "underscore": "^1.13.6" 8 "underscore": "^1.13.6"
8 }, 9 },
9 "devDependencies": { 10 "devDependencies": {
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
10 <view v-html="form.content"></view> 10 <view v-html="form.content"></view>
11 11
12 <view v-if="attachmentMp4.length>0"> 12 <view v-if="attachmentMp4.length>0">
13 <video v-for="(f,index) in attachmentMp4" :key="index" controls :src="config.baseUrl_api + f.url"></video> 13 <video v-for="(f,index) in attachmentMp4" :key="index" controls
14 :src="config.baseUrl_api + f.url"></video>
14 </view> 15 </view>
15 <view v-if="attachmentFile.length>0" class="mt20"> 16 <view v-if="attachmentFile.length>0" class="mt20">
16 <!-- 附件--> 17 <!-- 附件-->
...@@ -39,8 +40,8 @@ ...@@ -39,8 +40,8 @@
39 import _ from 'underscore' 40 import _ from 'underscore'
40 import config from '@/config.js' 41 import config from '@/config.js'
41 const form = ref({}) 42 const form = ref({})
42 const attachmentFile = ref([]) 43 const attachmentFile = ref([])
43 const attachmentMp4 = ref([]) 44 const attachmentMp4 = ref([])
44 45
45 onLoad((option) => { 46 onLoad((option) => {
46 getData(option.noteId) 47 getData(option.noteId)
...@@ -58,15 +59,17 @@ const attachmentMp4 = ref([]) ...@@ -58,15 +59,17 @@ const attachmentMp4 = ref([])
58 59
59 if (form.value.attacthJson) { 60 if (form.value.attacthJson) {
60 const attachment = JSON.parse(form.value.attacthJson) 61 const attachment = JSON.parse(form.value.attacthJson)
61 attachmentFile.value = _.filter(attachment, (a) => a.url.toLowerCase().indexOf('.mp4') === -1) || [] 62 attachmentFile.value = _.filter(attachment, (a) => a.url.toLowerCase().indexOf('.mp4') === -1) ||
63 []
62 attachmentMp4.value = _.filter(attachment, (a) => a.url.toLowerCase().indexOf('.mp4') !== -1) || [] 64 attachmentMp4.value = _.filter(attachment, (a) => a.url.toLowerCase().indexOf('.mp4') !== -1) || []
63 } 65 }
64 }) 66 })
65 } 67 }
66 function downLoad(url){ 68
69 function downLoad(url) {
67 console.log(url) 70 console.log(url)
68 var str = config.baseUrl_api + url 71 var str = config.baseUrl_api + url
69 if (url.indexOf('png') > -1 ||url.indexOf('jpg') > -1 ||url.indexOf('jpeg') > -1) { 72 if (url.indexOf('png') > -1 || url.indexOf('jpg') > -1 || url.indexOf('jpeg') > -1) {
70 uni.previewImage({ 73 uni.previewImage({
71 urls: [str], 74 urls: [str],
72 success: function(res) { 75 success: function(res) {
...@@ -83,6 +86,7 @@ const attachmentMp4 = ref([]) ...@@ -83,6 +86,7 @@ const attachmentMp4 = ref([])
83 goWebView(str) 86 goWebView(str)
84 } 87 }
85 } 88 }
89
86 function goWebView(url) { 90 function goWebView(url) {
87 url = url.replace("http://", "https://") 91 url = url.replace("http://", "https://")
88 uni.showLoading({ 92 uni.showLoading({
...@@ -91,7 +95,6 @@ const attachmentMp4 = ref([]) ...@@ -91,7 +95,6 @@ const attachmentMp4 = ref([])
91 uni.downloadFile({ 95 uni.downloadFile({
92 url: url, 96 url: url,
93 success: function(res) { 97 success: function(res) {
94 console.log('111')
95 uni.hideLoading(); 98 uni.hideLoading();
96 var filePath = res.tempFilePath; 99 var filePath = res.tempFilePath;
97 uni.showLoading({ 100 uni.showLoading({
...@@ -101,14 +104,13 @@ const attachmentMp4 = ref([]) ...@@ -101,14 +104,13 @@ const attachmentMp4 = ref([])
101 filePath: filePath, 104 filePath: filePath,
102 showMenu: true, 105 showMenu: true,
103 success: function(res) { 106 success: function(res) {
104 console.log('222')
105 uni.hideLoading(); 107 uni.hideLoading();
106 }, 108 },
107 fail: function(err) { 109 fail: function(err) {
108 console.log(err.errMsg) 110 console.log(err.errMsg)
109 uni.hideLoading(); 111 uni.hideLoading();
110 let msg 112 let msg
111 if(err.errMsg.indexOf('not supported')>-1){ 113 if (err.errMsg.indexOf('not supported') > -1) {
112 msg = '不支持该文件类型' 114 msg = '不支持该文件类型'
113 } else { 115 } else {
114 msg = err.errMsg 116 msg = err.errMsg
...@@ -140,6 +142,7 @@ const attachmentMp4 = ref([]) ...@@ -140,6 +142,7 @@ const attachmentMp4 = ref([])
140 background: #fff; 142 background: #fff;
141 min-height: 100vh; 143 min-height: 100vh;
142 } 144 }
145
143 .title { 146 .title {
144 font-size: 36rpx; 147 font-size: 36rpx;
145 font-weight: 500; 148 font-weight: 500;
...@@ -158,6 +161,7 @@ const attachmentMp4 = ref([]) ...@@ -158,6 +161,7 @@ const attachmentMp4 = ref([])
158 color: #7B7F83; 161 color: #7B7F83;
159 font-size: 22rpx; 162 font-size: 22rpx;
160 } 163 }
164
161 .content { 165 .content {
162 line-height: 1.6; 166 line-height: 1.6;
163 color: #4C5359; 167 color: #4C5359;
...@@ -178,7 +182,10 @@ const attachmentMp4 = ref([]) ...@@ -178,7 +182,10 @@ const attachmentMp4 = ref([])
178 word-wrap: break-word !important; 182 word-wrap: break-word !important;
179 white-space: normal !important; 183 white-space: normal !important;
180 } 184 }
181 .content rich-text img{max-width: 100%;} 185
186 .content rich-text img {
187 max-width: 100%;
188 }
182 189
183 image { 190 image {
184 max-width: 100%; 191 max-width: 100%;
......
...@@ -138,10 +138,10 @@ ...@@ -138,10 +138,10 @@
138 if (orderErr) { 138 if (orderErr) {
139 uni.hideLoading() 139 uni.hideLoading()
140 isPaying.value = false 140 isPaying.value = false
141 uni.showToast({ 141 // uni.showToast({
142 title: '创建订单失败', 142 // title: '创建订单失败',
143 icon: 'none' 143 // icon: 'none'
144 }) 144 // })
145 return 145 return
146 } 146 }
147 147
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
161 isPaying.value = false 161 isPaying.value = false
162 162
163 // 支付成功,跳转页面 163 // 支付成功,跳转页面
164 uni.navigateTo({ 164 uni.redirectTo({
165 url: `/personal/sucPay?orderId=${orderRes.data.orderId}` 165 url: `/personal/sucPay?orderId=${orderRes.data.orderId}`
166 }) 166 })
167 } 167 }
......
...@@ -31,32 +31,36 @@ ...@@ -31,32 +31,36 @@
31 </template> 31 </template>
32 32
33 <script setup> 33 <script setup>
34 import { ref } from 'vue' 34 import {
35 import { onLoad } from '@dcloudio/uni-app'; 35 ref
36 import * as api from '@/common/api.js' 36 } from 'vue'
37 37 import {
38 // 核心数据 38 onLoad
39 const formData = ref({}) // 订单统计数据 39 } from '@dcloudio/uni-app';
40 const price = ref('') // 核心业务ID 40 import * as api from '@/common/api.js'
41 const payType = ref('0') // 支付方式(默认0=民生付) 41
42 const payLoading = ref(false) // 支付按钮加载状态 42 // 核心数据
43 43 const formData = ref({}) // 订单统计数据
44 // 页面加载接收参数 44 const price = ref('') // 核心业务ID
45 onLoad(async (options) => { 45 const payType = ref('0') // 支付方式(默认0=民生付)
46 const payLoading = ref(false) // 支付按钮加载状态
47
48 // 页面加载接收参数
49 onLoad(async (options) => {
46 console.log('订单ID:', options.price) 50 console.log('订单ID:', options.price)
47 if (options.price) { 51 if (options.price) {
48 price.value = options.price 52 price.value = options.price
49 } 53 }
50 }) 54 })
51 55
52 56
53 // 支付方式切换 57 // 支付方式切换
54 function handlePayTypeChange(e) { 58 function handlePayTypeChange(e) {
55 payType.value = e.detail.value 59 payType.value = e.detail.value
56 } 60 }
57 61
58 // 立即支付核心逻辑 62 // 立即支付核心逻辑
59 async function handlePay() { 63 async function handlePay() {
60 64
61 65
62 try { 66 try {
...@@ -65,7 +69,7 @@ async function handlePay() { ...@@ -65,7 +69,7 @@ async function handlePay() {
65 69
66 if (res.data?.orderId) { 70 if (res.data?.orderId) {
67 api.pcallBack2(res.data.orderId) 71 api.pcallBack2(res.data.orderId)
68 uni.navigateTo({ 72 uni.redirectTo({
69 url: `/personal/sucPay` 73 url: `/personal/sucPay`
70 }) 74 })
71 } 75 }
...@@ -74,25 +78,30 @@ async function handlePay() { ...@@ -74,25 +78,30 @@ async function handlePay() {
74 78
75 } catch (err) { 79 } catch (err) {
76 const errMsg = err?.data?.msg || err?.message || '支付失败,请稍后重试' 80 const errMsg = err?.data?.msg || err?.message || '支付失败,请稍后重试'
77 uni.showToast({ title: errMsg, icon: 'none' }) 81 uni.showToast({
82 title: errMsg,
83 icon: 'none'
84 })
78 } finally { 85 } finally {
79 payLoading.value = false 86 payLoading.value = false
80 } 87 }
81 } 88 }
82 </script> 89 </script>
83 90
84 <style scoped lang="scss"> 91 <style scoped lang="scss">
85 .pay-order-container { 92 .pay-order-container {
86 padding: 30rpx; 93 padding: 30rpx;
87 background-color: #fff; 94 background-color: #fff;
88 min-height: 100vh; 95 min-height: 100vh;
89 box-sizing: border-box; 96 box-sizing: border-box;
90 } 97 }
91 .icon{ 98
92 width:30px; 99 .icon {
93 } 100 width: 30px;
94 // 页面头部 101 }
95 .page-header { 102
103 // 页面头部
104 .page-header {
96 text-align: center; 105 text-align: center;
97 padding: 20rpx 0; 106 padding: 20rpx 0;
98 border-bottom: 1px solid #eee; 107 border-bottom: 1px solid #eee;
...@@ -103,10 +112,10 @@ async function handlePay() { ...@@ -103,10 +112,10 @@ async function handlePay() {
103 font-weight: 600; 112 font-weight: 600;
104 color: #333; 113 color: #333;
105 } 114 }
106 } 115 }
107 116
108 // 订单信息区域 117 // 订单信息区域
109 .order-info { 118 .order-info {
110 margin-bottom: 60rpx; 119 margin-bottom: 60rpx;
111 120
112 .info-item { 121 .info-item {
...@@ -144,10 +153,10 @@ async function handlePay() { ...@@ -144,10 +153,10 @@ async function handlePay() {
144 font-size: 38rpx; 153 font-size: 38rpx;
145 } 154 }
146 } 155 }
147 } 156 }
148 157
149 // 支付方式区域 158 // 支付方式区域
150 .pay-type-section { 159 .pay-type-section {
151 margin-bottom: 80rpx; 160 margin-bottom: 80rpx;
152 161
153 .section-title { 162 .section-title {
...@@ -175,10 +184,10 @@ async function handlePay() { ...@@ -175,10 +184,10 @@ async function handlePay() {
175 } 184 }
176 } 185 }
177 } 186 }
178 } 187 }
179 188
180 // 底部支付按钮 189 // 底部支付按钮
181 .fixed-bottom { 190 .fixed-bottom {
182 position: fixed; 191 position: fixed;
183 bottom: 0; 192 bottom: 0;
184 left: 0; 193 left: 0;
...@@ -200,5 +209,5 @@ async function handlePay() { ...@@ -200,5 +209,5 @@ async function handlePay() {
200 background-color: #E60012; 209 background-color: #E60012;
201 color: #fff; 210 color: #fff;
202 } 211 }
203 } 212 }
204 </style> 213 </style>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -64,7 +64,8 @@ ...@@ -64,7 +64,8 @@
64 <uni-forms-item label="头像" required> 64 <uni-forms-item label="头像" required>
65 <uni-file-picker v-model="photoArr" @delete="delPhoto" return-type="object" limit="1" 65 <uni-file-picker v-model="photoArr" @delete="delPhoto" return-type="object" limit="1"
66 @select="upPhoto" :del-ico="false" :image-styles="imageStylesTx"></uni-file-picker> 66 @select="upPhoto" :del-ico="false" :image-styles="imageStylesTx"></uni-file-picker>
67 <image mode="aspectFill" v-if="baseFormData.photo2" style="height:200rpx;width:200rpx;" :src="config.baseUrl_api + baseFormData.photo2"/> 67 <image mode="aspectFill" v-if="baseFormData.photo2" style="height:200rpx;width:200rpx;"
68 :src="config.baseUrl_api + baseFormData.photo2" />
68 </uni-forms-item> 69 </uni-forms-item>
69 </view> 70 </view>
70 </uni-forms> 71 </uni-forms>
...@@ -80,7 +81,8 @@ ...@@ -80,7 +81,8 @@
80 <view class="fixedBottom"><button class="btn-red" @click="goSubmit">确 定</button></view> 81 <view class="fixedBottom"><button class="btn-red" @click="goSubmit">确 定</button></view>
81 82
82 <!-- 会员须知 --> 83 <!-- 会员须知 -->
83 <uni-popup ref="popup" type="bottom" background-color="#fff" animation :disable-scroll="true" :mask-click="false"> 84 <uni-popup ref="popup" type="bottom" background-color="#fff" animation :disable-scroll="true"
85 :mask-click="false">
84 <view class="tt">入会须知</view> 86 <view class="tt">入会须知</view>
85 <view class="popBody"> 87 <view class="popBody">
86 _{{baseFormData.name}}_欢迎您申请成为中国跆拳道协会(以下简称中国跆协)会员,请确保本次申请是经过您本人或监护人授权同意后的自愿行为,请您务必仔细阅读本入会须知。 88 _{{baseFormData.name}}_欢迎您申请成为中国跆拳道协会(以下简称中国跆协)会员,请确保本次申请是经过您本人或监护人授权同意后的自愿行为,请您务必仔细阅读本入会须知。
...@@ -297,7 +299,7 @@ ...@@ -297,7 +299,7 @@
297 baseFormData.value.photo = data.data.fang; 299 baseFormData.value.photo = data.data.fang;
298 baseFormData.value.photo2 = data.data.yuan; 300 baseFormData.value.photo2 = data.data.yuan;
299 photoArr.value = { 301 photoArr.value = {
300 url: config.baseUrl_api+baseFormData.value.photo, 302 url: config.baseUrl_api + baseFormData.value.photo,
301 name: '头像', 303 name: '头像',
302 extname: 'jpg' 304 extname: 'jpg'
303 } 305 }
...@@ -492,8 +494,8 @@ ...@@ -492,8 +494,8 @@
492 content: '请确认信息正确', 494 content: '请确认信息正确',
493 success: function(res) { 495 success: function(res) {
494 if (res.confirm) { 496 if (res.confirm) {
495 if(baseFormData.value.idcType=='4'){ 497 if (baseFormData.value.idcType == '4') {
496 baseFormData.value.idcType='0' 498 baseFormData.value.idcType = '0'
497 } 499 }
498 delete baseFormData.value.card 500 delete baseFormData.value.card
499 501
...@@ -523,16 +525,16 @@ ...@@ -523,16 +525,16 @@
523 uni.showModal({ 525 uni.showModal({
524 content: '保存成功', 526 content: '保存成功',
525 title: '提示', 527 title: '提示',
526 confirmText:'继续添加', 528 confirmText: '继续添加',
527 cancelColor:'返回首页', 529 cancelColor: '返回首页',
528 success: function(res) { 530 success: function(res) {
529 uni.redirectTo({ 531 uni.redirectTo({
530 url: `/personalVip/addVip?tab=${current.value}&idcType=${baseFormData.value.idcType}` 532 url: `/personalVip/addVip?tab=${current.value}&idcType=${baseFormData.value.idcType}`
531 }); 533 });
532 }, 534 },
533 fail:function(){ 535 fail: function() {
534 uni.reLaunch({ 536 uni.reLaunch({
535 url:`/pages/index/index` 537 url: `/pages/index/home`
536 }) 538 })
537 } 539 }
538 }) 540 })
...@@ -542,6 +544,7 @@ ...@@ -542,6 +544,7 @@
542 } 544 }
543 }); 545 });
544 } 546 }
547
545 function getUserInfo() { 548 function getUserInfo() {
546 api.getInfo(perId.value).then(res => { 549 api.getInfo(perId.value).then(res => {
547 baseFormData.value = res.data 550 baseFormData.value = res.data
...@@ -553,7 +556,6 @@ ...@@ -553,7 +556,6 @@
553 </script> 556 </script>
554 557
555 <style lang="scss"> 558 <style lang="scss">
556
557 /* 字段名左对齐 */ 559 /* 字段名左对齐 */
558 .uni-forms-item .uni-forms-item__label { 560 .uni-forms-item .uni-forms-item__label {
559 text-align: left !important; 561 text-align: left !important;
...@@ -582,11 +584,10 @@ ...@@ -582,11 +584,10 @@
582 584
583 /* 文本内容右对齐 */ 585 /* 文本内容右对齐 */
584 .uni-forms-item .uni-forms-item__content text, 586 .uni-forms-item .uni-forms-item__content text,
585 .uni-forms-item .uni-forms-item__content > text { 587 .uni-forms-item .uni-forms-item__content>text {
586 display: inline-block !important; 588 display: inline-block !important;
587 white-space: nowrap !important; 589 white-space: nowrap !important;
588 } 590 }
589
590 </style> 591 </style>
591 592
592 <style lang="scss" scoped> 593 <style lang="scss" scoped>
...@@ -598,9 +599,11 @@ ...@@ -598,9 +599,11 @@
598 right: 0; 599 right: 0;
599 bottom: 0; 600 bottom: 0;
600 } 601 }
602
601 :deep(.uni-popup) { 603 :deep(.uni-popup) {
602 overflow: hidden !important; 604 overflow: hidden !important;
603 } 605 }
606
604 :deep(.segmented-control) { 607 :deep(.segmented-control) {
605 height: 100rpx; 608 height: 100rpx;
606 } 609 }
...@@ -676,6 +679,7 @@ ...@@ -676,6 +679,7 @@
676 :deep(.item-text-overflow) { 679 :deep(.item-text-overflow) {
677 text-align: left; 680 text-align: left;
678 } 681 }
682
679 :deep(.fixUniFormItemStyle .uni-data-picker__input-box) { 683 :deep(.fixUniFormItemStyle .uni-data-picker__input-box) {
680 justify-content: flex-start !important; 684 justify-content: flex-start !important;
681 text-align: left !important; 685 text-align: left !important;
......
No preview for this file type
1 import {
2 createPinia
3 } from "pinia";
4
5
6 const store = createPinia()
7
8 export default store
...\ No newline at end of file ...\ No newline at end of file
1 import {
2 defineStore
3 } from "pinia";
4 import {
5 ref
6 } from 'vue'
7
8 export const useUserStore = defineStore('user', () => {
9 const user = ref(null)
10 const perInfo = ref(null)
11
12 const setUser = (value) => {
13 user.value = value
14 }
15
16 const setPerInfo = (value) => {
17 perInfo.value = value
18 }
19
20 return {
21 user,
22 setUser,
23 perInfo,
24 setPerInfo
25 }
26 })
...\ No newline at end of file ...\ No newline at end of file
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!