lilei 4 år sedan
förälder
incheckning
6496d6fef5
5 ändrade filer med 11 tillägg och 5 borttagningar
  1. 1 1
      libs/axios.js
  2. 3 2
      pages/goods/index.vue
  3. 4 1
      pages/index/index.vue
  4. 1 0
      pages/login/login.vue
  5. 2 1
      store/index.js

+ 1 - 1
libs/axios.js

@@ -39,7 +39,7 @@ const request = (opts, hasToken) => {
 				if(ret.status == '200'){
 					resolve(ret)
 				}else{
-					if(ret.status == 500 || ret.status == 401){
+					if(ret.status == 500){
 						uni.showToast({
 							icon:'none',
 							title: ret.message,

+ 3 - 2
pages/goods/index.vue

@@ -6,13 +6,13 @@
 		</view>
 		<!-- 商品 -->
 		<view class="goods">
-			<view v-for="(item,index) in goodsList" :key="item.type.id" v-if="item.list.length">
+			<view v-for="(item,index) in goodsList" :key="item.type.id" v-if="goodsList.length&&item.list.length">
 				<u-section :title="item.type.name" line-color="#01c9b2" sub-title="更多" @click="toGoods(item.type)"></u-section>
 				<view class="goods-list">
 					<uni-coods :list="item.list"></uni-coods>
 				</view>
 			</view>
-			<view v-else>
+			<view v-if="goodsList.length==0">
 				<u-empty text="暂无商品" mode="list"></u-empty>
 			</view>
 		</view>
@@ -39,6 +39,7 @@
 		},
 		onShow() {
 			this.getbannerList()
+			this.goodsList = []
 			getGoodsClass({}).then(res => {
 				console.log(res)
 				if(res.status == 200){

+ 4 - 1
pages/index/index.vue

@@ -54,6 +54,9 @@
 			 			</view>
 			 		</view>
 			 	</view>
+				<view v-if="stationDataList.length==0">
+					<u-empty text="暂无数据" mode="list"></u-empty>
+				</view>
 			 </view>
 		</view>
 	</view>
@@ -110,7 +113,7 @@
 			checkLogin().then(res => {
 				console.log(res,'checkLogin')
 				this.hasLogin = res.status == 200
-				if(!this.hasLogin){
+				if(!this.hasLogin&&!this.$store.state.vuex_noLogin){
 					uni.navigateTo({
 						url:"/pages/login/login"
 					})

+ 1 - 0
pages/login/login.vue

@@ -62,6 +62,7 @@
 		},
 		methods: {
 			cansel(){
+				this.$store.state.vuex_noLogin = true
 				uni.reLaunch({
 					url: '/pages/index/index'
 				})

+ 2 - 1
store/index.js

@@ -116,7 +116,8 @@ const store = new Vuex.Store({
 		// 客服电话
 		vuex_kfMobile: '4008826012',
 		// 垃圾箱类型
-		vuex_rubbishType: []
+		vuex_rubbishType: [],
+		vuex_noLogin: false
 	},
 	mutations: {
 		$uStore(state, payload) {