homeSelect.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <view @click="close" class="mask">
  3. <view class="wrapper">
  4. <text class="iconTop">&#xe649;</text>
  5. <view class="list">
  6. <view class="li" @click="scan">
  7. <text class="icon">&#xe891;</text>
  8. <text class="t1">扫一扫</text>
  9. </view>
  10. <view class="li" @click="creatTask">
  11. <text class="icon">&#xe64a;</text>
  12. <text class="t1">创建任务</text>
  13. </view>
  14. <view class="li" @click="goUrl">
  15. <text class="icon">&#xe6a7;</text>
  16. <text class="t1">关注机器人</text>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. var domModule = weex.requireModule('dom');
  24. domModule.addRule('fontFace', {
  25. 'fontFamily': "iconfont",
  26. 'src': "url('/static/iconfont.ttf')"
  27. })
  28. export default {
  29. data(){
  30. return {
  31. }
  32. },
  33. mounted() {
  34. },
  35. methods:{
  36. close() {
  37. uni.navigateBack()
  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/popupTask',
  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>
  67. page {
  68. background: transparent;
  69. }
  70. </style>
  71. <style scoped lang="scss">
  72. .mask {
  73. position: fixed;
  74. left: 0;
  75. top: 0;
  76. right: 0;
  77. bottom: 0;
  78. /* #ifndef APP-NVUE */
  79. display: flex;
  80. /* #endif */
  81. justify-content: center;
  82. align-items: center;
  83. background-color: rgba(0, 0, 0, 0.4);
  84. }
  85. .iconTop{
  86. font-family: iconfont;
  87. color: #484848;
  88. text-align: right;
  89. display: flex;
  90. font-size: 20px;
  91. margin-bottom: -22rpx;
  92. margin-left: 180rpx;
  93. }
  94. .icon {
  95. font-family: iconfont;
  96. font-size: 22px;
  97. color: #fff;
  98. opacity: 0.7;
  99. }
  100. .wrapper{
  101. position: absolute;
  102. top: 130rpx;
  103. right: 20rpx;
  104. .list{
  105. background: #484848;
  106. padding: 10rpx 0;
  107. border-radius: 20rpx;
  108. .li{
  109. padding: 15rpx 20rpx;
  110. margin-top: 14rpx;
  111. display: flex;
  112. flex-direction: row;
  113. align-items: center;
  114. .t1{
  115. color: #fff;
  116. font-size: 28rpx;
  117. margin-left: 20rpx;
  118. border-bottom:1px solid #4D4C4C;
  119. }
  120. }
  121. }
  122. }
  123. </style>