|
- let config = require("../../../config/config.js");
- let util = require("../../../utils/util");
- let Http = require("../../../utils/HttpBasics");
- let app = getApp();
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- showModalStatus: false,
- flag: 0
- },
-
- /**
- * 点击弹出二维码
- * 然后再关闭
- */
-
- powerDrawer: function(e) {
- var currentStatu = e.currentTarget.dataset.statu;
- console.log(e.currentTarget.dataset.statu);
- console.log(e.currentTarget.dataset.quancode);
- this.utils(currentStatu, e.currentTarget.dataset.quancode);
- },
- utils: function(currentStatu, quancode) {
- /* 动画部分 */
- // 第1步:创建动画实例
- var animation = wx.createAnimation({
- duration: 200, //动画时长
- timingFunction: "linear", //线性
- delay: 0 //0则不延迟
- }); // 第2步:这个动画实例赋给当前的动画实例
- this.animation = animation; // 第3步:执行第一组动画
- animation.opacity(0).step(); // 第4步:导出动画对象赋给数据对象储存
- this.setData({
- animationData: animation.export()
- }); // 第5步:设置定时器到指定时候后,执行第二组动画
- setTimeout(
- function() {
- // 执行第二组动画
- animation.opacity(1).step(); // 给数据对象储存的第一组动画,更替为执行完第二组动画的动画对象
- this.setData({
- animationData: animation
- }); //关闭
- if (currentStatu == "close") {
- this.setData({
- showModalStatus: false
- });
- }
- }.bind(this),
- 20
- );
- // 显示
- if (currentStatu == "open") {
- this.setData({
- showModalStatus: true
- });
- this.data.flag++;
-
- console.log(this.data.flag);
- util.barcode("barcode" + this.data.flag, quancode, 500, 100);
- util.qrcode("qrcode" + this.data.flag, quancode, 350, 350);
- this.setData({
- flag: this.data.flag
- });
- }
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function(options) {
- let that = this;
- console.log(options.orderId);
- Http.get({
- url: config.api.orderDetail,
- data: {
- orderId: options.orderId
- }
- }).then(res => {
- console.log(res);
- console.log("我是订单详情");
- that.setData({
- data: res.data
- });
-
- //createDate 创建时间
- var createDate = util.fmtDate(res.data.createDate);
-
- console.log(createDate);
- that.setData({
- createDate:createDate,
- })
- });
- },
-
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function() {},
-
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function(options) {},
-
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function() {},
-
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function() {},
-
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function() {},
-
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function() {},
-
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function() {}
- });
|