search.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template>
  2. <view>
  3. <tn-nav-bar fixed alpha customBack>
  4. <view slot="back" class='tn-custom-nav-bar__back'
  5. @click="goBack">
  6. <text class='icon tn-icon-left'></text>
  7. </view>
  8. <view slot="default">
  9. <view>
  10. <text>搜索</text>
  11. </view>
  12. </view>
  13. </tn-nav-bar>
  14. <view style="width: 100%;padding:16px" :style="{paddingTop: vuex_custom_bar_height + 'px'}">
  15. <uni-search-bar radius="30" :focus="true" v-model="prodName" placeholder="请输入您感兴趣的产品名称" cancelButton="none">
  16. <template v-slot:searchIcon>
  17. </template>
  18. </uni-search-bar>
  19. <uni-search-bar radius="30" v-model="brand" placeholder="请输入您感兴趣的产品品牌" cancelButton="none">
  20. <template v-slot:searchIcon>
  21. </template>
  22. </uni-search-bar>
  23. <uni-search-bar radius="30" v-model="prodSpec" placeholder="请输入您感兴趣的产品型号" cancelButton="none">
  24. <template v-slot:searchIcon>
  25. </template>
  26. </uni-search-bar>
  27. <button type="primary" style="border-radius:30px;background-color: #3a96d7;" radius @click="searchProd">搜索</button>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. export default {
  33. data() {
  34. return {
  35. brand: '',
  36. prodName:'',
  37. prodSpec: '',
  38. }
  39. },
  40. methods: {
  41. goBack(){
  42. uni.navigateBack();
  43. },
  44. searchProd(){
  45. uni.setStorageSync('searchProdValue',this.prodName+'/'+this.brand+'/'+this.prodSpec)
  46. uni.navigateBack();
  47. }
  48. }
  49. }
  50. </script>
  51. <style lang="scss" scoped>
  52. /* 胶囊*/
  53. .tn-custom-nav-bar__back {
  54. width: 60%;
  55. height: 100%;
  56. position: relative;
  57. display: flex;
  58. justify-content: space-evenly;
  59. align-items: center;
  60. box-sizing: border-box;
  61. // background-color: rgba(0, 0, 0, 0.15);
  62. border-radius: 1000rpx;
  63. border: 1rpx solid rgba(255, 255, 255, 0.5);
  64. // color: #333;
  65. font-size: 18px;
  66. .icon {
  67. display: block;
  68. flex: 1;
  69. margin: auto;
  70. text-align: center;
  71. }
  72. }
  73. </style>