lex 1 year ago
parent
commit
69e8de84d5

+ 0 - 435
src/views/student-register/index copy.tsx

@@ -1,435 +0,0 @@
-import {
-  Image,
-  Cell,
-  CellGroup,
-  Tag,
-  Button,
-  Stepper,
-  Icon,
-  Popup,
-  showConfirmDialog,
-  showToast
-} from 'vant';
-import { computed, defineComponent, onMounted, reactive } from 'vue';
-import styles from './index.module.less';
-import iconGift from './images/icon-gift.png';
-import shopEmpty from './images/shop-empty.png';
-import iconDateMember from './images/icon-date-member.png';
-import MSticky from '@/components/m-sticky';
-import MVideo from '@/components/m-video';
-import { useRoute, useRouter } from 'vue-router';
-import RegisterModal from './register-modal';
-import { useStudentRegisterStore } from '@/store/modules/student-register-store';
-import request from '@/helpers/request';
-import { browser, moneyFormat } from '@/helpers/utils';
-import deepClone from '@/helpers/deep-clone';
-import OWxTip from '@/components/m-wx-tip';
-import MDialog from '@/components/m-dialog';
-
-export default defineComponent({
-  name: 'student-register',
-  setup() {
-    const route = useRoute();
-    const studentRegisterStore = useStudentRegisterStore();
-    const router = useRouter();
-    // 初始化学校编号
-    studentRegisterStore.setShoolId(route.query.sId as any);
-    const forms = reactive({
-      schoolId: route.query.sId as any,
-      paymentType: '', // 支付类型
-      popupShow: false,
-      details: [] as any[],
-      schoolType: '', // 学校类型
-      gradeYear: '', // 学制
-      bugGoods: false, // 是否购买AI
-      registerType: '', // 报名类型
-      giftVipDay: 0, // 赠送天数
-      submitLoading: false,
-      showMore: true,
-      showTips: false,
-      showButton: false,
-      showMessage: '请使用微信扫描二维码'
-    });
-
-    const getRegisterGoods = async () => {
-      try {
-        const { data } = await request.get(
-          '/edu-app/open/userOrder/registerGoods/' + forms.schoolId,
-          {
-            noAuthorization: true // 是否请求接口的时候添加toekn
-          }
-        );
-        // 默认选中商品
-        studentRegisterStore.setVip(data.details || []);
-        forms.details = deepClone(data.details || []);
-        if (forms.details.length > 0) {
-          forms.giftVipDay = forms.details[0].membershipDays;
-        }
-        forms.bugGoods = data.bugGoods;
-        forms.schoolType = data.schoolType;
-        forms.gradeYear = data.gradeYear;
-        forms.registerType = data.registerType;
-        if (browser().weixin) {
-          if (data.registerType !== 'BUG_GOODS' || data.schoolStatus === 0) {
-            forms.showTips = true;
-            forms.showMessage = '二维码已经失效,详情请咨询学校老师';
-            forms.showButton = false;
-          }
-        } else {
-          forms.showTips = true;
-        }
-      } catch {}
-    };
-
-    // 计算金额
-    const calcPrice = computed(() => {
-      let amount: number = 0; //现价
-      let originAmount: number = 0; // 原价
-      const vipList: any[] = studentRegisterStore.getVip;
-      vipList.forEach((vip: any) => {
-        amount += Number(vip.currentPrice);
-        originAmount += Number(vip.originalPrice);
-      });
-
-      const goodsList: any[] = studentRegisterStore.getGoods;
-      goodsList.forEach((good: any) => {
-        amount += Number(good.price) * good.quantity;
-        originAmount += Number(good.originalPrice) * good.quantity;
-      });
-      return {
-        amount,
-        originAmount
-      };
-    });
-
-    // 删除商品
-    const onGoodsRemove = (item: any) => {
-      showConfirmDialog({
-        message: '是否删除该商品',
-        confirmButtonColor: '#FF8633'
-      }).then(() => {
-        studentRegisterStore.deleteGoods(item.productSkuId);
-      });
-    };
-
-    // 登记成功之后购买
-    const onRegisterSubmit = async () => {
-      try {
-        forms.submitLoading = true;
-
-        // 检测token是否失效
-        // const Authorization = storage.get(ACCESS_TOKEN) || '';
-        // const authInfo = await request.post('/edu-app/open/user/verification', {
-        //   noAuthorization: true,
-        //   data: { token: Authorization }
-        // });
-        // // 判断当前token是否失效
-        // if (!authInfo.data) {
-        //   storage.remove(ACCESS_TOKEN);
-        //   studentRegisterStore.deleteToken();
-        //   forms.popupRegister = true;
-        //   return;
-        // }
-
-        // // 请求是否有待支付订单,如果有则自动关闭
-        // const status = await paymentOrderUnpaid();
-        // if (status) return;
-        // const schoolInfo = await request.get(
-        //   '/edu-app/userPaymentOrder/registerStatus/' + forms.schoolId
-        // );
-        // const vipList = studentRegisterStore.getVip;
-
-        // if (schoolInfo.data.hasBuyCourse && vipList.length > 0) {
-        //   // setTimeout(() => {
-        //   //   showToast('您已购买乐器AI学练工具,请勿重复购买');
-        //   // }, 100);
-        //   forms.dialogConfirmStatus = true;
-        //   return;
-        // }
-        // await paymentContinue();
-
-        router.push({
-          path: '/student-register-form',
-          query: {
-            schoolId: forms.schoolId
-          }
-        });
-      } finally {
-        forms.submitLoading = false;
-      }
-    };
-
-    onMounted(async () => {
-      try {
-        getRegisterGoods();
-      } catch {}
-    });
-
-    return () => (
-      <div class={styles['student-register']}>
-        <div class={styles.studentSection} style={{ marginTop: '18px' }}>
-          <div class={styles.titleTool}></div>
-          {forms.details.map((item: any) => (
-            <CellGroup
-              class={styles.goodsSection}
-              onClick={() => {
-                if (studentRegisterStore.selectedVip(item.goodsId)) {
-                  studentRegisterStore.deleteVip(item.goodsId);
-                } else {
-                  studentRegisterStore.setVip([item]);
-                }
-              }}>
-              <Cell border={false} class={styles.goodsCell}>
-                {{
-                  icon: () => <Image class={styles.img} src={item.goodsUrl} />,
-                  title: () => (
-                    <div class={styles.section}>
-                      <div class={styles.sectionContent}>
-                        <h2>
-                          <img
-                            src={iconDateMember}
-                            class={styles.iconDateMember}
-                          />
-                        </h2>
-
-                        <p
-                          class={[
-                            styles.model,
-                            forms.showMore ? styles.more : ''
-                          ]}>
-                          {item.description}
-                        </p>
-                        {item.description &&
-                        item.description.length >= 36 &&
-                        forms.showMore ? (
-                          <span
-                            class={styles.moreBtn}
-                            onClick={(e: MouseEvent) => {
-                              e.stopPropagation();
-                              forms.showMore = false;
-                            }}>
-                            查看更多
-                            <Icon name="arrow-down" color="#aaa" />
-                          </span>
-                        ) : (
-                          ''
-                        )}
-
-                        {/* <div class={styles.sbtnGroup}>
-                          <span
-                            class={styles.btnDetail}
-                            onClick={(e: MouseEvent) => {
-                              e.stopPropagation();
-                              router.push('/student-digital-tools');
-                            }}>
-                            查看详情
-                          </span>
-                          <span
-                            class={styles.btnVideo}
-                            onClick={(e: MouseEvent) => {
-                              e.stopPropagation();
-                              forms.popupShow = true;
-                            }}>
-                            介绍视频
-                          </span>
-                        </div> */}
-                      </div>
-
-                      <i
-                        class={
-                          studentRegisterStore.selectedVip(item.goodsId)
-                            ? styles.selected
-                            : styles.noSelected
-                        }></i>
-                    </div>
-                  )
-                }}
-              </Cell>
-              <Cell border={false} class={styles.priceCell}>
-                {{
-                  title: () => (
-                    <div class={styles.sPriceGroup}>
-                      <div class={styles.tg}>
-                        团购价:
-                        <span>
-                          <i>¥ </i>
-                          {moneyFormat(item.currentPrice)}
-                        </span>
-                      </div>
-                      {item.currentPrice < item.originalPrice && (
-                        <del>¥{moneyFormat(item.originalPrice)}</del>
-                      )}
-                    </div>
-                  )
-                }}
-              </Cell>
-              {item.membershipDays > 0 && (
-                <Cell border={false} class={styles.giftCell}>
-                  {{
-                    title: () => (
-                      <div class={styles.gift}>
-                        <img src={iconGift} class={styles.iconGift} />
-                        现在购买赠送 <span>{item.membershipDays || 0}</span>
-                        天有效期
-                      </div>
-                    )
-                  }}
-                </Cell>
-              )}
-            </CellGroup>
-          ))}
-        </div>
-
-        {forms.bugGoods && (
-          <>
-            <div class={styles.studentSection}>
-              <div class={styles.titleBuy}></div>
-              {studentRegisterStore.getGoods &&
-              studentRegisterStore.getGoods.length <= 0 ? (
-                <div class={styles.goodsEmpty}>
-                  <img src={shopEmpty} class={styles.shopImg} />
-                  <div class={styles.goodsContainer}>
-                    <h2>
-                      为你的<span>音乐之旅</span>做好准备
-                    </h2>
-                    <p class={styles.tips}>快去选购乐器吧~</p>
-                    <Button
-                      class={styles.goSelect}
-                      type="primary"
-                      onClick={() => {
-                        router.push('/goods-list');
-                      }}>
-                      进入商城选购
-                      <Icon name="arrow" />
-                    </Button>
-                  </div>
-                </div>
-              ) : (
-                studentRegisterStore.getGoods.map((goods: any) => (
-                  <CellGroup class={styles.goodsSection}>
-                    <Cell border={false} class={styles.goodsCell}>
-                      {{
-                        icon: () => (
-                          <Image class={styles.img} src={goods.pic} />
-                        ),
-                        title: () => (
-                          <div class={styles.section}>
-                            <div class={styles.sectionContent}>
-                              <h2>
-                                {goods.name}
-                                <Tag class={styles.brandName}>
-                                  {goods.brandName}
-                                </Tag>
-                              </h2>
-                              <p class={[styles.model]}>
-                                规格:{goods.spDataJson}
-                              </p>
-                              <p class={[styles.model]}>{goods.productSn}</p>
-
-                              <Stepper
-                                min={1}
-                                max={99}
-                                v-model={goods.quantity}
-                                disableInput
-                              />
-                            </div>
-
-                            <i
-                              class={styles.delete}
-                              onClick={() => onGoodsRemove(goods)}></i>
-                          </div>
-                        )
-                      }}
-                    </Cell>
-                    <Cell border={false} class={styles.priceCell}>
-                      {{
-                        title: () => (
-                          <div class={styles.sPriceGroup}>
-                            <div class={styles.tg}>
-                              团购价:
-                              <span>
-                                <i>¥ </i>
-                                {moneyFormat(goods.price)}
-                              </span>
-                            </div>
-                            {goods.price < goods.originalPrice && (
-                              <del>¥{moneyFormat(goods.originalPrice)}</del>
-                            )}
-                          </div>
-                        )
-                      }}
-                    </Cell>
-                  </CellGroup>
-                ))
-              )}
-            </div>
-            {studentRegisterStore.getGoods &&
-              studentRegisterStore.getGoods.length > 0 && (
-                <Button
-                  class={styles.addButton}
-                  block
-                  onClick={() => {
-                    router.push('/goods-list');
-                  }}>
-                  <Icon name="add-o" />
-                  进入商城选购
-                </Button>
-              )}
-          </>
-        )}
-
-        <MSticky position="bottom">
-          <div class={styles.paymentContainer}>
-            <div class={styles.payemntPrice}>
-              <span class={styles.needPrice}>
-                <i style="font-style: normal">¥ </i>
-                <span>{moneyFormat(calcPrice.value.amount)}</span>
-              </span>
-              {calcPrice.value.originAmount > calcPrice.value.amount ? (
-                <del class={styles.allPrice}>
-                  ¥ {moneyFormat(calcPrice.value.originAmount)}
-                </del>
-              ) : (
-                ''
-              )}
-            </div>
-            <div
-              class={styles.paymentBtn}
-              onClick={() => {
-                const vipList = studentRegisterStore.getVip;
-                const goodsList = studentRegisterStore.getGoods;
-                if (vipList.length <= 0 && goodsList.length <= 0) {
-                  setTimeout(() => {
-                    showToast('请选择需要购买的商品');
-                  }, 100);
-                  return;
-                }
-                onRegisterSubmit();
-              }}>
-              <Button
-                disabled={forms.submitLoading}
-                loading={forms.submitLoading}>
-                确认购买
-              </Button>
-            </div>
-          </div>
-        </MSticky>
-
-        <Popup v-model:show={forms.popupShow} class={styles.videoPopup}>
-          {forms.popupShow && (
-            <MVideo src={'https://oss.dayaedu.com/daya/202105/SWmqmvW.mp4'} />
-          )}
-        </Popup>
-
-        {/* 是否在微信中打开 */}
-        <OWxTip
-          show={forms.showTips}
-          message={forms.showMessage}
-          showButton={forms.showButton}
-          buttonText="刷新"
-          onConfirm={() => window.location.reload()}
-        />
-      </div>
-    );
-  }
-});

+ 0 - 439
src/views/student-register/index-origin.module.less

@@ -1,439 +0,0 @@
-.student-register {
-  min-height: 100vh;
-  background: #FFF4E2;
-  overflow: hidden;
-
-  --k-font-primary: #FF8021;
-}
-
-.studentSection {
-  position: relative;
-  z-index: 1;
-  margin: 12px;
-  overflow: inherit;
-
-  &::before {
-    position: absolute;
-    top: 0;
-    left: 0;
-    right: 0;
-    content: ' ';
-    background: linear-gradient(180deg, #FFFFFF 0%, #FFDAB4 53%, #FFFFFF 100%);
-    box-shadow: 0px 1px 6px 0px #F0DDC8;
-    border-radius: 18px;
-    height: 120px;
-    z-index: -1;
-  }
-
-  .goodsSection {
-    border-radius: 18px 18px;
-    box-shadow: 0px 1px 6px 0px #F0D8C8;
-    border-radius: 18px;
-    overflow: hidden;
-    background: transparent;
-    margin-bottom: 12px;
-
-    &:last-child {
-      margin-bottom: 0;
-    }
-  }
-}
-
-.titleTool {
-  position: relative;
-  z-index: 9;
-  margin: 14px auto 4px;
-  width: 314px;
-  height: 35px;
-  background: url('./images/tool-title.png') no-repeat center;
-  background-size: contain;
-}
-
-.titleBuy {
-  margin: 14px auto 4px;
-  width: 259px;
-  height: 35px;
-  background: url('./images/buy-title.png') no-repeat center;
-  background-size: contain;
-}
-
-.goodsCell {
-  position: relative;
-  border-radius: 18px 18px 0px 0px;
-  padding: 12px 14px 0;
-
-  .noSelected,
-  .selected,
-  .delete {
-    position: absolute;
-    top: 0;
-    right: 0;
-    width: 29px;
-    height: 23px;
-  }
-
-  .selected {
-    background: url('./images/icon-checkbox-active.png') no-repeat center;
-    background-size: contain;
-  }
-
-  .noSelected {
-    background: url('./images/icon-checkbox-default.png') no-repeat center;
-    background-size: contain;
-  }
-
-  .delete {
-    background: url('./images/icon-delete-active.png') no-repeat center;
-    background-size: contain;
-  }
-
-  .img {
-    margin-right: 16px;
-    width: 98px;
-    height: 98px;
-    border-radius: 10px;
-    overflow: hidden;
-  }
-
-  h2 {
-    display: flex;
-    align-items: center;
-    font-size: 16px;
-    font-weight: 600;
-    color: #333333;
-    line-height: 22px;
-  }
-
-  .brandName {
-    margin-left: 4px;
-    font-size: 12px;
-    font-weight: 400;
-    color: #BE7332;
-    line-height: 17px;
-    height: 18px;
-    background-color: #FFF5E6;
-    border-radius: 4px;
-    border: 1px solid #FFE9D9;
-  }
-
-  .iconDateMember {
-    height: 20px;
-    width: 108px;
-  }
-
-  .model {
-    margin: 10px 0 6px;
-    font-size: 13px;
-    color: #E44D0F;
-    line-height: 18px;
-
-    span {
-      color: #FF5A56;
-      font-weight: bold;
-    }
-
-    &.more {
-      height: 36px;
-      overflow: hidden;
-    }
-  }
-
-  .moreBtn {
-    color: #aaa;
-    font-size: 12px;
-
-    :global {
-      .van-icon {
-        margin-left: 4px;
-      }
-    }
-  }
-
-  .sbtnGroup {
-    display: flex;
-
-    &>span {
-      font-size: 12px;
-      font-weight: 600;
-      color: #AF540D;
-      line-height: 18px;
-      border-radius: 9px;
-      border: 1px solid rgba(175, 84, 13, .62);
-      padding: 0 6px;
-    }
-
-    .btnDetail,
-    .btnVideo {
-      display: flex;
-      align-items: center;
-
-      &:after {
-        content: ' ';
-        background: url('./images/icon-btn-right.png') no-repeat center;
-        width: 12px;
-        height: 12px;
-        background-size: contain;
-        margin-left: 6px;
-        display: inline-block;
-      }
-    }
-
-    .btnDetail {
-      margin-right: 6px;
-    }
-
-    .btnVideo:after {
-      content: ' ';
-      background: url('./images/icon-btn-video.png') no-repeat center;
-      background-size: contain;
-    }
-  }
-
-  :global {
-
-    .van-stepper__minus,
-    .van-stepper__plus,
-    .van-stepper__input {
-      background-color: #FFF4E7;
-    }
-
-    .van-stepper__minus,
-    .van-stepper__plus {
-      color: #BF7434;
-    }
-
-    .van-stepper__input {
-      color: #8C6142;
-    }
-
-    .van-stepper__minus {
-      border-radius: 100px 0px 0px 100px;
-    }
-
-    .van-stepper__plus {
-      border-radius: 0px 100px 100px 0px;
-    }
-  }
-}
-
-.priceCell {
-  padding: 16px 14px 10px;
-
-  .sPriceGroup {
-    display: flex;
-    align-items: center;
-    padding: 0 10px;
-    height: 34px;
-    background: #FFF1EC;
-    border-radius: 20px;
-
-    .tg {
-      font-size: 14px;
-      color: #333333;
-      line-height: 20px;
-
-      span {
-        font-size: 22px;
-        font-family: DINAlternate-Bold, DINAlternate;
-        font-weight: bold;
-        color: #FC1A19;
-
-        i {
-          font-style: normal;
-          font-size: 14px;
-        }
-      }
-
-    }
-
-    del {
-      padding-left: 10px;
-      font-size: 14px;
-      font-family: DINAlternate-Bold, DINAlternate;
-      font-weight: bold;
-      color: #8C6142;
-      line-height: 16px;
-      opacity: 0.5;
-    }
-  }
-}
-
-.giftCell {
-  padding: 0 19px;
-  background: linear-gradient(90deg, #FF8633 0%, #FFB047 100%);
-  border-radius: 0px 0px 18px 18px;
-
-  .gift {
-    display: flex;
-    align-items: center;
-    font-size: 12px;
-    font-weight: 600;
-    color: #FFFFFF;
-    height: 34px;
-
-    span {
-      font-size: 15px;
-      color: #FFFC89;
-      padding: 0 5px;
-    }
-  }
-
-  .iconGift {
-    margin-right: 4px;
-    width: 18px;
-    height: 18px;
-  }
-}
-
-.goodsEmpty {
-  padding: 0 7px;
-  height: 106px;
-  background: #FFFFFF;
-  // box-shadow: 0px 1px 6px 0px #F0D8C8;
-  border-radius: 18px;
-  display: flex;
-  align-items: center;
-
-  .shopImg {
-    height: 106px;
-    width: 117px;
-  }
-
-  .goodsContainer {
-    h2 {
-      font-size: 16px;
-      color: #333333;
-      line-height: 22px;
-      font-weight: 400;
-
-      span {
-        color: #FF5A56;
-        font-weight: bold;
-      }
-    }
-
-    .tips {
-      font-size: 14px;
-      color: #BE7332;
-      line-height: 20px;
-    }
-
-    .goSelect {
-      margin-top: 5px;
-      height: 29px;
-      background-color: transparent;
-      border: 0;
-      background: #FF8057 linear-gradient(121deg, #FFD892 0%, #FFCB75 100%);
-      border-radius: 6px;
-      font-size: 14px;
-      font-weight: 600;
-      color: #5B2C03;
-
-      :global {
-        .van-button__text {
-          display: flex;
-          align-items: center;
-        }
-
-        .van-icon {
-          font-size: 12px;
-          font-weight: bold;
-        }
-      }
-    }
-  }
-}
-
-.addButton {
-  height: 42px;
-  background: linear-gradient(90deg, #FF8633 0%, #FFB047 100%);
-  border-radius: 22px;
-  margin: 0 12px 12px;
-  width: calc(100% - 24px);
-  border: none;
-
-  :global {
-    .van-icon {
-      margin-right: 5px;
-      font-size: 20px;
-    }
-
-    .van-button__text {
-      font-size: 16px;
-      font-weight: 600;
-      color: #FFFFFF;
-      border: 0 solid;
-      display: flex;
-      align-items: center;
-    }
-  }
-}
-
-.paymentContainer {
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-  font-size: 14px;
-  padding: 18px 12px calc(15px + env(safe-area-inset-bottom)) 12px;
-  background: #FFFFFF;
-  box-shadow: 0px 1px 6px 0px #F0D7C8, inset 0px 1px 3px 0px #FFFFFF;
-  border-radius: 18px 18px 0px 0px;
-
-  .needPrice {
-    color: #333333;
-    padding-bottom: 7px;
-    font-size: 18px;
-    font-family: DINAlternate-Bold, DINAlternate;
-    font-weight: bold;
-    color: #FC1A19;
-    padding-right: 6px;
-
-    span {
-      font-size: 28px;
-      margin-right: 2px;
-    }
-  }
-
-  .allPrice {
-    display: inline-block;
-    font-size: 14px;
-    font-family: DINAlternate-Bold, DINAlternate;
-    font-weight: bold;
-    color: #8C6142;
-    line-height: 16px;
-    opacity: 0.5;
-  }
-
-  :global {
-    .van-button {
-      height: 40px;
-      line-height: 40px;
-      width: 148px;
-      background: #FF8057 linear-gradient(121deg, #FFD892 0%, #FFCB75 100%);
-      border-radius: 12px;
-      font-size: 16px;
-      color: #5B2C03;
-      font-weight: 600;
-      border: 0;
-    }
-  }
-}
-
-.videoPopup {
-  width: 90%;
-  border-radius: 10px;
-  overflow: hidden;
-  transform: none;
-  margin-top: -95px;
-
-  :global {
-
-    .plyr--video {
-      height: 190px !important;
-    }
-
-    .plyr--video.plyr--fullscreen-fallback {
-      height: 100% !important
-    }
-  }
-}

+ 31 - 1
src/views/student-register/index.tsx

@@ -61,6 +61,7 @@ import { beforeSubmit } from './order-state';
 import { useInterval, useIntervalFn } from '@vueuse/core';
 import MPopup from '@/components/m-popup';
 import UserAuth from './component/user-auth';
+import MMessageTip from '@/components/m-message-tip';
 
 const classList: any = [];
 for (let i = 1; i <= 40; i++) {
@@ -121,6 +122,7 @@ export default defineComponent({
       schoolId: route.query.sId as any,
       paymentType: '', // 支付类型
       // popupShow: false,
+      registerDetails: {} as any,
       details: [] as any[],
       // schoolType: '', // 学校类型
       gradeYear: '', // 学制
@@ -275,6 +277,7 @@ export default defineComponent({
         // 默认选中商品
         studentRegisterStore.setVip(data.details || []);
         forms.details = deepClone(data.details || []);
+        forms.registerDetails = data;
 
         forms.registerExpireTime = data.registerExpireTime; // '2024-03-27 17:33:52'; //
         if (forms.registerExpireTime) {
@@ -434,7 +437,7 @@ export default defineComponent({
     };
 
     // 登记成功之后购买
-    const onSubmit = async () => {
+    const onSubmit = async (isRegister = false) => {
       forms.submitLoading = true;
       try {
         if (checkForm()) {
@@ -442,6 +445,20 @@ export default defineComponent({
           return;
         }
         const { extra, ...res } = studentInfo;
+        if (!isRegister) {
+          const checkSchool = await request.get(
+            `/edu-app/open/student/studentSchool?mobile=${studentInfo.username}&code=${studentInfo.password}&type=REGISTER`
+          );
+          if (checkSchool.data?.schoolId !== forms.schoolId) {
+            forms.showOtherSchool = true;
+            forms.showOtherMessage = `您已绑定【${
+              forms.registerDetails.schoolName || ''
+            }】,提交后将更换到【${
+              checkSchool.data?.schoolName
+            }】,是否确认提交?`;
+            return;
+          }
+        }
         const result = await request.post('/edu-app/userlogin', {
           requestType: 'form',
           data: {
@@ -1684,6 +1701,19 @@ export default defineComponent({
           buttonText="刷新"
           onConfirm={() => window.location.reload()}
         />
+
+        <MMessageTip
+          show={forms.showOtherSchool}
+          messageAlign="left"
+          message={forms.showOtherMessage}
+          showCancelButton
+          onCancel={() => (forms.showOtherSchool = false)}
+          onConfirm={() => {
+            forms.showOtherSchool = false;
+            // 直接注册
+            onSubmit(true);
+          }}
+        />
       </div>
     );
   }

+ 1 - 1
src/views/student-register/register-member/index.tsx

@@ -145,7 +145,7 @@ export default defineComponent({
           const checkSchool = await request.get(
             `/edu-app/open/student/studentSchool?mobile=${studentInfo.username}&code=${studentInfo.password}&type=REGISTER`
           );
-          if (checkSchool && checkSchool.schoolId !== forms.schoolId) {
+          if (checkSchool.data?.schoolId !== forms.schoolId) {
             forms.showOtherSchool = true;
             forms.showOtherMessage = `您已绑定【${
               forms.details.name || ''

+ 1 - 1
src/views/student-register/register-modal/index.tsx

@@ -169,7 +169,7 @@ export default defineComponent({
           const checkSchool = await request.get(
             `/edu-app/open/student/studentSchool?mobile=${studentInfo.username}&code=${studentInfo.password}&type=REGISTER`
           );
-          if (checkSchool && checkSchool.schoolId !== forms.schoolId) {
+          if (checkSchool.data?.schoolId !== forms.schoolId) {
             forms.showOtherSchool = true;
             forms.showOtherMessage = `您已绑定【${
               forms.details.schoolName || ''

+ 1 - 1
src/views/student-register/register-new/index.tsx

@@ -201,7 +201,7 @@ export default defineComponent({
           const checkSchool = await request.get(
             `/edu-app/open/student/studentSchool?mobile=${studentInfo.username}&code=${studentInfo.password}&type=REGISTER`
           );
-          if (checkSchool && checkSchool.schoolId !== forms.schoolId) {
+          if (checkSchool.data?.schoolId !== forms.schoolId) {
             forms.showOtherSchool = true;
             forms.showOtherMessage = `您已绑定【${
               forms.details.name || ''

+ 1 - 1
vite.config.ts

@@ -16,7 +16,7 @@ function resolve(dir: string) {
 // const proxyUrl = 'https://test.lexiaoya.cn/';
 // const proxyUrl = 'https://kt.colexiu.com/';
 // const proxyUrl = 'http://192.168.3.143:7989/';
-const proxyUrl = 'https://test.kt.colexiu.com/';
+const proxyUrl = 'https://dev.kt.colexiu.com/';
 export default defineConfig({
   base: './',
   plugins: [