248 lines
6.3 KiB
JavaScript
248 lines
6.3 KiB
JavaScript
import http from '../utils/http'
|
|
|
|
|
|
/**
|
|
* 登录/注册同一个接口
|
|
* @author Seven
|
|
* @data 2025-1-28
|
|
* @param number // 验证码
|
|
* @returns { }
|
|
* @see https://mall.gpxscs.cn/mobile/account/login/doMerchSmsRegisterAndLogin
|
|
*/
|
|
|
|
export function GetLogin (params){
|
|
params.isFilter = true
|
|
return new Promise((resolve, reject) => {
|
|
http({
|
|
url:'/account/login/doMerchSmsRegisterAndLogin',
|
|
method:'post',
|
|
data:params,
|
|
}).then(res=>{
|
|
resolve(res)
|
|
}).catch(e => reject(console.warn(e)))
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 获取验证码
|
|
* @author Seven
|
|
* @data 2025-1-6
|
|
* @returns { }
|
|
* @see https://mall.gpxscs.cn/mobile/account/login/sendVerifyCode
|
|
*/
|
|
|
|
export function GetSmsCode(params){
|
|
params.isFilter = true
|
|
return new Promise((resolve, reject) => {
|
|
http({
|
|
url:'/account/login/sendVerifyCode',
|
|
method:'post',
|
|
data:params,
|
|
}).then(res=>{
|
|
resolve(res)
|
|
}).catch(e => reject(console.warn(e)))
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 获取店铺分类
|
|
* @author Seven
|
|
* @date 2025-3-24
|
|
* @returns { }
|
|
* @see https://mall.gpxscs.cn/mobile/shop/store/biz-category/list
|
|
*/
|
|
export function GetStoreCategories() {
|
|
return new Promise((resolve, reject) => {
|
|
http({
|
|
url: 'shop/store/biz-category/list',
|
|
method: 'post'
|
|
}).then(res => {
|
|
resolve(res)
|
|
}).catch(e => reject(console.warn(e)))
|
|
})
|
|
}
|
|
/**
|
|
* 处理店铺分类数据,转换为 el-cascader 需要的格式
|
|
* @param {Array} data 原始店铺分类数据
|
|
* @returns {Array} 转换后的数据
|
|
*/
|
|
export function transformStoreCategories(data) {
|
|
return data.map(item => ({
|
|
value: item.id,
|
|
label: item.category_name,
|
|
children: item.children ? [
|
|
// 添加一个与一级目录同名的选项
|
|
{
|
|
value: item.id,
|
|
label: `${item.category_name} 分割比率(${item.split_ratio}%)`
|
|
},
|
|
...item.children.map(child => ({
|
|
value: child.id,
|
|
label: `${child.category_name} 分割比率(${child.split_ratio}%)`
|
|
}))
|
|
] : []
|
|
}));
|
|
}
|
|
|
|
export function GetPostion (params){
|
|
params.isFilter = true
|
|
return new Promise((resolve, reject) => {
|
|
http({
|
|
url:'/shop/merch/baidu/place/v2/suggestion',
|
|
method:'get',
|
|
params,
|
|
}).then(res=>{
|
|
resolve(res)
|
|
}).catch(e => reject(console.warn(e)))
|
|
})
|
|
}
|
|
export function GetBank (){
|
|
return new Promise((resolve, reject) => {
|
|
http({
|
|
url:'/shop/global/banks/list',
|
|
method:'post',
|
|
}).then(res=>{
|
|
resolve(res)
|
|
}).catch(e => reject(console.warn(e)))
|
|
})
|
|
}
|
|
|
|
export function merchApply(params){
|
|
return new Promise((resolve, reject) => {
|
|
const form={
|
|
bank_name: params.bank_name,
|
|
bank_branch_name: params.bank_branch_name,
|
|
account_number: params.account_number,
|
|
account_holder_name: params.account_holder_name,
|
|
biz_category: params.biz_category,
|
|
biz_license_company: params.biz_license_company,
|
|
biz_license_image: params.biz_license_image,
|
|
biz_license_number: params.biz_license_number,
|
|
biz_second_category: params.biz_second_category,
|
|
city_id: params.city_id,
|
|
contact_name: params.contact_name,
|
|
county_id: params.county_id,
|
|
entity_type: params.entity_type,
|
|
environment_image: params.environment_image,
|
|
front_facade_image: params.front_facade_image,
|
|
individual_id_images: params.individual_id_images,
|
|
individual_id_images2: params.individual_id_images2,
|
|
individual_id_number: params.individual_id_number,
|
|
legal_person_id_images: params.legal_person_id_images,
|
|
legal_person_id_images2: params.legal_person_id_images2,
|
|
legal_person_id_number: params.legal_person_id_number,
|
|
legal_person_mobile: params.legal_person_mobile,
|
|
legal_person_name: params.legal_person_name,
|
|
license_image: params.license_imageToString,
|
|
license_number: params.license_number,
|
|
license_type: params.license_type,
|
|
login_mobile: params.login_mobile,
|
|
province_id: params.province_id,
|
|
store_address: params.postion+params.store_address,
|
|
store_latitude: params.store_latitude,
|
|
store_longitude: params.store_longitude,
|
|
store_name: params.store_name,
|
|
}
|
|
console.log("这是数据",form);
|
|
http({
|
|
url:'/shop/merch/apply',
|
|
method:'post',
|
|
data:form
|
|
}).then(res=>{
|
|
resolve(res)
|
|
}).catch(e => reject(console.warn(e)))
|
|
})
|
|
}
|
|
|
|
//获取审核状态
|
|
export function getApproval_status(){
|
|
const phone={
|
|
mobile:localStorage.getItem("mobilePhone")
|
|
}
|
|
return new Promise((resolve,reject)=>{
|
|
http({
|
|
url:'/shop/merch/fresh/approval/status',
|
|
method:'post',
|
|
data:phone
|
|
}).then(res=>{
|
|
resolve(res)
|
|
}).catch(e => reject(console.warn(e)))
|
|
})
|
|
}
|
|
|
|
//重新审核
|
|
export function re_apply(params){
|
|
return new Promise((resolve,reject)=>{
|
|
http({
|
|
url:'/shop/merch/re-apply',
|
|
method:'post',
|
|
data:params
|
|
}).then(res=>{
|
|
resolve(res)
|
|
}).catch(e => reject(console.warn(e)))
|
|
})
|
|
}
|
|
|
|
|
|
/**
|
|
* 账号密码登录
|
|
* @author Seven
|
|
* @data 2025-1-6
|
|
* @returns { }
|
|
* @see https://mall.gpxscs.cn/api/admin/account/account-user-base/doLogin
|
|
*/
|
|
|
|
export function GetAccountLogin(params){
|
|
return new Promise((resolve, reject) => {
|
|
http({
|
|
url:'https://mall.gpxscs.cn/api/admin/account/account-user-base/doLogin',
|
|
method:'post',
|
|
params,
|
|
}).then(res=>{
|
|
resolve(res)
|
|
}).catch(e => reject(console.warn(e)))
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 获取图形验证码
|
|
* @author Seven
|
|
* @data 2025-1-6
|
|
* @returns { }
|
|
* @see https://mall.gpxscs.cn/api/admin/shop/shop-base-config/image
|
|
*/
|
|
|
|
export function GetVerifyCode(params){
|
|
return new Promise((resolve, reject) => {
|
|
http({
|
|
url:'https://mall.gpxscs.cn/api/admin/shop/shop-base-config/image',
|
|
method:'GET',
|
|
params,
|
|
}).then(res=>{
|
|
resolve(res)
|
|
}).catch(e => reject(console.warn(e)))
|
|
})
|
|
}
|
|
//获取入驻信息
|
|
export function GetMerchDetail(){
|
|
return new Promise((resolve,reject)=>{
|
|
http({
|
|
url:'/shop/merch/detail',
|
|
method:'post',
|
|
data:{mobile:localStorage.getItem('mobilePhone')}
|
|
}).then(res=>{
|
|
resolve(res)
|
|
}).catch(e=>reject(console.warn(e)))
|
|
})
|
|
}
|
|
|
|
export function GetAppDistrict(){
|
|
return new Promise((resolve,reject)=>{
|
|
http({
|
|
url:'shop/shop-base-district/getAppDistrict',
|
|
method:'get'
|
|
}).then(res=>{
|
|
resolve(res)
|
|
}).catch(e=>reject(console.warn(e)))
|
|
})
|
|
} |