YZM 2 years ago
parent
commit
3cbcbc9ba7
3 changed files with 37 additions and 31 deletions
  1. 1 1
      pages/gengduo/index.vue
  2. 1 3
      pages/user/index.vue
  3. 35 27
      pages/wardrobe/index.vue

+ 1 - 1
pages/gengduo/index.vue

@@ -97,7 +97,6 @@
 		created() {
 			this.sys = uni.getSystemInfoSync();
 			this.getTop();
-			this.change(0)
 		},
 		methods: {
 			// 获取一级分类
@@ -117,6 +116,7 @@
 								title: item.category_name
 							})
 						})
+						this.change(0)
 					} else {
 						that.$refs.toast.show({
 							model: 'error',

+ 1 - 3
pages/user/index.vue

@@ -56,7 +56,7 @@
 	</view>
 </template>	
 <script>
-	// {title:'我的钱包',type:'1'},{title:'我的消息',type:'4'},
+	// {title:'我的钱包',type:'1'},{title:'我的消息',type:'4'},{title:'衣服录入',type:'10'},{title:'创建家庭',type:'8'},
 import{myRequest} from '@/api/request.js'
 export default {
 	data() {
@@ -69,9 +69,7 @@ export default {
 			{title:'我的关注',type:'5'},
 			{title:'系统通知',type:'6'},
 			{title:'历史记录',type:'7'},
-			{title:'创建家庭',type:'8'},
 			{title:'内容推送',type:'9'},
-			{title:'衣服录入',type:'10'},
 			]
 		};
 	},

+ 35 - 27
pages/wardrobe/index.vue

@@ -12,7 +12,7 @@
 			</view>
 			<view class="dingwei" v-if="itemuser==0">
 				<text style="vertical-align: middle;" class="text-size-m mr-20">暂无家庭成员去添加</text>
-				<image style="vertical-align: middle;" src="/static/img/42.png" mode="widthFix"></image>
+				<image @click="chuangjian" style="vertical-align: middle;" src="/static/img/42.png" mode="widthFix"></image>
 			</view>
 		</view>
 		<!-- 推荐 -->
@@ -64,10 +64,12 @@
 					<view class="text-align-center text-size-m mt-8">{{item.brand}}</view>
 					<view class="text-align-center text-size-m mt-6 mb-6">{{item.goods_name}}</view>
 				</view>
-				<view style="clear: both;" class="more ma-30 pt-40" @click="gengmore()">
+				<view style="clear: both;"></view>
+				<view v-if="quanbuList.length<total" class="more ma-30 pt-40" @click="gengmore()">
 					<image src="/static/img/30.png" mode="widthFix"></image>
 					<text class="text-size-s">下拉加载更多~</text>
 				</view>
+				
 			</tm-sheet>
 		</view>
 		<!-- 待取衣服 -->
@@ -123,8 +125,9 @@ export default {
 				'../../static/img/100.png',
 				'../../static/img/100.png',
 			],
-			pagesize:3,
-			page:1
+			pagesize:2,
+			page:1,
+			total:0
 		};
 	},
 	onLoad() {
@@ -140,12 +143,34 @@ export default {
 		this.fenleichange();
 	},
 	methods: {
+		getList(){
+			var that=this;
+			myRequest({
+				url: "/api/Goods/classificationData",
+				method:'post',
+				data:{role_id:that.itemuser.id,id:that.activeIndex,page:that.page,pagesize:that.pagesize}
+			}).then(res => {
+				if (res.data.code == 200) {
+					if(res.data.data.length != 0){
+						that.quanbuList=that.quanbuList.concat(res.data.data.data);
+						that.total=res.data.data.total;
+					}
+				}else{
+					that.quanbuList=[];
+				}
+			})
+		},
 		quxiao(){
 			this.show_1=false;
 		},
 		chuFun(){
 			this.show_1=false;
 		},
+		chuangjian(){
+			uni.navigateTo({
+				url: "/pages/chuanghome/index",
+			})
+		},
 		longtap(){
 			uni.navigateTo({
 				url: "/pages/changan/index",
@@ -162,20 +187,9 @@ export default {
 			})
 		},
 		fenleichangeFun(){
-			var that=this;
-			myRequest({
-				url: "/api/Goods/classificationData",
-				method:'post',
-				data:{role_id:that.itemuser.id,id:that.activeIndex,page:that.page,pagesize:that.pagesize}
-			}).then(res => {
-				if (res.data.code == 200) {
-					if(res.data.data.length != 0){
-						that.quanbuList=res.data.data.data;
-					}
-				}else{
-					that.quanbuList=[];
-				}
-			})
+			this.page=1;
+			this.quanbuList=[]
+			this.getList()
 		},
 		sosoFun(){
 			uni.navigateTo({
@@ -201,7 +215,7 @@ export default {
 						if(wu==0){
 							that.itemuser=res.data.data[0];
 						}
-						this.fenleichangeFun()
+						this.getList()
 					}else{
 						that.itemuser=0;
 					}
@@ -237,14 +251,8 @@ export default {
 			})
 		},
 		gengmore(){
-			var that=this;
-			that.page=that.page+1;
-			this.fenleichangeFun();
-		},
-		chengyuan(){
-			uni.navigateTo({
-				url: "/pages/chengyuan/index",
-			})
+			this.page=this.page+1;
+			this.getList();
 		},
 		luru(){
 			uni.navigateTo({