saoma.vue 571 B

1234567891011121314151617181920212223242526272829303132333435
  1. <!--
  2. <template>
  3. <view>
  4. <input class="input" type="text" v-model="date" />
  5. <button type="primary" @click="tel()">扫描</button>
  6. </view>
  7. </template>
  8. <script>
  9. export default {
  10. data() {
  11. return {
  12. date: 0,
  13. };
  14. },
  15. methods:{
  16. tel(){
  17. var that = this;
  18. // 允许从相机和相册扫码
  19. uni.scanCode({
  20. success(res) {
  21. console.log('条码类型:' + res.scanType);
  22. console.log('条码内容:' + res.result);
  23. that.date = res.result;
  24. }
  25. });
  26. },
  27. }
  28. }
  29. </script>
  30. <style>
  31. </style> -->