const Method = require('./method.js').Method;
var network = require("../utils/network.js").requestLoading;
var networdmember = require("../utils/network.js").requestLoadingmember

const getShareImg = (url, urldata, data, message, success, fail) => {
  network(url, urldata, {
    ...data,
  },
    Method.GET,
    message,
    function (res) {
      typeof success == "function" && success(res)
    },
    function (ex) {
      // 失败执行的方法
      typeof fail == "function" && fail(ex)
    })
}
//新分享需求
//分享礼物
const getSharegift = (url, urldata, data, message, success, fail) => {
  networdmember(url, urldata, {
    ...data,
  },
    Method.GET,
    message,
    function (res) {
      typeof success == "function" && success(res)
    },
    function (ex) {
      // 失败执行的方法
      typeof fail == "function" && fail(ex)
    })
}
//分享页面
const getSharepage = (url, urldata, data, message, success, fail) => {
  networdmember(url, urldata, {
    ...data,
  },
    Method.GET,
    message,
    function (res) {
      typeof success == "function" && success(res)
    },
    function (ex) {
      // 失败执行的方法
      typeof fail == "function" && fail(ex)
    })
}
//分享活动图片
const getShareactiveimg = (url, urldata, data, message, success, fail) => {
  networdmember(url, urldata, {
    ...data,
  },
    Method.GET,
    message,
    function (res) {
      typeof success == "function" && success(res)
    },
    function (ex) {
      // 失败执行的方法
      typeof fail == "function" && fail(ex)
    })
}
module.exports = {
  getShareImg: getShareImg,
  getSharegift: getSharegift,
  getSharepage: getSharepage,
  getShareactiveimg: getShareactiveimg,
}