Browse Source

订单和评价修改

LXT-NJ\Admin 2 years ago
parent
commit
6e44fe2432

+ 40 - 17
pages/dingdan/index.vue

@@ -5,11 +5,11 @@
 		<tm-tabs align="split" 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">
 		<div class="zhuti shangpin">
 			<tm-sheet class="jiaoxi" style="" v-for="item in test">
 			<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>
 			</tm-sheet>
 		</div>
 		</div>
-		<view class="" v-if="isBottom">
-			没有更多了~~~~
+		<view class="empty" v-if="isEmpty">
+			暂无内容~
 		</view>
 		</view>
 		<!-- 弹出层消息 -->
 		<!-- 弹出层消息 -->
 		<tm-message ref="toast"></tm-message>
 		<tm-message ref="toast"></tm-message>
@@ -34,22 +34,12 @@ export default {
 				itemId: 0,
 				itemId: 0,
 				checked:false,
 				checked:false,
 				status:0
 				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购物车
 			typeclick:4,//1加入购物车,2购物车
 			page:1,
 			page:1,
 			pagesize:5,
 			pagesize:5,
-			isBottom:false
+			isBottom:false,
+			isEmpty:false
 		};
 		};
 	},
 	},
 	onLoad() {
 	onLoad() {
@@ -92,11 +82,12 @@ export default {
 			}).then(res=>{
 			}).then(res=>{
 					if (res.data.code == 200) {
 					if (res.data.code == 200) {
 						if (res.data.data.length != 0) {
 						if (res.data.data.length != 0) {
+							that.isEmpty=false;
 							that.test = [];
 							that.test = [];
 							for (let i = 0; i < res.data.data.data.length; i++) {
 							for (let i = 0; i < res.data.data.data.length; i++) {
 								var obj = {
 								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',
 									// label: '黑色 - 6518/320',
 									// size:'S',
 									// size:'S',
 									price: res.data.data.data[i].pay_money,
 									price: res.data.data.data[i].pay_money,
@@ -113,11 +104,40 @@ export default {
 							}
 							}
 						}else {
 						}else {
 						that.test = [];
 						that.test = [];
+						that.isEmpty=true;
 						}
 						}
 					} 
 					} 
 					console.log(res.data.data.data,'订单列表');
 					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
+				})
+			
+		}
 	},
 	},
 }
 }
 </script>
 </script>
@@ -138,4 +158,7 @@ export default {
 	/deep/ .shangpin .tm-cartCellListFood-img{width:90px !important;height:90px !important;}
 	/deep/ .shangpin .tm-cartCellListFood-img{width:90px !important;height:90px !important;}
 	/deep/ .shuliang .text-size-n{color: white !important;}
 	/deep/ .shuliang .text-size-n{color: white !important;}
 	/deep/ .jiaoxi{margin:0 !important;padding: 8px !important;margin-top: 10px !important;}
 	/deep/ .jiaoxi{margin:0 !important;padding: 8px !important;margin-top: 10px !important;}
+	.empty{
+		display: flex;justify-content:center;align-items: center;height: 100%;color: #AAAAAA;padding-top: 100px;
+	}
 </style>
 </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>
 					<image class="fr xiugai" src="/static/img/109.png" mode="widthFix" @click="goRedact(item)"></image>
 				</view>
 				</view>
 			</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>
 		</div>
 		<tm-button :round="24" class="sao mb-40 mt-40" block @click="xinjian">新建收获地址</tm-button>
 		<tm-button :round="24" class="sao mb-40 mt-40" block @click="xinjian">新建收获地址</tm-button>
 		<!-- 弹出层消息 -->
 		<!-- 弹出层消息 -->

+ 1 - 1
pages/pingjia/index.vue

@@ -86,7 +86,7 @@
 					// checked: false,
 					// checked: false,
 				},
 				},
 				// typeclick:5,//1加入购物车,2购物车
 				// typeclick:5,//1加入购物车,2购物车
-				typeclick: 7, //1加入购物车,2购物车
+				typeclick: 9, //1加入购物车,2购物车
 				rate1: 0,
 				rate1: 0,
 				rate2: 0,
 				rate2: 0,
 				rate3: 0,
 				rate3: 0,

+ 12 - 11
tm-vuetify/components/tm-cartCellListFood/tm-cartCellListFood.vue

@@ -76,8 +76,8 @@
 							<view class="fukuan" @click="goSure(mdata,1)" v-if="mdata[keyMap['orderStatus']]==1">确认收货</view>						
 							<view class="fukuan" @click="goSure(mdata,1)" v-if="mdata[keyMap['orderStatus']]==1">确认收货</view>						
 							<view class="fukuan" @click="goEval(mdata,2)"
 							<view class="fukuan" @click="goEval(mdata,2)"
 								v-if="mdata[keyMap['orderStatus']]==2 && mdata[keyMap['isEval']]== 0 ">去评价</view>
 								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 class="fukuan" @click="goEvalList(mdata,2)"
+								v-if="mdata[keyMap['orderStatus']]==2 && mdata[keyMap['isEval']]== 1 ">我的评价</view> -->
 						</view>
 						</view>
 						<!-- <view class="flex" v-if="mdata[keyMap['orderStatus']]==-2">
 						<!-- <view class="flex" v-if="mdata[keyMap['orderStatus']]==-2">
 							<view class="fukuan mr-10">再次购买</view>
 							<view class="fukuan mr-10">再次购买</view>
@@ -252,19 +252,20 @@
 			},
 			},
 			// 评价
 			// 评价
 			goEval(data,type){
 			goEval(data,type){
-				// console.log(data);
-				uni.navigateTo({
-					url:'/pages/pingjia/index?id='+data.id
-				})
-			},
-			goEvalList(data,type){
-				// uni.navigateTo({
-				// 	url:''
-				// })
+				console.log(data,type);
+				this.$emit('Eval', {
+					data: data,
+					type: 2
+				});
 			},
 			},
+			goEvalList(data,type){},
 			// 确认收货
 			// 确认收货
 			goSure(data,type){
 			goSure(data,type){
 				console.log(data);
 				console.log(data);
+				this.$emit('sure', {
+					data: data,
+					type: 1
+				});
 				
 				
 			},
 			},
 			//购买 
 			//购买