VaseYard.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <view class="vase-yard">
  3. <!-- <view class="top" @click="$goBack(2,'/pages/bazaar/VaseYard/reportedRecord')">
  4. <text>我的上报</text>
  5. </view> -->
  6. <view class="bom">
  7. <view class="uni-input-wrapper">
  8. <input class="uni-input" placeholder="输入瓶码" v-model="id" />
  9. <view class="icon" @click="ScanCodes()">
  10. <uni-icons type="scan" size="30"></uni-icons>
  11. </view>
  12. </view>
  13. <view class="btn" @click="particulars(id)">
  14. 开始稽查
  15. </view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. data() {
  22. return {
  23. id:''
  24. };
  25. },
  26. onLoad() {
  27. },
  28. methods:{
  29. // 扫码
  30. ScanCodes(){
  31. uni.scanCode({
  32. success: function (res) {
  33. if (res.result) {
  34. let data = res.result
  35. let index = data.lastIndexOf("/")
  36. data = data.substring(index+1,data.length)
  37. data = data.replace(/\s*/g,"")
  38. uni.navigateTo({
  39. url: '/pages/bazaar/VaseYard/particulars?id=' + data
  40. });
  41. }
  42. }
  43. });
  44. },
  45. // 查询
  46. particulars(data){
  47. if(this.id) {
  48. uni.navigateTo({
  49. url: '/pages/bazaar/VaseYard/particulars?id=' + data
  50. });
  51. }
  52. }
  53. }
  54. }
  55. </script>
  56. <style lang="scss">
  57. .vase-yard {
  58. height: 100%;
  59. .top {
  60. text-align: right;
  61. background-color: #e40315;
  62. height: 100rpx;
  63. line-height: 100rpx;
  64. text {
  65. color: #eee;
  66. margin: 30rpx;
  67. }
  68. }
  69. .bom {
  70. height: calc(100% - 100rpx);
  71. background-color: #eeeeee;
  72. display: flex;
  73. flex-direction: column;
  74. align-items: center;
  75. justify-content: center;
  76. padding: 0 40rpx;
  77. .uni-input-wrapper{
  78. background-color: #fff;
  79. width: 100%;
  80. height: 80rpx;
  81. position: relative;
  82. border-radius: 8rpx;
  83. .uni-input{
  84. padding-left: 20rpx;
  85. height: 100%;
  86. border-radius: 8rpx;
  87. }
  88. .icon{
  89. position: absolute;
  90. top: 50%;
  91. transform: translateY(-50%);
  92. right: 20rpx;
  93. z-index: 2;
  94. }
  95. }
  96. .btn {
  97. margin-top: 40rpx;
  98. color: #5a9ede;
  99. }
  100. }
  101. }
  102. </style>