瀏覽代碼

Merge branch 'master' of http://git.dayaedu.com/lex/orchestra-app

mo 2 年之前
父節點
當前提交
0a5874b523

+ 13 - 8
src/constant/index.ts

@@ -15,14 +15,6 @@ export const goodsType = {
   ACTI_REGIST: '活动报名'
 }
 
-export const orderType = {
-  WAIT_PAY: '待支付',
-  PAYING: '支付中',
-  PAID: '已付款',
-  CLOSE: '已关闭',
-  FAIL: '支付失败'
-}
-
 export const returnType = {
   DOING: '审核中',
   PASS: '通过',
@@ -116,3 +108,16 @@ export const schoolSystem = {
   fiveYearSystem: '五年制',
   sixYearSystem: '六年制'
 }
+
+
+// 订单状态
+export const orderType = {
+  WAIT_PAY: '待支付',
+  PAYING: '支付中',
+  PAID: '已付款',
+  TIMEOUT: '订单超时',
+  FAIL: '支付失败',
+  CLOSED: '订单关闭',
+  REFUNDING: '退款中',
+  REFUNDED: '已退款'
+}

+ 14 - 11
src/helpers/utils.ts

@@ -32,17 +32,20 @@ export const browser = () => {
 }
 
 // 获取授权的code码
-export const getUrlCode = (name: any) => {
-  // return (
-  //   decodeURIComponent(
-  //     (new RegExp("[?|&]" + name + "=" + "([^&;]+?)(&|#|;|$)").exec(
-  //       location.href
-  //     ) || [, ""])[1].replace(/\+/g, "%20")
-  //   ) || null
-  // );
-  const reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
-  const r = window.location.search.substr(1).match(reg);  //匹配目标参数
-  if (r != null) return unescape(r[2]); return null; //返回参数值
+export const getUrlCode = () => {
+  // 截取url中的code方法
+  const url = location.search;
+  const theRequest = new Object();
+  if (url.indexOf("?") != -1) {
+    const str = url.substr(1);
+    const strs = str.split("&");
+    for (let i = 0; i < strs.length; i++) {
+      theRequest[strs[i].split("=")[0]] = strs[i].split("=")[1];
+    }
+  }
+  console.log(theRequest);
+  return theRequest;
+
 };
 
 

+ 5 - 6
src/school/train-planning/index.tsx

@@ -28,14 +28,13 @@ export default defineComponent({
               sessionStorage.setItem('trainType', val)
             }}
           >
-            <Tab title="标准训练" name="standard">
-              {tabValue.value === 'standard' && <Standard />}
-            </Tab>
-            <Tab title="乐团加练" name="practice">
-              <Practice />
-            </Tab>
+            <Tab title="标准训练" name="standard"></Tab>
+            <Tab title="乐团加练" name="practice"></Tab>
           </Tabs>
         </OSticky>
+
+        {tabValue.value === 'standard' && <Standard />}
+        {tabValue.value === 'practice' && <Practice />}
       </div>
     )
   }

+ 3 - 3
src/school/train-planning/modal/calendar/index.tsx

@@ -79,14 +79,14 @@ export default defineComponent({
   },
   mounted() {
     // 初始化标题和最大显示日期
-    this.subtitle = dayjs(this.calendarDate || '')
+    this.subtitle = dayjs(this.calendarDate || new Date())
       .add(1, 'day')
       .format('YYYY年MM月')
-    this.maxDate = dayjs(this.calendarDate || '')
+    this.maxDate = dayjs(this.calendarDate || new Date())
       .add(1, 'day')
       .endOf('month')
       .toDate()
-    this.minDate = dayjs(this.calendarDate || '')
+    this.minDate = dayjs(this.calendarDate || new Date())
       .add(1, 'day')
       .toDate()
 

+ 13 - 2
src/school/train-planning/modal/timer/index.tsx

@@ -2,7 +2,7 @@ import OHeader from '@/components/o-header'
 import item from '@/student/coupons/item'
 import dayjs from 'dayjs'
 import { Button, Cell, CellGroup, Popup, showToast, Sticky, TimePicker } from 'vant'
-import { defineComponent, onMounted, reactive } from 'vue'
+import { defineComponent, onMounted, reactive, watch } from 'vue'
 import styles from './index.module.less'
 
 export default defineComponent({
@@ -132,7 +132,14 @@ export default defineComponent({
       state.selectTimeStatus = false
     }
 
-    onMounted(() => {
+    watch(
+      () => props.timerList,
+      () => {
+        init()
+      }
+    )
+
+    const init = () => {
       console.log(props.timerList, 'timerList')
       state.calendarDate = props.timerList?.calendarDate
       const timeDetailList = props.timerList?.timeDetailList || []
@@ -160,6 +167,10 @@ export default defineComponent({
         state.minMinute = temp.startMinute
         state.maxMinute = 60
       }
+    }
+
+    onMounted(() => {
+      init()
     })
     return () => (
       <div class={styles.timer}>

+ 35 - 3
src/student/music-group/pre-apply/component/apply.tsx

@@ -2,6 +2,7 @@ import {
   Button,
   Cell,
   CellGroup,
+  Dialog,
   Field,
   Form,
   Picker,
@@ -48,7 +49,8 @@ export default defineComponent({
       classStatus: false,
       subjectStatus: false,
       pattern: /^1(3|4|5|6|7|8|9)\d{9}$/,
-      nameReg: /^[\u4E00-\u9FA5]+$/
+      nameReg: /^[\u4E00-\u9FA5]+$/,
+      subjectChangeStatus: false // 更换声部时
     })
     const forms = reactive({
       username: null,
@@ -167,7 +169,7 @@ export default defineComponent({
 
       // 判断学年制
       if (props.schoolSystem === 'sixYearSystem') {
-        state.currentGrade.push({ text: '一年级', value: 1 })
+        state.currentGrade.push({ text: '六年级', value: 6 })
       }
     })
     return () => (
@@ -181,6 +183,7 @@ export default defineComponent({
               placeholder="请填写学生真实姓名"
               inputAlign="right"
               v-model={forms.username}
+              maxlength={15}
               rules={[{ validator, message }]}
             />
             <Field
@@ -246,7 +249,13 @@ export default defineComponent({
               isLink
               placeholder="请选择声部"
               v-model={forms.registerSubjectTxt}
-              onClick={() => (state.subjectStatus = true)}
+              onClick={() => {
+                if (state.subjectList.length <= 0) {
+                  showToast('暂无报名声部')
+                  return
+                }
+                state.subjectStatus = true
+              }}
               rules={[{ required: true, message: '请选择声部' }]}
             />
           </CellGroup>
@@ -259,6 +268,7 @@ export default defineComponent({
               inputAlign="right"
               placeholder="请填写家长真实姓名"
               v-model={forms.parentName}
+              maxlength={15}
               rules={[{ required: true, message: '请填写家长真实姓名' }]}
             />
             <Field
@@ -267,6 +277,7 @@ export default defineComponent({
               inputAlign="right"
               placeholder="请输入手机号"
               v-model={forms.phone}
+              maxlength={11}
               rules={[{ pattern: state.pattern, message: '输入监护人手机号码有误' }]}
             />
           </CellGroup>
@@ -320,6 +331,27 @@ export default defineComponent({
             }}
           />
         </Popup>
+
+        <Dialog
+          v-model:show={state.subjectChangeStatus}
+          message={'您修改了乐团声部,若确认更换,请先将原声部订单退款,完成后修改声部重新缴费。'}
+          messageAlign="left"
+          confirmButtonText="去退款"
+          cancelButtonText="选错了"
+          showCancelButton
+          onConfirm={() => {
+            console.log('223')
+          }}
+        >
+          {{
+            title: () => (
+              <div class={styles.dialogTitle}>
+                <i></i>
+                课程冲突
+              </div>
+            )
+          }}
+        </Dialog>
       </>
     )
   }

+ 131 - 60
src/student/music-group/pre-apply/component/order.tsx

@@ -1,71 +1,142 @@
-import { Button, Cell, CellGroup, Grid, GridItem, Image } from 'vant'
-import { defineComponent, ref } from 'vue'
+import OEmpty from '@/components/o-empty'
+import { orderType } from '@/constant'
+import { moneyFormat } from '@/helpers/utils'
+import { Button, Cell, CellGroup, Grid, GridItem, Image, List } from 'vant'
+import { defineComponent, onMounted, reactive, ref } from 'vue'
+import { useRoute } from 'vue-router'
+import request from '../../request-music'
 import styles from '../index.module.less'
 
 export default defineComponent({
   name: 'order',
   emits: ['next'],
   setup() {
-    const s = ref(true)
+    const route = useRoute()
+    const form = reactive({
+      isClick: false,
+      list: [] as any,
+      listState: {
+        dataShow: true, // 判断是否有数据
+        loading: false,
+        finished: false
+      },
+      params: {
+        page: 1,
+        rows: 20
+      }
+    })
+
+    // userPaymentOrder/page
+    const getList = async () => {
+      try {
+        if (form.isClick) return
+        form.isClick = true
+        const res = await request.post('/api-student/userPaymentOrder/page', {
+          data: {
+            ...form.params,
+            bizId: route.query.id
+          }
+        })
+        form.listState.loading = false
+        const result = res.data || {}
+        // 处理重复请求数据
+        if (form.list.length > 0 && result.current === 1) {
+          return
+        }
+        form.list = form.list.concat(result.rows || [])
+        form.listState.finished = result.current >= result.pages
+        form.params.page = result.current + 1
+        form.listState.dataShow = form.list.length > 0
+        form.isClick = false
+      } catch {
+        form.listState.dataShow = false
+        form.listState.finished = true
+        form.isClick = false
+      }
+    }
+
+    onMounted(() => {
+      getList()
+    })
+
     return () => (
       <div style={{ paddingTop: '20px' }}>
-        {[1, 2, 3, 4, 5].map((item: any) => (
-          <CellGroup inset class={styles.orderCellGroup}>
-            <Cell
-              title={'2021-09-08 13:23:43'}
-              titleClass={styles.payTime}
-              value={'待缴费'}
-              valueClass={s.value ? styles.payStatus : styles.paySuccess}
-            ></Cell>
-            <Cell border={false} class={styles.imgGroup}>
-              {{
-                title: () => (
-                  <Grid border={false}>
-                    <GridItem>
-                      <Image
-                        class={styles.img}
-                        src="https://daya.ks3-cn-beijing.ksyuncs.com/12/1670231208704.png"
-                      />
-                    </GridItem>
-                    <GridItem>
-                      <Image
-                        class={styles.img}
-                        src="https://daya.ks3-cn-beijing.ksyuncs.com/12/1670231208704.png"
-                      />
-                    </GridItem>
-                    <GridItem>
-                      <Image
-                        class={styles.img}
-                        src="https://daya.ks3-cn-beijing.ksyuncs.com/12/1670231208704.png"
-                      />
-                    </GridItem>
-                    {/* <GridItem>
-                    <Image
-                      class={styles.img}
-                      src="https://daya.ks3-cn-beijing.ksyuncs.com/12/1670231208704.png"
-                    />
-                  </GridItem> */}
-                  </Grid>
-                )
-              }}
-            </Cell>
-            <Cell class={styles.btnGroup} center>
-              {{
-                title: () => <span class={styles.btnPrice}>¥3,860.00</span>,
-                value: () => (
-                  <div class={styles.btns}>
-                    <Button round plain color="#AAAAAA">
-                      修改订单
-                    </Button>
-                    <Button round plain color="#FF8057">
-                      继续支付
-                    </Button>
-                  </div>
-                )
-              }}
-            </Cell>
-          </CellGroup>
-        ))}
+        {form.listState.dataShow ? (
+          <List
+            v-model:loading={form.listState.loading}
+            finished={form.listState.finished}
+            finishedText=" "
+            class={[styles.liveList]}
+            onLoad={getList}
+            immediateCheck={false}
+          >
+            {form.list.map((item: any) => (
+              <CellGroup inset class={styles.orderCellGroup}>
+                <Cell
+                  title={item.createTime}
+                  titleClass={styles.payTime}
+                  value={orderType[item.status]}
+                  valueClass={
+                    item.status === 'WAIT_PAY'
+                      ? styles.payStatus
+                      : item.status === 'PAID'
+                      ? styles.paySuccess
+                      : ''
+                  }
+                ></Cell>
+                <Cell border={false} class={styles.imgGroup}>
+                  {{
+                    title: () => (
+                      <Grid border={false}>
+                        <GridItem>
+                          <Image
+                            class={styles.img}
+                            src="https://daya.ks3-cn-beijing.ksyuncs.com/12/1670231208704.png"
+                          />
+                        </GridItem>
+                        <GridItem>
+                          <Image
+                            class={styles.img}
+                            src="https://daya.ks3-cn-beijing.ksyuncs.com/12/1670231208704.png"
+                          />
+                        </GridItem>
+                        <GridItem>
+                          <Image
+                            class={styles.img}
+                            src="https://daya.ks3-cn-beijing.ksyuncs.com/12/1670231208704.png"
+                          />
+                        </GridItem>
+                      </Grid>
+                    )
+                  }}
+                </Cell>
+                <Cell class={styles.btnGroup} center>
+                  {{
+                    title: () => (
+                      <span class={styles.btnPrice}>¥{moneyFormat(item.currentPrice)}</span>
+                    ),
+                    value: () => (
+                      <div class={styles.btns}>
+                        {item.status === 'WAIT_PAY' && (
+                          <>
+                            <Button round plain color="#AAAAAA">
+                              修改订单
+                            </Button>
+                            <Button round plain color="#FF8057">
+                              继续支付
+                            </Button>
+                          </>
+                        )}
+                      </div>
+                    )
+                  }}
+                </Cell>
+              </CellGroup>
+            ))}
+          </List>
+        ) : (
+          <OEmpty btnStatus={false} classImgSize="SMALL" tips="暂无订单" />
+        )}
       </div>
     )
   }

+ 43 - 8
src/student/music-group/pre-apply/component/payment.tsx

@@ -1,6 +1,6 @@
 import OSticky from '@/components/o-sticky'
 import { Button, Cell, CellGroup, Checkbox, CheckboxGroup, Icon, Image, showToast, Tag } from 'vant'
-import { defineComponent, nextTick, onMounted, reactive } from 'vue'
+import { defineComponent, nextTick, onMounted, reactive, ref } from 'vue'
 import styles from '../index.module.less'
 import radioCheck from '@/common/images/icon-radio-check.png'
 import radioDefault from '@/common/images/icon-radio-default.png'
@@ -71,6 +71,7 @@ export default defineComponent({
     }
 
     // 初始化金额
+
     const calcPrice = () => {
       const details = state.details
       const tempPrice = {
@@ -89,12 +90,33 @@ export default defineComponent({
 
       initNumCountUp()
     }
-
+    const countUpRef = reactive({
+      needPrice: null as any,
+      originalPrice: null as any
+    })
     const initNumCountUp = () => {
       nextTick(() => {
         // 在读学生
-        new CountUp('needPrice', state.orderInfo.needPrice).start()
-        new CountUp('originalPrice', state.orderInfo.originalPrice).start()
+        if (countUpRef.needPrice) {
+          countUpRef.needPrice.update(state.orderInfo.needPrice)
+        } else {
+          countUpRef.needPrice = new CountUp('needPrice', state.orderInfo.needPrice)
+          if (!countUpRef.needPrice.error) {
+            countUpRef.needPrice.start()
+          } else {
+            console.error(countUpRef.needPrice.error)
+          }
+        }
+        if (countUpRef.originalPrice) {
+          countUpRef.originalPrice.update(state.orderInfo.originalPrice)
+        } else {
+          countUpRef.originalPrice = new CountUp('originalPrice', state.orderInfo.originalPrice)
+          if (!countUpRef.originalPrice.error) {
+            countUpRef.originalPrice.start()
+          } else {
+            console.error(countUpRef.originalPrice.error)
+          }
+        }
       })
     }
 
@@ -136,20 +158,24 @@ export default defineComponent({
             orderType: 'ORCHESTRA',
             paymentCashAmount: state.orderInfo.needPrice || 0,
             paymentCouponAmount: 0,
-            goodsInfos: params
+            goodsInfos: params,
+            orderName: '订单详情',
+            orderDesc: '订单详情'
           }
         })
 
+        console.log(data)
         router.push({
           path: '/orderDetail',
           query: {
-            config: JSON.parse(data.paymentConfig),
+            config: JSON.stringify(data.paymentConfig),
             orderNo: data.orderNo,
             id: route.query.id
           }
         })
-      } catch {
+      } catch (e: any) {
         //
+        console.log(e)
       }
       // router.push('/orderDetail')
     }
@@ -167,7 +193,13 @@ export default defineComponent({
           </p>
         </div>
 
-        <CheckboxGroup v-model={state.check} style={{ paddingBottom: '20px' }}>
+        <CheckboxGroup
+          v-model={state.check}
+          style={{ paddingBottom: '20px' }}
+          onChange={() => {
+            calcPrice()
+          }}
+        >
           <div class={styles.applyTitle}>乐器</div>
           <CellGroup
             inset
@@ -299,6 +331,9 @@ export default defineComponent({
                     name={state.vipInfo.goodsId}
                     class={styles.checkbox}
                     ref={(el: any) => (state.checkboxRefs[state.vipInfo.goodsId] = el)}
+                    onClick={(e: Event) => {
+                      e.stopPropagation()
+                    }}
                     v-slots={{
                       icon: (props: any) => (
                         <Icon

二進制
src/student/music-group/pre-apply/images/download.png


二進制
src/student/music-group/pre-apply/images/icon-close.png


+ 24 - 0
src/student/music-group/pre-apply/index.module.less

@@ -175,6 +175,10 @@
       background-color: transparent;
       opacity: 0.6;
     }
+    .van-checkbox__icon--checked .van-icon {
+      border-color: transparent;
+      background-color: transparent;
+    }
   }
 }
 .section {
@@ -217,6 +221,7 @@
 .payTime {
   font-size: 16px;
   color: #777777;
+  flex: 0 auto;
 }
 .payStatus {
   color: #ff4e19;
@@ -267,3 +272,22 @@
     display: flex;
   }
 }
+
+.dialogTitle {
+  i {
+    display: inline-block;
+    width: 4px;
+    height: 14px;
+    background: #ff8057;
+    border-radius: 2px;
+    margin-right: 6px;
+  }
+
+  padding-left: 25px;
+  text-align: left;
+  font-size: 18px;
+  font-weight: 500;
+  color: #333333;
+  line-height: 25px;
+  padding-bottom: 12px;
+}

+ 39 - 9
src/student/music-group/pre-apply/index.tsx

@@ -1,18 +1,19 @@
 import { defineComponent, onMounted, reactive, ref } from 'vue'
-import { Image, Sticky, Tab, Tabs } from 'vant'
+import { Image, showDialog, Sticky, Tab, Tabs } from 'vant'
 import styles from './index.module.less'
-import { useRect } from '@vant/use'
+// import { useRect } from '@vant/use'
 import Apply from './component/apply'
 import Payment from './component/payment'
 import Order from './component/order'
-import { useRoute } from 'vue-router'
+import { useRoute, useRouter } from 'vue-router'
 import request from '../request-music'
-// import banner from './images/banner.png'
+import { setLogout } from '../state-music'
 
 export default defineComponent({
   name: 'pre-apply',
   setup() {
     const route = useRoute()
+    const router = useRouter()
     const bannerRef = ref()
     const state = reactive({
       tabValue: 'apply',
@@ -32,13 +33,42 @@ export default defineComponent({
         )
         state.registerInfo = data || {}
 
-        if (state.registerInfo.register) {
+        // 判断是否报名注册过
+        if (data.register) {
           state.tabValue = 'payment'
         }
 
-        if (state.registerInfo.purchase) {
+        // 	购买状态, 判断是否已经购买完了
+        if (data.purchase) {
           state.tabValue = 'order'
-          state.purchase = state.registerInfo.purchase
+          state.purchase = data.purchase
+        }
+
+        // INITIATION_SURVEY: '启蒙调查',
+        // PRE_REGISTER: '预报名',
+        // REGISTER: '乐团报名',
+        // DOING: '乐团交付',
+        // DONE: '已交付'
+        // CLOSE: '已交付'
+        // 判断乐团报名,只有 乐团报名 乐团交付 已交付才可以报名
+        const oStatus = data.status // 乐团状态
+        if (oStatus !== 'REGISTER' && oStatus !== 'DOING' && oStatus !== 'DONE') {
+          showDialog({
+            title: '提示',
+            message: '乐团建设中,请稍等'
+          }).then(() => {
+            setLogout()
+
+            const query = {
+              returnUrl: route.path,
+              ...route.query
+            } as any
+            router.replace({
+              path: '/loginMusic',
+              query: query
+            })
+          })
+          return
         }
       } catch {
         //
@@ -49,8 +79,8 @@ export default defineComponent({
     getRegisterStatus()
 
     onMounted(() => {
-      const { height } = useRect(bannerRef.value)
-      state.heightV = height
+      // const { height } = useRect(bannerRef.value)
+      // state.heightV = height
     })
     return () => (
       <div class={styles.preApply}>

+ 43 - 18
src/student/music-group/pre-apply/order-detail.module.less

@@ -94,18 +94,26 @@
 }
 
 .codeContainer {
+  position: relative;
+  .codeClose {
+    display: inline-block;
+    position: absolute;
+    top: -55px;
+    right: 0;
+    background: url('./images/icon-close.png') no-repeat center center;
+    background-size: contain;
+    width: 35px;
+    height: 35px;
+  }
+
   .codeImg {
-    width: 323px;
-    height: 465px;
+    width: 331px;
+    height: 557px;
     // padding-left: 8px;
-    background: url('../images/download.png') no-repeat center center;
+    background: url('./images/download.png') no-repeat center center;
     background-size: contain;
     margin: 0 auto;
 
-    .codeContent {
-      padding-left: 8px;
-    }
-
     .codeTitle {
       text-align: center;
       padding-top: 13px;
@@ -116,16 +124,17 @@
     }
 
     .codeName {
-      padding: 40px 12px 0;
-      font-size: 18px;
+      padding: 38px 12px 0;
+      font-size: 16px;
       font-weight: 600;
       color: #ffffff;
       text-align: center;
     }
     .codeQr {
       margin: 23px auto 0;
-      width: 241px;
-      height: 241px;
+      width: 221px;
+      height: 221px;
+      padding: 10px;
       background: linear-gradient(180deg, #ffffff 0%, #ffffff 100%);
       border-radius: 11px;
       overflow: hidden;
@@ -136,23 +145,39 @@
     }
 
     .codeBtnText {
+      min-width: 240px;
       margin: 15px auto 0;
       display: inline-block;
       background: linear-gradient(135deg, #ff9c63 0%, #ff7144 100%);
       border-radius: 18px;
-      padding: 6px 16px;
+      padding: 6px 0;
       font-size: 16px;
       font-weight: 600;
       color: #ffffff;
     }
 
     .codeTips {
-      padding-top: 10px;
-      font-size: 13px;
-      font-weight: 600;
-      color: #f16437;
-      line-height: 18px;
-      text-align: center;
+      width: 285px;
+      box-sizing: border-box;
+      font-size: 12px;
+      font-weight: 500;
+      color: #333333;
+      line-height: 17px;
+      background: #ffffff;
+
+      overflow: hidden;
+      border: 2px solid rgba(255, 140, 87, 1);
+      // border-image: linear-gradient(133deg, rgba(255, 140, 87, 1), rgba(255, 128, 87, 1)) 2 2;
+      border-radius: 10px;
+      margin: 15px auto 0;
+      padding: 10px 0px 10px 8px;
+
+      .tipsTitle {
+        font-size: 13px;
+        font-weight: 500;
+        color: #f16437;
+        padding-bottom: 2px;
+      }
     }
   }
   .close {

+ 105 - 45
src/student/music-group/pre-apply/order-detail.tsx

@@ -1,5 +1,5 @@
 import OHeader from '@/components/o-header'
-import { defineComponent, reactive } from 'vue'
+import { defineComponent, onMounted, reactive } from 'vue'
 import styles from './order-detail.module.less'
 import Addres from './component/addres'
 import OSticky from '@/components/o-sticky'
@@ -7,6 +7,9 @@ import { Button, Cell, CellGroup, Image, Popup, Tag } from 'vant'
 import Payment from '@/views/adapay/payment'
 import { useRoute, useRouter } from 'vue-router'
 import OQrcode from '@/components/o-qrcode'
+import request from '../request-music'
+import item from '@/student/coupons/item'
+import { moneyFormat } from '@/helpers/utils'
 
 export default defineComponent({
   name: 'order-detail',
@@ -15,11 +18,35 @@ export default defineComponent({
     const router = useRouter()
     const state = reactive({
       paymentStatus: false,
-      showQrcode: false
+      showQrcode: false,
+      orderNo: route.query.orderNo,
+      orderInfo: {} as any, // 订单信息
+      goodsInfos: [] as any // 订单信息列表
     })
+
+    const getOrderDetails = async () => {
+      try {
+        const { data } = await request.get('/api-student/userPaymentOrder/detail/' + state.orderNo)
+        console.log(data)
+        const goodsInfos = data.goodsInfos || []
+        state.orderInfo = data
+        goodsInfos.forEach((item: any) => {
+          const img = item.goodsUrl ? item.goodsUrl.split(',')[0] : ''
+          item.goodsUrl = img
+        })
+        state.goodsInfos = goodsInfos
+      } catch {
+        //
+      }
+    }
+
     const onSubmit = () => {
       state.paymentStatus = true
     }
+
+    onMounted(() => {
+      getOrderDetails()
+    })
     return () => (
       <>
         <OHeader />
@@ -29,42 +56,26 @@ export default defineComponent({
           </div>
 
           <CellGroup style={{ margin: 0 }}>
-            <Cell class={styles.cellItem} center>
-              {{
-                icon: () => (
-                  <Image
-                    class={styles.img}
-                    src="https://daya.ks3-cn-beijing.ksyuncs.com/12/1670231208704.png"
-                  />
-                ),
-                title: () => (
-                  <div class={styles.goodsContent}>
-                    <h2>长笛标准配置</h2>
-                    <Tag type="primary">品牌型号</Tag>
-                    <p class={styles.goodsNum}>x 1</p>
-                  </div>
-                ),
-                value: () => <span class={styles.cellPrice}>1212</span>
-              }}
-            </Cell>
-            <Cell class={styles.cellItem} center>
-              {{
-                icon: () => (
-                  <Image
-                    class={styles.img}
-                    src="https://daya.ks3-cn-beijing.ksyuncs.com/12/1670231208704.png"
-                  />
-                ),
-                title: () => (
-                  <div class={styles.goodsContent}>
-                    <h2>长笛标准配置长笛标准配置</h2>
-                    <Tag type="primary">品牌型号</Tag>
-                    <p class={styles.goodsNum}>x 1</p>
-                  </div>
-                ),
-                value: () => <span class={styles.cellPrice}>1212</span>
-              }}
-            </Cell>
+            {state.goodsInfos &&
+              state.goodsInfos.map((goods: any) => (
+                <Cell class={styles.cellItem} center>
+                  {{
+                    icon: () => <Image class={styles.img} src={goods.goodsUrl} />,
+                    title: () => (
+                      <div class={styles.goodsContent}>
+                        <h2>{goods.goodsName}</h2>
+                        <Tag type="primary">{goods.brandName}</Tag>
+                        <p class={styles.goodsNum}>x 1</p>
+                      </div>
+                    ),
+                    value: () => (
+                      <span class={styles.cellPrice}>
+                        {goods.currentPrice > 0 ? moneyFormat(goods.currentPrice) : '赠送'}
+                      </span>
+                    )
+                  }}
+                </Cell>
+              ))}
           </CellGroup>
         </div>
 
@@ -72,7 +83,7 @@ export default defineComponent({
           <div class={styles.paymentContainer}>
             <div class={styles.payemntPrice}>
               <p class={styles.needPrice}>
-                共需支付:<span>¥3,860.00</span>
+                共需支付:<span>¥{moneyFormat(state.orderInfo.currentPrice)}</span>
               </p>
             </div>
             <div class={styles.paymentBtn}>
@@ -97,34 +108,83 @@ export default defineComponent({
           style={{ minHeight: '30%' }}
         >
           <Payment
-            paymentConfig={{}}
+            paymentConfig={state.orderInfo}
             onClose={() => (state.paymentStatus = false)}
             onBackOut={() => {
               console.log('back')
               // router.back()
             }}
+            onConfirm={(val: any) => {
+              const config: any = route.query.config ? JSON.parse(route.query.config as any) : {}
+              // let a = {
+              //   paymentChannel: null,
+              //   merOrderNo: '1607581937480556546',
+              //   subject: '华为+HUAWEI+P20+1,JM测试数据511,乐器保养',
+              //   body: '华为+HUAWEI+P20+1,JM测试数据511,乐器保养',
+              //   addition: null,
+              //   price: 3798,
+              //   bankType: null,
+              //   code: null,
+              //   expirationTime: '2022-12-27+12:09:36',
+              //   wxAppId: 'wx8654c671631cfade',
+              //   userId: null
+              // }
+              if (val.payCode === 'payResult') {
+                router.push({
+                  path: '/payResult',
+                  query: {
+                    pay_channel: val.pay_channel,
+                    wxAppId: config.wxAppId,
+                    body: config.body,
+                    price: config.price
+                  }
+                })
+              } else {
+                router.push({
+                  path: '/payCenter',
+                  query: {
+                    pay_channel: val.pay_channel,
+                    wxAppId: config.wxAppId,
+                    body: config.body,
+                    price: config.price
+                  }
+                })
+              }
+            }}
           />
         </Popup>
 
         <Popup
           v-model:show={state.showQrcode}
-          position="bottom"
-          style={{ background: 'transparent' }}
+          // position="bottom"
+          style={{ background: 'transparent', overflow: 'initial' }}
           safeAreaInsetBottom={true}
         >
           <div class={styles.codeContainer}>
+            <i class={styles.codeClose} onClick={() => (state.showQrcode = false)}></i>
             <div class={styles.codeImg}>
               <div class={styles.codeContent}>
                 <h2 class={styles.codeTitle}>乐团报名</h2>
-                <div class={styles.codeName}>武汉小学2022上学期团武汉小学</div>
+                <div class={styles.codeName}>请截图下方二维码 登录支付宝扫码支付</div>
 
                 <div class={styles.codeQr}>
                   <OQrcode text="http://ponline.dayaedu.com/" size={'400'} />
                 </div>
                 <div style={{ textAlign: 'center' }}>
-                  <span class={styles.codeBtnText}>扫描上方二维码完成资料填写</span>
+                  <span class={styles.codeBtnText}>请在30分钟内扫码支付</span>
+                </div>
+                <div class={styles.codeTips}>
+                  <div class={styles.tipsTitle}>使用说明:</div>
+                  <div class={styles.tipsContent}>
+                    1.长按二维码保存图片到相册(或截屏保存到相册)
+                    <br />
+                    2.打开支付宝扫一扫
+                    <br />
+                    3.选择相册中的二维码
+                    <br />
+                    4.请在30分钟内扫码支付
+                  </div>
                 </div>
-                <div class={styles.codeTips}>二维码将在两小时后失效,请及时登记</div>
               </div>
             </div>
           </div>

+ 1 - 1
src/views/adapay/pay-center/index.tsx

@@ -21,7 +21,7 @@ export default defineComponent({
       if (browser().weixin) {
         if (payType === 'wx_pub') {
           //授权
-          const code = getUrlCode('code')
+          const code = getUrlCode()
           if (code) {
             state.code = code // 赋值code码
             onPayPage() // 跳转支付页

+ 1 - 1
src/views/adapay/pay-define/index.tsx

@@ -226,7 +226,7 @@ export default defineComponent({
       if (browser().weixin) {
         if (payType === 'wx_pub') {
           //授权
-          const code = getUrlCode('code')
+          const code = getUrlCode()
           if (code) {
             state.code = code // 赋值code码
           }

+ 2 - 2
src/views/adapay/pay-result/index.tsx

@@ -193,11 +193,11 @@ export default defineComponent({
     const getWxPay = () => {
       // 微信公众号支付
       //授权
-      const code = getUrlCode('code')
+      const code = getUrlCode()
       if (!code) {
         goAuth()
       } else {
-        state.code = code
+        // state.code = code
         getPayment()
       }
     }

+ 6 - 2
src/views/adapay/payment/index.tsx

@@ -72,7 +72,11 @@ export default defineComponent({
 
     const getCodePay = (code) => {
       // 二维码页面, 唤起支付页面
-      const payCode = code == 'qrCode' ? '/payQRCode' : '/payResult'
+      const payCode = code == 'qrCode' ? 'payCenter' : 'payResult'
+      emit('confirm', {
+        payCode,
+        pay_channel: state.pay_channel
+      })
     }
     return () => (
       <div class={styles.payment}>
@@ -82,7 +86,7 @@ export default defineComponent({
         <div class={styles.payAmount}>
           <p>应付金额</p>
           <div class={styles.amount}>
-            {moneyFormat(20)}
+            {moneyFormat(props.paymentConfig.currentPrice)}
             <span>元</span>
           </div>
         </div>