Although gamification has been widely used in e-commerce platforms, research on gamification in marketing is still scarce compared to practice, and the impact of gamification on purchase intention remains to be clarified. Therefore, based on affordance theory and engagement theory, this paper establishes a theoretical model to explain the pathway of gamification’s effects. Specifically, this study takes the e-commerce shopping festival game as an example, distinguishes the game part and task part, explores the relationship between them, and identifies the different mechanisms of the two parts’ engagement on purchase intention. A survey was conducted, and 234 valid questionnaires were collected. Results showed that game part affordance positively affects game part engagement which could increase task engagement. Second, game part engagement and task part engagement impact purchase intention differently. Task part engagement has a direct impact on purchase intention, while game part engagement influences purchase intention through game intention. Finally, the contribution of theory and practice is discussed.