Browse Source

before add uni-calendar

Cee Yang 3 years ago
parent
commit
855a5a7b55
9 changed files with 129 additions and 25 deletions
  1. 0 0
      components/.gitkeep
  2. 3 1
      i18n/en.js
  3. 3 1
      i18n/zh.js
  4. 67 0
      pages/calendar/index.vue
  5. 6 2
      pages/index/index.vue
  6. 0 2
      pages/login/index.vue
  7. 27 0
      pages/message/index.vue
  8. 13 13
      pages/mine/index.vue
  9. 10 6
      pages/mine/setting.vue

+ 0 - 0
components/.gitkeep


+ 3 - 1
i18n/en.js

@@ -270,6 +270,8 @@ const en = {
   "exit": "Exit",
   "expand": "Expand",
 	
-	"pleaseReadAndAggreeThePrivacyPolicy": "Please read and aggree the privacy policy!"
+	"pleaseReadAndAggreeThePrivacyPolicy": "Please read and aggree the privacy policy!",
+	
+	"schedule": "Schedule"
 }
 export default en;

+ 3 - 1
i18n/zh.js

@@ -268,6 +268,8 @@ const cn = {
   "exit": "直接退出",
   "expand": "展开",
 	
-	"pleaseReadAndAggreeThePrivacyPolicy": "请阅读并同意隐私政策!"
+	"pleaseReadAndAggreeThePrivacyPolicy": "请阅读并同意隐私政策!",
+	
+	"schedule": "工作日程"
 }
 export default cn;

+ 67 - 0
pages/calendar/index.vue

@@ -0,0 +1,67 @@
+<template>
+	<view>
+		
+		<!-- 导航栏 -->
+		<u-navbar bgColor="red">
+			<view class="u-nav-slot" slot="left">
+				<text class="text-bold text-xxl text-white"> {{ $t('schedule') }} </text>
+			</view>
+			<view class="u-nav-slot" slot="right">
+				<view class="cu-bar">
+					<u-icon name="arrow-left" color="white" size="28" @click="previousBtnDidClick"></u-icon>
+					<text class="text-bold text-white text-xl"> {{ currentDate }}  </text>
+					<u-icon name="arrow-right" color="white" size="28" @click="nextBtnDidClick"></u-icon>
+				</view>
+			</view>
+		</u-navbar>
+		
+		 <!-- <uni-calendar 
+		    :insert="true"
+		    :lunar="true" 
+		    :start-date="'2019-3-2'"
+		    :end-date="'2019-5-20'"
+		    @change="change"
+		     /> -->
+		
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				currentDate: '2021-12',
+				show: false,
+				mode: 'range'
+			}
+		},
+		onReady() {
+			// 如果需要兼容微信小程序的话,需要用此写法
+			this.$refs.calendar.setFormatter(this.formatter)
+		},
+		methods:{
+			previousBtnDidClick(){
+				console.log('previousBtnDidClick');
+			},
+			nextBtnDidClick(){
+				console.log('nextBtnDidClick');
+			},
+			confirm(e) {
+				console.log(e)
+			},
+			formatter(day) {
+				const d = new Date()
+				let month = d.getMonth() + 1
+				const date = d.getDate()
+				if(day.month == month && day.day == date + 3) {
+					day.bottomInfo = '有优惠'
+					day.dot = true
+				}
+				return day
+			},
+			change(e) {
+				console.log(e)
+			}
+		}
+	}
+</script>

+ 6 - 2
pages/index/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
-		<view v-if="selectedIndex==0"></view>
-		<view v-if="selectedIndex==1"></view>
+		<tabbar-calendar v-if="selectedIndex==0"></tabbar-calendar>
+		<tabbar-message v-if="selectedIndex==1"></tabbar-message>
 		<tabbar-mine v-if="selectedIndex==2"></tabbar-mine>
 		<view class="cu-bar tabbar bg-white shadow foot">
 			<view v-for="item in tabItems" :index='item.index' class="action" @click="tabBarDidChange" :data-index="item.index">
@@ -16,9 +16,13 @@
 
 <script>
 	import TabbarMine from '../mine/index.vue'
+	import TabbarCalendar from '../calendar/index.vue'
+	import TabbarMessage from '../message/index.vue'
 	export default {
 		components: {
 			TabbarMine,
+			TabbarCalendar,
+			TabbarMessage
 		},
 		data() {
 			return {

+ 0 - 2
pages/login/index.vue

@@ -68,8 +68,6 @@
 		mounted() {
 			this.user.account = this.username
 			this.user.password = this.password
-			
-			// this.$i18n.locale = this.locale
 		},
 		methods: {
 			async startLogin() {

+ 27 - 0
pages/message/index.vue

@@ -0,0 +1,27 @@
+<template>
+	<view>
+		<u-navbar leftIcon="" bgColor="white" :title="$t('message')">
+			<view class="u-nav-slot" slot="right">
+				<u-icon name="grid" size="28" @click="nextBtnDidClick"></u-icon>
+			</view>
+		</u-navbar>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				currentDate: '2021-12',
+			}
+		},
+		methods:{
+			previousBtnDidClick(){
+				console.log('previousBtnDidClick');
+			},
+			nextBtnDidClick(){
+				console.log('nextBtnDidClick');
+			}
+		}
+	}
+</script>

+ 13 - 13
pages/mine/index.vue

@@ -47,27 +47,27 @@
 			return {
 				mineItems: [
 					[
-						{'image': '../../static/mine/city.png','title': 'city','detail': '成都', 'url': ''},
-						{'image': '../../static/mine/location.png','title': 'campus','detail': '成都', 'url': ''},
-						{'image': '../../static/mine/department.png','title': 'department', 'detail': '成都', 'url': ''}
+						{'image': '/static/mine/city.png','title': 'city','detail': '成都', 'url': ''},
+						{'image': '/static/mine/location.png','title': 'campus','detail': '成都', 'url': ''},
+						{'image': '/static/mine/department.png','title': 'department', 'detail': '成都', 'url': ''}
 					],
 					[
-						{'image': '../../static/mine/city.png','title': 'city','detail': '成都', 'url': ''},
-						{'image': '../../static/mine/location.png','title': 'campus','detail': '成都', 'url': ''},
-						{'image': '../../static/mine/department.png','title': 'department', 'detail': '成都', 'url': ''}
+						{'image': '/static/mine/city.png','title': 'city','detail': '成都', 'url': ''},
+						{'image': '/static/mine/location.png','title': 'campus','detail': '成都', 'url': ''},
+						{'image': '/static/mine/department.png','title': 'department', 'detail': '成都', 'url': ''}
 					],
 					[
-						{'image': '../../static/mine/city.png','title': 'city','detail': '成都', 'url': ''},
-						{'image': '../../static/mine/location.png','title': 'campus','detail': '成都', 'url': ''},
-						{'image': '../../static/mine/department.png','title': 'department', 'detail': '成都', 'url': ''}
+						{'image': '/static/mine/city.png','title': 'city','detail': '成都', 'url': ''},
+						{'image': '/static/mine/location.png','title': 'campus','detail': '成都', 'url': ''},
+						{'image': '/static/mine/department.png','title': 'department', 'detail': '成都', 'url': ''}
 					],
 					[
-						{'image': '../../static/mine/student_old.png','title': 'referralList', 'detail': '', 'url': ''},
-						{'image': '../../static/mine/student_pain.png','title': 'renewList', 'detail': '', 'url': ''},
-						{'image': '../../static/mine/referral.png','title': 'auditList', 'detail': '', 'url': ''}
+						{'image': '/static/mine/student_old.png','title': 'referralList', 'detail': '', 'url': ''},
+						{'image': '/static/mine/student_pain.png','title': 'renewList', 'detail': '', 'url': ''},
+						{'image': '/static/mine/referral.png','title': 'auditList', 'detail': '', 'url': ''}
 					],
 					[
-						{'image': '../../static/mine/setting.png','title': 'setting', 'detail': '', 'url': '../mine/setting'},
+						{'image': '/static/mine/setting.png','title': 'setting', 'detail': '', 'url': '../mine/setting'},
 					],
 				]
 			};

+ 10 - 6
pages/mine/setting.vue

@@ -23,18 +23,18 @@
 			return {
 				mineItems: [
 					[
-						{'index': 0, 'image': '../../static/mine/modify_psw.png','title': 'changePassword', 'url': ''},
-						{'index': 1, 'image': '../../static/mine/about.png','title': 'aboutUs', 'url': ''},
-						{'index': 2, 'image': '../../static/mine/fk_edit.png','title': 'mineFeedback', 'url': ''}
+						{'index': 0, 'image': '/static/mine/modify_psw.png','title': 'changePassword', 'url': ''},
+						{'index': 1, 'image': '/static/mine/about.png','title': 'aboutUs', 'url': ''},
+						{'index': 2, 'image': '/static/mine/fk_edit.png','title': 'mineFeedback', 'url': ''}
 					],
 					[
-						{'index': 3, 'image': '../../static/mine/student_old.png','title': 'checkUpdate', 'url': ''},
+						{'index': 3, 'image': '/static/mine/student_old.png','title': 'checkUpdate', 'url': ''},
 					],
 					[
-						{'index': 4, 'image': '../../static/mine/language.png','title': 'switchLanguage', 'url': ''},
+						{'index': 4, 'image': '/static/mine/language.png','title': 'switchLanguage', 'url': ''},
 					],
 					[
-						{'index': 5, 'image': '../../static/mine/logout.png','title': 'logOut', 'url': '../login/index'},
+						{'index': 5, 'image': '/static/mine/logout.png','title': 'logOut', 'url': '../login/index'},
 					],
 				]
 			};
@@ -45,6 +45,9 @@
 		},
 		props: {
 			
+		},
+		mounted() {
+
 		},
 		methods: {
 			/// 列表跳转
@@ -61,6 +64,7 @@
 						let locale = this.$i18n.locale
 						locale === 'zh' ? this.$i18n.locale = 'en' : this.$i18n.locale = 'zh'
 						this.$store.commit('setLocale', this.$i18n.locale)
+						uni.setNavigationBarTitle({ title:this.$i18n.t('setting') })
 					break
 					default: break
 				}