From a6cdbcfe28fcc40ebb4919f57d60fb20122e8e57 Mon Sep 17 00:00:00 2001 From: wwl <xchao828@163.com> Date: 星期二, 12 八月 2025 09:10:35 +0800 Subject: [PATCH] 1 --- pagesA/appointment/appointment.vue | 759 +++++++++++++++++++++++++++------------------------------- 1 files changed, 353 insertions(+), 406 deletions(-) diff --git a/pagesA/appointment/appointment.vue b/pagesA/appointment/appointment.vue index ca881b1..7f28af3 100644 --- a/pagesA/appointment/appointment.vue +++ b/pagesA/appointment/appointment.vue @@ -1,448 +1,395 @@ <template> - <view class="page"> - <image class="bg-image" src="/static/images/tabbar/loginbg.png" mode="aspectFill"></image> - <view class="header"> + <view class="page"> + <image class="bg-image" src="/static/images/tabbar/loginbg.png" mode="aspectFill"></image> + <view class="header"> + <view class="search-bar"> + <view class="filter" @click="getListscreen"> + <text>绛涢��</text> + <uni-icons type="bottom" size="12" color="#666"></uni-icons> + </view> + <view class="search"> + <uni-icons type="search" size="16" color="#999"></uni-icons> + <input type="text" v-model="searchQuery" placeholder="鎼滅储浣撴濂楅" placeholder-class="placeholder" /> + <text class="search-btn" @click="getListsearch">鎼滅储</text> + </view> + </view> + </view> - <view class="search-bar"> - <view class="filter" @click="getListscreen"> - <text>绛涢��</text> - <uni-icons type="bottom" size="12" color="#666"></uni-icons> - </view> - <view class="search"> - <uni-icons type="search" size="16" color="#999"></uni-icons> - <input type="text" placeholder="鎼滅储浣撴濂楅" placeholder-class="placeholder" /> - <text class="search-btn" @click="getListsearch">鎼滅储</text> - </view> - </view> - </view> + <!-- 椤堕儴寮圭獥 --> + <uni-popup class="select_popup" ref="selectPopup" :mask-click="false"> + <view class="selectPopup"> + <view class="select_popup_list"> + <view class="select_popup_item" @click="itemChoosed(item, index)" v-for="(item, index) in dataList" :key="index"> + <text :style="{ 'color': choosedList.indexOf(item) != -1 ? '#F6A235' : '#333333' }">{{ item.name }}</text> + </view> + </view> + <view> + <text class="select_btn" @click="resetChoosedList">閲嶇疆</text> + <text class="select_btn" @click="submit">纭畾</text> + </view> + </view> + </uni-popup> - <!-- 椤堕儴寮圭獥 --> - <uni-popup class="select_popup" ref="selectPopup" :mask-click="false"> - <view class="selectPopup"> - <view class="select_popup_list"> - <view class="select_popup_item" @click="itemChoosed(item,index)" v-for="(item,index) in dataList"> - <text - :style="{'color': (choosedList.indexOf(item) != -1 ? '#F6A235':'#333333')}">{{item.name}}</text> - <!-- <image v-show="choosedList.indexOf(item) != -1 ? itemChoose : itemNotChoose " - src="../../static/image/icons/select_choosed.png" mode=""></image> --> - </view> - </view> - <!-- <view class="filter-section"> - <view class="time-grid"> - <view class="grid-item" @click="itemChoosed(item,index)" v-for="(item,index) in dataList" :key="index"> - {{ item }} - </view> - </view> - </view> --> - - <view > - <text class="select_btn" @click="resetChoosedList">閲嶇疆</text> - <text class="select_btn" @click="submit">纭畾</text> - </view> - </view> - </uni-popup> - - <scroll-view class="content" scroll-y> - <view class="list"> - <view v-for="(item, index) in packagelist" :key="index" class="card"> - <image class="card-img" :src="item.image" mode="aspectFill"></image> - <view class="card-content" @click="package(item.pacId)"> - <view class="card-header"> - <text class="name">{{ item.pacName }}</text> - <view class="hospital">{{ item.hospital }}</view> - <view class="tag-row"> - <view class="tag"> - <image class="img" src="/static/images/index/tao.png" mode="aspectFill"></image> - <text>鍋ュ悍璇�</text> - </view> - <text class="book-time">{{ item.bookTime }}</text> - </view> - </view> - <view class="card-footer"> - <view class="price"> - <text class="currency">楼</text> - <text class="amount">{{ item.price }}</text> - </view> - <text class="book-count">棰勭害閲弡{ item.bookCount }}+</text> - </view> - </view> - </view> - </view> - </scroll-view> - </view> + <scroll-view class="content" scroll-y> + <view class="list"> + <view v-for="(item, index) in packagelist" :key="index" class="card"> + <image class="card-img" :src="item.image" mode="aspectFill"></image> + <view class="card-content" @click="package(item.pacId)"> + <view class="card-header"> + <text class="name">{{ item.pacName }}</text> + <view class="hospital">{{ item.hospital }}</view> + <view class="tag-row"> + <view class="tag"> + <image class="img" src="/static/images/index/tao.png" mode="aspectFill"></image> + <text>鍋ュ悍璇�</text> + </view> + <text class="book-time">{{ item.bookTime }}</text> + </view> + </view> + <view class="card-footer"> + <view class="price"> + <text class="currency">楼</text> + <text class="amount">{{ item.price }}</text> + </view> + <text class="book-count">棰勭害閲弡{ item.bookCount || 0 }}</text> + </view> + </view> + </view> + </view> + </scroll-view> + </view> </template> + <script> - import { - getPackageList, - getList, - } from "@/api/system/package"; +import { getPackageList, getList } from "@/api/system/package"; - export default { - data() { - return { - dataList: {}, - packagelist: [], - choosedList: [], - // dataList: [{ - // value: "鐢�", - // text:"0" - // }, { - // value: "濂�", - // text:"1" - // }, - // { - // value: "鎵�鏈�", - // text:"2" - // } - // ], - categoryId: "", - // itemChoose: true, - // itemNotChoose: false, - } - }, - //鐢熷懡鍛ㄦ湡鏂规硶 鈥斺�� 椤甸潰鍔犺浇鏃� - onLoad() { - this.getList(); - this.getliebiao(); - }, - methods: { - getliebiao() { - getList().then(res => { - this.dataList = res.data; - }) - }, - /** 鏌ヨ鍒楄〃 */ - getList() { - uni.showLoading({ - title: '璇风◢绛夛紒' - }) - getPackageList(this.queryParams).then((response) => { - if (response.code == 200) { - uni.hideLoading() - this.packagelist = response.data; - } - }); - // uni.navigateTo({ - // url: '/pagesA/search/search' - // }) - }, - getListsearch() { - uni.navigateTo({ - url: '/pagesA/search/search' - }) - }, - - getListscreen() { - this.toggle() - }, - toggle() { - // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦� uni-popup 缁勪欢涓婄粦瀹� type灞炴�� - this.$refs.selectPopup.open('top') - }, - itemChoosed(item, index) { - this.choosedItem = index - if (this.choosedList.indexOf(item) !== -1) { - this.choosedList.splice(this.choosedList.indexOf(item), 1) - } else { - this.choosedList.push(item) - if (this.choosedList.length > 1) { - this.choosedList.forEach(item1 => { - if (item1 != item) { - this.choosedList.splice(item1, 1) - } - }) - // this.$modal.msgError("鍙兘閫夋嫨涓�椤癸紒") - } - } - - }, - - - //鐐瑰嚮閲嶇疆鎸夐挳 - resetChoosedList() { - this.choosedList = [] - this.$refs.selectPopup.close() - }, - //鐐瑰嚮纭畾鎸夐挳 - submit() { - if (this.choosedList.length == 1) { - this.choosedList.forEach(item => { - this.categoryId = item.id - }) - let data = { - categoryId: this.categoryId - } - getPackageList(data).then(res => { - this.packagelist = res.data - this.$refs.selectPopup.close() - }) - } else { - this.$modal.msgError("鍙兘閫夋嫨涓�椤�!") - } - - - }, - - //璺宠浆 - package(pacId) { - uni.navigateTo({ - url: '/pagesA/PackageDetails/PackageDetails?pacId=' + pacId - }) - } - } - } +export default { + data() { + return { + dataList: [], + packagelist: [], + choosedList: [], + categoryId: "", + searchQuery: "", // 瀛樺偍杈撳叆妗嗙殑鍊� + }; + }, + onLoad() { + this.getList(); + this.getliebiao(); + }, + methods: { + getliebiao() { + getList().then(res => { + this.dataList = res.data; + }); + }, + /** 鏌ヨ鍒楄〃 */ + getList() { + uni.showLoading({ + title: '璇风◢绛夛紒' + }); + const params = { + categoryId: this.categoryId, + pacName: this.searchQuery // 鍖呭惈杈撳叆妗嗙殑鎼滅储鍊� + }; + getPackageList(params).then(response => { + uni.hideLoading(); + if (response.code == 200) { + this.packagelist = response.data; + } + }); + }, + getListsearch() { + // 鎼滅储鎸夐挳瑙﹀彂绛涢�� + this.getList(); + }, + getListscreen() { + this.toggle(); + }, + toggle() { + this.$refs.selectPopup.open('top'); + }, + itemChoosed(item, index) { + this.choosedItem = index; + if (this.choosedList.indexOf(item) !== -1) { + this.choosedList.splice(this.choosedList.indexOf(item), 1); + } else { + this.choosedList.push(item); + if (this.choosedList.length > 1) { + this.choosedList = [item]; // 闄愬埗鍙兘閫夋嫨涓�椤� + } + } + }, + resetChoosedList() { + this.choosedList = []; + this.categoryId = ""; + this.searchQuery = ""; // 閲嶇疆杈撳叆妗嗗�� + this.getList(); + this.$refs.selectPopup.close(); + }, + submit() { + if (this.choosedList.length === 1) { + this.categoryId = this.choosedList[0].id; + const data = { + categoryId: this.categoryId, + pacName: this.searchQuery // 鍖呭惈杈撳叆妗嗙殑鎼滅储鍊� + }; + getPackageList(data).then(res => { + this.packagelist = res.data; + this.$refs.selectPopup.close(); + }); + } else { + this.$modal.msgError("鍙兘閫夋嫨涓�椤�!"); + } + }, + package(pacId) { + uni.navigateTo({ + url: '/pagesA/PackageDetails/PackageDetails?pacId=' + pacId + }); + } + } +}; </script> -<style> - page { - height: 100%; - } - .page { - height: 100%; - display: flex; - flex-direction: column; - background-color: #f5f5f5; - position: relative; - } +<style scoped> +page { + height: 100%; +} - .header { - background: #fff; - padding: 0 30rpx; - flex-shrink: 0; - } +.page { + height: 100%; + display: flex; + flex-direction: column; + background-color: #f5f5f5; + position: relative; +} - .search-bar { - display: flex; - align-items: center; - padding: 20rpx 0 30rpx; - gap: 20rpx; - } +.header { + background: #fff; + padding: 0 30rpx; + flex-shrink: 0; +} - .search-btn { - color: #007AFF; - font-size: 14px; - } +.search-bar { + display: flex; + align-items: center; + padding: 20rpx 0 30rpx; + gap: 20rpx; +} - .filter { - display: flex; - align-items: center; - gap: 4rpx; - font-size: 14px; - color: #333; - } +.search-btn { + color: #007AFF; + font-size: 14px; +} - .search { - flex: 1; - height: 72rpx; - background: #f5f5f5; - border-radius: 36rpx; - display: flex; - align-items: center; - padding: 0 30rpx; - gap: 10rpx; - } +.filter { + display: flex; + align-items: center; + gap: 4rpx; + font-size: 14px; + color: #333; +} - .search input { - flex: 1; - height: 100%; - font-size: 14px; - } +.search { + flex: 1; + height: 72rpx; + background: #f5f5f5; + border-radius: 36rpx; + display: flex; + align-items: center; + padding: 0 30rpx; + gap: 10rpx; +} - .placeholder { - color: #999; - font-size: 14px; - } +.search input { + flex: 1; + height: 100%; + font-size: 14px; +} - .content { - flex: 1; - overflow: auto; - } +.placeholder { + color: #999; + font-size: 14px; +} - .list { - padding: 20rpx 30rpx; - } +.content { + flex: 1; + overflow: auto; +} - .card { - margin-bottom: 20rpx; - background: #fff; - border-radius: 12rpx; - overflow: hidden; - display: flex; - } +.list { + padding: 20rpx 30rpx; +} - .card-img { - width: 200rpx; - height: 200rpx; - flex-shrink: 0; - } +.card { + margin-bottom: 20rpx; + background: #fff; + border-radius: 12rpx; + overflow: hidden; + display: flex; +} - .card-content { - flex: 1; - padding: 20rpx; - display: flex; - flex-direction: column; - justify-content: space-between; - } +.card-img { + width: 200rpx; + height: 200rpx; + flex-shrink: 0; +} - .card-header { - flex: 1; - } +.card-content { + flex: 1; + padding: 20rpx; + display: flex; + flex-direction: column; + justify-content: space-between; +} - .name { - font-size: 16px; - font-weight: 500; - color: #333; - margin-bottom: 8rpx; - } +.card-header { + flex: 1; +} - .hospital { - font-size: 14px; - color: #666; - margin-bottom: 12rpx; - } +.name { + font-size: 16px; + font-weight: 500; + color: #333; + margin-bottom: 8rpx; +} - .tag-row { - display: flex; - align-items: center; - gap: 12rpx; - } +.hospital { + font-size: 14px; + color: #666; + margin-bottom: 12rpx; +} - .tag { - display: flex; - align-items: center; - gap: 4rpx; - padding: 4rpx 12rpx; - /* background: #F8D7BE; - border-radius: 4rpx; */ - width: 142rpx; - height: 40rpx; - background: linear-gradient( 180deg, #FDE0C8 0%, #F7D5BB 100%); - border-radius: 8rpx 8rpx 8rpx 8rpx; - } - .tag .img{ - width: 24rpx; - height: 22.42rpx; - /* background: linear-gradient( 137deg, #E9C7A7 0%, #CC915D 100%, #CB8E59 100%); */ - } +.tag-row { + display: flex; + align-items: center; + gap: 12rpx; +} - .tag text { - width: 82rpx; - height: 26rpx; - font-family: Source Han Sans CN, Source Han Sans CN; - font-weight: 400; - font-size: 26rpx; - color: #71503B; - line-height: 26rpx; - text-align: left; - font-style: normal; - text-transform: none; - padding-left: 10rpx; - } +.tag { + display: flex; + align-items: center; + gap: 4rpx; + padding: 4rpx 12rpx; + width: 142rpx; + height: 40rpx; + background: linear-gradient(180deg, #FDE0C8 0%, #F7D5BB 100%); + border-radius: 8rpx; +} - .book-time { - font-size: 12px; - color: #3a7fff; - } +.tag .img { + width: 24rpx; + height: 22.42rpx; +} - .card-footer { - display: flex; - justify-content: space-between; - align-items: center; - } +.tag text { + width: 82rpx; + height: 26rpx; + font-family: Source Han Sans CN, Source Han Sans CN; + font-weight: 400; + font-size: 26rpx; + color: #71503B; + line-height: 26rpx; + text-align: left; + font-style: normal; + text-transform: none; + padding-left: 10rpx; +} - .price { - display: flex; - align-items: baseline; - } +.book-time { + font-size: 12px; + color: #3a7fff; +} - .currency { - font-size: 12px; - color: #F59C28; - } +.card-footer { + display: flex; + justify-content: space-between; + align-items: center; +} - .amount { - font-size: 20px; - font-weight: 500; - color: #F59C28; - } +.price { + display: flex; + align-items: baseline; +} - .book-count { - - font-family: D-DIN-PRO, D-DIN-PRO; - font-weight: 400; - font-size: 26rpx; - color: #65686A; - line-height: 42rpx; - - } +.currency { + font-size: 12px; + color: #F59C28; +} - .bg-image { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: 0; - } +.amount { + font-size: 20px; + font-weight: 500; + color: #F59C28; +} - .header { - position: relative; - z-index: 1; - } +.book-count { + font-family: D-DIN-PRO, D-DIN-PRO; + font-weight: 400; + font-size: 26rpx; + color: #65686A; + line-height: 42rpx; +} - .content { - position: relative; - z-index: 1; - } +.bg-image { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 0; +} +.header { + position: relative; + z-index: 1; +} - .selectPopup { - width: 100%; - max-height: 440upx; - padding: 29upx 27upx 39upx; - background-color: #fff; - border-radius: 5upx 5upx 15upx 20upx; - margin-top: 80upx; - } +.content { + position: relative; + z-index: 1; +} - .select_popup_list { - width: 100%; - height: 282upx; - overflow-y: auto; - display: flex; - flex-wrap: wrap; - } +.selectPopup { + width: 100%; + max-height: 440upx; + padding: 29upx 27upx 39upx; + background-color: #fff; + border-radius: 5upx 5upx 15upx 20upx; + margin-top: 80upx; +} - .select_popup_item { - /* cursor: pointer; */ - width: 28%; - height: 80upx; - margin: 10upx 15upx; - display: flex; - align-items: center; - background-color: #F8F8F8; - justify-content: center; - /* border: 2upx solid #ccc; */ - text-align: center; - } +.select_popup_list { + width: 100%; + height: 282upx; + overflow-y: auto; + display: flex; + flex-wrap: wrap; +} +.select_popup_item { + width: 28%; + height: 80upx; + margin: 10upx 15upx; + display: flex; + align-items: center; + background-color: #F8F8F8; + justify-content: center; + text-align: center; +} - .select_btn { - border: 1upx solid #F5A133; - border-radius: 15upx; - margin: 40rpx 0 40rpx 25rpx; - display: flex; - overflow: hidden; - cursor: pointer; - cursor: pointer; - display: inline-block; - width: 286upx; - height: 100%; - font-size: 30upx; - font-family: PingFang SC; - font-weight: bold; - color: #F5A133; - line-height: 60upx; - text-align: center; - } +.select_btn { + border: 1upx solid #F5A133; + border-radius: 15upx; + margin: 40rpx 0 40rpx 25rpx; + display: inline-block; + width: 286upx; + height: 100%; + font-size: 30upx; + font-family: PingFang SC; + font-weight: bold; + color: #F5A133; + line-height: 60upx; + text-align: center; +} </style> \ No newline at end of file -- Gitblit v1.8.0