YZM 2 years ago
parent
commit
594cd46ea2

+ 78 - 65
pages/chengyuan/index.vue

@@ -16,17 +16,21 @@
 								<image block mode="widthFix" src="/static/img/54.png" @click="add()"></image>
 							</view>
 						</view> -->
-						<view class="fr you black mt-30" style="width: 92%;" v-for="(item1,index1) in reqData.role" v-if="show==index1">
-							<tm-input  :required="true"  title="用户名" v-model="item1.username" placeholder="你想叫自己什么" align="right"></tm-input>
-							<tm-input  :required="true"  title="身高(cm)" v-model="item1.height" align="right"></tm-input>
-							<tm-input  :required="true"  title="体重(kg)" v-model="item1.weight" align="right"></tm-input>
-							<tm-pickers class="tan" :default-value.sync="item1.body_arr" rang-key="title" :list="chelianglis">
-								<tm-input name="shencai" title="身材" placeholder="请选择车型" disabled :value="obTstr2(item1.body_arr)" right-icon="icon-angle-right"></tm-input>
+						<view class="fr you black mt-30" style="width: 92%;">
+							<tm-input  :required="true"  title="用户名" v-model="reqData.username" placeholder="你想叫自己什么" align="right"></tm-input>
+							<tm-input  :required="true"  title="身高(cm)" v-model="reqData.height" align="right"></tm-input>
+							<tm-input  :required="true"  title="体重(kg)" v-model="reqData.weight" align="right"></tm-input>
+							<tm-pickers class="tan" :default-value.sync="reqData.body_arr" rang-key="title" :list="chelianglis">
+								<tm-input name="shencai" title="身材" placeholder="请选择身材" disabled :value="obTstr2(reqData.body_arr)" right-icon="icon-angle-right"></tm-input>
 							</tm-pickers>
 						</view>
 					</view>
 					<view style="clear: both;"></view>
-					<tm-button :round="24" class="sao mb-40" style="margin-top: 50px;" @click="tijiao()" block>保存</tm-button>
+					<view class="anniu">
+						<tm-button v-if="id != ''" @click="quxiao()" theme="gray" size="n">删除</tm-button>
+						<tm-button @click="tijiao()" class="fr" theme="primary" size="n">确认</tm-button>
+					</view>
+					<!-- <tm-button :round="24" class="sao mb-40" style="margin-top: 50px;" @click="tijiao()" block>保存</tm-button> -->
 				</view>
 			</tm-sheet>
 		</div>
@@ -39,13 +43,6 @@ import{myRequest} from '@/api/request.js'
 export default {
 	data() {
 		return {
-			shencaiList:[
-				{title:"梨形",id:21},
-				{title:"标准",id:31},
-				{title:"胖子",id:41},
-				{title:"瘦子",id:51},
-				{title:"模特",id:61},
-			],
 			active:1,
 			chelianglis:[
 				{title:"标准",id:1},
@@ -55,21 +52,27 @@ export default {
 			],
 			show:0,
 			reqData:{
-				wardrode_no:'6943819164690',
-				familyname:'',
-				role:[{
-					username:'',
-					weight:'',
-					height:'',
-					body_type:'',
-					body_arr:[]
-				}]
-				
+				family_id:uni.getStorageSync("family_id"),
+				username:'',
+				weight:'',
+				height:'',
+				body_type:'',
+				body_arr:[]
 			},
+			id:''
 		};
 	},
-	onLoad() {
+	onLoad(e) {
 		
+		this.reqData.username=e.username;
+		this.reqData.weight=e.weight;
+		this.reqData.height=e.height;
+		this.reqData.body_type=e.body_type;
+		this.id=e.id?e.id:'';
+		if(e.body_type){
+			this.reqData.body_arr.push(this.chelianglis[e.body_type])
+		}
+		console.log(this.id)
 	},
 	created() {
 		this.sys = uni.getSystemInfoSync();
@@ -90,58 +93,67 @@ export default {
 		},
 		tijiao(){
 			var that=this;
-			var arr=this.reqData.role;
-			for(let i=0;i<arr.length;i++){
-				if(arr[i].username==""){
-					that.$refs.toast.show({model:'warn',label:'请将数据填写完整'})
-					return;
-				}if(arr[i].weight==""){
-					that.$refs.toast.show({model:'warn',label:'请将数据填写完整'})
-					return;
-				}if(arr[i].height==""){
-					that.$refs.toast.show({model:'warn',label:'请将数据填写完整'})
-					return;
-				}
-				if(arr[i].body_arr.length !=0){
-					arr[i].body_type=arr[i].body_arr[0].id;
-				}
+			if(this.reqData.username==""){
+				that.$refs.toast.show({model:'warn',label:'请将数据填写完整'})
+				return;
+			}if(this.reqData.weight==""){
+				that.$refs.toast.show({model:'warn',label:'请将数据填写完整'})
+				return;
+			}if(this.reqData.height==""){
+				that.$refs.toast.show({model:'warn',label:'请将数据填写完整'})
+				return;
+			}
+			if(this.reqData.body_arr.length !=0){
+				this.reqData.body_type=this.reqData.body_arr[0].id;
+			}
+			if(that.id){
+				this.reqData.id=that.id;
+				var url="/api/MemberInfo/updateMemberInfo";
+			}else{
+				var url="/api/MemberInfo/addOneMemberInfo";
 			}
-			console.log(this.reqData)
 			myRequest({
-				url: "/api/Family/addFamilyMember",
+				url:url ,
 				method:'post',
 				data:that.reqData
 			}).then(res => {
 				console.log(res.data)
 				if (res.data.code == 200) {
-					uni.setStorageSync("family_id",res.data.data.family_id)
-					that.$refs.toast.show({model:'success',label:res.data.msg})
-					that.active=4;
+					let pages = getCurrentPages(); // 当前页面
+					let beforePage = pages[pages.length - 2]; // 前一个页面
+					uni.navigateBack({
+						delta: 1,
+						success: function() {
+							beforePage.$vm.getDate()
+						}
+					});
 				}else{
 					that.$refs.toast.show({model:'error',label:res.data.msg})
 				}
 			})
 			
 		},
-		add(){
-			var timestamp = Date.parse(new Date());
-			var obj={
-				username:'',
-				weight:'',
-				height:'',
-				body_type:'',
-				body_arr:[],
-				timestamp:timestamp
-			}
-			this.reqData.role.push(obj);
-			this.show=this.reqData.role.length-1;
-		},
-		shanchu(timestamp){
-			var index = this.reqData.role.findIndex((item) => {
-			  return item.timestamp == timestamp;
-			});
-			this.reqData.role.splice(index, 1);
-			this.show=this.reqData.role.length-1;
+		quxiao(){
+			var that=this;
+			myRequest({
+				url: "/api/MemberInfo/deleteMemberInfo",
+				method:'post',
+				data:{id:that.id}
+			}).then(res => {
+				console.log(res.data)
+				if (res.data.code == 200) {
+					let pages = getCurrentPages(); // 当前页面
+					let beforePage = pages[pages.length - 2]; // 前一个页面
+					uni.navigateBack({
+						delta: 1,
+						success: function() {
+							beforePage.$vm.getDate()
+						}
+					});
+				}else{
+					that.$refs.toast.show({model:'error',label:res.data.msg})
+				}
+			})
 		},
 		obTstr2(o){
 			if(Array.isArray(o)){
@@ -188,7 +200,6 @@ export default {
 		background-color: #1b1b1b !important;
 	}
 	/deep/ .kuang{margin:0 !important;padding: 14px !important;margin-bottom: 40px !important;}
-	/deep/ .kuang uni-button{background-color: #303440 !important;}
 	.jindu{width: 90%;margin: 0 auto;display: block;}
 	.wenzi{width: 94%;margin: 0 auto;}
 	.nicheng{width: 130px;height:132px;display: block;margin:0 auto;margin-top: 50px;}
@@ -215,4 +226,6 @@ export default {
 	/deep/ .tm--badges{position: absolute;top: 0px;right:6px}
 	.logincla{margin-top: 100px;}
 	/deep/ .quindex uni-button{background-color: #0A84FF !important;}
+	.anniu{width: 80%;margin: 0 auto;margin-top: 20px;}
+	/deep/ .anniu .gray.bk{color: white !important;}
 </style>

+ 3 - 1
pages/index/index.vue

@@ -56,7 +56,9 @@ export default {
 	},
 	methods: {
 		initBtn(){
-			
+			this.$refs.yigui.qingkong();
+			this.$refs.yigui.fenleichange();
+			this.$refs.yigui.getfenltext();
 		},
 		changepage(info){
 			this.showpage=info.index

+ 15 - 4
pages/qiehuan/index.vue

@@ -17,7 +17,7 @@
 			</tm-sheet> -->
 			<tm-sheet class="kuang" v-for="(item,index) in userList">
 				<view class="mt-2 flex-between flex-center dingwei pt-20 pb-20">
-					<view class="touxiang">
+					<view class="touxiang" @click="bianji(item)">
 						<image v-if="index==0" class="ml-20" style="vertical-align: middle;" src="/static/img/53.png" mode="widthFix"></image>
 						<image v-else class="ml-20" style="vertical-align: middle;" src="/static/img/61.png" mode="widthFix"></image>
 						<text style="vertical-align: middle;" class="text-size-g text-white">{{item.username}}</text>
@@ -61,6 +61,12 @@ export default {
 		this.getDate()
 	},
 	methods: {
+		bianji(item){
+			console.log(item)
+			uni.navigateTo({
+				url: "/pages/chengyuan/index?username="+item.username+'&weight='+item.weight+'&height='+item.height+'&body_type='+item.body_type+'&id='+item.id,
+			})
+		},
 		tianjia(){
 			uni.navigateTo({
 				url: "/pages/chengyuan/index",
@@ -74,9 +80,14 @@ export default {
 				data:{family_id:uni.getStorageSync("family_id"),id:item.id}
 			}).then(res => {
 				if (res.data.code == 200) {
-					uni.navigateTo({
-						url: "/pages/index/index?index=1",
-					})
+					let pages = getCurrentPages(); // 当前页面
+					let beforePage = pages[pages.length - 2]; // 前一个页面
+					uni.navigateBack({
+						delta: 1,
+						success: function() {
+							beforePage.$vm.initBtn()
+						}
+					});
 				}else{
 					
 				}

+ 10 - 2
pages/wardrobe/index.vue

@@ -59,7 +59,8 @@
 			<!-- 衣橱 -->
 			<tm-sheet class="yichu" style="margin-bottom: 70px !important;">
 				<tm-tabs class="C1b1b1b qiehuan" @change="fenleichangeFun" color="white"  align="left"  v-model="activeIndex" :list="list" range-key="title"></tm-tabs>
-				<view class="yiguicla black pa-6 ma-4 fl" v-for="(item,index) in quanbuList" @longtap="longtap()" @click="xiangqing()">
+				<view class="pa-10 text-size-s">柜中{{have}}件 共{{count}}条</view>
+				<view class="yiguicla black pa-6 ma-4 fl" :class="item.is_have==1?'C0178FD':''"  v-for="(item,index) in quanbuList" @longtap="longtap()" @click="xiangqing()">
 					<image :src="item.image" mode="widthFix"></image>
 					<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>
@@ -127,7 +128,9 @@ export default {
 			],
 			pagesize:2,
 			page:1,
-			total:0
+			total:0,
+			count:0,
+			have:0
 		};
 	},
 	onLoad() {
@@ -143,6 +146,9 @@ export default {
 		this.fenleichange();
 	},
 	methods: {
+		qingkong(){
+			this.quanbuList=[];
+		},
 		getList(){
 			var that=this;
 			myRequest({
@@ -154,6 +160,8 @@ export default {
 					if(res.data.data.length != 0){
 						that.quanbuList=that.quanbuList.concat(res.data.data.data);
 						that.total=res.data.data.total;
+						that.count=res.data.data.count;
+						that.have=res.data.data.have;
 					}
 				}else{
 					that.quanbuList=[];

+ 43 - 29
pages/yifu/index.vue

@@ -56,36 +56,23 @@
 			</tm-sheet> -->
 			<tm-button :round="24" class="sao mb-40" block @click="show_1=true">出库</tm-button>
 		</div>
-		
-		<div class="zhuti" v-if="activeIndex==1">
-			<tm-sheet class="kuang" style="padding-bottom: 10px !important;">
-				<view style="width: 94%;margin:0 auto;">
-					<image class="chuanda" src="/static/img/108.png" mode="widthFix"></image>
-					<view class="text-align-center mt-20 text-white">丝缎质感纹理风衣</view>
-					<view class="text-align-center mt-10 text-size-s">丝滑如肌肤</view>
-				</view>
-			</tm-sheet>
-		</div>
-		<view class="goumai shangpin" v-if="activeIndex==1">
-			<view class="pt-20"><text class="ml-20">衣物名</text><text class="fr mr-20 text-gray text-size-s">丝缎质感纹理风衣</text></view>
-			<view class="pa-20"><tm-cartCellListFood  v-on:jiaruFun="jiarufuFun" v-for="item in test1" :typeclick="typeclick1" :mdata="item" :cart-num.sync="item.buy"></tm-cartCellListFood></view>
-		</view>
-		<tm-sheet :shadow="24" class="jiaoxi xiao" v-if="activeIndex==1">
-			<tm-tabs align="center" class="qiehuan1" v-model="activeIndex5" :list="list5" range-key="title"></tm-tabs>
+		<!-- 搭配 -->
+		<tm-sheet v-if="activeIndex==1" class="yichu" style="margin-bottom: 40px !important;">
+			<!-- <view class="biaoti text-white mt-30 text-size-m"><view class="mr-10"></view>分类</view> -->
+			<!-- <tm-tabs class="C1b1b1b qiehuan" color="white"  align="left"  v-model="activeIndex" :list="list" range-key="title"></tm-tabs> -->
+			<!-- <view class="biaoti text-white mt-30 text-size-m"><view class="mr-10"></view>场景</view> -->
+			<!-- <tm-tabs class="C1b1b1b qiehuan" color="white"  align="left"  v-model="activeIndex1" :list="list1" range-key="title"></tm-tabs> -->
+			<!-- <tm-tabs class="C1b1b1b qiehuan" color="white"  align="left"  v-model="activeIndex1" :list="list1" range-key="title"></tm-tabs> -->
+			<view class="yiguicla1 black pa-6 ma-4 fl" v-for="(item,index) in quanbuList1">
+				<image :src="item.src" mode="widthFix"></image>
+				<view class="text-size-m mt-20 mb-20 ml-10">{{item.text}}</view>
+			</view>
+			<view style="clear: both;" 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 class="zhuti shangpin" v-if="activeIndex==1">
-			<tm-sheet :padding="[0, 0]" class="jiaoxi xiao">
-				<tm-cartCellListFood  v-on:jiaruFun="jiarufuFun" v-for="item in test" :typeclick="typeclick" :mdata="item" :cart-num.sync="item.buy"></tm-cartCellListFood>
-			</tm-sheet>
-		</view>
-		<view class="anniu" v-if="activeIndex==1">
-			<tm-menu direction="top" :list="['聚餐穿','开会穿']" @change="yuyue">
-				<tm-button :round="24" theme="gray" size="n">预约明日</tm-button>
-			</tm-menu>
-			
-			<tm-button :round="24" class="fr" theme="primary" size="n">全部取出</tm-button>
-		</view>
+		
 		
 		<tm-poup v-model="show_1" :position="pos" class="tcc">
 			<view style="position: relative !important;">
@@ -178,6 +165,26 @@ export default {
 				buy: 0,
 				itemId: 0
 			}],
+			quanbuList1:[{
+				src:'/static/img/44.png',
+				text:'日常穿搭'
+			},{
+				src:'/static/img/44.png',
+				text:'日常穿搭'
+			},{
+				src:'/static/img/44.png',
+				text:'日常穿搭'
+			},{
+				src:'/static/img/44.png',
+				text:'日常穿搭'
+			},{
+				src:'/static/img/44.png',
+				text:'日常穿搭'
+			},{
+				src:'/static/img/44.png',
+				text:'日常穿搭',
+				off:false
+			}],
 		};
 	},
 	onLoad() {
@@ -187,6 +194,9 @@ export default {
 		this.sys = uni.getSystemInfoSync();
 	},
 	methods: {
+		gengmore(){
+			
+		},
 		yuyue(){
 			this.$refs.toast.show({model:'success',label:'预约成功'})
 		},
@@ -281,4 +291,8 @@ export default {
 	.goumai{background: #1B1B1B;margin-bottom: 10px;}
 	.anniu{width: 80%;margin: 0 auto;margin-top: 20px;padding-bottom: 30px;}
 	/deep/ .qiehuan1 .text-primary{color: white !important;}
+	.yiguicla1 image{width: 95%;display: block;margin: 0 auto;margin-top: 5px;}
+	.yiguicla1{width: 47%;border-radius: 10px;}
+	.more{text-align: center;}
+	.more image{margin-right: 10px;vertical-align: middle;width: 30px;}
 </style>

File diff suppressed because it is too large
+ 0 - 1
unpackage/dist/build/app-plus/app-config-service.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/build/app-plus/app-service.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/build/app-plus/app-view.js


Some files were not shown because too many files changed in this diff