// pages/mineOrderProgress/mineOrderProgress.js const request = require("../../utils/request.js"); Page({ /** * 页面的初始数据 */ data: { popover_Status: true, bbosId: null, infoList: {}, orderInfo: {}, userAddressId: null }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { let that = this; const eventChannel = this.getOpenerEventChannel() eventChannel.on('getInfoList', function(data) { that.setData({ infoList: data.infolist, bbosId: data.infolist[0].bbosId }) that.geOrderInfo(); }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady() { }, /** * 生命周期函数--监听页面显示 */ onShow() { }, /** * 生命周期函数--监听页面隐藏 */ onHide() { }, /** * 生命周期函数--监听页面卸载 */ onUnload() { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { }, /** * 用户点击右上角分享 */ onShareAppMessage() { }, geOrderInfo() { let that = this; request.getData( 'app/box/order/sp/info',{bbosId: that.data.bbosId}, res => { that.setData({ orderInfo: res.data.data }) }, res => { console.log(res) } ) }, orderDateFun() { this.setData({ popover_Status: false }) }, popoverFun() { this.setData({ popover_Status: !this.data.popover_Status }) }, checkExpress(event) { let busiData = event.currentTarget.dataset.busi; wx.setClipboardData({ data: busiData, success (res) { wx.navigateToMiniProgram({ appId: 'wxd4185d00bf7e08ac', path: '', extraData: {}, success(res) { // 打开成功 } }) // wx.getClipboardData({ // success (res) { // console.log(res.data) // } // }) } }) }, switchDate(event) { let bbosId = event.currentTarget.dataset.bbosid; this.setData({ bbosId: bbosId }) this.geOrderInfo(); this.setData({ popover_Status: true }) }, toChangeAd() { let that = this; wx.navigateTo({ url: '../mineAddress/mineAddress', events: { getSelectAd: function(data) { that.setData({ userAddressId: data.userAddressId }) that.updateAd(); } }, }) }, //修改地址 updateAd() { let that = this; request.postData( 'app/box/update/addree', { bbosId: that.data.bbosId, applyAll: '1', userAddressId: that.data.userAddressId, }, res => { wx.showToast({ title: '修改地址成功', icon: 'success', duration: 2000 }) } ) }, })