This commit is contained in:
parent
368132d809
commit
5b326d7917
|
@ -4,11 +4,11 @@ VITE_NOW_TYPE = 'dist'
|
||||||
# VITE_PUSH_URL = 'ws://192.168.1.201:8787'
|
# VITE_PUSH_URL = 'ws://192.168.1.201:8787'
|
||||||
# VITE_BASE_URL = 'http://192.168.1.201:8545'
|
# VITE_BASE_URL = 'http://192.168.1.201:8545'
|
||||||
|
|
||||||
# VITE_PUSH_URL = 'ws://192.168.1.22:8787'
|
VITE_PUSH_URL = 'ws://192.168.1.22:8787'
|
||||||
# VITE_BASE_URL = 'http://192.168.1.22:8545'
|
VITE_BASE_URL = 'http://192.168.1.22:8545'
|
||||||
|
|
||||||
VITE_PUSH_URL ='wss://test-multi-store.lihaink.cn/pull'
|
# VITE_PUSH_URL ='wss://test-multi-store.lihaink.cn/pull'
|
||||||
VITE_BASE_URL = 'https://test-multi-store.lihaink.cn'
|
# VITE_BASE_URL = 'https://test-multi-store.lihaink.cn'
|
||||||
|
|
||||||
# VITE_PUSH_URL ='wss://multi-store.lihaink.cn/pull'
|
# VITE_PUSH_URL ='wss://multi-store.lihaink.cn/pull'
|
||||||
# VITE_BASE_URL = 'https://multi-store.lihaink.cn'
|
# VITE_BASE_URL = 'https://multi-store.lihaink.cn'
|
|
@ -1,4 +1,5 @@
|
||||||
import request from '@/utils/axios.js'
|
import request from '@/utils/axios.js'
|
||||||
|
import api from '@/utils/axiosAPI.js'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 商品列表
|
* @description 商品列表
|
||||||
|
@ -7,6 +8,7 @@ export function storeListApi(id, data) {
|
||||||
return request.get(`server/${id}/product/lst`, { params: data })
|
return request.get(`server/${id}/product/lst`, { params: data })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 商品详情
|
* @description 商品详情
|
||||||
*/
|
*/
|
||||||
|
@ -63,11 +65,18 @@ export function productDetailApi(store_id, id, data) {
|
||||||
return request.get(`server/${store_id}/product/detail/${id}`, { params: data })
|
return request.get(`server/${store_id}/product/detail/${id}`, { params: data })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * @description 批发商品列表
|
||||||
|
// */
|
||||||
|
// export function saleStoreListApi(data) {
|
||||||
|
// return request.get(`/store_product/storeProduct/lists`, { params: data })
|
||||||
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 批发商品列表
|
* @description 批发商品列表
|
||||||
*/
|
*/
|
||||||
export function saleStoreListApi(data) {
|
export function saleStoreListApi(data) {
|
||||||
return request.get(`/store_product/storeProduct/lists`, { params: data })
|
return api.get(`/product/product/lists`, { params: data })
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -41,6 +41,13 @@ export function userAddApi(data) {
|
||||||
return request.post(`/user/user/add`, data)
|
return request.post(`/user/user/add`, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 发送新增用户档案验证码
|
||||||
|
*/
|
||||||
|
export function userArchivesSmsApi(data) {
|
||||||
|
return request.post(`/user/user/archives_sms`, data)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 会员列表
|
* @description 会员列表
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -101,7 +101,7 @@ const regexPay = /^(25|26|27|28|29|30)\d{14,22}$/; //支付宝条码正则 25-30
|
||||||
const order_id = ref("");
|
const order_id = ref("");
|
||||||
// 支付
|
// 支付
|
||||||
const handleEnter = () => {
|
const handleEnter = () => {
|
||||||
if (form.value.pay_price < minMoney.value) return ElMessage.error(`起购金额为${minMoney.value}元`)
|
// if (form.value.pay_price < minMoney.value) return ElMessage.error(`起购金额为${minMoney.value}元`)
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
codeRef.value.blur();
|
codeRef.value.blur();
|
||||||
if (isRePay.value) orderPay();
|
if (isRePay.value) orderPay();
|
||||||
|
@ -332,7 +332,7 @@ const numTap = (item) => {
|
||||||
};
|
};
|
||||||
// 现金结算
|
// 现金结算
|
||||||
const cashBnt = () => {
|
const cashBnt = () => {
|
||||||
if (form.value.pay_price < minMoney.value) return ElMessage.error(`起购金额为${minMoney.value}元`)
|
// if (form.value.pay_price < minMoney.value) return ElMessage.error(`起购金额为${minMoney.value}元`)
|
||||||
if (
|
if (
|
||||||
changePrice.value === "" ||
|
changePrice.value === "" ||
|
||||||
changePrice.value === null ||
|
changePrice.value === null ||
|
||||||
|
@ -428,7 +428,7 @@ const keyboard = (event) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const getSms = () => {
|
const getSms = () => {
|
||||||
if (form.value.pay_price < minMoney.value && active.value === 3) return ElMessage.error(`起购金额为${minMoney.value}元`)
|
// if (form.value.pay_price < minMoney.value && active.value === 3) return ElMessage.error(`起购金额为${minMoney.value}元`)
|
||||||
if (!uid.value) return ElMessage.error('请先选择用户');
|
if (!uid.value) return ElMessage.error('请先选择用户');
|
||||||
let type = 1; // 采购款支付
|
let type = 1; // 采购款支付
|
||||||
if (active.value == 4) type = 2; //礼品券兑换
|
if (active.value == 4) type = 2; //礼品券兑换
|
||||||
|
@ -446,7 +446,7 @@ const getSms = () => {
|
||||||
const smsCode = ref('');
|
const smsCode = ref('');
|
||||||
// 提交验证码/支付
|
// 提交验证码/支付
|
||||||
const handlecodeEnter = () => {
|
const handlecodeEnter = () => {
|
||||||
if (form.value.pay_price < minMoney.value && active.value === 3) return ElMessage.error(`起购金额为${minMoney.value}元`)
|
// if (form.value.pay_price < minMoney.value && active.value === 3) return ElMessage.error(`起购金额为${minMoney.value}元`)
|
||||||
if (!uid.value) return ElMessage.error('请先选择用户');
|
if (!uid.value) return ElMessage.error('请先选择用户');
|
||||||
let pay_type = 18; // 采购款支付
|
let pay_type = 18; // 采购款支付
|
||||||
if (active.value == 4) pay_type = 19; //礼品券兑换
|
if (active.value == 4) pay_type = 19; //礼品券兑换
|
||||||
|
@ -503,7 +503,7 @@ onUnmounted(() => {
|
||||||
<div class="center" :class="{ active: active == 2 }" @click="changeActive(2)">
|
<div class="center" :class="{ active: active == 2 }" @click="changeActive(2)">
|
||||||
现金收款
|
现金收款
|
||||||
</div>
|
</div>
|
||||||
<div class="center" :class="{ active: active == 3 }" @click="changeActive(3)">
|
<div class="center" style="border-left: none;" :class="{ active: active == 3 }" @click="changeActive(3)">
|
||||||
采购款
|
采购款
|
||||||
</div>
|
</div>
|
||||||
<div class="right" :class="{ active: active == 4 }" @click="changeActive(4)">
|
<div class="right" :class="{ active: active == 4 }" @click="changeActive(4)">
|
||||||
|
@ -519,7 +519,7 @@ onUnmounted(() => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="display: inline-block;">
|
<div style="display: inline-block;">
|
||||||
<div style="color: #999;padding: 2rem 0 0.3rem 0">{{ form.activity || active == 2 ? '活动折扣:' : '消费返利:' }}
|
<div style="color: #999;padding: 2rem 0 0.3rem 0">活动折扣:
|
||||||
</div>
|
</div>
|
||||||
<div style="color: #f5222d; padding-bottom: 2rem">
|
<div style="color: #f5222d; padding-bottom: 2rem">
|
||||||
{{ form.activity }}¥<span style="font-size: 1.6rem">{{ form.activity_price }}</span>
|
{{ form.activity }}¥<span style="font-size: 1.6rem">{{ form.activity_price }}</span>
|
||||||
|
|
|
@ -72,7 +72,10 @@ const changeCartNum = (val, old) => {
|
||||||
});
|
});
|
||||||
costPrice.value = allPrice.value;
|
costPrice.value = allPrice.value;
|
||||||
}).catch((err)=>{
|
}).catch((err)=>{
|
||||||
val.cart_num = err?.msg?.match(/\d+\.\d+/) || 1;
|
let match = err?.msg?.match(/\b\d+(\.\d+)?\b/);
|
||||||
|
if(match){
|
||||||
|
val.cart_num = +match[0];
|
||||||
|
}else val.cart_num = 1;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,10 @@ const getStoreList = (data = {}, reload = false) => {
|
||||||
loadEnd.value = false;
|
loadEnd.value = false;
|
||||||
}
|
}
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
saleStoreListApi(where.value).then((res) => {
|
saleStoreListApi({
|
||||||
|
...where.value,
|
||||||
|
store_id: userStore.userInfo?.store_id
|
||||||
|
}).then((res) => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
if (res.data?.lists?.length < where.value.page_size) loadEnd.value = true;
|
if (res.data?.lists?.length < where.value.page_size) loadEnd.value = true;
|
||||||
storeList.value = storeList.value.concat(res.data.lists);
|
storeList.value = storeList.value.concat(res.data.lists);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, onUnmounted, reactive } from "vue";
|
import { ref, onMounted, onUnmounted, reactive } from "vue";
|
||||||
import { apiProvince, apiCity, apiArea, apiStreet, apiVillage, apiBrigade } from '@/api/public'
|
import { apiProvince, apiCity, apiArea, apiStreet, apiVillage, apiBrigade } from '@/api/public'
|
||||||
import { userShipApi, userAddApi } from "@/api/user"
|
import { userShipApi, userAddApi, userArchivesSmsApi } from "@/api/user"
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
|
|
||||||
|
|
||||||
|
@ -129,6 +129,7 @@ const addUser = () => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
let forms = {};
|
let forms = {};
|
||||||
forms.mobile = formDataInfo.mobile;
|
forms.mobile = formDataInfo.mobile;
|
||||||
|
forms.code = formDataInfo.code;
|
||||||
forms.user_ship = formDataInfo.user_ship;
|
forms.user_ship = formDataInfo.user_ship;
|
||||||
forms.real_name = formDataInfo.real_name;
|
forms.real_name = formDataInfo.real_name;
|
||||||
forms.province = "510000";
|
forms.province = "510000";
|
||||||
|
@ -145,6 +146,21 @@ const addUser = () => {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getSms = ()=>{
|
||||||
|
formDataRef.value.validateField('mobile',(valid)=>{
|
||||||
|
if(valid){
|
||||||
|
userArchivesSmsApi({
|
||||||
|
mobile:formDataInfo.mobile
|
||||||
|
}).then(res=>{
|
||||||
|
ElMessage.success('发送成功')
|
||||||
|
}).catch(err=>{
|
||||||
|
ElMessage.error('发送失败')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
addUser
|
addUser
|
||||||
})
|
})
|
||||||
|
@ -155,11 +171,11 @@ defineExpose({
|
||||||
<div class="add-user">
|
<div class="add-user">
|
||||||
<el-form :model="formDataInfo" :rules="formDataRules" ref="formDataRef" label-width="80px">
|
<el-form :model="formDataInfo" :rules="formDataRules" ref="formDataRef" label-width="80px">
|
||||||
<el-form-item label="用户电话" prop="mobile">
|
<el-form-item label="用户电话" prop="mobile">
|
||||||
<el-input v-model="formDataInfo.mobile" placeholder="请输入用户电话" style="flex: 1;"/>
|
<el-input v-model="formDataInfo.mobile" placeholder="请输入用户电话" />
|
||||||
<el-button type="primary" style="margin-left: 1rem;">获取验证码</el-button>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="验证码" prop="code">
|
<el-form-item label="验证码" prop="code">
|
||||||
<el-input v-model="formDataInfo.code" placeholder="请输入验证码" style="flex: 1;"/>
|
<el-input v-model="formDataInfo.code" placeholder="请输入验证码" style="flex: 1;"/>
|
||||||
|
<el-button type="primary" style="margin-left: 1rem;" @click="getSms">获取验证码</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="用户姓名" prop="real_name">
|
<el-form-item label="用户姓名" prop="real_name">
|
||||||
<el-input v-model="formDataInfo.real_name" placeholder="请输入用户姓名" />
|
<el-input v-model="formDataInfo.real_name" placeholder="请输入用户姓名" />
|
||||||
|
|
Loading…
Reference in New Issue