Parcourir la source

智能衣柜前端静态页面

YZM il y a 2 ans
Parent
commit
856c6abd1d

+ 80 - 0
pages/chuanghome/index.vue

@@ -0,0 +1,80 @@
+<template>
+	<view :style="{ minHeight: sys.windowHeight + 'px' }"
+		:class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
+		<tm-message ref="toast"></tm-message>
+		<tm-menubars title="创建家庭" :shadow="0" :showback="false"></tm-menubars>
+		<tm-sheet :shadow="24" v-if="active==1">
+			<tm-steps model="number" color="bg-gradient-blue-accent" activeFontColor="blue" line-color="bg-gradient-blue-accent" v-model="active" :list="list"></tm-steps>
+			<view class="mt-20">
+				<text class="text-primary text-size-s">扫柜体上的二维码和衣柜绑定</text>
+			</view>
+			<image block class="zhanshi" mode="widthFix" src="https://picsum.photos/300?k=1"></image>
+			<tm-button theme="bg-gradient-blue-accent" @click="saoma()" block>扫二维码</tm-button>
+		</tm-sheet>
+		<tm-sheet :shadow="24" v-if="active==2">
+			<view class="flex fulled-height" >
+				<view style="width: 80px;">
+					111
+				</view>
+				<view style="width:calc(100% - 160rpx);">
+					222
+				</view>
+			</view>
+			<tm-button theme="bg-gradient-blue-accent" @click="saoma()" block>下一步</tm-button>
+		</tm-sheet>
+	</view>
+</template>	
+<script>
+import{myRequest} from '@/api/request.js'
+export default {
+	data() {
+		return {
+			active:2,
+			list:['创建家庭','创建角色','创建成功'],
+			list2:[
+				{text:'苏州'},
+				{text:'北京'},
+				{text:'广东'},
+				{text:'江西',dot:8},
+				{text:'深圳'},
+			],
+		};
+	},
+	onLoad() {
+		
+	},
+	created() {
+		this.sys = uni.getSystemInfoSync();
+	},
+	methods: {
+		saoma(){
+			console.log("111")
+			var that=this;
+			that.active=2;
+			uni.scanCode({
+				scanType: ['barCode'],
+				success: function (res) {
+					console.log('条码类型:' + res.scanType);
+					console.log('条码内容:' + res.result);
+					that.active=2;
+				},
+				error : function(e) {
+					alert("网络异常,请重试");
+				}
+			})
+		},
+	},
+}
+</script>
+
+<style lang="scss">
+	.zhanshi{
+		width: 100%;
+		margin: 0 auto;
+		margin-top: 10px;
+		margin-bottom: 40px;
+	}
+	/deep/ .tm-menubars .body{
+		background-color: #1b1b1b !important;
+	}
+</style>

+ 9 - 4
pages/dapei/index.vue

@@ -1,10 +1,13 @@
 <template>
-	<view >
-		搭配
+	<view :style="{ minHeight: sys.windowHeight + 'px' }"
+		:class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
+		<tm-message ref="toast"></tm-message>
+		<tm-menubars title="搭配" :shadow="0" :showback="false"></tm-menubars>
 		
 	</view>
 </template>	
 <script>
+import{myRequest} from '@/api/request.js'
 export default {
 	data() {
 		return {
@@ -15,7 +18,7 @@ export default {
 		
 	},
 	created() {
-		
+		this.sys = uni.getSystemInfoSync();
 	},
 	methods: {
 	},
@@ -23,5 +26,7 @@ export default {
 </script>
 
 <style lang="scss">
-
+	/deep/ .tm-menubars .body{
+		background-color: #1b1b1b !important;
+	}
 </style>

+ 1 - 3
pages/index/index.vue

@@ -44,9 +44,7 @@ export default {
 		};
 	},
 	onLoad() {
-		// uni.redirectTo({
-		// 	url:"/pages/login/index"
-		// })
+		this.$tm.theme.setBlack(true);
 	},
 	methods: {
 		changepage(info){

+ 9 - 4
pages/login/index.vue

@@ -1,5 +1,7 @@
 <template>
-	<view >
+	<view :style="{ minHeight: sys.windowHeight + 'px' }"
+		:class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
+		<tm-menubars title="" :shadow="0" :showback="false"></tm-menubars>
 		<tm-message ref="toast"></tm-message>
 		<tm-sheet :shadow="24" :padding="[12,24]" :margin="[24,24]">
 			<view>
@@ -43,7 +45,7 @@ export default {
 		
 	},
 	created() {
-		
+		this.sys = uni.getSystemInfoSync();
 	},
 	methods: {
 		tijiao(){
@@ -60,8 +62,9 @@ export default {
 				method:'post',
 				data:that.reqData
 			}).then(res => {
-				console.log(res)
+				console.log(res.data)
 				if (res.data.code == 200) {
+					uni.setStorageSync("token",res.data.data.token)
 					that.$refs.toast.show({model:'success',label:res.data.msg})
 					setTimeout(function(){
 						uni.navigateTo({
@@ -94,5 +97,7 @@ export default {
 </script>
 
 <style lang="scss">
-
+	/deep/ .tm-menubars .body{
+		background-color: #1b1b1b !important;
+	}
 </style>

+ 7 - 16
pages/putstorage/index.vue

@@ -1,8 +1,8 @@
 <template>
-	<view :class="$tm.vx.state().tmVuetify.black?'black bk':''">
-		<tm-menubars color="primary" title="入库" :shadow="0" :showback="true"></tm-menubars>
+	<view :style="{ minHeight: sys.windowHeight + 'px' }"
+		:class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
+		<tm-menubars title="入库" :shadow="0" :showback="true"></tm-menubars>
 		<tm-button theme="light-green" @click="paizhao()">拍照</tm-button>
-		<tm-button theme="light-green" @click="saoma()">扫码</tm-button>
 	</view>
 </template>	
 <script>
@@ -19,6 +19,7 @@ export default {
 		
 	},
 	created() {
+		this.sys = uni.getSystemInfoSync();
 		uni.request({
 			url: "https://jisutqybmf.market.alicloudapi.com/weather/query",
 			method: "get",
@@ -38,18 +39,6 @@ export default {
 		});
 	},
 	methods: {
-		saoma(){
-			uni.scanCode({
-				scanType: ['barCode'],
-				success: function (res) {
-					console.log('条码类型:' + res.scanType);
-					console.log('条码内容:' + res.result);
-				},
-				error : function(e) {
-					alert("网络异常,请重试");
-				}
-			})
-		},
 		paizhao(){
 			var that=this;
 			uni.chooseImage({     //uni官方api,用于选取本地图片
@@ -116,5 +105,7 @@ export default {
 </script>
 
 <style lang="scss">
-	
+	/deep/ .tm-menubars .body{
+		background-color: #1b1b1b !important;
+	}
 </style>

+ 7 - 3
pages/registered/index.vue

@@ -1,5 +1,7 @@
 <template>
-	<view >
+	<view :style="{ minHeight: sys.windowHeight + 'px' }"
+		:class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
+		<tm-menubars title="" :shadow="0" :showback="false"></tm-menubars>
 		<tm-message ref="toast"></tm-message>
 		<tm-sheet :shadow="24" :padding="[12,24]" :margin="[24,24]">
 			<view>
@@ -48,7 +50,7 @@ export default {
 		
 	},
 	created() {
-		
+		this.sys = uni.getSystemInfoSync();
 	},
 	methods: {
 		tijiao(){
@@ -119,5 +121,7 @@ export default {
 </script>
 
 <style lang="scss">
-
+	/deep/ .tm-menubars .body{
+		background-color: #1b1b1b !important;
+	}
 </style>

+ 9 - 4
pages/shop/index.vue

@@ -1,10 +1,13 @@
 <template>
-	<view >
-		商城
+	<view :style="{ minHeight: sys.windowHeight + 'px' }"
+		:class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
+		<tm-message ref="toast"></tm-message>
+		<tm-menubars title="商城" :shadow="0" :showback="false"></tm-menubars>
 		
 	</view>
 </template>	
 <script>
+import{myRequest} from '@/api/request.js'
 export default {
 	data() {
 		return {
@@ -15,7 +18,7 @@ export default {
 		
 	},
 	created() {
-		
+		this.sys = uni.getSystemInfoSync();
 	},
 	methods: {
 	},
@@ -23,5 +26,7 @@ export default {
 </script>
 
 <style lang="scss">
-
+	/deep/ .tm-menubars .body{
+		background-color: #1b1b1b !important;
+	}
 </style>

+ 12 - 16
pages/shouye/index.vue

@@ -1,15 +1,6 @@
 <template>
-	<view :style="{ minHeight: sys.windowHeight + 'px' }"
-		:class="[$tm.vx.state().tmVuetify.black ? 'black' : 'grey text ']">
-		<tm-menubars color="primary" title="tm-vuetify" :shadow="0" :showback="false">
-			<template #left>
-				<view class="pl-24">
-					<tm-images :width="86" src="static/logowhite.png"></tm-images>
-				</view>
-			</template>
-	
-		</tm-menubars>
-		
+	<view :style="{ minHeight: sys.windowHeight + 'px' }" :class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
+		<tm-menubars title="" :shadow="0" :showback="false"></tm-menubars>
 		<view>
 			<view class="fixed fulled  overflow" style="z-index: 8;">
 				<tm-search @confirm="openSearch" v-model="keyword" suffixIcon=" " :showRight="false" :fllowTheme="false"
@@ -29,9 +20,6 @@
 		<view :class="[$tm.vx.state().tmVuetify.black ? 'black' : $tm.vx.state().tmVuetify.color || 'primary']">
 			<view class=" py-32" style=""
 				:class="[$tm.vx.state().tmVuetify.black ? 'grey-darken-5 bk' : $tm.vx.state().tmVuetify.color || 'primary']">
-				<!-- <navigator url="gonggao" class=" text-align-center text-white pb-12 flex-center mx-32" style="vertical-align: middle;">
-					<text class="pr-32 text-weight-b text-size-s">来自作者的一条公告>></text>
-				</navigator> -->
 				<view class="text-size-s text-align-center text-white opacity-8">
 					<text class="pr-24 ">当前版本:{{ ver }}</text>
 					<text>更新时间:{{ time }}</text>
@@ -171,8 +159,14 @@
 			// #endif
 		},
 		created() {
+			setTimeout(function(){
+				if(uni.getStorageSync("token")==""){
+					uni.redirectTo({
+						url:"/pages/login/index"
+					})
+				}
+			},2000)
 			this.sys = uni.getSystemInfoSync();
-			console.log(this.sys)
 		},
 		methods: {
 			openSearch() {
@@ -197,5 +191,7 @@
 </script>
 
 <style lang="scss">
-
+	/deep/ .tm-menubars .body{
+		background-color: #1b1b1b !important;
+	}
 </style>

+ 41 - 7
pages/user/index.vue

@@ -1,27 +1,61 @@
 <template>
-	<view >
-		我的
-		
+	<view :style="{ minHeight: sys.windowHeight + 'px' }"
+		:class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
+		<tm-message ref="toast"></tm-message>
+		<tm-menubars title="我的" :shadow="0" :showback="false"></tm-menubars>
+		<tm-button theme="light-green" @click="show=true">退出</tm-button>
+		<tm-button theme="light-green">上传图片</tm-button>
+		<tm-button theme="light-green" @click="chuangjian()">创建家庭</tm-button>
+		<tm-dialog v-model="show" content="确认退出系统?" @confirm="queren"></tm-dialog>
 	</view>
 </template>	
 <script>
+import{myRequest} from '@/api/request.js'
 export default {
 	data() {
 		return {
-			
+			show:false
 		};
 	},
 	onLoad() {
-		
+		console.log(this.$store.state)
 	},
 	created() {
-		
+		this.sys = uni.getSystemInfoSync();
+		console.log(this.$store.state)
 	},
 	methods: {
+		chuangjian(){
+			uni.navigateTo({
+				url: "/pages/chuanghome/index",
+			})
+		},
+		queren(){
+			var that=this;
+			if(uni.getStorageSync("token")==""){
+				uni.redirectTo({
+					url:"/pages/login/index"
+				})
+				return
+			}
+			myRequest({
+				url: "/api/Logout/logout",
+				method:'get',
+				data:{}
+			}).then(res => {
+				uni.setStorageSync("token","")
+				uni.redirectTo({
+					url:"/pages/login/index"
+				})
+			})
+		}
+		
 	},
 }
 </script>
 
 <style lang="scss">
-
+	/deep/ .tm-menubars .body{
+		background-color: #1b1b1b !important;
+	}
 </style>

+ 7 - 3
pages/wardrobe/index.vue

@@ -1,6 +1,7 @@
 <template>
-	<view :class="$tm.vx.state().tmVuetify.black?'black bk':''">
-		<tm-menubars color="primary" title="衣橱" :shadow="0" :showback="false">
+	<view :style="{ minHeight: sys.windowHeight + 'px' }"
+		:class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
+		<tm-menubars title="衣橱" :shadow="0" :showback="false">
 			<template #right>
 				<view class="pl-24">
 					<tm-button theme="indigo" size="s" @click="ruku">入库</tm-button>
@@ -77,7 +78,7 @@ export default {
 		
 	},
 	created() {
-
+		this.sys = uni.getSystemInfoSync();
 	},
 	methods: {
 		change(e){
@@ -105,6 +106,9 @@ export default {
 	/deep/ uni-scroll-view{
 		height: auto !important;
 	}
+	/deep/ .tm-menubars .body{
+		background-color: #1b1b1b !important;
+	}
 	.shangright{
 		padding: 10px;
 	}

+ 7 - 3
pages/xieyi/index.vue

@@ -1,6 +1,7 @@
 <template>
-	<view >
-		<tm-menubars title="用户服务协议" color="bg-gradient-primary-lighten" :showback="true"></tm-menubars>
+	<view :style="{ minHeight: sys.windowHeight + 'px' }"
+		:class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
+		<tm-menubars title="用户服务协议" :showback="true"></tm-menubars>
 		<tm-sheet color="text" class="zitima">
 			<view class="text-size-lg text-weight-b mb-24">
 				一、总则
@@ -49,7 +50,7 @@ export default {
 		
 	},
 	created() {
-		
+		this.sys = uni.getSystemInfoSync();
 	},
 	methods: {
 	},
@@ -60,4 +61,7 @@ export default {
 	/deep/ .zitima{
 		margin:0;
 	}
+	/deep/ .tm-menubars .body{
+		background-color: #1b1b1b !important;
+	}
 </style>

+ 7 - 4
pages/zhaohui/index.vue

@@ -1,7 +1,8 @@
 <template>
-	<view >
+	<view :style="{ minHeight: sys.windowHeight + 'px' }"
+		:class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
 		<tm-message ref="toast"></tm-message>
-		<tm-menubars title="找回密码" color="bg-gradient-primary-lighten" :showback="true"></tm-menubars>
+		<tm-menubars title="找回密码" :showback="true"></tm-menubars>
 		<tm-sheet :shadow="24">
 			<tm-steps model="number" color="bg-gradient-blue-accent" activeFontColor="blue" line-color="bg-gradient-blue-accent" v-model="active" :list="list"></tm-steps>
 			<view v-if="active==1">
@@ -54,7 +55,7 @@ export default {
 		
 	},
 	created() {
-		
+		this.sys = uni.getSystemInfoSync();
 	},
 	methods: {
 		tijiao(){
@@ -117,5 +118,7 @@ export default {
 </script>
 
 <style lang="scss">
-
+	/deep/ .tm-menubars .body{
+		background-color: #1b1b1b !important;
+	}
 </style>