stu_ft_add.vue 5.1 KB
<template>
	<view class="wrap_box">
		<u-sticky>
			<view class="bz_box">
				<view class="bz_tab">
					<view v-for="(item,index) in tabs" class="tab_li" :class="{active:active==index}" @click="setac_fuc(index)">
						{{item.title}}
					</view>
				</view>
			</view>
		</u-sticky>
		
		<ftadd v-if="active==0"  :options="options"></ftadd>
		<ftadd1 v-else  :options="options"></ftadd1>
		
	</view>
</template>

<script>
	import Vue from 'vue'
	import {
		mapState,
		mapMutations
	} from 'vuex'
	var that
	export default {
		data() {
			return {
				options: '',
				datas: '',
				tabs: [{
						title: '入学关怀'
					},
					{
						title: '常规访谈'
					},
				],
				stu_datas: [{
						id: '2',
						dk: '1'
					},
					{
						id: '2',
						dk: '1'
					},
					{
						id: '2',
						dk: ''
					},
					{
						id: '2',
						dk: '1'
					},
					{
						id: '2',
						dk: '1'
					},
					{
						id: '2',
						dk: '1'
					},
					{
						id: '2',
						dk: ''
					},
					{
						id: '2',
						dk: '1'
					},
					{
						id: '2',
						dk: '1'
					},
					{
						id: '2',
						dk: '1'
					},


				],
				active:0
			}
		},
		computed: {
			...mapState(['hasLogin', 'forcedLogin', 'userName', 'userinfo', 'nowtime']),
			startDate() {
					return this.getDate('start');
			},
			endDate() {
					return this.getDate('end');
			}
		},
		onLoad(e) {
			that = this
			that.options = e || {}
			console.log(e)
			that.active=e.type
			// that.getdata()
		},
		onShow() {

		},
		methods: {
			// ...mapMutations(['wxshouquan','login']),
			test() {},
			setac_fuc(index){
				that.active=index
			},
			save_fuc() {
				uni.showToast({
					icon: 'none',
					title: '保存成功'
				})
				setTimeout(function() {
					uni.navigateBack({
						delta: 1
					})
				}, 1000)
			},
			bindDateChange(e) {
				this.sx_time = e.detail.value
			},
			bindPickerChange: function(e) {
					console.log('picker发送选择改变,携带值为', e.detail.value)
					this.index = e.detail.value
			},
			getDate(type) {
				const date = new Date();
				let year = date.getFullYear();
				let month = date.getMonth() + 1;
				let day = date.getDate();

				if (type === 'start') {
					year = year - 60;
				} else if (type === 'end') {
					year = year;
				}
				month = month > 9 ? month : '0' + month;
				day = day > 9 ? day : '0' + day;
				return `${year}-${month}-${day}`;
			},
			del_fuc(item) {
				uni.showModal({
					title: '提示',
					content: '是否删除该备注',
					success: function(res) {
						if (res.confirm) {
							console.log('用户点击确定');
							uni.showToast({
								icon: 'none',
								title: '删除成功'
							})
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
			},
			getdata() {

				var datas = {
					key: that.options.type
				}
				var jkurl = '/info'

				that.$service.P_post(jkurl, datas).then(res => {
					that.btnkg = 0
					console.log(res)
					if (res.code == 1) {
						that.htmlReset = 0
						var datas = res.data
						console.log(typeof datas)

						if (typeof datas == 'string') {
							datas = JSON.parse(datas)
						}
						console.log(res)
						that.datas = datas.info.content
						if (datas.info.title) {
							uni.setNavigationBarTitle({
								title: datas.info.title
							})
						}
					} else {

						if (res.msg) {
							uni.showToast({
								icon: 'none',
								title: res.msg
							})
						} else {
							uni.showToast({
								icon: 'none',
								title: '获取数据失败'
							})
						}
					}
				}).catch(e => {
					that.htmlReset = 1
					that.btnkg = 0
					// that.$refs.htmlLoading.htmlReset_fuc(1)
					console.log(e)
					uni.showToast({
						icon: 'none',
						title: '获取数据失败,请检查您的网络连接'
					})
				})
			},
			getimg(img) {
				return service.getimg(img)
			},
			jump(e) {
				var that = this
				if (that.btnkg == 1) {
					return
				} else {
					that.btnkg = 1
					setTimeout(function() {
						that.btnkg = 0
					}, 2000)
				}
				console.log(e.currentTarget.dataset.type)
				service.jump(e)
			},
			goback() {
				uni.navigateBack()
			},
			func() {
				// that.$store.commit('setSystem',datas.system)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.wrap_box {
		width: 100%;
		// padding: 30rpx;
		min-height: 100vh;
		// #ifdef H5
		min-height: calc(100vh - 44px);
		// #endif
		background: #F8F8F8;
		position: relative;
		
		padding-bottom: 10rpx;
	}
	
	.bz_box{
		width: 100%;
		position: relative;
		background: #F8F8F8;
	}
	.bz_tab{
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: space-around;
		background-color: #fff;
		border-top:1rpx solid #f3f4f6;
	}
	.tab_li{
		font-size: 28rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #323232;
		padding:30rpx;
		position: relative;
		&.active{
			color: #2D81FF;
			&:after{
				content: '';
				position: absolute;
				bottom: 8rpx;
				left: 50%;
				background-image: url(@/static/imagesV2/icon23.png);
				background-size: 100% 100%;
				transform: translateX(-50%);
				height: 24rpx;
				width: 24rpx;
			}
		}
	}
	
	
</style>