guide.nvue 9.2 KB

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