import {http_use,http_post} from '../http.js' import api from '../api' class X_goods { // 专属客服 async x_custOmer() { let res = await http_post(api.x_custOmer, { }) return res } // 订单数量 async x_order_count() { let res = await http_post(api.x_order_count, { }) return res } // x_cancelOrder 取消订单 async x_cancelOrder(order_id) { let res = await http_post(api.x_cancelOrder, { order_id }) return res } // 搜索联动列表 async x_searchList(name) { let res = await http_post(api.x_searchList, { name }) return res } //X_update 加减购物车数量 async X_update(id,goods_number) { let res = await http_post(api.X_update, { id, goods_number }) return res } // 上传阿里云图片 获取签名 async X_getAliyunOssStsToken() { let res = await http_post(api.X_getAliyunOssStsToken, { }) return res } // X_submitSuggestion 意见反馈 async X_submitSuggestion(status,phone,type,suggestion_content,pic_url) { let res = await http_post(api.X_submitSuggestion, { status, phone, type, suggestion_content, pic_url }) return res } //X_toPay 去支付 async X_toPay(order_id) { let res = await http_post(api.X_toPay, { order_id }) return res } // 创建订单 async X_create_order(id_group,address,consignee,tel,remark,address_id) { let res = await http_post(api.X_create_order, { id_group, address, consignee, tel, remark, address_id }) return res } //支付 async X_appPay(order_id,pay_type) { console.log(order_id) let res = await http_post(api.X_appPay, { order_id, pay_type }) console.log(res) return res } //X_treeUserAddress 地区三级地址 async X_treeUserAddress() { let res = await http_post(api.X_treeUserAddress, { }) return res } //X_orderPreview 确认订单 async X_orderPreview(id_group) { let res = await http_post(api.X_orderPreview, { id_group }) return res } //添加购物车 async X_addCar(gba_id,batch_id,goods_number,add_type) { let res = await http_post(api.X_addCar, { gba_id, batch_id, goods_number, add_type }) return res } // 商品分类 async x_Classification() { let res = await http_post(api.x_Classification, { }) return res } // 购物车 async x_shoppingCar() { let res = await http_post(api.x_shoppingCar, { }) return res } // 删除购物车 async X_delCar(id_group) { let res = await http_post(api.X_delCar, { id_group }) return res } //X_addCollect_app 商品收藏/ 取消收藏 async X_addCollect_app(goods_id,status) { let res = await http_post(api.X_addCollect_app, { goods_id, status }) return res } // 商品收藏列表 async x_Collectlsit() { let res = await http_post(api.x_Collectlsit, { }) return res } // 商品详情 async x_goodsDetail(sku_id) { let res = await http_post(api.x_goodsDetail, { sku_id }) return res } // 热搜 async goodsRanking() { let res = await http_post(api.goodsRanking, { }) return res } // 商品搜索 async search( search_words, cate_id, activity_id, retail_flag, sort_field, sort_order, term_validity, drug_form, manufacturer, price_start, price_end, current_page ){ let res = await http_post(api.search, { search_words, cate_id, activity_id, retail_flag, sort_field, sort_order, term_validity, drug_form, manufacturer, price_start, price_end, current_page }) return res } // 商品列表 async goodsList(limit,page){ let res = await http_post(api.goodsList, { limit, //每页多少条(默认20) page //当前页 }) return res } } export default new X_goods