// pages/orderDetail/orderDetail.js
const app = getApp()
const wxService = require('../../utils/wxService')
const utils = require('../../utils/util')
const envInfo = require('../../config/index').envInfo

wxService.page({

  /**
   * 页面的初始数据
   */
  data: {
    // detail: null,
    detail: 
      {
        "id": "613402110104571904",
        "memberId": "598887367880871936",
        "status": "N",
        "skuVOList": [
          {
            "productId": "1556108606443006",
            "productCode": "test001",
            "productName": "test001",
            "skuId": "1556108807316001",
            "skuCode": "test001-4",
            "skuSpec": "颜色：白，尺寸：xl",
            "count": 3919,
            "price": 0.03,
            "discount": 0,
            "mainImgUrl": "http://testimg3.bigaka.com/group3/M00/00/17/Cv6CBF1Z9TKAU6T1AAAG8CvHO2o415.png",
            "amount": 117.57
          },
          {
            "productId": "1556108606443006",
            "productCode": "test001",
            "productName": "test001",
            "skuId": "1556108807316000",
            "skuCode": "test001-3",
            "skuSpec": "颜色：红，尺寸：xl",
            "count": 420,
            "price": 0.02,
            "discount": 0,
            "mainImgUrl": "http://testimg3.bigaka.com/group3/M00/00/17/Cv6CBF1Z9TKAU6T1AAAG8CvHO2o415.png",
            "amount": 8.4
          }
        ],
        "createTime": "2019-08-20 16:00:59",
        "discount": 0,
        "freightMoney": 0,
        "payAmount": 125.97,
        "skuCount": 4339
      }
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    if (!Object.keys(this.options).length){ return }
    this.setData({
      detail: this.options
    })
  },
  copy(e) {
    wx.setClipboardData({
      //准备复制的数据
      data: e.currentTarget.dataset.content,
      success: function (res) {
        wx.showToast({
          title: '复制成功',
          icon: 'none'
        });
      }
    });
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})