CpopLog3.nvue 1.9 KB

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