123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400 |
- <template>
- <view>
- <view class="list-header flex_c_r">
- <view class="header-btn" v-if="isAdmin" @click="clickAdmin">
- <view class="icon-setting2"></view>
- <view>服务管理</view>
- </view>
- <view class="header-btn-close" v-else @click="clickAdmin">
- 退出管理
- </view>
- </view>
- <scroll-view refresher-enabled :refresher-triggered="isRefreshing" @refresherrefresh="onCustomRefresh"
- class="list-main" @scrolltolower="scrolltolower" scroll-y>
- <view>
- <view v-for="(item, index) in data" :key="index + 'lists'" class="list-item flex_c_c">
- <view class="item-radio-box flex_c_c" v-if="!isAdmin">
- <view :class="[activeIds.includes(item.id) ? 'item-radio-active' : 'item-radio']"
- @click="activeDate(item)"></view>
- </view>
- <view class="item-main flex_c_s_l">
- <view class="item-header flex_c_s">
- <view class="item-title">{{ item.name }}</view>
- <view class="item-tags">
- <view class="item-tag-ok" v-if="item.status === '1'">已发布</view>
- <view class="item-tag-ex" v-if="item.status === '2'">待审核</view>
- </view>
- </view>
- <view class="item-text">{{ item.text }}</view>
- <view class="item-footer flex_c_s">
- <view class="item-price flex_c_c">
- <view class="dor">¥</view>
- <view class="price">{{ item.price }}/{{ item.desc }}
- </view>
- </view>
- <view class="item-date">{{ item.date }}</view>
- </view>
- </view>
- </view>
- </view>
- </scroll-view>
- <view class="list-footer flex_s_c" v-if="!isAdmin">
- <view class="footer-radio-box flex_c_c" @click="activeAll()">
- <view :class="[activeIds.length === data.length ? 'item-radio-active' : 'item-radio']"
- ></view>
- <view class="footer-radio-text">全选</view>
- </view>
- <view class="footer-btn-add" @click="onAdd"> 新增 </view>
- <view class="footer-btn-up" @click="onUp"> 上线 </view>
- <view class="footer-btn-delete" @click="onDelete"> 删除 </view>
- </view>
- </view>
- </template>
- <script setup>
- import { ref } from 'vue';
- const isAdmin = ref(false);
- const isRefreshing = ref(false)
- const data = ref([
- {
- id: '1',
- name: '老人生活-健康监测',
- status: '1',
- text: '依托先进的便携式检测设备与专业检测技术,打破传统检测的时空限制,可提供上门检测服务,让客户在舒适的环境中完成健康筛查',
- price: '200',
- desc: '次',
- date: '2025-6-12 17:50'
- },
- {
- id: '2',
- name: '老人生活-健康监测',
- status: '2',
- text: '依托先进的便携式检测设备与专业检测技术,打破传统检测的时空限制,可提供上门检测服务,让客户在舒适的环境中完成健康筛查',
- price: '200',
- desc: '次',
- date: '2025-6-12 17:50'
- },
- ])
- const activeIds = ref([])
- const onCustomRefresh = () => {
- isRefreshing.value = true;
- setTimeout(() => {
- isRefreshing.value = false;
- }, 1000);
- };
- const scrolltolower = () => {
- };
- const clickAdmin = () => {
- console.log(1);
- isAdmin.value = !isAdmin.value;
- };
- const activeDate = async (record) => {
- try {
- if (activeIds.value.includes(record.id)) {
- activeIds.value = activeIds.value.filter(item => item !== record.id)
- return;
- }
- activeIds.value.push(record.id);
- } catch (error) {
- console.log("TCL: activeDate -> error", error)
- }
- }
- const activeAll = async () => {
- try {
- if(data.value.length !== activeIds.value.length){
- activeIds.value = data.value.map(item => item.id);
- return
- }
- activeIds.value = [];
- } catch (error) {
- console.log("TCL: activeAll -> error", error)
- }
- };
- const onAdd =async () => {
- try {
- uni.navigateTo({
- url: `/pages_home/pages/serviceManagement/index`
- })
- } catch (error) {
- console.log("TCL: onAdd -> error", error)
-
- }
- }
- const onUp =async () => {
- try {
-
- } catch (error) {
- console.log("TCL: onUp -> error", error)
-
- }
- }
- const onDelete =async () => {
- try {
-
- } catch (error) {
- console.log("TCL: onDelete -> error", error)
-
- }
- }
- </script>
- <style lang="scss" scoped>
- @import "./index.scss";
- .list-main {
- padding: 20rpx 0;
- position: fixed;
- left: 0px;
- top: 92rpx;
- right: 0px;
- bottom: 0;
- background: #F5F5F5;
- overflow: hidden;
- overflow-y: auto;
- padding-bottom: 176rpx;
- }
- .list-header {
- height: 92rpx;
- padding: 0 34rpx;
- .header-btn {
- border-radius: 6rpx;
- background: #FFF7E8;
- padding: 11.2rpx 23.9rpx;
- font-family: PingFang SC;
- font-size: 28rpx;
- font-weight: normal;
- line-height: 32rpx;
- display: flex;
- align-items: center;
- letter-spacing: normal;
- color: #FF7D00;
- .icon-setting {
- margin-right: 6rpx;
- }
- }
- .header-btn-close {
- @extend .header-btn;
- color: #4E5969;
- background: #F2F3F5;
- }
- }
- .item-radio {
- width: 34rpx;
- height: 34rpx;
- border-radius: 34rpx;
- border: 4rpx solid #C4C4C4;
- }
- .item-radio-active {
- @extend .item-radio;
- border: none;
- @extend .whether-radio-active;
- }
- .list-item {
- padding: 24rpx 40rpx;
- margin-bottom: 20rpx;
- background: #fff;
- gap: 44rpx;
- .item-radio-box {
- min-width: 44rpx;
- }
- .item-main {
- flex: 1;
- gap: 22rpx;
- .item-header {
- width: 100%;
- .item-title {
- margin-top: 24rpx;
- font-family: PingFang SC;
- font-size: 36rpx;
- font-weight: normal;
- line-height: 44rpx;
- letter-spacing: normal;
- /* 外部/Neutral/10强调、正文标题 */
- color: #1D2129;
- }
- .item-tags {
- .item-tag {
- border-radius: 4rpx;
- padding: 4rpx 10rpx;
- font-family: PingFang SC;
- font-size: 30rpx;
- font-weight: normal;
- line-height: 40rpx;
- text-align: center;
- display: flex;
- align-items: center;
- letter-spacing: normal;
- }
- .item-tag-ok {
- @extend .item-tag;
- background: #E8FFEA;
- color: #00B42A;
- }
- .item-tag-ex {
- @extend .item-tag;
- background: #E8F3FF;
- color: #165DFF;
- }
- }
- }
- .item-text {
- font-family: PingFang SC;
- font-size: 30rpx;
- font-weight: normal;
- line-height: 40rpx;
- text-align: justify;
- /* 浏览器可能不支持 */
- letter-spacing: normal;
- color: #86909C;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 3;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .item-footer {
- width: 100%;
- .item-price {
- font-family: PingFang SC;
- font-size: 32rpx;
- font-weight: normal;
- line-height: 42rpx;
- text-align: right;
- letter-spacing: normal;
- color: #F53F3F;
- /* ¥ */
- .dor {
- font-family: PingFang SC;
- font-weight: 400;
- font-size: 24rpx;
- font-variation-settings: "opsz" auto;
- }
- /* 200/次 */
- .price {
- font-family: PingFang SC;
- font-weight: 400;
- font-size: 32rpx;
- font-variation-settings: "opsz" auto;
- }
- }
- .item-date {
- font-family: PingFang SC;
- font-size: 28rpx;
- font-weight: normal;
- line-height: 40rpx;
- letter-spacing: normal;
- color: #86909C;
- }
- }
- }
- }
- .list-footer {
- position: fixed;
- bottom: 0rpx;
- left: 0px;
- right: 0;
- z-index: 999;
- background: #fff;
- padding-bottom: 60rpx;
- height: 176rpx;
- gap: 30rpx;
- padding: 24rpx 50rpx ;
- .footer-radio-box {
- margin-top: 28rpx;
- margin-right: 25rpx;
- .footer-radio-text{
- font-family: PingFang SC;
- font-size: 32rpx;
- font-weight: normal;
- line-height: 44rpx;
- text-align: right;
- display: flex;
- align-items: center;
- letter-spacing: normal;
- /* 文字/text-5 */
- color: #1D2129;
- margin-left: 6rpx;
- }
- }
- .footer-btn {
- border-radius: 200rpx;
- box-sizing: border-box;
- /* 错误/danger-6 */
- border: 2rpx solid ;
- padding: 15rpx 32rpx;
- font-family: PingFang SC;
- font-size: 30rpx;
- font-weight: normal;
- line-height: 42rpx;
- display: flex;
- align-items: center;
- letter-spacing: normal;
- }
- .footer-btn-add {
- @extend .footer-btn;
- border-color: #F53F3F;
- color: #F53F3F;
- }
- .footer-btn-up {
- @extend .footer-btn;
- border-color: #FFECE8;
- background: #FFECE8;
- color: #F53F3F;
- }
- .footer-btn-delete {
- @extend .footer-btn;
- border-color: #F53F3F;
- background: #F53F3F;
- color: #fff;
- }
- }
- </style>
|