Ver código fonte

优惠券样式,登录回退

chenrong 1 ano atrás
pai
commit
334f826eb2
3 arquivos alterados com 21 adições e 10 exclusões
  1. 9 4
      pages/coupon/coupon.vue
  2. 10 4
      pages/login/login.vue
  3. 2 2
      pages/raffle/raffle.vue

+ 9 - 4
pages/coupon/coupon.vue

@@ -5,10 +5,13 @@
 				可使用
 			</view>
 			<view :class="['tab', tabActive == 2?'active':'']" style="margin-left: 10px;" @click="tabClick(2)">
-				不可使用
+				已使用
+			</view>
+			<view :class="['tab', tabActive == 3?'active':'']" style="margin-left: 10px;" @click="tabClick(3)">
+				已过期
 			</view>
 		</view>
-		<view class="card" v-for="(item, index) in list">
+		<view :class="['card', item.status != 0 ? 'grey' : '']" v-for="(item, index) in list">
 			<view class="leftIcon" ></view>
 			<view class="left"  >
 				¥<span style="font-size: 18px;">{{item.discount}}</span>
@@ -59,8 +62,10 @@
 				this.tabActive = index
 				if (index == 1) {
 					this.params.status = 0
-				} else {
+				} else if(index == 2) {
 					this.params.status = 1
+				} else {
+					this.params.status = 2
 				}
 				this.getList()
 			},
@@ -79,7 +84,7 @@
 <style scoped lang="scss">
 	.tabs {
 		display: flex;
-		
+		margin-bottom: 10px;
 		.tab {
 			width: 68px;
 			height: 24px;

+ 10 - 4
pages/login/login.vue

@@ -28,13 +28,12 @@
 		},
 		onShow() {
 			console.log(getCurrentPages(), '宋宋宋宋宋宋宋')
-			
 		},
 		methods: {
 			noLogin() {
 				console.log('sssssssss')
-				wx.navigateBack({
-					delta: 1
+				wx.switchTab({
+					url: '/pages/index/index'
 				})
 			},
 			wxLogin: function(e) {
@@ -91,8 +90,15 @@
 					wx.setStorageSync('token', res.data.token);
 					wx.setStorageSync('userId', res.data.userId);
 					getApp().globalData.hasLogin = true;
+					let routerList = getCurrentPages()
+					let index = 0
+					for (var i = 0; i < routerList.length; i++) {
+						if(routerList[i].route == "pages/login/login") {
+							index += 1
+						}
+					}
 					wx.navigateBack({
-						delta: 1
+						delta: index
 					})
 				})
 			}

+ 2 - 2
pages/raffle/raffle.vue

@@ -34,7 +34,7 @@
 		<view class="list2" v-if="tabActive == 2">
 			<view class="ka" v-for="(item, index) in list" @click="toDrawCard({id: item.id})">
 				<view class="top">
-					<image mode="widthFix" :src="item.icon"></image>
+					<image mode="aspectFit" :src="item.icon"></image>
 				</view>
 				<view class="ka-info">
 					<view class="ka-name">
@@ -52,7 +52,7 @@
 		<view class="list2 three" v-if="tabActive > 2">
 			<view class="ka" v-for="(item, index) in list" @click="toDrawCard({id: item.id})">
 				<view class="top">
-					<image mode="widthFix" :src="item.icon"></image>
+					<image mode="aspectFit" :src="item.icon"></image>
 				</view>
 				<view class="ka-info">
 					<view class="ka-name">