123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540 |
- <template>
- <view class="guide-wrapper">
- <view v-if="currentType == 'level-button-tip'" class="guide-container position-relative"
- @click="buttonMessage('confirm')">
- <!-- top: 55px; 相当于 上间隔 -->
- <view class="mask-bg-07" :style="{height:guideHeight+'px'}"></view>
- <!-- 中心位置 225 -->
- <view style="width: 750rpx;height: 231px;">
- <view style="height: 200px;" class="mask-bg-07">
- <view class="position-absolute-center" style="top: 0;left:100rpx;">
- <image style="width: 488rpx;height: 366rpx;"
- src="../../../static/modal/level-tip/level-tip-box@2x.png">
- </image>
- </view>
- <view class="position-absolute-center">
- <text class="text-white text-14px text-lines2"
- style="top: -80rpx;left:70rpx; width: 300rpx;">点击此按钮选择关卡</text>
- <view v-if="hiddenType != 'firstInstallation' && hiddenType != 'normal'"
- class="flex flex-direction-row" style="top: -50rpx;left:50rpx;" @click="switchSelected()">
- <image v-if="!isSelected" style="width: 40rpx;height: 40rpx; margin-right: 20rpx;"
- src="../../../static/common/subNVue/guide/check-box.png"></image>
- <image v-else style="width: 40rpx;height: 40rpx; margin-right: 20rpx;"
- src="../../../static/common/subNVue/guide/check-box-selected.png"></image>
- <text class="text-15px text-white">不再提示</text>
- </view>
- </view>
- </view>
- <!-- <view style="width: 750rpx;height: 82rpx;" class="flex flex-direction-row">
- <view class="flex-sub mask-bg-07"></view>
- <view class="position-relative justify-center align-center"
- style="width: 147px;height: 82rpx; background-color: rgba(0,0,0,0.7);">
- <image style="width: 147px;height: 31px;" class="position-absolute-center"
- src="../../../static/modal/level-tip/level-tip-bg@2x.png"></image>
- <image style="width: 30px;height: 23px; "
- src="../../../static/modal/level-tip/level-tip-logo@2x.png"></image>
- </view>
- <view class="flex-sub mask-bg-07"></view>
- </view> -->
- <view style="width: 750rpx;height: 82rpx;" class="flex flex-direction-row">
- <view class="flex-sub mask-bg-07"></view>
- <view class="position-relative align-center"
- style="width: 248rpx;height: 104rpx; background-color: rgba(0,0,0,0.7);">
- <image class="position-absolute-center" style="width: 248rpx;height: 104rpx; top: 18rpx;"
- src="../../../static/modal/level-tip/level-tip-bg-orange.png"></image>
- <view style="margin-top: 38rpx; width: 72rpx; height: 12rpx; background-color: #FFFFFF; border-radius: 18px;"></view>
- </view>
- <view class="flex-sub mask-bg-07"></view>
- </view>
- </view>
- <!-- 计算剩余空白 -->
- <view class="mask-bg-07 flex-sub"></view>
- </view>
- <view v-if="currentType == 'device-tip'"
- class="guide-container justify-center align-center position-relative mask-bg-07"
- @click="buttonMessage('confirm')">
- <view class="mid">
- <image class="bind-tip-image" src="../../../static/modal/tip/bind-tip-bg.png"></image>
- <text class="text-16px text-center text-white"
- style="width: 500rpx;margin-bottom: 130rpx;">请将手柄十字键朝上插入绑带中,佩戴在右侧小腿侧面</text>
- <view v-if="hiddenType != 'firstInstallation'" class="flex flex-direction-row"
- @click="switchSelected()">
- <image v-if="!isSelected" style="width: 40rpx;height: 40rpx; margin-right: 20rpx;"
- src="../../../static/common/subNVue/guide/check-box.png"></image>
- <image v-else style="width: 40rpx;height: 40rpx; margin-right: 20rpx;"
- src="../../../static/common/subNVue/guide/check-box-selected.png"></image>
- <text class="text-15px text-white">不再提示</text>
- </view>
- </view>
- </view>
- <view v-if="currentType == 'plan'" class="guide-container position-relative" @click="buttonMessage('confirm')">
- <!-- top: 55px; 相当于 上间隔 -->
- <view class="mask-bg-07" :style="{height:guideHeight+'px'}"></view>
- <!-- 中心位置 225 -->
- <view style="width: 750rpx;height: 284px;" >
- <view style="height: 220px;" class="mask-bg-07">
- <view class="position-absolute-center-bottom">
- <image style="width: 488rpx;height: 366rpx;"
- src="../../../static/common/subNVue/guide/guide-plan@3x.png">
- </image>
- </view>
- <view class="position-absolute-center">
- <text class="text-white text-14px text-lines2"
- style="top: 20rpx;left:40rpx; width: 300rpx;">请先定制属于您的专属计划</text>
- </view>
- </view>
- <view style="width: 750rpx;height: 100px;" class="flex flex-direction-row">
- <!-- 32+ 60/2 -->
- <view style="width: 62px;" class="mask-bg-07"></view>
- <image style="width: 90px;height: 100px; opacity: 0.7;"
- src="../../../static/common/subNVue/guide/guide-rect-mask.png"></image>
- <view class="mask-bg-07 flex-sub"></view>
- </view>
- </view>
- <!-- 计算剩余空白 -->
- <view class="mask-bg-07 flex-sub"></view>
- </view>
- <view v-if="currentType == 'actionJumpPlay'" class="guide-container position-relative"
- @click="buttonMessage('confirm')">
- <!-- top: 55px; 相当于 上间隔 -->
- <view class="mask-bg-07" :style="{height:guideHeight+'px'}"></view>
- <!-- 中心位置 275 -->
- <view style="width: 750rpx;height: 350px;">
- <view style="height: 200px;" class="mask-bg-07">
- <view class="position-absolute-center" style="top: 0;left:100rpx;">
- <image style="width: 488rpx;height: 366rpx;"
- src="../../../static/common/subNVue/guide/guide-mid.png">
- </image>
- </view>
- <view class="position-absolute-center">
- <text class="text-white text-14px" style="top: -30rpx;left:80rpx;">点击播放体验关卡对应关卡</text>
- </view>
- </view>
- <view style="width: 750rpx;height: 150px;" class="flex flex-direction-row">
- <view style="width: 166rpx;" class="mask-bg-07"></view>
- <image style="width: 200px;height: 200px; opacity: 0.7;top: -63rpx;"
- src="../../../static/common/subNVue/guide/guide-circle-mask.png"></image>
- <view class="mask-bg-07 flex-sub"></view>
- </view>
- </view>
- <!-- 计算剩余空白 -->
- <view class="mask-bg-07 flex-sub"></view>
- </view>
- <view v-if="currentType == 'bluetoothConnect'" class="guide-container position-relative"
- @click="buttonMessage('confirm')">
- <!-- top: 55px; 相当于 上间隔 -->
- <view class="mask-bg-07" :style="{height:guideHeight+'px'}"></view>
- <!-- 中心位置 225 -->
- <view style="width: 750rpx;height: 764rpx;">
- <view style="height: 596rpx;" class="mask-bg-07">
- <view class="position-absolute-center-bottom" style="left:31rpx;">
- <image style="width: 442rpx;height: 372rpx;"
- src="../../../static/common/subNVue/guide/guide-bluetooth@3x.png">
- </image>
- </view>
- <view class="position-absolute-center">
- <text class="text-white text-14px" style="left: 20px;top: 50px;">请先连接蓝牙设备</text>
- <!-- <text class="text-left text-white text-14px"
- style="width: 542rpx;">1、长按开关键3秒,绿灯连续闪烁为可连接状态.</text>
- <text class="text-left text-white text-14px" style="width: 542rpx;">2、选择设备类型进行连接.</text>
- <text class="text-left text-white text-14px"
- style="width: 542rpx;">3、手柄连接成功后,将手柄十字键朝上插入绑带中.</text>
- <text class="text-left text-white text-14px" style="width: 542rpx;">4、用绑带将手柄朝上绑在右脚脚踝上.</text>
- -->
- </view>
- </view>
- <view style="width: 750rpx;height: 168rpx;" class="flex flex-direction-row">
- <!-- 这里width 当做 left -->
- <view class="mask-bg-07" :style="{width:guideLeft+'px'}"></view>
- <image style="width: 100px;height: 100px; opacity: 0.7;top: -12px;"
- src="../../../static/common/subNVue/guide/guide-circle-mask.png"></image>
- <view class="mask-bg-07 flex-sub"></view>
- </view>
- </view>
- <!-- 计算剩余空白 -->
- <view class="mask-bg-07 flex-sub"></view>
- </view>
- <view v-if="currentType == 'level-game-tip'"
- class="guide-container justify-center align-center position-relative mask-bg-07"
- @click="buttonMessage('confirm')">
- <view class="game-mid">
- <view style="height: 278rpx;width: 750rpx;" class="position-relative">
- <view class="position-absolute-center" style="top: 0;left:0rpx;">
- <image style="width: 442rpx;height: 278rpx;"
- src="../../../static/common/subNVue/guide/level-game-title@2x.png"></image>
- </view>
- <view class="position-absolute-center">
- <text class="text-white text-14px"
- style="top: 0rpx;left:20rpx;">{{unlockLevelInfo.title}}</text>
- </view>
- </view>
- <view class="flex flex-direction-row align-center justify-center margin-17px">
- <text class="game-number">1</text>
- <text class="text-16px text-left text-white "
- style="width:476rpx;">{{unlockLevelInfo.firstText}}</text>
- </view>
- <image
- :style="{ width: unlockLevelInfo.firstWidth + 'rpx', height: unlockLevelInfo.firstHeight + 'rpx' ,transform:'scaleX('+unlockLevelInfo.firstDirection +')' }"
- :src="unlockLevelInfo.firstImage"></image>
- <view v-if="!unlockLevelInfo.secondHidden" class="flex flex-direction-row align-center justify-center margin-17px">
- <text class="game-number">2</text>
- <text class="text-16px text-left text-white "
- style="width:476rpx;">{{unlockLevelInfo.secondText}}</text>
- </view>
- <image v-if="!unlockLevelInfo.secondHidden"
- :style="{ width: unlockLevelInfo.secondWidth + 'rpx', height: unlockLevelInfo.secondHeight + 'rpx' ,transform:'scaleX('+unlockLevelInfo.secondDirection +')' }"
- :src="unlockLevelInfo.secondImage">
- </image>
- <!-- <image style="width: 232rpx;height: 78rpx;margin-top: 48rpx;"
- src="../../../static/common/subNVue/guide/level-game-next@2x.png"></image>
- -->
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- mapState,
- mapMutations
- } from 'vuex';
- export default {
- computed: mapState(['systemInfo', 'navHeight', 'tabbarHeight']),
- data() {
- return {
- title: '',
- content: '',
- lists: [],
- isSelected: false,
- currentType: 'none',
- /**
- * 隐藏guide时候,随后的操作类型
- */
- hiddenType: 'none',
- operationItem: null,
- guideHeight: 55,
- guideLeft: 166,
- //三个关卡的对应信息
- unlockLevelInfo: {
- title: '',
- firstText: '',
- firstImage: '',
- firstWidth: 0,
- firstHeight: 0,
- secondText: '',
- secondImage: '',
- secondWidth: 0,
- secondHeight: 0,
- secondHidden: false
- },
- midJumpInfo: {
- title: '解锁向上跳',
- // firstText: '请先确保手柄已经连接成功。',
- // firstImage: '../../../static/common/subNVue/guide/level-game-fab@2x.png',
- firstText: '通过向上跳的方式消除标志块',
- firstImage: '../../../static/modal/action-jump/midJumpWhite.png',
- firstDirection: 1,
- firstWidth: 68, //102,
- firstHeight: 68, //108,
- secondText: '通过向上跳的方式消除标志块',
- secondImage: '../../../static/modal/action-jump/midJumpWhite.png',
- secondDirection: 1,
- secondWidth: 68,
- secondHeight: 68,
- secondHidden: true,
- },
- directionJumpInfo: {
- title: '解锁左右跳',
- firstText: '此为左跳图标,通过向左跳的方式消除标志块',
- firstImage: '../../../static/modal/action-jump/directionJumpWhite-left.png',
- firstDirection: -1,
- firstWidth: 68,
- firstHeight: 68,
- secondText: '此为右跳图标,通过向右跳的方式消除标志块',
- secondImage: '../../../static/modal/action-jump/directionJumpWhite-right.png',
- secondDirection: 1,
- secondWidth: 68,
- secondHeight: 68,
- secondHidden: false
- },
- rotationJumpInfo: {
- title: '解锁左右旋跳',
- firstText: '此为左旋跳图标,通过向左旋跳的方式消除标志块',
- firstImage: '../../../static/modal/action-jump/directionJumpWhite-left.png',
- firstDirection: -1,
- firstWidth: 68,
- firstHeight: 68,
- secondText: '此为右旋跳图标,通过向右旋跳的方式消除标志块',
- secondImage: '../../../static/modal/action-jump/directionJumpWhite-right.png',
- secondDirection: 1,
- secondWidth: 68,
- secondHeight: 68,
- secondHidden: false
- }
- }
- },
- created() {
- console.log('*********一个guide created')
- const vm = this;
- uni.$on('guide-popup', (data) => {
- vm.title = data.title;
- vm.content = data.content;
- vm.currentType = data.type || 'none';
- vm.operationItem = data.operationItem;
- let _viewData = data.item;
- //获取类型
- vm.hiddenType = (_viewData && _viewData.hiddenType) || 'none';
- console.log("vm.hiddenType:", vm.hiddenType);
- if (vm.currentType == "actionJumpPlay") {
- // _viewData.height/4 = 27.5
- vm.guideHeight = _viewData.top + _viewData.height - _viewData.height / 4 - vm.systemInfo
- .statusBarHeight - 275;
- } else if (vm.currentType == "bluetoothConnect") {
- //+ _viewData.height - _viewData.height / 4 - vm.systemInfo.statusBarHeight
- vm.guideHeight = _viewData.top - 298;
- vm.guideLeft = _viewData.left - _viewData.width / 2 + 5;
- } else if (vm.currentType == "plan") {
- vm.guideHeight = vm.systemInfo.screenHeight - 284 - 32;
- // vm.guideLeft = 55;
- } else if (vm.currentType == "level-button-tip") {
- //首页提示选择关卡
- vm.guideHeight = vm.systemInfo.screenHeight - 284 - 32 + 3 + 6;
- const value = uni.getStorageSync('levelButtonPrompt');
- if (value) {
- vm.isSelected = value.isSelected;
- } else {
- vm.isSelected = false;
- }
- } else if (vm.currentType == "device-tip") {
- //提示绑带
- const value = uni.getStorageSync('deviceDirectionPrompt');
- if (value) {
- vm.isSelected = value.isSelected;
- } else {
- vm.isSelected = false;
- }
- } else if (vm.currentType == "level-game-tip") {
- if (_viewData.levelType == 'midJump') {
- vm.unlockLevelInfo = Object.assign({}, vm.midJumpInfo);
- } else if (_viewData.levelType == 'directionJump') {
- vm.unlockLevelInfo = Object.assign({}, vm.directionJumpInfo);
- } else if (_viewData.levelType == 'rotationJump') {
- vm.unlockLevelInfo = Object.assign({}, vm.rotationJumpInfo);
- }
- }
- })
- },
- beforeDestroy() {
- uni.$off('guide-popup')
- },
- methods: {
- switchSelected() {
- console.log('switchSelected', this.isSelected, !this.isSelected);
- this.isSelected = !this.isSelected;
- uni.$emit('guide-popup-page', {
- type: 'selected',
- messageType: this.currentType,
- isSelected: this.isSelected,
- operationItem: this.operationItem
- })
- // if (this.isSelected) {
- // uni.setStorage({
- // key: 'deviceDirectionPrompt',
- // data: {
- // isSelected: true
- // }
- // })
- // } else {
- // uni.setStorage({
- // key: 'deviceDirectionPrompt',
- // data: {
- // isSelected: false
- // }
- // })
- // }
- },
- buttonMessage(buttonEvent) {
- setTimeout(() => {
- const subNVue = uni.getCurrentSubNVue()
- uni.$emit('guide-popup-page', {
- type: 'button',
- messageType: this.currentType,
- hiddenType: this.hiddenType,
- confirm: buttonEvent == 'confirm' ? true : false,
- cancel: buttonEvent == 'cancel' ? true : false,
- info: buttonEvent + ' 该元素被点击了!',
- operationItem: this.operationItem
- })
- }, 260);
- this.hidePupup();
- },
- hidePupup() {
- uni.getCurrentSubNVue().hide('auto', 250);
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .guide-wrapper {
- justify-content: center;
- align-items: center;
- }
- .guide-container {
- /* background-color: rgba(0, 0, 0, 0.3); */
- width: 750rpx;
- flex: 1;
- }
- .transparents-container {}
- .mid {
- justify-content: center;
- align-items: center;
- height: 700rpx;
- width: 300rpx;
- }
- .game-mid {
- justify-content: center;
- align-items: center;
- height: 850rpx;
- width: 750rpx;
- }
- .bind-tip-image {
- border-width: 14rpx;
- border-style: solid;
- border-color: #E5E5FF;
- background-color: #FFFFFF;
- width: 226rpx;
- height: 260rpx;
- margin-bottom: 50rpx;
- }
- .title {
- height: 100rpx;
- line-height: 100rpx;
- border-bottom-style: solid;
- border-bottom-width: 1rpx;
- border-bottom-color: #CBCBCB;
- flex: 0;
- font-size: 30rpx;
- }
- .scroller {
- height: 400rpx;
- padding: 8rpx 15rpx;
- }
- .content {
- color: #555555;
- font-size: 32rpx;
- }
- .message-wrapper {
- flex: 0;
- border-top-style: solid;
- border-top-width: 1rpx;
- border-top-color: #CBCBCB;
- height: 80rpx;
- align-items: flex-end;
- }
- .send-message {
- font-size: 30rpx;
- line-height: 80rpx;
- color: #00CE47;
- margin-left: 20rpx;
- }
- .cell {
- margin: 10rpx;
- padding: 20rpx 0;
- top: 10rpx;
- align-items: center;
- justify-content: center;
- border-radius: 10rpx;
- background-color: #5989B9;
- }
- .text {
- font-size: 30rpx;
- text-align: center;
- color: white;
- }
- .circle {
- width: 50px;
- height: 50px;
- border-width: 1rpx;
- border-color: #FF0000;
- border-style: solid;
- border-radius: 50%;
- position: absolute;
- top: 200rpx;
- left: 200rpx;
- background-color: rgba(255, 255, 255, 0);
- /* box-sizing: border-box; */
- }
- .su {
- position: relative;
- width: 750px;
- flex: 1;
- border-width: 1rpx;
- border-color: #FF0000;
- border-style: solid;
- }
- .lk {
- position: absolute;
- width: 100px;
- height: 200px;
- /* border-radius: 10px; */
- // border-width: 10px;
- // border-color: rgba(0, 0, 0, 0.4);
- // border-style: solid;
- border-top-color: #000000;
- border-top-width: 10px;
- border-bottom: 1rpx solid #000;
- top: 150px;
- /* margin-top: -250px; */
- left: 150px;
- /* margin-left: -250px; */
- }
- .game-number {
- border-radius: 18px;
- border-width: 1rpx;
- width: 22px;
- height: 22px;
- text-align: center;
- color: #FFFFFF;
- border-color: #FFFFFF;
- margin-right: 13px;
- }
- </style>
|