张文飞 3 年 前
コミット
0d3b339343
5 ファイル変更152 行追加16 行削除
  1. 3 4
      App.vue
  2. 1 9
      components/titleHead.vue
  3. 8 1
      pages.json
  4. 127 0
      pages/developSetting/developSetting.vue
  5. 13 2
      pages/homePage/homePage.vue

+ 3 - 4
App.vue

@@ -3,19 +3,18 @@
 		onLaunch: function() {
 			let BASE_URL = "";
 			var env ='';
-			// let res = uni.getStorageSync('env')
-			let res = '1'
+			let res = uni.getStorageSync('env')
 			switch(res){
 			   case '1': //dev
 			     BASE_URL = 'http://192.168.4.212:8866' // 开发环境
 				 env = 'dev'
 				  break;
 			   case '2': //test
-			      BASE_URL = 'http://192.168.4.212:8866'
+			      BASE_URL = 'https://opentest1.elab.ink'
 				  env = 'test'
 				  break;
 			   case '3'://test2
-				  BASE_URL = 'http://gatewaytest1.elab-plus.com'
+				  BASE_URL = 'https://opentest2.elab.ink'
 				  env = 'test2'
 				  break;
 			   case '4'://test3

+ 1 - 9
components/titleHead.vue

@@ -100,15 +100,7 @@
 			// })
 		},
 		methods: {
-			back() {
-				if (this.isTabbarPage) {
-					this.$emit("back", "")
-				} else {
-					uni.navigateBack({
-						delta: 1
-					})
-				}
-			},
+			
 			tograb() {
 				this.$emit('share', '')
 			},

+ 8 - 1
pages.json

@@ -66,7 +66,14 @@
                 "enablePullDownRefresh": false
             }
             
-        }
+        },{
+			"path" : "pages/developSetting/developSetting",
+			"style" :                                                                                    
+			{
+			    "navigationBarTitleText": "设置页面",
+			    "enablePullDownRefresh": false
+			}
+		}
     ],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",

+ 127 - 0
pages/developSetting/developSetting.vue

@@ -0,0 +1,127 @@
+<template>
+	<view class="setting">
+		 <radio-group @change="checkboxChange" class="checkBox">
+			<label class="uni-list-cell" v-for="item in items" :key="item.value">
+				<view>
+					<radio :value="item.value" :checked="item.checked" />
+				</view>
+				<view>{{item.name}}环境</view>
+			</label>
+		</radio-group>
+		
+		<view @click="confirm" style="width: 600rpx; height: 100rpx;border-radius: 100rpx; background-color: #007AFF;color: #FFFFFF; line-height: 100rpx;display: flex;justify-content: center;margin-top: 50rpx;">确定</view>
+	</view>
+</template>
+
+<script>
+	import {
+	    mapMutations  
+	} from 'vuex'; 
+	export default {
+		data() {
+			return {
+				title: '选择服务',
+				value:"7",
+					themeColor: "",
+				items: [
+					{
+						value: '1',
+						name: 'dev'
+					},
+					{
+						value: '2',
+						name: 'test'
+					},
+					{
+						value: '3',
+						name: 'test2'
+					},
+					{
+						value: '4',
+						name: 'test3'
+					},
+					{
+						value: '5',
+						name: 'test4'
+					},
+					{
+						value: '6',
+						name: 'uat3'
+					},
+					{
+						value: '7',
+						name: 'uat'
+					},
+					{
+						value: '8',
+						name: 'product'
+					}
+				]
+			};
+		},
+		mounted() {
+		  let app = getApp();
+		  this.themeColor = app.globalData.color1;
+		  this.getEnv();	
+		},
+		 methods: {
+			 back(){
+				uni.navigateBack({
+					delta:1
+				});
+			 },
+			getEnv(){
+			   let res = uni.getStorageSync('env')||"8"
+			   for (var i = 0, lenI = this.items.length; i < lenI; ++i) {
+					const item = this.items[i]
+					if(res==item.value){
+						this.value = item.value;
+						this.$set(item,'checked',true)
+					}else{
+						this.$set(item,'checked',false)
+					}
+			   }
+			},
+			
+			checkboxChange: function (e) {
+				let	value = e.detail.value;
+				for (var i = 0, lenI = this.items.length; i < lenI; ++i) {
+					const item = this.items[i]
+					if(value ==item.value){
+						this.value = item.value
+						this.$set(item,'checked',true)
+					}else{
+						this.$set(item,'checked',false)
+					}
+				}
+				
+			},
+			confirm(){
+				uni.setStorageSync("env",this.value);
+				uni.reLaunch({
+					url:'../homePage/homePage'
+				})
+			}
+		},
+		components: {
+			
+		},
+	}
+</script>
+
+<style lang="scss">
+	.setting{
+		display: flex;
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+		.checkBox{
+			margin-left: 50rpx;
+			margin-top: 200rpx;
+		}
+	}
+  .uni-list-cell{
+	  display: flex;
+	  margin-bottom: 20rpx;
+  }
+</style>

+ 13 - 2
pages/homePage/homePage.vue

@@ -5,7 +5,7 @@
 			<view class="liveContent">
 				<view class="backDiv"></view>
 				<view class="title">分享好房 · 躺平赚钱</view>
-				<view class="subTitle">新手赚钱帮助 ></view>
+				<view class="subTitle" @click="setEnv">新手赚钱帮助 ></view>
 				<view class="levelDiv" v-if="userInfo.ownersUnion"
 					style="background: url('https://dm.static.elab-plus.com/yezhu/h5/icon_line_back.png') center/100% 100% no-repeat;">
 					<view class="level_top">
@@ -166,6 +166,7 @@
 				houseList: [],
 				userId: "",
 				token: "",
+				clickCount:8,
 				userInfo: {
 					"userId": "",
 					"name": null,
@@ -295,7 +296,17 @@
 					}
 				}
 				
-			}
+			},
+			setEnv(){
+				if (this.clickCount < 0) {
+					this.clickCount = 8;
+					uni.navigateTo({
+						url:"../developSetting/developSetting"
+					})
+				} else {
+					this.clickCount--;
+				}
+			},
 		},
 		components: {
 			levelView