lilei %!s(int64=4) %!d(string=hai) anos
pai
achega
0e780239d6
Modificáronse 3 ficheiros con 10 adicións e 4 borrados
  1. 5 1
      pages/index/index.vue
  2. 3 2
      pagesA/luckDraw/luckDraw.vue
  3. 2 1
      store/index.js

+ 5 - 1
pages/index/index.vue

@@ -90,6 +90,7 @@
 	import {checkLogin,getUserInfo} from '@/api/login.js'
 	import {parseQueryString} from '@/libs/tools.js'
 	import {sellerFindByPartnerNo} from '@/api/user.js'
+	import moment from 'moment'
 	export default {
 		data() {
 			return {
@@ -188,11 +189,14 @@
 				findEnable().then(res => {
 					if(res.status == 200 && res.data){
 						this.$u.vuex('vuex_LuckDraw',res.data)
-						findCustomerTimes({id:this.luckDraw.luckyDrawNo}).then(res => {
+						// 判断活动是否过期
+						
+						findCustomerTimes({id:res.data.luckyDrawNo}).then(res => {
 							let reTimes = 0
 							if(res.status == 200){
 								reTimes = res.data.timesSurplus || 0
 							}
+							this.$u.vuex('vuex_LuckDrawTimes',reTimes)
 							this.showLottery = reTimes > 0
 						})
 					}else{

+ 3 - 2
pagesA/luckDraw/luckDraw.vue

@@ -296,7 +296,7 @@ export default {
 			});
 		},
 		// 获取免费抽奖次数
-		getPrizeSetting(){
+		getCustomerTimes(){
 			findCustomerTimes({id:this.luckDraw.luckyDrawNo}).then(res => {
 				if(res.status == 200){
 					this.reTimes = res.data.timesSurplus || 0
@@ -439,7 +439,8 @@ export default {
 		this.timer = setInterval(this.scrollAnimate, 2000);
 		this.getScrollTextHeight()
 		// 查询免费抽奖次数
-		this.getPrizeSetting();
+		this.getCustomerTimes()
+		// this.reTimes = this.$store.state.vuex_LuckDrawTimes
 	},
 	onLoad() {
 		this.luckDraw = this.$store.state.vuex_LuckDraw

+ 2 - 1
store/index.js

@@ -118,7 +118,8 @@ const store = new Vuex.Store({
 		vuex_noLogin: false,
 		vuex_isClick: false,
 		// 大转盘
-		vuex_LuckDraw: null
+		vuex_LuckDraw: null,
+		vuex_LuckDrawTimes: 0
 	},
 	mutations: {
 		$uStore(state, payload) {