Ver Fonte

Merge remote-tracking branch 'origin/master'

sunshihao há 2 dias atrás
pai
commit
4f6542a7a5

+ 3 - 1
xinkeaboard-admin/src/pages/manage/store/edit_settled_store.js

@@ -731,7 +731,9 @@ export default class EditSettledStore extends Component {
           delete params[`storeGradeId_${site.webSite}`];
           delete params[`openTime_${site.webSite}`]
         })
-        
+
+        // 单独处理海外站的storeGradeId便于后端获取海外数据
+        params.storeGradeId = params.storeBusinessVOList.find(item => item.webSite === '1')?.storeGradeId;
         this.props.dispatch({
           type: 'store/edit_settled_store_info',
           payload: params,

+ 3 - 2
xinkeaboard-promotion-portal/src/components/AiAnalysis.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="ai-analysis">
     <div class="ai-analysis-empty" v-if="loading">
-      <Empty :autoFinish="autoFinish" :fail="fail"></Empty>
+      <Empty :autoFinish="autoFinish" :fail="fail" :tip="tip"></Empty>
     </div>
     <Markdown :source="data" v-else />
   </div>
@@ -10,11 +10,12 @@
 <script lang="ts" setup>
 import Markdown from 'vue3-markdown-it';
 
-import { computed } from 'vue';
+import { computed, ref } from 'vue';
 import { useMainStore } from '@/store';
 import Empty from '@/components/CommonEmpty.vue';
 
 const mainStore = useMainStore();
+const tip = ref<string>('大约需要 40-60 秒')
 
 const loading = computed(() => mainStore.getAiAnalysisData.loading);
 const autoFinish = computed(() => mainStore.getAiAnalysisData.autoFinish);

+ 11 - 0
xinkeaboard-promotion-portal/src/components/CommonEmpty.vue

@@ -11,6 +11,7 @@
           }"
         ></div>
       </div>
+      <div class="loading-tip" v-if="!fail && props.tip">{{ props.tip }}</div>
       <div class="loading-wrapper-error" v-if="fail">
         <div class="error-icon">
           <img :src="EmptyIcon" />
@@ -37,6 +38,9 @@ const props = defineProps({
   fail: {
     type: Boolean,
     default: false // true 时失败,进度条停止 & 变红
+  },
+  tip: {
+    type: String
   }
 });
 
@@ -151,6 +155,13 @@ watch(
   margin: 0 auto;
 }
 
+.loading-tip {
+  margin-top: 10px;
+  font-weight: 400;
+  font-size: 14px;
+  color: rgba(40,46,48,0.6);
+}
+
 .progress-fill {
   height: 100%;
   background-color: var(--promotion--color-primary);

+ 25 - 15
xinkeaboard-seller/src/components/BusinessStateSelector/index.js

@@ -1,6 +1,6 @@
 import { Select, message, Modal } from "antd";
 import { connect } from "dva/index";
-import router from 'umi/router';
+import router from "umi/router";
 import { Component } from "react";
 import { businessStateEnum } from "@/utils/utils";
 import styles from "./index.less";
@@ -26,18 +26,18 @@ export default class BusinessStateSelector extends Component {
     dispatch({
       type: "store/update_business_state",
       payload: {
-        businessState: value
+        businessState: value,
       },
       callback: (res) => {
         if (res.state === 200) {
           if (res.data) {
-            this.setState({ visible: true })
+            this.setState({ visible: true });
           } else {
-             message.success('设置成功')
+            message.success("设置成功");
             this.setState({ currentBusinessState: value });
           }
         } else {
-          message.error(res.msg)
+          message.error(res.msg);
         }
       },
     });
@@ -59,17 +59,22 @@ export default class BusinessStateSelector extends Component {
   }
 
   confirmModal = () => {
-    router.push({
-      pathname: '/store/decorate_pc',
-      query: {
-        tab: '2'
-      }
-    });
-    this.setState({visible: false})
+    if (this.props.confirmModal) {
+      this.props.confirmModal();
+    } else {
+      router.push({
+        pathname: "/store/decorate_pc",
+        query: {
+          tab: "2",
+        },
+      });
+    }
+
+    this.setState({ visible: false });
   };
 
   cancelModel = () => {
-    this.setState({visible: false})
+    this.setState({ visible: false });
   };
 
   render() {
@@ -100,9 +105,14 @@ export default class BusinessStateSelector extends Component {
         >
           <div className={styles.model_content}>
             <div className={styles.model_icon}>
-              <img className={styles.model_img} src={require('../../assets/warning.png')} />
+              <img
+                className={styles.model_img}
+                src={require("../../assets/warning.png")}
+              />
+            </div>
+            <div className={styles.model_tip}>
+              请先在【店铺装修-首页装修】内,装修首页并将“启用状态”更改为“启用”
             </div>
-            <div className={styles.model_tip}>请先在【店铺装修-首页装修】内,装修首页并将“启用状态”更改为“启用”</div>
           </div>
         </Modal>
       </div>

+ 5 - 1
xinkeaboard-seller/src/pages/store/pc_diy/index.js

@@ -42,13 +42,17 @@ export default class StorePCDiyIndex extends Component {
       )
   }
 
+  confirmModal = () => {
+    this.setState({activeKey: '2'})
+  }
+
   render() {
     const {activeKey} = this.state;
     return (
       <div className={global.common_page} style={{ flex: 1 }}>
         <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
             {sldLlineRtextAddGoodsAddMargin('#69A2F2', `${sldComLanguage('店铺装修')}`, 0, 0, 10, this.renderHeaderTip())}
-            <BusinessStateSelector />
+            <BusinessStateSelector confirmModal={this.confirmModal}/>
         </div>
         <Tabs type="card" activeKey={activeKey} animated={false} onTabClick={this.onHandleTabClick}>
           <TabPane tab={`${sldComLanguage('实例化模板')}`} key="1">