page-bottom-button.wpy 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <style lang="less">
  2. .page-bottom-button {
  3. position: fixed;
  4. left: 0;
  5. right: 0;
  6. bottom: 0;
  7. height: 280rpx;
  8. background-size: 100%;
  9. z-index: 1;
  10. .button-container {
  11. position: absolute;
  12. left: 0;
  13. right: 0;
  14. bottom: 80rpx;
  15. }
  16. }
  17. </style>
  18. <template>
  19. <div class="page-bottom-button" :style="{'background-image': 'url('+h5StaticPath+'/page_bottom_btn_bg.png)'}">
  20. <div class="button-container">
  21. <common-button text="{{text}}" icon="{{icon}}" click-emit-id="pageBottomBtnEmitId" v-on:pageBottomBtnEmitId="submit" />
  22. </div>
  23. </div>
  24. </template>
  25. <script>
  26. import wepy from '@wepy/core';
  27. import config from '@/config';
  28. wepy.component({
  29. props: {
  30. icon: String,
  31. text: String,
  32. clickEmitId: String
  33. },
  34. data: {
  35. h5StaticPath: config.h5StaticPath
  36. },
  37. ready() {},
  38. methods: {
  39. submit() {
  40. if (this.clickEmitId) {
  41. this.$emit(this.clickEmitId);
  42. }
  43. }
  44. }
  45. });
  46. </script>
  47. <config>
  48. {
  49. usingComponents: {
  50. 'common-button': '~@/components/common/common-button'
  51. },
  52. "componentPlaceholder": {
  53. "common-button": "view"
  54. }
  55. }
  56. </config>