index.wxml 4.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <!--pages/index/index.wxml-->
  2. <view class="newIndex" style="padding-bottom:{{isIphoneX?'68rpx':'0px'}}">
  3. <view class="topBar">
  4. <van-button custom-class="borders" bind:click="goConnect" plain type="info">{{!deviceId?"未连接智能笔":"已连接"}}
  5. </van-button>
  6. <van-button custom-class="borders" bind:click="saveCanvasImage" plain type="info">上传试卷
  7. </van-button>
  8. <!-- <van-button custom-class="borders" bind:click="gotoTeacher" plain type="info">老师端测试
  9. </van-button> -->
  10. <!-- <view>{{currentPage+1}}</view> -->
  11. </view>
  12. <van-tabs active="{{activeTabBar}}" color="#FC6C1E" bind:change="onChange">
  13. <van-tab title="作业纸">
  14. <canvas type="2d" id="myCanvas" style="width:{{canvasWidth}}px;height:{{canvasHeight}}px">
  15. </canvas>
  16. </van-tab>
  17. </van-tabs>
  18. <!-- 选择线宽 -->
  19. <van-transition show="{{ activeTab==='penWidth' }}" name="fade">
  20. <view class="penWidthPic" style="bottom:{{isIphoneX?'75px':'39px'}}">
  21. <view wx:for="{{penWidthImg}}" wx:key="index" class="{{index===penWidthIndex?'chosenPenWidth':''}}" bindtap="chosenPenwidth" data-index="{{index}}">
  22. <image src="{{item.img}}" alt="" />
  23. </view>
  24. </view>
  25. </van-transition>
  26. <!-- 选择颜色 -->
  27. <van-transition show="{{activeTab==='color'}}" name="fade">
  28. <view class="penColor" style="bottom:{{isIphoneX?'75px':'39px'}}">
  29. <view wx:for="{{penColors}}" bindtap="changeColor" data-index="{{index}}" class="ChosenColor" wx:key="index" style="background-color:{{item.color}}">
  30. <van-icon name="success" color="{{chosenIndex===index?'#fff':item.color}}" />
  31. </view>
  32. </view>
  33. </van-transition>
  34. <!-- 所有选项 -->
  35. <van-transition show="{{activeTab==='more'}}" name="fade">
  36. <view class="allOption" style="bottom:{{isIphoneX?'75px':'39px'}}">
  37. <view class="optionTitle" bindtap="hideOffline">
  38. <van-icon name="arrow-left" wx:if="{{checkOffline}}" color="#132238" size="18rpx" />
  39. 选项
  40. </view>
  41. <view class="menu">
  42. <view class="menuOpt" wx:if="{{!checkOffline}}">
  43. <view wx:for="{{optionImg}}" wx:key="index" class="onOpt m9" bindtap="tapOption" data-index="{{index}}">
  44. <image class="optImg" src="{{item.img}}"></image>
  45. <text class="optTxt">{{item.text}}</text>
  46. <van-icon name="arrow" wx:if="{{index===1}}" color="#132238" size="20rpx" />
  47. </view>
  48. </view>
  49. <view class="menuOpt" wx:if="{{checkOffline}}">
  50. <view wx:for="{{offlineImg}}" wx:key="index" bindtap="offlineDataActivity" data-index="{{index}}" class="onOpt m9">
  51. <image class="optImg" src="{{item.img}}"></image>
  52. <text class="optTxt">{{item.text}}</text>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </van-transition>
  58. <van-tabbar placeholder='{{true}}' active-color="#EC6938" active="{{activeTab}}" bind:change="changeTab">
  59. <van-tabbar-item wx:for="{{basePic}}" name="{{item.name}}" wx:key="name">
  60. <image slot="icon" src="{{item.icon}}" mode="aspectFit" style="width:30px;height:18px"></image>
  61. <image slot="icon-active" src="{{item.iconClick}}" mode="aspectFit" style="width: 30px; height: 18px;"></image>
  62. {{item.text}}
  63. </van-tabbar-item>
  64. </van-tabbar>
  65. <van-overlay z-index='{{999}}' show="{{ showConnectPen }}">
  66. <view class="connectPen">
  67. <view class="penDeteils">
  68. <view class="w50 flex closeButton">
  69. <van-icon name="close" size="20px" color='#8492A6' bind:click="hidePen" />
  70. </view>
  71. <view class="w50 middleInfo flex columnCenter">
  72. <view class="penName">笔名:{{deviceName}}</view>
  73. <text class="macAdrress">mac:{{deviceMac}}</text>
  74. <text class="macAdrress">电量剩余:{{penBattery}}</text>
  75. </view>
  76. <view class="w50 columnCenter">
  77. <van-button custom-class='changeButton' bind:click="changePen" color='#8492A6' plain type="info">切换智能笔
  78. </van-button>
  79. </view>
  80. </view>
  81. </view>
  82. </van-overlay>
  83. <van-dialog id='van-dialog'></van-dialog>
  84. <van-toast id="van-toast" />
  85. <view wx:if="{{showOfflineDialog}}" class="offlineProcess">
  86. <van-loading type='spinner' wx:if="{{continueFlag}}"></van-loading>
  87. <van-icon size="30" color='#fff' name="play-circle-o" wx:if="{{!continueFlag}}" />
  88. <view class="process">{{offlineProcess}}%</view>
  89. <view bindtap="processButton" class="processButton">{{continueFlag?'暂停':'继续'}}</view>
  90. </view>
  91. </view>