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(); 25 }).catch(() => {
36 } 26 uni.reLaunch({
37 }).catch(() => { 27 url: '/login/login'
38 firstload = true
39 uni.redirectTo({
40 url: '/login/login'
41 })
42 }) 28 })
43 } else { 29 })
44 this.globalData.isLogin = false; 30 return
45 firstload = true 31 }
46 uni.redirectTo({ 32
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 })
49 } 43 })
44 return
50 } 45 }
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,10 +1414,34 @@ export function createMemberPayRange(data) { ...@@ -1415,10 +1414,34 @@ 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({
1421 url: `/common/order/${orderId}`, 1428 url: `/common/order/${orderId}`,
1422 method: 'get' 1429 method: 'get'
1423 }) 1430 })
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 })
1424 } 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({
6 url: '/login', 8 url: '/login',
7 method: 'post', 9 method: 'post',
8 params: data 10 params: data
9 }).then((res) => { 11 }).then((res) => {
10 uni.setStorageSync('token', 'Bearer ' + res.data.token) 12 uni.setStorageSync('token', 'Bearer ' + res.data.token)
11 }).then(getInfo) 13 }).then(getInfo)
12 } 14 }
13 15
14 function h5Login(userName) { 16 function h5Login(userName) {
15 return request({ 17 return request({
16 url: `/h5Login`, 18 url: `/h5Login`,
17 method: 'post', 19 method: 'post',
18 params: { 20 params: {
19 username: userName 21 username: userName
20 } 22 }
21 }).then((res) => { 23 }).then((res) => {
22 uni.setStorageSync('token', 'Bearer ' + res.data.token) 24 uni.setStorageSync('token', 'Bearer ' + res.data.token)
23 }).then(getInfo) 25 }).then(getInfo)
24 } 26 }
25 27
26 function h5LoginAuto() { 28 function h5LoginAuto() {
27 const userName = uni.getStorageSync('userName') 29 const userName = uni.getStorageSync('userName')
28 if (userName) { 30 if (userName) {
29 return h5Login(userName) 31 return h5Login(userName)
30 } else { 32 } else {
31 uni.redirectTo({ 33 uni.redirectTo({
32 url: '/login/login' 34 url: '/login/login'
33 }) 35 })
34 } 36 }
35 } 37 }
36 38
37 function logout() { 39 function logout() {
38 return request({ 40 return request({
39 url: '/logout', 41 url: '/logout',
40 method: 'post' 42 method: 'post'
41 }).then(() => { 43 }).then(() => {
42 uni.removeStorageSync('token') 44 const userStore = useUserStore()
43 uni.removeStorageSync('userName') 45 const app = getApp()
44 }) 46
47 uni.removeStorageSync('token')
48 uni.removeStorageSync('userName')
49 uni.removeStorageSync('webUserName')
50
51 userStore.setUser(null)
52 app.globalData.isLogin = false
53 })
45 } 54 }
46 55
47 function getCodeImg() { 56 function getCodeImg() {
48 return request({ 57 return request({
49 url: '/captchaImage', 58 url: '/captchaImage',
50 method: 'get' 59 method: 'get'
51 }) 60 })
52 } 61 }
53 62
54 // 代退图形认证的获取手机验证码 63 // 代退图形认证的获取手机验证码
55 function getSmsCode(data) { 64 function getSmsCode(data) {
56 return request({ 65 return request({
57 // url: '/captchaSmsWithCaptchaImage', 66 // url: '/captchaSmsWithCaptchaImage',
58 url: '/captchaSmsWithCaptchaImageForMiniApp', 67 url: '/captchaSmsWithCaptchaImageForMiniApp',
59 method: 'post', 68 method: 'post',
60 params: data 69 params: data
61 }) 70 })
62 } 71 }
63 72
64 function loginByPhone(phonenumber, code) { 73 function loginByPhone(phonenumber, code) {
65 const data = { 74 const data = {
66 phonenumber, 75 phonenumber,
67 code 76 code
68 } 77 }
69 return request({ 78 return request({
70 url: '/userLoginByPhone', 79 url: '/userLoginByPhone',
71 method: 'post', 80 method: 'post',
72 params: data 81 params: data
73 }).then((res) => { 82 }).then((res) => {
74 uni.showToast({ 83 uni.showToast({
75 title: res.msg, 84 title: res.msg,
76 icon: 'none' 85 icon: 'none'
77 }) 86 })
78 uni.setStorageSync('token', 'Bearer ' + res.data.token) 87 uni.setStorageSync('token', 'Bearer ' + res.data.token)
79 }).then(getInfo) 88 }).then(getInfo)
80 } 89 }
81 90
82 // 获取用户详细信息 91 // 获取用户详细信息
83 function getInfo() { 92 function getInfo() {
84 return request({ 93 return request({
85 url: '/getInfo', 94 url: '/getInfo',
86 method: 'get' 95 method: 'get'
87 }).then(res => { 96 }).then(res => {
88 const app = getApp() 97 const userStore = useUserStore()
89 const user = res.data.user 98 const app = getApp()
90 // const personInfo = res.data.personInfo 99 const user = res.data.user
91 uni.setStorageSync('userName', user.userName) 100
92 // uni.setStorageSync('perId', personInfo.perId||-1) 101 uni.setStorageSync('userName', user.userName)
93 app.globalData.user = res.data.user 102 uni.removeStorageSync('webUserName')
94 app.globalData.deptType = user.dept.deptType 103 userStore.setUser(user)
95 app.globalData.genFlag = user.dept.genFlag 104
96 // user.dept.deptType = '3' 105 app.globalData.deptType = user.dept.deptType
97 switch (user.dept.deptType) { 106 app.globalData.genFlag = user.dept.genFlag
98 case '1': // 中跆协 107 app.globalData.changePassFlag = user.changePassFlag
99 app.globalData.userType = '1' 108 switch (user.dept.deptType) {
100 break 109 case '1': // 中跆协
101 case '2': // 省 110 app.globalData.userType = '1'
102 case '3': 111 break
103 app.globalData.userType = '2' 112 case '2': // 省
104 break 113 case '3':
105 case '6': // 道馆 114 app.globalData.userType = '2'
106 app.globalData.userType = '4' 115 break
107 break 116 case '6': // 道馆
108 default: // 市、区 117 app.globalData.userType = '4'
109 app.globalData.userType = '3' 118 break
110 break 119 default: // 市、区
111 } 120 app.globalData.userType = '3'
112 121 break
113 app.globalData.userInfo = user 122 }
114 }) 123 })
124 }
125
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)
141 })
115 } 142 }
116 143
117 // 团队会员用户注册接口 144 // 团队会员用户注册接口
118 function groupMemberRegister(data) { 145 function groupMemberRegister(data) {
119 return request({ 146 return request({
120 url: '/groupMemberRegister', 147 url: '/groupMemberRegister',
121 method: 'post', 148 method: 'post',
122 params: data 149 params: data
123 }) 150 })
124 } 151 }
125 // 获取道馆信息 152 // 获取道馆信息
126 function getMyOwnMemberInfo() { 153 function getMyOwnMemberInfo() {
127 return request({ 154 return request({
128 url: '/member/info/getMyOwnMemberInfo', 155 url: '/member/info/getMyOwnMemberInfo',
129 method: 'get' 156 method: 'get'
130 }).then(res => { 157 }).then(res => {
131 const app = getApp() 158 const app = getApp()
132 app.globalData.authenticationStatus = res.data.authenticationStatus 159 app.globalData.authenticationStatus = res.data.authenticationStatus
133 app.globalData.memberInfo = res.data.memberInfo 160 app.globalData.memberInfo = res.data.memberInfo
134 app.globalData.isExam = res.data?.memberInfo?.isPoints 161 app.globalData.isExam = res.data?.memberInfo?.isPoints
135 }) 162 })
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 })
136 } 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,
140 getSmsCode, 199 getSmsCode,
141 h5Login, 200 h5Login,
142 h5LoginAuto, 201 h5LoginAuto,
143 loginByPhone, 202 loginByPhone,
144 groupMemberRegister, 203 groupMemberRegister,
145 getMyOwnMemberInfo, 204 getMyOwnMemberInfo,
146 logout, 205 logout,
147 getInfo 206 getInfo,
148 } 207 getWebInfo,
208 wxLogin
209 }
...\ No newline at end of file ...\ No newline at end of file
......
1 <template> 1 <template>
2 <view> 2 <view>
3 <view class="wBox"> 3 <view class="wBox">
4 <view class="tt">基本信息</view> 4 <view class="tt">基本信息</view>
5 <view class="ddd"> 5 <view class="ddd">
6 <text class="lab">结算编号:</text>{{ form.flowCode }} 6 <text class="lab">结算编号:</text>{{ form.flowCode }}
7 </view> 7 </view>
8 <view class="ddd"> 8 <view class="ddd">
9 <text class="lab">{{ type=='1'?'考级名称':'考段名称' }}</text>{{form.mergeName}} 9 <text class="lab">{{ type=='1'?'考级名称':'考段名称' }}</text>{{form.mergeName}}
10 </view> 10 </view>
11 <view class="ddd"> 11 <view class="ddd">
12 <text class="lab">申请单位:</text>{{ form.memName }} 12 <text class="lab">申请单位:</text>{{ form.memName }}
13 </view> 13 </view>
14 <view class="ddd" v-if="form.mergeTime"> 14 <view class="ddd" v-if="form.mergeTime">
15 <text class="lab">申请日期:</text>{{form.mergeTime?.slice(0,10)}} 15 <text class="lab">申请日期:</text>{{form.mergeTime?.slice(0,10)}}
16 </view> 16 </view>
17 <view class="ddd"> 17 <view class="ddd">
18 <text class="lab">{{ type=='1'?'考级人数':'考段人数' }}</text>{{form.totalNum}} 18 <text class="lab">{{ type=='1'?'考级人数':'考段人数' }}</text>{{form.totalNum}}
19 </view> 19 </view>
20 <view class="ddd"> 20 <view class="ddd">
21 <text class="lab">总金额:</text>¥{{ (form.totalAmount*1).toFixed(2) }} 21 <text class="lab">总金额:</text>¥{{ (form.totalAmount*1).toFixed(2) }}
22 </view> 22 </view>
23 </view> 23 </view>
24 <view class="wBox"> 24 <view class="wBox">
25 <view class="tt"> 25 <view class="tt">
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 <view class="w100"> 30 style="background-color: #fffafa;">
31 <view class="text-primary">{{n.examCode}}</view> 31 <view class="w100">
32 <view class="name">{{n.name}}</view> 32 <view class="text-primary">{{n.examCode}}</view>
33 <!-- <view class="date">{{n.idcTypeStr}}{{n.idcCode}}</view> --> 33 <view class="name">{{n.name}}</view>
34 <view class="flexbox"> 34 <!-- <view class="date">{{n.idcTypeStr}}{{n.idcCode}}</view> -->
35 <view> 35 <view class="flexbox">
36 上报单位 36 <view>
37 <text>{{n.memberName}}</text> 37 上报单位
38 </view> 38 <text>{{n.memberName}}</text>
39 <view> 39 </view>
40 {{type=='1'?'考级考生数':'考段考生数'}} 40 <view>
41 <text> 41 {{type=='1'?'考级考生数':'考段考生数'}}
42 {{n.totalNum}} 42 <text>
43 </text> 43 {{n.totalNum}}
44 </view> 44 </text>
45 45 </view>
46 <view> 46
47 金额 47 <view>
48 <text class="text-danger">¥{{ (n.totalAmount*1).toFixed(2) }}</text> 48 金额
49 </view> 49 <text class="text-danger">¥{{ (n.totalAmount*1).toFixed(2) }}</text>
50 </view> 50 </view>
51 </view> 51 </view>
52 52 </view>
53 </view> 53
54 </view> 54 </view>
55 55 </view>
56 </view> 56
57 </view> 57 </view>
58 </template> 58 </view>
59 59 </template>
60 <script setup> 60
61 import * as api from '@/common/api.js' 61 <script setup>
62 import config from '@/config.js' 62 import * as api from '@/common/api.js'
63 import _ from 'underscore' 63 import config from '@/config.js'
64 import { 64 import _ from 'underscore'
65 onMounted, 65 import {
66 ref 66 onMounted,
67 } from 'vue' 67 ref
68 import { 68 } from 'vue'
69 onLoad 69 import {
70 } from '@dcloudio/uni-app' 70 onLoad
71 const app = getApp(); 71 } from '@dcloudio/uni-app'
72 const queryParams = ref({ 72 const app = getApp();
73 recordId: '' 73 const queryParams = ref({
74 }) 74 recordId: ''
75 75 })
76 const form = ref({}) 76
77 const list = ref([]) 77 const form = ref({})
78 const infoList = ref([]) 78 const list = ref([])
79 const deptType = ref() 79 const infoList = ref([])
80 const type = ref(null) 80 const deptType = ref()
81 let rangeId = '' 81 const type = ref(null)
82 onLoad((option) => { 82 let rangeId = ''
83 if ('form' in option) { 83 onLoad((option) => {
84 form.value = JSON.parse(decodeURIComponent(option.form)) 84 if ('form' in option) {
85 console.log(111,form.value) 85 form.value = JSON.parse(decodeURIComponent(option.form))
86 } 86 }
87 type.value = option.type 87 type.value = option.type
88 // console.log(222,form.value) 88 // console.log(222,form.value)
89 if (app.globalData.isLogin) { 89 if (app.globalData.isLogin) {
90 init() 90 init()
91 } else { 91 } else {
92 app.firstLoadCallback = () => { 92 app.firstLoadCallback = () => {
93 init() 93 init()
94 }; 94 };
95 } 95 }
96 96
97 }) 97 })
98 98
99 function init() { 99 function init() {
100 deptType.value = app.globalData.deptType 100 deptType.value = app.globalData.deptType
101 getForm() 101 getForm()
102 } 102 }
103 103
104 function getForm() { 104 function getForm() {
105 uni.showLoading({ 105 uni.showLoading({
106 title: '加载中' 106 title: '加载中'
107 }) 107 })
108 api.getMergePaymentInfo(form.value.recordId).then(res => { 108 api.getMergePaymentInfo(form.value.recordId).then(res => {
109 _.each(res.rows, (r) => { 109 _.each(res.rows, (r) => {
110 const item = JSON.parse(r.content) 110 const item = JSON.parse(r.content)
111 item.recordId = r.recordId 111 item.recordId = r.recordId
112 infoList.value.push(item) 112 infoList.value.push(item)
113 }) 113 })
114 console.log(infoList.value) 114 console.log(infoList.value)
115 form.value.totalNum = Math.floor(_.sumBy(infoList.value, (o) => parseFloat(o.totalNum || 0))) 115 form.value.totalNum = Math.floor(_.sumBy(infoList.value, (o) => parseFloat(o.totalNum || 0)))
116 form.value.totalAmount = Math.floor(_.sumBy(infoList.value, (o) => parseFloat(o.totalAmount || 0))) 116 form.value.totalAmount = Math.floor(_.sumBy(infoList.value, (o) => parseFloat(o.totalAmount || 0)))
117 117
118 uni.hideLoading() 118 uni.hideLoading()
119 119
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">
133 .wBox { 133 .wBox {
134 width: 700rpx; 134 width: 700rpx;
135 padding: 30rpx; 135 padding: 30rpx;
136 margin: 20rpx auto; 136 margin: 20rpx auto;
137 background: #FFFFFF; 137 background: #FFFFFF;
138 box-shadow: 0rpx 12rpx 116rpx 0rpx rgba(196, 203, 214, 0.1); 138 box-shadow: 0rpx 12rpx 116rpx 0rpx rgba(196, 203, 214, 0.1);
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 font-size: 30rpx; 143 margin: 0 0 30rpx;
144 } 144 font-size: 30rpx;
145 145 }
146 .ddd{font-size: 28rpx;color: #333; margin: 0 0 10rpx; 146
147 .lab{color: #999;display: inline-block;text-align: justify; 147 .ddd {
148 text{word-break: break-all;} 148 font-size: 28rpx;
149 } 149 color: #333;
150 } 150 margin: 0 0 10rpx;
151 } 151
152 152 .lab {
153 color: #999;
154 display: inline-block;
155 text-align: justify;
156
157 text {
158 word-break: break-all;
159 }
160 }
161 }
162 }
153 </style> 163 </style>
...\ No newline at end of file ...\ No newline at end of file
......
This diff could not be displayed because it is too large.
1 import App from './App' 1 import App from './App'
2 // #ifndef VUE3 2 import store from './store'
3 import Vue from 'vue' 3
4 Vue.config.productionTip = false 4 // #ifndef VUE3
5 App.mpType = 'app' 5 import Vue from 'vue'
6 const app = new Vue({ 6 Vue.config.productionTip = false
7 ...App 7 App.mpType = 'app'
8 }) 8 const app = new Vue({
9 app.$mount() 9 ...App
10 // #endif 10 })
11 11 app.use(store)
12 // #ifdef VUE3 12 app.$mount()
13 import { 13 // #endif
14 createSSRApp 14
15 } from 'vue' 15 // #ifdef VUE3
16 export function createApp() { 16 import {
17 const app = createSSRApp(App) 17 createSSRApp
18 return { 18 } from 'vue'
19 app 19 export function createApp() {
20 } 20 const app = createSSRApp(App)
21 } 21 app.use(store)
22 // #endif 22 return {
23 app
24 }
25 }
26 // #endif
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -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 }
......
1 <template> 1 <template>
2 <view> 2 <view>
3 <view class="wBox"> 3 <view class="wBox">
4 <view class="tt"> 4 <view class="tt">
5 审核信息 5 审核信息
6 </view> 6 </view>
7 <view> 7 <view>
8 <view class="stepItem" v-for="(n,index) in recordList" :key="index"> 8 <view class="stepItem" v-for="(n,index) in recordList" :key="index">
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> 12 <text v-if="n.auditResult==1" class="text-success">审核通过</text>
13 <text v-if="n.auditResult==1" class="text-success">审核通过</text> 13 <text v-if="n.auditResult==0" class="text-danger"> 审核拒绝</text>
14 <text v-if="n.auditResult==2" class="text-danger"> 审核拒绝</text> 14 </view>
15 <text v-if="n.auditResult==3" class="text-warning"> 已撤回</text> 15 <!-- <view class="name">{{index+1}}</view> -->
16 </view> 16 <view class="deptName">{{n.auditDeptName}}</view>
17 <!-- <view class="name">{{index+1}}</view> --> 17 <view v-if="n.auditResult==0">
18 <view class="deptName">{{n.auditDeptName}}</view> 18 备注:{{n.auditMsg||'/' }}
19 <view v-if="n.auditStatus==2"> 19 </view>
20 备注:{{n.auditMsg||'/' }} 20 </view>
21 </view> 21 </view>
22 </view> 22 </view>
23 </view> 23 </view>
24 </view> 24
25 </view> 25 </view>
26 26 </template>
27 </view> 27
28 </template> 28 <script setup>
29 29 import * as api from '@/common/api.js'
30 <script setup> 30 import config from '@/config.js'
31 import * as api from '@/common/api.js' 31 import _ from 'underscore'
32 import config from '@/config.js' 32 import to from 'await-to-js'
33 import _ from 'underscore' 33 import {
34 import { 34 onMounted,
35 onMounted, 35 ref
36 ref 36 } from 'vue'
37 } from 'vue' 37 import {
38 import { 38 onLoad,
39 onLoad, 39 onShow
40 onShow 40 } from '@dcloudio/uni-app'
41 } from '@dcloudio/uni-app' 41 const app = getApp();
42 const app = getApp(); 42 const userType = ref('')
43 const userType = ref('') 43 const recordList = ref([])
44 const recordList = ref([]) 44 onLoad(async (option) => {
45 onLoad((option) => { 45 await getMyRecentFN()
46 getMyCertStageFN() 46 })
47 }) 47
48 48 async function getMyRecentFN() {
49 function getMyCertStageFN() { 49 const [err, res] = await to(api.getMyRecent())
50 api.getMyCertStage().then(res => { 50 if (!err && res.data && res.data.auditLogs) {
51 recordList.value = res.data 51 recordList.value = JSON.parse(res.data.auditLogs)
52 console.log(res) 52 }
53 }) 53 }
54 54 </script>
55 } 55
56 </script> 56 <style scoped lang="scss">
57 57 .wBox {
58 <style scoped lang="scss"> 58 width: 700rpx;
59 .wBox { 59 padding: 30rpx;
60 width: 700rpx; 60 margin: 20rpx auto;
61 padding: 30rpx; 61 background: #FFFFFF;
62 margin: 20rpx auto; 62 box-shadow: 0rpx 12rpx 116rpx 0rpx rgba(196, 203, 214, 0.1);
63 background: #FFFFFF; 63 border-radius: 15rpx;
64 box-shadow: 0rpx 12rpx 116rpx 0rpx rgba(196, 203, 214, 0.1); 64
65 border-radius: 15rpx; 65 .tt {
66 66 color: #0A1629;
67 .tt { 67 margin: 0 0 30rpx;
68 color: #0A1629; 68 font-size: 30rpx;
69 margin: 0 0 30rpx; 69 }
70 font-size: 30rpx; 70
71 } 71 .ddd {
72 72 font-size: 28rpx;
73 .ddd { 73 color: #333;
74 font-size: 28rpx; 74 margin: 0 0 10rpx;
75 color: #333; 75
76 margin: 0 0 10rpx; 76 .lab {
77 77 color: #999;
78 .lab { 78 display: inline-block;
79 color: #999; 79 text-align: justify;
80 display: inline-block; 80 }
81 text-align: justify; 81 }
82 } 82 }
83 }
84 }
85 </style> 83 </style>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -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.
1 <template> 1 <template>
2 <view class="mainbox"> 2 <view class="mainbox">
3 <view class="title">{{form.name}}</view> 3 <view class="title">{{form.name}}</view>
4 <view class="infos"> 4 <view class="infos">
5 <text>{{ form.source }}</text> 5 <text>{{ form.source }}</text>
6 <text>{{ form.belongTime }}</text> 6 <text>{{ form.belongTime }}</text>
7 </view> 7 </view>
8 <view class="content"> 8 <view class="content">
9 9
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 </view> 14 :src="config.baseUrl_api + f.url"></video>
15 <view v-if="attachmentFile.length>0" class="mt20"> 15 </view>
16 <!-- 附件--> 16 <view v-if="attachmentFile.length>0" class="mt20">
17 <view class="fwb mt20">附件下载:</view> 17 <!-- 附件-->
18 <view v-for="(f,index) in attachmentFile" :key="index" class="text-primary underLine" 18 <view class="fwb mt20">附件下载:</view>
19 @click="downLoad(f.url)"> 19 <view v-for="(f,index) in attachmentFile" :key="index" class="text-primary underLine"
20 {{ index + 1 }}{{ f.name }} 20 @click="downLoad(f.url)">
21 </view> 21 {{ index + 1 }}{{ f.name }}
22 22 </view>
23 </view> 23
24 <view> 24 </view>
25 <text v-if=" form.author">发布人:{{ form.author }}</text> 25 <view>
26 </view> 26 <text v-if=" form.author">发布人:{{ form.author }}</text>
27 </view> 27 </view>
28 </view> 28 </view>
29 </template> 29 </view>
30 30 </template>
31 <script setup> 31
32 import { 32 <script setup>
33 ref 33 import {
34 } from 'vue' 34 ref
35 import * as api from '@/common/api.js'; 35 } from 'vue'
36 import { 36 import * as api from '@/common/api.js';
37 onLoad 37 import {
38 } from '@dcloudio/uni-app'; 38 onLoad
39 import _ from 'underscore' 39 } from '@dcloudio/uni-app';
40 import config from '@/config.js' 40 import _ from 'underscore'
41 const form = ref({}) 41 import config from '@/config.js'
42 const attachmentFile = ref([]) 42 const form = ref({})
43 const attachmentMp4 = ref([]) 43 const attachmentFile = ref([])
44 44 const attachmentMp4 = ref([])
45 onLoad((option) => { 45
46 getData(option.noteId) 46 onLoad((option) => {
47 }) 47 getData(option.noteId)
48 48 })
49 function getData(noteId) { 49
50 api.getNewsById(noteId).then(res => { 50 function getData(noteId) {
51 form.value = res.data 51 api.getNewsById(noteId).then(res => {
52 var html = res.data.content.replace(/<img([\s\w"-=\/\.:;]+)((?:(height="[^"]+")))/ig, '<img$1') 52 form.value = res.data
53 .replace(/<img([\s\w"-=\/\.:;]+)((?:(width="[^"]+")))/ig, '<img$1') 53 var html = res.data.content.replace(/<img([\s\w"-=\/\.:;]+)((?:(height="[^"]+")))/ig, '<img$1')
54 .replace(/<img([\s\w"-=\/\.:;]+)((?:(style="[^"]+")))/ig, '<img$1') 54 .replace(/<img([\s\w"-=\/\.:;]+)((?:(width="[^"]+")))/ig, '<img$1')
55 .replace(/<img([\s\w"-=\/\.:;]+)((?:(alt="[^"]+")))/ig, '<img$1') 55 .replace(/<img([\s\w"-=\/\.:;]+)((?:(style="[^"]+")))/ig, '<img$1')
56 .replace(/<img([\s\w"-=\/\.:;]+)/ig, '<img style="width: 100%;" $1'); 56 .replace(/<img([\s\w"-=\/\.:;]+)((?:(alt="[^"]+")))/ig, '<img$1')
57 57 .replace(/<img([\s\w"-=\/\.:;]+)/ig, '<img style="width: 100%;" $1');
58 58
59 if (form.value.attacthJson) { 59
60 const attachment = JSON.parse(form.value.attacthJson) 60 if (form.value.attacthJson) {
61 attachmentFile.value = _.filter(attachment, (a) => a.url.toLowerCase().indexOf('.mp4') === -1) || [] 61 const attachment = JSON.parse(form.value.attacthJson)
62 attachmentMp4.value = _.filter(attachment, (a) => a.url.toLowerCase().indexOf('.mp4') !== -1) || [] 62 attachmentFile.value = _.filter(attachment, (a) => a.url.toLowerCase().indexOf('.mp4') === -1) ||
63 } 63 []
64 }) 64 attachmentMp4.value = _.filter(attachment, (a) => a.url.toLowerCase().indexOf('.mp4') !== -1) || []
65 } 65 }
66 function downLoad(url){ 66 })
67 console.log(url) 67 }
68 var str = config.baseUrl_api + url 68
69 if (url.indexOf('png') > -1 ||url.indexOf('jpg') > -1 ||url.indexOf('jpeg') > -1) { 69 function downLoad(url) {
70 uni.previewImage({ 70 console.log(url)
71 urls: [str], 71 var str = config.baseUrl_api + url
72 success: function(res) { 72 if (url.indexOf('png') > -1 || url.indexOf('jpg') > -1 || url.indexOf('jpeg') > -1) {
73 console.log('success', res) 73 uni.previewImage({
74 }, 74 urls: [str],
75 fail: function(res) { 75 success: function(res) {
76 console.log('fail', res) 76 console.log('success', res)
77 }, 77 },
78 complete: function(res) { 78 fail: function(res) {
79 console.log('complete', res) 79 console.log('fail', res)
80 } 80 },
81 }) 81 complete: function(res) {
82 } else { 82 console.log('complete', res)
83 goWebView(str) 83 }
84 } 84 })
85 } 85 } else {
86 function goWebView(url) { 86 goWebView(str)
87 url = url.replace("http://", "https://") 87 }
88 uni.showLoading({ 88 }
89 title: '下载中' 89
90 }); 90 function goWebView(url) {
91 uni.downloadFile({ 91 url = url.replace("http://", "https://")
92 url: url, 92 uni.showLoading({
93 success: function(res) { 93 title: '下载中'
94 console.log('111') 94 });
95 uni.hideLoading(); 95 uni.downloadFile({
96 var filePath = res.tempFilePath; 96 url: url,
97 uni.showLoading({ 97 success: function(res) {
98 title: '正在打开' 98 uni.hideLoading();
99 }); 99 var filePath = res.tempFilePath;
100 uni.openDocument({ 100 uni.showLoading({
101 filePath: filePath, 101 title: '正在打开'
102 showMenu: true, 102 });
103 success: function(res) { 103 uni.openDocument({
104 console.log('222') 104 filePath: filePath,
105 uni.hideLoading(); 105 showMenu: true,
106 }, 106 success: function(res) {
107 fail: function(err) { 107 uni.hideLoading();
108 console.log(err.errMsg) 108 },
109 uni.hideLoading(); 109 fail: function(err) {
110 let msg 110 console.log(err.errMsg)
111 if(err.errMsg.indexOf('not supported')>-1){ 111 uni.hideLoading();
112 msg = '不支持该文件类型' 112 let msg
113 } else { 113 if (err.errMsg.indexOf('not supported') > -1) {
114 msg = err.errMsg 114 msg = '不支持该文件类型'
115 } 115 } else {
116 uni.showToast({ 116 msg = err.errMsg
117 title: msg, 117 }
118 icon: 'none', 118 uni.showToast({
119 duration: 2000 119 title: msg,
120 }); 120 icon: 'none',
121 } 121 duration: 2000
122 }); 122 });
123 }, 123 }
124 fail: function(error) { 124 });
125 uni.hideLoading(); 125 },
126 uni.showToast({ 126 fail: function(error) {
127 title: `下载失败`, 127 uni.hideLoading();
128 icon: 'none', 128 uni.showToast({
129 duration: 2000 129 title: `下载失败`,
130 }); 130 icon: 'none',
131 } 131 duration: 2000
132 }); 132 });
133 } 133 }
134 </script> 134 });
135 135 }
136 <style scoped lang="scss"> 136 </script>
137 .mainbox { 137
138 box-sizing: border-box; 138 <style scoped lang="scss">
139 padding: 50rpx 25rpx 160rpx; 139 .mainbox {
140 background: #fff; 140 box-sizing: border-box;
141 min-height: 100vh; 141 padding: 50rpx 25rpx 160rpx;
142 } 142 background: #fff;
143 .title { 143 min-height: 100vh;
144 font-size: 36rpx; 144 }
145 font-weight: 500; 145
146 color: #29343C; 146 .title {
147 margin-bottom: 34rpx; 147 font-size: 36rpx;
148 } 148 font-weight: 500;
149 149 color: #29343C;
150 .infos { 150 margin-bottom: 34rpx;
151 border-bottom: 1px solid #DCDCDC; 151 }
152 padding-bottom: 40rpx; 152
153 overflow: hidden; 153 .infos {
154 } 154 border-bottom: 1px solid #DCDCDC;
155 155 padding-bottom: 40rpx;
156 .infos>text { 156 overflow: hidden;
157 margin-right: 18rpx; 157 }
158 color: #7B7F83; 158
159 font-size: 22rpx; 159 .infos>text {
160 } 160 margin-right: 18rpx;
161 .content { 161 color: #7B7F83;
162 line-height: 1.6; 162 font-size: 22rpx;
163 color: #4C5359; 163 }
164 font-size: 30rpx; 164
165 padding-top: 40rpx; 165 .content {
166 width: 100%; 166 line-height: 1.6;
167 word-wrap: break-word !important; 167 color: #4C5359;
168 white-space: normal !important; 168 font-size: 30rpx;
169 } 169 padding-top: 40rpx;
170 170 width: 100%;
171 .content rich-text { 171 word-wrap: break-word !important;
172 word-wrap: break-word !important; 172 white-space: normal !important;
173 white-space: normal !important; 173 }
174 } 174
175 175 .content rich-text {
176 .content span, 176 word-wrap: break-word !important;
177 .content p { 177 white-space: normal !important;
178 word-wrap: break-word !important; 178 }
179 white-space: normal !important; 179
180 } 180 .content span,
181 .content rich-text img{max-width: 100%;} 181 .content p {
182 182 word-wrap: break-word !important;
183 image { 183 white-space: normal !important;
184 max-width: 100%; 184 }
185 } 185
186 186 .content rich-text img {
187 audio { 187 max-width: 100%;
188 width: 100%; 188 }
189 } 189
190 190 image {
191 video { 191 max-width: 100%;
192 width: 100%; 192 }
193 } 193
194 audio {
195 width: 100%;
196 }
197
198 video {
199 width: 100%;
200 }
194 </style> 201 </style>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -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 }
......
1 <template> 1 <template>
2 <view class="pay-order-container"> 2 <view class="pay-order-container">
3 3
4 4
5 <view class="order-info"> 5 <view class="order-info">
6 6
7 <view class="info-item total-price"> 7 <view class="info-item total-price">
8 <text class="label">支付总费用:</text> 8 <text class="label">支付总费用:</text>
9 <text class="value red">{{ price ?? 0 }}</text> 9 <text class="value red">{{ price ?? 0 }}</text>
10 </view> 10 </view>
11 </view> 11 </view>
12 12
13 <view class="pay-type-section"> 13 <view class="pay-type-section">
14 <text class="section-title">选择支付方式</text> 14 <text class="section-title">选择支付方式</text>
15 <radio-group :value="payType" @change="handlePayTypeChange"> 15 <radio-group :value="payType" @change="handlePayTypeChange">
16 <label class="radio-item"> 16 <label class="radio-item">
17 <radio value="0" color="#E60012" :checked="payType === '0'" /> 17 <radio value="0" color="#E60012" :checked="payType === '0'" />
18 <view class="pay-method"> 18 <view class="pay-method">
19 <image class="icon" src="/static/min.png" mode="widthFix"></image> 19 <image class="icon" src="/static/min.png" mode="widthFix"></image>
20 <text class="pay-name">民生付</text> 20 <text class="pay-name">民生付</text>
21 </view> 21 </view>
22 </label> 22 </label>
23 </radio-group> 23 </radio-group>
24 </view> 24 </view>
25 25
26 <!-- 底部支付按钮 --> 26 <!-- 底部支付按钮 -->
27 <view class="fixed-bottom"> 27 <view class="fixed-bottom">
28 <button class="pay-btn red-bg" :loading="payLoading" @click="handlePay">立即支付</button> 28 <button class="pay-btn red-bg" :loading="payLoading" @click="handlePay">立即支付</button>
29 </view> 29 </view>
30 </view> 30 </view>
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 console.log('订单ID:', options.price) 46 const payLoading = ref(false) // 支付按钮加载状态
47 if (options.price) { 47
48 price.value = options.price 48 // 页面加载接收参数
49 } 49 onLoad(async (options) => {
50 }) 50 console.log('订单ID:', options.price)
51 51 if (options.price) {
52 52 price.value = options.price
53 // 支付方式切换 53 }
54 function handlePayTypeChange(e) { 54 })
55 payType.value = e.detail.value 55
56 } 56
57 57 // 支付方式切换
58 // 立即支付核心逻辑 58 function handlePayTypeChange(e) {
59 async function handlePay() { 59 payType.value = e.detail.value
60 60 }
61 61
62 try { 62 // 立即支付核心逻辑
63 payLoading.value = true 63 async function handlePay() {
64 const res = await api.goPay() 64
65 65
66 if (res.data?.orderId) { 66 try {
67 api.pcallBack2(res.data.orderId) 67 payLoading.value = true
68 uni.navigateTo({ 68 const res = await api.goPay()
69 url: `/personal/sucPay` 69
70 }) 70 if (res.data?.orderId) {
71 } 71 api.pcallBack2(res.data.orderId)
72 72 uni.redirectTo({
73 // 跳转到支付成功页 73 url: `/personal/sucPay`
74 74 })
75 } catch (err) { 75 }
76 const errMsg = err?.data?.msg || err?.message || '支付失败,请稍后重试' 76
77 uni.showToast({ title: errMsg, icon: 'none' }) 77 // 跳转到支付成功页
78 } finally { 78
79 payLoading.value = false 79 } catch (err) {
80 } 80 const errMsg = err?.data?.msg || err?.message || '支付失败,请稍后重试'
81 } 81 uni.showToast({
82 </script> 82 title: errMsg,
83 83 icon: 'none'
84 <style scoped lang="scss"> 84 })
85 .pay-order-container { 85 } finally {
86 padding: 30rpx; 86 payLoading.value = false
87 background-color: #fff; 87 }
88 min-height: 100vh; 88 }
89 box-sizing: border-box; 89 </script>
90 } 90
91 .icon{ 91 <style scoped lang="scss">
92 width:30px; 92 .pay-order-container {
93 } 93 padding: 30rpx;
94 // 页面头部 94 background-color: #fff;
95 .page-header { 95 min-height: 100vh;
96 text-align: center; 96 box-sizing: border-box;
97 padding: 20rpx 0; 97 }
98 border-bottom: 1px solid #eee; 98
99 margin-bottom: 40rpx; 99 .icon {
100 100 width: 30px;
101 .title { 101 }
102 font-size: 36rpx; 102
103 font-weight: 600; 103 // 页面头部
104 color: #333; 104 .page-header {
105 } 105 text-align: center;
106 } 106 padding: 20rpx 0;
107 107 border-bottom: 1px solid #eee;
108 // 订单信息区域 108 margin-bottom: 40rpx;
109 .order-info { 109
110 margin-bottom: 60rpx; 110 .title {
111 111 font-size: 36rpx;
112 .info-item { 112 font-weight: 600;
113 display: flex; 113 color: #333;
114 justify-content: space-between; 114 }
115 align-items: center; 115 }
116 padding: 25rpx 0; 116
117 border-bottom: 1px solid #f5f5f5; 117 // 订单信息区域
118 font-size: 32rpx; 118 .order-info {
119 119 margin-bottom: 60rpx;
120 .label { 120
121 color: #666; 121 .info-item {
122 } 122 display: flex;
123 123 justify-content: space-between;
124 .value { 124 align-items: center;
125 font-weight: 600; 125 padding: 25rpx 0;
126 font-size: 34rpx; 126 border-bottom: 1px solid #f5f5f5;
127 } 127 font-size: 32rpx;
128 128
129 .red { 129 .label {
130 color: #E60012; 130 color: #666;
131 } 131 }
132 } 132
133 133 .value {
134 .total-price { 134 font-weight: 600;
135 border-bottom: none; 135 font-size: 34rpx;
136 margin-top: 10rpx; 136 }
137 137
138 .label { 138 .red {
139 font-size: 34rpx; 139 color: #E60012;
140 color: #333; 140 }
141 } 141 }
142 142
143 .value { 143 .total-price {
144 font-size: 38rpx; 144 border-bottom: none;
145 } 145 margin-top: 10rpx;
146 } 146
147 } 147 .label {
148 148 font-size: 34rpx;
149 // 支付方式区域 149 color: #333;
150 .pay-type-section { 150 }
151 margin-bottom: 80rpx; 151
152 152 .value {
153 .section-title { 153 font-size: 38rpx;
154 font-size: 32rpx; 154 }
155 color: #333; 155 }
156 margin-bottom: 20rpx; 156 }
157 display: block; 157
158 } 158 // 支付方式区域
159 159 .pay-type-section {
160 .radio-item { 160 margin-bottom: 80rpx;
161 display: flex; 161
162 align-items: center; 162 .section-title {
163 font-size: 32rpx; 163 font-size: 32rpx;
164 padding: 10rpx 0; 164 color: #333;
165 165 margin-bottom: 20rpx;
166 .pay-method { 166 display: block;
167 display: flex; 167 }
168 align-items: center; 168
169 margin-left: 10rpx; 169 .radio-item {
170 170 display: flex;
171 .pay-name { 171 align-items: center;
172 font-size: 32rpx; 172 font-size: 32rpx;
173 margin-left: 20rpx; 173 padding: 10rpx 0;
174 color: #333; 174
175 } 175 .pay-method {
176 } 176 display: flex;
177 } 177 align-items: center;
178 } 178 margin-left: 10rpx;
179 179
180 // 底部支付按钮 180 .pay-name {
181 .fixed-bottom { 181 font-size: 32rpx;
182 position: fixed; 182 margin-left: 20rpx;
183 bottom: 0; 183 color: #333;
184 left: 0; 184 }
185 right: 0; 185 }
186 padding: 20rpx 30rpx 30rpx; 186 }
187 background-color: #fff; 187 }
188 border-top: 1px solid #eee; 188
189 189 // 底部支付按钮
190 .pay-btn { 190 .fixed-bottom {
191 width: 100%; 191 position: fixed;
192 height: 88rpx; 192 bottom: 0;
193 line-height: 88rpx; 193 left: 0;
194 border-radius: 44rpx; 194 right: 0;
195 font-size: 34rpx; 195 padding: 20rpx 30rpx 30rpx;
196 font-weight: 600; 196 background-color: #fff;
197 } 197 border-top: 1px solid #eee;
198 198
199 .red-bg { 199 .pay-btn {
200 background-color: #E60012; 200 width: 100%;
201 color: #fff; 201 height: 88rpx;
202 } 202 line-height: 88rpx;
203 } 203 border-radius: 44rpx;
204 font-size: 34rpx;
205 font-weight: 600;
206 }
207
208 .red-bg {
209 background-color: #E60012;
210 color: #fff;
211 }
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}}_欢迎您申请成为中国跆拳道协会(以下简称中国跆协)会员,请确保本次申请是经过您本人或监护人授权同意后的自愿行为,请您务必仔细阅读本入会须知。
...@@ -102,7 +104,7 @@ ...@@ -102,7 +104,7 @@
102 </view> 104 </view>
103 </uni-popup> 105 </uni-popup>
104 106
105 <uni-popup ref="infoConfirm" type="center" :disable-scroll="true" :mask-click="false"> 107 <uni-popup ref="infoConfirm" type="center" :disable-scroll="true" :mask-click="false">
106 <view class="tt">确认信息</view> 108 <view class="tt">确认信息</view>
107 <view class="popBody"> 109 <view class="popBody">
108 <view> 110 <view>
...@@ -125,7 +127,7 @@ ...@@ -125,7 +127,7 @@
125 onLoad 127 onLoad
126 } from '@dcloudio/uni-app' 128 } from '@dcloudio/uni-app'
127 import config from '@/config.js' 129 import config from '@/config.js'
128 import * as aes2 from '@/common/utils.js' 130 import * as aes2 from '@/common/utils.js'
129 const current = ref(0) 131 const current = ref(0)
130 const popup = ref(null) 132 const popup = ref(null)
131 const infoConfirm = ref(null) 133 const infoConfirm = ref(null)
...@@ -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 }
...@@ -414,19 +416,19 @@ ...@@ -414,19 +416,19 @@
414 }) 416 })
415 } 417 }
416 } 418 }
417 // if (baseFormData.value.idcType == 1 || baseFormData.value.idcType == 3) { 419 // if (baseFormData.value.idcType == 1 || baseFormData.value.idcType == 3) {
418 // //转换为大写并判断位数12 420 // //转换为大写并判断位数12
419 // baseFormData.value.idcCode = baseFormData.value.idcCode.toUpperCase() 421 // baseFormData.value.idcCode = baseFormData.value.idcCode.toUpperCase()
420 // // var regex = /^[a-zA-Z]/ 422 // // var regex = /^[a-zA-Z]/
421 // if (baseFormData.value.idcCode.length > 12) { 423 // if (baseFormData.value.idcCode.length > 12) {
422 // uni.showToast({ 424 // uni.showToast({
423 // icon: 'none', 425 // icon: 'none',
424 // title: '请输入正确的证件号', 426 // title: '请输入正确的证件号',
425 // duration: 2000 427 // duration: 2000
426 // }) 428 // })
427 // return 429 // return
428 // } 430 // }
429 // } 431 // }
430 } 432 }
431 433
432 434
...@@ -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;
...@@ -561,16 +563,16 @@ ...@@ -561,16 +563,16 @@
561 padding-left: 0 !important; 563 padding-left: 0 !important;
562 width: auto !important; 564 width: auto !important;
563 } 565 }
564 566
565 /* 内容右对齐 */ 567 /* 内容右对齐 */
566 .uni-forms-item .uni-forms-item__content { 568 .uni-forms-item .uni-forms-item__content {
567 display: flex !important; 569 display: flex !important;
568 align-items: center !important; 570 align-items: center !important;
569 justify-content: flex-end !important; 571 justify-content: flex-end !important;
570 text-align: right !important; 572 text-align: right !important;
571 flex-wrap: nowrap !important; 573 flex-wrap: nowrap !important;
572 } 574 }
573 575
574 /* 输入框内容右对齐 */ 576 /* 输入框内容右对齐 */
575 .uni-forms-item .uni-easyinput .uni-easyinput__content-input, 577 .uni-forms-item .uni-easyinput .uni-easyinput__content-input,
576 .uni-forms-item .uni-easyinput input, 578 .uni-forms-item .uni-easyinput input,
...@@ -579,28 +581,29 @@ ...@@ -579,28 +581,29 @@
579 .uni-forms-item .uni-data-picker .uni-data-picker__input-box { 581 .uni-forms-item .uni-data-picker .uni-data-picker__input-box {
580 text-align: right !important; 582 text-align: right !important;
581 } 583 }
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>
593 :deep(.uni-popup__mask) { 594 :deep(.uni-popup__mask) {
594 overflow: hidden !important; 595 overflow: hidden !important;
595 position: fixed !important; 596 position: fixed !important;
596 top: 0; 597 top: 0;
597 left: 0; 598 left: 0;
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 }
...@@ -620,7 +623,7 @@ ...@@ -620,7 +623,7 @@
620 font-size: 28rpx; 623 font-size: 28rpx;
621 line-height: 1.5; 624 line-height: 1.5;
622 height: 70vh; 625 height: 70vh;
623 overflow-y: auto; 626 overflow-y: auto;
624 font-family: 华文仿宋; 627 font-family: 华文仿宋;
625 height: 80vh; 628 height: 80vh;
626 overflow: auto; 629 overflow: auto;
...@@ -636,7 +639,7 @@ ...@@ -636,7 +639,7 @@
636 box-sizing: border-box; 639 box-sizing: border-box;
637 display: flex; 640 display: flex;
638 font-size: 30rpx; 641 font-size: 30rpx;
639 642
640 643
641 text { 644 text {
642 color: #014A9F; 645 color: #014A9F;
...@@ -676,13 +679,14 @@ ...@@ -676,13 +679,14 @@
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;
682 } 686 }
683 687
684 /* 让地区选择器的文本左对齐 */ 688 /* 让地区选择器的文本左对齐 */
685 :deep(.fixUniFormItemStyle .uni-data-picker__text) { 689 :deep(.fixUniFormItemStyle .uni-data-picker__text) {
686 text-align: left !important; 690 text-align: left !important;
687 } 691 }
688 </style> 692 </style>
...\ No newline at end of file ...\ No newline at end of file
......
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!