How to use the vant.Toast function in vant

To help you get started, we’ve selected a few vant 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 MixinNetwork / supergroup.mixin.one / web / src / pages / WxPay.vue View on Github external
(res) => {
          console.log(res)
          // alert(JSON.stringify(res))
          if (res.err_msg == "get_brand_wcpay_request:ok") {
            Toast(this.$t('wxpay.succ_toast'))
            this.$router.push('/wxpay/done')
          } else if (res.err_msg == "get_brand_wcpay_request:fail"){
            Toast(this.$t('wxpay.error_toast', {msg: res.err_msg}))
          }
          this.loading = false
        }
      );
github geekape / applet-h5-shop / mpvue / wap / src / pages / shop / cart / index.vue View on Github external
let goodsCount = {};

      this.carts.forEach((item, index) => {
        if (item.isCheck == true) {
          checkedId.push(item.goods_id);
          cartId.push(item.id);

          // 多个商品
          goodsCount[item.goods_id] = item.num;
        }
      });
      checkedId = checkedId.join(",");
      cartId = cartId.join(",");

      if (checkedId == "") {
        Toast("请选择购买的商品");
      } else {
        this.$router.push({name: `confirm_order`, params: {
          type: 1,
          goodsId: checkedId,
          cartIds: cartId,
          count: goodsCount
        }})
      }

      
    },
    delGoods () {
github wmz1930 / Jeebase / jeebase-wechat / jeebase-wechat-vant / src / utils / request.js View on Github external
response => {
    const res = response.data
    if (res.code !== 200) {
      // 90000002:登录超时
      if (res.code === 90000002) {
        store.dispatch('FedLogOut').then(() => {
          location.reload() // 为了重新实例化vue-router对象 避免bug
        })
      } else if (res.code === 10000007) { // 10000007:没有权限
        Toast('没有权限,请重新登录!')
      } else {
        Toast(res.msg)
      }
      return Promise.reject('error')
    } else {
      return response.data
    }
  },
  error => {
github geekape / applet-h5-shop / mpvue / wap / src / pages / shop / confirm_order / index.vue View on Github external
submitOrder() {
      const _this = this;
      let address = this.address;
      let type = 0;

      // 填写地址
      if (!address.mobile) {
        Toast("请填写你的地址");
        return false;
      }

      // 同意协议
      if (!this.isTcp) {
        Toast("请同意协议");
        return false;
      }

      // 配送门店
      if (this.sendType.includes(2)) {
        if (this.storesId == 0) {
          Toast("请选择配送门店");
          return false;
        }
      }

      post("shop/api/add_order", {
        address_id: _this.address.id,
        remark: _this.remark, // 留言
        sn_id: _this.snId, // 优惠卷id
        stores_id: _this.storesId, // 门店id
github Zkliang1991 / Zkliang1991.github.io / 1901 / vue / ronxin / src / views / Cart.vue View on Github external
jiesuan(){
            //先判断用户是否有选中商品
            var listid=[];
            this.goods.forEach((car)=>{
                if(car.check){
                    listid.push(car);
                }
            });
            //判断listid的长度
            if(listid.length==0){
                Toast("请选择你要购买的商品")
            }else{
                this.$axios.post("/vue/jiesuangoods",{
                    listid,
                    goodsusername:localStorage.username
                }).then(res=>{
                    // this.goods=res.data.result;
                });
                this.$router.push({name:"jiesuan"});
            }
        }
    },
github moonbreezee / online-mall / shop_admin / src / components / Order / AllOrderPage.vue View on Github external
}).then(res => {
                console.log(res);
                if (res.data.errno === 0) {
                  Toast('修改成功 !')
                  this.$notify({
                    title: '成功',
                    message: '修改成功 !',
                    type: 'success'
                  });
                  this.getList()
                  this.closechangeprice()
                  loading.close()
                }else{
                  Toast('修改失败 !')
                  this.$notify.error({
                     title: '错误',
                     message: '修改失败 !'
                   });
                  loading.close()
                }
github Zkliang1991 / Zkliang1991.github.io / 1901 / vue / ronxin / src / views / Register.vue View on Github external
console.log(this.registerInfo)
                                this.$axios.post("/vue/register",this.registerInfo).then(res=>{
                                    console.log(res.data);
                                    if(!!res.data.type){
                                        this.$router.push({name:'login'})
                                    }
                                })

                            }else{
                                Toast('两次密码输入不一致'); 
                            }
                        }else{
                            Toast('密码应为6-12的字母和数字组合'); 
                        }
                    }else{
                        Toast('手机号不合法'); 
                    }
                }else{
                   Toast('用户名应为6-12位字符或数字'); 
                }
            }else{
                Toast('请输入用户名');
            }
        }
    }
github moonbreezee / online-mall / shop_admin / src / components / Order / AllOrderPage.vue View on Github external
}).then(res => {
              console.log(res);
              if (res.data.errno === 0) {
                Toast('修改成功 !')
                this.$notify({
                  title: '成功',
                  message: '修改成功 !',
                  type: 'success'
                });
                this.getList()
                this.closechangeprice()
                loading.close()
              }else{
                Toast('修改失败 !')
                this.$notify.error({
                   title: '错误',
                   message: '修改失败 !'
                 });
                loading.close()
              }
            })
          }).catch(() => {
github geekape / applet-h5-shop / mpvue / wap / src / pages / shop / goods_detail / index.vue View on Github external
.then(res => {
          if (res.data == 1) {
            Toast("加入收藏成功");
            this.isCollect = true;
          } else {
            Toast("取消收藏成功");
            this.isCollect = false;
          }
        });
    }