import request from '@/api/request.js'

function home(data) {
	return request({
		url: '/api/shop/home',
		method: 'post',
		data
	})
}

function getcar(data) {
	return request({
		url: '/api/shop/getcar',
		method: 'post',
		data
	})
}

function share2(data) {
	return request({
		url: '/api/share/share2',
		method: 'post',
		data
	})
}

function homeget(data) {
	return request({
		url: '/api/shop/home',
		method: 'get',
		data
	})
}

function navtopage(item) {
	console.log('item',JSON.stringify(item))
	if (item.media_type == 1) {
		uni.navigateTo({
			url: `/pagesD/pages/product/product?id=${item.ad_link}`
		});
	} else if (item.media_type == 2) {
		uni.navigateTo({
			url: `/pagesA/pages/adopt/adopt?id=${item.ad_link}`
		});
	} else if (item.media_type == 3) {
		let ad_link = encodeURIComponent(JSON.stringify(item.ad_link));
		uni.navigateTo({
			url: `/pagesE/pages/showhfive/showhfive?url=${ad_link}`
		})
	}
}

function index(data) {
	return request({
		url: '/api/shop/index2',
		method: 'post',
		data
	})
}

function tabbar(data) {
	return request({
		url: '/api/shop/tabbar',
		method: 'post',
		data
	})
}

function userShare(data) {
	return request({
		url: '/api/Share/userShare',
		method: 'post',
		data
	})
}

function myqrcode(data) {
	return request({
		url: '/api/fx/myqrcode',
		method: 'post',
		data
	})
}
//签到动作
function vipSign(data) {
	return request({
		url: '/api/Vip/sign',
		method: 'post',
		data
	})
}
//签到信息
function shopSign(data) {
	return request({
		url: '/api/shop/sign',
		method: 'get',
		data
	})
}
//签到信息
function shopSignPost(data) {
	return request({
		url: '/api/shop/sign',
		method: 'post',
		data
	})
}

function lists(data) {
	return request({
		url: '/api/Campaign/lists',
		method: 'post',
		data
	})
}

function buyIndex(data) {
	return request({
		url: '/api/Buy/index',
		method: 'post',
		data
	})
}

function ad_advertisement(data) {
	return request({
		url: '/api/Article/ad_advertisement',
		method: 'post',
		data
	})
}
//共享联养
function details(data) {
	return request({
		url: '/api/Buy/details',
		method: 'post',
		data
	})
}

function order_make(data) {
	return request({
		url: '/api/Buy/order_make',
		method: 'post',
		data
	})
}

function orderDetail(data) {
	return request({
		url: '/api/Buy/orderDetail',
		method: 'post',
		data
	})
}

function cancoupon(data) {
	return request({
		url: '/api/Buy/cancoupon',
		method: 'post',
		data
	})
}

function payNew(data) {
	return request({
		url: '/api/Buy/payNew',
		method: 'post',
		data
	})
}
//合同详情
function contract_tplinfo(data) {
	return request({
		url: '/api/ajax/contract_tplinfo',
		method: 'post',
		data
	})
}

function partydetail(data) {
	return request({
		url: '/api/article/partydetail',
		method: 'post',
		data
	})
}
//商品详情
function choose(data) {
	return request({
		url: '/api/Buy/choose',
		method: 'post',
		data
	})
}
//搜索
function searchs(data) {
	return request({
		url: '/api/shop/searchs',
		method: 'post',
		data
	})
}

function vipIndex(data) {
	return request({
		url: '/api/vip/index',
		method: 'post',
		data
	})
}

function Campaign(data) {
	return request({
		url: '/api/Campaign/index',
		method: 'get',
		data
	})
}

function Artical(data) {
	return request({
		url: '/api/Article/artical',
		method: 'post',
		data
	})
}
function Notice(data) {
	return request({
		url: '/api/Article/index',
		method: 'post',
		data
	})
}

function renyang_pay(data) {
	return request({
		url: '/api/Wxpaycz/renyang_pay',
		method: 'post',
		data
	})
}

function addresOrder(data) {
	return request({
		url: '/api/Buy/addresOrder',
		method: 'post',
		data
	})
}

function getgoods(data) {
	return request({
		url: '/api/index/getgoods2',
		method: 'post',
		data
	})
}
function ptzctrl(data) {
	return request({
		url: '/api/video/ptzctrl',
		method: 'post',
		data
	})
}
// 商户信息
function merchantindex(data){
	return request({
		url: '/api/merchant/merchantindex',
		method: 'post',
		data
	})
}
// 商户信息
function farmproperty(data){
	return request({
		url: '/api/buy/farmproperty',
		method: 'post',
		data
	})
}
 
// 商户信息
function codeqorce(data){
	return request({
		url: '/api/buy/codeqorce',
		method: 'post',
		data
	})
}

// 商户信息
function bondindex(data){
	return request({
		url: '/api/merchant/bondindex',
		method: 'post',
		data
	})
}
// 商户信息
function thaw(data){
	return request({
		url: '/api/merchant/thaw',
		method: 'post',
		data
	})
}
 
export default {
	thaw,
	bondindex,
	ptzctrl,
	share2,
	getgoods,
	index,
	userShare,
	myqrcode,
	vipSign,
	shopSign,
	shopSignPost,
	lists,
	buyIndex,
	ad_advertisement,
	details,
	order_make,
	orderDetail,
	cancoupon,
	payNew,
	contract_tplinfo,
	partydetail,
	choose,
	home,
	searchs,
	vipIndex,
	Campaign,
	homeget,
	tabbar,
	Artical,
	Notice,
	renyang_pay,
	navtopage,
	getcar,
	addresOrder,
	merchantindex,
	farmproperty,
	codeqorce
}
