diff --git a/api/model/index.js b/api/model/index.js index 1b2cace..5f0ed8c 100644 --- a/api/model/index.js +++ b/api/model/index.js @@ -157,6 +157,11 @@ const api = { url: '/index/getAddOrderPageBean', method: 'GET', }, + // 查询快捷订单详情 + getAddOrderInfo: { + url: '/index/getAddOrderInfo', + method: 'GET', + }, } export default api \ No newline at end of file diff --git a/components/QuickOrderEntry.vue b/components/QuickOrderEntry.vue index 941daa7..2933869 100644 --- a/components/QuickOrderEntry.vue +++ b/components/QuickOrderEntry.vue @@ -36,7 +36,7 @@ export default { default: true }, bottom : { - default : '30vh', + default : '33vh', } }, data() { @@ -59,8 +59,10 @@ export default { // 如果有订单信息,提供订单列表 if (Array.isArray(this.orderInfo) && this.orderInfo.length > 0) { this.$emit('order-info', this.orderInfo); + this.navigateTo('/pages_order/order/firmOrder'); + return } - + // 如果有目标页面,则跳转 if (this.targetUrl) { this.navigateTo(this.targetUrl); diff --git a/components/userShop/userShopCommission.vue b/components/userShop/userShopCommission.vue index 49cc935..24f9fe1 100644 --- a/components/userShop/userShopCommission.vue +++ b/components/userShop/userShopCommission.vue @@ -3,7 +3,7 @@ - 总积分 + 我的积分 {{ userInfo.money }} diff --git a/config.js b/config.js index 5f98974..56cbd86 100644 --- a/config.js +++ b/config.js @@ -7,7 +7,7 @@ import uvUI from '@/uni_modules/uv-ui-tools' Vue.use(uvUI); // 当前环境 -const type = 'dev' +const type = 'prod' // 环境配置 diff --git a/mixins/loadList.js b/mixins/loadList.js new file mode 100644 index 0000000..6b206a7 --- /dev/null +++ b/mixins/loadList.js @@ -0,0 +1,103 @@ + + + +function query(self, queryParams){ + // return (self.beforeGetData && self.beforeGetData()) || + // queryParams || self.queryParams + + // 深度合并对象 + return self.$utils.deepMergeObject( + + self.$utils.deepMergeObject(self.queryParams, + + (self.beforeGetData && self.beforeGetData()) || {}), + + queryParams) +} + + + +export default { + data() { + return { + queryParams: { + pageNo: 1, + pageSize: 10, + }, + total : 0, + List : [], + hasMore: true, // 是否还有更多数据 + loading: false, // 是否正在加载 + } + }, + onPullDownRefresh() { + }, + onReachBottom() { + }, + onShow() { + }, + methods: { + // 刷新列表 + refreshList() { + this.pageNo = 1; + this.hasMore = true; + this.orderList = []; + this.loadList(); + }, + + // 加载更多 + loadMore() { + if (!this.hasMore || this.loading) return; + this.pageNo++; + this.loadList(); + }, + + // 加载订单列表 + loadList() { + return new Promise((success, error) => { + if(!this.mixinsListApi){ + return console.error('mixinsListApi 缺失'); + } + if (this.loading) return; + + this.loading = true; + + const params = { + ...this.queryParams, + }; + + + this.$api(this.mixinsListApi, query(this, params)) + .then(res => { + this.loading = false; + uni.stopPullDownRefresh(); + + if (res.code === 200 && res.result) { + + this.getDataThen && this.getDataThen(res.result.records, res.result.total, res.result) + + success(res.result) + + const newList = res.result.records || []; + this.total = res.result.total + + if (this.pageNo === 1) { + this.List = newList; + } else { + this.List = [...this.List, ...newList]; + } + + // 判断是否还有更多数据 + this.hasMore = newList.length >= this.pageSize; + } else { + uni.showToast({ + title: res.message || '加载失败', + icon: 'none' + }); + error(res) + } + }) + }) + }, + } +} \ No newline at end of file diff --git a/pages/index/cart.vue b/pages/index/cart.vue index ac4cd95..3c03117 100644 --- a/pages/index/cart.vue +++ b/pages/index/cart.vue @@ -178,7 +178,7 @@ }, valChange(item, e) { this.$api('updateCartNum', { - id: item.id, + id: item.cartId, num: e.value, }) }, diff --git a/pages/index/category.vue b/pages/index/category.vue index c36313e..f2ca63a 100644 --- a/pages/index/category.vue +++ b/pages/index/category.vue @@ -128,7 +128,7 @@ shopClassId: this.selectCategory.id, pageNo: 1, pageSize: 99999, - // cityId : this.selectCity.id, + cityId : this.selectCity.id, }, res => { if(res.code == 200) { this.list = res.result.records diff --git a/pages/index/center.vue b/pages/index/center.vue index bd21de6..5339770 100644 --- a/pages/index/center.vue +++ b/pages/index/center.vue @@ -40,8 +40,8 @@ - 我的积分 - ¥{{ userInfo.money || 0 }} + 累计提现 + ¥{{ userInfo.price || 0 }} @@ -49,8 +49,8 @@ - 我的金额 - ¥{{ userInfo.price || 0 }} + 我的积分 + ¥{{ userInfo.money || 0 }} diff --git a/pages/index/index.vue b/pages/index/index.vue index 5defebb..d27fef9 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -102,7 +102,10 @@ export default { }, computed: { }, - onLoad() { + onLoad(query) { + if (query.shareId) { + uni.setStorageSync('shareId', query.shareId) + } if(this.selectCity.id){ this.mixinsListApi = 'getProductList' } diff --git a/pages/index/order.vue b/pages/index/order.vue index 707c83a..13dae19 100644 --- a/pages/index/order.vue +++ b/pages/index/order.vue @@ -3,8 +3,11 @@ - + @@ -46,7 +49,7 @@ 立即支付 - + 确认收货 @@ -86,6 +89,9 @@ export default { { name: '待付款' }, + { + name: '已付款' + }, { name: '配送中' }, diff --git a/pages_order/mine/individualTeam.vue b/pages_order/mine/individualTeam.vue index f852267..dfe5579 100644 --- a/pages_order/mine/individualTeam.vue +++ b/pages_order/mine/individualTeam.vue @@ -15,7 +15,8 @@ - {{ userInfo.phone }} + {{ userInfo.nickName }} + {{ levelMap[info.role] }} diff --git a/pages_order/mine/purse.vue b/pages_order/mine/purse.vue index 9cb89be..677d7bf 100644 --- a/pages_order/mine/purse.vue +++ b/pages_order/mine/purse.vue @@ -14,25 +14,25 @@ 我要提现 - - 可提现金额:¥{{userInfo.price}} + + 可提现:¥{{userInfo.money}} - - + + 快捷选择: ¥{{amount}} @@ -88,9 +88,9 @@ data() { return { notice: '', - withdrawAmount: '', // 提现金额 + withdrawAmount: '', // 提现积分 isSubmitting: false, // 是否正在提交 - quickAmounts: [10, 50, 100, 200, 500], // 快捷金额选项 + quickAmounts: [10, 50, 100, 200, 500], // 快捷积分选项 } }, computed: { @@ -102,20 +102,20 @@ this.$store.commit('getUserInfo'); }, methods: { - // 选择快捷金额 + // 选择快捷积分 selectQuickAmount(amount) { - if (amount > parseFloat(this.userInfo.price)) return; + if (amount > parseFloat(this.userInfo.money)) return; this.withdrawAmount = amount.toString(); }, - // 选择全部金额 + // 选择全部积分 selectAllAmount() { - if (this.userInfo.price) { - this.withdrawAmount = parseFloat(this.userInfo.price).toString(); + if (this.userInfo.money) { + this.withdrawAmount = parseFloat(this.userInfo.money).toString(); } }, - // 金额输入处理 + // 积分输入处理 onAmountInput(e) { let value = e.detail.value; // 只允许输入数字和小数点 @@ -132,11 +132,11 @@ this.withdrawAmount = value; }, - // 验证提现金额 + // 验证提现积分 validateAmount() { if (!this.withdrawAmount) { uni.showToast({ - title: '请输入提现金额', + title: '请输入提现积分', icon: 'none' }); return false; @@ -145,25 +145,25 @@ const amount = parseFloat(this.withdrawAmount); if (isNaN(amount) || amount <= 0) { uni.showToast({ - title: '请输入正确的提现金额', + title: '请输入正确的提现积分', icon: 'none' }); return false; } - // 检查提现金额是否超过可用余额 - if (this.userInfo.price && amount > parseFloat(this.userInfo.price)) { + // 检查提现积分是否超过可用余额 + if (this.userInfo.money && amount > parseFloat(this.userInfo.money)) { uni.showToast({ - title: '提现金额不能超过可用余额', + title: '提现积分不能超过可用余额', icon: 'none' }); return false; } - // 检查最小提现金额(假设最小提现1元) + // 检查最小提现积分(假设最小提现1元) if (amount < 1) { uni.showToast({ - title: '最小提现金额为1元', + title: '最小提现积分为1元', icon: 'none' }); return false; @@ -176,7 +176,7 @@ submitWithdraw() { if (this.isSubmitting) return; - // 验证提现金额 + // 验证提现积分 if (!this.validateAmount()) return; // 确认提现 diff --git a/pages_order/order/createOrder.vue b/pages_order/order/createOrder.vue index cbf11e7..68cfd86 100644 --- a/pages_order/order/createOrder.vue +++ b/pages_order/order/createOrder.vue @@ -115,7 +115,7 @@ 账户余额 - (余额: {{ userInfo.price }}) + (余额: {{ userInfo.money }}) {{formatTime(order.createTime)}} - {{getStatusText(order.state)}} + {{getStatusText(order.status)}} @@ -110,10 +110,10 @@ - - - 暂无{{currentTabName}}订单 - + + + 暂无{{currentTabName}}订单 + @@ -144,7 +144,7 @@ { name: '全部', state: '' }, { name: '待审核', state: '0' }, { name: '已审核', state: '1' }, - { name: '已取消', state: '2' } + // { name: '已取消', state: '2' } ], orderList: [], // 订单列表 pageNo: 1, // 当前页码 @@ -216,10 +216,14 @@ const params = { pageNo: this.pageNo, pageSize: this.pageSize, - state: this.statusTabs[this.currentTab].state }; - this.$api('getAddOrderPageBean', params, res => { + if(this.statusTabs[this.currentTab].state){ + params.state = this.statusTabs[this.currentTab].state + } + + this.$api('getAddOrderPageBean', params) + .then(res => { this.loading = false; uni.stopPullDownRefresh(); @@ -240,15 +244,7 @@ icon: 'none' }); } - }, err => { - this.loading = false; - uni.stopPullDownRefresh(); - console.error('加载订单列表失败', err); - uni.showToast({ - title: '网络错误,请重试', - icon: 'none' - }); - }); + }) }, // 获取状态文本 @@ -352,14 +348,14 @@ // 查看订单详情 viewOrderDetail(order) { // 根据订单状态跳转到不同页面 - if (order.state === '1') { + if (order.status === '1') { // 已审核的订单,跳转到确认下单页面 this.$utils.navigateTo(`/pages_order/order/firmOrder?orderId=${order.id}`); } else { // 其他状态显示详情信息 uni.showModal({ title: '订单详情', - content: `订单号: ${order.orderNumber || order.id}\n状态: ${this.getStatusText(order.state)}\n下单方式: ${this.getTypeName(order.type)}\n创建时间: ${this.formatTime(order.createTime)}`, + content: `订单号: ${order.orderNumber || order.id}\n状态: ${this.getStatusText(order.status)}\n下单方式: ${this.getTypeName(order.type)}\n创建时间: ${this.formatTime(order.createTime)}`, showCancel: false }); } diff --git a/pages_order/order/firmOrder.vue b/pages_order/order/firmOrder.vue index 6a4a24a..82d7e4e 100644 --- a/pages_order/order/firmOrder.vue +++ b/pages_order/order/firmOrder.vue @@ -160,16 +160,30 @@ methods: { // 获取订单信息 getOrderInfo() { - this.$api('getOrderInfo', res => { - if (res.code === 200 && res.result[0]) { - // 如果返回商品信息,则设置商品信息 commonShop - this.productInfo = res.result[0]; + // this.$api('getOrderInfo', res => { + // if (res.code === 200 && res.result[0]) { + // // 如果返回商品信息,则设置商品信息 commonShop + // this.productInfo = res.result[0]; + + // this.productInfo.commonShop.forEach(n => { + // this.checkboxValue.push(n.id) + // }) + // } + // }); + + + this.$api('getAddOrderInfo', { + orderId : this.orderId + }, res => { + if (res.code === 200 && res.result) { + // 如果返回商品信息,则设置商品信息 commonShop + this.productInfo = res.result; this.productInfo.commonShop.forEach(n => { this.checkboxValue.push(n.id) }) - } - }); + } + }); }, // 获取地址列表 diff --git a/pages_order/order/orderDetail.vue b/pages_order/order/orderDetail.vue index b259784..55a155e 100644 --- a/pages_order/order/orderDetail.vue +++ b/pages_order/order/orderDetail.vue @@ -23,7 +23,7 @@ > 立即支付 - 确认收货 @@ -215,6 +215,9 @@ export default { { name: '待付款' }, + { + name: '已付款' + }, { name: '配送中' }, diff --git a/pages_order/product/productList.vue b/pages_order/product/productList.vue index 4fdb1ae..eaffaa6 100644 --- a/pages_order/product/productList.vue +++ b/pages_order/product/productList.vue @@ -59,7 +59,7 @@ this.queryParams.shopIconId = iconId }else if(search){ this.search = search - this.title = '搜素材料' + this.title = '搜索材料' } }, methods: {
¥{{ userInfo.money || 0 }}
¥{{ userInfo.price || 0 }}