From 74377c7dd88afe4ef358966ff7e38025fd95b0dc Mon Sep 17 00:00:00 2001 From: THK3121 Date: Fri, 4 Aug 2023 18:16:03 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/nongKe/supply_chain/goods_list.vue | 624 +++--- pages/nongKe/supply_chain/supplier.vue | 23 +- pages/users/order_list/index.vue | 2209 ++++++++++------------ pages/users/order_list/indexCopy.vue | 340 +--- pages/users/user_address/index.vue | 126 +- 5 files changed, 1516 insertions(+), 1806 deletions(-) diff --git a/pages/nongKe/supply_chain/goods_list.vue b/pages/nongKe/supply_chain/goods_list.vue index 43a20d5..9dc0c5b 100644 --- a/pages/nongKe/supply_chain/goods_list.vue +++ b/pages/nongKe/supply_chain/goods_list.vue @@ -1,334 +1,358 @@ \ No newline at end of file diff --git a/pages/nongKe/supply_chain/supplier.vue b/pages/nongKe/supply_chain/supplier.vue index 43e982d..1c0d91e 100644 --- a/pages/nongKe/supply_chain/supplier.vue +++ b/pages/nongKe/supply_chain/supplier.vue @@ -49,7 +49,7 @@ - + {{item.mer_name}} @@ -189,7 +189,7 @@ - + @@ -289,19 +289,19 @@ storeTypeArr: [], //店铺类型 merList: [], //商户分类 product_type: 0, - show:false, - image: '' ,//图片, - credit_buy:'',//支持先货后款 + show: false, + image: '', //图片, + credit_buy: '', //支持先货后款 }; }, onLoad(options) { - + this.product_type = options.product_type ?? 0 if (options.street_id != undefined) { this.sotreParam.street_id = options.street_id } - this.credit_buy=options.credit_buy + this.credit_buy = options.credit_buy this.sotreParam.type_id = options.type_id this.sotreParam.type_id = options.type_id && options.type_id.split(',').toString() || '' this.sotreParam.category_id = options.cate_id && options.cate_id.split(',').toString() || '' @@ -501,7 +501,7 @@ category_id: this.sotreParam.category_id, type_id: this.sotreParam.type_id, street_id: this.sotreParam.street_id, - credit_buy:this.credit_buy + credit_buy: this.credit_buy } if (this.latitude) { rqData.location = this.latitude + ',' + this.longitude @@ -618,7 +618,7 @@ this.storeMerchantList() } } - + } @@ -627,7 +627,7 @@ width: 100%; height: 140rpx; padding: 0 20rpx; - padding-top:70rpx ; + padding-top: 70rpx; // box-sizing: border-box; position: fixed; left: 0; @@ -1130,12 +1130,13 @@ } } } + .guanbi { width: 20px; height: 20px; margin: 30px auto; } - + .pop { z-index: 1; } diff --git a/pages/users/order_list/index.vue b/pages/users/order_list/index.vue index 90b4c85..99e989b 100644 --- a/pages/users/order_list/index.vue +++ b/pages/users/order_list/index.vue @@ -1,1290 +1,1113 @@ - - - - \ No newline at end of file + .iconfont { + margin-right: 10rpx; + font-size: 23rpx; + } + } + \ No newline at end of file diff --git a/pages/users/order_list/indexCopy.vue b/pages/users/order_list/indexCopy.vue index 1ec640d..496ccd8 100644 --- a/pages/users/order_list/indexCopy.vue +++ b/pages/users/order_list/indexCopy.vue @@ -1,7 +1,9 @@ @@ -411,7 +317,7 @@ orderPay, groupOrderList, orderTake, - applyInvoiceApi, + applyInvoiceApi } from '@/api/order.js'; import { getUserInfo @@ -443,7 +349,6 @@ }, data() { return { - flag: false, loading: false, //是否加载中 loadend: false, //是否加载完毕 loadTitle: '加载更多', //提示语 @@ -476,8 +381,7 @@ title: '可用余额:', number: 0, payStatus: this.$store.getters.globalData.yue_pay_status - }, - + } ], pay_close: false, pay_order_id: '', @@ -489,15 +393,7 @@ invoice: { invoice: false, add: false, - }, - show: false, - shouhuo: { - index: '', - id: '' - }, - //商品分类 - activity_type: '', - product_type: 0 + } }; }, computed: { @@ -513,8 +409,6 @@ } }, onShow() { - this.flag = (this.$route.query.product_type == 0) - console.log(this.flag) if (this.isLogin) { this.page = 1; this.loadend = false; @@ -531,12 +425,15 @@ onReady() {}, mounted: function() {}, methods: { - //去结算 - pay_open: function(order_id) { - uni.navigateTo({ - url: '/pages/order_details/stay?order_id=' + order_id + '&product_type=' + this - .product_type - }) + // 后退 + returns() { + uni.navigateBack() + }, + // 首页 + goHome() { + uni.switchTab({ + url: '/pages/index/index' + }); }, // 去商铺 goMall(item) { @@ -589,7 +486,6 @@ */ onLoad: function(options) { if (options.status) this.orderStatus = options.status; - if (options.product_type) this.product_type = options.product_type; }, /** * 获取订单统计数据 @@ -597,9 +493,7 @@ */ getOrderData: function() { let that = this; - orderData({ - product_type: this.product_type - }).then(res => { + orderData().then(res => { console.log(res.data) that.$set(that, 'orderData', res.data); }) @@ -634,15 +528,10 @@ * */ goPay: function(pay_price, order_id) { - console.log(order_id); - uni.navigateTo({ - url: '/pages/users/payment/payment?order_id=' + order_id + '&product_type=' + this - .product_type - }); - // this.$set(this, 'pay_close', true); - // this.order_id = order_id; - // this.pay_order_id = order_id.toString() - // this.$set(this, 'totalPrice', pay_price); + this.$set(this, 'pay_close', true); + this.order_id = order_id; + this.pay_order_id = order_id.toString() + this.$set(this, 'totalPrice', pay_price); }, /** * 支付成功回调 @@ -668,7 +557,7 @@ /** * 去订单详情 */ - goOrderDetails: function(order_id, product_type) { + goOrderDetails: function(order_id) { let self = this if (!order_id) return that.$util.Tips({ title: '缺少订单号无法查看订单详情' @@ -681,8 +570,7 @@ uni.hideLoading(); if (self.orderStatus == 0) { uni.navigateTo({ - url: '/pages/order_details/stay?order_id=' + order_id + '&product_type=' + - product_type + url: '/pages/order_details/stay?order_id=' + order_id }) } else { uni.navigateTo({ @@ -696,8 +584,7 @@ // #ifndef MP if (self.orderStatus == 0) { uni.navigateTo({ - url: '/pages/order_details/stay?order_id=' + order_id + '&product_type=' + - product_type + url: '/pages/order_details/stay?order_id=' + order_id }) } else { uni.navigateTo({ @@ -764,13 +651,11 @@ groupOrderList({ page: that.page, limit: that.limit, - product_type: that.product_type, }).then(res => { - console.log(res); that.isReady = true; - let list = res.data.return || []; + let list = res.data.list || []; let loadend = list.length < that.limit; - console.log(that.orderList) + // console.log(that.orderList) that.orderList = that.page == 1 ? list : that.$util.SplitArray(list, that .orderList); that.$set(that, 'orderList', that.orderList); @@ -786,13 +671,7 @@ status: that.orderStatus - 1, page: that.page, limit: that.limit, - product_type: that.product_type, }).then(res => { - // res.data.list[0].status=2 - console.log(res) - res.data.list.forEach(item => { - console.log([item.status, item.pay_type]); - }) let list = res.data.list || []; let loadend = list.length < that.limit; that.orderList = that.page == 1 ? list : that.$util.SplitArray(list, that @@ -864,26 +743,27 @@ }, // 确认收货 confirmOrder: function(item, index) { - this.show = true - this.shouhuo.id = item.order_id - this.shouhuo.index = index - }, - queding() { let that = this; - orderTake(that.shouhuo.id).then(res => { - that.show = false - that.orderList.splice(that.shouhuo.index, 1); - that.getOrderData(); - return that.$util.Tips({ - title: '操作成功', - icon: 'success', - }) - - }).catch(err => { - return that.$util.Tips({ - title: err - }); - that.show = false + uni.showModal({ + title: '确认收货', + content: '为保障权益,请收到货确认无误后,再确认收货', + success: function(res) { + if (res.confirm) { + orderTake(item.order_id).then(res => { + return that.$util.Tips({ + title: '操作成功', + icon: 'success' + }, function() { + that.orderList.splice(index, 1); + that.getOrderData(); + }); + }).catch(err => { + return that.$util.Tips({ + title: err + }); + }) + } + } }) }, /*申请开票*/ @@ -911,11 +791,7 @@ title: err }); }) - }, - close() { - this.show = false - }, - + } }, onReachBottom: function() { this.getOrderList(); @@ -924,6 +800,13 @@ \ No newline at end of file diff --git a/pages/users/user_address/index.vue b/pages/users/user_address/index.vue index 495fc0c..6a49cd2 100644 --- a/pages/users/user_address/index.vue +++ b/pages/users/user_address/index.vue @@ -5,11 +5,13 @@ 姓名 - + 联系电话 - + 所在地区 @@ -18,13 +20,14 @@ 请选择地址 {{addressText}} - + 详细地址 - +
@@ -35,7 +38,8 @@
- 设置为默认地址 + 设置为默认地址 + @@ -43,12 +47,13 @@ 导入微信地址 - 导入微信地址 + 导入微信地址 +
- + @@ -63,11 +68,21 @@ // +---------------------------------------------------------------------- // | Author: CRMEB Team // +---------------------------------------------------------------------- - import { editAddress, getAddressDetail } from '@/api/user.js'; - import { getCityV2, getCityList } from '@/api/api.js'; - import { mapGetters } from "vuex"; + import { + editAddress, + getAddressDetail + } from '@/api/user.js'; + import { + getCityV2, + getCityList + } from '@/api/api.js'; + import { + mapGetters + } from "vuex"; import areaWindow from '@/components/areaWindow'; - import { getGeocoder } from '@/api/store.js'; + import { + getGeocoder + } from '@/api/store.js'; import authorize from '@/components/Authorize'; export default { components: { @@ -92,14 +107,15 @@ multiIndex: [0, 0, 0], cityId: 0, display: false, - addressInfo:[], + addressInfo: [], latitude: '', longitude: '' }; }, - computed: {...mapGetters(['isLogin','viewColor']), - addressText(){ - return this.addressInfo.map(v=>v.name).join('/'); + computed: { + ...mapGetters(['isLogin', 'viewColor']), + addressText() { + return this.addressInfo.map(v => v.name).join('/'); } }, onLoad(options) { @@ -119,7 +135,7 @@ } }, methods: { - OnChangeAddress(address){ + OnChangeAddress(address) { this.addressInfo = address; }, // 地址数据 @@ -129,7 +145,7 @@ this.district = res.data }) }, - changeRegion(){ + changeRegion() { this.display = true; }, // 关闭地址弹窗; @@ -170,7 +186,8 @@ success: function(res) { uni.chooseAddress({ success: function(res) { - getCityList(res.provinceName+'/'+res.cityName+'/'+res.countyName).then(res=>{ + getCityList(res.provinceName + '/' + res.cityName + '/' + res + .countyName).then(res => { that.addressInfo = res.data; }) that.userAddress.real_name = res.userName; @@ -183,9 +200,10 @@ icon: 'none', duration: 1000 }); - if (res.errMsg == 'chooseAddress:cancel') return that.$util.Tips({ - title: '取消选择' - }); + if (res.errMsg == 'chooseAddress:cancel') return that.$util + .Tips({ + title: '取消选择' + }); }, }) }, @@ -212,7 +230,7 @@ getAddress() { let that = this; that.$wechat.openAddress().then(res => { - getCityList(res.provinceName+'/'+res.cityName+'/'+res.countryName).then(res=>{ + getCityList(res.provinceName + '/' + res.cityName + '/' + res.countryName).then(res => { that.addressInfo = res.data; }) that.userAddress.real_name = res.userName; @@ -222,14 +240,17 @@ // console.log(err); }); }, + selfLocation() { + console.log(66) let self = this uni.showLoading({ title: '定位中', mask: true, }); uni.getLocation({ - type: 'gcj02', + type: 'wgs84', + timeout: '10', success: (res) => { let latitude, longitude; latitude = res.latitude.toString(); @@ -241,11 +262,15 @@ long: longitude }).then(res => { const data = res.data; - getCityList(data.address_component.province+'/'+data.address_component.city+'/'+data.address_component.district+'/'+(!data.address_reference.town ? '' : data.address_reference.town.title)).then(res=>{ + getCityList(data.address_component.province + '/' + data.address_component + .city + '/' + data.address_component.district + '/' + (!data + .address_reference.town ? '' : data.address_reference.town + .title)).then(res => { self.addressInfo = res.data; - self.$set(self.userAddress, 'detail', data.formatted_addresses.recommend); + self.$set(self.userAddress, 'detail', data.formatted_addresses + .recommend); uni.hideLoading(); - }).catch(e=>{ + }).catch(e => { uni.hideLoading(); uni.showToast({ title: '定位失败,请手动输入地址', @@ -253,7 +278,7 @@ duration: 1000 }); }) - }).catch(e=>{ + }).catch(e => { uni.hideLoading(); uni.showToast({ title: '定位失败,请手动输入地址', @@ -323,8 +348,10 @@ that.couponId = ''; uni.$emit('updataAddress') uni.navigateTo({ - url: '/pages/users/order_confirm/index?cartId=' + cartId + '&addressId=' + (that.id ? that.id : res.data - .address_id) + '&pinkId=' + pinkId + '&couponId=' + couponId + url: '/pages/users/order_confirm/index?cartId=' + cartId + + '&addressId=' + (that.id ? that.id : res.data + .address_id) + '&pinkId=' + pinkId + '&couponId=' + + couponId }); } else { // #ifdef H5 @@ -353,74 +380,92 @@ + \ No newline at end of file