ZZJ
2022-04-02 45faaf27722588e92050e2e3eace9b3704377048
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<template>
  <div class="Connect">
    <!-- 固定按钮 -->
    <div
      class="connectBox"
      @mouseenter="showConnectBox"
      @mouseleave="hiddenConnectBox"
      v-if="isShowConnectBox"
    >
      <div class="tele">
        <div class="title">
          <span class="iconfont">&#xe613;</span>售前咨询电话
        </div>
        <div class="teleNum">010-84155885</div>
      </div>
      <router-link to="/connectUs">
        <div class="advice">
          <div class="title">
            <span class="iconfont">&#xe612;</span>建议反馈
          </div>
          <div class="des">您的每一条建议声音,我们都认真对待</div>
        </div>
      </router-link>
    </div>
 
    <div
      class="connect"
      @mouseenter="showConnectBox"
      @mouseleave="hiddenConnectBox"
    >
      <span class="iconfont">&#xe611;</span>联系我们
    </div>
    <div class="backToTop iconfont" @click="backToTop">&#xe610;</div>
  </div>
</template>
 
<script>
export default {
  data() {
    return {
      isShowConnectBox: false, //固定定位弹层
    };
  },
  methods: {
    // 回到顶部
    backToTop() {
      const _this = this;
      cancelAnimationFrame(_this.timer);
      _this.timer = requestAnimationFrame(function fn() {
        var oTop =
          document.body.scrollTop || document.documentElement.scrollTop;
        if (oTop > 0) {
          document.body.scrollTop = document.documentElement.scrollTop =
            oTop - 90;
          //这里的100代表回到顶部的速度,可以按照实际情况调整
          _this.timer = requestAnimationFrame(fn);
        } else {
          cancelAnimationFrame(_this.timer);
        }
      });
    },
    showConnectBox() {
      if (this.ConnectTimer) {
        clearTimeout(this.ConnectTimer);
        this.ConnectTimer = null;
      }
      this.isShowConnectBox = true;
    },
    hiddenConnectBox() {
      const _this = this;
      this.ConnectTimer = setTimeout(() => {
        _this.isShowConnectBox = false;
      }, 100);
    },
  },
};
</script>
 
<style lang="scss" scoped>
.connectBox {
  position: fixed;
  right: 94px;
  top: 662px;
  padding: 10px 0;
  box-sizing: border-box;
  width: 268px;
  height: 149px;
  background: #ffffff;
  box-shadow: 0px 4px 12px rgba(0, 51, 128, 0.18);
  border-radius: 8px;
 
  .tele,
  .advice {
    box-sizing: border-box;
    padding: 0 20px 0 10px;
    overflow: hidden;
    height: 64px;
 
    &:hover {
      background-color: #fafafa;
 
      span,
      .title,
      .teleNum,
      .des {
        color: #0065ff;
      }
    }
  }
 
  .advice {
    cursor: pointer;
  }
 
  .title {
    display: flex;
    align-items: center;
    margin-top: 8px;
    font-weight: bold;
    font-size: 14px;
  }
 
  span {
    margin-right: 10px;
    font-size: 24px;
    font-weight: 700;
  }
 
  .teleNum {
    margin-top: 6px;
    margin-left: 34px;
    color: #0065ff;
    font-size: 12px;
  }
 
  .des {
    margin-top: 6px;
    margin-left: 34px;
    color: #666666;
    font-size: 12px;
  }
}
 
.connect {
  position: fixed;
  box-sizing: border-box;
  width: 44px;
  height: 120px;
  top: 662px;
  right: 40px;
  z-index: 2;
  padding: 10px 14px;
  background: #ffffff;
  box-shadow: 0px 4px 8px rgba(85, 93, 106, 0.12);
  border-radius: 22px;
  text-align: center;
  line-height: 20px;
  font-size: 14px;
  cursor: pointer;
 
  &:hover {
    color: #0065ff;
    box-shadow: 0px 4px 12px rgba(0, 51, 128, 0.18);
  }
}
 
.backToTop {
  position: fixed;
  right: 40px;
  top: 802px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #666;
  text-align: center;
  line-height: 44px;
  font-size: 18px;
  background-color: #fff;
  box-shadow: 0px 4px 8px rgba(85, 93, 106, 0.12);
  cursor: pointer;
 
  &:hover {
    color: #0065ff;
    box-shadow: 0px 4px 12px rgba(0, 51, 128, 0.18);
  }
}
</style>