273 lines
7.0 KiB
JavaScript
273 lines
7.0 KiB
JavaScript
export default {
|
||
init(vm){
|
||
return {
|
||
// 获取首页轮播
|
||
getIndexSwiper() {
|
||
return vm.$u.post('adv/indexadv');
|
||
},
|
||
// 获取首页轮播
|
||
getZhiBoSwiper() {
|
||
return vm.$u.post('adv/divebroadcastxadv');
|
||
},
|
||
// 发现列表
|
||
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,
|
||
});
|
||
},
|
||
// 发现详情
|
||
getArticleInfo({ article_id }){
|
||
return vm.$u.post('article/articleInfo', {
|
||
article_id: article_id,
|
||
});
|
||
},
|
||
// 发现(取消)点赞
|
||
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,
|
||
});
|
||
},
|
||
// 直播列表
|
||
// getZhiboList() {
|
||
// return vm.$u.post('article/articleCollect', {
|
||
// article_id: article_id,
|
||
// });
|
||
// },
|
||
// 屏蔽用户
|
||
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');
|
||
},
|
||
// 达人(搜索)列表
|
||
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,
|
||
});
|
||
},
|
||
// 获取商城首页信息(顶部轮播图与商品分类)
|
||
getShopTopList(){
|
||
return vm.$u.post('Shop/getShopTopList');
|
||
},
|
||
// 商品分类列表(树结构)
|
||
getGoodsClassifyList() {
|
||
return vm.$u.post('Goods/getGoodsClassifyList');
|
||
},
|
||
// 商品推荐的分类
|
||
getGoodsClassRecommend() {
|
||
return vm.$u.post('Goods/getGoodsClassRecommend');
|
||
},
|
||
// 商品推荐
|
||
getGoodsRecommend({page, gc_id}){
|
||
return vm.$u.post('Goods/getGoodsRecommend', {
|
||
page: page,
|
||
gc_id: gc_id,
|
||
});
|
||
},
|
||
// 购物车商品列表
|
||
getCartList() {
|
||
return vm.$u.post('cart/cartList');
|
||
},
|
||
// 购物车商品列表(树结构)
|
||
getCartTreeList() {
|
||
return vm.$u.post('cart/cartTreeList');
|
||
},
|
||
// 添加购物车
|
||
addCart({ goods_id, quantity }) {
|
||
return vm.$u.post('cart/cartAdd', {
|
||
goods_id: goods_id,
|
||
quantity: quantity
|
||
});
|
||
},
|
||
// 购物车删除商品
|
||
deleteCart({ id }) {
|
||
return vm.$u.post('cart/cartDel', {
|
||
cart_ids: id
|
||
});
|
||
},
|
||
// 购物车更新商品数量
|
||
cartUpdateNumber({ cart_id, quantity }) {
|
||
return vm.$u.post('cart/cartUpdate', {
|
||
cart_id: cart_id,
|
||
quantity: quantity
|
||
});
|
||
},
|
||
// 订单步骤1:展示结算数据
|
||
settlementOrder({ ifcart, cart_id, pintuan_id, pintuangroup_id }) {
|
||
return vm.$u.post('buy/buy_step1', {
|
||
ifcart: ifcart,
|
||
cart_id: cart_id,
|
||
pintuan_id: pintuan_id,
|
||
pintuangroup_id: pintuangroup_id,
|
||
});
|
||
},
|
||
// 订单步骤2:发起订单,返回订单信息
|
||
sendOrder({ ifcart, cart_id, address_id, buy_city_id, pintuan_id, pintuangroup_id, voucher_id }) {
|
||
return vm.$u.post('buy/buy_step2', {
|
||
ifcart: ifcart,
|
||
cart_id: cart_id,
|
||
address_id: address_id,
|
||
buy_city_id: buy_city_id,
|
||
pintuan_id: pintuan_id,
|
||
pintuangroup_id: pintuangroup_id,
|
||
voucher_id: voucher_id, // 优惠券信息
|
||
});
|
||
},
|
||
// 订单步骤3:发起支付(第三方统一下单)
|
||
sendPay({ pay_sn, payment_code }) {
|
||
return vm.$u.post('Payment/real_order', {
|
||
pay_sn: pay_sn,
|
||
payment_code: payment_code,
|
||
});
|
||
},
|
||
// 选择地区计算运费
|
||
getFreight({ freight_hash, city_id, area_id, delivery }) {
|
||
return vm.$u.post('Buy/change_addr', {
|
||
freight_hash: freight_hash,
|
||
city_id: city_id,
|
||
area_id: area_id,
|
||
delivery: delivery,
|
||
});
|
||
},
|
||
// 商品详情
|
||
// getGoodsDetails({ id }) {
|
||
// return vm.$u.post('Goods/goodDetails', {
|
||
// goods_id: id
|
||
// });
|
||
// },
|
||
// 商品详情
|
||
getGoodsDetails({ id }) {
|
||
return vm.$u.post('goods/goodsInfo', {
|
||
goods_id: id
|
||
});
|
||
},
|
||
getStoreGoodsList({ id, page = 0}){
|
||
return vm.$u.post('Store/getStoreGoodsList', {
|
||
id: id,
|
||
page:page
|
||
});
|
||
},
|
||
getStoreImgVideoList({id}){
|
||
return vm.$u.post('Store/getStoreImgVideoList', {
|
||
id: id
|
||
});
|
||
},
|
||
// 商品搜索
|
||
ShopSearch({keyword,page = 1,order = 'goods_salenum'}){
|
||
return vm.$u.post('ShopSearch/search',{
|
||
keyword,page,order
|
||
})
|
||
},
|
||
// 秒杀推荐
|
||
recommendedSpike() {
|
||
return vm.$u.post('Spike/recommendedSpike');
|
||
},
|
||
// 秒杀详情
|
||
getSpikeInfo({ groupbuy_id }) {
|
||
return vm.$u.post('Spike/spikeInfo', {
|
||
groupbuy_id: groupbuy_id
|
||
});
|
||
},
|
||
// 秒杀列表
|
||
getSpikeList({ page }) {
|
||
return vm.$u.post('spike/spikeList', {
|
||
page: page
|
||
});
|
||
},
|
||
// 拼团列表
|
||
getPinTuanList({ page, gc_id }) {
|
||
return vm.$u.post('Specialci/pintuanList', {
|
||
page: page,
|
||
gc_id: gc_id,
|
||
});
|
||
},
|
||
// 拼团商品详情
|
||
getPinTuanDetails({ pintuan_id }) {
|
||
return vm.$u.post('Specialci/pintuanInfo', { pintuan_id: pintuan_id });
|
||
},
|
||
// 推荐拼团
|
||
getPinTuanPush() {
|
||
return vm.$u.post('Specialci/pintuanPush');
|
||
},
|
||
// 开团/参团
|
||
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,
|
||
});
|
||
},
|
||
// 商品分类(拼团分类)
|
||
getGoodsClass() {
|
||
return vm.$u.post('Specialci/goodsClass');
|
||
},
|
||
// 优惠券列表(要兑换的)
|
||
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,
|
||
});
|
||
},
|
||
// 领取优惠券
|
||
getCoupon({ id }) {
|
||
return vm.$u.post('Coupon/getCoupon', {
|
||
vouchertemplate_id: id,
|
||
});
|
||
},
|
||
// 我的优惠券(已有的)
|
||
getMemberCouponList({ store_id, gc_id, type, status }) {
|
||
return vm.$u.post('Coupon/getMemberCouponList', {
|
||
store_id: store_id,
|
||
gc_id: gc_id,
|
||
type: type,
|
||
status: status,
|
||
});
|
||
},
|
||
// 获取直播列表
|
||
tabLiveList(){
|
||
return vm.$u.post('Specialci/tabLiveList')
|
||
},
|
||
// 获取图文视频详情
|
||
articleInfo({article_id}){
|
||
return vm.$u.post('article/articleInfo',{article_id})
|
||
},
|
||
getStoreInfo({id}){
|
||
return vm.$u.post('Store/getStoreInfo',{id})
|
||
},
|
||
// 获取商品评论
|
||
getAllEvalue({ goods_id, page }) {
|
||
return vm.$u.post('Specialci/getAllEvalue', {
|
||
goods_id: goods_id,
|
||
page: page,
|
||
})
|
||
},
|
||
}
|
||
}
|
||
|
||
} |