Browse Source

修改判断显示

lex 1 year ago
parent
commit
aea0330ca5
2 changed files with 8 additions and 5 deletions
  1. 6 3
      src/views/student-register/order-detail.tsx
  2. 2 2
      vite.config.ts

+ 6 - 3
src/views/student-register/order-detail.tsx

@@ -47,6 +47,7 @@ export default defineComponent({
       authShow: false, // 是否进行实名认证
       selectGoodsId: null as any,
       currentPrice: 0,
+      hasInstrument: false, // 是否有乐器
       dialogStatus: false,
       dialogMessage: '',
       submitStatus: false
@@ -82,6 +83,7 @@ export default defineComponent({
 
         // 判断运费状态
         // 如果没有购买商品,有购买教材则『到付』 其它则免运费
+        state.hasInstrument = hasInstrument;
         if (hasInstrument) {
           state.freight = '到付';
         } else {
@@ -263,7 +265,7 @@ export default defineComponent({
      */
     const buyOrchestra = async (callback: any) => {
       // 请选择收货地址
-      if (!addressDetails.value.id) {
+      if (!addressDetails.value.id && state.hasInstrument) {
         showToast('请选择收货地址');
         return;
       }
@@ -288,7 +290,7 @@ export default defineComponent({
             data: {
               orderNo: state.orderNo,
               orderType: 'SCHOOL_REGISTER',
-              receiveAddress: addressDetails.value.id
+              receiveAddress: addressDetails.value.id || ''
             }
           }
         );
@@ -361,7 +363,8 @@ export default defineComponent({
         {browser().isApp && <OHeader border={false} />}
         <div class={styles.cartConfirm}>
           {/* 只有乐团购买的时候显示收货地址 */}
-          {orderType.value === 'SCHOOL_REGISTER' && (
+          {/* {orderType.value === 'SCHOOL_REGISTER' && } */}
+          {state.hasInstrument && (
             <div class={styles.cartConfirmBox}>
               <Addres item={addressDetails.value} />
             </div>

+ 2 - 2
vite.config.ts

@@ -13,8 +13,8 @@ function resolve(dir: string) {
 }
 // https://vitejs.dev/config/
 // https://github.com/vitejs/vite/issues/1930 .env
-// const proxyUrl = 'https://test.lexiaoya.cn/';
-const proxyUrl = 'https://dev.kt.colexiu.com/';
+const proxyUrl = 'https://test.lexiaoya.cn/';
+// const proxyUrl = 'https://dev.kt.colexiu.com/';
 // const proxyUrl = 'http://192.168.3.143:7989/';
 export default defineConfig({
   base: './',