f527b6cd by 张猛

支付

1 parent 7caf72e2
...@@ -250,7 +250,8 @@ export function insertSinglePay(data) { ...@@ -250,7 +250,8 @@ export function insertSinglePay(data) {
250 return request({ 250 return request({
251 url: '/person/paymentNew/insertSinglePay', 251 url: '/person/paymentNew/insertSinglePay',
252 method: 'post', 252 method: 'post',
253 params: data 253 params: data,
254 showLoading: false
254 }) 255 })
255 } 256 }
256 257
...@@ -1541,6 +1542,7 @@ export function certifiedNew(renewYear) { ...@@ -1541,6 +1542,7 @@ export function certifiedNew(renewYear) {
1541 return request({ 1542 return request({
1542 url: `/system/certifiedNew/commit?renewYear=${renewYear}`, 1543 url: `/system/certifiedNew/commit?renewYear=${renewYear}`,
1543 method: 'post', 1544 method: 'post',
1545 showLoading: false
1544 }) 1546 })
1545 } 1547 }
1546 1548
...@@ -1629,7 +1631,8 @@ export function getMyStatus() { ...@@ -1629,7 +1631,8 @@ export function getMyStatus() {
1629 export function goPay(id, payType) { 1631 export function goPay(id, payType) {
1630 return request({ 1632 return request({
1631 url: `/person/paymentRangeNew/pay/${id}/${payType}`, 1633 url: `/person/paymentRangeNew/pay/${id}/${payType}`,
1632 method: 'post' 1634 method: 'post',
1635 showLoading: false
1633 }) 1636 })
1634 } 1637 }
1635 1638
...@@ -1839,7 +1842,8 @@ export function commitJiExam(params) { ...@@ -1839,7 +1842,8 @@ export function commitJiExam(params) {
1839 return request({ 1842 return request({
1840 url: `/exam/info/commitJi/${params.id}/${params.addresId}/${params.payType}`, 1843 url: `/exam/info/commitJi/${params.id}/${params.addresId}/${params.payType}`,
1841 method: 'post', 1844 method: 'post',
1842 params 1845 params,
1846 showLoading: false
1843 }) 1847 })
1844 } 1848 }
1845 1849
......
...@@ -31,6 +31,7 @@ async function minShengPay(orderId, encryptedData) { ...@@ -31,6 +31,7 @@ async function minShengPay(orderId, encryptedData) {
31 title: '生成支付...', 31 title: '生成支付...',
32 mask: true 32 mask: true
33 }) 33 })
34 console.log(1111)
34 35
35 // 参数校验 36 // 参数校验
36 if (!orderId) { 37 if (!orderId) {
...@@ -219,7 +220,6 @@ function invokeWechatPayment(payParams, orderId) { ...@@ -219,7 +220,6 @@ function invokeWechatPayment(payParams, orderId) {
219 }) 220 })
220 }, 221 },
221 fail: async (err) => { 222 fail: async (err) => {
222 debugger
223 // 用户取消支付 223 // 用户取消支付
224 if (err.errMsg?.includes('cancel')) { 224 if (err.errMsg?.includes('cancel')) {
225 await handleUserCancel(orderId) 225 await handleUserCancel(orderId)
......
1 // dev 1 // dev
2 // const baseUrl_api = 'http://192.168.1.137:8787' 2 const baseUrl_api = 'http://192.168.1.137:8787'
3 const baseUrl_api = 'http://tk001.wxjylt.com/stage-api' 3 // const baseUrl_api = 'http://tk001.wxjylt.com/stage-api'
4 const loginImage_api = 'http://tk001.wxjylt.com/stage-api' 4 const loginImage_api = 'http://tk001.wxjylt.com/stage-api'
5 const payUrl = 'https://wxpay.cmbc.com.cn/mobilePlatform/appserver/lcbpPay.do' 5 const payUrl = 'https://wxpay.cmbc.com.cn/mobilePlatform/appserver/lcbpPay.do'
6 6
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
2 <view class="add-apply-page"> 2 <view class="add-apply-page">
3 <!-- 顶部步骤条 --> 3 <!-- 顶部步骤条 -->
4 <view class="steps-bar"> 4 <view class="steps-bar">
5 <view class="step-item" :class="{ active: active >= 0, current: active == 0 }"> 5 <view :class="{ active: active >= 0, current: active == 0 }" class="step-item">
6 <view class="step-circle">1</view> 6 <view class="step-circle">1</view>
7 <view class="step-text">考级基本信息</view> 7 <view class="step-text">考级基本信息</view>
8 </view> 8 </view>
9 <view class="step-line" :class="{ active: active >= 1 }"></view> 9 <view :class="{ active: active >= 1 }" class="step-line"></view>
10 <view class="step-item" :class="{ active: active >= 1, current: active == 1 }"> 10 <view :class="{ active: active >= 1, current: active == 1 }" class="step-item">
11 <view class="step-circle">2</view> 11 <view class="step-circle">2</view>
12 <view class="step-text">添加考生</view> 12 <view class="step-text">添加考生</view>
13 </view> 13 </view>
...@@ -15,38 +15,38 @@ ...@@ -15,38 +15,38 @@
15 15
16 <view class="page-content"> 16 <view class="page-content">
17 <!-- 步骤1:考级基本信息 --> 17 <!-- 步骤1:考级基本信息 -->
18 <view class="wBox" v-if="active == 0"> 18 <view v-if="active == 0" class="wBox">
19 <uni-forms ref="baseForm" :modelValue="form" label-width="100"> 19 <uni-forms ref="baseForm" :modelValue="form" label-width="100">
20 <uni-forms-item label="考试名称"> 20 <uni-forms-item label="考试名称">
21 <view class="align-forms-item" v-if="form.name">{{form.name}}</view> 21 <view v-if="form.name" class="align-forms-item">{{ form.name }}</view>
22 <view v-else class="align-forms-item-placeHolder">自动生成</view> 22 <view v-else class="align-forms-item-placeHolder">自动生成</view>
23 </uni-forms-item> 23 </uni-forms-item>
24 <uni-forms-item label="申请单位" required> 24 <uni-forms-item label="申请单位" required>
25 <view class="align-forms-item">{{form.memberName}}</view> 25 <view class="align-forms-item">{{ form.memberName }}</view>
26 </uni-forms-item> 26 </uni-forms-item>
27 <uni-forms-item label="申请日期" required> 27 <uni-forms-item label="申请日期" required>
28 <uni-datetime-picker type="date" v-model="form.applyTime"></uni-datetime-picker> 28 <uni-datetime-picker v-model="form.applyTime" type="date"></uni-datetime-picker>
29 </uni-forms-item> 29 </uni-forms-item>
30 <uni-forms-item label="考试开始时间" required> 30 <uni-forms-item label="考试开始时间" required>
31 <uni-datetime-picker type="datetime" v-model="form.startTime"></uni-datetime-picker> 31 <uni-datetime-picker v-model="form.startTime" type="datetime"></uni-datetime-picker>
32 </uni-forms-item> 32 </uni-forms-item>
33 <uni-forms-item label="考试结束时间" required> 33 <uni-forms-item label="考试结束时间" required>
34 <uni-datetime-picker type="datetime" v-model="form.endTime"></uni-datetime-picker> 34 <uni-datetime-picker v-model="form.endTime" type="datetime"></uni-datetime-picker>
35 </uni-forms-item> 35 </uni-forms-item>
36 <uni-forms-item label="考级地点" required> 36 <uni-forms-item label="考级地点" required>
37 <uni-easyinput v-model="form.examLocation" placeholder="考级地点" /> 37 <uni-easyinput v-model="form.examLocation" placeholder="考级地点"/>
38 </uni-forms-item> 38 </uni-forms-item>
39 <uni-forms-item :label="`考官${ec}`" v-for="ec in examinerForChoose" :key="ec"> 39 <uni-forms-item v-for="ec in examinerForChoose" :key="ec" :label="`考官${ec}`">
40 <view class="maskbox"> 40 <view class="maskbox">
41 <view class="mask" @click="selectFN(ec)"></view> 41 <view class="mask" @click="selectFN(ec)"></view>
42 <uni-easyinput v-model="form[`examiner_${ec}`]" clearable placeholder="点击选择考官" /> 42 <uni-easyinput v-model="form[`examiner_${ec}`]" clearable placeholder="点击选择考官"/>
43 </view> 43 </view>
44 </uni-forms-item> 44 </uni-forms-item>
45 </uni-forms> 45 </uni-forms>
46 </view> 46 </view>
47 47
48 <!-- 步骤2:添加考生 --> 48 <!-- 步骤2:添加考生 -->
49 <view class="step2-content" v-if="active == 1"> 49 <view v-if="active == 1" class="step2-content">
50 <!-- 考级信息卡片 --> 50 <!-- 考级信息卡片 -->
51 <view class="exam-info-card"> 51 <view class="exam-info-card">
52 <view class="card-header"> 52 <view class="card-header">
...@@ -55,34 +55,34 @@ ...@@ -55,34 +55,34 @@
55 <view class="info-grid"> 55 <view class="info-grid">
56 <view class="info-item"> 56 <view class="info-item">
57 <text class="info-label">考试名称</text> 57 <text class="info-label">考试名称</text>
58 <text class="info-value">{{form.name || '-'}}</text> 58 <text class="info-value">{{ form.name || '-' }}</text>
59 </view> 59 </view>
60 <view class="info-item"> 60 <view class="info-item">
61 <text class="info-label">申请单位</text> 61 <text class="info-label">申请单位</text>
62 <text class="info-value">{{form.memberName || '-'}}</text> 62 <text class="info-value">{{ form.memberName || '-' }}</text>
63 </view> 63 </view>
64 <view class="info-item"> 64 <view class="info-item">
65 <text class="info-label">考试地点</text> 65 <text class="info-label">考试地点</text>
66 <text class="info-value">{{form.examLocation || '-'}}</text> 66 <text class="info-value">{{ form.examLocation || '-' }}</text>
67 </view> 67 </view>
68 <view class="info-item"> 68 <view class="info-item">
69 <text class="info-label">考试时间</text> 69 <text class="info-label">考试时间</text>
70 <text class="info-value">{{formatDateTime(form.startTime)}} - {{formatDateTime(form.endTime)}}</text> 70 <text class="info-value">{{ formatDateTime(form.startTime) }} - {{ formatDateTime(form.endTime) }}</text>
71 </view> 71 </view>
72 </view> 72 </view>
73 </view> 73 </view>
74 74
75 <!-- 操作栏(红框顶部统计+添加按钮) --> 75 <!-- 操作栏(红框顶部统计+添加按钮) -->
76 <button class="btn-add-student" @click="goChooseStudent"> 76 <button class="btn-add-student" @click="goChooseStudent">
77 <uni-icons type="plus" size="16" color="#fff"></uni-icons> 77 <uni-icons color="#fff" size="16" type="plus"></uni-icons>
78 添加考生 78 添加考生
79 </button> 79 </button>
80 <view class="action-bar"> 80 <view class="action-bar">
81 <view class="stat-info"> 81 <view class="stat-info">
82 <text class="stat-total">{{tablePersonInfo.total || 0}}</text> 82 <text class="stat-total">{{ tablePersonInfo.total || 0 }}</text>
83 <view class="level-tags"> 83 <view class="level-tags">
84 <view class="level-tag" v-for="l in tablePersonInfo.levelArr" :key="l.level"> 84 <view v-for="l in tablePersonInfo.levelArr" :key="l.level" class="level-tag">
85 {{ szToHz(l.level) }}级:{{l.num}} 85 {{ szToHz(l.level) }}级:{{ l.num }}
86 </view> 86 </view>
87 </view> 87 </view>
88 </view> 88 </view>
...@@ -91,19 +91,21 @@ ...@@ -91,19 +91,21 @@
91 91
92 <!-- 考生列表(红框主体) --> 92 <!-- 考生列表(红框主体) -->
93 <view class="student-list"> 93 <view class="student-list">
94 <view class="student-card" v-for="(n,index) in infoList" :key="index"> 94 <view v-for="(n,index) in infoList" :key="index" class="student-card">
95 <!-- 左侧:头像+考生信息 --> 95 <!-- 左侧:头像+考生信息 -->
96 <view class="card-left"> 96 <view class="card-left">
97 <view class="avatar"> 97 <view class="avatar">
98 <image v-if="n.photo" :src="n.photo" mode="aspectFill" /> 98 <image v-if="n.photo" :src="n.photo" mode="aspectFill"/>
99 <image v-else :src="config.baseUrl_api + '/fs/static/tx@2x.png'" 99 <image v-else :src="config.baseUrl_api + '/fs/static/tx@2x.png'"
100 mode="aspectFill"> 100 mode="aspectFill">
101 </image> 101 </image>
102 <!-- <text v-else class="avatar-text">{{(n.realName || '').slice(0,1)}}</text> --> 102 <!-- <text v-else class="avatar-text">{{(n.realName || '').slice(0,1)}}</text> -->
103 </view> 103 </view>
104 <view class="student-info"> 104 <view class="student-info">
105 <view class="student-name">{{n.realName}} <text class="per-code">{{n.perCode}}</text></view> 105 <view class="student-name">{{ n.realName }}
106 <view class="student-idcard">{{n.idcTypeStr}}{{n.idcCode}}</view> 106 <text class="per-code">{{ n.perCode }}</text>
107 </view>
108 <view class="student-idcard">{{ n.idcTypeStr }}{{ n.idcCode }}</view>
107 </view> 109 </view>
108 </view> 110 </view>
109 111
...@@ -116,26 +118,26 @@ ...@@ -116,26 +118,26 @@
116 <view class="level-item"> 118 <view class="level-item">
117 <text class="level-label">考试级别</text> 119 <text class="level-label">考试级别</text>
118 <view class="select-wrapper" @click="changeLevelfather(n)"> 120 <view class="select-wrapper" @click="changeLevelfather(n)">
119 <uni-data-select v-model="n.levelNew" :localdata="levelArr" @change="changeLevel" :clear="false" /> 121 <uni-data-select v-model="n.levelNew" :clear="false" :localdata="levelArr" @change="changeLevel"/>
120 </view> 122 </view>
121 </view> 123 </view>
122 <view class="level-item"> 124 <view class="level-item">
123 <text class="level-label">是否通过</text> 125 <text class="level-label">是否通过</text>
124 <view class="select-wrapper"> 126 <view class="select-wrapper">
125 <uni-data-select v-model="n.isPass" :localdata="range" :clear="false" /> 127 <uni-data-select v-model="n.isPass" :clear="false" :localdata="range"/>
126 </view> 128 </view>
127 </view> 129 </view>
128 </view> 130 </view>
129 131
130 <!-- 删除按钮 --> 132 <!-- 删除按钮 -->
131 <view class="delete-btn" @click="handleDelete(n)"> 133 <view class="delete-btn" @click="handleDelete(n)">
132 <uni-icons type="trash" size="18" color="#dd524d"></uni-icons> 134 <uni-icons color="#dd524d" size="18" type="trash"></uni-icons>
133 </view> 135 </view>
134 </view> 136 </view>
135 137
136 <!-- 空状态 --> 138 <!-- 空状态 -->
137 <view class="empty" v-if="infoList.length==0"> 139 <view v-if="infoList.length==0" class="empty">
138 <image class="empty-img" mode="aspectFit" :src="config.baseUrl_api + '/fs/static/nodata.png'" /> 140 <image :src="config.baseUrl_api + '/fs/static/nodata.png'" class="empty-img" mode="aspectFit"/>
139 <text class="empty-text">暂无考生信息</text> 141 <text class="empty-text">暂无考生信息</text>
140 </view> 142 </view>
141 </view> 143 </view>
...@@ -143,11 +145,11 @@ ...@@ -143,11 +145,11 @@
143 </view> 145 </view>
144 146
145 <!-- 底部按钮 --> 147 <!-- 底部按钮 -->
146 <view class="fixedBottom" v-if="active == 0"> 148 <view v-if="active == 0" class="fixedBottom">
147 <button class="btn-red-kx" style="width: 40%;" @click="submitForm(0)">保存</button> 149 <button class="btn-red-kx" style="width: 40%;" @click="submitForm(0)">保存</button>
148 <button class="btn-red" style="width: 40%;" @click="submitForm(1)">下一步</button> 150 <button class="btn-red" style="width: 40%;" @click="submitForm(1)">下一步</button>
149 </view> 151 </view>
150 <view class="fixedBottom" v-if="active == 1"> 152 <view v-if="active == 1" class="fixedBottom">
151 <button class="btn-red-kx" style="width: 25%;" @click="prev">上一步</button> 153 <button class="btn-red-kx" style="width: 25%;" @click="prev">上一步</button>
152 <button class="btn-red-kx" style="width: 25%;" @click="submitForm2(0)">保存</button> 154 <button class="btn-red-kx" style="width: 25%;" @click="submitForm2(0)">保存</button>
153 <button class="btn-red" style="width: 30%;" @click="submitForm2(1)">提交审核</button> 155 <button class="btn-red" style="width: 30%;" @click="submitForm2(1)">提交审核</button>
...@@ -157,70 +159,70 @@ ...@@ -157,70 +159,70 @@
157 </template> 159 </template>
158 160
159 <script setup> 161 <script setup>
160 import { ref } from 'vue'; 162 import {ref} from 'vue';
161 import * as api from '@/common/api.js'; 163 import * as api from '@/common/api.js';
162 import { onLoad, onShow } from '@dcloudio/uni-app'; 164 import {onLoad, onShow} from '@dcloudio/uni-app';
163 import config from '@/config.js' 165 import config from '@/config.js'
164 import dayjs from 'dayjs' 166 import dayjs from 'dayjs'
165 import _ from 'underscore' 167 import _ from 'underscore'
166 168
167 const app = getApp(); 169 const app = getApp();
168 const memberInfo = app.globalData.memberInfo 170 const memberInfo = app.globalData.memberInfo
169 171
170 const form = ref({ 172 const form = ref({
171 type: '1' 173 type: '1'
172 }); 174 });
173 175
174 const examinerForChoose = ['A', 'B', 'C'] 176 const examinerForChoose = ['A', 'B', 'C']
175 let examinerArr = [] 177 let examinerArr = []
176 const active = ref(0) 178 const active = ref(0)
177 const infoList = ref([]) 179 const infoList = ref([])
178 const tablePersonInfo = ref({}) 180 const tablePersonInfo = ref({})
179 const transcript = ref([]) // 补全缺失变量 181 const transcript = ref([]) // 补全缺失变量
180 182
181 const levelArr = ref([{ 183 const levelArr = ref([{
182 value: '10', 184 value: '10',
183 text: '十级' 185 text: '十级'
184 }, { 186 }, {
185 value: '9', 187 value: '9',
186 text: '九级' 188 text: '九级'
187 }, { 189 }, {
188 value: '8', 190 value: '8',
189 text: '八级' 191 text: '八级'
190 }, { 192 }, {
191 value: '7', 193 value: '7',
192 text: '七级' 194 text: '七级'
193 }, { 195 }, {
194 value: '6', 196 value: '6',
195 text: '六级' 197 text: '六级'
196 }, { 198 }, {
197 value: '5', 199 value: '5',
198 text: '五级' 200 text: '五级'
199 }, { 201 }, {
200 value: '4', 202 value: '4',
201 text: '四级' 203 text: '四级'
202 }, { 204 }, {
203 value: '3', 205 value: '3',
204 text: '三级' 206 text: '三级'
205 }, { 207 }, {
206 value: '2', 208 value: '2',
207 text: '二级' 209 text: '二级'
208 }, { 210 }, {
209 value: '1', 211 value: '1',
210 text: '一级' 212 text: '一级'
211 }]) 213 }])
212 214
213 const range = ref([{ 215 const range = ref([{
214 value: '1', 216 value: '1',
215 text: '是' 217 text: '是'
216 }, { 218 }, {
217 value: '0', 219 value: '0',
218 text: '否' 220 text: '否'
219 }]) 221 }])
220 222
221 let examId 223 let examId
222 224
223 onLoad(option => { 225 onLoad(option => {
224 if (app.globalData.isLogin) { 226 if (app.globalData.isLogin) {
225 initData(option) 227 initData(option)
226 } else { 228 } else {
...@@ -228,9 +230,9 @@ ...@@ -228,9 +230,9 @@
228 initData(option) 230 initData(option)
229 }; 231 };
230 } 232 }
231 }); 233 });
232 234
233 function initData(option) { 235 function initData(option) {
234 form.value.memberName = app.globalData.memberInfo.name 236 form.value.memberName = app.globalData.memberInfo.name
235 form.value.applyTime = dayjs().format('YYYY-MM-DD') 237 form.value.applyTime = dayjs().format('YYYY-MM-DD')
236 238
...@@ -249,27 +251,27 @@ ...@@ -249,27 +251,27 @@
249 getDetail() 251 getDetail()
250 } 252 }
251 } 253 }
252 } 254 }
253 255
254 onShow(() => { 256 onShow(() => {
255 uni.$on('chosen', updateData) 257 uni.$on('chosen', updateData)
256 const curExamId = examId || form.value.examId 258 const curExamId = examId || form.value.examId
257 if (curExamId) { 259 if (curExamId) {
258 getChosedStudentList() 260 getChosedStudentList()
259 } 261 }
260 }) 262 })
261 263
262 function updateData(e) { 264 function updateData(e) {
263 examinerArr.push(e.obj) 265 examinerArr.push(e.obj)
264 form.value[`examiner_${e.ec}`] = e.obj.name 266 form.value[`examiner_${e.ec}`] = e.obj.name
265 } 267 }
266 268
267 function getDetail() { 269 function getDetail() {
268 api.getLevelApplyInfo(examId || form.value.examId).then(res => { 270 api.getLevelApplyInfo(examId || form.value.examId).then(res => {
269 const data = res.data 271 const data = res.data
270 if (data.examiner) { 272 if (data.examiner) {
271 _.each(data.examiner.split(','), (id, i) => { 273 _.each(data.examiner.split(','), (id, i) => {
272 examinerArr[i] = { perId: id } 274 examinerArr[i] = {perId: id}
273 }) 275 })
274 276
275 _.each(data.examinerNames.split(','), (name, i) => { 277 _.each(data.examinerNames.split(','), (name, i) => {
...@@ -281,9 +283,9 @@ ...@@ -281,9 +283,9 @@
281 } 283 }
282 form.value = data 284 form.value = data
283 }) 285 })
284 } 286 }
285 287
286 function selectFN(ec) { 288 function selectFN(ec) {
287 const chosen = [] 289 const chosen = []
288 _.each(examinerForChoose, ecKey => { 290 _.each(examinerForChoose, ecKey => {
289 const key = `examiner_${ecKey}` 291 const key = `examiner_${ecKey}`
...@@ -301,9 +303,9 @@ ...@@ -301,9 +303,9 @@
301 uni.navigateTo({ 303 uni.navigateTo({
302 url: path 304 url: path
303 }); 305 });
304 } 306 }
305 307
306 function submitForm(flag) { 308 function submitForm(flag) {
307 form.value.status = '0' 309 form.value.status = '0'
308 const examinerIds = [] 310 const examinerIds = []
309 const examinerNames = [] 311 const examinerNames = []
...@@ -337,31 +339,31 @@ ...@@ -337,31 +339,31 @@
337 } else { 339 } else {
338 // 保存并下一步 - 需校验 340 // 保存并下一步 - 需校验
339 if (!form.value.applyTime) { 341 if (!form.value.applyTime) {
340 uni.showToast({ title: '请选择申请日期', icon: 'none' }) 342 uni.showToast({title: '请选择申请日期', icon: 'none'})
341 return 343 return
342 } 344 }
343 if (!form.value.startTime) { 345 if (!form.value.startTime) {
344 uni.showToast({ title: '请选择考试开始时间', icon: 'none' }) 346 uni.showToast({title: '请选择考试开始时间', icon: 'none'})
345 return 347 return
346 } 348 }
347 if (!form.value.endTime) { 349 if (!form.value.endTime) {
348 uni.showToast({ title: '请选择考试结束时间', icon: 'none' }) 350 uni.showToast({title: '请选择考试结束时间', icon: 'none'})
349 return 351 return
350 } 352 }
351 if (!form.value.examLocation) { 353 if (!form.value.examLocation) {
352 uni.showToast({ title: '请输入考级地点', icon: 'none' }) 354 uni.showToast({title: '请输入考级地点', icon: 'none'})
353 return 355 return
354 } 356 }
355 if (dayjs(form.value.startTime).valueOf() < dayjs(form.value.applyTime).valueOf()) { 357 if (dayjs(form.value.startTime).valueOf() < dayjs(form.value.applyTime).valueOf()) {
356 uni.showToast({ title: '考试开始时间应大于申请日期', icon: 'none' }) 358 uni.showToast({title: '考试开始时间应大于申请日期', icon: 'none'})
357 return 359 return
358 } 360 }
359 if (dayjs(form.value.endTime).valueOf() <= dayjs(form.value.startTime).valueOf()) { 361 if (dayjs(form.value.endTime).valueOf() <= dayjs(form.value.startTime).valueOf()) {
360 uni.showToast({ title: '考试结束时间应大于考试开始时间', icon: 'none' }) 362 uni.showToast({title: '考试结束时间应大于考试开始时间', icon: 'none'})
361 return 363 return
362 } 364 }
363 if (examinerIds.length % 2 === 0) { 365 if (examinerIds.length % 2 === 0) {
364 uni.showToast({ title: '录入的考官人数必须为单数', icon: 'none' }) 366 uni.showToast({title: '录入的考官人数必须为单数', icon: 'none'})
365 return 367 return
366 } 368 }
367 369
...@@ -377,39 +379,39 @@ ...@@ -377,39 +379,39 @@
377 } 379 }
378 }) 380 })
379 } 381 }
380 } 382 }
381 383
382 function save() { 384 function save() {
383 if (form.value.examId) { 385 if (form.value.examId) {
384 return api.updateLevelInfo(form.value).then(() => { 386 return api.updateLevelInfo(form.value).then(() => {
385 uni.showToast({ title: '保存成功', icon: 'none' }) 387 uni.showToast({title: '保存成功', icon: 'none'})
386 }) 388 })
387 } else { 389 } else {
388 return api.addLevelInfo(form.value).then((res) => { 390 return api.addLevelInfo(form.value).then((res) => {
389 form.value.examId = res.data.examId 391 form.value.examId = res.data.examId
390 form.value.name = res.data.name 392 form.value.name = res.data.name
391 uni.showToast({ title: '保存成功', icon: 'none' }) 393 uni.showToast({title: '保存成功', icon: 'none'})
392 }) 394 })
393 } 395 }
394 } 396 }
395 397
396 function prev() { 398 function prev() {
397 active.value = 0 399 active.value = 0
398 } 400 }
399 401
400 function goChooseStudent() { 402 function goChooseStudent() {
401 uni.navigateTo({ 403 uni.navigateTo({
402 url: `/level/chooseStudent?examId=${form.value.examId}&memId=${memberInfo.memId}&examType=${form.value.type}` 404 url: `/level/chooseStudent?examId=${form.value.examId}&memId=${memberInfo.memId}&examType=${form.value.type}`
403 }) 405 })
404 } 406 }
405 407
406 // 格式化日期时间 408 // 格式化日期时间
407 function formatDateTime(dateStr) { 409 function formatDateTime(dateStr) {
408 if (!dateStr) return '-' 410 if (!dateStr) return '-'
409 return dateStr.substring(0, 10) 411 return dateStr.substring(0, 10)
410 } 412 }
411 413
412 function getChosedStudentList() { 414 function getChosedStudentList() {
413 if (!form.value.examId) return 415 if (!form.value.examId) return
414 var obj = { 416 var obj = {
415 examId: form.value.examId 417 examId: form.value.examId
...@@ -439,9 +441,9 @@ ...@@ -439,9 +441,9 @@
439 441
440 infoList.value = res.rows 442 infoList.value = res.rows
441 }).then(getTablePersonInfo) 443 }).then(getTablePersonInfo)
442 } 444 }
443 445
444 function getTablePersonInfo() { 446 function getTablePersonInfo() {
445 const total = infoList.value.length 447 const total = infoList.value.length
446 const levelArrData = [] 448 const levelArrData = []
447 _.each(infoList.value, (d) => { 449 _.each(infoList.value, (d) => {
...@@ -464,31 +466,31 @@ ...@@ -464,31 +466,31 @@
464 return l.level 466 return l.level
465 }) 467 })
466 } 468 }
467 } 469 }
468 470
469 function szToHz(num) { 471 function szToHz(num) {
470 const hzArr = ['〇', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十'] 472 const hzArr = ['〇', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十']
471 return hzArr[parseInt(num)] 473 return hzArr[parseInt(num)]
472 } 474 }
473 475
474 let nowRow 476 let nowRow
475 477
476 function changeLevelfather(row) { 478 function changeLevelfather(row) {
477 nowRow = row 479 nowRow = row
478 api.jiDropDownBox({ 480 api.jiDropDownBox({
479 perId: row.perId 481 perId: row.perId
480 }).then(res => { 482 }).then(res => {
481 levelArr.value = res.data 483 levelArr.value = res.data
482 for (var l of levelArr.value) { 484 for (let l of levelArr.value) {
483 l.text = l.name 485 l.text = l.name
484 l.disabled = !(l.status) 486 l.disabled = !(l.status)
485 } 487 }
486 }) 488 })
487 } 489 }
488 490
489 function changeLevel(e) { 491 function changeLevel(e) {
490 if (e == nowRow.levelOld) { 492 if (e == nowRow.levelOld) {
491 uni.showToast({ title: '考试级别重复,请重新选择!', icon: 'none' }) 493 uni.showToast({title: '考试级别重复,请重新选择!', icon: 'none'})
492 nowRow.levelNew = nowRow.levelRecommend 494 nowRow.levelNew = nowRow.levelRecommend
493 return 495 return
494 } 496 }
...@@ -496,61 +498,65 @@ ...@@ -496,61 +498,65 @@
496 uni.showModal({ 498 uni.showModal({
497 title: '提示', 499 title: '提示',
498 content: `建议考试级别为 "${szToHz(nowRow.levelRecommend)}级" ,确定要修改为${szToHz(e)}级吗?`, 500 content: `建议考试级别为 "${szToHz(nowRow.levelRecommend)}级" ,确定要修改为${szToHz(e)}级吗?`,
499 success: function(res) { 501 success: function (res) {
500 if (res.confirm) { 502 if (res.confirm) {
501 getTablePersonInfo() 503 getTablePersonInfo()
502 } else { 504 } else {
503 nowRow.levelNew = nowRow.levelRecommend 505 nowRow.levelNew = nowRow.levelRecommend
504 } 506 }
505 }, 507 },
506 fail: function(res) { 508 fail: function (res) {
507 nowRow.levelNew = nowRow.levelRecommend 509 nowRow.levelNew = nowRow.levelRecommend
508 } 510 }
509 }) 511 })
510 } 512 }
511 } 513 }
512 514
513 function submitForm2(flag) { 515 function submitForm2(flag) {
514 // 循环校验考试级别 516 // 循环校验考试级别
515 for (var item of infoList.value) { 517 for (let item of infoList.value) {
516 if (item.levelNew == item.levelOld) { 518 if (item.levelNew == item.levelOld) {
517 uni.showToast({ title: `${item.realName}考试级别重复,请重新选择!`, icon: 'none' }) 519 uni.showToast({title: `${item.realName}考试级别重复,请重新选择!`, icon: 'none'})
518 return 520 return
519 } 521 }
520 if (!item.levelNew) { 522 if (!item.levelNew) {
521 uni.showToast({ title: `${item.realName}请选择考试级别!`, icon: 'none' }) 523 uni.showToast({title: `${item.realName}请选择考试级别!`, icon: 'none'})
522 return 524 return
523 } 525 }
524 } 526 }
525 527
526 if (flag === 1) { 528 if (flag === 1) {
527 if (infoList.value.length == 0) { 529 if (infoList.value.length == 0) {
528 uni.showToast({ title: '请选择考生', icon: 'none' }) 530 uni.showToast({title: '请选择考生', icon: 'none'})
529 return 531 return
530 } 532 }
531 533
532 uni.showModal({ 534 uni.showModal({
533 title: '提示', 535 title: '提示',
534 content: `请确认人员照片是否已更新?`, 536 content: `请确认人员照片是否已更新?`,
535 success: function(res) { 537 success: function (res) {
536 if (res.confirm) { 538 if (res.confirm) {
537 saveStep2(flag).then(() => { 539 // saveStep2(flag).then(() => {
538 uni.showToast({ title: '提交成功', icon: 'none' }) 540 // uni.showToast({title: '提交成功', icon: 'none'})
541 // uni.navigateTo({
542 // url: `/level/paymentDetail?examId=${form.value.examId}`
543 // })
544 // })
545
539 uni.navigateTo({ 546 uni.navigateTo({
540 url: `/level/paymentDetail?examId=${form.value.examId}` 547 url: `/level/paymentDetail?examId=${form.value.examId}`
541 }) 548 })
542 })
543 } 549 }
544 } 550 }
545 }) 551 })
546 } else { 552 } else {
547 saveStep2(flag).then(() => { 553 saveStep2(flag).then(() => {
548 uni.showToast({ title: '操作成功', icon: 'none' }) 554 uni.showToast({title: '操作成功', icon: 'none'})
549 }) 555 })
550 } 556 }
551 } 557 }
552 558
553 function saveStep2(flag) { 559 function saveStep2(flag) {
554 const data = _.map(infoList.value, (d) => { 560 const data = _.map(infoList.value, (d) => {
555 return { 561 return {
556 id: d.id, 562 id: d.id,
...@@ -564,32 +570,32 @@ ...@@ -564,32 +570,32 @@
564 transcript: form.value.transcript, 570 transcript: form.value.transcript,
565 status: flag 571 status: flag
566 }) 572 })
567 } 573 }
568 574
569 function handleDelete(row) { 575 function handleDelete(row) {
570 uni.showModal({ 576 uni.showModal({
571 title: '提示', 577 title: '提示',
572 content: `确定删除${row.realName}?`, 578 content: `确定删除${row.realName}?`,
573 success: function(res) { 579 success: function (res) {
574 if (res.confirm) { 580 if (res.confirm) {
575 api.dellevelPerson(row.id).then(() => { 581 api.dellevelPerson(row.id).then(() => {
576 uni.showToast({ title: '操作成功', icon: 'none' }) 582 uni.showToast({title: '操作成功', icon: 'none'})
577 getChosedStudentList() 583 getChosedStudentList()
578 }) 584 })
579 } 585 }
580 } 586 }
581 }) 587 })
582 } 588 }
583 </script> 589 </script>
584 <style lang="scss" scoped> 590 <style lang="scss" scoped>
585 .add-apply-page { 591 .add-apply-page {
586 min-height: 100vh; 592 min-height: 100vh;
587 background: #f5f5f5; 593 background: #f5f5f5;
588 padding-bottom: 120rpx; 594 padding-bottom: 120rpx;
589 } 595 }
590 596
591 /* 顶部步骤条 */ 597 /* 顶部步骤条 */
592 .steps-bar { 598 .steps-bar {
593 display: flex; 599 display: flex;
594 align-items: center; 600 align-items: center;
595 justify-content: center; 601 justify-content: center;
...@@ -656,16 +662,16 @@ ...@@ -656,16 +662,16 @@
656 background: #AD181F; 662 background: #AD181F;
657 } 663 }
658 } 664 }
659 } 665 }
660 666
661 /* 步骤2样式 */ 667 /* 步骤2样式 */
662 .step2-content { 668 .step2-content {
663 padding: 0 20rpx; 669 padding: 0 20rpx;
664 margin-top: 20rpx; 670 margin-top: 20rpx;
665 } 671 }
666 672
667 /* 考级信息卡片 */ 673 /* 考级信息卡片 */
668 .exam-info-card { 674 .exam-info-card {
669 background: #fff; 675 background: #fff;
670 border-radius: 16rpx; 676 border-radius: 16rpx;
671 margin-bottom: 20rpx; 677 margin-bottom: 20rpx;
...@@ -711,10 +717,10 @@ ...@@ -711,10 +717,10 @@
711 } 717 }
712 } 718 }
713 } 719 }
714 } 720 }
715 721
716 /* 操作栏(统计+添加按钮) */ 722 /* 操作栏(统计+添加按钮) */
717 .action-bar { 723 .action-bar {
718 display: flex; 724 display: flex;
719 justify-content: space-between; 725 justify-content: space-between;
720 align-items: center; 726 align-items: center;
...@@ -751,8 +757,9 @@ ...@@ -751,8 +757,9 @@
751 } 757 }
752 758
753 759
754 } 760 }
755 .btn-add-student { 761
762 .btn-add-student {
756 display: flex; 763 display: flex;
757 align-items: center; 764 align-items: center;
758 justify-content: center; 765 justify-content: center;
...@@ -763,9 +770,10 @@ ...@@ -763,9 +770,10 @@
763 font-size: 26rpx; 770 font-size: 26rpx;
764 color: #fff; 771 color: #fff;
765 box-shadow: 0 4rpx 16rpx rgba(173, 24, 31, 0.3); 772 box-shadow: 0 4rpx 16rpx rgba(173, 24, 31, 0.3);
766 } 773 }
767 /* 考生列表(核心优化) */ 774
768 .student-list { 775 /* 考生列表(核心优化) */
776 .student-list {
769 .student-card { 777 .student-card {
770 position: relative; 778 position: relative;
771 // display: flex; 779 // display: flex;
...@@ -835,7 +843,7 @@ ...@@ -835,7 +843,7 @@
835 justify-content: space-between; 843 justify-content: space-between;
836 // padding:0 30px; 844 // padding:0 30px;
837 margin-top: 20rpx; 845 margin-top: 20rpx;
838 margin-left:100rpx; 846 margin-left: 100rpx;
839 // flex-direction: column; 847 // flex-direction: column;
840 // align-items: flex-end; 848 // align-items: flex-end;
841 // gap: 16rpx; 849 // gap: 16rpx;
...@@ -893,22 +901,22 @@ ...@@ -893,22 +901,22 @@
893 color: #666; 901 color: #666;
894 } 902 }
895 } 903 }
896 } 904 }
897 905
898 .wBox { 906 .wBox {
899 width: 700rpx; 907 width: 700rpx;
900 padding: 30rpx; 908 padding: 30rpx;
901 margin: 20rpx auto; 909 margin: 20rpx auto;
902 background: #FFFFFF; 910 background: #FFFFFF;
903 box-shadow: 0rpx 12rpx 116rpx 0rpx rgba(196, 203, 214, 0.1); 911 box-shadow: 0rpx 12rpx 116rpx 0rpx rgba(196, 203, 214, 0.1);
904 border-radius: 15rpx; 912 border-radius: 15rpx;
905 } 913 }
906 914
907 :deep(.uni-forms-item__inner) { 915 :deep(.uni-forms-item__inner) {
908 padding-bottom: 20rpx; 916 padding-bottom: 20rpx;
909 } 917 }
910 918
911 .maskbox { 919 .maskbox {
912 position: relative; 920 position: relative;
913 921
914 .mask { 922 .mask {
...@@ -919,10 +927,10 @@ ...@@ -919,10 +927,10 @@
919 background-color: red; 927 background-color: red;
920 opacity: 0; 928 opacity: 0;
921 } 929 }
922 } 930 }
923 931
924 /* 底部按钮 */ 932 /* 底部按钮 */
925 .fixedBottom { 933 .fixedBottom {
926 position: fixed; 934 position: fixed;
927 bottom: 0; 935 bottom: 0;
928 left: 0; 936 left: 0;
...@@ -954,5 +962,5 @@ ...@@ -954,5 +962,5 @@
954 font-size: 28rpx; 962 font-size: 28rpx;
955 font-weight: 600; 963 font-weight: 600;
956 } 964 }
957 } 965 }
958 </style> 966 </style>
......
...@@ -213,13 +213,16 @@ const handleSubmit = async () => { ...@@ -213,13 +213,16 @@ const handleSubmit = async () => {
213 content: `确定提交订单吗?`, 213 content: `确定提交订单吗?`,
214 success: async (res) => { 214 success: async (res) => {
215 if (res.confirm) { 215 if (res.confirm) {
216 uni.showLoading({title: '提交中...'}); 216 uni.showLoading({
217 title: '支付中...',
218 mask: true
219 })
217 try { 220 try {
218 const commitRes = await api.commitJiExam({ 221 const commitRes = await api.commitJiExam({
219 addresId: selectedAddress.value.id, 222 addresId: selectedAddress.value.id,
220 id: examId.value, 223 id: examId.value,
221 payType: '2' 224 payType: '2'
222 }); 225 })
223 if (commitRes.data && commitRes.data.payResult.encryptedData) { 226 if (commitRes.data && commitRes.data.payResult.encryptedData) {
224 const res = await minShengPay(commitRes.data.orderId, commitRes.data.payResult.encryptedData) 227 const res = await minShengPay(commitRes.data.orderId, commitRes.data.payResult.encryptedData)
225 if (res == 'OK') { 228 if (res == 'OK') {
...@@ -233,44 +236,6 @@ const handleSubmit = async () => { ...@@ -233,44 +236,6 @@ const handleSubmit = async () => {
233 } 236 }
234 } 237 }
235 238
236 // if (commitRes.data && commitRes.data.orderId) {
237 // // 有支付流程,调用支付
238 // const payRes = await api.payJiExam(commitRes.data.orderId);
239 // uni.hideLoading();
240 //
241 // if (payRes.data && payRes.data.payResult && payRes.data.payResult.encryptedData) {
242 // // 调用支付
243 // uni.requestPayment({
244 // provider: 'wxpay',
245 // timeStamp: payRes.data.payResult.timeStamp,
246 // nonceStr: payRes.data.payResult.nonceStr,
247 // package: payRes.data.payResult.package,
248 // signType: payRes.data.payResult.signType,
249 // paySign: payRes.data.payResult.paySign,
250 // success: () => {
251 // uni.showToast({title: '支付成功', icon: 'success'});
252 // setTimeout(() => {
253 // uni.navigateBack();
254 // }, 1500);
255 // },
256 // fail: () => {
257 // uni.showToast({title: '支付失败', icon: 'none'});
258 // }
259 // });
260 // } else {
261 // // 无需支付,直接成功
262 // uni.showToast({title: '提交成功', icon: 'success'});
263 // setTimeout(() => {
264 // uni.navigateBack();
265 // }, 1500);
266 // }
267 // } else {
268 // uni.hideLoading();
269 // uni.showToast({title: '提交成功', icon: 'success'});
270 // setTimeout(() => {
271 // uni.navigateBack();
272 // }, 1500);
273 // }
274 } catch (e) { 239 } catch (e) {
275 uni.hideLoading(); 240 uni.hideLoading();
276 console.error('提交失败', e); 241 console.error('提交失败', e);
......
...@@ -108,7 +108,7 @@ async function handlePay() { ...@@ -108,7 +108,7 @@ async function handlePay() {
108 108
109 try { 109 try {
110 payLoading.value = true 110 payLoading.value = true
111 uni.showToast({ 111 uni.showLoading({
112 title: '支付中...', 112 title: '支付中...',
113 mask: true 113 mask: true
114 }) 114 })
...@@ -134,6 +134,7 @@ async function handlePay() { ...@@ -134,6 +134,7 @@ async function handlePay() {
134 // 跳转到支付成功页 134 // 跳转到支付成功页
135 135
136 } catch (err) { 136 } catch (err) {
137 console.log(err)
137 const errMsg = err?.data?.msg || err?.message || '支付失败,请稍后重试' 138 const errMsg = err?.data?.msg || err?.message || '支付失败,请稍后重试'
138 uni.showToast({ 139 uni.showToast({
139 title: errMsg, 140 title: errMsg,
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!