| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318 | 
							- import request from '@/sheep/request';
 
- import request2 from '@/sheep/request2';
 
- import $platform from '@/sheep/platform';
 
- export default {
 
- 	getUnused: () =>
 
- 		request2({
 
- 			url: 'promotion/coupon/get-unused-count',
 
- 			method: 'GET',
 
- 			custom: {
 
- 				showLoading: false,
 
- 				auth: true,
 
- 			},
 
- 		}),
 
- 	profile: () =>
 
- 		request2({
 
- 			url: 'member/user/get',
 
- 			method: 'GET',
 
- 			custom: {
 
- 				showLoading: false,
 
- 				auth: true,
 
- 			},
 
- 		}),
 
- 	balance: () =>
 
- 		request2({
 
- 			url: '/app-api/pay/wallet/get',
 
- 			method: 'GET',
 
- 			custom: {
 
- 				showLoading: false,
 
- 				auth: true,
 
- 			},
 
- 		}),
 
- 	// 账号登录
 
- 	accountLogin: (data) =>
 
- 		request({
 
- 			url: '/user/api/user/accountLogin',
 
- 			method: 'POST',
 
- 			data,
 
- 			custom: {
 
- 				showSuccess: true,
 
- 				loadingMsg: '登录中',
 
- 			},
 
- 		}),
 
- 	// 短信登录
 
- 	smsLogin: (data) =>
 
- 		request({
 
- 			url: '/user/api/user/smsLogin',
 
- 			method: 'POST',
 
- 			data,
 
- 			custom: {
 
- 				showSuccess: true,
 
- 				loadingMsg: '登录中',
 
- 			},
 
- 		}),
 
- 	// 短信注册
 
- 	smsRegister: (data) =>
 
- 		request({
 
- 			url: '/user/api/user/smsRegister',
 
- 			method: 'POST',
 
- 			data,
 
- 			custom: {
 
- 				showSuccess: true,
 
- 				loadingMsg: '正在注册',
 
- 			},
 
- 		}),
 
- 	// 绑定、更换手机号
 
- 	changeMobile: (data) =>
 
- 		request({
 
- 			url: '/user/api/user/changeMobile',
 
- 			method: 'POST',
 
- 			data,
 
- 			custom: {
 
- 				showSuccess: true,
 
- 				loadingMsg: '验证中',
 
- 			},
 
- 		}),
 
- 	// 更新小程序信息
 
- 	updateMpUserInfo: (data) =>
 
- 		request({
 
- 			url: '/user/api/user/updateMpUserInfo',
 
- 			method: 'POST',
 
- 			data,
 
- 		}),
 
- 	// 第三方授权信息
 
- 	thirdOauthInfo: () =>
 
- 		request({
 
- 			url: '/user/api/user/thirdOauth',
 
- 			method: 'GET',
 
- 			params: {
 
- 				provider: $platform.provider,
 
- 				platform: $platform.platform,
 
- 			},
 
- 			custom: {
 
- 				showLoading: false,
 
- 			},
 
- 		}),
 
- 	// 添加分享记录
 
- 	addShareLog: (data) =>
 
- 		request({
 
- 			url: 'share/add',
 
- 			method: 'POST',
 
- 			data,
 
- 			custom: {
 
- 				showError: false,
 
- 			},
 
- 		}),
 
- 	share: {
 
- 		list: (params) =>
 
- 			request({
 
- 				url: 'share/list',
 
- 				method: 'GET',
 
- 				params,
 
- 			}),
 
- 	},
 
- 	// 账号登出
 
- 	logout: (data) =>
 
- 		request({
 
- 			url: '/user/api/user/logout',
 
- 			method: 'POST',
 
- 			data,
 
- 		}),
 
- 	// 账号注销
 
- 	logoff: (data) =>
 
- 		request({
 
- 			url: '/user/api/user/logoff',
 
- 			method: 'POST',
 
- 			data,
 
- 		}),
 
- 	address: {
 
- 		// default: () =>
 
- 		// 	request({
 
- 		// 		url: 'user/address/default',
 
- 		// 		method: 'GET',
 
- 		// 		custom: {
 
- 		// 			showError: false,
 
- 		// 		},
 
- 		// 	}),
 
- 		default: () =>
 
- 			request2({
 
- 				url: 'member/address/get-default',
 
- 				method: 'GET',
 
- 				custom: {
 
- 					showError: false,
 
- 				},
 
- 			}),
 
- 		list: () =>
 
- 			request2({
 
- 				url: 'member/address/list',
 
- 				method: 'GET',
 
- 				custom: {},
 
- 			}),
 
- 		create: (data) =>
 
- 			request2({
 
- 				url: 'member/address/create',
 
- 				method: 'POST',
 
- 				data,
 
- 				custom: {
 
- 					showSuccess: true,
 
- 				},
 
- 			}),
 
- 		update: (data) =>
 
- 			request2({
 
- 				url: 'member/address/update',
 
- 				method: 'PUT',
 
- 				data,
 
- 				custom: {
 
- 					showSuccess: true,
 
- 				},
 
- 			}),
 
- 		detail: (id) =>
 
- 			request2({
 
- 				url: 'member/address/get?id=' + id,
 
- 				method: 'GET',
 
- 			}),
 
- 		delete: (id) =>
 
- 			request2({
 
- 				url: 'member/address/delete?id=' + id,
 
- 				method: 'DELETE',
 
- 			}),
 
- 	},
 
- 	favorite: {
 
- 		list: (params) =>
 
- 			request2({
 
- 				url: 'product/favorite/page',
 
- 				method: 'GET',
 
- 				params,
 
- 			}),
 
- 		do: (id) =>
 
- 			request({
 
- 				url: 'user/goodsLog/favorite',
 
- 				method: 'POST',
 
- 				data: {
 
- 					goods_id: id,
 
- 				},
 
- 				custom: {
 
- 					showSuccess: true,
 
- 					auth: true,
 
- 				},
 
- 			}),
 
- 		// 取消收藏
 
- 		cancel: (id) =>
 
- 			request2({
 
- 				url: 'product/favorite/delete-list',
 
- 				method: 'DELETE',
 
- 				data: {
 
- 					spuIds: id.split(',').map(item => item * 1),
 
- 					// spuIds: id.split(',').join(','),
 
- 				},
 
- 				custom: {
 
- 					showSuccess: true,
 
- 					auth: true,
 
- 				},
 
- 			}),
 
- 		// cancel: (id) =>
 
- 		//   request({
 
- 		//     url: 'user/goodsLog/favorite',
 
- 		//     method: 'POST',
 
- 		//     data: {
 
- 		//       goods_ids: id,
 
- 		//     },
 
- 		//     custom: {
 
- 		//       showSuccess: true,
 
- 		//       auth: true,
 
- 		//     },
 
- 		//   }),
 
- 	},
 
- 	view: {
 
- 		list: (params) =>
 
- 			request({
 
- 				url: 'user/goodsLog/views',
 
- 				method: 'GET',
 
- 				params,
 
- 				custom: {},
 
- 			}),
 
- 		delete: (data) =>
 
- 			request({
 
- 				url: 'user/goodsLog/viewDel',
 
- 				method: 'DELETE',
 
- 				data,
 
- 				custom: {
 
- 					showSuccess: true,
 
- 				},
 
- 			}),
 
- 	},
 
- 	wallet: {
 
- 		log: (params) =>
 
- 			request2({
 
- 				// url: 'member/point/record/page',
 
- 				url: 'pay/wallet-transaction/page',
 
- 				method: 'GET',
 
- 				params,
 
- 				custom: {},
 
- 			}),
 
- 		log2: (params) =>
 
- 			request2({
 
- 				url: 'member/point/record/page',
 
- 				// url: 'pay/wallet-transaction/page',
 
- 				method: 'GET',
 
- 				params,
 
- 				custom: {},
 
- 			}),
 
- 	},
 
- 	account: {
 
- 		info: (params) =>
 
- 			request({
 
- 				url: 'user/account',
 
- 				method: 'GET',
 
- 				params,
 
- 				custom: {
 
- 					showError: false,
 
- 					auth: true,
 
- 				},
 
- 			}),
 
- 		save: (data) =>
 
- 			request({
 
- 				url: 'user/account',
 
- 				method: 'POST',
 
- 				data,
 
- 				custom: {
 
- 					showSuccess: true,
 
- 					auth: true,
 
- 				},
 
- 			}),
 
- 	},
 
- 	//数量接口
 
- 	// data: () =>
 
- 	//   request({
 
- 	//     url: 'user/user/data',
 
- 	//     method: 'GET',
 
- 	//     custom: {
 
- 	//       showLoading: false,
 
- 	//       auth: true,
 
- 	//     },
 
- 	//   }),
 
- 	data: () =>
 
- 		request2({
 
- 			url: 'trade/order/get-count',
 
- 			method: 'GET',
 
- 			custom: {
 
- 				showLoading: false,
 
- 				auth: true,
 
- 			},
 
- 		}),
 
- 	data2: () =>
 
- 		request2({
 
- 			url: 'trade/after-sale/get-applying-count',
 
- 			method: 'GET',
 
- 			custom: {
 
- 				showLoading: false,
 
- 				auth: true,
 
- 			},
 
- 		}),
 
- };
 
 
  |