BF-202210271038\Administrator пре 2 година
родитељ
комит
1c29b83d16

+ 37 - 15
components/dgex-tantan/dgex-tantan.vue

@@ -20,7 +20,10 @@
 					 <!-- 加载图片会闪屏 双if避免 -->
 					<template v-if="currentIndex + visible >= index && currentIndex <= index">
             <view  class="tantan-slide-img-box"   :style="{height: winHeigh + 'px'}">
-              <image class="tantan-slide-img" :class="{'overturn-shake':overturnType===1,'overturn-back-shake':overturnType===2}" :style="{height: winHeigh + 'px'}"  mode="aspectFill" :src="item.image" ></image>
+              <view :animation="animationData">
+                <image  class="tantan-slide-img" v-show="imgIndex===imgKey" v-for="(img,imgIndex) in item.images"   :style="{height: winHeigh + 'px'}"  mode="aspectFill" :src="img" ></image>
+              </view>
+
               <view class="slide-img-click">
                 <view class="slide-img-click-item" @click.stop="setImgKey(item,0)"></view>
                 <view class="slide-img-click-item" @click.stop="setImgKey(item,1)"></view>
@@ -86,8 +89,9 @@
 				dislike: 0,
 
         imgKey:0,
-        overturnType:0
-			}
+        overturnType:0,
+        animationData:{}
+      }
 		},
     watch:{
       'overturnType':function (){
@@ -102,7 +106,9 @@
       console.log(res)
 			this.winWidth = res.windowWidth
 			this.winHeigh = res.windowHeight-46
-		},
+
+
+    },
 		methods: {
       setImgKey(item, type){
         if( this.overturnType<=0){
@@ -127,28 +133,44 @@
       setOverturnImg(item){
         // tools.success('one')
         // return;
+        let animation = uni.createAnimation({
+          duration: 100,
+          timingFunction: 'ease',
+        })
+
+        animation.rotateY(3).scale(1.01).step()
+        item.image=item.images[this.imgKey]
+        tools.vibrate()
+        this.animationData = animation.export()
+        setTimeout(function() {
+          animation.rotateY(0).scale(1).step()
+          this.animationData = animation.export()
+        }.bind(this), 100)
 
-        this.overturnType=1;
-        setTimeout(()=>{
-          item.image=item.images[this.imgKey]
-          this.overturnType=2;
-          setTimeout(()=>{
-            this.overturnType=0;
-          },80)
-        },80)
       },
       setOverturnTwo(){
         // tools.error('two')
         // return;
-        this.overturnType=1;
+        let animation = uni.createAnimation({
+          duration: 100,
+          timingFunction: 'ease',
+        })
+        animation.rotateY(5).step()
+        tools.vibrate()
         let overturnNum=1
        let overturnServe=setInterval(()=>{
           ++overturnNum
          if(overturnNum>4){
-           this.overturnType=0;
            clearInterval(overturnServe)
          }else {
-           this.overturnType=(overturnNum%2===1)?1:2
+          let overturnType=(overturnNum%2===1)?1:2
+           if(overturnType===1){
+             animation.rotateY(3).step()
+             tools.vibrate()
+           }else {
+             animation.rotateY(0).step()
+           }
+           this.animationData = animation.export()
          }
         },80)
 

+ 6 - 5
components/en-utils/en-nav/en-nav.vue

@@ -1,6 +1,6 @@
 <template>
   <view class="">
-    <view class="header"  :style="style">
+    <view class="header"  :style="[{'height': customBarH + 'px', 'padding-top': statusBarH + 'px'}]">
       <view class="flexbox"  :class="{'flexbox-xcx':(isXcx && rightShow)}"
         :style="[{'height': customBarH + 'px', 'padding-top': statusBarH + 'px','background':bgckgroundBox}]">
         <view class="left-button" @tap="goBack">
@@ -73,10 +73,7 @@
       },
     },
     computed: {
-      style() {
-        let _style = `height: ${this.customBarH}px;`
-        return _style
-      }
+
     },
     watch: {
       leftShow(e) {
@@ -110,6 +107,10 @@
           this.customBarH = 30
           this.left=0
           //#endif
+          // #ifdef APP-PLUS
+          this.customBarH = 34
+          this.left=0
+          //#endif
           console.log('self.customBarH---------'+this.customBarH)
           this.$emit('navHeight', this.customBarH+this.statusBarH)
         }

+ 8 - 7
pages.json

@@ -1,5 +1,12 @@
 {
   "pages": [
+    {
+      "path": "pages/index/index",
+      "style": {
+        "navigationBarTitleText": "",
+        "enablePullDownRefresh": false
+      }
+    },
     {
       "path": "pages/login/index",
       "style": {
@@ -86,13 +93,7 @@
         "enablePullDownRefresh": false
       }
     },
-    {
-      "path": "pages/index/index",
-      "style": {
-        "navigationBarTitleText": "",
-        "enablePullDownRefresh": false
-      }
-    },
+
     {
       "path": "pages/text/tantan",
       "style": {

+ 8 - 8
pages/index/model/index-nav.vue

@@ -1,6 +1,6 @@
 <template>
   <view class="">
-    <view class="header"  :style="style">
+    <view class="header"  :style="[{'height': customBarH + 'px', 'padding-top': statusBarH + 'px'}]">
       <view class="header-left">
         <view class="left-text sys-color-black-0 sys-weight-600">筛选</view>
         <view class="left-img">
@@ -47,10 +47,7 @@
 
     },
     computed: {
-      style() {
-        let _style = `height: ${this.customBarH}px;`
-        return _style
-      }
+
     },
     watch: {
 
@@ -76,13 +73,16 @@
           this.customBarH = 34
           this.left=0
           //#endif
+          // #ifdef APP-PLUS
+          this.customBarH = 34
+          this.left=0
+          //#endif
           console.log('self.customBarH---------'+this.customBarH)
+          console.log('self.statusBarH---------'+this.statusBarH)
           this.$emit('navHeight', this.customBarH+this.statusBarH)
         }
       })
-      //#ifdef MP-WEIXIN
-      this.isXcx=true
-      //#endif
+
     }
   }
 </script>

+ 1 - 1
service/tools.js

@@ -182,7 +182,7 @@ tools.platformType = function () {
 tools.vibrate=function (){
     console.log('vibrate')
     // #ifndef H5
-    uni.vibrate({
+    uni.vibrateLong({
         success: function () {
             console.log('success');
         }