This commit is contained in:
weipengfei 2024-06-26 13:56:49 +08:00
parent 368132d809
commit 5b326d7917
7 changed files with 54 additions and 16 deletions

View File

@ -4,11 +4,11 @@ VITE_NOW_TYPE = 'dist'
# VITE_PUSH_URL = 'ws://192.168.1.201:8787'
# VITE_BASE_URL = 'http://192.168.1.201:8545'
# VITE_PUSH_URL = 'ws://192.168.1.22:8787'
# VITE_BASE_URL = 'http://192.168.1.22:8545'
VITE_PUSH_URL = 'ws://192.168.1.22:8787'
VITE_BASE_URL = 'http://192.168.1.22:8545'
VITE_PUSH_URL ='wss://test-multi-store.lihaink.cn/pull'
VITE_BASE_URL = 'https://test-multi-store.lihaink.cn'
# VITE_PUSH_URL ='wss://test-multi-store.lihaink.cn/pull'
# VITE_BASE_URL = 'https://test-multi-store.lihaink.cn'
# VITE_PUSH_URL ='wss://multi-store.lihaink.cn/pull'
# VITE_BASE_URL = 'https://multi-store.lihaink.cn'

View File

@ -1,4 +1,5 @@
import request from '@/utils/axios.js'
import api from '@/utils/axiosAPI.js'
/**
* @description 商品列表
@ -7,6 +8,7 @@ export function storeListApi(id, data) {
return request.get(`server/${id}/product/lst`, { params: data })
}
/**
* @description 商品详情
*/
@ -63,11 +65,18 @@ export function productDetailApi(store_id, id, 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 批发商品列表
*/
export function saleStoreListApi(data) {
return request.get(`/store_product/storeProduct/lists`, { params: data })
return api.get(`/product/product/lists`, { params: data })
}
/**

View File

@ -41,6 +41,13 @@ export function userAddApi(data) {
return request.post(`/user/user/add`, data)
}
/**
* @description 发送新增用户档案验证码
*/
export function userArchivesSmsApi(data) {
return request.post(`/user/user/archives_sms`, data)
}
/**
* @description 会员列表
*/

View File

@ -101,7 +101,7 @@ const regexPay = /^(25|26|27|28|29|30)\d{14,22}$/; //支付宝条码正则 25-30
const order_id = ref("");
//
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;
codeRef.value.blur();
if (isRePay.value) orderPay();
@ -332,7 +332,7 @@ const numTap = (item) => {
};
//
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 (
changePrice.value === "" ||
changePrice.value === null ||
@ -428,7 +428,7 @@ const keyboard = (event) => {
};
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('请先选择用户');
let type = 1; //
if (active.value == 4) type = 2; //
@ -446,7 +446,7 @@ const getSms = () => {
const smsCode = ref('');
// /
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('请先选择用户');
let pay_type = 18; //
if (active.value == 4) pay_type = 19; //
@ -503,7 +503,7 @@ onUnmounted(() => {
<div class="center" :class="{ active: active == 2 }" @click="changeActive(2)">
现金收款
</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 class="right" :class="{ active: active == 4 }" @click="changeActive(4)">
@ -519,7 +519,7 @@ onUnmounted(() => {
</div>
</div>
<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 style="color: #f5222d; padding-bottom: 2rem">
{{ form.activity }}¥<span style="font-size: 1.6rem">{{ form.activity_price }}</span>

View File

@ -72,7 +72,10 @@ const changeCartNum = (val, old) => {
});
costPrice.value = allPrice.value;
}).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;
});
};

View File

@ -41,7 +41,10 @@ const getStoreList = (data = {}, reload = false) => {
loadEnd.value = false;
}
loading.value = true;
saleStoreListApi(where.value).then((res) => {
saleStoreListApi({
...where.value,
store_id: userStore.userInfo?.store_id
}).then((res) => {
loading.value = false;
if (res.data?.lists?.length < where.value.page_size) loadEnd.value = true;
storeList.value = storeList.value.concat(res.data.lists);

View File

@ -1,7 +1,7 @@
<script setup>
import { ref, onMounted, onUnmounted, reactive } from "vue";
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";
@ -129,6 +129,7 @@ const addUser = () => {
if (valid) {
let forms = {};
forms.mobile = formDataInfo.mobile;
forms.code = formDataInfo.code;
forms.user_ship = formDataInfo.user_ship;
forms.real_name = formDataInfo.real_name;
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({
addUser
})
@ -155,11 +171,11 @@ defineExpose({
<div class="add-user">
<el-form :model="formDataInfo" :rules="formDataRules" ref="formDataRef" label-width="80px">
<el-form-item label="用户电话" prop="mobile">
<el-input v-model="formDataInfo.mobile" placeholder="请输入用户电话" style="flex: 1;"/>
<el-button type="primary" style="margin-left: 1rem;">获取验证码</el-button>
<el-input v-model="formDataInfo.mobile" placeholder="请输入用户电话" />
</el-form-item>
<el-form-item label="验证码" prop="code">
<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 label="用户姓名" prop="real_name">
<el-input v-model="formDataInfo.real_name" placeholder="请输入用户姓名" />