lex 8 月之前
父節點
當前提交
d87b26c2a2

+ 12 - 1
src/school/orchestra/compontent/photo.module.less

@@ -94,6 +94,17 @@
     position: relative;
     padding-top: 20px;
 
+    .iconNew {
+      position: absolute;
+      top: 26px;
+      right: 6px;
+      background: url('../images/icon-new.png') center no-repeat;
+      background-size: contain;
+      z-index: 12;
+      width: 44px;
+      height: 17px;
+    }
+
     .more {
       display: inline-block;
       position: absolute;
@@ -192,4 +203,4 @@
       top: 50px;
     }
   }
-}
+}

+ 2 - 1
src/school/orchestra/compontent/photo.tsx

@@ -267,7 +267,8 @@ export default defineComponent({
             <div class={styles.phoneContainer}>
               {state.list.map((item: any) => (
                 <div class={styles.item} onClick={() => onDetail(item)}>
-                  {/* <i class={styles.more}></i> */}
+                  {item.newFlag ? <i class={styles.iconNew}></i> : ''}
+
                   <i
                     class={styles.more}
                     onClick={(e: any) => {

二進制
src/school/orchestra/images/icon-new.png


+ 4 - 2
src/student/music-group/layout/login.tsx

@@ -40,6 +40,7 @@ export default defineComponent({
       orchestraPath: 'preApply' as any,
       orchestraInfo: {} as any,
       hasBuyInstruments: false, // 是否购买商品
+      registerStatus: '',
       // 是否开启微信登录(测试使用)默认为false
       testIsWeixin: false
       // noPaymentList: [
@@ -139,8 +140,8 @@ export default defineComponent({
           qs.stringify({
             ...rest
           })
-        // 判断是否购买的商品 - 只在商品购买乐团
-        if (this.hasBuyInstruments) {
+        // 判断是否购买的商品 - 只在商品购买乐团 并且是在读的状态
+        if (this.hasBuyInstruments && this.registerStatus === 'LEARNING') {
           newUrl = window.location.origin + window.location.pathname + '#/preGoodsSuccess?t=pay'
           window.location.href = newUrl
           return
@@ -204,6 +205,7 @@ export default defineComponent({
             '/api-student/orchestraRegister/registerStatus/' + id
           )
           this.hasBuyInstruments = registerInfo.data.hasBuyInstruments || false
+          this.registerStatus = registerInfo.data.registerStatus || ''
         }
 
         this.directNext()

+ 24 - 10
src/student/music-group/pre-apply/component/apply.tsx

@@ -172,10 +172,26 @@ export default defineComponent({
             code: props.code
           }
         })
-        setTimeout(() => {
-          // showToast('报名成功')
-          emit('next', 'payment')
-        }, 100)
+
+        const { data } = await request.get(
+          '/api-student/orchestraRegister/registerStatus/' + route.query.id
+        )
+        // 	购买状态, 判断是否已经购买完了
+        if (data.purchase) {
+          await request.post('/api-student/orchestraRegister/learningStudent', {
+            data: {
+              orchestraId: route.query.id
+            }
+          })
+          setTimeout(() => {
+            emit('next', 'order')
+          }, 100)
+        } else {
+          setTimeout(() => {
+            // showToast('报名成功')
+            emit('next', 'payment')
+          }, 100)
+        }
       } catch {
         //
       }
@@ -312,12 +328,10 @@ export default defineComponent({
 
                 // 切换订单时判断是否有支付中和已支付的订单,并且已注册过
                 // 判断学员所在乐团状态,如果在读则不允许更换声部(只能退团重新报名)
-                // 退团重新报名也不能更新声部
-                if (
-                  props.registerInfo?.registerStatus === 'LEARNING' ||
-                  (props.registerInfo?.registerStatus === 'OUTOF_ORCHESTRA' &&
-                    props.registerInfo?.orderNumber > 0)
-                ) {
+                // 退团重新报名也不能更新声部  现在可以了 ||
+                // props.registerInfo?.registerStatus === 'OUTOF_ORCHESTRA' &&
+                //   props.registerInfo?.orderNumber > 0
+                if (props.registerInfo?.registerStatus === 'LEARNING') {
                   state.subjectChangeStatus = true
                   return
                 }

+ 234 - 190
src/student/music-group/pre-goods-apply/index.tsx

@@ -223,6 +223,23 @@ export default defineComponent({
           }
         })
 
+        // 判断是否为退团重新报名逻辑
+        if (state.registerInfo.hasBuyCourse) {
+          await request.post('/api-student/orchestraRegister/learningStudent', {
+            data: {
+              orchestraId: route.query.id
+            }
+          })
+
+          router.push({
+            path: '/preGoodsSuccess',
+            query: {
+              t: 'pay'
+            }
+          })
+
+          return
+        }
         if (forms.groupBuyType === 'SELF') {
           router.push({
             path: '/preGoodsSuccess'
@@ -237,6 +254,11 @@ export default defineComponent({
     // 乐团报名
     const onSubmit = async () => {
       try {
+        // 判断是否在购买VIP
+        if (state.registerInfo.hasBuyCourse) {
+          await onRegisterUser()
+          return
+        }
         if (forms.groupBuyType === 'SELF') {
           state.submitStatus = true
           return
@@ -741,65 +763,83 @@ export default defineComponent({
             </Field>
           </CellGroup>
 
-          {forms.groupBuyType === 'GROUP_BUY' && (
+          {state.registerInfo.hasBuyCourse ? (
+            <div class={'btnGroup'} style={{ paddingTop: '30px' }}>
+              <Button
+                type="primary"
+                color="linear-gradient(135deg, #FF8C4A 0%, #FF531C 100%)"
+                round
+                block
+                native-type="submit"
+              >
+                提交
+              </Button>
+            </div>
+          ) : (
             <>
-              <CellGroup class={[styles.applyCellGroup, styles.groupBuy]} border={false}>
-                <div class={[styles.title, styles.titleIntrumentTool]}></div>
-                <Cell border={false}>
-                  {{
-                    icon: () => <Image src={state.vipYearInfo.goodsUrl} class={styles.goodsImg} />,
-                    value: () => (
-                      <div class={styles.vipYearInfo}>
-                        <div class={styles.goodsTitle}>
-                          {state.vipYearInfo.goodsName} <img src={icon12} />
-                        </div>
-                        <p class={styles.goodsTips}>乐团首次训练之日起生效</p>
-                        <p class={[styles.goodsMemo, 'van-multi-ellipsis--l2']}>
-                          {state.vipYearInfo.description}
-                        </p>
-                        <div class={styles.goodsPrice}>
-                          <div class={styles.priceGroup}>
-                            团购价:
-                            <p>
-                              <span>¥</span> {moneyFormat(state.vipYearInfo.currentPrice)}
+              {forms.groupBuyType === 'GROUP_BUY' && (
+                <>
+                  <CellGroup class={[styles.applyCellGroup, styles.groupBuy]} border={false}>
+                    <div class={[styles.title, styles.titleIntrumentTool]}></div>
+                    <Cell border={false}>
+                      {{
+                        icon: () => (
+                          <Image src={state.vipYearInfo.goodsUrl} class={styles.goodsImg} />
+                        ),
+                        value: () => (
+                          <div class={styles.vipYearInfo}>
+                            <div class={styles.goodsTitle}>
+                              {state.vipYearInfo.goodsName} <img src={icon12} />
+                            </div>
+                            <p class={styles.goodsTips}>乐团首次训练之日起生效</p>
+                            <p class={[styles.goodsMemo, 'van-multi-ellipsis--l2']}>
+                              {state.vipYearInfo.description}
                             </p>
-                          </div>
-                          {/* <del class={styles.priceOrigin}>
+                            <div class={styles.goodsPrice}>
+                              <div class={styles.priceGroup}>
+                                团购价:
+                                <p>
+                                  <span>¥</span> {moneyFormat(state.vipYearInfo.currentPrice)}
+                                </p>
+                              </div>
+                              {/* <del class={styles.priceOrigin}>
                             原价: ¥{moneyFormat(state.vipYearInfo.originalPrice)}
                           </del> */}
-                        </div>
-                      </div>
-                    )
-                  }}
-                </Cell>
-                <Cell border={false}>
-                  {{
-                    icon: () => <Image src={state.goodsInfo.goodsUrl} class={styles.goodsImg} />,
-                    value: () => (
-                      <div class={styles.goodsInfo}>
-                        <div class={styles.goodsTitle}>
-                          {state.goodsInfo.goodsName}
-                          {state.goodsInfo.currentPrice <= 0 ? <img src={iconFree} /> : ''}
-                        </div>
-                        <p class={[styles.goodsMemo, 'van-multi-ellipsis--l2']}>
-                          {state.goodsInfo.description}
-                        </p>
-                        <div class={styles.goodsPrice}>
-                          <div class={styles.priceGroup}>
-                            团购价:
-                            <p>
-                              {state.goodsInfo.currentPrice <= 0 ? (
-                                <del>
-                                  <span>¥</span> {moneyFormat(state.goodsInfo.groupPrice)}
-                                </del>
-                              ) : (
-                                <>
-                                  <span>¥</span> {moneyFormat(state.goodsInfo.currentPrice)}
-                                </>
-                              )}
-                            </p>
+                            </div>
                           </div>
-                          {/* {state.goodsInfo.currentPrice > 0 ? (
+                        )
+                      }}
+                    </Cell>
+                    <Cell border={false}>
+                      {{
+                        icon: () => (
+                          <Image src={state.goodsInfo.goodsUrl} class={styles.goodsImg} />
+                        ),
+                        value: () => (
+                          <div class={styles.goodsInfo}>
+                            <div class={styles.goodsTitle}>
+                              {state.goodsInfo.goodsName}
+                              {state.goodsInfo.currentPrice <= 0 ? <img src={iconFree} /> : ''}
+                            </div>
+                            <p class={[styles.goodsMemo, 'van-multi-ellipsis--l2']}>
+                              {state.goodsInfo.description}
+                            </p>
+                            <div class={styles.goodsPrice}>
+                              <div class={styles.priceGroup}>
+                                团购价:
+                                <p>
+                                  {state.goodsInfo.currentPrice <= 0 ? (
+                                    <del>
+                                      <span>¥</span> {moneyFormat(state.goodsInfo.groupPrice)}
+                                    </del>
+                                  ) : (
+                                    <>
+                                      <span>¥</span> {moneyFormat(state.goodsInfo.currentPrice)}
+                                    </>
+                                  )}
+                                </p>
+                              </div>
+                              {/* {state.goodsInfo.currentPrice > 0 ? (
                             <>
                               <div class={styles.priceGroup}>
                                 团购价:
@@ -822,154 +862,158 @@ export default defineComponent({
                               </div>
                             </>
                           )} */}
-                        </div>
-                      </div>
-                    )
-                  }}
-                </Cell>
-
-                {otherParams.leBao.show ? (
-                  <Cell
-                    class={styles.inspectCell}
-                    style={{ backgroundColor: state.inspectStatus ? '#FFF3EA' : '#f4f4f4' }}
-                  >
-                    {{
-                      icon: () => (
-                        <img
-                          src={iconBao}
-                          class={styles.iconBao}
-                          onClick={() => {
-                            if (state.instrumentsInspectionDescribe) state.inspectPopupStatus = true
-                          }}
-                        />
-                      ),
-                      value: () => (
-                        <div class={styles.baoContainer}>
-                          <div
-                            class={styles.baoTitle}
-                            onClick={() => {
-                              if (state.instrumentsInspectionDescribe)
-                                state.inspectPopupStatus = true
-                            }}
-                          >
-                            下校检查乐器 1-2次/学期
+                            </div>
                           </div>
-                          <div class={styles.baoPrice}>
-                            <p
-                              onClick={() => {
-                                state.inspectStatus = !state.inspectStatus
-                                calcPrice()
-                              }}
-                            >
-                              <span class={styles.prefix}>¥</span> {state.inspectInfo.currentPrice}
-                              <span class={styles.suffix}>/年</span>
-                            </p>
-                            <Checkbox
-                              v-model={state.inspectStatus}
+                        )
+                      }}
+                    </Cell>
+
+                    {otherParams.leBao.show ? (
+                      <Cell
+                        class={styles.inspectCell}
+                        style={{ backgroundColor: state.inspectStatus ? '#FFF3EA' : '#f4f4f4' }}
+                      >
+                        {{
+                          icon: () => (
+                            <img
+                              src={iconBao}
+                              class={styles.iconBao}
                               onClick={() => {
-                                calcPrice()
+                                if (state.instrumentsInspectionDescribe)
+                                  state.inspectPopupStatus = true
                               }}
-                            >
-                              {{
-                                icon: (props: any) => (
-                                  <img
-                                    class={styles.checkboxImg}
-                                    src={props.checked ? iconCheckboxActive : iconCheckbox}
-                                  />
-                                )
-                              }}
-                            </Checkbox>
-                          </div>
+                            />
+                          ),
+                          value: () => (
+                            <div class={styles.baoContainer}>
+                              <div
+                                class={styles.baoTitle}
+                                onClick={() => {
+                                  if (state.instrumentsInspectionDescribe)
+                                    state.inspectPopupStatus = true
+                                }}
+                              >
+                                下校检查乐器 1-2次/学期
+                              </div>
+                              <div class={styles.baoPrice}>
+                                <p
+                                  onClick={() => {
+                                    state.inspectStatus = !state.inspectStatus
+                                    calcPrice()
+                                  }}
+                                >
+                                  <span class={styles.prefix}>¥</span>{' '}
+                                  {state.inspectInfo.currentPrice}
+                                  <span class={styles.suffix}>/年</span>
+                                </p>
+                                <Checkbox
+                                  v-model={state.inspectStatus}
+                                  onClick={() => {
+                                    calcPrice()
+                                  }}
+                                >
+                                  {{
+                                    icon: (props: any) => (
+                                      <img
+                                        class={styles.checkboxImg}
+                                        src={props.checked ? iconCheckboxActive : iconCheckbox}
+                                      />
+                                    )
+                                  }}
+                                </Checkbox>
+                              </div>
+                            </div>
+                          )
+                        }}
+                      </Cell>
+                    ) : (
+                      ''
+                    )}
+                  </CellGroup>
+                  <OSticky position="bottom">
+                    <div class={styles.paymentContainer}>
+                      <div class={styles.payemntPrice}>
+                        <p class={styles.needPrice}>
+                          总计:
+                          <span class={styles.numFont}>
+                            <span>¥ </span>
+
+                            {moneyFormat(state.orderInfo.needPrice)}
+                          </span>
+                        </p>
+                      </div>
+                      <div class={styles.paymentBtn}>
+                        <Button
+                          color="linear-gradient(135deg, #FF8C4A 0%, #FF531C 100%)"
+                          round
+                          native-type="submit"
+                        >
+                          团购支付
+                        </Button>
+                      </div>
+                    </div>
+                  </OSticky>
+                </>
+              )}
+
+              {forms.groupBuyType === 'SELF' && (
+                <>
+                  <CellGroup class={[styles.applyCellGroup, styles.self]} border={false}>
+                    <div
+                      class={styles.toolImg}
+                      onClick={() => {
+                        showImagePreview([state.registerInfo?.instrumentPriceImg])
+                        localStorage.setItem('read-tool-image', '1')
+                        state.toolImgStatus = true
+                      }}
+                    >
+                      <Image src={state.registerInfo?.instrumentPriceImg} />
+
+                      {!state.toolImgStatus && (
+                        <div class={styles.toolImgOverflow}>
+                          <Button>点击查看《乐团训练工具标准配置表》</Button>
+                          <img src={iconHead} class={styles.iconHead} />
                         </div>
-                      )
-                    }}
-                  </Cell>
-                ) : (
-                  ''
-                )}
-              </CellGroup>
-              <OSticky position="bottom">
-                <div class={styles.paymentContainer}>
-                  <div class={styles.payemntPrice}>
-                    <p class={styles.needPrice}>
-                      总计:
-                      <span class={styles.numFont}>
-                        <span>¥ </span>
+                      )}
+                    </div>
+                    <Field
+                      required
+                      label="您计划配置的乐器品牌"
+                      labelAlign="top"
+                      border={false}
+                      placeholder="请填写您计划配置的乐器品牌"
+                      v-model={forms.instrumentsBrand}
+                      maxlength={20}
+                      class={styles.toolInput}
+                      rules={[{ required: true, message: '请填写您计划配置的乐器品牌' }]}
+                    />
+                    <Field
+                      style="padding-top: 0;"
+                      required
+                      label="您计划配置的AI学练工具品牌"
+                      labelAlign="top"
+                      border={false}
+                      class={styles.toolInput}
+                      placeholder="请填写您计划配置的AI学练工具品牌"
+                      v-model={forms.learningTools}
+                      maxlength={20}
+                      rules={[{ required: true, message: '请填写您计划配置的AI学练工具品牌' }]}
+                    />
+                  </CellGroup>
 
-                        {moneyFormat(state.orderInfo.needPrice)}
-                      </span>
-                    </p>
-                  </div>
-                  <div class={styles.paymentBtn}>
+                  <div class={'btnGroup'} style={{ paddingTop: '30px' }}>
                     <Button
+                      type="primary"
                       color="linear-gradient(135deg, #FF8C4A 0%, #FF531C 100%)"
                       round
+                      block
                       native-type="submit"
                     >
-                      团购支付
+                      提交
                     </Button>
                   </div>
-                </div>
-              </OSticky>
-            </>
-          )}
-
-          {forms.groupBuyType === 'SELF' && (
-            <>
-              <CellGroup class={[styles.applyCellGroup, styles.self]} border={false}>
-                <div
-                  class={styles.toolImg}
-                  onClick={() => {
-                    showImagePreview([state.registerInfo?.instrumentPriceImg])
-                    localStorage.setItem('read-tool-image', '1')
-                    state.toolImgStatus = true
-                  }}
-                >
-                  <Image src={state.registerInfo?.instrumentPriceImg} />
-
-                  {!state.toolImgStatus && (
-                    <div class={styles.toolImgOverflow}>
-                      <Button>点击查看《乐团训练工具标准配置表》</Button>
-                      <img src={iconHead} class={styles.iconHead} />
-                    </div>
-                  )}
-                </div>
-                <Field
-                  required
-                  label="您计划配置的乐器品牌"
-                  labelAlign="top"
-                  border={false}
-                  placeholder="请填写您计划配置的乐器品牌"
-                  v-model={forms.instrumentsBrand}
-                  maxlength={20}
-                  class={styles.toolInput}
-                  rules={[{ required: true, message: '请填写您计划配置的乐器品牌' }]}
-                />
-                <Field
-                  style="padding-top: 0;"
-                  required
-                  label="您计划配置的AI学练工具品牌"
-                  labelAlign="top"
-                  border={false}
-                  class={styles.toolInput}
-                  placeholder="请填写您计划配置的AI学练工具品牌"
-                  v-model={forms.learningTools}
-                  maxlength={20}
-                  rules={[{ required: true, message: '请填写您计划配置的AI学练工具品牌' }]}
-                />
-              </CellGroup>
-
-              <div class={'btnGroup'} style={{ paddingTop: '30px' }}>
-                <Button
-                  type="primary"
-                  color="linear-gradient(135deg, #FF8C4A 0%, #FF531C 100%)"
-                  round
-                  block
-                  native-type="submit"
-                >
-                  提交
-                </Button>
-              </div>
+                </>
+              )}
             </>
           )}
         </Form>

+ 1 - 1
vite.config.ts

@@ -12,7 +12,7 @@ function resolve(dir: string) {
 // https://vitejs.dev/config/
 // https://github.com/vitejs/vite/issues/1930 .env
 // const proxyUrl = 'https://online.lexiaoya.cn/';
-const proxyUrl = 'https://test.lexiaoya.cn/'
+const proxyUrl = 'https://dev.lexiaoya.cn/'
 // const proxyUrl = 'http://47.98.131.38:8989/'
 // const proxyUrl = 'http://192.168.3.20:8989/' // 邹旋
 // const proxyUrl = 'http://192.168.3.143:8989/' // 尚科