diff --git a/api/cart.js b/api/cart.js index e707284..ad9a17c 100644 --- a/api/cart.js +++ b/api/cart.js @@ -29,5 +29,5 @@ export const frequentlyPurchaseApi = (data) => { //购物车-零售购物车预检 export const checkOrderApi = (data) => { - return request.post('/order/RetailOrder/checkOrder', data); + return request.post('/order/order/checkOrder', data); } \ No newline at end of file diff --git a/api/order.js b/api/order.js index 54f282e..e5eefc5 100644 --- a/api/order.js +++ b/api/order.js @@ -1,41 +1,57 @@ import request from '@/utils/request'; //提交零售订单(支付一起) -export const createOrderApi = (data)=>{ - return request.post('/order/RetailOrder/createOrder', data); +export const createOrderApi = (data) => { + return request.post('/order/order/createOrder', data); } //订单列表 -export const orderListApi = (data)=>{ - return request.get('/order/retailOrder/order_list', data); +export const orderListApi = (data) => { + return request.get('/order/order/order_list', data); } //订单详情 -export const orderDetailApi = (data)=>{ - return request.get('/order/RetailOrder/detail', data); +export const orderDetailApi = (data) => { + return request.get('/order/order/detail', data); } //重新发起支付 -export const rePaymentApi = (data)=>{ - return request.post('/order/RetailOrder/Repayment', data); +export const rePaymentApi = (data) => { + return request.post('/order/order/Repayment', data); } //订单数量统计 -export const orderCountApi = (data)=>{ - return request.post('/order/RetailOrder/order_count', data); +export const orderCountApi = (data) => { + return request.post('/order/order/order_count', data); } //取消订单 -export const cancelOrderApi = (data)=>{ - return request.post('/order/RetailOrder/cancel_order', data); +export const cancelOrderApi = (data) => { + return request.post('/order/order/cancel_order', data); } //订单确认收货 -export const confirmReceiptApi = (data)=>{ - return request.post('/order/RetailOrder/confirm_receipt', data); +export const confirmReceiptApi = (data) => { + return request.post('/order/order/confirm_receipt', data); } //订单再次购买 -export const purchaseAgainApi = (data)=>{ - return request.get('/order/RetailOrder/purchase_again', data); +export const purchaseAgainApi = (data) => { + return request.get('/order/order/purchase_again', data); +} + +// 核销 +// 核销订单列表 +export const writeListApi = (data) => { + return request.post('/order/order/write_list', data); +} + +// 单个订单核销 +export const writeOrderApi = (data) => { + return request.post('/order/order/writeoff_order', data); +} + +// 核销数量统计 +export const writeCountApi = (data) => { + return request.post('/order/order/write_count', data); } \ No newline at end of file diff --git a/api/user.js b/api/user.js index 5292983..7e39b9f 100644 --- a/api/user.js +++ b/api/user.js @@ -1,57 +1,63 @@ import request from '@/utils/request'; // 密码登录 -export const userLoginApi = (data)=>{ - return request.post('/login/account', data, { - noAuth: true - }); +export const userLoginApi = (data) => { + return request.post('/login/account', data, { + noAuth: true + }); } // 微信登录 -export const userLoginWeixinApi = (data)=>{ - return request.post('/login/mnpLogin', data, { - noAuth: true - }); +export const userLoginWeixinApi = (data) => { + return request.post('/login/mnpLogin', data, { + noAuth: true + }); } // 微信获取手机号 -export const getMobileByMnpApi = (data)=>{ - return request.post('/user/User/getMobileByMnp', data, { - noAuth: true - }); +export const getMobileByMnpApi = (data) => { + return request.post('/user/User/getMobileByMnp', data, { + noAuth: true + }); } // 更新信息 -export const loginUpdateUserApi = (data)=>{ - return request.post('/login/updateUser', data); +export const loginUpdateUserApi = (data) => { + return request.post('/login/updateUser', data); } // 添加地址 -export const addressCreateApi = (data)=>{ - return request.post('/user/address/create', data); +export const addressCreateApi = (data) => { + return request.post('/user/address/create', data); } // 修改地址 -export const addressEditApi = (data)=>{ - return request.post('/user/address/edit', data); +export const addressEditApi = (data) => { + return request.post('/user/address/edit', data); } // 删除地址 -export const addressDeleteApi = (data)=>{ - return request.post('/user/address/delete', data); +export const addressDeleteApi = (data) => { + return request.post('/user/address/delete', data); } // 地址列表 -export const addressListsApi = (data)=>{ - return request.get('/user/address/lists', data); +export const addressListsApi = (data) => { + return request.get('/user/address/lists', data); } // 地址详情 -export const addressDetailApi = (data)=>{ - return request.get('/user/address/detail', data); +export const addressDetailApi = (data) => { + return request.get('/user/address/detail', data); } // 自提点列表 -export const merchantListApi = (data)=>{ - return request.get('/merchant/merchant/lists', data); +export const merchantListApi = (data) => { + return request.get('/merchant/merchant/lists', data); +} + + +// 充值 +export const rechargeApi = (data) => { + return request.post('/user/user/recharge', data); } \ No newline at end of file diff --git a/config/app.js b/config/app.js index 58b2350..1bc1012 100644 --- a/config/app.js +++ b/config/app.js @@ -1,19 +1,10 @@ let BASE_URL import store from "@/store/user.js" // 环境 -// let env = "dev" -// let env = "test" -// let env = "prod" -// let env = "local" -let env = "liu"; +let env = "dev" +// let env = "liu"; switch (env) { - case 'prod': - BASE_URL = 'https://erp.lihaink.cn'; - break; - case 'test': - BASE_URL = 'https://ceshi-erp.lihaink.cn'; - break; case 'liu': BASE_URL = 'http://192.168.1.201:8545'; break; diff --git a/multipleShop/images/charge_bg.webp b/multipleShop/images/charge_bg.webp new file mode 100644 index 0000000..50c20a6 Binary files /dev/null and b/multipleShop/images/charge_bg.webp differ diff --git a/multipleShop/images/write_done.webp b/multipleShop/images/write_done.webp new file mode 100644 index 0000000..b760c6c Binary files /dev/null and b/multipleShop/images/write_done.webp differ diff --git a/multipleShop/index/index.vue b/multipleShop/index/index.vue index 7b059db..cfea4a8 100644 --- a/multipleShop/index/index.vue +++ b/multipleShop/index/index.vue @@ -1,3 +1,188 @@ + + + + + - - - \ No newline at end of file + \ No newline at end of file diff --git a/multipleShop/orderVerification/index.vue b/multipleShop/orderVerification/index.vue index d7d69c6..bac9b0d 100644 --- a/multipleShop/orderVerification/index.vue +++ b/multipleShop/orderVerification/index.vue @@ -1,3 +1,124 @@ + + + + - - - \ No newline at end of file + \ No newline at end of file diff --git a/multipleShop/test.vue b/multipleShop/test.vue new file mode 100644 index 0000000..2c4d29f --- /dev/null +++ b/multipleShop/test.vue @@ -0,0 +1,127 @@ + + + + \ No newline at end of file diff --git a/multipleShop/verificationOrder/detail.vue b/multipleShop/verificationOrder/detail.vue index 158293e..9381bbe 100644 --- a/multipleShop/verificationOrder/detail.vue +++ b/multipleShop/verificationOrder/detail.vue @@ -1,3 +1,87 @@ + + - - \ No newline at end of file + \ No newline at end of file diff --git a/multipleShop/verificationOrder/index.vue b/multipleShop/verificationOrder/index.vue index e4939e3..c1e6e91 100644 --- a/multipleShop/verificationOrder/index.vue +++ b/multipleShop/verificationOrder/index.vue @@ -1,3 +1,208 @@ + + + + - - - \ No newline at end of file + \ No newline at end of file diff --git a/pages.json b/pages.json index dcd2c8b..c732cdd 100644 --- a/pages.json +++ b/pages.json @@ -9,6 +9,13 @@ } }, "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages + { + "path": "pages/member/member", + "style": { + "navigationBarTitleText": "会员充值", + "enablePullDownRefresh": false, + } + }, { "path": "pages/index/index", "style": { @@ -21,51 +28,34 @@ "bounce": "none" } } - }, - { - "path": "pages/index/test", - "style": { - "navigationBarTitleText": "购物", - "disableScroll": true, - "enablePullDownRefresh": false, - "app-plus": { - // 将回弹属性关掉 - "bounce": "none" - } - } - }, - { + }, { "path": "pages/login/login", "style": { - "navigationBarTitleText": "登录", - "enablePullDownRefresh": false, - "navigationStyle": "custom" + "navigationBarTitleText": "", + "enablePullDownRefresh": false + // "navigationStyle": "custom" } - }, - { + }, { "path": "pages/cart/cart", "style": { "navigationBarTitleText": "购物车", "enablePullDownRefresh": false, "navigationStyle": "custom" } - }, - { + }, { + "path": "pages/code/code", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + }, { "path": "pages/my/my", "style": { "navigationBarTitleText": "个人中心", "enablePullDownRefresh": false, "navigationStyle": "custom" } - }, - { - "path": "pages/code/code", - "style": { - "navigationBarTitleText": "", - "enablePullDownRefresh": false - } } - ], "subPackages": [{ "root": "multipleShop", @@ -80,7 +70,8 @@ "path": "verificationOrder/index", "style": { "navigationBarTitleText": "核销订单", - "enablePullDownRefresh": false + "enablePullDownRefresh": false, + "disableScroll": true } }, { "path": "verificationOrder/detail", @@ -194,10 +185,7 @@ } ] } - - ], - "globalStyle": { "navigationBarTextStyle": "black", "navigationBarTitleText": "", diff --git a/pages/cart/cart.vue b/pages/cart/cart.vue index 645006c..0807725 100644 --- a/pages/cart/cart.vue +++ b/pages/cart/cart.vue @@ -1,453 +1,462 @@ \ No newline at end of file diff --git a/pages/charge/charge.vue b/pages/charge/charge.vue new file mode 100644 index 0000000..da9c892 --- /dev/null +++ b/pages/charge/charge.vue @@ -0,0 +1,276 @@ + + + \ No newline at end of file diff --git a/pages/index/index - 副本.vue b/pages/index/index - 副本.vue new file mode 100644 index 0000000..676697a --- /dev/null +++ b/pages/index/index - 副本.vue @@ -0,0 +1,898 @@ + + + + + \ No newline at end of file diff --git a/pages/index/index.vue b/pages/index/index.vue index 676697a..279ab0a 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -181,8 +181,6 @@ import useUserStore from "@/store/user"; const userStore = useUserStore(); - - const test = () => { uni.navigateTo({ url: '/pageQuota/quotation/index' @@ -190,9 +188,6 @@ } - - - /*商品列表滚动隐藏头部导航 */ const instance = getCurrentInstance(); // 获取组件实例 const targetHeight = ref(0) @@ -202,10 +197,9 @@ if (e.detail.scrollTop <= 0 || e.detail.scrollTop >= targetHeight.value) return isScroll.value = e.detail.scrollTop > lastScollTop lastScollTop = e.detail.scrollTop - } - /*商品列表滚动隐藏头部导航结束 */ + /*商品列表滚动隐藏头部导航结束 */ const cartStore = useCartStore(); const show = ref(0); const topActive = ref(0); @@ -241,7 +235,9 @@ cartCreateApi({ cart_num: cart_num, is_new: 0, // 是否直接购买0否1是 - goods_id: id + // goods_id: id, + store_id: where.value.store_id, + product_id: id }).then(res => { getCartList(); }).catch(err => { @@ -267,7 +263,8 @@ page_no: 1, page_size: 25, name: '', - order: '' + order: '', + store_id: '2' }) const loading = ref(true); const goodList = ref([]); @@ -384,6 +381,7 @@ } const navTo = (url) => { + // if (!userStore.token || !userStore.userInfo.mobile) return uni.showModal({ if (!userStore.token) return uni.showModal({ content: '您需要先登录才可使用该功能, 是否前去登录', success: (e) => { @@ -429,7 +427,10 @@ userStore.setUserInfo({}); } } - }) + }); + + + console.log(data); addCart(data.id, data.cart_num); } // 结算 @@ -453,18 +454,20 @@ total_price: res.data?.extend?.total_price || '0.00', count: res.data?.count || 0 } - cartStore.setCartList(res.data?.lists.map(item => item.cart_id)) + cartStore.setCartList(res.data?.lists.map(item => item.id)) }) } - onLoad(() => { + onLoad((opt) => { + if (opt.id) where.value.store_id = opt.id; getgoodClassList(0); getGoodList(); - }) + onShow(() => { getCartList(); }) + onMounted(() => { const instance = getCurrentInstance(); // 获取组件实例 const getWXDom = () => { diff --git a/pages/index/test.vue b/pages/index/test.vue index 2c4d29f..cfea4a8 100644 --- a/pages/index/test.vue +++ b/pages/index/test.vue @@ -1,127 +1,349 @@ - - + \ No newline at end of file + + // 初始化 + onLoad(() => { + // 获取定位 + getLocation(); + }); + + // 门店选择 + const onChooseShop = (id) => { + currShop.value = id; + + setTimeout(() => { + uni.reLaunch({ + url: '/pages/index/index?id=' + id, + fail(err) { + console.log(err); + } + }) + }, 300) + } + + // 触底刷新 + const onReachBottom = () => { + getShopList(); + } + + // 搜索 + const handleSearch = () => { + shopList.value = []; + queryParams.page_no = 1; + status.value = ''; + getShopList(); + } + + // 获取门店 + const getShopList = () => { + if (status.value == 'nomore') return; + if (status.value == 'loading') return; + + status.value == 'loading'; + shopListApi(queryParams).then(res => { + let len = res.data.lists; + status.value = queryParams.page_size > len ? 'nomore' : 'loadmore'; + shopList.value = shopList.value.concat(res.data.lists); + if (status.value == 'loadmore') queryParams.page_no += 1; + }) + } + + // 门店距离处理 + const parseDistance = (e) => { + if (!e) return '-'; + if (e > 1) { + return (e.toFixed(1)) + 'km'; + } else { + return (e * 1000).toFixed(0) + 'm'; + } + } + + // 拨打门店电话 + const onPhoneCall = (phone) => { + if (!phone) return; + uni.makePhoneCall({ + phoneNumber: phone + }) + } + + // 导航 + const onNavgation = (item) => { + uni.openLocation({ + latitude: Number(item.latitude), + longitude: Number(item.longitude), + }) + } + + // 获取定位 + const getLocation = () => { + let location = uni.getStorageSync('location'); + if (location) { + let [lng, lat] = location.split(','); + queryParams.longitude = lng; + queryParams.latitude = lat; + + // 加载店铺列表 + getShopList(); + } else { + uni.getLocation({ + type: "gcj02", + success(res) { + queryParams.latitude = res.latitude; + queryParams.longitude = res.longitude; + + // 加载店铺列表 + getShopList(); + + // 避免下次再获取 + uni.setStorageSync('location', `${res.longitude},${res.latitude}`) + } + }) + } + } + + + + \ No newline at end of file diff --git a/pages/login/login.vue b/pages/login/login.vue index a69bb94..4b0f061 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -132,6 +132,7 @@ const showWeixin = ref(true); //是否显示微信登录 const isAgree = ref(false); //是否同意协议 + const tempUser = ref(null); const weixinLogin = () => { if (!isAgree.value) return uni.$u.toast('请先阅读并同意协议'); @@ -146,9 +147,12 @@ }).then(res => { uni.hideLoading(); userStore.setToken(res.data.token); - userStore.setUserInfo(res.data); + if (!res.data.mobile) { //未绑定手机号 + tempUser.value = res.data; return showBind.value = true; + } else { + userStore.setUserInfo(res.data); } navToIndex(); }) @@ -167,7 +171,20 @@ getMobileByMnpApi({ code: e.detail.code }).then(res => { - navToIndex(); + //手机号获取成功 可以本地缓存用户信息以及token + userStore.setUserInfo(res.data); + + //身份授权成功 核销人员 + if (res.is_staff == 1) { + userStore.setUserInfo(res.data); + uni.reLaunch({ + url: "/multipleShop/verificationOrder/index" + }) + } else { // 直接选择门店 + uni.reLaunch({ + url: "/multipleShop/index/index" + }) + } }) } else { console.log("用户拒绝授权"); diff --git a/pages/member/member.vue b/pages/member/member.vue new file mode 100644 index 0000000..e566f52 --- /dev/null +++ b/pages/member/member.vue @@ -0,0 +1,359 @@ + + + + + + + + \ No newline at end of file diff --git a/pages/my/my.vue b/pages/my/my.vue index 95655bc..94ac1f5 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -1,16 +1,54 @@