BpopLog2.nvue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <view class="wrapper">
  3. <text class="iconTop">&#xe649;</text>
  4. <view class="list">
  5. <view class="li" @click="scan">
  6. <text class="icon">&#xe891;</text>
  7. <text class="t1">扫一扫</text>
  8. </view>
  9. <view class="li" @click="creatTask">
  10. <text class="icon">&#xe64a;</text>
  11. <text class="t1">创建任务</text>
  12. </view>
  13. <view class="li" @click="goUrl">
  14. <text class="icon">&#xe6a7;</text>
  15. <text class="t1">关注机器人</text>
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. var domModule = weex.requireModule('dom');
  22. domModule.addRule('fontFace', {
  23. 'fontFamily': "iconfont",
  24. 'src': "url('/static/iconfont.ttf')"
  25. })
  26. export default {
  27. data(){
  28. return {
  29. }
  30. },
  31. mounted() {
  32. },
  33. methods:{
  34. close() {
  35. const fssubNVue = uni.getSubNVueById('BpopLog2')
  36. console.log(fssubNVue)
  37. fssubNVue.hide()
  38. },
  39. goUrl(){
  40. this.close()
  41. uni.navigateTo({
  42. url:'/pages/native/robot'
  43. })
  44. },
  45. creatTask(){
  46. this.close()
  47. uni.$emit('xBpopLog2', {
  48. content: 'comfirm'
  49. });
  50. },
  51. scan() {
  52. this.close()
  53. uni.scanCode({
  54. success: (res) => {
  55. console.log('条码类型:' + res.scanType);
  56. console.log('条码内容:' + res.result);
  57. },
  58. fail: (e) => {
  59. console.log(e)
  60. }
  61. });
  62. },
  63. }
  64. }
  65. </script>
  66. <style scoped lang="scss">
  67. .iconTop{
  68. font-family: iconfont;
  69. color: #484848;
  70. text-align: right;
  71. font-size: 20px;
  72. margin-bottom: -22rpx;
  73. margin-right: 18rpx;
  74. }
  75. .icon {
  76. font-family: iconfont;
  77. font-size: 22px;
  78. color: #fff;
  79. opacity: 0.7;
  80. }
  81. .wrapper{
  82. position: relative;
  83. .list{
  84. background: #484848;
  85. padding: 10rpx 0;
  86. border-radius: 20rpx;
  87. .li{
  88. padding: 15rpx 20rpx;
  89. margin-top: 14rpx;
  90. flex-direction: row;
  91. align-items: center;
  92. .t1{
  93. color: #fff;
  94. font-size: 28rpx;
  95. margin-left: 20rpx;
  96. border-bottom:1px solid #4D4C4C;
  97. }
  98. }
  99. }
  100. }
  101. </style>