feat: 完成引导页
This commit is contained in:
@@ -14,9 +14,23 @@ Component({
|
||||
*/
|
||||
data: {
|
||||
currentStep: 'first',
|
||||
currentStepIndex: 0,
|
||||
stepTexts: [
|
||||
'这里请输入你想让小朋友熟悉的汉字、字母、数字等,点击“确定”',
|
||||
'点击这里修改颜色',
|
||||
'点击这里删除',
|
||||
'这里会生成图片,点击下载后可打印、涂色、识字',
|
||||
],
|
||||
platform: '',
|
||||
},
|
||||
lifetimes: {
|
||||
attached() {},
|
||||
attached() {
|
||||
const { platform } = wx.getDeviceInfo();
|
||||
console.log('platform:', platform);
|
||||
this.setData({
|
||||
platform,
|
||||
});
|
||||
},
|
||||
},
|
||||
/**
|
||||
* 组件的方法列表
|
||||
@@ -27,15 +41,18 @@ Component({
|
||||
},
|
||||
|
||||
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]);
|
||||
const stepArr = ['first', 'second', 'third', 'fourth'];
|
||||
const { currentStepIndex: preStepIndex } = this.data;
|
||||
|
||||
if (preStepIndex === 3) return this.triggerEvent('onClose');
|
||||
const currentStepIndex = preStepIndex + 1;
|
||||
|
||||
this.setData({
|
||||
currentStep: stepArr[currentStepIndex + 1],
|
||||
currentStepIndex,
|
||||
currentStep: stepArr[currentStepIndex],
|
||||
});
|
||||
},
|
||||
|
||||
preventScroll() {},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user