zoukankan      html  css  js  c++  java
  • 微信小程序 对接口常用

    @import '../expert/expert.wxss';
     
    FZ._get('https://didu2.didu86.com/issun/index.php/Home/goodstype/selectGoodsTypeAll')
    .then(function (data) {console.log(data)})
    .catch(function (data) { console.log(data)});
     
    wx.navigateTo({
    url: '/pages/detail/detailv?items=' + JSON.stringify(items) +"&&mypic=" +mypic
    })
    <image class='image-full' src='../../../imgs/index/t_icon.png'></image>
     
    <image mode='widthFix' class='img-w' src='../../imgs/wl/wl1.png'></image>
     
    setTimeout(function () {console.log() }, 1500)
     
    let items = e.currentTarget.dataset.items;
    let item = JSON.parse(opt.items);
    let myDate = new Date();
     
    let val = e.detail.value;
    this.setData({})
    
    that.setData({
    user: wx.getStorageSync('user')
    });
     
     
    wx:if="{{==1}}"
     
     
    chargeInto: function () {
    wx.navigateTo({
    url: "/pages/user/chargeintopay/chargeintopay"
    })
    },
    FZ._back({ linkobj: encodeURIComponent(JSON.stringify(linkobj)), type: 1 })
     
    let pData= FZ._pdata();
    if (pData){
    console.log(pData)
    console.log(JSON.parse(decodeURIComponent(pData.linkobj)))

    if (pData.type == 1) {
    nailItem.link.push(JSON.parse(decodeURIComponent(pData.linkobj)))
    console.log(nailItem)
    this.setData({ nailItem })
    } else {

    }
    }
     
    wx.switchTab({
    url: "/pages/user/index"
    })
     
    wx.showToast({
    title: '登录成功',
    icon: 'success',
    duration: 1000
    })
     
    setTimeout(function () {
     
    }, 1000);
     
    post请求-----------------------------------------
    wx.setStorageSync('user', result)
     
    let user = wx.getStorageSync('user');
     
    let that = this;
     
    post请求-----------------------------------------
    wx.request({
    header: {
    "Content-Type": "application/x-www-form-urlencoded"
    },
    method: "POST",
    url: app.globalData.hpUrl + 'User/userAllRegister',
    data: {
    typenum: selectArr[selectIndex],
    phone: loveChe.hphone,
    password: loveChe.hpwd
    },
    success: function (res) {
    var result = res.data;
    
    console.log(res)
     
    }
    }
    });
     
     
    updateUser:function(){
    // 更新数据
    wx.request({
    url: app.globalData.hpUrl + 'User/userFind', //仅为示例,并非真实的接口地址
    header: {
    "Content-Type": "application/x-www-form-urlencoded"
    },
    method: "POST",
    data: {
    id: result,
    },
    success: function (res) {
    let result = res.data;
    // console.log(res)
    if (result) {
    wx.setStorageSync('user', result)
    wx.showToast({
    title: '注册成功',
    icon: 'success',
    duration: 1000
    })
    setTimeout(function () {
    wx.switchTab({
    url: "/pages/user/user"
    })
    }, 1000);
    }
    
    }
    })
    },
     
     
  • 相关阅读:
    最佳内存缓存框架Caffeine
    18个Java8日期处理的实践,太有用了
    windows 2003 IIS FTP 530 home directory inaccessible
    关闭应用程序(主程序)(WPF)
    解决Win8.1 IE11兼容性问题的方法
    Web页面性能测试工具浅析
    JS模板引擎handlebars.js的简单使用
    mvc4+entityFramework5 发布时遇到的纠结问题
    sqlserver 导入数据出现 无法创建 OLE DB 取值函数。请查看列元数据是否有效
    正则基础之——贪婪与非贪婪模式
  • 原文地址:https://www.cnblogs.com/dianzan/p/8359505.html
Copyright © 2011-2022 走看看