scrollTop.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template name="scrollTop">
  2. <!-- 商品详情价格判断 -->
  3. <view>
  4. <view class="scrollTop">
  5. <view class="icon msg" @click="onClickPhone">
  6. <text class="iconfont icon-zixunrexian"></text>
  7. </view>
  8. <view class="icon top" @click="onPageScrollTop">
  9. <text class="iconfont icon-zhiding"></text>
  10. </view>
  11. </view>
  12. <view class="phone" v-show="isPhone">
  13. <view class="content">
  14. <view class="tel">
  15. <view class="p">0755-22907771</view>
  16. <view class="btn">
  17. <tui-button margin="5rpx 0 5rpx 0" type="gradual" shape="circle" width="120rpx" height="50rpx" :size="24" @click="toTelPhone">点击咨询</tui-button>
  18. </view>
  19. </view>
  20. <view class="tel">
  21. <view class="p">153-3885-1365</view>
  22. <view class="btn">
  23. <tui-button margin="5rpx 0 5rpx 0" type="gradual" shape="circle" width="120rpx" height="50rpx" :size="24" @click="toPhone">点击咨询</tui-button>
  24. </view>
  25. </view>
  26. <view class="txt">工作日</view>
  27. <view class="txt">周一~周五/9:00-18:00</view>
  28. </view>
  29. <text class="iconfont icon-2guanbi" @click.stop="hideIsPhone"></text>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. export default{
  35. name:'scrollTop',
  36. props:{
  37. },
  38. data() {
  39. return{
  40. isPhone:false,
  41. telPhone:'0755-22907771',
  42. mobilePhone:'15338851365'
  43. }
  44. },
  45. created() {
  46. },
  47. methods:{
  48. onPageScrollTop(){
  49. uni.pageScrollTo({
  50. scrollTop: 0,
  51. duration: 600
  52. });
  53. },
  54. onClickPhone(){
  55. this.isPhone = true
  56. },
  57. hideIsPhone(){
  58. this.isPhone = false
  59. },
  60. toTelPhone(){
  61. uni.makePhoneCall({
  62. phoneNumber:this.telPhone
  63. });
  64. },
  65. toPhone(){
  66. uni.makePhoneCall({
  67. phoneNumber:this.mobilePhone
  68. });
  69. },
  70. },
  71. }
  72. </script>
  73. <style lang="scss">
  74. .scrollTop{
  75. width: 80rpx;
  76. height: 200rpx;
  77. position: fixed;
  78. right: 20rpx;
  79. bottom: 20%;
  80. .icon{
  81. width: 80rpx;
  82. height: 80rpx;
  83. border-radius: 50%;
  84. float: left;
  85. margin: 10rpx 0;
  86. line-height: 80rpx;
  87. text-align: center;
  88. &.msg{
  89. background-image: linear-gradient(0deg, #f28e31 0%, #e15616 100%);
  90. }
  91. &.top{
  92. background-color: rgba(0,0,0,0.4);
  93. }
  94. .iconfont{
  95. font-size: $font-size-44;
  96. color: #FFFFFF;
  97. }
  98. }
  99. }
  100. .phone{
  101. width: 100%;
  102. height: 100%;
  103. position: fixed;
  104. right: 0;
  105. top: 0;
  106. background: rgba(0,0,0,0.4);
  107. z-index: 999999;
  108. .content{
  109. width: 500rpx;
  110. height: 704rpx;
  111. position: absolute;
  112. top: 0;
  113. left: 0;
  114. right: 0;
  115. bottom: 0;
  116. margin: auto;
  117. background: url(https://admin-b.caimei365.com/userfiles/1/images/photo/2020/11/%E4%B8%8B%E8%BD%BD.jpg) no-repeat;
  118. background-size: cover;
  119. border-radius: 20rpx;
  120. box-sizing: border-box;
  121. padding: 220rpx 60rpx 0 60rpx;
  122. .tel{
  123. height: 60rpx;
  124. line-height: 60rpx;
  125. font-size: $font-size-28;
  126. margin: 8rpx 0;
  127. .p{
  128. color: $color-system;
  129. float: left;
  130. }
  131. .btn{
  132. float: right;
  133. }
  134. }
  135. .txt{
  136. height: 60rpx;
  137. line-height: 60rpx;
  138. font-size: $font-size-28;
  139. color: #666666;
  140. text-align: center;
  141. }
  142. }
  143. .icon-2guanbi{
  144. width: 80rpx;
  145. height: 80rpx;
  146. text-align: center;
  147. line-height: 80rpx;
  148. font-size: 54rpx;
  149. display: block;
  150. position: absolute;
  151. bottom: 18%;
  152. left: 50%;
  153. margin-left: -40rpx;
  154. color: #FFFFFF;
  155. }
  156. }
  157. </style>