董国庆
2026-02-03 d10c7033c19bf9ad1b55c3e5a12eee0f3eaba0d7
新建优惠券页面
3个文件已添加
1个文件已修改
47 ■■■■■ 已修改文件
src/app.config.ts 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/robotaxi/pages/coupon/index.config.ts 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/robotaxi/pages/coupon/index.less 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/robotaxi/pages/coupon/index.tsx 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/app.config.ts
@@ -20,6 +20,7 @@
      root: 'robotaxi',
      pages: [
        'pages/demo/index',
        'pages/coupon/index'
      ],
    }
  ];
src/robotaxi/pages/coupon/index.config.ts
New file
@@ -0,0 +1,3 @@
export default {
  navigationBarTitleText: '我的优惠券'
};
src/robotaxi/pages/coupon/index.less
New file
@@ -0,0 +1,3 @@
.demo {
  text-align: center;
}
src/robotaxi/pages/coupon/index.tsx
New file
@@ -0,0 +1,40 @@
import Taro from '@tarojs/taro';
import { Component } from 'react';
import { View, Text } from '@tarojs/components';
import './index.less';
import { createPage } from '../../../utils/page';
import { checkOtp } from '../../../utils/tools';
// @ts-ignore
@createPage()
export default class Toolbox extends Component {
  $app: any = Taro.getApp().$app;
  componentDidShow() {
    this.$app.xpReportShow();
    const autoLogin = false; // 设置为 true 以启用自动登录
    checkOtp(autoLogin).then(otp => {
      if (otp) {
        // 已登录
        console.log('用户已登录,otp:', otp);
      } else {
        // 没有登录
        console.log('用户未登录');
      }
    });
  }
  componentDidHide() {
    this.$app.xpReportHide();
  }
  render() {
    return (
      <View className='demo'>
        <Text>Demo 页面</Text>
      </View>
    )
  }
}