guide.nvue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. <template>
  2. <view class="guide-wrapper">
  3. <view v-if="currentType == 'device-tip'"
  4. class="guide-container justify-center align-center position-relative mask-bg-07">
  5. <view class="mid">
  6. <image class="bind-tip-image" src="../../../static/modal/tip/bind-tip-bg.png"></image>
  7. <text class="text-16px text-center text-white"
  8. style="width: 500rpx;margin-bottom: 130rpx;">请将手柄十字键朝上插入绑带中,佩戴在右侧小腿侧面</text>
  9. <view class="flex flex-direction-row" @click="switchSelected()">
  10. <image v-if="!isSelected" style="width: 40rpx;height: 40rpx; margin-right: 20rpx;"
  11. src="../../../static/common/subNVue/guide/check-box.png"></image>
  12. <image v-else style="width: 40rpx;height: 40rpx; margin-right: 20rpx;"
  13. src="../../../static/common/subNVue/guide/check-box-selected.png"></image>
  14. <text class="text-15px text-white">不再提示</text>
  15. </view>
  16. </view>
  17. </view>
  18. <view v-if="currentType == 'plan'" class="guide-container position-relative" @click="buttonMessage('confirm')">
  19. <!-- top: 55px; 相当于 上间隔 -->
  20. <view class="mask-bg-07" :style="{height:guideHeight+'px'}"></view>
  21. <!-- 中心位置 225 -->
  22. <view style="width: 750rpx;height: 284px;">
  23. <view style="height: 200px;" class="mask-bg-07">
  24. <view class="position-absolute-center" style="top: 0;left:100rpx;">
  25. <image style="width: 488rpx;height: 366rpx;"
  26. src="../../../static/common/subNVue/guide/guide-plan@3x.png">
  27. </image>
  28. </view>
  29. <view class="position-absolute-center">
  30. <text class="text-white text-14px" style="top: -30rpx;left:90rpx;">运动开始前设置一下计划</text>
  31. </view>
  32. </view>
  33. <view style="width: 750rpx;height: 120px;" class="flex flex-direction-row">
  34. <view style="width: 30px;" class="mask-bg-07"></view>
  35. <image style="width: 150px;height: 150px; opacity: 0.7;"
  36. src="../../../static/common/subNVue/guide/guide-rect-mask.png"></image>
  37. <view class="mask-bg-07 flex-sub"></view>
  38. </view>
  39. </view>
  40. <!-- 计算剩余空白 -->
  41. <view class="mask-bg-07 flex-sub"></view>
  42. </view>
  43. <view v-if="currentType == 'actionJumpPlay'" class="guide-container position-relative"
  44. @click="buttonMessage('confirm')">
  45. <!-- top: 55px; 相当于 上间隔 -->
  46. <view class="mask-bg-07" :style="{height:guideHeight+'px'}"></view>
  47. <!-- 中心位置 275 -->
  48. <view style="width: 750rpx;height: 350px;">
  49. <view style="height: 200px;" class="mask-bg-07">
  50. <view class="position-absolute-center" style="top: 0;left:100rpx;">
  51. <image style="width: 488rpx;height: 366rpx;"
  52. src="../../../static/common/subNVue/guide/guide-mid.png">
  53. </image>
  54. </view>
  55. <view class="position-absolute-center">
  56. <text class="text-white text-14px" style="top: -30rpx;left:80rpx;">点击开始进行</text>
  57. </view>
  58. </view>
  59. <view style="width: 750rpx;height: 150px;" class="flex flex-direction-row">
  60. <view style="width: 166rpx;" class="mask-bg-07"></view>
  61. <image style="width: 200px;height: 200px; opacity: 0.7;top: -63rpx;"
  62. src="../../../static/common/subNVue/guide/guide-circle-mask.png"></image>
  63. <view class="mask-bg-07 flex-sub"></view>
  64. </view>
  65. </view>
  66. <!-- 计算剩余空白 -->
  67. <view class="mask-bg-07 flex-sub"></view>
  68. </view>
  69. <view v-if="currentType == 'bluetoothConnect'" class="guide-container position-relative"
  70. @click="buttonMessage('confirm')">
  71. <!-- top: 55px; 相当于 上间隔 -->
  72. <view class="mask-bg-07" :style="{height:guideHeight+'px'}"></view>
  73. <!-- 中心位置 225 -->
  74. <view style="width: 750rpx;height: 284px;">
  75. <view style="height: 200px;" class="mask-bg-07">
  76. <view class="position-absolute-center" style="top: 0;left:100rpx;">
  77. <image style="width: 488rpx;height: 366rpx;"
  78. src="../../../static/common/subNVue/guide/guide-bluetooth@3x.png">
  79. </image>
  80. </view>
  81. <view class="position-absolute-center">
  82. <text class="text-white text-14px" style="top: -10rpx;left:80rpx;">点击此处进行蓝牙连接</text>
  83. </view>
  84. </view>
  85. <view style="width: 750rpx;height: 84px;" class="flex flex-direction-row">
  86. <!-- 这里width 当做 left -->
  87. <view class="mask-bg-07" :style="{width:guideLeft+'px'}"></view>
  88. <image style="width: 100px;height: 100px; opacity: 0.7;top: -16px;"
  89. src="../../../static/common/subNVue/guide/guide-circle-mask.png"></image>
  90. <view class="mask-bg-07 flex-sub"></view>
  91. </view>
  92. </view>
  93. <!-- 计算剩余空白 -->
  94. <view class="mask-bg-07 flex-sub"></view>
  95. </view>
  96. </view>
  97. </template>
  98. <script>
  99. import {
  100. mapState,
  101. mapMutations
  102. } from 'vuex';
  103. export default {
  104. computed: mapState(['systemInfo', 'navHeight', 'tabbarHeight']),
  105. data() {
  106. return {
  107. title: '',
  108. content: '',
  109. lists: [],
  110. isSelected: false,
  111. currentType: 'none',
  112. operationItem: null,
  113. guideHeight: 55,
  114. guideLeft: 166,
  115. }
  116. },
  117. created() {
  118. const vm = this;
  119. // for (let i = 1; i < 20; i++) {
  120. // this.lists.push('item' + i);
  121. // }
  122. uni.$on('guide-popup', (data) => {
  123. vm.title = data.title;
  124. vm.content = data.content;
  125. vm.currentType = data.type;
  126. vm.operationItem = data.operationItem;
  127. // console.log(JSON.stringify(data),vm.currentType);
  128. if (vm.currentType == "actionJumpPlay") {
  129. let _viewData = data.item;
  130. // console.log(JSON.stringify(vm.systemInfo));
  131. // _viewData.height/4 = 27.5
  132. vm.guideHeight = _viewData.top + _viewData.height - _viewData.height / 4 - vm.systemInfo
  133. .statusBarHeight - 275;
  134. } else if (vm.currentType == "bluetoothConnect") {
  135. let _viewData = data.item;
  136. vm.guideHeight = _viewData.top + _viewData.height - _viewData.height / 4 - vm.systemInfo
  137. .statusBarHeight - 225;
  138. vm.guideLeft = _viewData.left - _viewData.width / 2 + 5;
  139. } else if (vm.currentType == "plan") {
  140. let _viewData = data.item;
  141. vm.guideHeight = vm.systemInfo.screenHeight - 284 - 32;
  142. // vm.guideLeft = 55;
  143. }
  144. })
  145. },
  146. beforeDestroy() {
  147. uni.$off('guide-popup')
  148. },
  149. methods: {
  150. switchSelected() {
  151. console.log('switchSelected', this.isSelected, !this.isSelected);
  152. this.isSelected = !this.isSelected;
  153. if (this.isSelected) {
  154. //this.buttonMessage('confirm');
  155. uni.setStorage({
  156. key: 'deviceDirectionPrompt',
  157. data: {
  158. isSelected: true
  159. }
  160. })
  161. } else {
  162. // this.buttonMessage('cancel');
  163. uni.setStorage({
  164. key: 'deviceDirectionPrompt',
  165. data: {
  166. isSelected: false
  167. }
  168. })
  169. }
  170. },
  171. buttonMessage(buttonEvent) {
  172. setTimeout(() => {
  173. const subNVue = uni.getCurrentSubNVue()
  174. uni.$emit('guide-popup-page', {
  175. type: 'button',
  176. messageType: this.currentType,
  177. confirm: buttonEvent == 'confirm' ? true : false,
  178. cancel: buttonEvent == 'cancel' ? true : false,
  179. info: buttonEvent + ' 该元素被点击了!',
  180. operationItem: this.operationItem
  181. })
  182. }, 260);
  183. this.hidePupup();
  184. },
  185. hidePupup() {
  186. console.log('hidePupup');
  187. uni.getCurrentSubNVue().hide('auto', 250);
  188. setTimeout(() => {
  189. this.currentType = 'none';
  190. }, 250);
  191. }
  192. }
  193. }
  194. </script>
  195. <style scoped lang="scss">
  196. .guide-wrapper {
  197. justify-content: center;
  198. align-items: center;
  199. }
  200. .guide-container {
  201. /* background-color: rgba(0, 0, 0, 0.3); */
  202. width: 750rpx;
  203. flex: 1;
  204. }
  205. .transparents-container {}
  206. .mid {
  207. justify-content: center;
  208. align-items: center;
  209. height: 700rpx;
  210. width: 300rpx;
  211. }
  212. .bind-tip-image {
  213. border-width: 14rpx;
  214. border-style: solid;
  215. border-color: #E5E5FF;
  216. background-color: #FFFFFF;
  217. width: 226rpx;
  218. height: 260rpx;
  219. margin-bottom: 50rpx;
  220. }
  221. .title {
  222. height: 100rpx;
  223. line-height: 100rpx;
  224. border-bottom-style: solid;
  225. border-bottom-width: 1rpx;
  226. border-bottom-color: #CBCBCB;
  227. flex: 0;
  228. font-size: 30rpx;
  229. }
  230. .scroller {
  231. height: 400rpx;
  232. padding: 8rpx 15rpx;
  233. }
  234. .content {
  235. color: #555555;
  236. font-size: 32rpx;
  237. }
  238. .message-wrapper {
  239. flex: 0;
  240. border-top-style: solid;
  241. border-top-width: 1rpx;
  242. border-top-color: #CBCBCB;
  243. height: 80rpx;
  244. align-items: flex-end;
  245. }
  246. .send-message {
  247. font-size: 30rpx;
  248. line-height: 80rpx;
  249. color: #00CE47;
  250. margin-left: 20rpx;
  251. }
  252. .cell {
  253. margin: 10rpx;
  254. padding: 20rpx 0;
  255. top: 10rpx;
  256. align-items: center;
  257. justify-content: center;
  258. border-radius: 10rpx;
  259. background-color: #5989B9;
  260. }
  261. .text {
  262. font-size: 30rpx;
  263. text-align: center;
  264. color: white;
  265. }
  266. .circle {
  267. width: 50px;
  268. height: 50px;
  269. border-width: 1rpx;
  270. border-color: #FF0000;
  271. border-style: solid;
  272. border-radius: 50%;
  273. position: absolute;
  274. top: 200rpx;
  275. left: 200rpx;
  276. background-color: rgba(255, 255, 255, 0);
  277. /* box-sizing: border-box; */
  278. }
  279. .su {
  280. position: relative;
  281. width: 750px;
  282. flex: 1;
  283. border-width: 1rpx;
  284. border-color: #FF0000;
  285. border-style: solid;
  286. }
  287. .lk {
  288. position: absolute;
  289. width: 100px;
  290. height: 200px;
  291. /* border-radius: 10px; */
  292. // border-width: 10px;
  293. // border-color: rgba(0, 0, 0, 0.4);
  294. // border-style: solid;
  295. border-top-color: #000000;
  296. border-top-width: 10px;
  297. border-bottom: 1rpx solid #000;
  298. top: 150px;
  299. /* margin-top: -250px; */
  300. left: 150px;
  301. /* margin-left: -250px; */
  302. }
  303. </style>