import fly from "./main";
import store from "@/store/index"

// 订单列表
export function orderList() {
  let $params = {
    access_token: wx.getStorageSync('token')
  }
  return fly.post('order/order-list', $params)
}

//创建订单
export function createOrder($params) {
  $params['access_token'] = wx.getStorageSync('token')
  return fly.post('order/create-order', $params)
}


//支付订单
export function payOrder($params) {
  $params['access_token'] = wx.getStorageSync('token')
  return fly.post('order/pay', $params)
}


//删除订单
export function deleteOrder($sn) {
  let $params = {}
  $params['sn'] = $sn
  $params['access_token'] = wx.getStorageSync('token')
  return fly.post('order/order-delete', $params)
}

//支付订单
export function testPay($fee) {
  let $params = {};
  $params['total_fee'] = $fee;
  $params['access_token'] = wx.getStorageSync('token')?wx.getStorageSync('token'):11
  return fly.post('order/test-pay', $params)
}
