diff --git a/.env.development b/.env.development index 48add0d..f5f48a0 100644 --- a/.env.development +++ b/.env.development @@ -1,10 +1,14 @@ VITE_NOW_TYPE = 'dist' -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 = '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 ='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' \ No newline at end of file diff --git a/src/api/store.js b/src/api/store.js index 10cefc6..035a223 100644 --- a/src/api/store.js +++ b/src/api/store.js @@ -176,4 +176,11 @@ export function subOrdersListApi(data) { */ export function merchantOrderCountApi(data) { return request.get(`/order/retailOrder/merchant_order_count`, { params: data }) -} \ No newline at end of file +} + +/** + * @description 发送短信验证(采购款) + */ +export function storeOrderCheckSmsApi(data) { + return request.post(`/store_order/StoreOrder/checkSms`, data) +} diff --git a/src/api/user.js b/src/api/user.js index 9377d4f..bd8815a 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -4,46 +4,74 @@ import request from '@/utils/axios.js' * @description 验证码 */ export function captchaApi() { - return request.get(`captcha`) + return request.get(`captcha`) } /** * @description 登录 */ export function login(data) { - return request.post(`/login/account`, data) + return request.post(`/login/account`, data) } /** * @description 信息 */ export function info(data) { - return request.get(`user`, data) + return request.get(`user`, data) } /** * @description 退出登录 */ export function logout() { - return request.post(`logout`) + return request.post(`logout`) } /** * @description 会员类型 */ -export function userShipApi() { - return request.get(`/user/UserShip/lists`) - } +export function userShipApi(data) { + return request.get(`/user/UserShip/lists`, { params: data }) +} - /** - * @description 添加会员 - */ +/** +* @description 添加会员 +*/ export function userAddApi(data) { return request.post(`/user/user/add`, data) - } +} - /** - * @description 会员列表 - */ -export function userListsApi() { - return request.get(`/user/user/lists`) - } +/** +* @description 会员列表 +*/ +export function userListsApi(data) { + return request.get(`/user/user/lists`, { params: data }) +} + +/** +* @description 用户详情 +*/ +export function userDetailApi(data) { + return request.get(`/user/user/detail`, { params: data }) +} + +/** +* @description 地址详情 +*/ +export function userAddressDetailApi(data) { + return request.get(`/user/Address/detail`, { params: data }) +} + +/** +* @description 修改地址 +*/ +export function userAddressEditApi(data) { + return request.post(`/user/Address/edit`, data) +} + +/** +* @description 充值 +*/ +export function userRechangeAmountApi(data) { + return request.post(`/store_order/StoreOrder/rechange_amount`, data) +} diff --git a/src/components/pay.vue b/src/components/pay.vue index b4ce8e4..d771a5b 100644 --- a/src/components/pay.vue +++ b/src/components/pay.vue @@ -1,10 +1,10 @@ diff --git a/src/components/payUser.vue b/src/components/payUser.vue new file mode 100644 index 0000000..552e721 --- /dev/null +++ b/src/components/payUser.vue @@ -0,0 +1,665 @@ + + + + + diff --git a/src/components/userList.vue b/src/components/userList.vue new file mode 100644 index 0000000..66605fd --- /dev/null +++ b/src/components/userList.vue @@ -0,0 +1,197 @@ + + + + + diff --git a/src/layout/myAside.vue b/src/layout/myAside.vue index 9a7a9cc..f9329e8 100644 --- a/src/layout/myAside.vue +++ b/src/layout/myAside.vue @@ -71,12 +71,12 @@ const list = ref([ ico: "FullScreen", count: 0, }, - { - name: "statistics", - title: "盈收统计", - ico: "TrendCharts", - count: 0, - }, + // { + // name: "statistics", + // title: "盈收统计", + // ico: "TrendCharts", + // count: 0, + // }, { name: "putStorage", title: "入库登记", diff --git a/src/utils/EscPos.js b/src/utils/EscPos.js index 61206d9..17624f2 100644 --- a/src/utils/EscPos.js +++ b/src/utils/EscPos.js @@ -89,13 +89,13 @@ const testObj = { "reservation_time": null, "is_writeoff": 1, "is_remind": 0, - "create_time": "2024-06-08 16:04:16", - "update_time": "2024-06-08 16:56:23", + "create_time": "2024-00-08 16:04:16", + "update_time": "2024-00-08 16:56:23", "delete_time": null, "system_store_name": "店铺名称", - "system_store_phone": "15699996666", + "system_store_phone": "156****6666", "staff_name": "新店阿萨", - "staff_phone": "15699996666", + "staff_phone": "156****6666", "nickname": "", "user_mobile": "", "info": [ diff --git a/src/utils/feedback.ts b/src/utils/feedback.ts new file mode 100644 index 0000000..e29121b --- /dev/null +++ b/src/utils/feedback.ts @@ -0,0 +1,95 @@ +import { + ElMessage, + ElMessageBox, + ElNotification, + ElLoading, + type ElMessageBoxOptions +} from 'element-plus' +import type { LoadingInstance } from 'element-plus/es/components/loading/src/loading' + +export class Feedback { + private loadingInstance: LoadingInstance | null = null + static instance: Feedback | null = null + static getInstance() { + return this.instance ?? (this.instance = new Feedback()) + } + // 消息提示 + msg(msg: string) { + ElMessage.info(msg) + } + // 错误消息 + msgError(msg: string) { + if(msg!=='Network Error') ElMessage.error(msg) + } + // 成功消息 + msgSuccess(msg: string) { + ElMessage.success(msg) + } + // 警告消息 + msgWarning(msg: string) { + ElMessage.warning(msg) + } + // 弹出提示 + alert(msg: string) { + ElMessageBox.alert(msg, '系统提示') + } + // 错误提示 + alertError(msg: string) { + ElMessageBox.alert(msg, '系统提示', { type: 'error' }) + } + // 成功提示 + alertSuccess(msg: string) { + ElMessageBox.alert(msg, '系统提示', { type: 'success' }) + } + // 警告提示 + alertWarning(msg: string) { + ElMessageBox.alert(msg, '系统提示', { type: 'warning' }) + } + // 通知提示 + notify(msg: string) { + ElNotification.info(msg) + } + // 错误通知 + notifyError(msg: string) { + ElNotification.error(msg) + } + // 成功通知 + notifySuccess(msg: string) { + ElNotification.success(msg) + } + // 警告通知 + notifyWarning(msg: string) { + ElNotification.warning(msg) + } + // 确认窗体 + confirm(msg: string) { + return ElMessageBox.confirm(msg, '温馨提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }) + } + // 提交内容 + prompt(content: string, title: string, options?: ElMessageBoxOptions) { + return ElMessageBox.prompt(content, title, { + confirmButtonText: '确定', + cancelButtonText: '取消', + ...options + }) + } + // 打开全局loading + loading(msg: string) { + this.loadingInstance = ElLoading.service({ + lock: true, + text: msg + }) + } + // 关闭全局loading + closeLoading() { + this.loadingInstance?.close() + } +} + +const feedback = Feedback.getInstance() + +export default feedback diff --git a/src/views/putStorage/index.vue b/src/views/putStorage/index.vue index 996298a..76f9de7 100644 --- a/src/views/putStorage/index.vue +++ b/src/views/putStorage/index.vue @@ -6,22 +6,24 @@ import { ElMessage } from "element-plus"; const orderList = ref([]); const where = ref({ - page_no: 1, - page_size: 20, - loadend: false + page_no: 1, + page_size: 20, + loadend: false, + type: 1 }); const loading = ref(false); const getOrderList = () => { - if(where.value.loadend) return ; + if (where.value.loadend) return; loading.value = true; storeStorageInfoListsApi({ page_no: where.value.page_no, - page_size: where.value.page_size + page_size: where.value.page_size, + type: where.value.type }).then((res) => { orderList.value = [...orderList.value, ...res.data.lists]; - if(res.data.lists.length { getOrderList(); +const reload = ()=>{ + where.value.page_no = 1; + where.value.loadend = false; + orderList.value = []; + getOrderList(); +}; + +// 入库 +const handlePutStorage = (data) => { +} + // 编辑 const handleEdit = async (data) => { storeStorageInfoEditApi({ @@ -43,41 +56,38 @@ const handleEdit = async (data) => { @@ -89,14 +99,17 @@ const handleEdit = async (data) => { box-sizing: border-box; padding: 1rem; height: 100%; + display: flex; + flex-direction: column; - .image{ + .image { width: 4rem; height: 4rem; } - .order-lists{ - height: 100%; + + .order-lists { + flex: 1; width: 100%; } } diff --git a/src/views/saleHome/component/order.vue b/src/views/saleHome/component/order.vue index b4127a3..5b1d41b 100644 --- a/src/views/saleHome/component/order.vue +++ b/src/views/saleHome/component/order.vue @@ -4,6 +4,7 @@ import { cartListApi, cartDeleteApi, cartCreateApi } from "@/api/store.js"; import price from "./price.vue"; import mitt from "@/utils/mitt.js"; import { useUserStore } from "@/store/user.js"; +import userList from "@/components/userList.vue"; const list = ref([]); const allPrice = ref(0); //商品总价 @@ -11,6 +12,7 @@ const costPrice = ref(0); //商品原价 const discounts = ref(0); //优惠金额 const userStore = useUserStore(); +const userListRef = ref(null); const clearAll = () => { let id = []; @@ -91,11 +93,20 @@ const showPrice = (type = true) => { priceRef.value.show(type, costPrice.value); }; +const userInfo = ref({ + uid: '' +}) +const setUser = (row)=>{ + userInfo.value = row; + userInfo.value.uid = row.id; +} + defineExpose({ getList, list, discounts, allPrice, + userInfo }); // 键盘事件 @@ -119,6 +130,28 @@ onUnmounted(() => {