app-search-for.vue 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <view class="app-view" :style="{backgroundColor: newData.background}">
  3. <!-- <app-jump-button open_type="navigate" url="../search/search" height="100" width="100" form>-->
  4. <!-- <view class="app-text dir-left-nowrap cross-center" :style="{color: `${newData.textColor}`}" :class="[`${newData.textPosition === 'center' ? 'main-center' : 'main-left'}`]">-->
  5. <!-- <icon class="app-icon"></icon>-->
  6. <!-- <text>{{newData.placeholder}}</text>-->
  7. <!-- </view>-->
  8. <!-- <view class="input" :style="{backgroundColor: newData.color, borderRadius: `${newData.radius}rpx`,color: `${newData.textColor}`}"></view>-->
  9. <!-- </app-jump-button>-->
  10. <view class="jump dir-left-nowrap main-center cross-center" @click="jump_route()">
  11. <view class="input main-center" :style="{backgroundColor: newData.color, borderRadius: `${newData.radius}rpx`,color: `${newData.textColor}`}">
  12. <view class="app-text dir-left-nowrap cross-center" :style="{color: `${newData.textColor}`}" :class="[`${newData.textPosition === 'center' ? 'main-center' : 'main-left'}`]">
  13. <icon class="app-icon"></icon>
  14. <text>{{newData.placeholder}}</text>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. import appInput from '../../basic-component/app-input/app-input.vue';
  22. export default {
  23. name: 'app-search-for',
  24. props: {
  25. value: {
  26. type: Object,
  27. default: function() {
  28. return {
  29. background: `#efeff4`,
  30. color: '#ffffff',
  31. placeholder: '搜索',
  32. radius: 28,
  33. textColor: '#999999',
  34. textPosition: `center`,
  35. }
  36. }
  37. }
  38. },
  39. components: {
  40. 'app-input': appInput,
  41. },
  42. data() {
  43. return {
  44. newData: this.value
  45. };
  46. },
  47. methods: {
  48. jump_route() {
  49. uni.navigateTo({
  50. url: '/pages/search/search'
  51. })
  52. }
  53. }
  54. }
  55. </script>
  56. <style scoped lang="scss">
  57. .jump {
  58. width: 100%;
  59. height: 100%;
  60. }
  61. .app-view {
  62. height: #{88rpx};
  63. width: #{750rpx};
  64. position: relative;
  65. border-radius: 0;
  66. border: none;
  67. }
  68. .app-text {
  69. z-index: 1000;
  70. width: #{704rpx};
  71. height: #{58rpx};
  72. line-height: #{58rpx};
  73. }
  74. .app-text text {
  75. font-size: #{26rpx};
  76. }
  77. .app-icon {
  78. margin-right: #{12rpx};
  79. margin-left: #{12rpx};
  80. width: #{25rpx};
  81. height: #{25rpx};
  82. background-size: 100% 100%;
  83. background-image: url("../../../static/image/icon/search.png");
  84. }
  85. .input {
  86. height: #{58rpx};
  87. width: #{704rpx};
  88. border: #{1rpx} solid #dcdfe6;
  89. }
  90. </style>