123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- import {
- request
- } from '@/request/request.js';
- const baseUrl = '/prod-api/mobile-api';
- /*
- * 获取tab List
- *
- *
- */
- export function getCategoryList() {
- return request({
- url: `${baseUrl}/category/list`,
- method: 'get'
- })
- }
- /*
- * 获取banner
- *
- *
- */
- export function getTopicList() {
- return request({
- url: `${baseUrl}/topic/list`,
- method: 'get'
- })
- }
- /*
- * 获取热门
- *
- *
- */
- export function getSearchHot() {
- return request({
- url: `${baseUrl}/goods/searchHot`,
- method: 'get'
- })
- }
- /*
- * 获取推荐
- *
- *
- */
- export function getSearchNew() {
- return request({
- url: `${baseUrl}/goods/searchNew`,
- method: 'get'
- })
- }
- /*
- * 获取商品详情
- *
- *
- */
- export function getGoods(id) {
- return request({
- url: `${baseUrl}/goods/${id}`,
- method: 'get'
- })
- }
- /*
- * 喜欢
- *
- *
- */
- export function like(id) {
- return request({
- url: `${baseUrl}/user/favorite/add/${id}`,
- method: 'post'
- })
- }
- /*
- * 取消喜欢
- *
- *
- */
- export function noLisk(id) {
- return request({
- url: `${baseUrl}/user/favorite/dislike/${id}`,
- method: 'post'
- })
- }
- /*
- * 加入购物车
- *
- *
- */
- export function addCart(data) {
- return request({
- url: `${baseUrl}/user/cart/add/`,
- method: 'post',
- data: data
- })
- }
- /*
- * 获取购物车数量
- *
- *
- */
- export function getCartCount() {
- return request({
- url: `${baseUrl}/user/cart/count`,
- method: 'get'
- })
- }
- /*
- * 获取购物车数据
- *
- *
- */
- export function getCartData() {
- return request({
- url: `${baseUrl}/user/cart/queryByUser`,
- method: 'get'
- })
- }
- /*
- * 追加数量
- *
- *
- */
- export function addGoodCount(id, count) {
- return request({
- url: `${baseUrl}/user/cart/update/${id}/${count}`,
- method: 'post'
- })
- }
- /*
- * 获取订单状态
- *
- *
- */
- export function getOrderResult(orderSn) {
- return request({
- url: `${baseUrl}/pay/queryResult/${orderSn}`,
- method: 'get'
- })
- }
- /*
- * 获取订单信息
- *
- *
- */
- export function getPaymentInformation(orderSn) {
- return request({
- url: `${baseUrl}/pay/wx/prepare?orderSn=${orderSn}`,
- method: 'post'
- })
- }
- /*
- * 修改用户OpenId
- *
- *
- */
- export function updateWxOpenId(openId) {
- return request({
- url: `${baseUrl}/user/updateOpenId/${openId}`,
- method: 'post'
- })
- }
|