armg vor 3 Wochen
Ursprung
Commit
7deac87bec

BIN
src/assets/AIDesign/tab1.png


BIN
src/assets/AIDesign/tab2.png


BIN
src/assets/AIDesign/top-bg.jpg


+ 1 - 1
src/styles/index.scss

@@ -11,7 +11,7 @@ html {
   // ai设计板块
   @media screen and (min-width: 900px) {
     .AI-Design-container {
-      max-width: 900px;
+      max-width: 500px;
       padding: 0;
       margin: 0 auto;
       overflow: hidden;

Datei-Diff unterdrückt, da er zu groß ist
+ 623 - 280
src/views/AIDesign/design.vue


+ 54 - 4
src/views/AIDesign/diagnoseResult.vue

@@ -1,7 +1,13 @@
 <template>
     <div class="diagnosis-page AI-Design-container">
         <!-- 顶部导航 -->
-        <header-online pagetitle="诊断结果"></header-online>
+        <div class="header">
+            <van-nav-bar title="诊断结果" left-arrow @click-left="returnPage" @click-right="toHome">
+                <template #right>
+                    <van-icon name="wap-home-o" color="#333" size="26" />
+                </template>
+            </van-nav-bar>
+        </div>
         <section>
             <!-- 历史诊断 -->
             <div class="history-section">
@@ -184,7 +190,7 @@ import { Component, Vue, Ref, Watch } from 'vue-property-decorator';
 import html2canvas from 'html2canvas';
 import { NavBar, Button, Image, Loading, Empty, Toast, ImagePreview } from 'vant';
 import { diagGetEntity, diagGetReadState, diagUpdateReadState } from "@/api/indexAI";
-import { getWxconfig } from '@/utils/index';
+import { getWecomType, toLBHome } from '@/utils/index';
 import axios from "axios";
 declare let wx: any;
 @Component({
@@ -242,7 +248,12 @@ export default class DiagnosisPage extends Vue {
     // }
     // 页面挂载时请求数据
     created() {
-        getWxconfig();
+        this.getWxconfig();
+        if (this.$route.query.WecomType) {
+            sessionStorage.setItem("WecomType", this.$route.query.WecomType);
+        } else {
+            sessionStorage.removeItem("WecomType");
+        }
     }
     activated() {
         // 初始化数据
@@ -349,7 +360,13 @@ export default class DiagnosisPage extends Vue {
             }
         })
     }
-
+    returnPage() {
+        this.$router.push({ path: 'diagnose', query: { wallType: this.wallType } });
+        // this.$router.back();
+    }
+    toHome() {
+        toLBHome()
+    }
     private startPolling(): void {
         // 立即执行一次检查
         this.GetEntityData();
@@ -416,6 +433,39 @@ export default class DiagnosisPage extends Vue {
     imgClick(url) {
         ImagePreview([url]);
     }
+    // 获取微信API授权信息
+    getWxconfig() {
+        const jsApiList = ['getSetting', 'authorize', 'showModal', 'openSetting', 'downloadFile', 'saveImageToPhotosAlbum', 'closeWindow'];
+        let url = window.location.href.split("#")[0];
+        axios.get(`${process.env.VUE_APP_BASE_API}wx/ticket`, {
+            params: {
+                url: url,
+                agent: 1
+            }
+        }).then(response => {
+            if (response.status == 200) {
+                let qiyeData = response.data.data;
+                wx.agentConfig({
+                    debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+                    corpid: qiyeData.appId, // 必填,企业微信的corpid,必须与当前登录的企业一致
+                    agentid: qiyeData.agentId, // 必填,企业微信的应用id (e.g. 1000247)
+                    timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
+                    nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
+                    signature: qiyeData.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
+                    jsApiList: [...jsApiList], //必填,传入需要使用的接口名称
+                    success: function (res) {
+                        console.log('获取签名成功');
+                    },
+                    fail: function (res) {
+                        console.log(res);
+                        if (res.errMsg.indexOf('function not exist') > -1) {
+                            alert('版本过低请升级');
+                        }
+                    },
+                });
+            }
+        });
+    }
 
     GetReadStateFn() {
         const formData = new FormData();

+ 74 - 15
src/views/AIDesign/index.vue

@@ -1,29 +1,30 @@
 <template>
   <div class="home-container AI-Design-container">
-    <header-online pagetitle="首页" :showRightIcon="false"></header-online>
-    <!--<div class="header">-->
-    <!--<van-nav-bar title="首页" left-arrow @click-left="returnPage" @click-right="toHome">-->
-    <!--<template #right>-->
-    <!--<van-icon name="wap-home-o" color="#333" size="26" />-->
-    <!--</template>-->
-    <!--</van-nav-bar>-->
-    <!--</div>-->
+    <div class="header">
+      <van-nav-bar title="首页" left-arrow @click-left="returnPage" @click-right="toHome">
+        <template #right>
+          <van-icon name="wap-home-o" color="#333" size="26" />
+        </template>
+      </van-nav-bar>
+    </div>
     <!-- 顶部装饰背景图 -->
     <div class="top-bg">
-      <img src="@/assets/AIDesign/top-bg.png" alt="背景图" class="bg-image" />
+      <img src="@/assets/AIDesign/top-bg.jpg" alt="背景图" class="bg-image" />
     </div>
 
     <!-- 空间标题 -->
-    <div class="smart-space-title-new">
+    <!-- <div class="smart-space-title-new">
       <div class="tab-title" :class="{ active_l: currentTab === 'outside' }" @click="handleTabChange('outside')">
         <div>外墙空间</div>
       </div>
       <div class="tab-title" :class="{ active_r: currentTab === 'inside' }" @click="handleTabChange('inside')">
         <div>内墙空间</div>
       </div>
-    </div>
-    <div>
-
+    </div> -->
+    <!-- 新版tab -->
+    <div class="new-tab-wrapper" :class="currentTab === 'outside' ? 'outside-tab-bg' : 'inside-tab-bg'">
+      <div class="tab-title" @click="currentTab = 'outside'"></div>
+      <div class="tab-title" @click="currentTab = 'inside'"></div>
     </div>
 
     <!-- 外墙-功能卡片区域 -->
@@ -97,8 +98,8 @@ declare let wx: any;
 @Component
 export default class extends Vue {
   private currentTab = 'outside';
-  private toastLoading = null;
   created() {
+    this.getWxconfig();
     // 经销商随身邦,好邦手进去,默认在内墙空间;服务商进去,默认外墙空间
     const agentFrom = window.localStorage.getItem('agentFrom');
     window.localStorage.setItem('agentFromAI', agentFrom);
@@ -117,7 +118,7 @@ export default class extends Vue {
     this.currentTab = tabType;
   }
   returnPage() {
-    this.$router.go(-1);
+    toLBHome();
   }
   toHome() {
     toLBHome()
@@ -145,6 +146,41 @@ export default class extends Vue {
     this.$toast('规划中,敬请期待');
     // this.$router.push("/AIDesign/five-element");
   }
+
+
+  // 获取微信API授权信息
+  getWxconfig() {
+    const jsApiList = ['getSetting', 'authorize', 'showModal', 'openSetting', 'downloadFile', 'saveImageToPhotosAlbum', 'closeWindow'];
+    let url = window.location.href.split("#")[0];
+    axios.get(`${process.env.VUE_APP_BASE_API}wx/ticket`, {
+      params: {
+        url: url,
+        agent: 1
+      }
+    }).then(response => {
+      if (response.status == 200) {
+        let qiyeData = response.data.data;
+        wx.agentConfig({
+          debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+          corpid: qiyeData.appId, // 必填,企业微信的corpid,必须与当前登录的企业一致
+          agentid: qiyeData.agentId, // 必填,企业微信的应用id (e.g. 1000247)
+          timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
+          nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
+          signature: qiyeData.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
+          jsApiList: [...jsApiList], //必填,传入需要使用的接口名称
+          success: function (res) {
+            console.log('获取签名成功');
+          },
+          fail: function (res) {
+            console.log(res);
+            if (res.errMsg.indexOf('function not exist') > -1) {
+              alert('版本过低请升级');
+            }
+          },
+        });
+      }
+    });
+  }
 }
 </script>
 
@@ -251,6 +287,29 @@ export default class extends Vue {
   }
 }
 
+.new-tab-wrapper {
+  width: 100%;
+  height:58px;
+  margin-bottom: 20px;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+
+  .tab-title {
+    width: 50%;
+    height:100%;
+  }
+}
+
+.outside-tab-bg {
+  background: url('../../assets/AIDesign/tab1.png') no-repeat;
+  background-size: 100% auto;
+}
+
+.inside-tab-bg {
+  background: url('../../assets/AIDesign/tab2.png') no-repeat;
+  background-size: 100% auto;
+}
 
 /* 功能卡片容器 */
 .feature-cards {

Datei-Diff unterdrückt, da er zu groß ist
+ 645 - 574
src/views/AIDesign/insideDesign.vue


+ 48 - 12
src/views/AIDesign/result.vue

@@ -1,13 +1,12 @@
 <template>
   <div class="resout-container AI-Design-container">
-    <header-online pagetitle="生成结果"></header-online>
-    <!-- <div class="header">
+    <div class="header">
       <van-nav-bar title="生成结果" left-arrow @click-left="returnPage" @click-right="toHome">
         <template #right>
           <van-icon name="wap-home-o" color="#333" size="26" />
         </template>
-</van-nav-bar>
-</div> -->
+      </van-nav-bar>
+    </div>
 
     <div class="container">
       <!-- 房屋效果图 -->
@@ -63,10 +62,6 @@
           <van-icon class="icon" name="user-o" />
           <span class="text">转人工设计(原别墅之星小程序)</span>
         </button>
-         <!-- <button class="action-button" @click="manualDesign">
-          <van-icon class="icon" name="user-o" />
-          <span class="text">测试跳转小程序</span>
-        </button> -->
       </div>
     </div>
 
@@ -75,14 +70,15 @@
 <script lang="ts">
 import { ImagePreview, Dialog } from 'vant';
 import { Component, Vue } from "vue-property-decorator";
-import { GetEntity, GetReadState, UpdateReadState, insideGetEntity, insideGetReadState, insideUpdateReadState, GetProjectlist, GetDictList, wecomTicket } from "@/api/indexAI";
-import { getWecomType, toLBHome, toXiaoChengxu ,getWxconfig } from '@/utils/index';
+import { GetEntity, GetReadState, UpdateReadState, insideGetEntity, insideGetReadState, insideUpdateReadState, GetProjectlist, GetDictList } from "@/api/indexAI";
+import { getWecomType, toLBHome } from '@/utils/index';
 import axios from "axios";
 declare let wx: any;
 @Component
 export default class extends Vue {
   private readState = true;
   // 数据属性
+  // private imageUrl = require('@/assets/AIDesign/house-image.jpg'); // 替换为实际图片路径
   private imageUrl = ''; // 替换为实际图片路径
   private imageUrlSmall = '';
   private UserFilePathUrl = '';//用户原图
@@ -124,7 +120,12 @@ export default class extends Vue {
   private projectDisableFlag = true;//转人工不可点击
   private serviceCodeArray = [];
   created() {
-    getWxconfig();
+    if(this.$route.query.WecomType){
+      sessionStorage.setItem("WecomType",this.$route.query.WecomType);
+    }else{
+      sessionStorage.removeItem("WecomType");
+    }
+    this.getWxconfig();
     // this.getServiceCode();
   }
 
@@ -248,6 +249,7 @@ export default class extends Vue {
     const formData = new FormData();
     // const userInfo: any = JSON.parse(window.localStorage.getItem("userInfoV1")!);
     // formData.append('WXuserid', userInfo.loginName);
+    formData.append('outsideType', 0);
     this.GetReadStateToApi[this.wallType](formData).then(response => {
       if (response.StatusCode == 200) {
         this.readState = response.Data.readState;
@@ -261,7 +263,8 @@ export default class extends Vue {
     this.UpdateReadStateToApi[this.wallType](formData).then(response => { });
   }
   returnPage() {
-    this.$router.push({ path: '/AIDesign' });
+    this.$router.push({path: this.designPageApi[this.wallType]});
+    // this.$router.back();
   }
   toHome() {
     toLBHome()
@@ -378,6 +381,39 @@ export default class extends Vue {
       }
     })
   }
+  // 获取微信API授权信息
+  getWxconfig() {
+    const jsApiList = ['getSetting', 'authorize', 'showModal', 'openSetting', 'downloadFile', 'saveImageToPhotosAlbum','closeWindow'];
+    let url = window.location.href.split("#")[0];
+    axios.get(`${process.env.VUE_APP_BASE_API}wx/ticket`, {
+      params: {
+        url: url,
+        agent: 1
+      }
+    }).then(response => {
+      if (response.status == 200) {
+        let qiyeData = response.data.data;
+        wx.agentConfig({
+          debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+          corpid: qiyeData.appId, // 必填,企业微信的corpid,必须与当前登录的企业一致
+          agentid: qiyeData.agentId, // 必填,企业微信的应用id (e.g. 1000247)
+          timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
+          nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
+          signature: qiyeData.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
+          jsApiList: [...jsApiList], //必填,传入需要使用的接口名称
+          success: function (res) {
+            console.log('获取签名成功');
+          },
+          fail: function (res) {
+            console.log(res);
+            if (res.errMsg.indexOf('function not exist') > -1) {
+              alert('版本过低请升级');
+            }
+          },
+        });
+      }
+    });
+  }
   // 点击保存图片按钮
   saveImageToAlbum() {
     const that = this;

+ 61 - 48
src/views/login/index.vue

@@ -1,7 +1,8 @@
 <template>
   <div>
     <div class="login">
-      <van-form @submit="onSubmit" style="width: 100%;">
+      <button @click="onSubmit1">虚拟登录</button>
+      <!-- <van-form @submit="onSubmit" style="width: 100%;">
         <van-field
           v-model="username"
           name="username"
@@ -33,32 +34,34 @@
             提交
           </van-button>
         </div>
-      </van-form>
+      </van-form> -->
     </div>
   </div>
 </template>
 <script lang="ts">
 import { Component, Vue, Watch, Prop } from "vue-property-decorator";
+import {  initGuidInfo,doWecomLogin } from '@/utils/wecomLogin.ts';
+
 
 @Component
 export default class extends Vue {
   username: string = "";
   password: string = "";
   wxUserId: string = "";
-    agentValue: string = "hbs";
-    agentOptions: any = [{
-        value: 'hbs',
-        label: '好邦手'
-    }, {
-        value: 'ssb',
-        label: '随身邦'
-    }, {
-        value: 'stoneLikePaint',
-        label: '服务商随身邦'
-    }, {
-        value: 'goldShop',
-        label: '金牌店随身邦'
-    }]
+  agentValue: string = "hbs";
+  agentOptions: any = [{
+    value: 'hbs',
+    label: '好邦手'
+  }, {
+    value: 'ssb',
+    label: '随身邦'
+  }, {
+    value: 'stoneLikePaint',
+    label: '服务商随身邦'
+  }, {
+    value: 'goldShop',
+    label: '金牌店随身邦'
+  }]
   async created() {
     let that = this;
     that.wxUserId = that.$route.query.wxUserId as string;
@@ -85,14 +88,14 @@ export default class extends Vue {
     //   );
     //   this.$router.push(`/home`);
     // }
-      let paramValueAgent = that.agentValue;
-      if (paramValueAgent == 'hbs'){
-          obj.userType = '0';
-      }else if (paramValueAgent == 'ssb') {
-          obj.userType = '1';
-      }else {
-          obj.userType = '2';
-      }
+    let paramValueAgent = that.agentValue;
+    if (paramValueAgent == 'hbs') {
+      obj.userType = '0';
+    } else if (paramValueAgent == 'ssb') {
+      obj.userType = '1';
+    } else {
+      obj.userType = '2';
+    }
     let [err, data] = await this.$post("/wx/getUserByPassWord", obj);
     console.log(err);
     console.log(data);
@@ -100,11 +103,19 @@ export default class extends Vue {
       console.log("login --sysUser = " + data.sysUser)
       let getUserInfo: any = data;
       window.localStorage.setItem("userInfoV1", JSON.stringify(getUserInfo.sysUser));
-        window.localStorage.setItem('agentFrom',that.agentValue);
-        window.localStorage.setItem("loginNumber", 1);
+      window.localStorage.setItem('agentFrom', that.agentValue);
+      window.localStorage.setItem("loginNumber", 1);
       this.$router.push(`/homeIndex?userId=${data.sysUser.userId}&agent=${that.agentValue}`);
     }
   }
+  onSubmit1() {
+    initGuidInfo();
+    doWecomLogin('QWert!@345')
+      .then(() => {
+        this.$router.push('/');
+        console.log(`模拟登录成功`);
+      })
+  }
 }
 </script>
 <style lang="scss" scoped>
@@ -113,28 +124,30 @@ export default class extends Vue {
   padding-right: 15px;
   box-sizing: border-box;
 }
-  .agent-box{
-    flex-direction: row;
-    display: flex;
-    align-items: center;
+
+.agent-box {
+  flex-direction: row;
+  display: flex;
+  align-items: center;
+  box-sizing: border-box;
+  width: 100%;
+  padding: 10px 16px;
+  overflow: hidden;
+  color: #323233;
+  font-size: 14px;
+  line-height: 24px;
+  background-color: #fff;
+
+  .left-label {
+    -webkit-box-flex: 0;
+    -webkit-flex: none;
+    flex: none;
     box-sizing: border-box;
-    width: 100%;
-    padding: 10px 16px;
-    overflow: hidden;
-    color: #323233;
-    font-size: 14px;
-    line-height: 24px;
-    background-color: #fff;
-    .left-label{
-      -webkit-box-flex: 0;
-      -webkit-flex: none;
-      flex: none;
-      box-sizing: border-box;
-      width: 6.2em;
-      margin-right: 12px;
-      color: #646566;
-      text-align: left;
-      word-wrap: break-word;
-    }
+    width: 6.2em;
+    margin-right: 12px;
+    color: #646566;
+    text-align: left;
+    word-wrap: break-word;
   }
+}
 </style>