Browse Source

修改评价页面

LXT-NJ\Admin 2 năm trước cách đây
mục cha
commit
fcda4f152a

+ 14 - 7
pages/dingdan/index.vue

@@ -2,12 +2,15 @@
 	<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-sheet>
 		</div>
+		<view class="" v-if="isBottom">
+			没有更多了~~~~
+		</view>
 		<!-- 弹出层消息 -->
 		<tm-message ref="toast"></tm-message>
 	</view>
@@ -44,6 +47,9 @@ export default {
 				status:0
 			}],
 			typeclick:4,//1加入购物车,2购物车
+			page:1,
+			pagesize:5,
+			isBottom:false
 		};
 	},
 	onLoad() {
@@ -80,7 +86,9 @@ export default {
 			myRequest({
 				url:'/api/Order/orderList',
 				method:'post',
-				data:{type:index}
+				data:{type:index,
+				page:that.page,
+				pagesize:that.pagesize}
 			}).then(res=>{
 					if (res.data.code == 200) {
 						if (res.data.data.length != 0) {
@@ -98,7 +106,8 @@ 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)
 							}
@@ -108,15 +117,13 @@ export default {
 					} 
 					console.log(res.data.data.data,'订单列表');
 			})
-		}
+		},
 	},
 }
 </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;}

+ 49 - 18
pages/pingjia/index.vue

@@ -53,7 +53,6 @@
 											<view style="font-size: 12px;">上传图片</view>
 										</view>
 									</view>
-
 								</view>
 							</view>
 						</view>
@@ -76,15 +75,15 @@
 		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购物车
@@ -92,20 +91,20 @@
 				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,30 @@
 			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;
+						// this.item.title=res.data.data.goods_details.goods_name;
+						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,8 +177,10 @@
 						console.log(url, 'url');
 						// 选中图片
 						if (_this.fileList.indexOf(url) == -1) {
+							let uu=url.substr(24);
 							_this.fileList.push(url);
-							console.log(_this.fileList, 'haah');
+							_this.imgList.push(uu)
+							console.log(_this.fileList,'haah');
 						}
 						uni.hideLoading();
 						if (_this.fileList.length > 5) {
@@ -179,11 +204,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 +243,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 +257,11 @@
 								model: 'success',
 								label: res.data.msg
 							})
+							setTimeout(()=>{
+								uni.navigateBack({
+									delta:1
+								})
+							},800)
 						} else {
 							that.$refs.toast.show({
 								model: 'error',

+ 14 - 5
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'
 					}
 				}
 			},
@@ -250,9 +254,14 @@
 			goEval(data,type){
 				// console.log(data);
 				uni.navigateTo({
-					url:'/pages/pingjia/index?no='+data.orderNo
+					url:'/pages/pingjia/index?id='+data.id
 				})
 			},
+			goEvalList(data,type){
+				// uni.navigateTo({
+				// 	url:''
+				// })
+			},
 			// 确认收货
 			goSure(data,type){
 				console.log(data);