123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- // const { useParamsEaseFuncs } = require('XrFrame/xrFrameSystem');
- const { request } = require('../utils/request')
- const API = {
- createCommentURL: '/appraise/create',
- loginURL: '/user/login',
- getUserInfoURL: '/user/info',
- registerURL: '/user/register',
- modifyURL: '/user/modify',
- getOrderURL: '/order/user',
- getCategoryURL: '/category',
- getCategoryGoodsURL: '/goods/category',
- getAllGoodsURL: '/goods',
- getSearchGoodsURL: '/goods/search'
- }
- //查询列表时传参---注意参数数据类型
- function createCommont(data) {
- //Promise
- return request.post(
- API.createCommentURL,
- {
- data: data
- }
- );
- }
- /**
- * @param: {pageNum, pageSize}
- */
- //传对象给params
- function getCommentList(params) {
- return request.get(
- API.createCommentURL,
- {
- params: params,//是传入的形参
- }
- );
- }
- // //超时设置:timeout: 1000 * 60 * 30
- // function deleteComment() {
- // }
- function login(params) {
- return request.post(
- API.loginURL,
- {
- header: params.header,
- data: params.data,
- }
- );
- }
- function getUserInfo(params) {
- return request.get(
- API.getUserInfoURL,
- {
- header: params.header,
- params: params.data,
- }
- );
- }
- function register(params) {
- return request.post(
- API.registerURL,
- {
- data: params.data,
- }
- );
- }
- function modify(params) {
- return request.post(
- API.modifyURL,
- {
- data: params.data,
- }
- );
- }
- function getOrder(params) {
- return request.get(
- API.getOrderURL,
- {
- params: params.data,
- }
- )
- }
- // 获取分类信息
- function getCategoryAPI() {
- // return http( API.getCategoryURL, {data: data})
- return request.get(
- API.getCategoryURL,
- )
- }
- // 获取分类出来的商品信息
- function getClassifyGoods(data) {
- return request.get(
- API.getCategoryGoodsURL + `/${data.page}/${data.pageSize}` + '?category=' + data.id
- )
- }
- //获取所有的商品
- function getAllGoods(data) {
- return request.get(
- API.getAllGoodsURL + `/${data.page}/${data.pageSize}`
- )
- }
- //搜索获取商品
- function searchGoods(data) {
- return request.get(
- API.getSearchGoodsURL + `/${data.page}/${data.pageSize}` + '?search=' + data.inputValue
- )
- }
- module.exports = {
- createCommont,
- getCommentList,
- login,
- getUserInfo,
- register,
- modify,
- getOrder,
- getCategoryAPI,
- getClassifyGoods,
- loginURl: API.loginURL,
- registerURL: API.registerURL,
- getAllGoods,
- searchGoods
- }
|