BpopLog2.nvue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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.navigateTo({
  48. url:'/pages/webview/popup'
  49. })
  50. return
  51. uni.$emit('xBpopLog2', {
  52. content: 'comfirm'
  53. });
  54. },
  55. scan() {
  56. this.close()
  57. uni.scanCode({
  58. success: (res) => {
  59. console.log('条码类型:' + res.scanType);
  60. console.log('条码内容:' + res.result);
  61. },
  62. fail: (e) => {
  63. console.log(e)
  64. }
  65. });
  66. },
  67. }
  68. }
  69. </script>
  70. <style scoped lang="scss">
  71. .iconTop{
  72. font-family: iconfont;
  73. color: #484848;
  74. text-align: right;
  75. font-size: 20px;
  76. margin-bottom: -22rpx;
  77. margin-right: 18rpx;
  78. }
  79. .icon {
  80. font-family: iconfont;
  81. font-size: 22px;
  82. color: #fff;
  83. opacity: 0.7;
  84. }
  85. .wrapper{
  86. position: relative;
  87. .list{
  88. background: #484848;
  89. padding: 10rpx 0;
  90. border-radius: 20rpx;
  91. .li{
  92. padding: 15rpx 20rpx;
  93. margin-top: 14rpx;
  94. flex-direction: row;
  95. align-items: center;
  96. .t1{
  97. color: #fff;
  98. font-size: 28rpx;
  99. margin-left: 20rpx;
  100. border-bottom:1px solid #4D4C4C;
  101. }
  102. }
  103. }
  104. }
  105. </style>