diff --git a/App.vue b/App.vue index 0bb195b..839c098 100644 --- a/App.vue +++ b/App.vue @@ -61,8 +61,9 @@ this.getBannerList(), this.getPricePreviewList(), this.getConfigData(), + this.getQrCode() ] - this.getQrCode() + await Promise.all(promises) // 确保进度达到100% diff --git a/api/model/index.js b/api/model/index.js index 0513b09..9ebe757 100644 --- a/api/model/index.js +++ b/api/model/index.js @@ -212,6 +212,21 @@ const api = { method: 'GET', auth : true, }, + getcheckoutReasons: { + url: '/recycle-admin/applet/order/getcheckoutReasons', + method: 'GET', + auth: true, + }, + submitQualityInfo: { + url: '/recycle-admin/applet/info_team_order/submitQualityInfo', + method: 'POST', + auth: true, + }, + cancelOrder: { + url: '/recycle-admin/applet/order/cancelOrder', + method: 'POST', + auth: true, + }, } export default api \ No newline at end of file diff --git a/config.js b/config.js index eba31b4..081fdcd 100644 --- a/config.js +++ b/config.js @@ -2,9 +2,6 @@ const type = 'dev' const config = { - local: { - baseUrl: 'http://127.0.0.1', - }, dev: { baseUrl: 'http://h5.xzaiyp.top', }, diff --git a/pages.json b/pages.json index b0a608a..f3fffc4 100644 --- a/pages.json +++ b/pages.json @@ -31,23 +31,6 @@ } ], "subPackages": [ - { - "root": "pages/mine", - "pages": [ - { - "path": "recyclingDestination", - "style": { - "navigationStyle": "custom" - } - }, - { - "path": "questionDetail", - "style": { - "navigationStyle": "custom" - } - } - ] - }, { "root": "pages/subcomponent", "pages": [ diff --git a/pages/baoyou-city/baoyou-city.vue b/pages/baoyou-city/baoyou-city.vue index a8aa39a..e883fff 100644 --- a/pages/baoyou-city/baoyou-city.vue +++ b/pages/baoyou-city/baoyou-city.vue @@ -9,9 +9,7 @@ - + @@ -67,12 +65,6 @@ export default { } }); }, - computed: { - city_banner() { - const item = getApp().globalData.configData.find(i => i.keyName === 'city_banner') - return item ? item.keyContent : '' - } - }, methods: { goBack() { uni.navigateBack() diff --git a/pages/component/home.vue b/pages/component/home.vue index 8ff9bd7..5ab01c0 100644 --- a/pages/component/home.vue +++ b/pages/component/home.vue @@ -8,7 +8,7 @@ :interval="3000" :duration="500" circular - style="width: 100%; height: 320rpx;" + style="width: 100%; height: 380rpx;" > - + {{item.title}} - {{item.description}} + {{item.desc}} @@ -200,22 +197,22 @@ export default { { icon: '/static/home/爱心援乡.png', title: '爱心援乡', - description: '精准帮扶贫困群体' + desc: '精准帮扶贫困群体' }, { icon: '/static/home/回塑新源.png', title: '回塑新源', - description: '塑料的第二次成型' + desc: '塑料的第二次成型' }, { icon: '/static/home/织物出海.png', title: '织物出海', - description: '分拣出最高价值' + desc: '分拣出最高价值' }, { icon: '/static/home/碳循再生.png', title: '碳循再生', - description: '减碳从出发生系统' + desc: '减碳从出发生系统' } ], bannerList: [], @@ -339,12 +336,6 @@ export default { } }) }, - getRecyclingDestination() { - this.$api('getRecyclingDestination') - .then(res => { - this.destinations = res.result - }) - }, goToInspectionReport(item) { uni.navigateTo({ url: `/pages/subcomponent/inspection-report?id=${item.id}` @@ -424,7 +415,6 @@ export default { // 监听全局数据更新 uni.$on('configDataUpdated', this.updateCionData); this.getPricePreview(); - this.getRecyclingDestination() }, } @@ -445,7 +435,7 @@ export default { .banner { width: 100%; - height: 330rpx; + height: 390rpx; position: relative; overflow: hidden; border-radius: 0 0 30rpx 30rpx; diff --git a/pages/component/my.vue b/pages/component/my.vue index 0518940..c309849 100644 --- a/pages/component/my.vue +++ b/pages/component/my.vue @@ -393,8 +393,8 @@ export default { return getApp().globalData.bannerList || [] }, myBannerImage() { - const item = getApp().globalData.configData.find(i => i.keyName === 'user_banner') - return item ? item.keyContent : '' + const banner = (getApp().globalData.bannerList || []).find(item => item.title === '我的-轮播图'); + return banner ? banner.image : ''; }, userTypeText() { // 0 普通用户, 1 推广达人, 2 推广大使 @@ -452,7 +452,7 @@ export default { } .banner { - height: 320rpx; + height: 400rpx; background: #ff6b35; position: relative; overflow: hidden; diff --git a/pages/component/recycle copy.vue b/pages/component/recycle copy.vue index b34939a..134e98e 100644 --- a/pages/component/recycle copy.vue +++ b/pages/component/recycle copy.vue @@ -249,7 +249,7 @@ 回收规则 - + - @@ -253,7 +250,7 @@ 回收规则 - + - - - {{ logoName }} - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/pages/manager/inspect-result.vue b/pages/manager/inspect-result.vue index 2f0dcb9..4c5269e 100644 --- a/pages/manager/inspect-result.vue +++ b/pages/manager/inspect-result.vue @@ -125,9 +125,9 @@ - - - {{ item }} + + + {{ item.reason }} @@ -153,8 +153,8 @@ export default { reasonPopupVisible: false, currentReasonTitle: '', reasonImages: [], - reasonOptions: ['大面积破损', '不可回收', '顽固污渍', '污渍无法清除', '异味严重', '带有危险物品'], - reasonChecked: [false, true, false, true, false, false], + reasonOptions: [], + reasonChecked: [], currentReasonItem: null, isPopupOpen: false // 控制弹窗状态 } @@ -224,6 +224,7 @@ export default { let unqualifiedCount = 0 let unrecyclableCount = 0 + console.log('item', item) item.commonOrderList.forEach(commonItem => { if (commonItem.testingStatus === 0) { qualifiedCount++ @@ -244,7 +245,7 @@ export default { this.qualifiedList.push({ id: item.id, name: displayName, - shopClass: item.shopClass, + shopClass: this.getShopClass(item.id), shopId: item.shopId, price: itemPrice, count: qualifiedCount, @@ -268,7 +269,7 @@ export default { unqualifiedItems.push({ id: commonItem.id, name: `${itemNames}${index}`, - shopClass: item.shopClass, + shopClass: this.getShopClass(item.id), shopId: item.shopId, reason: '', images: savedImages, @@ -282,7 +283,7 @@ export default { this.unqualifiedGroups.push({ id: item.id, name: displayName, - shopClass: item.shopClass, + shopClass: this.getShopClass(item.id), shopId: item.shopId, price: itemPrice, total: 0, // 不合格产品总价为0 @@ -327,23 +328,37 @@ export default { }, finishInspect() { // 这里可以将最终的inspectData提交到服务器 - console.log('最终的质检数据:', JSON.stringify(this.inspectData, null, 2)) + this.inspectData["list"]=JSON.stringify(this.inspectData["list"], null, 2) + console.log('最终的质检数据:', this.inspectData); // 可以调用API提交数据 - // this.$api('submitInspectResult', { inspectData: this.inspectData }, res => { - // if (res && res.code === 200) { - // uni.showToast({ title: '质检完成', icon: 'success' }) - // uni.navigateBack() - // } - // }) + this.$api('submitQualityInfo', this.inspectData , res => { + if (res && res.code === 200) { + uni.showToast({ title: '质检完成', icon: 'success' }) + uni.navigateBack() + } + }) uni.showToast({ title: '完成质检', icon: 'success' }) }, + selectReasonForUnqualified(item,type) { + this.$api('getcheckoutReasons', { + classId: item.shopClass, + type: type + }, res => { + console.log('res', res) + if(res.code == 200){ + this.reasonOptions = res.result; + } + }) + }, selectReason(item) { + console.log('item', item) this.currentReasonItem = item this.currentReasonTitle = item.name this.reasonImages = item.images || [] this.reasonChecked = item.reasons || Array(this.reasonOptions.length).fill(false) + this.selectReasonForUnqualified(item,0) this.lockScroll() this.$refs.reasonPopup.open() }, @@ -352,14 +367,17 @@ export default { this.currentReasonTitle = this.getItemName(item.id) this.reasonImages = item.images || [] this.reasonChecked = item.reasons || Array(this.reasonOptions.length).fill(false) + this.selectReasonForUnqualified(item,1) this.lockScroll() this.$refs.reasonPopup.open() }, selectReasonForUnrecyclable(item) { + console.log('item', item) this.currentReasonItem = item this.currentReasonTitle = this.getItemName(item.id) this.reasonImages = item.images || [] this.reasonChecked = item.reasons || Array(this.reasonOptions.length).fill(false) + this.selectReasonForUnqualified(item,2) this.lockScroll() this.$refs.reasonPopup.open() }, @@ -436,6 +454,7 @@ export default { this.reasonImages.splice(idx, 1) }, toggleReason(idx) { + console.log this.$set(this.reasonChecked, idx, !this.reasonChecked[idx]) }, saveReason() { @@ -443,7 +462,7 @@ export default { if (this.currentReasonItem) { this.currentReasonItem.images = [...this.reasonImages] this.currentReasonItem.reasons = [...this.reasonChecked] - + // console.log('this.currentReasonItem', this.currentReasonItem) // 更新inspectData中的数据 this.updateInspectData() } @@ -456,7 +475,7 @@ export default { const selectedReasonIds = [] this.reasonChecked.forEach((checked, index) => { if (checked) { - selectedReasonIds.push(index.toString()) + selectedReasonIds.push(this.reasonOptions[index].id.toString()) } }) @@ -552,6 +571,15 @@ export default { } return '未知商品' }, + getShopClass(id) { + if (this.order && this.order.commonOrderList) { + // console.log('this.order', ShopClass) + const ShopClass = this.order.commonOrderList.find(item => item.id == id) + // console.log('ShopClass', ShopClass) + return ShopClass ? ShopClass.shopClass: '' + } + return '' + }, getItemBrand(id) { if (this.order && this.order.commonOrderList) { const orderItem = this.order.commonOrderList.find(item => item.id == id) diff --git a/pages/manager/inspect.vue b/pages/manager/inspect.vue index bcd7b7e..2ed4c69 100644 --- a/pages/manager/inspect.vue +++ b/pages/manager/inspect.vue @@ -143,11 +143,12 @@ export default { commonOrderList: [] } } - + console.log('groupedGoods', groupedGoods) // 为每个数量创建对应的质检项 for (let i = 0; i < (item.num || 0); i++) { + // console.log('groupedGoods[item.id]', groupedGoods[item.id]) groupedGoods[item.id].commonOrderList.push({ - id: `${item.id}-${i}`, // 生成唯一ID + id: `${item.commonOrderList[i].id}`, // 生成唯一ID testingInstructions: '', testingImages: '', testingStatus: '' // 默认为空 diff --git a/pages/manager/order-detail.vue b/pages/manager/order-detail.vue index 7737064..a26c545 100644 --- a/pages/manager/order-detail.vue +++ b/pages/manager/order-detail.vue @@ -177,7 +177,7 @@ - + @@ -225,7 +225,7 @@ export default { // 基础信息 this.baseInfo = [ { label: '订单编号', value: data.ordeNo, copy: true }, - ...(data.status === 2 ? [{ label: '快递单号', value: data.wliuNo, copy: true }] : []), + ...(data.wliuNo ? [{ label: '快递单号', value: data.wliuNo, copy: true }] : []), { label: '用户名', value: data.name, arrow: true }, { label: '取件地址', value: data.address + (data.addressDetail || '') }, { label: '预约时间', value: data.goTime } diff --git a/pages/manager/order.vue b/pages/manager/order.vue index 5cba921..4058b97 100644 --- a/pages/manager/order.vue +++ b/pages/manager/order.vue @@ -294,7 +294,7 @@ export default { // if (state === 3) { // return { label: '已取消', class: 'gray' } // } - if (status === 1 && state != 3) { + if ((status === 1||status === 0) && state != 3) { return { label: '已预约', class: 'green' } } else if (state === 1) { return { label: '待质检', class: 'orange' } diff --git a/pages/subcomponent/about.vue b/pages/subcomponent/about.vue index d6caf1a..3342bbc 100644 --- a/pages/subcomponent/about.vue +++ b/pages/subcomponent/about.vue @@ -10,7 +10,7 @@ - + diff --git a/pages/subcomponent/detail.vue b/pages/subcomponent/detail.vue index b11d266..7f00c56 100644 --- a/pages/subcomponent/detail.vue +++ b/pages/subcomponent/detail.vue @@ -327,11 +327,17 @@ export default { this.showCancelModal = false; // 模拟取消动作 this.currentStep = 0; - this.currentStatus = { - text: '已取消', - time: this.getNowTime(), - icon: '/static/【待取件】快递员正在赶来.png' - }; + // this.currentStatus = { + // text: '已取消', + // time: this.getNowTime(), + // icon: '/static/【待取件】快递员正在赶来.png' + // }; + this.$api('cancelOrder', { orderId: this.orderId }, res => { + if (res && res.code === 200) { + console.log('res', res) + uni.showToast({ title: '订单已取消', icon: 'none' }); + } + }) // uni.showToast({ title: '订单已取消', icon: 'none' }); }, getNowTime() { diff --git a/pages/subcomponent/pickup.vue b/pages/subcomponent/pickup.vue index f7e8b5d..b0ce214 100644 --- a/pages/subcomponent/pickup.vue +++ b/pages/subcomponent/pickup.vue @@ -64,7 +64,7 @@ {{ item.name }} {{ item.brandName }} - {{ item.desc }} + ¥{{ item.unitPrice }}/件 x{{ item.quantity }}