feat: 添加引导页

This commit is contained in:
2025-06-18 17:37:01 +08:00
parent 526ad49981
commit 145ca0bf62
3 changed files with 59 additions and 24 deletions
@@ -13,7 +13,8 @@
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
text-align: center; text-align: center;
color: rgba(255, 235, 59, 0.95); // color: rgba(255, 235, 59, 0.95);
color: rgb(255, 255, 255, 0.9);
font-size: 40rpx; font-size: 40rpx;
font-weight: bold; font-weight: bold;
width: 100%; width: 100%;
@@ -21,12 +22,31 @@
} }
.tip-box { .tip-box {
height: 48px;
border-radius: 24px;
background: rgba(255, 255, 255, 0.2);
border: 4rpx solid rgba(147, 211, 51, 1); border: 4rpx solid rgba(147, 211, 51, 1);
transition: all 0.4s;
&--first {
position: absolute;
top: 66px;
left: 50%;
transform: translateX(-50%);
width: 340px;
}
&--second {
position: absolute;
top: 127px;
left: 28px;
width: 48px;
}
} }
.tip-text { .tip-text {
color: rgba(255, 235, 59, 0.95); // color: rgba(255, 235, 59, 0.95);
// color: #fff; color: rgb(255, 255, 255, 0.9);
font-size: 32rpx; font-size: 32rpx;
} }
@@ -36,16 +56,16 @@
left: 0; left: 0;
width: 100%; width: 100%;
.tip-box { // .tip-box {
position: absolute; // position: absolute;
top: 0; // top: 0;
left: 50%; // left: 50%;
transform: translateX(-50%); // transform: translateX(-50%);
width: 342px; // width: 342px;
height: 46px; // height: 46px;
border-radius: 21px; // border-radius: 21px;
background: rgba(255, 255, 255, 0.2); // background: rgba(255, 255, 255, 0.2);
} // }
.guide-icon { .guide-icon {
position: absolute; position: absolute;
@@ -70,8 +90,8 @@
color: rgba(255, 235, 59, 0.95); color: rgba(255, 235, 59, 0.95);
border-radius: 28rpx; border-radius: 28rpx;
position: absolute; position: absolute;
top: 260rpx; top: 50%;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translate(-50%, -50%);
} }
} }
@@ -12,7 +12,9 @@ Component({
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
data: {}, data: {
currentStep: 'first',
},
lifetimes: { lifetimes: {
attached() {}, attached() {},
}, },
@@ -23,5 +25,17 @@ Component({
onClose() { onClose() {
this.triggerEvent('onClose'); this.triggerEvent('onClose');
}, },
toNextStep() {
const stepArr = ['first', 'second', 'third', 'fourth', 'fifth'];
const { currentStep } = this.data;
const currentStepIndex = currentStep
? stepArr.indexOf(currentStep)
: 0;
console.log('next', stepArr[currentStepIndex + 1]);
this.setData({
currentStep: stepArr[currentStepIndex + 1],
});
},
}, },
}); });
@@ -1,7 +1,14 @@
<view class="introduction-popup"> <view class="introduction-popup">
<view class="introduction-popup-title">跟我一起来涂色、识字吧!</view> <view class="introduction-popup-title">跟我一起来涂色、识字吧!</view>
<view class="tip-box tip-box--{{currentStep}}"></view>
<toy-button
type="white"
plain
bind:click="toNextStep"
custom-class="btn-next-step">
下一步
</toy-button>
<view class="first-step"> <view class="first-step">
<view class="tip-box"></view>
<van-icon <van-icon
class-prefix="toy-icon" class-prefix="toy-icon"
name="guide" name="guide"
@@ -11,12 +18,6 @@
<view class="tip-text"> <view class="tip-text">
这里请输入你想让小朋友熟悉的汉字、字母、数字等,点击“确定” 这里请输入你想让小朋友熟悉的汉字、字母、数字等,点击“确定”
</view> </view>
<toy-button
type="white"
plain
bind:click="toNextStep"
custom-class="btn-next-step">
下一步
</toy-button>
</view> </view>
<view class="second-step"> </view>
</view> </view>