Browse Source

Merge branch 'master' of https://git.liliju.com/YZM/wardrobe

YZM 1 year ago
parent
commit
7d01d2a07c

+ 107 - 28
pages/dingdan/index.vue

@@ -2,12 +2,18 @@
 	<view :style="{ minHeight: sys.windowHeight + 'px' }"
 		:class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
 		<tm-menubars title="我的订单" :shadow="0" :showback="true"></tm-menubars>
-		<tm-tabs align="center" class="qiehuan1" v-model="activeIndex" :list="list2" range-key="title" @change="changeTab"></tm-tabs>
+		<tm-tabs align="split" class="qiehuan1" v-model="activeIndex" :list="list2" range-key="title" @change="changeTab"></tm-tabs>
 		<div class="zhuti shangpin">
 			<tm-sheet class="jiaoxi" style="" v-for="item in test">
-				<tm-cartCellListFood class="shuliang" :typeclick="typeclick" :mdata="item" :cart-num.sync="item.buy"></tm-cartCellListFood>
+				<tm-cartCellListFood class="shuliang" :typeclick="typeclick" :mdata="item" v-on:sure="goSure(item.id)" v-on:Eval="goEval(item.id)"  :cart-num.sync="item.buy"></tm-cartCellListFood>
 			</tm-sheet>
 		</div>
+		<view class="empty" v-if="isEmpty">
+			暂无内容~
+		</view>
+		<view class="bottom" v-if="isBottom">
+			没有更多~
+		</view>
 		<!-- 弹出层消息 -->
 		<tm-message ref="toast"></tm-message>
 	</view>
@@ -31,19 +37,14 @@ export default {
 				itemId: 0,
 				checked:false,
 				status:0
-			},{
-				img: '../../static/img/84.png',
-				title: '产品3(任选)',
-				size:'S',
-				label: '这个产品是只有几个融会',
-				price: 36.2,
-				id: 3,
-				buy: 0,
-				itemId: 0,
-				checked:false,
-				status:0
 			}],
 			typeclick:4,//1加入购物车,2购物车
+			page:1,
+			pagesize:5,
+			total:0,
+			isBottom:false,
+			isEmpty:false,
+			sel:-1
 		};
 	},
 	onLoad() {
@@ -58,37 +59,42 @@ export default {
 		this.sys = uni.getSystemInfoSync();
 		this.getOrderList(-1);
 	},
+	onReachBottom() {
+		this.loadMore(this.sel)
+	},
 	methods: {
-		// 切换tab
-		changeTab(e){
+		changeTab(e){ // 切换tab
 			this.activeIndex=e;
-			let sel=0;
 			if(e==0){
-				sel=-1;
+				this.sel=-1;
 			}else if(e==1){
-				sel=0;
+				this.sel=0;
 			}else if(e==2){
-				sel=1;
+				this.sel=1;
 			}else if(e==3){
-				sel=2;
+				this.sel=2;
 			}
-			this.getOrderList(sel)	
+			this.getOrderList(this.sel)	
 		},
 		// 获取订单列表
 		getOrderList(index){
 			let that=this;
+			this.page=1;
+			this.pagesize=5;
 			myRequest({
 				url:'/api/Order/orderList',
 				method:'post',
-				data:{type:index}
+				data:{type:this.sel,page:that.page,pagesize:that.pagesize}
 			}).then(res=>{
 					if (res.data.code == 200) {
+						that.total=res.data.data.total;
 						if (res.data.data.length != 0) {
+							that.isEmpty=false;
 							that.test = [];
 							for (let i = 0; i < res.data.data.data.length; i++) {
 								var obj = {
-									img: res.data.data.data[i].goods_image,
-									title: res.data.data.data[i].goods_name,
+									img: res.data.data.data[i].orderGoods.goods_img,
+									title: res.data.data.data[i].orderGoods.goods_name,
 									// label: '黑色 - 6518/320',
 									// size:'S',
 									price: res.data.data.data[i].pay_money,
@@ -98,25 +104,95 @@ export default {
 									checked: false,
 									goods_id:res.data.data.data[i].goods_id,
 									orderStatus:res.data.data.data[i].order_status,
-									orderNo:res.data.data.data[i].order_sn
+									orderNo:res.data.data.data[i].order_sn,
+									isEval:res.data.data.data[i].is_evaluate
 								};
 								that.test.push(obj)
 							}
 						}else {
 						that.test = [];
+						that.isEmpty=true;
+						that.isBottom=false;
 						}
 					} 
 					console.log(res.data.data.data,'订单列表');
 			})
+		},
+	  goSure(ids){
+	  	let that=this;
+	  	myRequest({
+	  	url:'/api/Order/receipt',
+	  	method:'post',
+	  	data:{
+	  		id:ids
+	  	}
+	  	}).then(res=>{
+	  		if(res.data.code==200){
+	  			that.$refs.toast.show({
+	  				model: 'success',
+	  				label: res.data.msg
+	  			})
+	  		}else{
+	  			that.$refs.toast.show({
+	  				model: 'error',
+	  				label: res.data.msg
+	  			})
+	  		}
+	  	})
+	  },
+	  goEval(ids){
+			uni.navigateTo({
+				url:'/pages/pingjia/index?id='+ids
+				})		
+		},
+		loadMore(index){ //加载更多
+			if(this.isBottom) return;
+			this.page++;
+			let that=this;
+			myRequest({
+				url:'/api/Order/orderList',
+				method:'post',
+				data:{type:this.sel,page:that.page,pagesize:that.pagesize}
+			}).then(res=>{
+					if (res.data.code == 200) {
+						if(that.test.length < res.data.data.total){
+							let newList=[];
+							for (let i = 0; i < res.data.data.data.length; i++) {
+								var obj = {
+									img: res.data.data.data[i].orderGoods.goods_img,
+									title: res.data.data.data[i].orderGoods.goods_name,
+									// label: '黑色 - 6518/320',
+									// size:'S',
+									price: res.data.data.data[i].pay_money,
+									id: res.data.data.data[i].id,
+									buy: res.data.data.data[i].goods_num,
+									itemId: res.data.data.data[i].id,
+									checked: false,
+									goods_id:res.data.data.data[i].goods_id,
+									orderStatus:res.data.data.data[i].order_status,
+									orderNo:res.data.data.data[i].order_sn,
+									isEval:res.data.data.data[i].is_evaluate
+								};
+								newList.push(obj)
+							}
+							that.test=that.test.concat(newList)
+						} else {
+						that.isBottom=true;
+						that.page--;
+						console.log(that.page);
+						}
+					} else {
+						that.isBottom=true;
+						that.page--;
+					}
+			})
 		}
 	},
 }
 </script>
 
 <style lang="scss">
-	/deep/ .tm-menubars .body{
-		background-color: #1b1b1b !important;
-	}
+	/deep/ .tm-menubars .body{background-color: #1b1b1b !important;}
 	/deep/ .qiehuan1 .text-primary{color: white !important;}
 	/deep/ .qiehuan1 .tm-tabs-wk{border-top: 1px solid #262628;}
 	/deep/ .shuliang .text-size-n{color: white !important;}
@@ -131,4 +207,7 @@ export default {
 	/deep/ .shangpin .tm-cartCellListFood-img{width:90px !important;height:90px !important;}
 	/deep/ .shuliang .text-size-n{color: white !important;}
 	/deep/ .jiaoxi{margin:0 !important;padding: 8px !important;margin-top: 10px !important;}
+	.empty,.bottom{display: flex;justify-content:center;align-items: center;color: #AAAAAA;}
+	.empty{padding-top: 100px;}
+	.bottom{padding-bottom: 10px;height: 30px;width: 100%;}
 </style>

+ 0 - 11
pages/dizhi/index.vue

@@ -13,17 +13,6 @@
 					<image class="fr xiugai" src="/static/img/109.png" mode="widthFix" @click="goRedact(item)"></image>
 				</view>
 			</view>
-			<!-- <view class="contdz pt-20">
-				<view>
-					<text>薛定谔</text>
-					<text class="ml-40 text-gray text-size-m">178****5566</text>
-					<tm-button class="ml-50" :round="10" theme="gray" size="s">学校</tm-button>
-				</view>
-				<view class="text-gray text-size-s mt-15">
-					<text>江苏省南京市江宁区 淳化街道弘景大道3666号</text>
-					<image class="fr xiugai" src="/static/img/109.png" mode="widthFix"></image>
-				</view>
-			</view>-->
 		</div>
 		<tm-button :round="24" class="sao mb-40 mt-40" block @click="xinjian">新建收获地址</tm-button>
 		<!-- 弹出层消息 -->

+ 69 - 41
pages/pingjia/index.vue

@@ -33,9 +33,9 @@
 					<view class="mt-30">
 						<view class="">
 							<view class="cent-bottom-m">
-								<view class="uploadImg" style="display: flex;justify-content: flex-start;flex-wrap: wrap;align-items: flex-start;">
+								<view class="uploadImg">
 									<view v-for="(el, index) in fileList" :key="index">
-										<view class="uploadImg-image" >
+										<view class="uploadImg-image">
 											<image @click="checkImgbox(fileList, index)" :src="imgUrl+el"
 												mode="aspectFill" style="width: 100%;height: 100%;border-radius: 4px;">
 											</image>
@@ -53,7 +53,6 @@
 											<view style="font-size: 12px;">上传图片</view>
 										</view>
 									</view>
-
 								</view>
 							</view>
 						</view>
@@ -76,36 +75,36 @@
 		data() {
 			return {
 				item: {
-					img: '../../static/img/83.png',
-					title: '丝缎质感纹理风衣',
-					label: '黑色 - 6518/320',
-					size: 'S',
-					price: '1299',
-					id: 3,
-					buy: 0,
-					itemId: 0,
-					checked: false,
+					// img: '../../static/img/83.png',
+					// title: '丝缎质感纹理风衣',
+					// label: '黑色 - 6518/320',
+					// size: 'S',
+					// price: '1299',
+					// id: 3,
+					// buy: 0,
+					// itemId: 0,
+					// checked: false,
 				},
 				// typeclick:5,//1加入购物车,2购物车
-				typeclick: 7, //1加入购物车,2购物车
+				typeclick: 9, //1加入购物车,2购物车
 				rate1: 0,
 				rate2: 0,
 				rate3: 0,
 				val_1: '',
-				// filelist:["https://picsum.photos/200?v=555","https://picsum.photos/200?v=555"],
-				// filelist:[],
 				fileList: [],
 				imgUrl: "",
 				sizeType: ['compressed'],
 				imageList: [], // 申诉图片地址
 				uploadFlag: true, // 申诉图片大于3张隐藏上传按钮
-				orNo: '',
+				orId: '',
+				imgList: []
 			};
 		},
 		onLoad(op) {
 			console.log(op);
 			if (op) {
-				this.orNo = op.no;
+				this.orId = op.id;
+				this.getOrderDetail()
 			}
 		},
 		created() {
@@ -117,6 +116,31 @@
 			this.sys = uni.getSystemInfoSync();
 		},
 		methods: {
+			getOrderDetail() {
+				let that = this;
+				myRequest({
+					url: '/api/Order/orderDetails',
+					method: 'post',
+					data: {
+						id: that.orId
+					}
+				}).then(res => {
+					if (res.data.code == 200) {
+						this.item = res.data.data.goods_details;
+						this.item.title = res.data.data.goods_details.goods_name;
+						this.item.img = res.data.data.goods_details.goods_img;
+						this.item.price = res.data.data.goods_details.goods_price;
+						this.item.buy = res.data.data.goods_details.buy_num;
+						console.log(res.data.data.goods_details, '33');
+					} else {
+						that.$refs.toast.show({
+							model: 'error',
+							label: res.data.msg
+						})
+					}
+				})
+			},
+
 			openImagePage() {
 				let that = this;
 				if (that.fileList.length > 5) {
@@ -154,7 +178,9 @@
 						console.log(url, 'url');
 						// 选中图片
 						if (_this.fileList.indexOf(url) == -1) {
+							let uu = url.substr(24);
 							_this.fileList.push(url);
+							_this.imgList.push(uu)
 							console.log(_this.fileList, 'haah');
 						}
 						uni.hideLoading();
@@ -179,11 +205,12 @@
 			},
 			popImg(index) { //删除图片
 				this.fileList.splice(index, 1);
+				this.imgList.splice(index, 1);
 				if (this.fileList.length < 1) {
 					this.uploadFlag = true
 				}
 			},
-			// 上传图片
+
 			aa(num) {
 				if (num == 1) {
 					this.checked1 = true;
@@ -217,11 +244,11 @@
 						url: '/api/Order/orderEvaluate',
 						method: 'post',
 						data: {
-							id: that.orNo,
+							id: that.orId,
 							experience_value: that.rate1,
 							delivery_value: that.rate2,
 							service_value: that.rate3,
-							atlas: that.fileList.join(','),
+							atlas: that.imgList.join(','),
 							content: that.val_1
 						}
 					}).then(res => {
@@ -231,6 +258,11 @@
 								model: 'success',
 								label: res.data.msg
 							})
+							setTimeout(() => {
+								uni.navigateBack({
+									delta: 1
+								})
+							}, 800)
 						} else {
 							that.$refs.toast.show({
 								model: 'error',
@@ -253,11 +285,19 @@
 		padding: 10px 10px;
 	}
 
-	/deep/ .kuang {
+	/deep/ .kuang,
+	/deep/ .jia .tm-button-btn {
 		margin: 0 !important;
 		padding: 0px !important;
 	}
 
+	.uploadImg {
+		display: flex;
+		justify-content: flex-start;
+		align-items: flex-start;
+		flex-wrap: wrap;
+	}
+
 	.uploadImg-image {
 		width: 70px;
 		height: 70px;
@@ -271,29 +311,22 @@
 		top: -5px;
 	}
 
-	/deep/ .jia .tm-button-btn {
-		padding: 0px !important;
-		margin: 0px !important;
-	}
-
 	/deep/ .jia .tm-button-btn .px-12 {
 		padding: 0 !important;
 	}
 
-	/deep/ .uploadImg-image .white {
+	/deep/ .white {
 		background: none !important;
-		color: #ffffff !important;
 	}
 
-	/deep/ .jia .white {
-		background: none !important;
+	/deep/ .jia .white,
+	/deep/ .jian .white {
 		color: #ffffff !important;
 	}
 
 	.sao {
 		width: 90%;
-		margin: 0 auto;
-		margin-top: 20px;
+		margin: 20px auto 0px;
 	}
 
 	/deep/ .shuliang .text-size-n {
@@ -301,9 +334,8 @@
 	}
 
 	/deep/ .shangpin .tm-cartCellListFood {
-		padding: 0px 0px 15px 0px !important;
-		margin-top: 5px !important;
-		margin-bottom: 20px !important;
+		margin: 5px 0px 20px !important;
+		padding-bottom: 15px !important;
 		border-bottom: 1px solid #1B1B1B;
 	}
 
@@ -311,10 +343,7 @@
 		border-top: 1px solid #1b1b1b !important;
 	}
 
-	/deep/ .shangpin .title {
-		color: white !important;
-	}
-
+	/deep/ .shangpin .title,
 	/deep/ .shangpin .text-red {
 		color: white !important;
 	}
@@ -370,8 +399,7 @@
 	.jia-btn {
 		width: 70px;
 		height: 70px;
-		border: 1px solid #ffffff;
+		border: 1px solid #eeeeee;
 		border-radius: 4px;
-
 	}
 </style>

+ 18 - 8
tm-vuetify/components/tm-cartCellListFood/tm-cartCellListFood.vue

@@ -72,9 +72,12 @@
 							<view class="fukuan" @click="goPay(mdata,0)">去付款</view>
 						</view>
 						<view class="flex" v-if="mdata[keyMap['orderStatus']]==1 ||mdata[keyMap['orderStatus']]==2">
-							<view class="fukuan mr-10" @click="goBuy(mdata,1)">再次购买</view>
-							<view class="fukuan" @click="goSure(mdata,1)" v-if="mdata[keyMap['orderStatus']]==1">确认收货</view>
-							<view class="fukuan" @click="goEval(mdata,2)" v-if="mdata[keyMap['orderStatus']]==2">去评价</view>
+							<view class="fukuan mr-10" @click="goBuy(mdata,1)">再次购买</view>	
+							<view class="fukuan" @click="goSure(mdata,1)" v-if="mdata[keyMap['orderStatus']]==1">确认收货</view>						
+							<view class="fukuan" @click="goEval(mdata,2)"
+								v-if="mdata[keyMap['orderStatus']]==2 && mdata[keyMap['isEval']]== 0 ">去评价</view>
+							<!-- <view class="fukuan" @click="goEvalList(mdata,2)"
+								v-if="mdata[keyMap['orderStatus']]==2 && mdata[keyMap['isEval']]== 1 ">我的评价</view> -->
 						</view>
 						<!-- <view class="flex" v-if="mdata[keyMap['orderStatus']]==-2">
 							<view class="fukuan mr-10">再次购买</view>
@@ -157,7 +160,8 @@
 						unit: 'unit',
 						buy: 'buy',
 						size: 'size',
-						orderStatus: 'orderStatus'
+						orderStatus: 'orderStatus',
+						isEval:'isEval'
 					}
 				}
 			},
@@ -248,14 +252,20 @@
 			},
 			// 评价
 			goEval(data,type){
-				// console.log(data);
-				uni.navigateTo({
-					url:'/pages/pingjia/index?no='+data.orderNo
-				})
+				console.log(data,type);
+				this.$emit('Eval', {
+					data: data,
+					type: 2
+				});
 			},
+			goEvalList(data,type){},
 			// 确认收货
 			goSure(data,type){
 				console.log(data);
+				this.$emit('sure', {
+					data: data,
+					type: 1
+				});
 				
 			},
 			//购买