index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template :class="[AppTheme]">
  2. <u-navbar :titleStyle="{color:'#ffffff'}" :bgColor="datas.bg_color" :autoBack="false" :fixed="true"
  3. :placeholder="true" :height="45">
  4. <view class="u-nav-slot" slot="left" @click="scancode">
  5. <u-icon name="scan" color="#ffffff" size="24"></u-icon>
  6. </view>
  7. <!-- #ifdef APP-PLUS || H5 -->
  8. <view class="u-nav-slot" slot="center" style="width: 580rpx;">
  9. <u-search actionText="" :showAction="false" placeholder="输入商品名称" bg-color="#fff" @search="doSearch"
  10. v-model="search"></u-search>
  11. </u-icon>
  12. </view>
  13. <!-- #endif -->
  14. <!-- #ifdef MP-WEIXIN -->
  15. <view class="u-nav-slot" slot="center" style="width: 580rpx;">
  16. <view class="u-nav-slot" slot="center" style="width: 460rpx;">
  17. <u-search actionText="" :showAction="false" placeholder="输入商品名称" bg-color="#fff" @search="doSearch"
  18. v-model="search"></u-search>
  19. </u-icon>
  20. </view>
  21. </view>
  22. <!-- #endif -->
  23. <!-- #ifdef APP-PLUS || H5 -->
  24. <view class="u-nav-slot" slot="right" @click="tocar">
  25. <u-icon name="shopping-cart" color="#ffffff" size="24"></u-icon>
  26. </view>
  27. <!-- #endif -->
  28. </u-navbar>
  29. </template>
  30. <script>
  31. export default {
  32. props: ['styles', 'datas'],
  33. data() {
  34. return {
  35. search: '',
  36. };
  37. },
  38. methods: {
  39. //打开扫一扫
  40. scancode() {
  41. uni.scanCode({
  42. scanType: ['qrCode'],
  43. success: function(res) {
  44. uni.navigateTo({
  45. url: '/pagesB/pages/activorderdails/writeoffdetails/writeoffdetails?code=' +
  46. res.result
  47. })
  48. }
  49. })
  50. },
  51. //打开购物车
  52. tocar() {
  53. uni.navigateTo({
  54. url: '/pagesE/pages/cart/cart'
  55. })
  56. },
  57. doSearch() {
  58. uni.navigateTo({
  59. url: `/pagesA/pages/search/search?value=${this.search}`
  60. })
  61. },
  62. },
  63. };
  64. </script>
  65. <style lang="less" scoped>
  66. .component-wrapper {
  67. display: block;
  68. max-width: 100%;
  69. // text-align: center;
  70. margin-left: auto;
  71. margin-right: auto;
  72. overflow: hidden;
  73. text-decoration: none;
  74. display: flex;
  75. align-items: center;
  76. }
  77. .search-input {
  78. width: 100%;
  79. height: 35px;
  80. display: flex;
  81. justify-items: center;
  82. border-radius: 50px;
  83. background-color: white;
  84. }
  85. .img {
  86. width: 25px;
  87. height: 25px;
  88. margin: 10px;
  89. }
  90. .title {
  91. width: 315px;
  92. }
  93. </style>