How to use the @tarojs/taro.navigateBack function in @tarojs/taro

To help you get started, we’ve selected a few @tarojs/taro examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github huangjianke / Gitter / src / pages / account / about.js View on Github external
success(res) {
        if (res.confirm) {
          Taro.setStorageSync('Authorization', '')
          Taro.setStorageSync('userInfo', null)
          Taro.navigateBack()
        } else if (res.cancel) {
          console.log('用户点击取消')
        }
      }
    })
github lingxiaoyi / Taro-navigation-bar / src / pages / demo / demo2.js View on Github external
handlerGobackClick() {
    const pages = Taro.getCurrentPages();
    if (pages.length >= 2) {
      Taro.navigateBack({
        delta: 1
      });
    } else {
      Taro.navigateTo({
        url: '/pages/index/index'
      });
    }
  }
  render() {
github ninghao / w-store-app / src / pages / user / account.js View on Github external
username,
        password,
        wxUserInfo,
        code
      }
    })

    switch (response.statusCode) {
      case 200:
        await Taro.setStorage({
          key: 'token',
          data: response.data
        })

        Taro.eventCenter.trigger('user::logged_in', response.data)
        Taro.navigateBack()
        break
      case 404:
        const result = await Taro.showModal({
          title: '是否创建新用户',
          content: '请求绑定的用户不存在,是否要创建一个新用户?'
        })

        if (result.confirm) {
          this.setState({
            action: 'register',
            submitButtonText: '注册用户',
            wxUserLogin: true
          })

          Taro.setNavigationBarTitle({
            title: '注册用户'
github ninghao / w-store-app / src / pages / user / account.js View on Github external
data: {
        username,
        password
      }
    })

    switch (response.statusCode) {
      case 200:
        await Taro.setStorage({
          key: 'token',
          data: response.data
        })

        Taro.eventCenter.trigger('user::logged_in', response.data)

        Taro.navigateBack()

        break
      case 404:
        Taro.atMessage({
          type: 'error',
          message: response.data
        })

        break
      case 401:
        Taro.atMessage({
          type: 'error',
          message: response.data
        })

        break
github ninghao / w-store-app / src / pages / user / account.js View on Github external
method: 'POST',
        url: `${API_WS}/wx-login`,
        data: {
          code
        }
      })

      switch (response.statusCode) {
        case 200:
          await Taro.setStorage({
            key: 'token',
            data: response.data
          })

          Taro.eventCenter.trigger('user::logged_in', response.data)
          Taro.navigateBack()
          break
        case 404:
          this.wxUserBind()
          break
      }
    } catch (error) {
      Taro.atMessage({
        type: 'error',
        message: '微信登录失败,请重试!'
      })
    }
  }
github lingxiaoyi / Taro-navigation-bar / src / pages / demo / scorll.js View on Github external
success: (e) => {
            if (e.confirm) {
                Taro.navigateBack({
                    delta: 1
                });
            }
        }
    })
github lingxiaoyi / Taro-navigation-bar / src / pages / demo / demo6.js View on Github external
handlerGobackClick() {
    const pages = Taro.getCurrentPages();
    if (pages.length >= 2) {
      Taro.navigateBack({
        delta: 1
      });
    } else {
      Taro.navigateTo({
        url: '/pages/index/index'
      });
    }
  }
  render() {
github webclipper / web-clipper-wxapp / src / store / saga / router.ts View on Github external
yield takeEvery(ROUTER.DETAIL_ROUTER_BACK, function() {
    const pages = Taro.getCurrentPages();
    if (pages.length === 1) {
      Taro.switchTab({ url: '/pages/recent/index' });
    } else {
      Taro.navigateBack();
    }
  });
}
github zhixiaoqiang / taroCloud / src / pages / create / index.js View on Github external
const success = () => {
      Taro.showToast({
        title: '提交成功',
      })
      Taro.navigateBack()
    }
    if (id) {
github lingxiaoyi / Taro-navigation-bar / src / components / navbar_lxy / index.js View on Github external
handleBackClick() {
    if (_isFunction(this.props.onBack)) {
      this.props.onBack();
    } else {
      const pages = Taro.getCurrentPages();
      if (pages.length >= 2) {
        Taro.navigateBack({
          delta: this.props.delta
        });
      }
    }
  }
  handleGoHomeClick() {