From a7b7a72d4ffc8512d906a62018d3cca77cb086b6 Mon Sep 17 00:00:00 2001 From: xy <271556543@qq.com> Date: Mon, 20 Jan 2025 17:51:03 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- component/Share/Share.vue | 50 ++ main.js | 3 + package_sub/pages/AddOrder/AddOrder.vue | 66 +- package_sub/pages/OrderList/OrderList.vue | 280 +++++++ package_sub/pages/ServiceList/ServiceList.vue | 10 +- .../ServiceObject/ServiceObject.vue | 0 pages.json | 9 +- pages/index/index.vue | 72 +- pages/me/me.vue | 33 +- pages/order/order.vue | 12 +- static/toShare.png | Bin 0 -> 4688 bytes store/index.js | 31 +- uview-ui/components/u-select/u-select.vue | 784 +++++++++--------- 13 files changed, 926 insertions(+), 424 deletions(-) create mode 100644 component/Share/Share.vue create mode 100644 package_sub/pages/OrderList/OrderList.vue rename package_sub/{ => pages}/ServiceObject/ServiceObject.vue (100%) create mode 100644 static/toShare.png diff --git a/component/Share/Share.vue b/component/Share/Share.vue new file mode 100644 index 0000000..d006a53 --- /dev/null +++ b/component/Share/Share.vue @@ -0,0 +1,50 @@ + + + + + diff --git a/main.js b/main.js index 1ba71e1..cbc105a 100644 --- a/main.js +++ b/main.js @@ -32,5 +32,8 @@ Vue.prototype.$qqmapsdk = new QQMapWX({ key: 'D5EBZ-C3BWP-HZIDG-VO6BE-P2MN5-ESFZO' }); +let mpShare = require('uview-ui/libs/mixin/mpShare.js'); +Vue.mixin(mpShare) + app.$mount() diff --git a/package_sub/pages/AddOrder/AddOrder.vue b/package_sub/pages/AddOrder/AddOrder.vue index 754e5bc..0cb3553 100644 --- a/package_sub/pages/AddOrder/AddOrder.vue +++ b/package_sub/pages/AddOrder/AddOrder.vue @@ -315,12 +315,14 @@ - + 实付: ¥ {{ accompanyProduct.price }} 立即下单 + 更多 + + {} + switch (this.moreActionList[index].tag) { + case 'cancel': + fn = () => this.$u.api.accompanyProductOrder({ + id: this.orderId, + pay_status: -1 + }).then(_ => { + this.getDetail() + }) + break; + case 'chargeback': + break; + } + uni.showModal({ + title: "操作", + content: `是否确认${name}?`, + success: (status) => { + if (status.confirm) { + fn() + } else { + } + }, + fail: () => { + }, + }) + } }, computed: { currentStep() { @@ -912,6 +954,21 @@ export default { this.list_archive.find((i) => i.id === this.form.user_archive_id) || {} ); }, + moreActionList() { + if (this.form.pay_status === 0) { + return [{ + text: '取消订单', + fontSize: 28, + tag: 'cancel' + }] + } else if (this.form.pay_status === 1) { + return [{ + text: '退单', + fontSize: 28, + tag: 'chargeback' + }] + } + } }, }; @@ -1354,6 +1411,11 @@ export default { font-size: 40rpx; } } + .more { + font-size: 26rpx; + color: #666; + padding-right: 20rpx; + } } .service-list { diff --git a/package_sub/pages/OrderList/OrderList.vue b/package_sub/pages/OrderList/OrderList.vue new file mode 100644 index 0000000..2fa9828 --- /dev/null +++ b/package_sub/pages/OrderList/OrderList.vue @@ -0,0 +1,280 @@ + + + + + diff --git a/package_sub/pages/ServiceList/ServiceList.vue b/package_sub/pages/ServiceList/ServiceList.vue index 7030f3c..43ae40d 100644 --- a/package_sub/pages/ServiceList/ServiceList.vue +++ b/package_sub/pages/ServiceList/ServiceList.vue @@ -5,7 +5,7 @@ - {{select.site_name}} + {{ vuex_site.name || ' ' }} @@ -73,8 +73,6 @@ page: 1, page_size: 5, type: '', - site_id: '', - site_name: '全部站点' }, list: [], loadStatus: 'loadmore', @@ -104,7 +102,8 @@ }, async getList() { const res = await this.$u.api.accompanyProduct({ - ...this.select + ...this.select, + site_id: this.vuex_site?.id }) this.last_page = res.last_page this.loadStatus = this.select.page >= this.last_page ?'nomore':'loadmore' @@ -121,8 +120,7 @@ this.getList() }, confirmSite(e) { - this.select.site_name = e[0].label - this.select.site_id = e[0].value + this.$u.vuex("vuex_site", e[0]) this.list = [] this.select.page = 1 this.getList() diff --git a/package_sub/ServiceObject/ServiceObject.vue b/package_sub/pages/ServiceObject/ServiceObject.vue similarity index 100% rename from package_sub/ServiceObject/ServiceObject.vue rename to package_sub/pages/ServiceObject/ServiceObject.vue diff --git a/pages.json b/pages.json index 46c2cbb..5cb2307 100644 --- a/pages.json +++ b/pages.json @@ -59,7 +59,7 @@ } }, { - "path": "ServiceObject/ServiceObject", + "path": "pages/ServiceObject/ServiceObject", "style": { "navigationBarTitleText": "服务对象" } @@ -70,6 +70,13 @@ "navigationBarTitleText": "我的服务人员", "enablePullDownRefresh": true } + }, + { + "path": "pages/OrderList/OrderList", + "style": { + "navigationBarTitleText": "订单", + "enablePullDownRefresh": true + } } ] } diff --git a/pages/index/index.vue b/pages/index/index.vue index 9e09d75..2a1aec6 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -10,10 +10,11 @@ - {{ vuex_location.city.replace(/(市|区|县)/, "") }} + {{ vuex_site.name }} + @@ -45,9 +46,10 @@ 'padding-right': menuButtonRight + 'px', }" > - + - {{ vuex_location.city.replace(/(市|区|县)/, "") }} + {{ vuex_site.name }} + @@ -192,9 +194,9 @@ @@ -208,6 +210,13 @@ > + + + @@ -226,6 +235,12 @@ export default { }, data() { return { + isShowSite: false, + list_site: [{ + id: '', + name: '全部站点' + }], + isShowSticky: false, scrollTop: 308, statusBarHeight: 40, @@ -266,23 +281,27 @@ export default { hospitals: [], banners: [], + photos: [], }; }, mounted() { this.getElScrollTop(); - if (this.$store.state.vuex_location.status !== 2) { - this.$store.dispatch("getLocation"); - } + // if (this.$store.state.vuex_location.status !== 2) { + // this.$store.dispatch("getLocation"); + // } }, - created() { + onLoad() { this.menuButtonRight = uni.getSystemInfoSync().screenWidth - uni.getMenuButtonBoundingClientRect().left + 10; this.statusBarHeight = uni.getMenuButtonBoundingClientRect().top; - this.getHospital(); - this.getBanner(); + this.getSiteList().then(_ => { + this.getHospital(); + this.getBanner(); + this.getPhotos(); + }) }, onPageScroll(e) { this.isShowSticky = e.scrollTop > this.scrollTop; @@ -306,11 +325,26 @@ export default { }, searchInput(e) {}, + async getSiteList() { + const res = await this.$u.api.otherSite() + this.list_site.push(...res) + let defaultValue = res.find(i => i.name === '常州') + if (defaultValue && !this.vuex_site.id) { + this.$u.vuex('vuex_site', defaultValue) + } + }, + confirmSite(e) { + this.$u.vuex('vuex_site', e[0]) + this.getHospital() + this.getBanner() + this.getPhotos() + }, async getHospital() { try { const res = await this.$u.api.hospitalList({ page: 1, page_size: 5, + site_id: this.vuex_site.id ? this.vuex_site.id : '', "show_relation[0]": "site", }); this.hospitals = res.data; @@ -320,13 +354,23 @@ export default { try { const res = await this.$u.api.banner({ position: 1, + site_id: this.vuex_site.id ? this.vuex_site.id : '', }); this.banners = res.map((i) => ({ ...i, - url: i.image?.url, + url: i.image?.url ?? '', })); } catch (err) {} }, + async getPhotos() { + try { + const res = await this.$u.api.banner({ + position: 2, + site_id: this.vuex_site.id ? this.vuex_site.id : '', + }); + this.photos = res + } catch (err) {} + }, }, }; diff --git a/pages/me/me.vue b/pages/me/me.vue index 7a6bba8..b35b0f0 100644 --- a/pages/me/me.vue +++ b/pages/me/me.vue @@ -12,7 +12,13 @@ - + 陪诊订单 @@ -20,7 +26,13 @@ 商城订单 - + 居家照护订单 @@ -28,13 +40,18 @@ 常用联系人 - + 售后订单 - + 我要分享 @@ -52,18 +69,22 @@ + + @@ -354,64 +354,64 @@ export default { .u-select { - &__action { - position: relative; - line-height: $u-form-item-height; - height: $u-form-item-height; + &__action { + position: relative; + line-height: $u-form-item-height; + height: $u-form-item-height; - &__icon { - position: absolute; - right: 20rpx; - top: 50%; - transition: transform .4s; - transform: translateY(-50%); - z-index: 1; + &__icon { + position: absolute; + right: 20rpx; + top: 50%; + transition: transform .4s; + transform: translateY(-50%); + z-index: 1; - &--reverse { - transform: rotate(-180deg) translateY(50%); - } - } - } + &--reverse { + transform: rotate(-180deg) translateY(50%); + } + } + } - &__hader { - &__title { - color: $u-content-color; - } - } + &__hader { + &__title { + color: $u-content-color; + } + } - &--border { - border-radius: 6rpx; - border-radius: 4px; - border: 1px solid $u-form-item-border-color; - } + &--border { + border-radius: 6rpx; + border-radius: 4px; + border: 1px solid $u-form-item-border-color; + } - &__header { - @include vue-flex; - align-items: center; - justify-content: space-between; - height: 80rpx; - padding: 0 40rpx; - } + &__header { + @include vue-flex; + align-items: center; + justify-content: space-between; + height: 80rpx; + padding: 0 40rpx; + } - &__body { - width: 100%; - height: 500rpx; - overflow: hidden; - background-color: #fff; + &__body { + width: 100%; + height: 500rpx; + overflow: hidden; + background-color: #fff; - &__picker-view { - height: 100%; - box-sizing: border-box; + &__picker-view { + height: 100%; + box-sizing: border-box; - &__item { - @include vue-flex; - align-items: center; - justify-content: center; - font-size: 32rpx; - color: $u-main-color; - padding: 0 8rpx; - } - } - } + &__item { + @include vue-flex; + align-items: center; + justify-content: center; + font-size: 32rpx; + color: $u-main-color; + padding: 0 8rpx; + } + } + } }