123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- // 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
- })
- }
- )
- },
- })
|