更新项目配置和添加小程序模块
- 修改 ArticleController.java - 更新 application.yml 配置 - 更新 frontend/.env.production 环境配置 - 添加 single_uniapp22miao 小程序模块 - 添加 logs 目录
This commit is contained in:
316
single_uniapp22miao/api/api.js
Normal file
316
single_uniapp22miao/api/api.js
Normal file
@@ -0,0 +1,316 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
import request from "@/utils/request.js";
|
||||
/**
|
||||
* 公共接口 ,优惠券接口 , 行业此讯 , 手机号码注册
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* 获取主页数据 无需授权
|
||||
*
|
||||
*/
|
||||
export function getIndexData()
|
||||
{
|
||||
return request.get("index",{},{ noAuth : true});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取登录授权login
|
||||
*
|
||||
*/
|
||||
export function getLogo()
|
||||
{
|
||||
return request.get('wechat/getLogo', {}, { noAuth : true});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存form_id
|
||||
* @param string formId
|
||||
*/
|
||||
export function setFormId(formId) {
|
||||
return request.post("wechat/set_form_id", { formId: formId});
|
||||
}
|
||||
|
||||
/**
|
||||
* 领取优惠卷
|
||||
* @param int couponId
|
||||
*
|
||||
*/
|
||||
export function setCouponReceive(couponId){
|
||||
return request.post('coupon/receive', { couponId: couponId});
|
||||
}
|
||||
/**
|
||||
* 优惠券列表
|
||||
* @param object data
|
||||
*/
|
||||
export function getCoupons(data){
|
||||
return request.get('coupons',data,{noAuth:true})
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的优惠券
|
||||
* @param int types 0全部 1未使用 2已使用
|
||||
*/
|
||||
export function getUserCoupons(data){
|
||||
return request.get('coupon/list',data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 文章分类列表
|
||||
*
|
||||
*/
|
||||
export function getArticleCategoryList(){
|
||||
return request.get('article/category/list',{},{noAuth:true})
|
||||
}
|
||||
|
||||
/**
|
||||
* 文章列表
|
||||
* @param int cid
|
||||
*
|
||||
*/
|
||||
export function getArticleList(cid,data){
|
||||
return request.get('article/list/' + cid, data,{noAuth:true})
|
||||
}
|
||||
|
||||
/**
|
||||
* 文章 热门列表
|
||||
*
|
||||
*/
|
||||
export function getArticleHotList(){
|
||||
return request.get('article/hot/list',{},{noAuth:true});
|
||||
}
|
||||
|
||||
/**
|
||||
* 文章 轮播列表
|
||||
*
|
||||
*/
|
||||
export function getArticleBannerList(){
|
||||
return request.get('article/banner/list',{},{noAuth:true})
|
||||
}
|
||||
|
||||
/**
|
||||
* 文章详情
|
||||
* @param int id
|
||||
*
|
||||
*/
|
||||
export function getArticleDetails(id){
|
||||
return request.get('article/info',id,{noAuth:true});
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机号+验证码登录接口
|
||||
* @param object data
|
||||
*/
|
||||
export function loginMobile(data){
|
||||
return request.post('login/mobile',data,{noAuth:true})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取短信KEY
|
||||
* @param object phone
|
||||
*/
|
||||
export function verifyCode(){
|
||||
return request.get('verify_code', {},{noAuth:true})
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证码发送
|
||||
* @param object phone
|
||||
*/
|
||||
export function registerVerify(phone){
|
||||
return request.post('sendCode', { phone: phone },{noAuth:true},1)
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机号注册
|
||||
* @param object data
|
||||
*
|
||||
*/
|
||||
export function phoneRegister(data){
|
||||
return request.post('register',data,{noAuth:true});
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机号修改密码
|
||||
* @param object data
|
||||
*
|
||||
*/
|
||||
export function phoneRegisterReset(data){
|
||||
return request.post('register/reset',data,{noAuth:true})
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机号+密码登录
|
||||
* @param object data
|
||||
*
|
||||
*/
|
||||
export function phoneLogin(data){
|
||||
return request.post('login',data,{noAuth:true})
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换H5登录
|
||||
* @param object data
|
||||
*/
|
||||
// #ifdef MP
|
||||
export function switchH5Login(){
|
||||
return request.post('switch_h5', { 'from':'routine'});
|
||||
}
|
||||
// #endif
|
||||
|
||||
/*
|
||||
* h5切换公众号登录
|
||||
* */
|
||||
// #ifdef H5
|
||||
export function switchH5Login() {
|
||||
return request.post("switch_h5", { 'from': "wechat" });
|
||||
}
|
||||
// #endif
|
||||
|
||||
/**
|
||||
* 换绑手机号
|
||||
*
|
||||
*/
|
||||
export function bindingPhone(data){
|
||||
return request.post('update/binding',data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 换绑手机号校验
|
||||
*
|
||||
*/
|
||||
export function bindingVerify(data){
|
||||
return request.post('update/binding/verify',data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出登錄
|
||||
*
|
||||
*/
|
||||
export function logout(){
|
||||
return request.get('logout');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订阅消息id
|
||||
*/
|
||||
export function getTemlIds(data)
|
||||
{
|
||||
return request.get('wechat/program/my/temp/list', data , { noAuth:true});
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页拼团数据
|
||||
*/
|
||||
export function pink()
|
||||
{
|
||||
return request.get('pink', {}, { noAuth:true});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取城市信息
|
||||
*/
|
||||
export function getCity() {
|
||||
return request.get('city/list', { }, { noAuth: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取小程序直播列表
|
||||
*/
|
||||
export function getLiveList(page,limit) {
|
||||
return request.get('wechat/live', { page, limit}, { noAuth: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取小程序二维码
|
||||
*/
|
||||
export function getQrcode(data) {
|
||||
return request.post('qrcode/get',data,{ noAuth: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取主题换色配置
|
||||
*/
|
||||
export function getTheme() {
|
||||
return request.get('index/color/config',{},{noAuth:true});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取主题换色配置
|
||||
*/
|
||||
export function getAppVersion() {
|
||||
return request.get('index/get/version',{},{noAuth:true});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全局本地图片域名
|
||||
*/
|
||||
export function getImageDomain() {
|
||||
return request.get('image/domain',{},{noAuth:true});
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品排行榜
|
||||
*/
|
||||
export function productRank(){
|
||||
return request.get('product/leaderboard',{},{noAuth:true});
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验token是否有效
|
||||
*/
|
||||
export function tokenIsExistApi(){
|
||||
return request.post(`token/is/exist`,{},{noAuth:true});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取登录配置
|
||||
*/
|
||||
export function loginConfigApi(){
|
||||
return request.get(`login/config`,{},{noAuth:true});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取底部导航信息
|
||||
*/
|
||||
export function getBottomNavigationApi(){
|
||||
return request.get(`get/bottom/navigation`,{},{noAuth:true});
|
||||
}
|
||||
/**
|
||||
* 协议详情
|
||||
*/
|
||||
export function agreementInfo(info){
|
||||
return request.get(`agreement/${info}`,{},{noAuth:true});
|
||||
}
|
||||
/**
|
||||
* 首页装修
|
||||
*/
|
||||
export function pagediyInfoApi(id){
|
||||
return request.get(`pagediy/info/${id}`,{},{noAuth:true});
|
||||
}
|
||||
/**
|
||||
* 首页 第二级商品分类
|
||||
*
|
||||
*/
|
||||
export function getCategoryTwo(id)
|
||||
{
|
||||
return request.get(`categorybypid/${id}`,{},{ noAuth : true});
|
||||
}
|
||||
/**
|
||||
* 获取备案设置
|
||||
*
|
||||
*/
|
||||
export function getConfigCopyright(id)
|
||||
{
|
||||
return request.get(`config/get/copyright`,{},{ noAuth : true},{},true);
|
||||
}
|
||||
263
single_uniapp22miao/api/integral.js
Normal file
263
single_uniapp22miao/api/integral.js
Normal file
@@ -0,0 +1,263 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | 积分商城模块API接口
|
||||
// +----------------------------------------------------------------------
|
||||
// | 创建时间: 2025-12-17
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
import request from "@/utils/request.js";
|
||||
|
||||
// ==================== 一、商品模块 ====================
|
||||
|
||||
/**
|
||||
* 获取积分商品列表
|
||||
* @param {Object} params - {page, limit, category_id, keyword, sort}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getIntegralGoodsList(params) {
|
||||
return request.get('integral/goods/list', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取积分商品详情
|
||||
* @param {Number} id - 商品ID
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getIntegralGoodsDetail(id) {
|
||||
return request.get('integral/goods/detail', { id });
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索积分商品
|
||||
* @param {Object} params - {keyword, page, limit}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function searchIntegralGoods(params) {
|
||||
return request.get('integral/goods/search', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品分类列表
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getIntegralCategory() {
|
||||
return request.get('integral/category/list', {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 收藏/取消收藏商品
|
||||
* @param {Object} data - {goods_id, is_collect}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function collectIntegralGoods(data) {
|
||||
return request.post('integral/goods/collect', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取轮播图
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getIntegralBanner() {
|
||||
return request.get('integral/banner/list', {});
|
||||
}
|
||||
|
||||
// ==================== 二、订单模块 ====================
|
||||
|
||||
/**
|
||||
* 创建兑换订单
|
||||
* @param {Object} data - {goods_id, quantity, address_id}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function createIntegralOrder(data) {
|
||||
return request.post('integral/order/create', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单列表
|
||||
* @param {Object} params - {page, limit, status}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getIntegralOrderList(params) {
|
||||
return request.get('integral/order/list', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单详情
|
||||
* @param {Number} id - 订单ID
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getIntegralOrderDetail(id) {
|
||||
return request.get('integral/order/detail', { id });
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消订单
|
||||
* @param {Object} data - {id}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function cancelIntegralOrder(data) {
|
||||
return request.post('integral/order/cancel', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认收货
|
||||
* @param {Object} data - {id}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function confirmIntegralOrder(data) {
|
||||
return request.post('integral/order/confirm', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单
|
||||
* @param {Object} data - {id}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function deleteIntegralOrder(data) {
|
||||
return request.post('integral/order/delete', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物流信息
|
||||
* @param {Number} id - 订单ID
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getIntegralOrderExpress(id) {
|
||||
return request.get('integral/order/express', { id });
|
||||
}
|
||||
|
||||
// ==================== 二、购物车模块 ====================
|
||||
|
||||
/**
|
||||
* 加入购物车
|
||||
* @param {Object} data - {goods_id, quantity, sku_id}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function addIntegralCart(data) {
|
||||
return request.post('integral/cart/add', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取购物车列表
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getIntegralCartList() {
|
||||
return request.get('integral/cart/list');
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新购物车数量
|
||||
* @param {Object} data - {id, quantity}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function updateIntegralCart(data) {
|
||||
return request.post('integral/cart/update', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除购物车商品
|
||||
* @param {Object} data - {ids: [id1, id2, ...]}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function deleteIntegralCart(data) {
|
||||
return request.post('integral/cart/delete', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新购物车选中状态
|
||||
* @param {Object} data - {id, selected}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function updateIntegralCartSelected(data) {
|
||||
return request.post('integral/cart/selected', data);
|
||||
}
|
||||
|
||||
// ==================== 三、积分模块 ====================
|
||||
|
||||
/**
|
||||
* 获取积分余额
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getPointsBalance() {
|
||||
return request.get('integral/points/balance');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取积分规则
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getPointsRules() {
|
||||
return request.get('integral/points/rules');
|
||||
}
|
||||
|
||||
/**
|
||||
* 签到获取积分
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function signIn() {
|
||||
return request.post('integral/points/signin');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取签到信息
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getSignInfo() {
|
||||
return request.get('integral/points/signin/info');
|
||||
}
|
||||
|
||||
// ==================== 四、统计模块 ====================
|
||||
|
||||
/**
|
||||
* 获取积分商城首页统计数据
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getIntegralIndex() {
|
||||
return request.get('integral/index');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单统计数量
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getIntegralOrderCount() {
|
||||
return request.get('integral/order/count');
|
||||
}
|
||||
|
||||
// ==================== 批量导出 ====================
|
||||
|
||||
export default {
|
||||
// 商品
|
||||
getIntegralGoodsList,
|
||||
getIntegralGoodsDetail,
|
||||
searchIntegralGoods,
|
||||
getIntegralCategory,
|
||||
collectIntegralGoods,
|
||||
getIntegralBanner,
|
||||
|
||||
// 订单
|
||||
createIntegralOrder,
|
||||
getIntegralOrderList,
|
||||
getIntegralOrderDetail,
|
||||
cancelIntegralOrder,
|
||||
confirmIntegralOrder,
|
||||
deleteIntegralOrder,
|
||||
getIntegralOrderExpress,
|
||||
|
||||
// 购物车
|
||||
addIntegralCart,
|
||||
getIntegralCartList,
|
||||
updateIntegralCart,
|
||||
deleteIntegralCart,
|
||||
updateIntegralCartSelected,
|
||||
|
||||
// 积分
|
||||
getPointsBalance,
|
||||
getPointsRules,
|
||||
signIn,
|
||||
getSignInfo,
|
||||
|
||||
// 统计
|
||||
getIntegralIndex,
|
||||
getIntegralOrderCount
|
||||
};
|
||||
|
||||
563
single_uniapp22miao/api/miao.js
Normal file
563
single_uniapp22miao/api/miao.js
Normal file
@@ -0,0 +1,563 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | 单店商城API接口
|
||||
// +----------------------------------------------------------------------
|
||||
// | 创建时间: 2025-11-08
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
import request from "@/utils/request.js";
|
||||
import { HTTP_REQUEST_URL } from '@/config/app.js'
|
||||
|
||||
// ==================== 一、用户认证模块 ====================
|
||||
|
||||
/**
|
||||
* 用户登录
|
||||
* @param {Object} data - {account: 手机号, password: 密码}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function userLogin(data) {
|
||||
return request.post('user/login', data, { noAuth: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户注册
|
||||
* @param {Object} data - {mobile: 手机号, code: 验证码, password: 密码, invite_code: 邀请码(选填)}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function userRegister(data) {
|
||||
return request.post('user/register', data, { noAuth: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function userInfo() {
|
||||
return request.post('user/info');
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户昵称
|
||||
* @param {Object} data - {nickname: 昵称}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function updateNickname(data) {
|
||||
return request.post('user/nickname', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改密码
|
||||
* @param {Object} data - {old_password: 原密码, new_password: 新密码, code: 验证码}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function changePassword(data) {
|
||||
return request.post('user/changepwd', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置密码
|
||||
* @param {Object} data - {mobile: 手机号, code: 验证码, password: 新密码}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function resetPassword(data) {
|
||||
return request.post('user/resetpwd', data, { noAuth: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传用户头像
|
||||
* @param {Object} data - {file: 头像文件}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function uploadAvatar(data) {
|
||||
return request.post('user/avatar', data);
|
||||
}
|
||||
|
||||
// ==================== 二、商品模块 ====================
|
||||
|
||||
/**
|
||||
* 获取商品分类列表
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getGoodsCategory() {
|
||||
return request.get('goods/category', {}, { noAuth: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品列表
|
||||
* @param {Object} params - {page: 页码, limit: 每页数量, category_id: 分类ID, keyword: 关键词}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getGoodsList(params) {
|
||||
return request.get('goods/list', params, { noAuth: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品详情
|
||||
* @param {Number} id - 商品ID
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getGoodsDetail(id) {
|
||||
return request.get('goods/detail', { id }, { noAuth: true });
|
||||
}
|
||||
|
||||
// ==================== 三、订单模块 ====================
|
||||
|
||||
/**
|
||||
* 获取订单首页数据(营业时间等)
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getOrderIndex() {
|
||||
return request.post('order/index');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取可购买商品列表(抢购列表)
|
||||
* @param {Object} params - {page: 页码, limit: 每页数量, type: 类型(1:可购买 0:全部)}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getOrderGoods(params) {
|
||||
return request.get('order/goods', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 购买商品(抢单)
|
||||
* @param {Object} data - {id: 寄卖商品ID, seller_id: 卖家用户ID}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function buyGoods(data) {
|
||||
return request.post('order/buy', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单列表
|
||||
* @param {Object} params - {page: 页码, limit: 每页数量, cate: 类型(1:买方仓库 2:卖方仓库), type: 状态(1:寄卖中/交易中 2:已完成)}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getOrderList(params) {
|
||||
return request.get('order/list', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单详情
|
||||
* @param {Number} order_id - 订单ID
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getOrderDetail(order_id) {
|
||||
return request.get('order/detail', { order_id });
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付订单
|
||||
* @param {Object} data - {id: 订单ID}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function payOrder(data) {
|
||||
return request.post('order/pay', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认订单(卖家发货)
|
||||
* @param {Object} data - {id: 订单ID}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function confirmOrder(data) {
|
||||
return request.post('order/confirm', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消订单
|
||||
* @param {Object} data - {id: 订单ID}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function cancelOrder(data) {
|
||||
return request.post('order/cancel', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转卖订单
|
||||
* @param {Object} data - {id: 订单ID}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function resellOrder(data) {
|
||||
return request.post('order/resell', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单统计数量
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getOrderCount() {
|
||||
return request.get('order/count');
|
||||
}
|
||||
|
||||
// ==================== 四、地址管理模块 ====================
|
||||
|
||||
/**
|
||||
* 获取地址列表
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getAddressList() {
|
||||
return request.get('address/list');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取默认地址
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getDefaultAddress() {
|
||||
return request.post('address/default');
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增地址
|
||||
* @param {Object} data - {name: 姓名, mobile: 手机号, province: 省, city: 市, district: 区, detail: 详细地址, is_default: 是否默认}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function addAddress(data) {
|
||||
return request.post('address/insert', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新地址
|
||||
* @param {Object} data - {id: 地址ID, name, mobile, province, city, district, detail, is_default}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function updateAddress(data) {
|
||||
return request.post('address/update', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除地址
|
||||
* @param {Object} data - {id: 地址ID}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function deleteAddress(data) {
|
||||
return request.post('address/delete', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取地址详情
|
||||
* @param {Number} id - 地址ID
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getAddressDetail(id) {
|
||||
return request.get('address/detail', { id });
|
||||
}
|
||||
|
||||
// ==================== 五、财务模块 ====================
|
||||
|
||||
/**
|
||||
* 获取财务记录列表
|
||||
* @param {Object} params - {page: 页码, limit: 每页数量, cate: 类型(1:分红 2:优惠券 3:推广), type: 收支(1:收入 2:支出)}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getMoneyList(params) {
|
||||
return request.get('money/list', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取提现记录
|
||||
* @param {Object} params - {page: 页码, limit: 每页数量}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getWithdrawLog(params) {
|
||||
return request.get('money/log', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请提现
|
||||
* @param {Object} data - {amount: 金额, type: 方式(1:支付宝 2:银行卡)}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function applyWithdraw(data) {
|
||||
return request.post('money/withdraw', data);
|
||||
}
|
||||
|
||||
// ==================== 六、支付方式模块 ====================
|
||||
|
||||
/**
|
||||
* 获取支付宝信息
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getAlipayInfo() {
|
||||
return request.get('alipay/index');
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定支付宝
|
||||
* @param {Object} data - {account: 支付宝账号, real_name: 真实姓名}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function bindAlipay(data) {
|
||||
return request.post('alipay/bind', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取银行卡信息
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getBankInfo() {
|
||||
return request.get('bank/index');
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定银行卡
|
||||
* @param {Object} data - {bank_name: 银行名称, card_no: 卡号, real_name: 真实姓名, bank_branch: 开户支行}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function bindBank(data) {
|
||||
return request.post('bank/bind', data);
|
||||
}
|
||||
|
||||
// ==================== 七、分享推广模块 ====================
|
||||
|
||||
/**
|
||||
* 获取分享首页数据(邀请码、统计等)
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getShareIndex() {
|
||||
return request.get('share/index');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取我的粉丝列表
|
||||
* @param {Object} params - {page: 页码, limit: 每页数量, level: 等级(1,2,3)}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getFansList(params) {
|
||||
return request.get('share/select', params);
|
||||
}
|
||||
|
||||
// ==================== 八、首页模块 ====================
|
||||
|
||||
/**
|
||||
* 获取轮播图
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getBannerList() {
|
||||
return request.get('index/banner', {}, { noAuth: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取首页配置数据
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getIndexConfig() {
|
||||
return request.post('index/get', {}, { noAuth: true });
|
||||
}
|
||||
|
||||
// ==================== 九、短信模块 ====================
|
||||
|
||||
/**
|
||||
* 发送短信验证码
|
||||
* @param {Object} data - {mobile: 手机号, event: 事件类型(register/resetpwd/changepwd)}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function sendSms(data) {
|
||||
return request.post('sms/send', data, { noAuth: true });
|
||||
}
|
||||
|
||||
// ==================== 十、设置模块 ====================
|
||||
|
||||
/**
|
||||
* 获取协议内容
|
||||
* @param {Object} params - {type: 类型(user/privacy/sale)}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getAgreement(params) {
|
||||
return request.get('setting/agreement', params, { noAuth: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取系统配置
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getSetting() {
|
||||
return request.get('setting/index', {}, { noAuth: true });
|
||||
}
|
||||
|
||||
// ==================== 十一、合同模块 ====================
|
||||
|
||||
/**
|
||||
* 获取合同列表
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getContractList() {
|
||||
return request.get('contract/list');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取合同详情
|
||||
* @param {Number} id - 合同ID
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getContractDetail(id) {
|
||||
return request.get('contract/detail', { id });
|
||||
}
|
||||
|
||||
// ==================== 十二、奖品模块 ====================
|
||||
|
||||
/**
|
||||
* 获取奖品列表
|
||||
* @param {Object} params - {page: 页码, limit: 每页数量}
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getPrizeList(params) {
|
||||
return request.get('prize/list', params);
|
||||
}
|
||||
|
||||
// ==================== 十三、签名回调 ====================
|
||||
|
||||
/**
|
||||
* 签名回调
|
||||
* @param {Object} data - 签名数据
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function signNotify(data) {
|
||||
return request.post('notify/sign', data, { noAuth: true });
|
||||
}
|
||||
|
||||
// ==================== 辅助函数 ====================
|
||||
|
||||
/**
|
||||
* 通用上传文件
|
||||
* @param {String} filePath - 文件路径
|
||||
* @param {String} uploadUrl - 上传接口(可选,默认 upload/image)
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function uploadFile(filePath, uploadUrl = 'upload/image') {
|
||||
return new Promise((resolve, reject) => {
|
||||
const token = uni.getStorageSync('token');
|
||||
|
||||
uni.uploadFile({
|
||||
url: request.baseUrl + uploadUrl,
|
||||
filePath: filePath,
|
||||
name: 'file',
|
||||
header: {
|
||||
'Authori-zation': 'Bearer ' + token
|
||||
},
|
||||
success: (uploadRes) => {
|
||||
try {
|
||||
const data = JSON.parse(uploadRes.data);
|
||||
if (data.code === 0) {
|
||||
resolve(data);
|
||||
} else {
|
||||
reject(data);
|
||||
}
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export function uploadUserImage(filePath, pid, model = 'user') {
|
||||
return new Promise((resolve, reject) => {
|
||||
const token = uni.getStorageSync('token');
|
||||
uni.uploadFile({
|
||||
url: HTTP_REQUEST_URL + '/api/front/wa/user/image',
|
||||
filePath,
|
||||
name: 'multipart',
|
||||
header: {
|
||||
'Authori-zation': 'Bearer ' + token
|
||||
},
|
||||
formData: {
|
||||
model,
|
||||
pid
|
||||
},
|
||||
success: (res) => {
|
||||
try {
|
||||
const data = JSON.parse(res.data)
|
||||
if (data.code === 0) resolve(data)
|
||||
else reject(data)
|
||||
} catch (e) {
|
||||
reject(e)
|
||||
}
|
||||
},
|
||||
fail: (err) => reject(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导出所有API(兼容旧代码)
|
||||
*/
|
||||
export default {
|
||||
// 用户认证
|
||||
userLogin,
|
||||
userRegister,
|
||||
userInfo,
|
||||
updateNickname,
|
||||
changePassword,
|
||||
resetPassword,
|
||||
uploadAvatar,
|
||||
|
||||
// 商品
|
||||
getGoodsCategory,
|
||||
getGoodsList,
|
||||
getGoodsDetail,
|
||||
|
||||
// 订单
|
||||
getOrderIndex,
|
||||
getOrderGoods,
|
||||
buyGoods,
|
||||
getOrderList,
|
||||
getOrderDetail,
|
||||
payOrder,
|
||||
confirmOrder,
|
||||
cancelOrder,
|
||||
resellOrder,
|
||||
getOrderCount,
|
||||
|
||||
// 地址
|
||||
getAddressList,
|
||||
getDefaultAddress,
|
||||
addAddress,
|
||||
updateAddress,
|
||||
deleteAddress,
|
||||
getAddressDetail,
|
||||
|
||||
// 财务
|
||||
getMoneyList,
|
||||
getWithdrawLog,
|
||||
applyWithdraw,
|
||||
|
||||
// 支付方式
|
||||
getAlipayInfo,
|
||||
bindAlipay,
|
||||
getBankInfo,
|
||||
bindBank,
|
||||
|
||||
// 分享推广
|
||||
getShareIndex,
|
||||
getFansList,
|
||||
|
||||
// 首页
|
||||
getBannerList,
|
||||
getIndexConfig,
|
||||
|
||||
// 短信
|
||||
sendSms,
|
||||
|
||||
// 设置
|
||||
getAgreement,
|
||||
getSetting,
|
||||
|
||||
// 合同
|
||||
getContractList,
|
||||
getContractDetail,
|
||||
|
||||
// 奖品
|
||||
getPrizeList,
|
||||
|
||||
// 签名
|
||||
signNotify,
|
||||
|
||||
// 工具
|
||||
uploadFile,
|
||||
uploadUserImage
|
||||
};
|
||||
|
||||
270
single_uniapp22miao/api/order.js
Normal file
270
single_uniapp22miao/api/order.js
Normal file
@@ -0,0 +1,270 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// |
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
|
||||
import request from "@/utils/request.js";
|
||||
|
||||
/**
|
||||
* 获取购物车列表
|
||||
* @param numType boolean true 购物车数量,false=购物车产品数量
|
||||
*/
|
||||
export function getCartCounts(numType,type) {
|
||||
return request.get("cart/count?numType=" + numType + "&type=" + type);
|
||||
}
|
||||
/**
|
||||
* 获取购物车列表
|
||||
*
|
||||
*/
|
||||
export function getCartList(data) {
|
||||
return request.get("cart/list", data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改购物车数量
|
||||
* @param int cartId 购物车id
|
||||
* @param int number 修改数量
|
||||
*/
|
||||
export function changeCartNum(cartId, number, opt = {}) {
|
||||
return request.post(`cart/num?id=${cartId}&number=${number}`, {}, opt, 1);
|
||||
}
|
||||
/**
|
||||
* 清除购物车
|
||||
* @param object ids join(',') 切割成字符串
|
||||
*/
|
||||
export function cartDel(ids, opt = {}) {
|
||||
if (typeof ids === 'object')
|
||||
ids = ids.join(',');
|
||||
return request.post(`cart/delete?ids=${ids}`, {}, opt, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 购物车重选提交
|
||||
*
|
||||
*/
|
||||
export function getResetCart(data) {
|
||||
return request.post('cart/resetcart', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单列表
|
||||
* @param object data
|
||||
*/
|
||||
export function getOrderList(data) {
|
||||
return request.get('order/list', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单产品信息
|
||||
* @param string unique
|
||||
*/
|
||||
export function orderProduct(data) {
|
||||
return request.post('order/product', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单评价
|
||||
* @param object data
|
||||
*
|
||||
*/
|
||||
export function orderComment(data) {
|
||||
return request.post('order/comment', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单支付
|
||||
* @param object data
|
||||
*/
|
||||
export function orderPay(data) {
|
||||
return request.post('pay/payment', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单统计数据
|
||||
*/
|
||||
export function orderData() {
|
||||
return request.get('order/data')
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单取消
|
||||
* @param string id
|
||||
*
|
||||
*/
|
||||
export function orderCancel(id) {
|
||||
return request.post('order/cancel', {
|
||||
id: id
|
||||
}, {}, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除已完成订单
|
||||
* @param string uni
|
||||
*
|
||||
*/
|
||||
export function orderDel(uni) {
|
||||
return request.post('order/del', {
|
||||
id: uni
|
||||
}, {}, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单详情
|
||||
* @param string uni
|
||||
*/
|
||||
export function getOrderDetail(uni) {
|
||||
return request.get('order/detail/' + uni);
|
||||
}
|
||||
|
||||
/**
|
||||
* 再次下单
|
||||
* @param string uni
|
||||
*
|
||||
*/
|
||||
export function orderAgain(uni) {
|
||||
return request.post('order/again', {
|
||||
orderNo: uni
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单收货
|
||||
* @param string uni
|
||||
*
|
||||
*/
|
||||
export function orderTake(uni) {
|
||||
return request.post('order/take', {
|
||||
id: uni
|
||||
}, {}, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单查询物流信息
|
||||
* @returns {*}
|
||||
*/
|
||||
export function express(uni) {
|
||||
return request.get("order/express/" + uni);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取退款理由
|
||||
*
|
||||
*/
|
||||
export function ordeRefundReason() {
|
||||
return request.get('order/refund/reason');
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单退款审核
|
||||
* @param object data
|
||||
*/
|
||||
export function orderRefundVerify(data) {
|
||||
return request.post('order/refund', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单确认获取订单详细信息
|
||||
* @param string cartId
|
||||
*/
|
||||
export function orderConfirm(cartId, isNew, addAgain,secKill,combination,bargain) {
|
||||
return request.post('order/confirm', {
|
||||
cartIds: cartId,
|
||||
isNew: isNew,
|
||||
addAgain: addAgain,
|
||||
secKill: secKill,
|
||||
combination:combination,
|
||||
bargain:bargain
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前金额能使用的优惠卷
|
||||
* @param string price
|
||||
*
|
||||
*/
|
||||
export function getCouponsOrderPrice(preOrderNo) {
|
||||
return request.get(`coupons/order/${preOrderNo}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单创建
|
||||
* @param string key
|
||||
* @param object data
|
||||
*
|
||||
*/
|
||||
export function orderCreate(data) {
|
||||
return request.post('order/create', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算订单金额
|
||||
* @param key
|
||||
* @param data
|
||||
* @returns {*}
|
||||
*/
|
||||
export function postOrderComputed(data) {
|
||||
return request.post("order/computed/price", data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将字符串 转base64
|
||||
* @param object data
|
||||
*/
|
||||
export function qrcodeApi(data) {
|
||||
return request.post('qrcode/str2base64', data, {}, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信查询支付结果
|
||||
* @param object data
|
||||
*/
|
||||
export function wechatQueryPayResult(data) {
|
||||
return request.get('pay/queryPayResult?orderNo=' + data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付宝查询支付结果
|
||||
* @param object data
|
||||
*/
|
||||
export function alipayQueryPayResult(data) {
|
||||
return request.get('pay/queryAliPayResult?orderNo=' + data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请退款商品详情
|
||||
* @param object data
|
||||
*/
|
||||
export function applyRefund(orderId) {
|
||||
return request.get(`order/apply/refund/${orderId}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 预下单
|
||||
* @param object data
|
||||
*/
|
||||
export function preOrderApi(data) {
|
||||
return request.post(`order/pre/order`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载预下单
|
||||
* @param object preOrderNo
|
||||
*/
|
||||
export function loadPreOrderApi(preOrderNo) {
|
||||
return request.get(`order/load/pre/${preOrderNo}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取支付配置
|
||||
* @param object preOrderNo
|
||||
*/
|
||||
export function getPayConfig(preOrderNo) {
|
||||
return request.get(`order/get/pay/config`);
|
||||
}
|
||||
/**
|
||||
* 获取支付配置
|
||||
*
|
||||
*/
|
||||
export function getOrderPayConfig() {
|
||||
return request.get(`pay/get/config`);
|
||||
}
|
||||
119
single_uniapp22miao/api/public.js
Normal file
119
single_uniapp22miao/api/public.js
Normal file
@@ -0,0 +1,119 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
|
||||
import request from "@/utils/request.js";
|
||||
import wechat from "@/libs/wechat.js";
|
||||
import {
|
||||
toLogin,
|
||||
checkLogin
|
||||
} from '../libs/login';
|
||||
/**
|
||||
* 获取微信公众号js配置
|
||||
* @returns {*}
|
||||
*/
|
||||
export function getWechatConfig() {
|
||||
return request.get("wechat/config",{ url: encodeURIComponent(wechat.signLink()) },{ noAuth: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取微信sdk配置
|
||||
* @returns {*}
|
||||
*/
|
||||
export function wechatAuth(code, spread) {
|
||||
var reg=/^[0-9]+.?[0-9]*$/; //判断字符串是否为数字 ,判断正整数用/^[1-9]+[0-9]*]*$/
|
||||
spread = reg.test(spread) ? spread : 0;
|
||||
return request.get(
|
||||
"wechat/authorize/login?code=" + code + "&spread_spid=" + spread, {},
|
||||
{ noAuth: true }
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取登录授权login
|
||||
*
|
||||
*/
|
||||
export function getLogo()
|
||||
{
|
||||
// wechat/get_logo
|
||||
return request.get('wechat/getLogo', {}, { noAuth : true});
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序用户登录
|
||||
* @param data object 小程序用户登录信息
|
||||
*/
|
||||
export function login(code,data) {
|
||||
return request.post("wechat/authorize/program/login?code="+code, data, { noAuth : true });
|
||||
}
|
||||
/**
|
||||
* 分享
|
||||
* @returns {*}
|
||||
*/
|
||||
export function getShare() {
|
||||
return request.get("share", {}, { noAuth: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取关注海报
|
||||
* @returns {*}
|
||||
*/
|
||||
export function follow() {
|
||||
return request.get("wechat/follow", {}, { noAuth: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取图片base64
|
||||
* @retins {*}
|
||||
* */
|
||||
export function imageBase64(image) {
|
||||
return request.post("qrcode/base64",image,{ noAuth: true },1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动复制口令功能
|
||||
* @returns {*}
|
||||
*/
|
||||
export function copyWords() {
|
||||
return request.get("copy_words", {}, { noAuth: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信(公众号,小程序)绑定手机号
|
||||
* @param {Object} data
|
||||
*/
|
||||
export function getUserPhone(data){
|
||||
return request.post('wechat/register/binding/phone',data,{noAuth : true});
|
||||
}
|
||||
|
||||
/**
|
||||
* APP微信登录
|
||||
* @param {Object} data
|
||||
*/
|
||||
export function appAuth(data) {
|
||||
return request.post("wechat/authorize/app/login", data, { noAuth : true });
|
||||
}
|
||||
|
||||
/**
|
||||
* 苹果登录
|
||||
* @param {Object} data
|
||||
*/
|
||||
export function appleLogin(data) {
|
||||
return request.post("ios/login", data, { noAuth : true });
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 苹果绑定手机号
|
||||
* @param {Object} data
|
||||
*/
|
||||
export function iosBinding(data) {
|
||||
return request.post("ios/binding/phone", data, { noAuth : true });
|
||||
}
|
||||
231
single_uniapp22miao/api/store.js
Normal file
231
single_uniapp22miao/api/store.js
Normal file
@@ -0,0 +1,231 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
|
||||
import request from "@/utils/request.js";
|
||||
|
||||
/**
|
||||
* 获取产品详情
|
||||
* @param int id
|
||||
*
|
||||
*/
|
||||
export function getProductDetail(id, type) {
|
||||
return request.get('product/detail/' + id + '?type=' + type, {}, {
|
||||
noAuth: true
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 产品分享二维码 推广员
|
||||
* @param int id
|
||||
*/
|
||||
// #ifndef MP
|
||||
export function getProductCode(id) {
|
||||
return request.get('product/code/' + id, {});
|
||||
}
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
export function getProductCode(id) {
|
||||
return request.get('product/code/' + id, {
|
||||
user_type: 'routine'
|
||||
});
|
||||
}
|
||||
// #endif
|
||||
|
||||
/**
|
||||
* 添加收藏
|
||||
* @param int id
|
||||
* @param string category product=普通产品,product_seckill=秒杀产品
|
||||
*/
|
||||
export function collectAdd(id, category) {
|
||||
return request.post('collect/add', {
|
||||
id: id,
|
||||
'category': category === undefined ? 'product' : category
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消收藏产品
|
||||
* @param int id
|
||||
*/
|
||||
export function collectDel(proId) {
|
||||
return request.post(`collect/cancel/${proId}`);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除收藏产品
|
||||
* @param string id
|
||||
*/
|
||||
export function collectDelete(ids) {
|
||||
return request.post(`collect/delete`,ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 购车添加
|
||||
*
|
||||
*/
|
||||
export function postCartAdd(data) {
|
||||
return request.post('cart/save', data, {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分类列表
|
||||
*
|
||||
*/
|
||||
export function getCategoryList() {
|
||||
return request.get('category', {}, {
|
||||
noAuth: true
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取产品列表
|
||||
* @param object data
|
||||
*/
|
||||
export function getProductslist(data) {
|
||||
return request.get('products', data, {
|
||||
noAuth: true
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品列表(个别分类模型使用)
|
||||
* @param object data
|
||||
*/
|
||||
export function productList(data) {
|
||||
return request.get('product/list', data, {
|
||||
noAuth: true
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取推荐产品
|
||||
*
|
||||
*/
|
||||
export function getProductHot(page, limit) {
|
||||
return request.get("product/hot", {
|
||||
page: page === undefined ? 1 : page,
|
||||
limit: limit === undefined ? 4 : limit
|
||||
}, {
|
||||
noAuth: true
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 批量收藏
|
||||
*
|
||||
* @param object id 产品编号 join(',') 切割成字符串
|
||||
* @param string category
|
||||
*/
|
||||
export function collectAll(id, category) {
|
||||
return request.post('collect/all', {
|
||||
id: id,
|
||||
category: category === undefined ? 'product' : category
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页产品的轮播图和产品信息
|
||||
* @param int type
|
||||
*
|
||||
*/
|
||||
export function getGroomList(type, data) {
|
||||
return request.get('index/product/' + type, data, {
|
||||
noAuth: true
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取收藏列表
|
||||
* @param object data
|
||||
*/
|
||||
export function getCollectUserList(data) {
|
||||
return request.get('collect/user', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取产品评论
|
||||
* @param int id
|
||||
* @param object data
|
||||
*
|
||||
*/
|
||||
export function getReplyList(id, data) {
|
||||
return request.get('reply/list/' + id, data,{
|
||||
noAuth: true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 产品评价数量和好评度
|
||||
* @param int id
|
||||
*/
|
||||
export function getReplyConfig(id) {
|
||||
return request.get('reply/config/' + id,{},{
|
||||
noAuth: true
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取搜索关键字获取
|
||||
*
|
||||
*/
|
||||
export function getSearchKeyword() {
|
||||
return request.get('search/keyword', {}, {
|
||||
noAuth: true
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 门店列表
|
||||
* @returns {*}
|
||||
*/
|
||||
export function storeListApi(data) {
|
||||
return request.post("store/list", data, {}, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 优品推荐
|
||||
* @param object data
|
||||
*/
|
||||
export function getProductGood() {
|
||||
return request.get('product/good',{},{
|
||||
noAuth: true
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情页产品评论
|
||||
* @param int id
|
||||
* @param object data
|
||||
*
|
||||
*/
|
||||
export function getReplyProduct(id) {
|
||||
return request.get('reply/product/' + id,{}, {
|
||||
noAuth: true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品的sku
|
||||
* @returns {*}
|
||||
*/
|
||||
export function getAttr(id) {
|
||||
return request.get("product/sku/detail/" + id);
|
||||
}
|
||||
/**
|
||||
* 根据商品id集合查询对应商品
|
||||
* @param {string} ids
|
||||
*/
|
||||
export function productByidsApi(ids) {
|
||||
return request.get(`product/byids/${ids}`,{}, {
|
||||
noAuth: true
|
||||
});
|
||||
}
|
||||
536
single_uniapp22miao/api/user.js
Normal file
536
single_uniapp22miao/api/user.js
Normal file
@@ -0,0 +1,536 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
import request from "@/utils/request.js";
|
||||
import Cache from "@/utils/cache.js"
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
*
|
||||
*/
|
||||
export function getUserInfo(){
|
||||
return request.get('user');
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置用户分享
|
||||
*
|
||||
*/
|
||||
export function userShare(){
|
||||
return request.post('user/share');
|
||||
}
|
||||
|
||||
/**
|
||||
* h5用户登录
|
||||
* @param data object 用户账号密码
|
||||
*/
|
||||
export function loginH5(data) {
|
||||
return request.post("loginV2", data, { noAuth : true });
|
||||
}
|
||||
|
||||
/**
|
||||
* h5用户无密码登录
|
||||
* @param data object 用户账号密码
|
||||
*/
|
||||
export function loginV2(data) {
|
||||
return request.post("loginV2", data, { noAuth : true });
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* h5用户手机号登录
|
||||
* @param data object 用户手机号 也只能
|
||||
*/
|
||||
export function loginMobile(data) {
|
||||
return request.post("login/mobile", data, { noAuth : true });
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证码key
|
||||
*/
|
||||
export function getCodeApi() {
|
||||
return request.get("verify_code", {}, { noAuth: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* h5用户发送验证码
|
||||
* @param data object 用户手机号
|
||||
*/
|
||||
export function registerVerify(phone){
|
||||
return request.post('sendCode', { phone: phone },{noAuth:true},1)
|
||||
}
|
||||
|
||||
/**
|
||||
* h5用户手机号注册
|
||||
* @param data object 用户手机号 验证码 密码
|
||||
*/
|
||||
export function register(data) {
|
||||
return request.post("register", data, { noAuth : true });
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户手机号修改密码
|
||||
* @param data object 用户手机号 验证码 密码
|
||||
*/
|
||||
export function registerReset(data) {
|
||||
return request.post("register/reset", data, { noAuth: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户中心菜单
|
||||
*
|
||||
*/
|
||||
export function getMenuList() {
|
||||
return request.get("menu/user");
|
||||
}
|
||||
|
||||
/*
|
||||
* 签到用户信息
|
||||
* */
|
||||
export function postSignUser(sign) {
|
||||
return request.post("user/sign/user", sign);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取签到配置
|
||||
*
|
||||
*/
|
||||
export function getSignConfig(){
|
||||
return request.get('user/sign/config')
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取签到列表
|
||||
* @param object data
|
||||
*/
|
||||
export function getSignList(data){
|
||||
return request.get('user/sign/list',data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户签到
|
||||
*/
|
||||
export function setSignIntegral(){
|
||||
return request.get('user/sign/integral')
|
||||
}
|
||||
|
||||
/**
|
||||
* 签到列表(年月)
|
||||
* @param object data
|
||||
*
|
||||
*/
|
||||
export function getSignMonthList(data){
|
||||
return request.get('user/sign/month',data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 活动状态
|
||||
*
|
||||
*/
|
||||
export function userActivity(){
|
||||
return request.get('user/activity');
|
||||
}
|
||||
|
||||
/*
|
||||
* 余额明细(types|2=全部,1=支出,2=收入)
|
||||
* */
|
||||
export function getCommissionInfo(data) {
|
||||
return request.get("spread/commission/detail", data);
|
||||
}
|
||||
|
||||
/*
|
||||
* 提现记录 getCountApi
|
||||
* */
|
||||
export function getRecordApi(q) {
|
||||
return request.get("extract/record", q);
|
||||
}
|
||||
|
||||
/*
|
||||
* 提现总金额
|
||||
* */
|
||||
export function getCountApi() {
|
||||
return request.get("extract/totalMoney");
|
||||
}
|
||||
|
||||
/*
|
||||
* 积分记录
|
||||
* */
|
||||
export function getIntegralList(q) {
|
||||
return request.get("integral/list", q);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分销海报图片
|
||||
*
|
||||
*/
|
||||
export function spreadBanner(data){
|
||||
return request.get('user/spread/banner',data);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 获取推广用户一级和二级
|
||||
* @param object data
|
||||
*/
|
||||
export function spreadPeople(data){
|
||||
return request.get('spread/people',data);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 推广佣金/提现总和
|
||||
* @param int type
|
||||
*/
|
||||
export function spreadCount(type){
|
||||
return request.get('spread/count/'+type);
|
||||
}
|
||||
|
||||
/*
|
||||
* 推广数据 当前佣金 提现总金额
|
||||
* */
|
||||
export function getSpreadInfo() {
|
||||
return request.get("commission");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 推广订单
|
||||
* @param object data
|
||||
*/
|
||||
export function spreadOrder(data){
|
||||
return request.get('spread/order',data);
|
||||
}
|
||||
|
||||
/*
|
||||
* 获取推广人排行
|
||||
* */
|
||||
export function getRankList(q) {
|
||||
return request.get("rank", q);
|
||||
}
|
||||
|
||||
/*
|
||||
* 获取佣金排名
|
||||
* */
|
||||
export function getBrokerageRank(q) {
|
||||
return request.get("brokerage_rank", q);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提现申请
|
||||
* @param object data
|
||||
*/
|
||||
export function extractCash(data){
|
||||
return request.post('extract/cash',data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 提现银行/提现最低金额
|
||||
*
|
||||
*/
|
||||
export function extractBank(){
|
||||
return request.get('extract/bank');
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员等级列表
|
||||
*
|
||||
*/
|
||||
export function userLevelGrade(){
|
||||
return request.get('user/level/grade');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取某个等级任务
|
||||
* @param int id 任务id
|
||||
*/
|
||||
export function userLevelTask(id){
|
||||
return request.get('user/level/task/'+id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查用户是否可以成为会员
|
||||
*
|
||||
*/
|
||||
export function userLevelDetection(){
|
||||
return request.get('user/level/detection');
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 地址列表
|
||||
* @param object data
|
||||
*/
|
||||
export function getAddressList(data){
|
||||
return request.get('address/list',data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置默认地址
|
||||
* @param int id
|
||||
*/
|
||||
export function setAddressDefault(id){
|
||||
return request.post('address/default/set',{id:id})
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改 添加地址
|
||||
* @param object data
|
||||
*/
|
||||
export function editAddress(data){
|
||||
return request.post('address/edit',data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除地址
|
||||
* @param int id
|
||||
*
|
||||
*/
|
||||
export function delAddress(id){
|
||||
return request.post('address/del',{id:id})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单个地址
|
||||
* @param int id
|
||||
*/
|
||||
export function getAddressDetail(id){
|
||||
return request.get('address/detail/'+id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户信息
|
||||
* @param object
|
||||
*/
|
||||
export function userEdit(data){
|
||||
return request.post('user/edit',data);
|
||||
}
|
||||
|
||||
/*
|
||||
* 退出登录
|
||||
* */
|
||||
export function getLogout() {
|
||||
return request.get("logout");
|
||||
}
|
||||
/**
|
||||
* 小程序充值
|
||||
*
|
||||
*/
|
||||
export function rechargeRoutine(data){
|
||||
return request.post('recharge/routine',data)
|
||||
}
|
||||
/*
|
||||
* 公众号充值
|
||||
* */
|
||||
export function rechargeWechat(data) {
|
||||
return request.post("recharge/wechat", data);
|
||||
}
|
||||
|
||||
/*
|
||||
* app微信充值
|
||||
* */
|
||||
export function appWechat(data) {
|
||||
return request.post("recharge/wechat/app", data);
|
||||
}
|
||||
|
||||
/*
|
||||
* 余额充值
|
||||
* */
|
||||
export function transferIn(data) {
|
||||
return request.post("recharge/transferIn", data,{},1);
|
||||
}
|
||||
|
||||
/*
|
||||
* 支付宝充值
|
||||
* */
|
||||
export function alipayFull(data) {
|
||||
return request.post("recharge/alipay", data,{});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取默认地址
|
||||
*
|
||||
*/
|
||||
export function getAddressDefault(){
|
||||
return request.get('address/default');
|
||||
}
|
||||
|
||||
/**
|
||||
* 充值金额选择
|
||||
*/
|
||||
export function getRechargeApi() {
|
||||
return request.get("recharge/index");
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录记录
|
||||
*/
|
||||
export function setVisit(data)
|
||||
{
|
||||
return request.post('user/set_visit', {...data}, { noAuth:true});
|
||||
}
|
||||
|
||||
/**
|
||||
* 客服列表
|
||||
*/
|
||||
export function serviceList() {
|
||||
return request.get("user/service/lst");
|
||||
}
|
||||
/**
|
||||
* 客服详情
|
||||
*/
|
||||
export function getChatRecord(to_uid, data) {
|
||||
return request.get("user/service/record/" + to_uid, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 静默绑定推广人
|
||||
* @param {Object} puid
|
||||
*/
|
||||
export function spread(puid)
|
||||
{
|
||||
return request.get("user/bindSpread?spreadPid="+ puid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前用户在佣金排行第几名
|
||||
*
|
||||
*/
|
||||
export function brokerageRankNumber(data)
|
||||
{
|
||||
return request.get("user/brokerageRankNumber",data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员等级经验值;
|
||||
*
|
||||
*/
|
||||
export function getlevelInfo()
|
||||
{
|
||||
return request.get("user/level/grade");
|
||||
}
|
||||
|
||||
/**
|
||||
* 经验值明细;
|
||||
*
|
||||
*/
|
||||
export function getlevelExpList(data)
|
||||
{
|
||||
return request.get("user/expList",data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 经验值明细;
|
||||
*
|
||||
*/
|
||||
export function getuserDalance()
|
||||
{
|
||||
return request.get("user/balance");
|
||||
}
|
||||
|
||||
/*
|
||||
统计
|
||||
*
|
||||
*/
|
||||
export function computeUser(){
|
||||
uni.request({
|
||||
url: document.location.protocol + '//shop.crmeb.net/index.php/admin/server.upgrade_api/updatewebinfo',
|
||||
method:'POST',
|
||||
data: {
|
||||
host:window.location.host,
|
||||
https:document.location.protocol,
|
||||
version:'CRMEB-JAVA-SY-V2.0',
|
||||
ip:Cache.has('Ip') ? Cache.get('Ip') : ''
|
||||
},
|
||||
dataType:'json',
|
||||
success: (res) => {}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 账单记录;
|
||||
*
|
||||
*/
|
||||
export function getBillList(data)
|
||||
{
|
||||
return request.get("recharge/bill/record",data);
|
||||
}
|
||||
|
||||
/*
|
||||
* 积分中心详情
|
||||
* */
|
||||
export function postIntegralUser() {
|
||||
return request.get("integral/user");
|
||||
}
|
||||
|
||||
/*
|
||||
* 根据账户获取用户积分信息
|
||||
* */
|
||||
export function getIntegralUserByAccount(account) {
|
||||
return request.get("integral/user/account", { account: account }, { noAuth: true });
|
||||
}
|
||||
|
||||
/*
|
||||
* 立即提现 冻结期、冻结佣金、可提现佣金、最低可提现金额
|
||||
* */
|
||||
export function extractUser() {
|
||||
return request.get("extract/user");
|
||||
}
|
||||
|
||||
/*
|
||||
* 推广人统计页 推广人数(一级+二级)、一级人数、二级人数
|
||||
* */
|
||||
export function spreadPeoCount() {
|
||||
return request.get("spread/people/count");
|
||||
}
|
||||
|
||||
/**
|
||||
* 版权信息
|
||||
*/
|
||||
export function copyrightApi(){
|
||||
return request.get(`copyright/info`,{},{noAuth:true});
|
||||
}
|
||||
|
||||
/**
|
||||
* ========== 寄卖商城(WA)相关接口 ==========
|
||||
*/
|
||||
|
||||
/**
|
||||
* 获取寄卖商城用户信息
|
||||
* @param {Integer} userId 寄卖商城用户ID
|
||||
* @returns {Object} 用户信息 { id, nickname, mobile, selfBonus, money, score, shareBonus, coupon }
|
||||
*/
|
||||
export function getWaUserInfo(userId) {
|
||||
return request.post('wa/user/info', { userId: userId });
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取个人奖金记录列表
|
||||
* @param {Object} data { userId, type, page, limit }
|
||||
* - userId: 寄卖商城用户ID
|
||||
* - type: 记录类型 1=收入明细 2=支出明细
|
||||
* - page: 页码,默认1
|
||||
* - limit: 每页条数,默认20
|
||||
*/
|
||||
export function getWaSelfBonusList(data) {
|
||||
return request.get('wa/selfbonus/list', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 奖金兑换商品下单
|
||||
* @param {Object} data { userId, orderId, money, memo }
|
||||
* - userId: 寄卖商城用户ID
|
||||
* - orderId: 积分商城订单编号
|
||||
* - money: 兑换使用的奖金金额
|
||||
* - memo: 备注说明
|
||||
*/
|
||||
export function exchangeWaSelfBonus(data) {
|
||||
return request.post('wa/selfbonus/exchange', data);
|
||||
}
|
||||
Reference in New Issue
Block a user