MobileFooter.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template>
  2. <div class="mobile-footer">
  3. <span :class="activeType=='home'?'active':''">
  4. <nuxt-link to="/">
  5. <i :class="activeType=='home'?'iconfont icon-shouye':'iconfont icon-shouye1'"></i><p>首页</p>
  6. </nuxt-link>
  7. </span>
  8. <!--<span :class="activeType=='shops'?'active':''">
  9. <nuxt-link to="/mobile/shop">
  10. <i :class="activeType=='shops'?'iconfont icon-dianpu':'iconfont icon-dianpu1'"></i><p>店铺</p>
  11. </nuxt-link>
  12. </span>-->
  13. <span class="seek">
  14. <a>
  15. <img src="/images/mobile/@2x/applyPurchase/home/seek-footer.png" alt="">
  16. <p>发布求购</p>
  17. </a>
  18. </span>
  19. <span :class="activeType=='user'?'active':''">
  20. <a @click="goCollect">
  21. <i :class="activeType=='user'?'iconfont icon-icon':'iconfont icon-wo'"></i><p>我</p>
  22. </a>
  23. </span>
  24. <a @click="toTop" v-show="!hideToTop"><i class="iconfont icon-arrow-up icon-xlg"></i></a>
  25. <login-box @onLoginBoxClose="showLoginBox = false" v-if="showLoginBox"></login-box>
  26. <div class="mobile-modal">
  27. <div class="mobile-modal-box">
  28. <div class="mobile-modal-header">发布求购<i class="icon-guanbi iconfont"></i></div>
  29. <div class="publish-seek">
  30. <div class="content-line">
  31. <span><i>*</i>型号:</span>
  32. <input type="text" placeholder="请勿填中文符号">
  33. </div>
  34. <div class="content-line">
  35. <span><i>*</i>品牌:</span>
  36. <input type="text" placeholder="请勿填中文符号">
  37. </div>
  38. <div class="content-line">
  39. <span><i>*</i>截止日期:</span>
  40. <input type="text" placeholder="请勿填中文符号">
  41. </div>
  42. <div class="content-line">
  43. <span>币种:</span>
  44. <a href="">RMB </a>
  45. </div>
  46. <div class="content-line">
  47. <span>数量:</span>
  48. <input type="text">
  49. </div>
  50. <div class="content-line">
  51. <span>规格:</span>
  52. <input type="text">
  53. </div>
  54. <a>确认发布</a>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. </template>
  60. <script>
  61. import { scrollTo } from '~utils/scroll'
  62. import {LoginBox} from '~components/mobile/common'
  63. export default{
  64. name: 'MobileFooter',
  65. data () {
  66. return {
  67. hideToTop: true,
  68. showLoginBox: false
  69. }
  70. },
  71. components: {
  72. LoginBox
  73. },
  74. computed: {
  75. activeType () {
  76. return this.$route.path === '/' ? 'home' : this.$route.path === '/mobile/shop' ? 'shops' : this.$route.path === '/mobile/user' ? 'user' : ''
  77. },
  78. user () {
  79. return this.$store.state.option.user
  80. }
  81. },
  82. mounted: function () {
  83. this.$nextTick(function () {
  84. window.addEventListener('scroll', this.onScroll)
  85. })
  86. },
  87. methods: {
  88. onScroll () {
  89. let scrolled = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop
  90. if (scrolled > window.screen.availHeight) {
  91. this.hideToTop = false
  92. } else {
  93. this.hideToTop = true
  94. }
  95. },
  96. toTop () {
  97. scrollTo('body', 300)
  98. },
  99. goCollect: function () {
  100. if (this.user.logged) {
  101. this.$router.push('/mobile/user')
  102. } else {
  103. this.showLoginBox = true
  104. }
  105. }
  106. }
  107. }
  108. </script>
  109. <style scoped lang="scss">
  110. .mobile-footer{
  111. position:fixed;
  112. bottom:0;
  113. width:100%;
  114. height:.98rem;
  115. text-align: center;
  116. border-top:.04rem solid #ccc;
  117. background: #ffffff;
  118. z-index: 10;
  119. }
  120. .mobile-footer > span{
  121. display: inline-block;
  122. width: 2rem;
  123. font-size:.32rem;
  124. color:#b0b0b0;
  125. padding-top:.1rem;
  126. }
  127. .mobile-footer > span a{
  128. color:#b0b0b0;
  129. }
  130. .mobile-footer > span a i{
  131. font-size:.45rem;
  132. }
  133. .mobile-footer > span a p{
  134. font-size:.22rem;
  135. }
  136. .mobile-footer > span.active a{
  137. color:#3976f4;
  138. }
  139. .mobile-footer > a {
  140. position: absolute;
  141. right: .1rem;
  142. top: -1rem;
  143. background: rgba(0,0,0,.4);
  144. color: #fff;
  145. width: .88rem;
  146. height: .88rem;
  147. line-height: .88rem;
  148. border-radius: 100%;
  149. }
  150. .mobile-footer >a i{
  151. font-size: .46rem;
  152. }
  153. .mobile-footer > span.seek {
  154. width: 3.5rem;
  155. position: relative;
  156. }
  157. .mobile-footer > span.seek img {
  158. position: absolute;
  159. width: 1.3rem;
  160. height: 1.3rem;
  161. top: -1.3rem;
  162. right: 1.1rem;
  163. }
  164. .mobile-modal {
  165. .mobile-modal-box {
  166. .publish-seek {
  167. background: #fff;
  168. padding-top: .1rem;
  169. padding-bottom: .4rem;
  170. .content-line {
  171. height: .8rem;
  172. line-height: .8rem;
  173. font-size: .26rem;
  174. text-align: left;
  175. border-bottom: .01rem solid #b7d5fe;
  176. input {
  177. width: 3.49rem;
  178. height: .52rem;
  179. padding-left: .19rem;
  180. border: .01rem solid #7e7e7e;
  181. }
  182. span {
  183. display: inline-block;
  184. width: 1.76rem;
  185. text-align: right;
  186. i {
  187. color: #ff0000;
  188. margin-right: .05rem;
  189. font-style: normal;
  190. }
  191. }
  192. }
  193. > a {
  194. display: block;
  195. width: 5.19rem;
  196. height: .84rem;
  197. text-align: center;
  198. line-height: .84rem;
  199. font-size: .38rem;
  200. margin: .3rem auto 0;
  201. background: #3f84f6;
  202. color: #fff;
  203. border-radius: .08rem;
  204. }
  205. }
  206. }
  207. }
  208. </style>