导航

    Taro 社区

    Taro

    • 注册
    • 登录
    • 搜索
    • 版块
    • 最新
    • 话题
    • 热门
    • 群组
    1. 主页
    2. 4575529-96747755
    4
    • 资料
    • 关注
    • 粉丝
    • 主题
    • 帖子
    • 最佳
    • 群组

    4575529-96747755

    @4575529-96747755

    0
    声望
    3
    帖子
    395
    资料浏览
    0
    粉丝
    0
    关注
    注册时间 最后登录

    4575529-96747755 关注

    4575529-96747755 发布的帖子

    • 求教:config里面的window 如何按照多端判断
      import Taro, { Component, Config } from '@tarojs/taro'
      import './app.scss'
      import './constant/global'
      
      var new_window = {};
      if (process.env.TARO_ENV === 'alipay') {
        new_window = {
          "transparentTitle": "none" ,
          "titlePenetrate":"NO", 
        }
        console.log(new_window);
      }
      if (process.env.TARO_ENV === 'weapp') {
        console.log(1111);
        new_window.navigationStyle = 'custom';
        console.log(new_window);
        
      }
      
      class App extends Component {
        config: Config = {
          pages: [
            'pages/home/index',
            'pages/business/index',
            'pages/service/index',
            'pages/user/index',
          ],
          window: new_window,
          tabBar: {
            "custom": true,
            "color": "#999999",
            "selectedColor": "#222222",
            "borderStyle": "white",
            "list": [{
              "selectedIconPath": "static/images/a1h.png",
              "iconPath": "static/images/a1.png",
              "pagePath": "pages/home/index",
              "text": "首页"
            }, {
              "selectedIconPath": "static/images/a2h.png",
              "iconPath": "static/images/a2.png",
              "pagePath": "pages/business/index",
              "text": "业务"
            }, {
              "selectedIconPath": "static/images/a3h.png",
              "iconPath": "static/images/a3.png",
              "pagePath": "pages/service/index",
              "text": "服务"
            }, {
              "selectedIconPath": "static/images/a4h.png",
              "iconPath": "static/images/a4.png",
              "pagePath": "pages/user/index",
              "text": "我的"
            }]
          },
          "permission": {
            "scope.userLocation": {
              "desc": "你的位置信息将用于附近商家的展示"
            }
          }
        }
      
      
        componentWillMount() {
          //this.configInit();
          //这里隐藏支付宝的顶部tabBar
          if (process.env.TARO_ENV === 'alipay') {
            Taro.hideTabBar({
              animation: false
            })
          }
        }
      
        componentDidShow() { }
      
        componentDidHide() { }
      
        componentDidCatchError() { }
      
        // this.props.children 是将要会渲染的页面
        render() {
          return this.props.children
        }
      }
      
      export default App
      

      config里面的window 如何按照多端判断,我这样写是无效的😢

      发布在 Taro 实践 + 案例
      4
      4575529-96747755
    • 请问taro3.0.5引用Map后监听onRegionChange为何无效
      <Map
          id='mapContainer'
          longitude={longitude}
          latitude={latitude}
          scale={12}
          markers={markers}
          show-location={true}
          style={`width: 100%;height:40%`}
          onRegionChange={this.regionchange}
          //optimize={true}
          setting={{}}
      >
      
        onRegionChange(e) {
          console.log(e)
        }
      

      滑动缩放监听无任何返回,taro3.0.5

      发布在 Taro
      4
      4575529-96747755
    • RE: Taro 3使用地图Map组件时报错

      同样出现这个问题,有什么办法解决吗

      发布在 Taro
      4
      4575529-96747755