瀏覽代碼

Merge branch 'iteration-school-info' into iteration-20240403-apply

lex 1 年之前
父節點
當前提交
1e2b051d6a

二進制
src/common/images/message-bg.png


二進制
src/common/images/message-top.png


+ 58 - 0
src/components/m-message-tip/index.module.less

@@ -0,0 +1,58 @@
+.wxPopupDialog {
+  // position: relative;
+  overflow: initial;
+
+  // margin-top: -160px;
+  &::before {
+    position: absolute;
+    content: ' ';
+    top: -22px;
+    left: 50%;
+    margin-left: -45px;
+    display: inline-block;
+    background: url('../../common/images/message-top.png') no-repeat top center;
+    background-size: contain;
+    width: 89px;
+    height: 56px;
+  }
+}
+
+.popupContainer {
+  background: url('../../common/images/message-bg.png') no-repeat top center;
+  background-size: cover;
+  border-radius: 20px;
+  overflow: hidden;
+  padding-bottom: 20px;
+  text-align: center;
+
+  .title1 {
+    padding-top: 53px;
+    text-align: center;
+    font-size: 18px;
+    font-weight: 500;
+    color: #000000;
+  }
+
+  .popupTips {
+    font-size: 15px;
+    color: #666666;
+    line-height: 21px;
+    padding: 16px 20px 20px;
+    word-break: break-all;
+  }
+
+  .button {
+    padding: 0 44px;
+    height: 40px;
+    font-size: 16px;
+    color: #333333;
+    border-color: #AAAAAA;
+    margin: 0 7px;
+  }
+
+  .confirmBtn {
+    background: linear-gradient(305deg, #40C8FF 0%, #3192FF 100%);
+    color: #FFFFFF;
+    border: none;
+  }
+}

+ 106 - 0
src/components/m-message-tip/index.tsx

@@ -0,0 +1,106 @@
+import { Button, Popup } from 'vant';
+import { PropType, defineComponent, onMounted, ref, watch } from 'vue';
+import styles from './index.module.less';
+import { browser } from '@/helpers/utils';
+
+export default defineComponent({
+  name: 'm-wx-tip',
+  props: {
+    // 是否显示微信弹窗
+    show: {
+      type: Boolean,
+      default: true
+    },
+    title: {
+      type: String,
+      default: '温馨提示'
+    },
+    message: {
+      type: String,
+      default: '请使用微信打开'
+    },
+    messageAlign: {
+      type: String as PropType<'center' | 'left' | 'right'>,
+      default: 'center'
+    },
+    /** 是否展示取消按钮 */
+    showCancelButton: {
+      type: Boolean,
+      default: false
+    },
+    /** 取消按钮文案 */
+    showCancelButtonText: {
+      type: String,
+      default: '取消'
+    },
+    /** 是否展示确认按钮 */
+    showConfirmButton: {
+      type: Boolean,
+      default: true
+    },
+    /** 确认按钮文案 */
+    showConfirmButtonText: {
+      type: String,
+      default: '确认'
+    }
+  },
+  emits: ['confirm', 'cancel'],
+  setup(props, { emit }) {
+    const showPopup = ref(false);
+    onMounted(() => {
+      if (props.show) {
+        showPopup.value = true;
+      }
+    });
+
+    watch(
+      () => [props.show, props.message],
+      () => {
+        if (props.show) {
+          showPopup.value = true;
+        } else {
+          showPopup.value = false;
+        }
+      }
+    );
+    return () => (
+      <>
+        <Popup
+          v-model:show={showPopup.value}
+          round
+          style={{ width: '88%', maxWidth: '520px' }}
+          closeOnClickOverlay={false}
+          class={styles.wxPopupDialog}>
+          <div class={styles.popupContainer}>
+            <p class={styles.title1} v-html={props.title}></p>
+            <p
+              class={styles.popupTips}
+              style={{ 'text-align': props.messageAlign }}
+              v-html={props.message}></p>
+
+            {(props.showConfirmButton || props.showConfirmButton) && (
+              <div class={styles.btnGroup}>
+                {props.showCancelButton && (
+                  <Button
+                    round
+                    class={[styles.button, styles.cancelBtn]}
+                    onClick={() => emit('cancel')}>
+                    {props.showCancelButtonText}
+                  </Button>
+                )}
+                {props.showConfirmButton && (
+                  <Button
+                    round
+                    class={[styles.button, styles.confirmBtn]}
+                    onClick={() => emit('confirm')}>
+                    {props.showConfirmButtonText}
+                  </Button>
+                )}
+              </div>
+            )}
+          </div>
+        </Popup>
+      </>
+    );
+  }
+});

+ 1 - 1
src/components/m-sticky/index.tsx

@@ -70,7 +70,7 @@ export default defineComponent({
       // resize.observe(divRef.value);
 
       try {
-        useResizeObserver(divRef.value, (entries: any) => {
+        useResizeObserver(div2Ref.value, (entries: any) => {
           const entry = entries[0];
           const { height } = entry.contentRect;
           if (Math.abs(height - forms.heightV) > 1) {

+ 3 - 3
src/components/m-wx-tip/index.module.less

@@ -11,7 +11,7 @@
     left: 50%;
     margin-left: -51px;
     display: inline-block;
-    background: url('../../common/images/wx-no-top.png') no-repeat top center;
+    background: url('../../common/images/message-top.png') no-repeat top center;
     background-size: contain;
     width: 103px;
     height: 56px;
@@ -19,7 +19,7 @@
 }
 
 .popupContainer {
-  background: url('../../common/images/wx-no-bg.png') no-repeat top center;
+  background: url('../../common/images/message-bg.png') no-repeat top center;
   background-size: cover;
   border-radius: 20px;
   overflow: hidden;
@@ -50,4 +50,4 @@
     color: #777;
     border-color: #E7E7E7;
   }
-}
+}

+ 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: {
@@ -1699,6 +1716,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>
     );
   }

+ 36 - 4
src/views/student-register/register-member/index.tsx

@@ -30,6 +30,7 @@ import { setLoginInit, state } from '@/state';
 import iconGift from '../images/icon-gift.png';
 import { useRoute, useRouter } from 'vue-router';
 import MSticky from '@/components/m-sticky';
+import MMessageTip from '@/components/m-message-tip';
 const classList: any = [];
 for (let i = 1; i <= 40; i++) {
   classList.push({ text: i + '班', value: i });
@@ -84,12 +85,15 @@ export default defineComponent({
       classStatus: false,
       loading: false,
       schoolId: route.query.sId as any,
+      details: {} as any,
       gradeYear: null,
       schoolType: null,
       giftVipDay: null,
       showTips: false,
       showButton: false,
-      showMessage: '请使用微信扫描二维码'
+      showMessage: '请使用微信打开',
+      showOtherSchool: false,
+      showOtherMessage: ''
     });
     const studentInfo = reactive({
       autoRegister: true,
@@ -133,10 +137,25 @@ export default defineComponent({
       countDownRef.value.reset();
     };
 
-    const onSubmit = async () => {
+    const onSubmit = async (isRegister = false) => {
       try {
         if (checkForm()) return;
         forms.loading = true;
+        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.details.name || ''
+            }】,提交后将更换到【${
+              checkSchool.data?.schoolName
+            }】,是否确认提交?`;
+            return;
+          }
+        }
+
         await request.get('/edu-app/open/student/schoolQuery', {
           params: {
             schoolId: forms.schoolId,
@@ -209,7 +228,7 @@ export default defineComponent({
         forms.gradeYear = data.gradeYear;
         studentInfo.extra.giftVipDay = data.giftVipDay;
         studentInfo.extra.registerType = data.registerType;
-
+        forms.details = data;
         if (browser().weixin) {
           if (data.registerType !== 'GIFT_VIP_DAY' || data.status === 0) {
             forms.showTips = true;
@@ -374,7 +393,7 @@ export default defineComponent({
             class={styles.submitBtn}
             color="linear-gradient(121deg, #FFD892 0%, #FFCB75 100%)"
             block
-            onClick={onSubmit}
+            onClick={() => onSubmit()}
             disabled={forms.loading}
             loading={forms.loading}>
             确认
@@ -449,6 +468,19 @@ export default defineComponent({
             });
           }}
         />
+
+        <MMessageTip
+          show={forms.showOtherSchool}
+          messageAlign="left"
+          message={forms.showOtherMessage}
+          showCancelButton
+          onCancel={() => (forms.showOtherSchool = false)}
+          onConfirm={() => {
+            forms.showOtherSchool = false;
+            // 直接注册
+            onSubmit(true);
+          }}
+        />
       </div>
     );
   }

+ 36 - 5
src/views/student-register/register-modal/index.tsx

@@ -44,6 +44,7 @@ import Payment from '@/views/adapay/payment';
 import { beforeSubmit } from '../order-state';
 import OPopup from '@/components/m-popup';
 import MSticky from '@/components/m-sticky';
+import MMessageTip from '@/components/m-message-tip';
 const studentRegisterStore = useStudentRegisterStore();
 const classList: any = [];
 for (let i = 1; i <= 40; i++) {
@@ -69,6 +70,7 @@ export default defineComponent({
       gradeStatus: false,
       classStatus: false,
       loading: false,
+      details: {} as any,
       schoolType: '', // 学校类型
       gradeYear: '', // 学制
       bugGoods: false, // 是否购买AI
@@ -82,6 +84,8 @@ export default defineComponent({
       countDownTimePay: 60 * 1000,
       dialogConfig: {} as any,
       showMore: true,
+      showOtherSchool: false,
+      showOtherMessage: '',
       showTips: false,
       showButton: false,
       showMessage: '请使用微信扫描二维码'
@@ -156,11 +160,26 @@ export default defineComponent({
       countDownRef.value.reset();
     };
 
-    const onSubmit = async () => {
+    const onSubmit = async (isRegister = false) => {
       try {
         if (checkForm()) return;
         forms.loading = true;
         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.details.schoolName || ''
+            }】,提交后将更换到【${
+              checkSchool.data?.schoolName
+            }】,是否确认提交?`;
+            return;
+          }
+        }
+
         const result = await request.post('/edu-app/userlogin', {
           // hideLoading: false,
           requestType: 'form',
@@ -320,7 +339,7 @@ export default defineComponent({
       //   amount += Number(good.price) * good.quantity;
       //   originAmount += Number(good.originalPrice) * good.quantity;
       // });
-      console.log(studentRegisterStore.getVip);
+      // console.log(studentRegisterStore.getVip);
       return {
         amount,
         originAmount
@@ -749,7 +768,6 @@ export default defineComponent({
               v-model={studentInfo.password}
               maxlength={6}
               onUpdate:modelValue={(val: any) => {
-                console.log(val, 'val');
                 getUserInfos();
               }}>
               {{
@@ -892,7 +910,7 @@ export default defineComponent({
                   )}
                 </div>
               </div>
-              <div class={styles.paymentBtn} onClick={onSubmit}>
+              <div class={styles.paymentBtn} onClick={() => onSubmit()}>
                 <Button round disabled={forms.loading} loading={forms.loading}>
                   立即支付
                 </Button>
@@ -983,7 +1001,7 @@ export default defineComponent({
             //     orderNo: paymentConfig.orderNo
             //   }
             // });
-            console.log(forms.dialogConfig, 'dialogConfig');
+            // console.log(forms.dialogConfig, 'dialogConfig');
 
             countDown.pause();
             const paymentConfig = forms.dialogConfig.paymentConfig;
@@ -1039,6 +1057,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>
     );
   }

+ 36 - 3
src/views/student-register/register-new/index.tsx

@@ -34,6 +34,7 @@ import registerBgIcon from '../images/register-bg.png';
 import vipGiftIcon from '../images/vip-gift-icon.png';
 import agreeYes from '../images/agree-yes.png';
 import agreeNo from '../images/agree-no.png';
+import MMessageTip from '@/components/m-message-tip';
 
 const classList: any = [];
 for (let i = 1; i <= 40; i++) {
@@ -89,12 +90,15 @@ export default defineComponent({
       classStatus: false,
       loading: false,
       schoolId: route.query.sId as any,
+      details: {} as any,
       gradeYear: null,
       schoolType: null,
       giftVipDay: null,
       showTips: false,
       showButton: false,
-      showMessage: '请使用微信扫描二维码'
+      showMessage: '请使用微信打开',
+      showOtherSchool: false,
+      showOtherMessage: ''
     });
     const isAgree = ref(false);
     const studentInfo = reactive({
@@ -189,10 +193,25 @@ export default defineComponent({
       countDownRef.value.reset();
     };
 
-    const onSubmit = async () => {
+    const onSubmit = async (isRegister = false) => {
       try {
         if (checkForm()) return;
         forms.loading = true;
+        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.details.name || ''
+            }】,提交后将更换到【${
+              checkSchool.data?.schoolName
+            }】,是否确认提交?`;
+            return;
+          }
+        }
+
         await request.get('/edu-app/open/student/schoolQuery', {
           params: {
             schoolId: forms.schoolId,
@@ -259,6 +278,7 @@ export default defineComponent({
         forms.giftVipDay = data.giftVipDay;
         forms.schoolType = data.schoolType;
         forms.gradeYear = data.gradeYear;
+        forms.details = data;
         studentInfo.extra.giftVipDay = data.giftVipDay;
         studentInfo.extra.registerType = data.registerType;
 
@@ -470,7 +490,7 @@ export default defineComponent({
             class={styles.submitBtn}
             color="linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)"
             block
-            onClick={onSubmit}
+            onClick={() => onSubmit()}
             disabled={forms.loading}
             loading={forms.loading}>
             确认
@@ -545,6 +565,19 @@ export default defineComponent({
             });
           }}
         />
+
+        <MMessageTip
+          show={forms.showOtherSchool}
+          messageAlign="left"
+          message={forms.showOtherMessage}
+          showCancelButton
+          onCancel={() => (forms.showOtherSchool = false)}
+          onConfirm={() => {
+            forms.showOtherSchool = false;
+            // 直接注册
+            onSubmit(true);
+          }}
+        />
       </div>
     );
   }

+ 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: [