Browse Source

可配置部分

zhengkaixin 3 years ago
parent
commit
04229da283
5 changed files with 40 additions and 6 deletions
  1. 8 1
      pages/index/index.vue
  2. 20 3
      pages/index/main.vue
  3. 4 1
      pages/user/index.vue
  4. BIN
      static/img/homeLogo.png
  5. 8 1
      utils/mixin.js

+ 8 - 1
pages/index/index.vue

@@ -8,7 +8,7 @@
 		
 			<view class="home-head">
 				<view class="" >
-					<img class="homeLogo" src="/static/img/homeLogo.png" alt="">
+					<img class="homeLogo" :src="homeLogo" alt="">
 				
 				</view>
 				<view class="homeTab">
@@ -57,6 +57,7 @@
 	export default {
 		data() {
 			return {
+				homeLogo:'/static/img/homeLogo.png',
  				memberQyshow:false,
 				memberQy:1,
 				memberQyColumns:[],
@@ -229,6 +230,12 @@
 			}
 			
 		},
+		onLoad() {
+			 var  logo=this.carhelp.getConfig().logo
+			 if(logo){
+				 this.homeLogo=logo
+ 			 }
+		},
 		onReady() {
 			
 			this.getBannerInfo()

+ 20 - 3
pages/index/main.vue

@@ -1,8 +1,8 @@
 <template>
 		<view>
-			<view class="jpLogin">
+			<view class="jpLogin" :style="customStyle0" >
 			
-				<view  class="personal-btn" v-if="bottonShow"> 
+				<view  class="personal-btn"  v-if="bottonShow"> 
 					<u-button type="error" shape="circle" :custom-style="customStyle1" @click="gotoMain(true)" ><span>加入我们</span></u-button>
 					<u-button hover-class="none" shape="circle" :custom-style="customStyle2" @click="gotoMain(false)"><span>我先逛逛</span></u-button>
 					<view style="text-align:center;margin-top:10px;color: white;font-size: 16px;">荆州市总工会&nbsp;主办</view>
@@ -20,6 +20,7 @@
 	export default {
 		data() {
 			return {
+				customStyle0: "", 
 				customStyle1: {
 					background: '#FF3737',
 					color:'#FF3737',
@@ -67,7 +68,11 @@
 				}).then((response) => {
 					console.log('findByOpenId')
 					let [error, res] = response;
-				  
+					
+					//var backImg="https://yktwechat.xiaoxinda.com/config/xxd2021.jpg"
+					this.carhelp.setConfig(res.data.data.configure) 
+					this.setBackImg()
+					
 					if (res.data.code == 200&&res.data.result) {			
 						var token = res ? res.data.data.token : '';					
 						this.carhelp.setPersonInfo(res.data.data.memberInfo );
@@ -88,7 +93,19 @@
 					this.carhelp.logoff()
 					this.bottonShow=true
 				})
+			},
+			setBackImg(){
+				var  img=this.carhelp.getConfig().homepageLogo
+				if(img){
+					this.customStyle0="background:url("+img+") no-repeat;background-size: 100%;"
+				}
 			}
+			
+		},
+		onLoad() {
+			 
+				this.setBackImg( )
+			 
 		},
 		onReady() {
 			

+ 4 - 1
pages/user/index.vue

@@ -452,7 +452,10 @@
 		onLoad(){
 			 _self = this;
 			 console.log('mylogined onLoad')
-			 
+			 var  consumerPhone=this.carhelp.getConfig().consumerPhone
+			 if(consumerPhone){
+				 this.tel=consumerPhone
+ 			 }
 			 
 		},
 		onShow(){

BIN
static/img/homeLogo.png


+ 8 - 1
utils/mixin.js

@@ -9,7 +9,14 @@ var app = {
 	remove: key =>  uni.removeStorageSync(prefix + key),
 	getConfig : () => {
 		var config = uni.getStorageSync(prefix + '_config_$')
-		 return config?config:{};
+		var configure={}
+		if(config){
+			for(var  i in config){
+				var con=config[i];
+				configure[con.key]=con.value
+			}
+		}
+		 return configure;
 	},
 	setConfig : (value) => uni.setStorageSync(prefix + '_config_$', value),