twt лет назад: 2
Родитель
Сommit
bdb3897b08
3 измененных файлов с 14 добавлено и 6 удалено
  1. 5 2
      pages/activity/jkDetail.vue
  2. 7 4
      pages/shop/goodsDetail.vue
  3. 2 0
      utils/common.js

+ 5 - 2
pages/activity/jkDetail.vue

@@ -95,7 +95,7 @@
 					<view class="shareTxt">分享</view>
 				</button> -->
 				<!-- 状态1未开始 2进行中3已结束 -->
-				<view class="bottomBtn" v-if="info.state==2" @click="signUp">
+				<view class="bottomBtn" v-if="info.state==2" @click="signUp" :style="{background:'#'+themeColor}">
 				  <span v-if="info.money">¥{{info.money}} &nbsp; 立即抢购</span>
 				  <span v-else>立即报名</span>
 				</view>
@@ -132,7 +132,7 @@
 				</view>
 				<view class="bmTtnBox">
 					<view style="height: 1rpx;"></view>
-					<view class="bmBtn" @click="submitOrder">
+					<view class="bmBtn" @click="submitOrder" :style="{background:'#'+themeColor}">
 						<span v-if="info.money">¥{{info.money}} &nbsp; 立即抢购</span>
 						<span v-else>立即报名</span>
 					</view>
@@ -268,6 +268,7 @@
 				 ext:'',
 				 shareId:'',
 				 scene:'',
+				 themeColor:'',
 			}
 		},
 		onLoad(opt) {
@@ -278,6 +279,7 @@
 		   this.userInfo=this.$store.state.userInfo;
 		  // opt.scene='10002'
 		   if(this.userInfo){
+			   this.themeColor = uni.getStorageSync("themeColor");
 			this.queryGoodsLook()
 			if(opt.scene&&opt.scene!='undefined'){
 				this.scene=opt.scene;
@@ -291,6 +293,7 @@
 		   	
 		   }else{
 		   	this.$common.automaticlogin().then(val => {
+				this.themeColor = uni.getStorageSync("themeColor");
 		   		this.userInfo=this.$store.state.userInfo;
 		   		
 		   		if(opt.scene&&opt.scene!='undefined'){

+ 7 - 4
pages/shop/goodsDetail.vue

@@ -128,8 +128,8 @@
 				<image src="../../static/timg/share.png" mode="" class="bottomImg"></image>
 				<view class="bottomTxt">分享</view>
 			</button> -->
-			<view class="bottomBtn" @click="ljbuy" v-if="!activityEnd&&info.goodsDownTime">立即购买</view>
-			<view class="bottomBtn" @click="ljbuy" v-if="activityEnd&&!info.goodsDownTime">立即购买</view>
+			<view class="bottomBtn"  :style="{background:'#'+themeColor}" @click="ljbuy" v-if="!activityEnd&&info.goodsDownTime">立即购买</view>
+			<view class="bottomBtn" :style="{background:'#'+themeColor}" @click="ljbuy" v-if="activityEnd&&!info.goodsDownTime">立即购买</view>
 			<view class="bottomBtn2"  v-if="activityEnd&&info.goodsDownTime">抢购结束</view>
 		</view>
 	</view>
@@ -185,7 +185,7 @@
 			</view>
 			
 			<view class="buybtnBox">
-				<view class="buyBtn" @click="goBuy">立即购买</view>
+				<view class="buyBtn" @click="goBuy" :style="{background:'#'+themeColor}">立即购买</view>
 			</view>
 			
 		</view>
@@ -250,6 +250,7 @@
 				shareId:'',
 				shareQrCode:'',
 				scene:'',
+				themeColor:'',
 			}
 		},
 		onLoad(opt) {
@@ -259,13 +260,14 @@
 			if(opt.shareId){
 				this.shareId=opt.shareId
 			}
-			
+		
 			//this.userInfo = uni.getStorageSync("userInfo");
 			this.userInfo=this.$store.state.userInfo;
 			this.ext=this.$common.getExtStoreId();
 			//opt.scene='10003'
 			console.log(opt)
 			if(this.userInfo){
+				this.themeColor = uni.getStorageSync("themeColor");
 				this.wxOpenData=this.$store.state.wxOpenData;
 				if(opt.scene&&opt.scene!='undefined'){
 					this.scene=opt.scene;
@@ -278,6 +280,7 @@
 				this.$common.automaticlogin().then(val => {
 					this.userInfo=this.$store.state.userInfo;
 					this.wxOpenData=this.$store.state.wxOpenData;
+					this.themeColor = uni.getStorageSync("themeColor");
 					if(opt.scene&&opt.scene!='undefined'){
 						this.scene=opt.scene;
 						this.getShareParams()

+ 2 - 0
utils/common.js

@@ -28,6 +28,8 @@ const automaticlogin = function() {
 				   unionId:extConfig.unionId
 				  },'GET').then(res => {
 					  $store.commit('mutationswxOpenData', res.data);
+					  var themeColor= res.data.themeColor
+					   uni.setStorageSync('themeColor',themeColor);
 					  if(res.data.loginInfo){
 					  	$store.commit('mutationsuserInfo', res.data.loginInfo.openUser)
 					  }