index.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <view :style="{ minHeight: sys.windowHeight + 'px' }"
  3. :class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
  4. <tm-message ref="toast"></tm-message>
  5. <tm-menubars title="创建家庭" :shadow="0" :showback="false"></tm-menubars>
  6. <tm-sheet :shadow="24" v-if="active==1">
  7. <tm-steps model="number" color="bg-gradient-blue-accent" activeFontColor="blue" line-color="bg-gradient-blue-accent" v-model="active" :list="list"></tm-steps>
  8. <view class="mt-20">
  9. <text class="text-primary text-size-s">扫柜体上的二维码和衣柜绑定</text>
  10. </view>
  11. <image block class="zhanshi" mode="widthFix" src="https://picsum.photos/300?k=1"></image>
  12. <tm-button theme="bg-gradient-blue-accent" @click="saoma()" block>扫二维码</tm-button>
  13. </tm-sheet>
  14. <tm-sheet :shadow="24" v-if="active==2">
  15. <view class="flex fulled-height" >
  16. <view style="width: 80px;">
  17. 111
  18. </view>
  19. <view style="width:calc(100% - 160rpx);">
  20. 222
  21. </view>
  22. </view>
  23. <tm-button theme="bg-gradient-blue-accent" @click="saoma()" block>下一步</tm-button>
  24. </tm-sheet>
  25. </view>
  26. </template>
  27. <script>
  28. import{myRequest} from '@/api/request.js'
  29. export default {
  30. data() {
  31. return {
  32. active:2,
  33. list:['创建家庭','创建角色','创建成功'],
  34. list2:[
  35. {text:'苏州'},
  36. {text:'北京'},
  37. {text:'广东'},
  38. {text:'江西',dot:8},
  39. {text:'深圳'},
  40. ],
  41. };
  42. },
  43. onLoad() {
  44. },
  45. created() {
  46. this.sys = uni.getSystemInfoSync();
  47. },
  48. methods: {
  49. saoma(){
  50. console.log("111")
  51. var that=this;
  52. that.active=2;
  53. uni.scanCode({
  54. scanType: ['barCode'],
  55. success: function (res) {
  56. console.log('条码类型:' + res.scanType);
  57. console.log('条码内容:' + res.result);
  58. that.active=2;
  59. },
  60. error : function(e) {
  61. alert("网络异常,请重试");
  62. }
  63. })
  64. },
  65. },
  66. }
  67. </script>
  68. <style lang="scss">
  69. .zhanshi{
  70. width: 100%;
  71. margin: 0 auto;
  72. margin-top: 10px;
  73. margin-bottom: 40px;
  74. }
  75. /deep/ .tm-menubars .body{
  76. background-color: #1b1b1b !important;
  77. }
  78. </style>