Forráskód Böngészése

去掉多余的东西

lex 2 éve
szülő
commit
b1ca02530b

+ 33 - 35
src/views/adapay/use-coupons/choice-coupon.tsx

@@ -1,10 +1,10 @@
-import OEmpty from '@/components/o-empty'
-import request from '@/helpers/request'
-import { state } from '@/state'
+import OEmpty from '@/components/m-empty';
+import request from '@/helpers/request';
+import { state } from '@/state';
 // import Item from '@/views/coupons/item'
-import { Button, Loading } from 'vant'
-import { defineComponent } from 'vue'
-import styles from './index.module.less'
+import { Button, Loading } from 'vant';
+import { defineComponent } from 'vue';
+import styles from './index.module.less';
 
 export default defineComponent({
   name: 'choice-coupon',
@@ -32,12 +32,12 @@ export default defineComponent({
       list: [] as any,
       // consumeAmount: 0 // 消耗金额
       dataLoading: false
-    }
+    };
   },
   computed: {
     // 使用优惠券的数量
     useLength() {
-      return this.list.filter((list: any) => list.checked).length || 0
+      return this.list.filter((list: any) => list.checked).length || 0;
     }
   },
   async mounted() {
@@ -47,14 +47,14 @@ export default defineComponent({
     this.couponList.forEach((item: any) => {
       this.useCoupon.forEach((coupon: any) => {
         if (item.couponIssueId === coupon.couponIssueId) {
-          item.checked = true
+          item.checked = true;
         }
-      })
-    })
-    const canUsable = this.couponList.filter((list: any) => !list.disabled)
-    const canUsed = this.couponList.filter((list: any) => list.disabled)
-    this.list = [...canUsable, ...canUsed]
-    this.calcCoupon()
+      });
+    });
+    const canUsable = this.couponList.filter((list: any) => !list.disabled);
+    const canUsed = this.couponList.filter((list: any) => list.disabled);
+    this.list = [...canUsable, ...canUsed];
+    this.calcCoupon();
   },
   methods: {
     // async getList() {
@@ -108,39 +108,39 @@ export default defineComponent({
       this.$emit(
         'submit',
         this.list.filter((list: any) => list.checked)
-      )
+      );
 
       this.list.forEach((item: any) => {
-        item.checked = false
-      })
+        item.checked = false;
+      });
     },
     onSelect(item: any) {
-      item.checked = !item.checked
-      this.calcCoupon()
+      item.checked = !item.checked;
+      this.calcCoupon();
     },
     calcCoupon() {
       // 计算优惠券
       // 已使用的优惠券
-      const useList = this.list.filter((list: any) => list.checked)
+      const useList = this.list.filter((list: any) => list.checked);
       const limitCount = useList.map((list: any) => {
-        return Number(list.useLimit || 0)
-      })
+        return Number(list.useLimit || 0);
+      });
       const usePrice =
         limitCount.length > 0
           ? limitCount.reduce((sum: any, list: any) => {
-              return sum + list
+              return sum + list;
             })
-          : 0
+          : 0;
       // 使用优惠券后,可判断的金额
-      const useLastAmount = this.orderAmount - usePrice
+      const useLastAmount = this.orderAmount - usePrice;
       // 判断使用优惠券之后还有没有其它优惠券可用
       this.list.forEach((item: any) => {
         if (Number(item.useLimit) > useLastAmount && !item.checked) {
-          item.disabled = true
+          item.disabled = true;
         } else {
-          item.disabled = false
+          item.disabled = false;
         }
-      })
+      });
     }
   },
   render() {
@@ -170,8 +170,7 @@ export default defineComponent({
               size={48}
               color="#2dc7aa"
               vertical
-              style={{ height: '100%', justifyContent: 'center' }}
-            >
+              style={{ height: '100%', justifyContent: 'center' }}>
               加载中...
             </Loading>
           )}
@@ -185,12 +184,11 @@ export default defineComponent({
             type="primary"
             round
             style={{ minWidth: '105px', fontSize: '16px' }}
-            onClick={this.onSubmit}
-          >
+            onClick={this.onSubmit}>
             确定
           </Button>
         </div>
       </div>
-    )
+    );
   }
-})
+});

+ 46 - 48
src/views/adapay/use-coupons/index.tsx

@@ -1,9 +1,9 @@
-import request from '@/helpers/request'
-import { state } from '@/state'
-import { Cell, Popup } from 'vant'
-import { defineComponent } from 'vue'
-import ChoiceCoupon from './choice-coupon'
-import styles from './index.module.less'
+import request from '@/helpers/request';
+import { state } from '@/state';
+import { Cell, Popup } from 'vant';
+import { defineComponent } from 'vue';
+import ChoiceCoupon from './choice-coupon';
+import styles from './index.module.less';
 
 /*
  * 订单类型对应优惠券类型
@@ -18,7 +18,7 @@ export const couponEnum = {
   LIVE: 'LIVE',
   VIDEO: 'VIDEO',
   ALBUM: 'ALBUM'
-}
+} as any;
 
 export default defineComponent({
   name: 'use-conpon',
@@ -51,41 +51,41 @@ export default defineComponent({
       useCouponCount: 0,
       dataLoading: false,
       list: [] as any
-    }
+    };
   },
   computed: {
     couponCount() {
       const limitCount = this.useCouponList.map((list: any) => {
-        return Number(list.discountPrice || 0)
-      })
-      let count = 0
+        return Number(list.discountPrice || 0);
+      });
+      let count = 0;
       if (this.disabled) {
-        count = this.discountPrice
+        count = this.discountPrice;
       } else {
         count =
           limitCount.length > 0
             ? limitCount.reduce((sum: any, list: any) => {
-                return sum + list
+                return sum + list;
               })
-            : 0
+            : 0;
       }
-      return count
+      return count;
     },
     couponCategory() {
       // 如果订单类型不在优惠券类型里面,则默认查询通用券
-      return couponEnum[this.orderType] || 'UNIVERSAL'
+      return couponEnum[this.orderType] || 'UNIVERSAL';
     }
   },
   mounted() {
     // this.getUseableCoupon()
-    this.getList()
+    this.getList();
   },
   methods: {
     async getList() {
-      if (this.dataLoading) return
-      this.dataLoading = true
+      if (this.dataLoading) return;
+      this.dataLoading = true;
       try {
-        const res = await request.post(`${state.platformApi}/couponInfo/page`, {
+        const res = await request.post(`/edu-app/couponInfo/page`, {
           data: {
             couponCategory: this.couponCategory,
             couponType: 'FULL_DISCOUNT',
@@ -94,32 +94,32 @@ export default defineComponent({
             page: 1,
             rows: 100
           }
-        })
-        this.dataLoading = false
-        const result = res.data || {}
+        });
+        this.dataLoading = false;
+        const result = res.data || {};
         // 处理重复请求数据
-        if (this.list.length > 0 && result.pageNo === 1) return
-        this.list = result.rows || []
+        if (this.list.length > 0 && result.pageNo === 1) return;
+        this.list = result.rows || [];
 
         // 处理可用优惠券是否支付使用
         this.list.forEach((item: any) => {
-          item.checked = false
+          item.checked = false;
           // 如果使用金额大于订单金额则优惠券不可用
           if (item.useLimit > this.orderAmount) {
-            item.disabled = true
+            item.disabled = true;
           } else {
-            item.disabled = false
+            item.disabled = false;
           }
-        })
+        });
 
-        let count = 0
+        let count = 0;
         this.list.forEach((item: any) => {
           if (!item.disabled) {
-            count++
+            count++;
           }
-        })
-        console.log(this.list, 'list')
-        this.useCouponCount = count
+        });
+        console.log(this.list, 'list');
+        this.useCouponCount = count;
       } catch {
         //
       }
@@ -142,10 +142,10 @@ export default defineComponent({
     // },
     onSubmit(item: any) {
       // useCouponList
-      this.useCouponList = item
-      this.$emit('couponSelect', item)
-      this.popupStatus = false
-      this.popupLoading = false
+      this.useCouponList = item;
+      this.$emit('couponSelect', item);
+      this.popupStatus = false;
+      this.popupLoading = false;
     }
   },
   render() {
@@ -179,11 +179,10 @@ export default defineComponent({
               )
           }}
           onClick={() => {
-            if (this.disabled) return
-            this.popupStatus = true
-            this.popupLoading = true
-          }}
-        ></Cell>
+            if (this.disabled) return;
+            this.popupStatus = true;
+            this.popupLoading = true;
+          }}></Cell>
 
         <Popup
           v-model:show={this.popupStatus}
@@ -192,9 +191,8 @@ export default defineComponent({
           safeAreaInsetBottom={true}
           style={{ height: '75%' }}
           onClosed={() => {
-            this.popupLoading = false
-          }}
-        >
+            this.popupLoading = false;
+          }}>
           {/* 优化体验 */}
           {this.popupLoading && (
             <ChoiceCoupon
@@ -208,6 +206,6 @@ export default defineComponent({
           )}
         </Popup>
       </>
-    )
+    );
   }
-})
+});

+ 0 - 410
src/views/student-register/component/apply.tsx

@@ -1,410 +0,0 @@
-import request from '@/helpers/request'
-import {
-  Button,
-  CellGroup,
-  Dialog,
-  Field,
-  Form,
-  Picker,
-  Popup,
-  Radio,
-  RadioGroup,
-  showToast,
-  Tag
-} from 'vant'
-import { defineComponent, onMounted, reactive } from 'vue'
-import { useRoute, useRouter } from 'vue-router'
-import styles from '../index.module.less'
-import { setLogout } from '@/state'
-
-// 乐团交付,乐团停止或关闭,有新的交付团;则不允许报名
-const classList: any = []
-for (let i = 1; i <= 40; i++) {
-  classList.push({ text: i + '班', value: i })
-}
-
-export default defineComponent({
-  name: 'apply',
-  props: {
-    schoolSystem: {
-      type: String,
-      default: 'sixYearSystem' // 默认为六年制
-    },
-    registerInfo: {
-      type: Object,
-      defualt: {}
-    },
-    code: {
-      type: String,
-      default: ''
-    }
-  },
-  emits: ['next'],
-  setup(props, { slots, attrs, emit }) {
-    const route = useRoute()
-    const router = useRouter()
-    const state = reactive({
-      // code: '' as any, // 微信授权code码
-      detail: {} as any, // 学员详情
-      currentGrade: [
-        { text: '一年级', value: 1 },
-        { text: '二年级', value: 2 },
-        { text: '三年级', value: 3 },
-        { text: '四年级', value: 4 },
-        { text: '五年级', value: 5 }
-      ], // 年级数组列表
-      classList: classList,
-      subjectList: [] as any, // 声部列表
-      gradeStatus: false,
-      classStatus: false,
-      subjectStatus: false,
-      pattern: /^1(3|4|5|6|7|8|9)\d{9}$/,
-      nameReg: /^[\u4E00-\u9FA5]+$/,
-      subjectChangeStatus: false // 更换声部时
-    })
-    const forms = reactive({
-      username: null,
-      sex: null as any,
-      currentGrade: null,
-      currentGradeTxt: null, // 年级编号
-      currentClass: '', // 班级
-      currentClassTxt: null, // 年级编号
-      registerSubjectId: '',
-      registerSubjectTxt: null, // 所在声部
-      parentName: null,
-      phone: null
-    })
-
-    // 获取乐团报名信息
-    const studentRegister = async () => {
-      try {
-        const { data } = await request.get(
-          '/api-student/orchestraRegister/register/' + route.query.id
-        )
-        const detail = data || {}
-
-        state.detail = detail
-
-        const grade: any = state.currentGrade.find((item: any) => item.value == detail.currentGrade)
-        const cls: any = state.classList.find((item: any) => item.value == detail.currentClass)
-        const subjects: any = state.subjectList.find(
-          (item: any) => item.value == detail.registerSubjectId
-        )
-        forms.username = detail.username
-        forms.sex = detail.sex ? 1 : 0
-        forms.currentGrade = detail.currentGrade
-        forms.currentGradeTxt = grade ? grade.text : ''
-        forms.currentClass = detail.currentClass
-        forms.currentClassTxt = cls ? cls.text : ''
-        forms.registerSubjectId = detail.registerSubjectId
-        forms.registerSubjectTxt = subjects ? subjects.text : ''
-        forms.parentName = detail.parentName
-        forms.phone = detail.phone
-      } catch (e) {
-        //
-        console.log(e)
-      }
-    }
-
-    // 获取声部信息
-    const getSubjects = async () => {
-      try {
-        const subjects = await request.post(
-          '/api-student/open/orchestraSubjectConfig/pageByOrchestraId',
-          {
-            data: {
-              orchestraId: route.query.id,
-              page: 1,
-              rows: 100
-            }
-          }
-        )
-        const rows = subjects.data.rows || []
-        rows.forEach((item: any) => {
-          state.subjectList.push({
-            text: item.name,
-            value: item.subjectId
-          })
-        })
-      } catch {
-        //
-      }
-    }
-
-    const validator = (val: any) => {
-      // 校验函数返回 true 表示校验通过,false 表示不通过
-      return state.nameReg.test(val) && val.length >= 2 && val.length <= 15
-    }
-    const message = (value: any) => {
-      if (!value) {
-        return '请填写学员真实姓名'
-      } else if (!state.nameReg.test(value)) {
-        return '学员姓名必须为中文'
-      } else if (value.length < 2 || value.length > 15) {
-        return '学员姓名必须为2~15个字'
-      } else {
-        return ''
-      }
-    }
-
-    // 乐团报名
-    const onSubmit = async () => {
-      try {
-        const params: any = {
-          orchestraId: route.query.id,
-          schoolId: state.detail.schoolId,
-          ...forms
-        }
-        // 判断是否已报过名
-        if (state.detail.id) {
-          params.id = state.detail.id
-        }
-        await request.post('/api-student/orchestraRegister/save', {
-          hideLoading: false,
-          data: {
-            ...params,
-            code: props.code
-          }
-        })
-        setTimeout(() => {
-          // showToast('报名成功')
-          emit('next', 'payment')
-        }, 100)
-      } catch {
-        //
-      }
-    }
-
-    onMounted(async () => {
-      // state.code = route.query.code || ''
-      // console.log('pre register code: ' + state.code)
-      await getSubjects()
-      // 判断学年制
-      if (props.schoolSystem === 'sixYearSystem') {
-        state.currentGrade.push({ text: '六年级', value: 6 })
-      }
-      await studentRegister()
-
-      // 判断是否有授权码
-      // if (!props.code) {
-      //   setLogout()
-      //   const query = {
-      //     returnUrl: route.path,
-      //     ...route.query
-      //   } as any
-      //   router.replace({
-      //     path: '/loginMusic',
-      //     query: query
-      //   })
-      // }
-    })
-    return () => (
-      <div class={styles.preApplyC}>
-        <Form validateFirst scrollToError onSubmit={onSubmit} ref="form" class={styles.form}>
-          <div class={styles.applyTitle}>学员信息</div>
-          <CellGroup inset class={styles.applyCellGroup}>
-            <Field
-              required
-              label="学员信息"
-              placeholder="请填写学员真实姓名"
-              inputAlign="right"
-              v-model={forms.username}
-              maxlength={15}
-              rules={[{ validator, message }]}
-            />
-            <Field
-              required
-              label="性别"
-              inputAlign="right"
-              rules={[{ required: true, message: '请选择性别' }]}
-            >
-              {{
-                input: () => (
-                  <RadioGroup v-model={forms.sex}>
-                    <Tag
-                      size="large"
-                      type="primary"
-                      color={!(forms.sex === 1) ? '#EAEAEA' : '#FF8057'}
-                      textColor={!(forms.sex === 1) ? '#AAA' : '#FFF'}
-                      class={styles.radioSection}
-                      round
-                    >
-                      <Radio class={styles.radioItem} name={1}></Radio>男生
-                    </Tag>
-                    <Tag
-                      size="large"
-                      type="primary"
-                      color={!(forms.sex === 0) ? '#EAEAEA' : '#FF8057'}
-                      textColor={!(forms.sex === 0) ? '#AAA' : '#FFF'}
-                      class={styles.radioSection}
-                      round
-                    >
-                      <Radio class={styles.radioItem} name={0}></Radio>女生
-                    </Tag>
-                  </RadioGroup>
-                )
-              }}
-            </Field>
-            <Field
-              required
-              label="年级"
-              inputAlign="right"
-              readonly
-              isLink
-              placeholder="请选择年级"
-              v-model={forms.currentGradeTxt}
-              onClick={() => (state.gradeStatus = true)}
-              rules={[{ required: true, message: '请选择年级' }]}
-            />
-            <Field
-              required
-              label="班级"
-              inputAlign="right"
-              readonly
-              isLink
-              placeholder="请选择班级"
-              v-model={forms.currentClassTxt}
-              onClick={() => (state.classStatus = true)}
-              rules={[{ required: true, message: '请选择班级' }]}
-            />
-          </CellGroup>
-
-          <div class={styles.applyTitle}>声部信息</div>
-          <div class={styles.applyTips}>(请务必按照学生的录取声部填报)</div>
-          <CellGroup inset class={styles.applyCellGroup}>
-            <Field
-              required
-              label="声部"
-              inputAlign="right"
-              readonly
-              isLink
-              placeholder="请选择声部"
-              v-model={forms.registerSubjectTxt}
-              onClick={() => {
-                if (state.subjectList.length <= 0) {
-                  showToast('暂无报名声部')
-                  return
-                }
-
-                // 切换订单时判断是否有支付中和已支付的订单,并且已注册过
-                // 判断学员所在乐团状态,如果在读则不允许更换声部(只能退团重新报名)
-                // 退团重新报名也不能更新声部
-                if (
-                  props.registerInfo?.registerStatus === 'LEARNING' ||
-                  (props.registerInfo?.registerStatus === 'OUTOF_ORCHESTRA' &&
-                    props.registerInfo?.orderNumber > 0)
-                ) {
-                  state.subjectChangeStatus = true
-                  return
-                }
-                state.subjectStatus = true
-              }}
-              rules={[{ required: true, message: '请选择声部' }]}
-            />
-          </CellGroup>
-
-          <div class={styles.applyTitle}>家长信息</div>
-          <CellGroup inset class={styles.applyCellGroup}>
-            <Field
-              required
-              label="家长姓名"
-              inputAlign="right"
-              placeholder="请填写家长真实姓名"
-              v-model={forms.parentName}
-              maxlength={15}
-              rules={[{ required: true, message: '请填写家长真实姓名' }]}
-            />
-            <Field
-              required
-              label="手机号"
-              inputAlign="right"
-              placeholder="请输入手机号"
-              v-model={forms.phone}
-              maxlength={11}
-              type="tel"
-              rules={[{ pattern: state.pattern, message: '输入监护人手机号码有误' }]}
-            />
-          </CellGroup>
-
-          <div class={'btnGroup'} style={{ paddingTop: '30px' }}>
-            <Button type="primary" round block native-type="submit">
-              下一步
-            </Button>
-          </div>
-        </Form>
-
-        {/* 年级 */}
-        <Popup
-          v-model:show={state.gradeStatus}
-          position="bottom"
-          round
-          safeAreaInsetBottom
-          // duration={0}
-          lazyRender={false}
-          class={'popupBottomSearch'}
-        >
-          <Picker
-            showToolbar
-            columns={state.currentGrade}
-            onCancel={() => (state.gradeStatus = false)}
-            onConfirm={(val: any) => {
-              const selectedOption = val.selectedOptions[0]
-              forms.currentGrade = selectedOption.value
-              forms.currentGradeTxt = selectedOption.text
-              state.gradeStatus = false
-            }}
-          />
-        </Popup>
-        {/* 班级 */}
-        <Popup v-model:show={state.classStatus} position="bottom" round class={'popupBottomSearch'}>
-          <Picker
-            showToolbar
-            columns={state.classList}
-            onCancel={() => (state.classStatus = false)}
-            onConfirm={(val: any) => {
-              const selectedOption = val.selectedOptions[0]
-              forms.currentClass = selectedOption.value
-              forms.currentClassTxt = selectedOption.text
-              state.classStatus = false
-            }}
-          />
-        </Popup>
-        {/* 声部 */}
-        <Popup
-          v-model:show={state.subjectStatus}
-          position="bottom"
-          round
-          class={'popupBottomSearch'}
-        >
-          <Picker
-            showToolbar
-            columns={state.subjectList}
-            onCancel={() => (state.subjectStatus = false)}
-            onConfirm={(val: any) => {
-              const selectedOption = val.selectedOptions[0]
-              forms.registerSubjectId = selectedOption.value
-              forms.registerSubjectTxt = selectedOption.text
-              state.subjectStatus = false
-            }}
-          />
-        </Popup>
-
-        <Dialog
-          v-model:show={state.subjectChangeStatus}
-          message={'您已有报名订单,不可更换声部'}
-          messageAlign="center"
-          confirmButtonText="确定"
-        >
-          {{
-            title: () => (
-              <div class={styles.dialogTitle}>
-                <i></i>
-                提示
-              </div>
-            )
-          }}
-        </Dialog>
-      </div>
-    )
-  }
-})

+ 0 - 311
src/views/student-register/component/order.tsx

@@ -1,311 +0,0 @@
-import OEmpty from '@/components/o-empty'
-import { orderStatus } from '@/constant'
-import { moneyFormat } from '@/helpers/utils'
-import {
-  Button,
-  Cell,
-  CellGroup,
-  Field,
-  Grid,
-  GridItem,
-  Image,
-  List,
-  Popup,
-  Radio,
-  RadioGroup,
-  showToast
-} from 'vant'
-import { defineComponent, onMounted, reactive, ref } from 'vue'
-import { useRoute, useRouter } from 'vue-router'
-import request from '@/helpers/request'
-import styles from '../index.module.less'
-
-export default defineComponent({
-  name: 'order',
-  emits: ['next'],
-  setup() {
-    const router = useRouter()
-    const route = useRoute()
-    const form = reactive({
-      isClick: false,
-      list: [] as any,
-      listState: {
-        dataShow: true, // 判断是否有数据
-        loading: false,
-        finished: false
-      },
-      params: {
-        page: 1,
-        rows: 20
-      },
-      resionList: [] as any,
-      refundStatus: false,
-      resion: null,
-      refundSelect: {} as any,
-      checked: null as any
-    })
-
-    // 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,
-            goodsQuery: true
-          }
-        })
-        form.listState.loading = false
-        const result = res.data || {}
-        // 处理重复请求数据
-        if (form.list.length > 0 && result.current === 1) {
-          return
-        }
-        const rows = result.rows || []
-        rows.goodsInfos &&
-          rows.goodsInfos.forEach((item: any) => {
-            const img = item.goodsUrl ? item.goodsUrl.split(',')[0] : ''
-            item.goodsUrl = img
-          })
-        form.list = form.list.concat(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
-      }
-    }
-
-    // const getDefaultParams = async () => {
-    //   try {
-    //     const { data } = await request.get('/api-student/sysParamConfig/queryByParamName', {
-    //       params: {
-    //         paramName: 'refund_reason'
-    //       }
-    //     })
-    //     const temp = data.paramValue.split('\n') || []
-    //     temp.forEach((item: any, index: number) => {
-    //       form.resionList.push({
-    //         text: item,
-    //         value: index + 1
-    //       })
-    //     })
-    //     form.resionList.push({
-    //       text: '其它原因',
-    //       value: 999
-    //     })
-    //     console.log(form.resionList, 'resionList')
-    //   } catch {
-    //     //
-    //   }
-    // }
-
-    // // 确认退费
-    // const onConfirmRefund = async () => {
-    //   try {
-    //     const status = form.checked === 999 && !form.resion
-    //     console.log(form.checked)
-    //     if (!form.checked) {
-    //       showToast('请选择原因')
-    //       return
-    //     } else if (status) {
-    //       showToast('请输入原因')
-    //       return
-    //     }
-
-    //     const refundReason = form.resionList.find((item: any) => item.value === form.checked)
-
-    //     console.log({
-    //       merOrderNo: form.refundSelect.orderNo,
-    //       refundReason: form.checked === 999 ? form.resion : refundReason.text
-    //     })
-
-    //     await request.post('/api-student/userPaymentOrder/refundPayment', {
-    //       data: {
-    //         merOrderNo: form.refundSelect.orderNo,
-    //         refundReason: form.checked === 999 ? form.resion : refundReason.text
-    //       }
-    //     })
-    //     form.refundStatus = false
-    //     onSearch()
-    //   } catch {
-    //     //
-    //   }
-    // }
-
-    // const onSearch = () => {
-    //   form.params.page = 1
-    //   form.list = []
-    //   form.listState.dataShow = true // 判断是否有数据
-    //   form.listState.loading = false
-    //   form.listState.finished = false
-    //   getList()
-    // }
-
-    // 查看详情
-    const onDetails = (item: any) => {
-      router.push({
-        path: 'payment-result',
-        query: {
-          orderNo: item.orderNo,
-          refund: 'refund'
-        }
-      })
-    }
-
-    onMounted(() => {
-      // getDefaultParams()
-      getList()
-    })
-
-    return () => (
-      <div style={{ paddingTop: '20px' }}>
-        {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} onClick={() => onDetails(item)}>
-                <Cell
-                  title={item.createTime}
-                  titleClass={styles.payTime}
-                  value={orderStatus[item.status]}
-                  valueClass={
-                    item.status === 'WAIT_PAY'
-                      ? styles.payStatus
-                      : item.status === 'PAID'
-                      ? styles.paySuccess
-                      : ''
-                  }
-                ></Cell>
-                <Cell border={false} class={styles.imgGroup} center>
-                  {{
-                    title: () => (
-                      <div class={styles.orderPriceInfo}>
-                        <Grid border={false} columnNum={3}>
-                          {item.goodsInfos &&
-                            item.goodsInfos.map(
-                              (goods: any, index: number) =>
-                                index < 3 && (
-                                  <GridItem>
-                                    <Image class={styles.img} src={goods.goodsUrl} />
-                                  </GridItem>
-                                )
-                            )}
-                        </Grid>
-                        <div class={styles.orderPriceNum}>
-                          <div class={styles.opNums}>
-                            <span>¥ </span>
-                            {moneyFormat(item.currentPrice)}
-                          </div>
-                          <div class={styles.opBuyLength}>
-                            共{(item.goodsInfos && item.goodsInfos.length) || 0}件
-                          </div>
-                        </div>
-                      </div>
-                    )
-                  }}
-                </Cell>
-                {/* {item.refundable && (
-                  <Cell class={styles.btnGroup} center>
-                    {{
-                      title: () => (
-                        <span class={styles.btnPrice}>¥{moneyFormat(item.currentPrice)}</span>
-                      ),
-                      value: () => (
-                        <div class={styles.btns}>
-                          <Button
-                            round
-                            plain
-                            color="#AAAAAA"
-                            onClick={(e: any) => {
-                              e.stopPropagation()
-                              form.refundSelect = item
-                              form.refundStatus = true
-                            }}
-                          >
-                            申请退款
-                          </Button>
-                        </div>
-                      )
-                    }}
-                  </Cell>
-                )} */}
-              </CellGroup>
-            ))}
-          </List>
-        ) : (
-          <OEmpty btnStatus={false} tips="暂无订单" />
-        )}
-
-        {/* <Popup v-model:show={form.refundStatus} round style={{ width: '90%' }}>
-          <div class={styles.container}>
-            <div class={[styles.dialogTitle, styles.dialogRefund]}>
-              <i></i>
-              申请退款
-            </div>
-
-            <div class={styles.refundContent}>
-              <div class={styles.tips}>
-                您将要发起退款,退款需承担千分之六的手续费,确认退款后款项将原路返还到您的付款账户中。
-              </div>
-
-              <div class={styles.refundTitle}>
-                <span>*</span>请选择您的退款原因
-              </div>
-
-              <RadioGroup v-model={form.checked}>
-                {form.resionList &&
-                  form.resionList.map((item: any) => (
-                    <Cell style="padding: 16px 0;" onClick={() => (form.checked = item.value)}>
-                      {{
-                        icon: () => <Radio name={item.value} />,
-                        title: () => <span style={'padding-left: 6px'}>{item.text}</span>
-                      }}
-                    </Cell>
-                  ))}
-              </RadioGroup>
-              {form.checked === 999 && (
-                <Field
-                  class={styles.phoneName}
-                  v-model={form.resion}
-                  placeholder="请输入原因"
-                  maxlength={50}
-                  type="textarea"
-                  rows={2}
-                />
-              )}
-            </div>
-
-            <div class={['van-hairline--top van-dialog__footer']}>
-              <Button
-                onClick={onConfirmRefund}
-                class={['van-button van-button--default van-button--large van-dialog__cancel']}
-              >
-                确认退款
-              </Button>
-              <Button
-                onClick={() => (form.refundStatus = false)}
-                class={[
-                  'van-button van-button--default van-button--large van-dialog__confirm van-hairline--left'
-                ]}
-              >
-                取消
-              </Button>
-            </div>
-          </div>
-        </Popup> */}
-      </div>
-    )
-  }
-})

+ 0 - 768
src/views/student-register/component/payment.tsx

@@ -1,768 +0,0 @@
-import OSticky from '@/components/o-sticky'
-import {
-  Button,
-  Cell,
-  CellGroup,
-  Checkbox,
-  CheckboxGroup,
-  Icon,
-  Image,
-  Popup,
-  showConfirmDialog,
-  showToast,
-  Tag
-} from 'vant'
-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'
-import iconGives from '../images/icon-gives.png'
-import { useRoute, useRouter } from 'vue-router'
-import request from '@/helpers/request'
-import { moneyFormat } from '@/helpers/utils'
-import { CountUp } from 'countup.js'
-import OPopup from '@/components/o-popup'
-import MemberBao from '../../member-bao'
-import GoodsDetail from '../../goods-detail'
-import ODialog from '@/components/o-dialog'
-
-export default defineComponent({
-  name: 'payment',
-  emits: ['next'],
-  setup() {
-    const route = useRoute()
-    const router = useRouter()
-    const state = reactive({
-      paymentType: '',
-      musicPaymentType: '', // 乐团中对应支付方式
-      check: [] as any, // 选中的数据
-      checkboxRefs: [] as any,
-      details: [] as any, //
-      goodsInfo: {} as any, // 商品
-      textBookInfo: {} as any, // 教材
-      repaireInfo: {} as any, // 乐器保养
-      vipInfo: {} as any, // 团练宝
-      depositInfo: {} as any, // 订金
-      paymentOrderDetails: [] as any, // 购买状态
-      orderInfo: {
-        needPrice: 0,
-        originalPrice: 0
-      },
-      memberBaoStatus: false, // 团练宝详情状态
-      goodsStatus: false, //
-      selectGoodsId: null as any,
-      currentPrice: 0,
-      selectGoodsInfo: {} as any,
-      dialogStatus: false,
-      dialogMessage: '',
-      dialogConfig: {} as any,
-
-      isDeposit: false, // 判断是否有订金
-      isVip: false // 是否有会员
-    })
-
-    // 获取支付渠道
-    const sysParamConfig = async () => {
-      try {
-        const { data } = await request.get('/api-student/sysParamConfig/queryByParamName', {
-          params: {
-            paramName: 'payment_service_provider'
-          }
-        })
-        state.paymentType = data.paramValue || ''
-      } catch {
-        //
-      }
-    }
-
-    // 查询未支付订单
-    const paymentOrderUnpaid = async () => {
-      try {
-        const { data } = await request.get('/api-student/userPaymentOrder/unpaid')
-        // 判断是否有待支付订单
-        if (data.id) {
-          state.dialogMessage = '您有待支付的订单,是否继续支付'
-          state.dialogStatus = true
-          state.dialogConfig = data
-        }
-      } catch {
-        //
-      }
-    }
-
-    // 获取商品信息
-    const registerGoods = async () => {
-      try {
-        const { data } = await request.get(
-          '/api-student/orchestraRegister/registerGoods/' + route.query.id
-        )
-
-        state.musicPaymentType = data.paymentServiceProvider || ''
-        // 获取已经购买商品信息
-        const paymentOrderDetails = data.paymentOrderDetails || []
-        paymentOrderDetails.forEach((item: any) => {
-          state.paymentOrderDetails.push(item.goodsType)
-        })
-        // 初始化数据商品数据
-        const details = data.details || []
-        details.forEach((item: any) => {
-          if (item.goodsType === 'INSTRUMENTS') {
-            const img = item.goodsUrl ? item.goodsUrl.split(',')[0] : ''
-            state.goodsInfo = { ...item, goodsUrl: img }
-          } else if (item.goodsType === 'TEXTBOOK') {
-            const img = item.goodsUrl ? item.goodsUrl.split(',')[0] : ''
-            state.textBookInfo = { ...item, goodsUrl: img }
-          } else if (item.goodsType === 'REPAIR') {
-            state.repaireInfo = { ...item }
-          } else if (item.goodsType === 'VIP') {
-            state.vipInfo = { ...item }
-            state.isVip = true
-          } else if (item.goodsType === 'DEPOSIT') {
-            // 判断是否有订金 - 如果有订金则不显示vip
-            state.isDeposit = true
-            // 查询是否有VIP的数据
-            const tempVipInfo = details.find((item: any) => item.goodsType === 'VIP')
-            if (tempVipInfo) {
-              item.originalPrice = tempVipInfo.currentPrice
-              state.depositInfo = { ...item }
-            }
-          }
-          state.details = details
-
-          // 只有教材默认选中 -
-          if (!state.paymentOrderDetails.includes(item.goodsType) && item.goodsType == 'TEXTBOOK') {
-            state.check.push(item.goodsId)
-          }
-        })
-
-        /**
-         * 1 - 检查是否有订金商品 有则VIP不显示
-         * 2 - 是否购买订金 如果购买VIP显示,扣减金额
-         * 3 -
-         */
-
-        calcPrice()
-      } catch {
-        //
-      }
-    }
-
-    const onSelect = (type: string) => {
-      state.checkboxRefs[type].toggle()
-      calcPrice()
-    }
-
-    // 初始化金额
-    const calcPrice = () => {
-      const details = state.details
-      const tempPrice = {
-        needPrice: 0, //需要支付金额
-        originalPrice: 0 // 原价
-      }
-      details.forEach((item: any) => {
-        // 是否选中
-        if (
-          state.check.includes(item.goodsId) &&
-          !state.paymentOrderDetails.includes(item.goodsType)
-        ) {
-          tempPrice.needPrice += parseFloat(item.currentPrice || 0)
-          tempPrice.originalPrice += parseFloat(item.originalPrice || 0)
-        }
-      })
-
-      state.orderInfo = tempPrice
-
-      initNumCountUp()
-    }
-    const countUpRef = reactive({
-      needPrice: null as any,
-      originalPrice: null as any
-    })
-    const initNumCountUp = () => {
-      nextTick(() => {
-        // 在读学员
-        if (countUpRef.needPrice) {
-          countUpRef.needPrice.update(state.orderInfo.needPrice)
-        } else {
-          countUpRef.needPrice = new CountUp('needPrice', state.orderInfo.needPrice, {
-            decimalPlaces: 2
-          })
-          if (!countUpRef.needPrice.error) {
-            countUpRef.needPrice.start()
-          } else {
-            console.error(countUpRef.needPrice.error)
-          }
-        }
-      })
-    }
-
-    // 购买
-    const onSubmit = async () => {
-      try {
-        // 判断订单号
-        if (state.check.length <= 0) {
-          showToast('请选择您要购买的商品')
-          return
-        }
-        // 重新计算金额
-        calcPrice()
-        const params: any = [] // 支付参数
-        const details = state.details
-
-        let checkInstruments = false // 是否选择了乐器
-        details.forEach((item: any) => {
-          // 是否选中 并且没有购买过
-          if (
-            state.check.includes(item.goodsId) &&
-            !state.paymentOrderDetails.includes(item.goodsType)
-          ) {
-            params.push({
-              goodsId: item.goodsId,
-              goodsNum: 1,
-              goodsType: item.goodsType,
-              paymentCashAmount: item.currentPrice, // 现金支付金额
-              paymentCouponAmount: 0 // 优惠券金额
-            })
-          }
-          // 判断是否是乐器
-          if (
-            item.goodsType === 'INSTRUMENTS' &&
-            state.check.includes(item.goodsId) &&
-            !state.paymentOrderDetails.includes(item.goodsType)
-          ) {
-            checkInstruments = false
-          }
-        })
-
-        // 为了处理,商品和乐器保养做关联
-        const repaire = state.repaireInfo
-        if (checkInstruments && repaire.goodsId) {
-          params.push({
-            goodsId: repaire.goodsId,
-            goodsNum: 1,
-            goodsType: repaire.goodsType,
-            paymentCashAmount: repaire.currentPrice, // 现金支付金额
-            paymentCouponAmount: 0 // 优惠券金额
-          })
-        }
-
-        // 创建订单
-        const { data } = await request.post('/api-student/userPaymentOrder/executeOrder', {
-          hideLoading: false,
-          data: {
-            paymentType: state.musicPaymentType || state.paymentType,
-            bizId: route.query.id, // 乐团编号
-            orderType: 'ORCHESTRA',
-            paymentCashAmount: state.orderInfo.needPrice || 0,
-            paymentCouponAmount: 0,
-            goodsInfos: params,
-            orderName: '乐团报名缴费',
-            orderDesc: '乐团报名缴费'
-          }
-        })
-
-        console.log(data)
-        router.push({
-          path: '/orderDetail',
-          query: {
-            pm: 1, // h5乐团报名
-            config: JSON.stringify({ ...data.paymentConfig, paymentType: data.paymentType }),
-            orderNo: data.orderNo
-          }
-        })
-      } catch (e: any) {
-        //
-        console.log(e)
-      }
-    }
-
-    onMounted(() => {
-      sysParamConfig()
-      // 查询未支付订单
-      registerGoods()
-      paymentOrderUnpaid()
-    })
-    return () => (
-      <>
-        <div class={styles.applyTitle}>报名须知</div>
-        <div class={[styles.paymentTips, styles.mlr13]}>
-          <p>
-            1、<span>乐团免费政策</span>:学生在团期间训练及教材免费政策(教材邮费需自理);
-          </p>
-          <p>
-            2、<span>入团必备工具</span>
-            :为了符合乐团学练同频的要求,学生在入团前需准备好乐团Ai训练工具和乐器两项工具;
-          </p>
-          <p>
-            3、<span>入团必备工具准备的原则</span>
-            :家长可自行准备(需按照乐团提供的参考参数准备),也可勾选下方项目技术方提供的乐团工具;
-          </p>
-          <p>
-            4、<span>温馨提示</span>
-            :自行准备的家长请在收到开团信息后再进行工具准备(避免出现时间浪费),在项目技术方购置的家长请放心提交(Ai学练工具将在首次训练时激活)
-          </p>
-        </div>
-        <CheckboxGroup
-          v-model={state.check}
-          style={{ paddingBottom: '20px' }}
-          onChange={() => {
-            calcPrice()
-          }}
-        >
-          {/* 判断是否买了乐器学习系统 */}
-          {!state.paymentOrderDetails.includes('VIP') && !state.isDeposit && (
-            <CellGroup
-              inset
-              class={[styles.mlr13, styles.sectionCell]}
-              onClick={() => onSelect(state.vipInfo.goodsId)}
-            >
-              <Cell border={false}>
-                {{
-                  icon: () => (
-                    <Checkbox
-                      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
-                            class={styles.iconChecked}
-                            name={props.checked ? radioCheck : radioDefault}
-                          />
-                        )
-                      }}
-                    />
-                  ),
-                  title: () => (
-                    <div class={styles.section}>
-                      <Image
-                        class={styles.img}
-                        src={state.vipInfo.goodsUrl}
-                        onClick={(e: any) => {
-                          e.stopPropagation()
-                          state.memberBaoStatus = true
-                        }}
-                      />
-                      <div class={styles.sectionContent}>
-                        <h2
-                          onClick={(e: any) => {
-                            e.stopPropagation()
-                            state.memberBaoStatus = true
-                          }}
-                        >
-                          {state.vipInfo.goodsName}
-                        </h2>
-                        <Tag
-                          color="linear-gradient(135deg, #FF8C4A 0%, #FF531C 100%)"
-                          textColor="#fff"
-                          class={styles.brandName}
-                        >
-                          6个月
-                        </Tag>
-                        <p class={[styles.model, 'van-multi-ellipsis--l2']}>
-                          {state.vipInfo.description}
-                        </p>
-                      </div>
-                    </div>
-                  )
-                }}
-              </Cell>
-              <Cell>
-                {{
-                  title: () => (
-                    <div class={styles.extra}>
-                      <div class={styles.sectionPrice}>
-                        <p class={styles.price}>
-                          团购价:
-                          <span class={styles.numFont}>
-                            <span class={styles.numPrefix}>¥</span>
-                            {moneyFormat(state.vipInfo.currentPrice)}
-                          </span>
-                        </p>
-                        <p class={styles.originPrice}>
-                          原价:
-                          <del class={styles.numFont}>
-                            ¥ {moneyFormat(state.vipInfo.originalPrice)}
-                          </del>
-                        </p>
-                      </div>
-                    </div>
-                  )
-                }}
-              </Cell>
-            </CellGroup>
-          )}
-
-          {/* 定金 */}
-          {!state.paymentOrderDetails.includes('DEPOSIT') && state.isVip && (
-            <CellGroup
-              inset
-              class={[styles.mlr13, styles.sectionCell]}
-              onClick={() => onSelect(state.depositInfo.goodsId)}
-            >
-              <Cell border={false}>
-                {{
-                  icon: () => (
-                    <Checkbox
-                      name={state.depositInfo.goodsId}
-                      class={styles.checkbox}
-                      ref={(el: any) => (state.checkboxRefs[state.depositInfo.goodsId] = el)}
-                      onClick={(e: Event) => {
-                        e.stopPropagation()
-                      }}
-                      v-slots={{
-                        icon: (props: any) => (
-                          <Icon
-                            class={styles.iconChecked}
-                            name={props.checked ? radioCheck : radioDefault}
-                          />
-                        )
-                      }}
-                    />
-                  ),
-                  title: () => (
-                    <div class={styles.section}>
-                      <Image
-                        class={styles.img}
-                        src={state.depositInfo.goodsUrl}
-                        onClick={(e: any) => {
-                          e.stopPropagation()
-                          state.memberBaoStatus = true
-                        }}
-                      />
-                      <div class={styles.sectionContent}>
-                        <h2
-                          onClick={(e: any) => {
-                            e.stopPropagation()
-                            state.memberBaoStatus = true
-                          }}
-                        >
-                          {state.depositInfo.goodsName}
-                        </h2>
-                        <Tag
-                          color="linear-gradient(135deg, #FF8C4A 0%, #FF531C 100%)"
-                          textColor="#fff"
-                          class={styles.brandName}
-                        >
-                          6个月
-                        </Tag>
-                        <p class={[styles.model, 'van-multi-ellipsis--l2']}>
-                          {state.depositInfo.description}
-                        </p>
-                      </div>
-                    </div>
-                  )
-                }}
-              </Cell>
-              <Cell>
-                {{
-                  title: () => (
-                    <div class={styles.extra}>
-                      <div class={styles.sectionPrice}>
-                        <p class={styles.price}>
-                          定金:
-                          <span class={styles.numFont}>
-                            <span class={styles.numPrefix}>¥</span>
-                            {moneyFormat(state.depositInfo.currentPrice)}
-                          </span>
-                        </p>
-                        <p class={styles.originPrice}>
-                          团购价:
-                          <span class={styles.numFont}>
-                            ¥ {moneyFormat(state.depositInfo.originalPrice)}
-                          </span>
-                        </p>
-                      </div>
-                    </div>
-                  )
-                }}
-              </Cell>
-            </CellGroup>
-          )}
-
-          {/* 判断是否已经购买乐器 */}
-          {!state.paymentOrderDetails.includes('INSTRUMENTS') && (
-            <CellGroup
-              inset
-              class={[styles.mlr13, styles.sectionCell]}
-              onClick={() => onSelect(state.goodsInfo.goodsId)}
-            >
-              <Cell border={false}>
-                {{
-                  icon: () => (
-                    <Checkbox
-                      name={state.goodsInfo.goodsId}
-                      class={styles.checkbox}
-                      ref={(el: any) => (state.checkboxRefs[state.goodsInfo.goodsId] = el)}
-                      onClick={(e: Event) => {
-                        e.stopPropagation()
-                      }}
-                      v-slots={{
-                        icon: (props: any) => (
-                          <Icon
-                            class={styles.iconChecked}
-                            name={props.checked ? radioCheck : radioDefault}
-                          />
-                        )
-                      }}
-                    />
-                  ),
-                  title: () => (
-                    <div class={styles.section}>
-                      <Image
-                        class={styles.img}
-                        src={state.goodsInfo.goodsUrl}
-                        onClick={(e: any) => {
-                          e.stopPropagation()
-                          state.selectGoodsId = state.goodsInfo.goodsId
-                          state.currentPrice = state.goodsInfo.currentPrice
-                          state.selectGoodsInfo = {
-                            showFree: true,
-                            originalPrice: state.repaireInfo.originalPrice
-                          }
-                          state.goodsStatus = true
-                        }}
-                      />
-                      <div class={styles.sectionContent}>
-                        <h2
-                          onClick={(e: any) => {
-                            e.stopPropagation()
-                            state.selectGoodsId = state.goodsInfo.goodsId
-                            state.currentPrice = state.goodsInfo.currentPrice
-                            state.goodsStatus = true
-                          }}
-                        >
-                          {state.goodsInfo.goodsName}
-                        </h2>
-                        <Tag
-                          color="linear-gradient(135deg, #FF8C4A 0%, #FF531C 100%)"
-                          textColor="#fff"
-                          class={styles.brandName}
-                        >
-                          {state.goodsInfo.brandName}
-                        </Tag>
-                        <p class={[styles.model, 'van-multi-ellipsis--l2']}>
-                          {state.goodsInfo.description}
-                        </p>
-                      </div>
-                    </div>
-                  )
-                }}
-              </Cell>
-              <Cell border={false}>
-                {{
-                  title: () => (
-                    <div class={styles.extra}>
-                      <div class={styles.sectionPrice}>
-                        <p class={styles.price}>
-                          团购价:
-                          <span class={styles.numFont}>
-                            <span class={styles.numPrefix}>¥ </span>
-                            {moneyFormat(state.goodsInfo.currentPrice)}
-                          </span>
-                        </p>
-                        <p class={styles.originPrice}>
-                          原价:
-                          <del class={styles.numFont}>
-                            ¥ {moneyFormat(state.goodsInfo.originalPrice)}
-                          </del>
-                        </p>
-                      </div>
-                    </div>
-                  )
-                }}
-              </Cell>
-              {/* <Cell center class={styles.gives}>
-                  {{
-                    title: () => (
-                      <div class={styles.sectionTips}>
-                        <Image src={iconGives} class={styles.iconGives} />
-                        赠价值{state.repaireInfo.originalPrice}元乐器维保服务一年
-                      </div>
-                    )
-                  }}
-                </Cell> */}
-            </CellGroup>
-          )}
-
-          {/* 判断是否已经购买教材 */}
-          {!state.paymentOrderDetails.includes('TEXTBOOK') && (
-            <CellGroup
-              inset
-              class={[styles.mlr13, styles.sectionCell]}
-              onClick={() => {
-                return
-                // onSelect(state.textBookInfo.goodsId)
-              }}
-            >
-              <Cell border={false}>
-                {{
-                  icon: () => (
-                    <Checkbox
-                      name={state.textBookInfo.goodsId}
-                      disabled
-                      class={styles.checkbox}
-                      ref={(el: any) => (state.checkboxRefs[state.textBookInfo.goodsId] = el)}
-                      onClick={(e: Event) => {
-                        e.stopPropagation()
-                      }}
-                      v-slots={{
-                        icon: (props: any) => (
-                          <Icon
-                            class={styles.iconChecked}
-                            name={props.checked ? radioCheck : radioDefault}
-                          />
-                        )
-                      }}
-                    />
-                  ),
-                  title: () => (
-                    <div class={styles.section}>
-                      <Image
-                        class={styles.img}
-                        src={state.textBookInfo.goodsUrl}
-                        onClick={(e: any) => {
-                          e.stopPropagation()
-                          state.selectGoodsId = state.textBookInfo.goodsId
-                          state.currentPrice = state.textBookInfo.currentPrice
-                          state.selectGoodsInfo = {}
-                          state.goodsStatus = true
-                        }}
-                      />
-                      <div class={styles.sectionContent}>
-                        <h2
-                          onClick={(e: any) => {
-                            e.stopPropagation()
-                            state.selectGoodsId = state.textBookInfo.goodsId
-                            state.currentPrice = state.textBookInfo.currentPrice
-                            state.selectGoodsInfo = {}
-                            state.goodsStatus = true
-                          }}
-                        >
-                          {state.textBookInfo.goodsName}
-                        </h2>
-                        <Tag
-                          color="linear-gradient(135deg, #FF8C4A 0%, #FF531C 100%)"
-                          textColor="#fff"
-                          class={styles.brandName}
-                        >
-                          {state.textBookInfo.brandName}
-                        </Tag>
-                        <p class={[styles.model, 'van-multi-ellipsis--l2']}>
-                          {state.textBookInfo.description}
-                        </p>
-                      </div>
-                    </div>
-                  )
-                }}
-              </Cell>
-              <Cell>
-                {{
-                  title: () => (
-                    <div class={styles.extra}>
-                      <div class={styles.sectionPrice}>
-                        <p class={styles.price}>
-                          团购价:
-                          <span
-                            class={[
-                              state.textBookInfo.currentPrice > 0 ? styles.numFont : styles.free
-                            ]}
-                          >
-                            {state.textBookInfo.currentPrice > 0 ? (
-                              <>
-                                <span class={styles.numPrefix}>¥ </span>
-                                {moneyFormat(state.textBookInfo.currentPrice)}
-                              </>
-                            ) : (
-                              '免费'
-                            )}
-                          </span>
-                        </p>
-                        <p class={styles.originPrice}>
-                          原价:
-                          <del class={styles.numFont}>
-                            ¥ {moneyFormat(state.textBookInfo.originalPrice)}
-                          </del>
-                        </p>
-                      </div>
-                    </div>
-                  )
-                }}
-              </Cell>
-            </CellGroup>
-          )}
-        </CheckboxGroup>
-        <OSticky position="bottom" background="white">
-          <div class={styles.paymentContainer}>
-            <div class={styles.payemntPrice}>
-              <p class={styles.needPrice}>
-                支付金额:
-                <span class={styles.numFont}>
-                  <span>¥ </span>
-                  <i style="font-style: normal" id="needPrice"></i>
-                </span>
-              </p>
-              <p class={styles.allPrice}>
-                <del class={styles.numFont}>
-                  总原价:¥ {moneyFormat(state.orderInfo.originalPrice)}
-                </del>
-              </p>
-            </div>
-            <div class={styles.paymentBtn}>
-              <Button
-                color="linear-gradient(135deg, #FF8C4A 0%, #FF531C 100%)"
-                round
-                onClick={onSubmit}
-              >
-                立即提交
-              </Button>
-            </div>
-          </div>
-        </OSticky>
-        <OPopup v-model:modelValue={state.memberBaoStatus} position="right">
-          <MemberBao />
-        </OPopup>
-        <OPopup v-model:modelValue={state.goodsStatus} position="right" destroy>
-          {state.goodsStatus && (
-            <GoodsDetail
-              id={state.selectGoodsId}
-              groupPrice={state.currentPrice}
-              goodsInfo={state.selectGoodsInfo}
-            />
-          )}
-        </OPopup>
-        <ODialog
-          title="提示"
-          v-model:show={state.dialogStatus}
-          message={state.dialogMessage}
-          confirmButtonText="继续支付"
-          cancelButtonText="取消订单"
-          showCancelButton
-          onConfirm={() => {
-            const paymentConfig = state.dialogConfig.paymentConfig
-            router.push({
-              path: '/orderDetail',
-              query: {
-                pm: 1, // h5乐团报名
-                config: JSON.stringify(paymentConfig.paymentConfig),
-                orderNo: paymentConfig.orderNo
-              }
-            })
-          }}
-          onCancel={async () => {
-            try {
-              await request.post(
-                '/api-student/userPaymentOrder/cancelPayment/' + state.dialogConfig.orderNo
-              )
-            } catch {
-              //
-            }
-          }}
-        />
-      </>
-    )
-  }
-})

+ 1 - 1
src/views/student-register/component/user-auth.tsx

@@ -35,7 +35,7 @@ export default defineComponent({
   methods: {
     async onSubmit() {
       try {
-        const url = state.platformApi + '/sysAccount/realNameAuth';
+        const url = '/edu-app/sysAccount/realNameAuth';
         await request.post(url, {
           data: {
             ...this.form,

+ 1 - 1
src/views/student-register/shop-address/index.tsx

@@ -172,7 +172,7 @@ export default defineComponent({
             ))}
           </List>
         ) : (
-          <OEmpty btnStatus={false} tips="暂无收货地址" />
+          <OEmpty tips="暂无收货地址" />
         )}
         <OSticky position="bottom">
           <div class={'btnGroup'}>

+ 0 - 43
src/views/student-register/shop-mall/components/shop-item/index.module.less

@@ -1,43 +0,0 @@
-body {
-  :global {
-    --van-cart: #ff4e19;
-  }
-}
-.item {
-  :global {
-    .van-card {
-      background: #fff;
-      flex: 1;
-      margin: 0;
-      padding: 14px 12px;
-    }
-    .van-card__title {
-      font-size: 16px;
-      color: #333;
-      font-weight: 400;
-      line-height: 22px;
-      max-height: 44px;
-    }
-    .van-card__desc {
-      font-size: 14px;
-      color: #999;
-      font-weight: 400;
-      line-height: 20px;
-      max-height: 40px;
-      white-space: break-spaces;
-    }
-    .van-card__thumb {
-      width: auto;
-      height: auto;
-    }
-    .van-image {
-      width: 100px !important;
-      height: 100px !important;
-      border-radius: 8px;
-      overflow: hidden;
-    }
-    .van-card__price {
-      color: var(--van-cart);
-    }
-  }
-}

+ 0 - 33
src/views/student-register/shop-mall/components/shop-item/index.tsx

@@ -1,33 +0,0 @@
-import { moneyFormat } from '@/helpers/utils'
-import { formateAttr } from '@/views/cart/cart'
-import { Card } from 'vant'
-import { defineComponent } from 'vue'
-import styles from './index.module.less'
-
-export default defineComponent({
-  name: 'shop-item',
-  props: {
-    item: {
-      type: Object,
-      default: {
-        productPic: '',
-        productName: '',
-        productAttr: '',
-        productPrice: 0,
-        productQuantity: 0
-      }
-    }
-  },
-  setup({ item }) {
-    return () => (
-      <Card
-        class={styles.item}
-        thumb={item.productPic}
-        title={item.productName}
-        desc={formateAttr(item.productAttr)}
-        price={moneyFormat(item.productPrice)}
-        num={item.productQuantity}
-      ></Card>
-    )
-  }
-})

+ 0 - 100
src/views/student-register/shop-mall/index.module.less

@@ -1,100 +0,0 @@
-.shopMall {
-  max-width: 750px;
-  margin: 0 auto;
-}
-.hotContent {
-  padding: 11px 14px 0 14px;
-  background-color: #fff;
-  border-radius: 0 0 18px 18px;
-}
-.icon-shop-cart {
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  .dot {
-    line-height: 16px;
-    background: #ff4e19;
-    border-radius: 10px 10px 0px 10px;
-    font-size: 12px;
-    color: #ffffff;
-    padding: 0px 5px;
-    margin-right: 5px;
-  }
-}
-.iconBadge {
-  :global {
-    .van-badge {
-      border: none;
-    }
-  }
-}
-.searchBox {
-  :global {
-    .van-search {
-      padding-bottom: 0;
-    }
-    .van-search .van-search__content {
-      background-color: #fff !important;
-    }
-  }
-}
-.swipe {
-  height: 35.2vmin;
-  border-radius: 10px;
-  overflow: hidden;
-  .swipeItemImg {
-    height: 100%;
-    width: 100%;
-  }
-  :global {
-    .van-swipe__indicators {
-      right: 10px;
-      left: initial;
-    }
-    .van-swipe__indicator {
-      transition: width 0.3s;
-    }
-    .van-swipe__indicator--active {
-      width: 12px;
-      border-radius: 4px;
-    }
-  }
-}
-
-.tabs {
-  :global {
-    // .van-tab {
-    //   height: 30px;
-    //   padding: 0 14px;
-    //   border-radius: 6px;
-    //   color: #333;
-    //   font-size: 14px;
-    //   background-color: #fff;
-    //   margin-right: 10px;
-    // }
-    // .van-tabs__wrap {
-    //   height: initial !important;
-    //   padding-top: 14px;
-    //   padding-bottom: 14px;
-    // }
-    // .van-tab--active {
-    //   background-color: #d9fff8;
-    //   color: var(--van-primary);
-    // }
-    // .van-tabs__nav {
-    //   padding: 0 4px 0 14px !important;
-    // }
-    // .van-tabs__line {
-    //   display: none;
-    // }
-    .van-tabs__line {
-      width: 20px !important;
-      height: 7px;
-      bottom: 0.5rem;
-      background-image: url('./images/bottom-line.svg');
-      background-repeat: no-repeat;
-      background-size: 100% 100%;
-      background-color: transparent !important;
-    }
-  }
-}

+ 0 - 183
src/views/student-register/shop-mall/index.tsx

@@ -1,183 +0,0 @@
-import ColHeader from '@/components/col-header'
-import {
-  Badge,
-  Dialog,
-  Divider,
-  Icon,
-  Image,
-  PullRefresh,
-  Sticky,
-  Swipe,
-  SwipeItem,
-  Tab,
-  Tabs
-} from 'vant'
-import { defineComponent } from 'vue'
-import HotGoods from './components/hot-goods'
-import MenuList from './components/menu-list'
-import TabList from './components/tab-list'
-import styles from './index.module.less'
-import iconShopCart from './images/icon-shop-cart.png'
-import request from '@/helpers/request'
-import {
-  listenerMessage,
-  postMessage,
-  removeListenerMessage
-} from '@/helpers/native-message'
-import ColSearch from '@/components/col-search'
-import { browser, setAuth } from '@/helpers/utils'
-import { cartCount, getCartCount } from './shop-mall'
-import TheHomeHeader from './components/TheHomeHeader'
-
-export default defineComponent({
-  name: 'shop-mall',
-  data() {
-    return {
-      loading: false,
-      height: 'auto' as any,
-      count: 0, // 购买车数量
-      advertiseList: [], // 广告列表
-      productList: [], // 商品分类
-      hotProductList: [], // 热门商品列表
-      productCategoryList: [] // 商品分类列表
-    }
-  },
-  mounted() {
-    this.init()
-    // if (browser().ios) {
-    document.addEventListener('visibilitychange', event => {
-      if (!document.hidden) {
-        getCartCount()
-        const tabFirst = this.$refs.tabFirst as any
-        tabFirst?.onSearch()
-      }
-    })
-    // }
-    //  else {
-    //   listenerMessage('UpdateToken', result => {
-    //     if (result?.content.token) {
-    //       setAuth(result?.content.token)
-    //     }
-    //     getCartCount()
-    //     const tabFirst = this.$refs.tabFirst as any
-    //     tabFirst?.onSearch()
-    //   })
-    // }
-  },
-  unmounted() {
-    // removeListenerMessage('UpdateToken', () => {})
-  },
-  methods: {
-    onRefresh() {
-      this.productCategoryList = []
-      this.$nextTick(() => {
-        this.init()
-      })
-      const tabFirst = this.$refs.tabFirst as any
-      tabFirst?.onSearch()
-    },
-    async init() {
-      try {
-        const res = await request.get('/api-mall-portal/home/content')
-        const result = res.data || {}
-        this.count = result.count
-        cartCount.value = result.count
-        this.advertiseList = result.advertiseList
-        const category = result.productCategoryList || []
-        const categoryResult: any = []
-        while (category.length > 0) {
-          const chunk = category.splice(0, 5)
-          categoryResult.push(chunk)
-        }
-        this.productList = categoryResult
-        this.hotProductList = result.hotProductList || []
-        this.productCategoryList = result.productAttributeCategoryList || []
-      } catch {}
-      setTimeout(() => {
-        this.loading = false
-      }, 500)
-    },
-    openWebView(url: string): void {
-      try {
-        this.$router.push(url)
-      } catch (error) {}
-    }
-  },
-  render() {
-    return (
-      <div class={styles.shopMall}>
-        <TheHomeHeader
-          onCart={() => this.openWebView('/cart')}
-          onSearch={() => this.openWebView('/goodsList?input=focus')}
-          onMore={action => {
-            if (!action) return
-            this.openWebView(action.url)
-          }}
-        />
-        <PullRefresh
-          v-model={this.loading}
-          loading-text="正在刷新..."
-          success-text="刷新完成"
-          onRefresh={() => this.onRefresh()}
-        >
-          <div class={styles.hotContent}>
-            <Swipe class={styles.swipe} autoplay={3000} showIndicators={false}>
-              {this.advertiseList.map((item: any) => (
-                <SwipeItem onClick={() => this.openWebView(item.url)}>
-                  <Image
-                    class={styles.swipeItemImg}
-                    src={item.pic}
-                    fit="fill"
-                  />
-                </SwipeItem>
-              ))}
-            </Swipe>
-
-            <MenuList
-              productList={this.productList}
-              onOpenWebView={this.openWebView}
-            />
-          </div>
-
-          {this.hotProductList.length === 3 && (
-            <HotGoods
-              hotProductList={this.hotProductList}
-              onOpenWebView={this.openWebView}
-            />
-          )}
-
-          <Tabs
-            shrink
-            lineWidth={25}
-            background={'#f6f8f9'}
-            color="var(--van-primary)"
-            class={styles.tabs}
-            sticky
-            offsetTop={this.height}
-            lazyRender
-          >
-            <Tab title="全部" name={0}>
-              <TabList
-                ref="tabFirst"
-                isTab={true}
-                showAdd={false}
-                productAttributeCategoryId={0}
-                onOpenWebView={this.openWebView}
-              />
-            </Tab>
-            {this.productCategoryList.map((item: any) => (
-              <Tab title={item.name} name={item.id}>
-                <TabList
-                  isTab={true}
-                  showAdd={false}
-                  productAttributeCategoryId={item.id}
-                  onOpenWebView={this.openWebView}
-                />
-              </Tab>
-            ))}
-          </Tabs>
-        </PullRefresh>
-      </div>
-    )
-  }
-})

+ 31 - 14
src/views/student-register/shop-mall/modal/goods-filter-list/index.tsx

@@ -104,20 +104,37 @@ export default defineComponent({
                     class={styles['radio-group']}
                     modelValue={this.params[key]}
                     onUpdate:modelValue={val => (this.params[key] = val)}>
-                    {this[key].map((item: any, index: number) => {
-                      const isActive = index === this.params[key];
-                      const type = isActive ? 'primary' : 'default';
-                      return (
-                        <Radio
-                          class={styles.radio}
-                          name={index}
-                          onClick={() => {}}>
-                          <Tag size="large" type={type}>
-                            {item.name}
-                          </Tag>
-                        </Radio>
-                      );
-                    })}
+                    {key === 'productAttrbuteCategoryList'
+                      ? this.productAttributeCategoryList.map(
+                          (item: any, index: number) => {
+                            const isActive = index === this.params[key];
+                            const type = isActive ? 'primary' : 'default';
+                            return (
+                              <Radio
+                                class={styles.radio}
+                                name={index}
+                                onClick={() => {}}>
+                                <Tag size="large" type={type}>
+                                  {item.name}
+                                </Tag>
+                              </Radio>
+                            );
+                          }
+                        )
+                      : this.brandList.map((item: any, index: number) => {
+                          const isActive = index === this.params[key];
+                          const type = isActive ? 'primary' : 'default';
+                          return (
+                            <Radio
+                              class={styles.radio}
+                              name={index}
+                              onClick={() => {}}>
+                              <Tag size="large" type={type}>
+                                {item.name}
+                              </Tag>
+                            </Radio>
+                          );
+                        })}
                   </RadioGroup>
                 )
               }}