deming/common/api/shop.js

370 lines
9.7 KiB
JavaScript
Raw Normal View History

2020-06-15 02:00:14 +00:00
export default {
init(vm){
return {
2020-07-15 08:21:43 +00:00
// 获取首页轮播
getIndexSwiper() {
return vm.$u.post('adv/indexadv');
},
// 获取首页轮播
getZhiBoSwiper() {
return vm.$u.post('adv/divebroadcastxadv');
},
2020-06-29 09:24:57 +00:00
// 发现列表
getArticlelist({ page, value, store_id, member_id, is_video_img }){
return vm.$u.post('article/articlelist', {
page: page,
like: value, // 搜索内容
store_id: store_id,
member_id: member_id,
is_video_img: is_video_img,
});
},
2020-07-01 09:32:36 +00:00
// 发现详情
getArticleInfo({ article_id }){
return vm.$u.post('article/articleInfo', {
article_id: article_id,
});
},
2020-06-30 10:06:50 +00:00
// 发现(取消)点赞
articleLike({ article_id }) {
return vm.$u.post('article/articleLike', {
article_id: article_id,
});
},
// 发现(取消)收藏
articleCollect({ article_id }) {
return vm.$u.post('article/articleCollect', {
article_id: article_id,
});
},
2020-07-15 08:21:43 +00:00
// 直播列表
// getZhiboList() {
// return vm.$u.post('article/articleCollect', {
// article_id: article_id,
// });
// },
2020-06-30 10:06:50 +00:00
// 屏蔽用户
articleAddShield({ article_id, member_id }) {
return vm.$u.post('article/articleAddShield', {
article_id: article_id,
member_id: member_id,
});
},
// 推荐达人
getRecommendList(){
return vm.$u.post('MemberExpert/recommendList');
},
2020-08-15 10:32:46 +00:00
// 获取所有达人
getAllRecommendList({ page }) {
return vm.$u.post('MemberExpert/getRecommendList', { page });
},
2020-07-01 09:32:36 +00:00
// 达人(搜索)列表
getExpertList({ page, store_id, live_status, like_nickname }){
return vm.$u.post('MemberExpert/expertList', {
page: page,
store_id: store_id,
live_status: live_status,
like_nickname: like_nickname,
});
},
// 达人详情
getExpertInfo({ member_id }){
return vm.$u.post('MemberExpert/expertInfo', {
member_id: member_id,
});
},
2020-06-24 08:39:31 +00:00
// 获取商城首页信息(顶部轮播图与商品分类)
getShopTopList(){
return vm.$u.post('Shop/getShopTopList');
},
2020-06-30 10:06:50 +00:00
// 商品分类列表(树结构)
getGoodsClassifyList() {
return vm.$u.post('Goods/getGoodsClassifyList');
},
2020-07-23 06:56:20 +00:00
// 商品推荐的分类
getGoodsClassRecommend() {
return vm.$u.post('Goods/getGoodsClassRecommend');
},
2020-08-04 11:08:04 +00:00
// goodsListByClassId
goodsListByClassId({ gc_id, page, order }) {
return vm.$u.post('goods/goodsListByClassId', {
gc_id: gc_id,
page: page,
order: order,
});
},
2020-06-18 06:57:26 +00:00
// 商品推荐
2020-07-17 09:34:42 +00:00
getGoodsRecommend({page, gc_id}){
2020-06-18 06:57:26 +00:00
return vm.$u.post('Goods/getGoodsRecommend', {
2020-07-17 09:34:42 +00:00
page: page,
gc_id: gc_id,
2020-06-18 06:57:26 +00:00
});
2020-06-19 10:07:11 +00:00
},
// 购物车商品列表
getCartList() {
return vm.$u.post('cart/cartList');
2020-06-24 08:39:31 +00:00
},
// 购物车商品列表(树结构)
getCartTreeList() {
return vm.$u.post('cart/cartTreeList');
},
2020-06-29 00:47:37 +00:00
// 添加购物车
addCart({ goods_id, quantity }) {
return vm.$u.post('cart/cartAdd', {
goods_id: goods_id,
quantity: quantity
});
},
// 购物车删除商品
deleteCart({ id }) {
return vm.$u.post('cart/cartDel', {
2020-06-29 09:24:57 +00:00
cart_ids: id
});
},
2020-06-30 10:06:50 +00:00
// 购物车更新商品数量
cartUpdateNumber({ cart_id, quantity }) {
return vm.$u.post('cart/cartUpdate', {
cart_id: cart_id,
quantity: quantity
});
},
2020-07-14 01:15:51 +00:00
// 订单步骤1展示结算数据
2020-07-21 13:02:28 +00:00
settlementOrder({ ifcart, cart_id, pintuan_id, pintuangroup_id }) {
2020-06-30 10:06:50 +00:00
return vm.$u.post('buy/buy_step1', {
2020-07-14 01:15:51 +00:00
ifcart: ifcart,
2020-06-30 10:06:50 +00:00
cart_id: cart_id,
2020-07-21 13:02:28 +00:00
pintuan_id: pintuan_id,
pintuangroup_id: pintuangroup_id,
2020-06-30 10:06:50 +00:00
});
},
2020-07-14 01:15:51 +00:00
// 订单步骤2发起订单返回订单信息
2020-07-22 10:51:48 +00:00
sendOrder({ ifcart, cart_id, address_id, buy_city_id, pintuan_id, pintuangroup_id, voucher_id }) {
2020-07-14 01:15:51 +00:00
return vm.$u.post('buy/buy_step2', {
ifcart: ifcart,
cart_id: cart_id,
address_id: address_id,
buy_city_id: buy_city_id,
2020-07-21 13:02:28 +00:00
pintuan_id: pintuan_id,
pintuangroup_id: pintuangroup_id,
voucher_id: voucher_id, // 优惠券信息
2020-07-14 01:15:51 +00:00
});
},
// 订单步骤3发起支付第三方统一下单
sendPay({ pay_sn, payment_code }) {
return vm.$u.post('Payment/real_order', {
pay_sn: pay_sn,
payment_code: payment_code,
});
},
2020-07-06 09:32:29 +00:00
// 选择地区计算运费
2020-07-16 09:39:06 +00:00
getFreight({ freight_hash, city_id, area_id, delivery }) {
2020-07-06 09:32:29 +00:00
return vm.$u.post('Buy/change_addr', {
freight_hash: freight_hash,
city_id: city_id,
area_id: area_id,
2020-07-16 09:39:06 +00:00
delivery: delivery,
2020-07-06 09:32:29 +00:00
});
},
2020-06-29 09:24:57 +00:00
// 商品详情
2020-07-15 08:21:43 +00:00
// getGoodsDetails({ id }) {
// return vm.$u.post('Goods/goodDetails', {
// goods_id: id
// });
// },
// 商品详情
2020-06-29 09:24:57 +00:00
getGoodsDetails({ id }) {
2020-07-15 08:21:43 +00:00
return vm.$u.post('goods/goodsInfo', {
2020-06-29 09:24:57 +00:00
goods_id: id
2020-06-29 00:47:37 +00:00
});
2020-06-30 10:06:50 +00:00
},
2020-08-05 09:38:11 +00:00
getStoreGoodsList({ id, page, order, gc_id }){
2020-07-02 07:39:25 +00:00
return vm.$u.post('Store/getStoreGoodsList', {
id: id,
2020-08-05 09:38:11 +00:00
page: page,
order: order,
gc_id: gc_id,
});
},
getStoreClassifyList({ id }) {
return vm.$u.post('Store/getStoreClassifyList', {
id: id
2020-07-02 07:39:25 +00:00
});
2020-07-06 01:10:34 +00:00
},
getStoreImgVideoList({id}){
return vm.$u.post('Store/getStoreImgVideoList', {
id: id
});
2020-07-07 06:45:57 +00:00
},
2020-07-18 03:44:05 +00:00
// 商品搜索
2020-08-15 11:04:18 +00:00
ShopSearch({keyword, page = 1, order = 'goods_salenum',sid=''}){
2020-07-18 03:44:05 +00:00
return vm.$u.post('ShopSearch/search',{
2020-08-15 11:04:18 +00:00
keyword,page,order,store_id:sid
2020-07-18 03:44:05 +00:00
})
},
2020-07-15 08:21:43 +00:00
// 秒杀推荐
recommendedSpike() {
return vm.$u.post('Spike/recommendedSpike');
},
// 秒杀详情
2020-08-11 07:38:43 +00:00
getSpikeInfo({ groupbuy_id, goods_id }) {
2020-07-15 08:21:43 +00:00
return vm.$u.post('Spike/spikeInfo', {
2020-08-11 07:38:43 +00:00
groupbuy_id: groupbuy_id,
goods_id: goods_id,
2020-07-15 08:21:43 +00:00
});
},
// 秒杀列表
getSpikeList({ page }) {
return vm.$u.post('spike/spikeList', {
page: page
});
},
2020-07-16 09:39:06 +00:00
// 拼团列表
2020-07-17 09:34:42 +00:00
getPinTuanList({ page, gc_id }) {
return vm.$u.post('Specialci/pintuanList', {
page: page,
gc_id: gc_id,
});
2020-07-16 09:39:06 +00:00
},
// 拼团商品详情
2020-08-11 07:38:43 +00:00
getPinTuanDetails({ pintuan_id, goods_id }) {
return vm.$u.post('Specialci/pintuanInfo', {
pintuan_id: pintuan_id,
goods_id: goods_id,
});
2020-07-16 09:39:06 +00:00
},
2020-07-20 09:17:41 +00:00
// 推荐拼团
2020-07-17 09:34:42 +00:00
getPinTuanPush() {
return vm.$u.post('Specialci/pintuanPush');
},
2020-08-11 10:24:56 +00:00
// 拼团验证
pintuanVerify({ pintuan_id, pintuangroup_headid }) {
return vm.$u.post('Specialci/pintuanVerify', {
pintuan_id: pintuan_id,
pintuangroup_headid: pintuangroup_headid,
});
},
2020-07-20 09:17:41 +00:00
// 开团/参团
withImmediate({ pintuan_id, pintuangroup_headid, pintuangroup_id}) {
return vm.$u.post('Specialci/withImmediate', {
pintuan_id: pintuan_id,
pintuangroup_headid: pintuangroup_headid,
pintuangroup_id: pintuangroup_id,
});
},
2020-07-17 09:34:42 +00:00
// 商品分类(拼团分类)
getGoodsClass() {
return vm.$u.post('Specialci/goodsClass');
},
// 优惠券列表(要兑换的)
2020-07-16 09:39:06 +00:00
getCouponList({ page, store_id, type, gc_id }) {
return vm.$u.post('Coupon/CouponList', {
page: page,
store_id: store_id,
type: type,
gc_id: gc_id,
});
},
// 领取优惠券
2020-07-17 09:34:42 +00:00
getCoupon({ id }) {
2020-07-16 09:39:06 +00:00
return vm.$u.post('Coupon/getCoupon', {
2020-07-17 09:34:42 +00:00
vouchertemplate_id: id,
});
},
// 我的优惠券(已有的)
2020-08-19 09:55:58 +00:00
getMemberCouponList({ store_id, gc_id, type, status, page }) {
2020-07-17 09:34:42 +00:00
return vm.$u.post('Coupon/getMemberCouponList', {
store_id: store_id,
gc_id: gc_id,
type: type,
status: status,
2020-08-19 09:55:58 +00:00
page: page,
2020-07-16 09:39:06 +00:00
});
2020-07-18 08:10:14 +00:00
},
// 获取直播列表
2020-08-13 03:52:05 +00:00
tabLiveList({page}){
return vm.$u.post('Specialci/tabLiveList',{page})
2020-07-20 00:43:13 +00:00
},
2020-07-30 12:33:16 +00:00
// 商城-活动广告
getStoreActivity() {
return vm.$u.post('adv/storeActivity')
},
2020-07-20 00:43:13 +00:00
// 获取图文视频详情
articleInfo({article_id}){
return vm.$u.post('article/articleInfo',{article_id})
2020-07-21 13:01:42 +00:00
},
getStoreInfo({id}){
return vm.$u.post('Store/getStoreInfo',{id})
2020-07-24 11:48:57 +00:00
},
2020-07-25 07:17:52 +00:00
// 评论标签+数量
getEvaluateSpec({ id }) {
return vm.$u.post('Specialci/getEvaluateSpec', {
goods_id: id,
})
},
2020-07-24 11:48:57 +00:00
// 获取商品评论
2020-07-25 07:17:52 +00:00
getAllEvalue({ goods_id, page, type }) {
2020-07-24 11:48:57 +00:00
return vm.$u.post('Specialci/getAllEvalue', {
goods_id: goods_id,
page: page,
2020-07-25 07:17:52 +00:00
type: type,
2020-07-24 11:48:57 +00:00
})
},
2020-07-25 07:17:52 +00:00
// 搜索发现列表
2020-08-09 10:29:36 +00:00
searchwordlist({type}) {
return vm.$u.post('ShopSearch/searchWordList',{type})
2020-07-25 07:17:52 +00:00
},
2020-07-28 12:47:31 +00:00
// 提交试穿订单
saveGoodsTry({ member_name, member_mobile, area_info, address_detail, goods_id, num, store_id, appointment_time }) {
2020-07-27 09:59:47 +00:00
return vm.$u.post('Order/saveGoodsTry', {
member_name: member_name,
member_mobile: member_mobile,
area_info: area_info,
address_detail: address_detail,
goods_id: goods_id,
num: num,
store_id: store_id,
2020-07-28 12:47:31 +00:00
appointment_time: appointment_time,
2020-07-27 09:59:47 +00:00
})
},
2020-07-31 01:40:06 +00:00
// 达人上架商品
goodsShelves({live_id}){
return vm.$u.post('Specialci/goodsShelves',{live_id})
2020-08-05 09:38:11 +00:00
},
2020-08-07 03:59:08 +00:00
// 收藏店铺
2020-08-05 09:38:11 +00:00
addFavoriteStore({ id }) {
return vm.$u.post('member/addFavoriteStore',{ fid: id })
},
2020-08-07 03:40:13 +00:00
//店家id获取用户信息
getAtwillUserInfo({ id }) {
return vm.$u.post('Specialci/getAtwillUserInfo',{ store_id: id })
},
2020-08-07 03:59:08 +00:00
// 收藏商品
addFavoriteGoods({ fid }) {
return vm.$u.post('member/addFavoriteGoods',{ fid: fid })
},
// 取消收藏(商品/店铺)
removeFavorite({ fid, type }) {
return vm.$u.post('Member/removeFavorite',{
fav_id: fid,
type: type
})
2020-08-09 10:29:36 +00:00
},
//店铺列表
storeList({ page, name_search }) {
return vm.$u.post('shop/storeList',{
page,
name_search: name_search
})
2020-08-10 09:38:54 +00:00
},
// 是否弹出新人优惠券
isNewmembervoucher() {
return vm.$u.post('Coupon/isNewmembervoucher')
},
2020-08-17 04:11:38 +00:00
//待发货退款
2020-08-17 08:01:02 +00:00
addrefundall({order_id,reason_info}) {
return vm.$u.post('order/add_refund_all',{order_id,reason_info})
2020-08-17 04:11:38 +00:00
},
2020-06-15 02:00:14 +00:00
}
}
}