msgSetting.vue 4.2 KB
<template>
	<view class="msg_setting">
		<view class="select_list">
			<view v-for="(item, index) in navList" :key="index" class="select_item" @click="expertActive = index">
				<image class="icon" :src="expertActive === index ? item.iconActive : item.iconName" mode=""></image>
				<text class="col-3d f-24 l-h-32 m-top10">{{ item.title }}</text>
			</view>
		</view>
		
		<view class="expert_content">
			<swiper class="swiper" circular :current="expertActive" @animationfinish="toggleSwiper">
				<swiper-item>
					<view class="swiper-item">
						<scroll-view scroll-y="true" class="scroll-history">
							<view id="demo1" v-for="item in 10" :key="item" class="scroll-item">
								<msgCardVue />
							</view>
							<view class="col-9 f-24 l-h-32 m-top30 t-c">暂无更多消息</view>
						</scroll-view>
					</view>
				</swiper-item>
				<swiper-item>
					<view class="swiper-item">
						<scroll-view scroll-y="true" class="scroll-history">
							<view class="scroll-item">
								<msgCardVue />
								<view class="col-9 f-24 l-h-32 m-top30 t-c">暂无更多消息</view>
							</view>
						</scroll-view>
					</view>
				</swiper-item>
				<swiper-item>
					<view class="swiper-item">
						<scroll-view scroll-y="true" class="scroll-history">
							<view class="scroll-item">
								<view class="msg_title">订场管理</view>
								<!-- 消息列表 -->
								<view class="bg-fff">
									<u-cell-group :border="false">
										<u-cell v-for="(item, index) in bookingMsg" :key="index" :title="item.title">
											<u-switch slot="right-icon" v-model="item.isTrue" inactiveColor="#EAEAEA" activeColor="#58BE6B" :loading="isLoading"/>
										</u-cell>
									</u-cell-group>
								</view>
								<view class="msg_title">商城管理</view>
								<!-- 消息列表 -->
								<view class="bg-fff">
									<u-cell-group :border="false">
										<u-cell v-for="(item, index) in mallMsg" :key="index" :title="item.title">
											<u-switch slot="right-icon" v-model="item.isTrue" inactiveColor="#EAEAEA" activeColor="#58BE6B" :loading="isLoading"/>
										</u-cell>
									</u-cell-group>
								</view>
							</view>
						</scroll-view>
					</view>
				</swiper-item>
			</swiper>
		</view>
		
	</view>
</template>

<script>
	import Msg from '../static/msg.png'
	import storeMsg from '../static/storeMsg.png'
	import settingMsg from '../static/settingMsg.png'
	import msgActive from '../static/msg_active.png'
	import storeMsgActive from '../static/storeMsg_active.png'
	import settingMsgActive from '../static/settingMsg_active.png'
	import msgCardVue from '../components/msgCard.vue'
	export default {
		components: { msgCardVue },
		data() {
			return {
				checked: false,
				isLoading: false,
				expertActive: 0,
				navList: [
					{ title: '系统消息', iconName: Msg, iconActive: msgActive},
					{ title: '店铺消息', iconName: storeMsg, iconActive: storeMsgActive},
					{ title: '消息设置', iconName: settingMsg, iconActive: settingMsgActive}
				],
				bookingMsg: [
					{ title: '订场提醒', isTrue: false },
					{ title: '订单进行中提醒', isTrue: false },
					{ title: '退款提醒', isTrue: true }
				],
				mallMsg: [
					{ title: '自提订单提醒', isTrue: false },
					{ title: '配送订单提醒', isTrue: true },
					{ title: '退款提醒', isTrue: true },
					{ title: '库存不足提醒', isTrue: true }
				]
			}
		},
		methods: {
			// 检测手机滑动
			toggleSwiper(event){
				this.expertActive = event.detail?.current
			}
		}
	}
</script>

<style lang="scss" scoped>
.msg_setting{
	background-color: #F6F7FB;
	min-height: 100vh;
	.select_list{
		display: flex;
		align-items: center;
		justify-content: space-around;
		padding: 20rpx 0;
		background-color: #fff;
		.select_item{
			display: flex;
			flex-direction: column;
			align-items: center;
			.icon{
				width: 100rpx;
				height: 100rpx;
				border-radius: 32rpx;
			}
		}
	}
	.msg_title{
		padding: 0 30rpx;
		height: 72rpx;
		line-height: 72rpx;
		font-size: 24rpx;
		color: #999;
	}
}

.expert_content{
	padding: 20rpx 30rpx;
}
.scroll-history {
	height: calc(100vh - 182rpx);
}
.swiper {
	height: calc(100vh - 182rpx);
}
.swiper-item {
	display: block;
}
.scroll-item {
	margin-bottom: 10px;
}
</style>