فهرست منبع

Merge branch 'dev' of xiongzhu/raex_front into master

panhui 4 سال پیش
والد
کامیت
c7779c895f
2فایلهای تغییر یافته به همراه18 افزوده شده و 11 حذف شده
  1. 3 1
      src/components/product/ThreeMode.vue
  2. 15 10
      src/views/asset/Detail.vue

+ 3 - 1
src/components/product/ThreeMode.vue

@@ -100,9 +100,10 @@ export default {
                     let center_z = (bounding.max.z + bounding.min.z) / 2;
 
                     console.log('model size: x=' + size_x + ', y=' + size_y + ', z=' + size_z);
+                    let isY = size_y >= size_x;
 
                     camera.lookAt(new THREE.Vector3(center_x, center_y, center_z));
-                    camera.position.set(center_x, center_y, size_y * 1.8);
+                    camera.position.set(center_x, center_y, isY ? size_y * 1.8 : size_x * 1.8);
 
                     hemiLight.position.set(0, center_y + size_y * 2, 0);
                     if (controls) {
@@ -139,6 +140,7 @@ export default {
                 controls.enablePan = false;
                 controls.enabled = props.pageType === 'asset';
                 controls.update();
+
                 window.addEventListener('resize', onWindowResize);
 
                 // stats

+ 15 - 10
src/views/asset/Detail.vue

@@ -378,15 +378,10 @@ export default {
         }
     },
     mounted() {
-        this.getProduct();
+        this.getProduct(true);
         setTimeout(() => {
             this.record();
         }, 1000);
-        this.$http.get('/sysConfig/get/hold_days').then(res => {
-            this.holdDays = Number(res.value);
-            // this.holdDays = 10;
-            this.getTime();
-        });
     },
     methods: {
         allFn() {
@@ -579,13 +574,14 @@ export default {
                 startPosition: index
             });
         },
-        getProduct() {
+        getProduct(init = false) {
             this.$toast.loading({
                 message: '加载中...',
                 forbidClick: true
             });
             this.$http.get('/asset/get/' + this.$route.query.id).then(res => {
                 this.info = res;
+
                 if (res.orderId) {
                     this.$http.get('/order/get/' + res.orderId).then(res => {
                         this.orderInfo = res;
@@ -619,8 +615,16 @@ export default {
                         this.btn = this.$refs.btn;
                     }
                 });
-
-                this.$toast.clear();
+                console.log(init);
+                if (init) {
+                    this.$http.get('/sysConfig/get/hold_days').then(res => {
+                        this.holdDays = Number(res.value);
+                        // this.holdDays = 10;
+                        this.getTime();
+                    });
+                } else {
+                    this.$toast.clear();
+                }
             });
         },
         likeProduct() {
@@ -673,10 +677,11 @@ export default {
             }
             if (!this.dayjs().isBefore(this.dayjs(startTime, 'YYYY-MM-DD HH:mm:ss'))) {
                 if (this.getProduct) {
-                    this.getProduct();
+                    this.getProduct(false);
                 }
                 this.startTime = '';
             } else {
+                this.$toast.clear();
                 this.timer = setTimeout(() => {
                     this.getTime();
                 }, 1000);