Browse Source

评价页面功能

LXT-NJ\Admin 2 years ago
parent
commit
4bce974413

+ 12 - 15
pages/dingdan/index.vue

@@ -17,7 +17,7 @@ import{myRequest} from '@/api/request.js'
 export default {
 	data() {
 		return {
-			list2:[ '全部','待付款','已付款','已完成','待收货'],
+			list2:[ '全部','待付款','已付款','已完成'],
 			activeIndex:0,
 			test: [
 				{
@@ -71,8 +71,6 @@ export default {
 				sel=1;
 			}else if(e==3){
 				sel=2;
-			}else if(e==4){
-				sel=-2;
 			}
 			this.getOrderList(sel)	
 		},
@@ -84,23 +82,23 @@ export default {
 				method:'post',
 				data:{type:index}
 			}).then(res=>{
-				if(res.data.code==200){
 					if (res.data.code == 200) {
 						if (res.data.data.length != 0) {
 							that.test = [];
-							for (let i = 0; i < res.data.data.length; i++) {
+							for (let i = 0; i < res.data.data.data.length; i++) {
 								var obj = {
-									img: res.data.data[i].goods_image,
-									title: res.data.data[i].goods_name,
+									img: res.data.data.data[i].goods_image,
+									title: res.data.data.data[i].goods_name,
 									// label: '黑色 - 6518/320',
 									// size:'S',
-									price: res.data.data[i].pay_money,
-									id: res.data.data[i].id,
-									buy: res.data.data[i].goods_num,
-									itemId: res.data.data[i].id,
+									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[i].goods_id,
-									orderStatus:res.data.data[i].order_status
+									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
 								};
 								that.test.push(obj)
 							}
@@ -108,8 +106,7 @@ export default {
 						that.test = [];
 						}
 					} 
-					console.log(res.data.data,'33');
-				}
+					console.log(res.data.data.data,'订单列表');
 			})
 		}
 	},

+ 340 - 95
pages/pingjia/index.vue

@@ -1,132 +1,377 @@
 <template>
-	<view :style="{ minHeight: sys.windowHeight + 'px' }"
-		:class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
+	<view :style="{ minHeight: sys.windowHeight + 'px' }" :class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
 		<tm-menubars title="我的评价" :shadow="0" :showback="true"></tm-menubars>
 		<div class="zhuti">
 			<tm-sheet class="kuang" style="padding-bottom: 70px !important;">
 				<view style="width: 94%;margin:0 auto;">
-					<tm-cartCellListFood class="shangpin" :typeclick="typeclick" :mdata="item" :cart-num.sync="item.buy"></tm-cartCellListFood>
+					<tm-cartCellListFood class="shangpin" :typeclick="typeclick" :mdata="item"
+						:cart-num.sync="item.buy"></tm-cartCellListFood>
 					<view class="tiyan">
 						<text class="text-white mr-20">产品体验</text>
 						<tm-rate v-model="rate1"></tm-rate>
-						<text class="ml-20 text-size-s">非常满意</text>
+						<text class="ml-20 text-size-s" v-if="rate1==5">非常满意</text>
+						<text class="ml-20 text-size-s" v-if="rate1<=4&&rate1>3">比较满意</text>
+						<text class="ml-20 text-size-s" v-if="rate1<=3&&rate1>0">一般满意</text>
 					</view>
 					<view class="tiyan">
 						<text class="text-white mr-20">派送评价</text>
 						<tm-rate v-model="rate2"></tm-rate>
-						<text class="ml-20 text-size-s">比较满意</text>
+						<text class="ml-20 text-size-s" v-if="rate2==5">非常满意</text>
+						<text class="ml-20 text-size-s" v-if="rate2<=4&&rate2>3">比较满意</text>
+						<text class="ml-20 text-size-s" v-if="rate2<=3&&rate2>0">一般满意</text>
 					</view>
 					<view class="tiyan">
 						<text class="text-white mr-20">服务态度</text>
 						<tm-rate v-model="rate3"></tm-rate>
-						<text class="ml-20 text-size-s">一般满意</text>
+						<text class="ml-20 text-size-s" v-if="rate3==5">非常满意</text>
+						<text class="ml-20 text-size-s" v-if="rate3<=4&&rate3>3">比较满意</text>
+						<text class="ml-20 text-size-s" v-if="rate3<=3&&rate3>0">一般满意</text>
 					</view>
-					<tm-input class="shuru" :height="150" title="" :maxlength="144"  :border-bottom="false" placeholder="快来发表评论吧!"  input-type="textarea" v-model="val_1" bg-color="grey-lighten-5" clear></tm-input>
+					<tm-input class="shuru" :height="150" title="" :maxlength="144" :border-bottom="false"
+						placeholder="快来发表评论吧!" input-type="textarea" v-model="val_1" bg-color="grey-lighten-5" clear>
+					</tm-input>
 					<view class="mt-30">
-						<tm-upload :tips="false" :filelist.sync="filelist"></tm-upload>
+						<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 v-for="(el, index) in fileList" :key="index">
+										<view class="uploadImg-image" >
+											<image @click="checkImgbox(fileList, index)" :src="imgUrl+el"
+												mode="aspectFill" style="width: 100%;height: 100%;border-radius: 4px;">
+											</image>
+											<view class="jian" @click="popImg(index)">
+												<tm-button class="shanchu" theme="white" size="s" icon="icon-times">
+												</tm-button>
+											</view>
+										</view>
+									</view>
+									<view class="jia-btn" @click="openImagePage" v-if="uploadFlag">
+										<view class="jia">
+											<view>
+												<tm-button theme="white" size="m" icon="icon-plus"></tm-button>
+											</view>
+											<view style="font-size: 12px;">上传图片</view>
+										</view>
+									</view>
+
+								</view>
+							</view>
+						</view>
+						<!-- <tm-upload :tips="false" :filelist.sync="filelist" max='5'></tm-upload> -->
 					</view>
 					<tm-button :round="24" class="sao" block @click="submit">提交</tm-button>
 				</view>
 			</tm-sheet>
-			
+
 		</div>
 		<!-- 弹出层消息 -->
 		<tm-message ref="toast"></tm-message>
 	</view>
-</template>	
+</template>
 <script>
-import{myRequest} from '@/api/request.js'
-export default {
-	data() {
-		return {
-			item: {
-				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购物车
-			rate1:1,
-			rate2:2,
-			rate3:3,
-			val_1:'',
-			filelist:["https://picsum.photos/200?v=555","https://picsum.photos/200?v=555"],
-		};
-	},
-	onLoad() {
-		
-		
-	},
-	created() {
-		this.sys = uni.getSystemInfoSync();
-	},
-	methods: {
-		aa(num){
-			if(num==1){
-				this.checked1=true;
-				this.checked2=false;
-				this.checked3=false;
-			}else if(num==2){
-				this.checked1=false;
-				this.checked2=true;
-				this.checked3=false;
-			}else if(num==3){
-				this.checked1=false;
-				this.checked2=false;
-				this.checked3=true;
+	import {
+		myRequest
+	} from '@/api/request.js'
+	export default {
+		data() {
+			return {
+				item: {
+					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购物车
+				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: '',
+			};
+		},
+		onLoad(op) {
+			console.log(op);
+			if (op) {
+				this.orNo = op.no;
 			}
 		},
-		// 提交评价
-		submit(){
-			console.log('11');
-			myRequest({
-				url:'/api/Order/orderEvaluate',
-				method:'post',
-				data:{
-				experience_value:''	,
-				delivery_value:'',
-				service_value:'',
-				atlas:'',
-				content:''
+		created() {
+			if (!uni.getStorageSync("token")) {
+				uni.navigateTo({
+					url: "/pages/login/index",
+				})
+			}
+			this.sys = uni.getSystemInfoSync();
+		},
+		methods: {
+			openImagePage() {
+				let that = this;
+				if (that.fileList.length > 5) {
+					uni.showToast({
+						title: "最多支持5张图片",
+						icon: "none"
+					})
+					return;
 				}
-			}).then(res=>{
-				if(res.data.code==200){
-					console.log(res.data.data,'pingjia1!!');
+				uni.chooseImage({
+					count: 1,
+					sizeType: ['compressed'],
+					sourceType: ['album', 'camera'],
+					success: function(res) {
+						uni.showLoading({
+							title: '图片上传中'
+						});
+						that.uploadImage(res.tempFilePaths)
+					}
+				});
+			},
+			uploadImage(tempFilePaths) {
+				let _this = this;
+				uni.uploadFile({
+					url: 'http://yigui.liliju.com/common/uploads/upload', //接口地址
+					header: {
+						"token": uni.getStorageSync('token'),
+					}, //请求token
+					filePath: tempFilePaths[0],
+					name: 'file',
+					success: (res) => {
+						let data = JSON.parse(res.data);
+						console.log(data);
+						let url = data.data.yimg;
+						console.log(url, 'url');
+						// 选中图片
+						if (_this.fileList.indexOf(url) == -1) {
+							_this.fileList.push(url);
+							console.log(_this.fileList, 'haah');
+						}
+						uni.hideLoading();
+						if (_this.fileList.length > 5) {
+							_this.uploadFlag = false
+						} else {
+							_this.uploadFlag = true
+						}
+					}
+				});
+			},
+			checkImgbox(fileList, index) { //放大图片
+				console.log(fileList, index, 999)
+				let arr = [];
+				fileList.forEach((el) => {
+					arr.push(this.imgUrl + el);
+				})
+				uni.previewImage({
+					urls: arr,
+					current: index
+				});
+			},
+			popImg(index) { //删除图片
+				this.fileList.splice(index, 1);
+				if (this.fileList.length < 1) {
+					this.uploadFlag = true
 				}
-			})
-			
-		}
-	},
-}
+			},
+			// 上传图片
+			aa(num) {
+				if (num == 1) {
+					this.checked1 = true;
+					this.checked2 = false;
+					this.checked3 = false;
+				} else if (num == 2) {
+					this.checked1 = false;
+					this.checked2 = true;
+					this.checked3 = false;
+				} else if (num == 3) {
+					this.checked1 = false;
+					this.checked2 = false;
+					this.checked3 = true;
+				}
+			},
+			// 提交评价
+			submit() {
+				if (this.rate1 == 0 || this.rate2 == 0 || this.rate3 == 0) {
+					uni.showToast({
+						title: '请选择满意度',
+						icon: 'none'
+					})
+				} else if (this.val_1 == '') {
+					uni.showToast({
+						title: '内容不能为空',
+						icon: 'none'
+					})
+				} else {
+					let that = this;
+					myRequest({
+						url: '/api/Order/orderEvaluate',
+						method: 'post',
+						data: {
+							id: that.orNo,
+							experience_value: that.rate1,
+							delivery_value: that.rate2,
+							service_value: that.rate3,
+							atlas: that.fileList.join(','),
+							content: that.val_1
+						}
+					}).then(res => {
+						if (res.data.code == 200) {
+							console.log(res.data.data, 'pingjia1!!');
+							that.$refs.toast.show({
+								model: 'success',
+								label: res.data.msg
+							})
+						} else {
+							that.$refs.toast.show({
+								model: 'error',
+								label: res.data.msg
+							})
+						}
+					})
+				}
+			}
+		},
+	}
 </script>
 
 <style lang="scss">
-	/deep/ .tm-menubars .body{
+	/deep/ .tm-menubars .body {
 		background-color: #1b1b1b !important;
 	}
-	/deep/ .zhuti{padding: 10px 10px;}
-	/deep/ .kuang{margin:0 !important;padding: 0px !important;}
-	.sao{width: 90%;margin: 0 auto;margin-top: 20px;}
-	/deep/ .shuliang .text-size-n{color: white !important;}
-	/deep/ .kuang .white.bk{background-color:#1b1b1b!important;}
-	/deep/ .shangpin .tm-cartCellListFood{padding: 0px 0px 15px 0px !important;
-	margin-top: 5px !important;margin-bottom: 20px !important;
-	border-bottom: 1px solid #1B1B1B;}
-	/deep/ .kuang .border-t-1.bk{border-top:1px solid #1b1b1b!important;}
-	/deep/ .shangpin .title{color: white !important;}
-	/deep/ .shangpin .text-red{color: white !important;}
-	/deep/ .shangpin .round-3{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;}
-	.tiyan text{vertical-align: middle;}
-	.tiyan{margin-top: 20px;}
-	/deep/ .tiyan .text-primary.bk{color: #FFCC00 !important;}
-	/deep/ .tiyan .opacity-6{opacity:1 !important;}
-	/deep/ .shuru .grey-darken-4{background: #0D0D0D !important;}
-	.shuru{padding:0px !important;margin-top: 20px !important;}
+
+	/deep/ .zhuti {
+		padding: 10px 10px;
+	}
+
+	/deep/ .kuang {
+		margin: 0 !important;
+		padding: 0px !important;
+	}
+
+	.uploadImg-image {
+		width: 70px;
+		height: 70px;
+		margin: 0px 10px 10px 0px;
+		position: relative;
+	}
+
+	.shanchu {
+		position: absolute;
+		right: -15px;
+		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 {
+		background: none !important;
+		color: #ffffff !important;
+	}
+
+	/deep/ .jia .white {
+		background: none !important;
+		color: #ffffff !important;
+	}
+
+	.sao {
+		width: 90%;
+		margin: 0 auto;
+		margin-top: 20px;
+	}
+
+	/deep/ .shuliang .text-size-n {
+		color: white !important;
+	}
+
+	/deep/ .shangpin .tm-cartCellListFood {
+		padding: 0px 0px 15px 0px !important;
+		margin-top: 5px !important;
+		margin-bottom: 20px !important;
+		border-bottom: 1px solid #1B1B1B;
+	}
+
+	/deep/ .kuang .border-t-1.bk {
+		border-top: 1px solid #1b1b1b !important;
+	}
+
+	/deep/ .shangpin .title {
+		color: white !important;
+	}
+
+	/deep/ .shangpin .text-red {
+		color: white !important;
+	}
+
+	/deep/ .shangpin .round-3 {
+		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;
+	}
+
+	.tiyan text {
+		vertical-align: middle;
+	}
+
+	.tiyan {
+		margin-top: 20px;
+	}
+
+	/deep/ .tiyan .text-primary.bk {
+		color: #FFCC00 !important;
+	}
+
+	/deep/ .tiyan .opacity-6 {
+		opacity: 1 !important;
+	}
+
+	/deep/ .shuru .grey-darken-4 {
+		background: #0D0D0D !important;
+	}
+
+	.shuru {
+		padding: 0px !important;
+		margin-top: 20px !important;
+	}
+
+	.jia {
+		width: 100%;
+		height: 100%;
+		display: flex;
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+	}
+
+	.jia-btn {
+		width: 70px;
+		height: 70px;
+		border: 1px solid #ffffff;
+		border-radius: 4px;
+
+	}
 </style>

+ 186 - 101
tm-vuetify/components/tm-cartCellListFood/tm-cartCellListFood.vue

@@ -10,18 +10,23 @@
 			width:imgWidth+'rpx',
 			height:imgWidth+'rpx'
 		}">
-			<image @click="quxq(mdata)" style="width:90px;height:90px;" :round="3"  :src="mdata[keyMap['img']]"></image>
+			<image @click="quxq(mdata)" style="width:90px;height:90px;" :round="3" :src="mdata[keyMap['img']]"></image>
 		</view>
 		<view class="tm-cartCellListFood-r fulled ">
 			<view class="pl-15">
-				<view class="title  text-size-s text-weight-b text-overflow-2" style="line-height: 32rpx;"  :class="[black_tmeme ? 'bk' : '',]">
+				<view class="title  text-size-s text-weight-b text-overflow-2" style="line-height: 32rpx;"
+					:class="[black_tmeme ? 'bk' : '',]">
 					{{mdata[keyMap['title']]}}
 					<image v-if="typeclick==4" class="shanchu" src="/static/img/94.png"></image>
 				</view>
-				<view  style="min-height: 64rpx;" >
-					<view v-if="!dense&&mdata[keyMap['label']]" class="tm-cartCellListFood-label text-size-s text-grey py-8">{{mdata[keyMap['label']]}}</view>
-					<view v-if="!dense&&mdata[keyMap['label']]" class="tm-cartCellListFood-label text-size-s text-grey py-8 text-red">{{mdata[keyMap['size']]}}</view>
-					<view v-if="mdata[keyMap['saleLabel']]&&!dense" class="tm-cartCellListFood-sale text-size-s text-grey">
+				<view style="min-height: 64rpx;">
+					<view v-if="!dense&&mdata[keyMap['label']]"
+						class="tm-cartCellListFood-label text-size-s text-grey py-8">{{mdata[keyMap['label']]}}</view>
+					<view v-if="!dense&&mdata[keyMap['label']]"
+						class="tm-cartCellListFood-label text-size-s text-grey py-8 text-red">{{mdata[keyMap['size']]}}
+					</view>
+					<view v-if="mdata[keyMap['saleLabel']]&&!dense"
+						class="tm-cartCellListFood-sale text-size-s text-grey">
 						<block v-for="(item,index) in mdata[keyMap['saleLabel']]" :key="index">
 							<tm-tags :black="black_tmeme" :color="color" v-if="index<4" size="xs">{{item}}</tm-tags>
 						</block>
@@ -30,9 +35,12 @@
 				<view class="tm-cartCellListFood-price flex-between">
 					<view>
 						<text class="text-size-xs text-red" v-if="typeclick!=3 && typeclick!=6">¥</text>
-						<text v-if="typeclick!=3 && typeclick!=6" class="text-size-n text-red text-weight-b px-5">{{mdata[keyMap['price']]}}</text>
-						<text v-if="mdata[keyMap['unit']]" class="text-size-xs text-grey pr-10">/{{mdata[keyMap['unit']]}}</text>
-						<text v-if="mdata[keyMap['salePrice']]" class="text-delete text-size-xxs text-grey">¥{{mdata[keyMap['salePrice']]}}</text>
+						<text v-if="typeclick!=3 && typeclick!=6"
+							class="text-size-n text-red text-weight-b px-5">{{mdata[keyMap['price']]}}</text>
+						<text v-if="mdata[keyMap['unit']]"
+							class="text-size-xs text-grey pr-10">/{{mdata[keyMap['unit']]}}</text>
+						<text v-if="mdata[keyMap['salePrice']]"
+							class="text-delete text-size-xxs text-grey">¥{{mdata[keyMap['salePrice']]}}</text>
 					</view>
 					<view class="flex jiarugouwuche" v-if="typeclick==1" @click="jiaru(mdata)">
 						<image class="" src="/static/img/86.png"></image>
@@ -42,15 +50,17 @@
 							<view :style="{
 							width:`${actionSize}rpx`,
 							height:`${actionSize}rpx`,
-						}" :class="[color,black_tmeme ? 'bk' : '',]" @click="jian" class="tm-cartCellListFood-actions rounded  flex-center outlined">
-								<text  class="iconfont icon-minus text-size-xxs"></text>
+						}" :class="[color,black_tmeme ? 'bk' : '',]" @click="jian"
+								class="tm-cartCellListFood-actions rounded  flex-center outlined">
+								<text class="iconfont icon-minus text-size-xxs"></text>
 							</view>
 							<view class="px-12 text-size-n " :class="[black_tmeme ? 'bk' : '',]">{{cNum}}</view>
 						</block>
 						<view :style="{
 							width:`${actionSize}rpx`,
 							height:`${actionSize}rpx`,
-						}" :class="[color,`border-${color}-a-1`,black_tmeme ? 'bk' : '',]" @click="jia" class="tm-cartCellListFood-actions rounded  flex-center ">
+						}" :class="[color,`border-${color}-a-1`,black_tmeme ? 'bk' : '',]" @click="jia"
+							class="tm-cartCellListFood-actions rounded  flex-center ">
 							<text class="iconfont icon-plus text-size-xs"></text>
 						</view>
 					</view>
@@ -59,16 +69,17 @@
 					</view>
 					<view class="flex" v-if="typeclick==4">
 						<view class="" v-if="mdata[keyMap['orderStatus']]==0">
-							<view class="fukuan">去付款</view>
+							<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">再次购买</view>
-							<view class="fukuan" >{{mdata[keyMap['orderStatus']]==1?'确认收货':'去评价'}}</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">去评价</view>
 						</view>
-							<view class="flex" v-if="mdata[keyMap['orderStatus']]==-2">
-								<view class="fukuan mr-10">再次购买</view>
-								<view class="fukuan" >确认收货</view>
-							</view>
+						<!-- <view class="flex" v-if="mdata[keyMap['orderStatus']]==-2">
+							<view class="fukuan mr-10">再次购买</view>
+							<view class="fukuan">确认收货</view>
+						</view> -->
 					</view>
 					<view style="position: absolute;right: 20px;" v-if="typeclick==5">
 						<view class="genghuan mr-10">出库</view>
@@ -103,65 +114,69 @@
 	import tmImages from "@/tm-vuetify/components/tm-images/tm-images.vue"
 	import tmTags from "@/tm-vuetify/components/tm-tags/tm-tags.vue"
 	export default {
-		components:{tmSliderNav,tmImages,tmTags},
-		name:"tm-cartCellListFood",
-		props:{
-			imgWidth:{
-				type:Number,
-				default:140,
+		components: {
+			tmSliderNav,
+			tmImages,
+			tmTags
+		},
+		name: "tm-cartCellListFood",
+		props: {
+			imgWidth: {
+				type: Number,
+				default: 140,
 			},
-			cartNum:{
-				type:Number,
-				default:0
+			cartNum: {
+				type: Number,
+				default: 0
 			},
-			color:{
-				type:String,
-				default:'primary'
+			color: {
+				type: String,
+				default: 'primary'
 			},
-			bgColor:{
-				type:String,
-				default:'white'
+			bgColor: {
+				type: String,
+				default: 'white'
 			},
 			// 字段映射表,每个人的mdata的数据字段不一样。如果不同就映射下吧。
-			keyMap:{
-				type:Object,
-				default:()=>{
+			keyMap: {
+				type: Object,
+				default: () => {
 					return {
-						img:'img',
-						title:'title',
-						label:'label',
-						price:'price',
-						salePrice:'salePrice',
-						saleLabel:'saleLabel',
-						unit:'unit',
-						buy:'buy',
-						size:'size',
-						orderStatus:'orderStatus'
+						img: 'img',
+						title: 'title',
+						label: 'label',
+						price: 'price',
+						salePrice: 'salePrice',
+						saleLabel: 'saleLabel',
+						unit: 'unit',
+						buy: 'buy',
+						size: 'size',
+						orderStatus: 'orderStatus'
 					}
 				}
 			},
 			// 精简后,不显示简介文字和优惠文字,只显示标题,价格和数量
-			dense:{
-				type:Boolean|String,
-				default:false
+			dense: {
+				type: Boolean | String,
+				default: false
 			},
 			//增减按钮大小。单位rpx
-			actionSize:{
-				type:Number,
-				default:38
+			actionSize: {
+				type: Number,
+				default: 38
 			},
 			// 显示上边线还是下边线。可选top / bottom
 			border: {
 				type: String,
 				default: 'top'
 			},
-			black:{
-				type:Boolean|String,
-				default:null
+			black: {
+				type: Boolean | String,
+				default: null
 			},
-			mdata:{
-				type:Object,
-				default:()=>{
+			mdata: {
+				type: Object,
+				default: () => {
 					// return {
 					// 	img:'https://picsum.photos/300?k=2',
 					// 	title:'特色单人套餐(任选)',
@@ -175,87 +190,157 @@
 					return {};
 				}
 			},
-			typeclick:{
-				type:Number,
-				default:0
+			typeclick: {
+				type: Number,
+				default: 0
 			}
 		},
-		watch:{
-			'mdata.buy':function(val){
-				if(this.cart_num==val) return;
+		watch: {
+			'mdata.buy': function(val) {
+				if (this.cart_num == val) return;
 				this.cart_num = val;
 			},
 		},
-		computed:{
+		computed: {
 			black_tmeme: function() {
 				if (this.black !== null) return this.black;
 				return this.$tm.vx.state().tmVuetify.black;
 			},
-			
-			cart_num:{
-				get:function(){
-					return  this.cNum;
+
+			cart_num: {
+				get: function() {
+					return this.cNum;
 				},
-				set:function(val){
+				set: function(val) {
 					this.cNum = val;
-					this.$emit("update:cartNum",val)
+					this.$emit("update:cartNum", val)
 					// #ifdef H5
-					this.$nextTick(function(){
-						this.$emit("change",val)
+					this.$nextTick(function() {
+						this.$emit("change", val)
 					})
 					// #endif
-					
+
 					// #ifndef H5
-					this.$emit("change",val)
+					this.$emit("change", val)
 					// #endif
-					
+
 				}
 			}
 		},
 		data() {
 			return {
-				cNum:0,
+				cNum: 0,
 			};
 		},
 		mounted() {
 			this.cNum = this.mdata.buy;
 		},
-		methods:{
-			jiaru(data){
-				this.$emit('jiaruFun', {data:data,type:2});
+		methods: {
+			// 付款
+			goPay(data,type){
+				console.log(data);
+			},
+			// 评价
+			goEval(data,type){
+				// console.log(data);
+				uni.navigateTo({
+					url:'/pages/pingjia/index?no='+data.orderNo
+				})
+			},
+			// 确认收货
+			goSure(data,type){
+				console.log(data);
+				
 			},
-			genghuan(data,type){
-				if(type==1){
-					this.$emit('genghuan', {data:data,type:type});
-				}else if(type==2){
-					this.$emit('genghuan', {data:data,type:type});
+			//购买 
+			goBuy(data,type){
+				console.log(data);
+			},
+			
+			jiaru(data) {
+				this.$emit('jiaruFun', {
+					data: data,
+					type: 2
+				});
+			},
+			genghuan(data, type) {
+				if (type == 1) {
+					this.$emit('genghuan', {
+						data: data,
+						type: type
+					});
+				} else if (type == 2) {
+					this.$emit('genghuan', {
+						data: data,
+						type: type
+					});
 				}
 			},
-			quxq(data){
-				this.$emit('jiaruFun', {data:data,type:1});
+			quxq(data) {
+				this.$emit('jiaruFun', {
+					data: data,
+					type: 1
+				});
 			},
-			jian(){
+			jian() {
 				const buyNum = this.cNum;
-				if(buyNum<=0) {
+				if (buyNum <= 0) {
 					this.cart_num = 0;
 					return
 				}
-				this.cart_num  = buyNum-1
+				this.cart_num = buyNum - 1
 			},
-			jia(){
+			jia() {
 				const buyNum = this.cNum;
-				this.cart_num  = parseInt(buyNum) + 1
-			},
+				this.cart_num = parseInt(buyNum) + 1
+			},	
 		}
 	}
 </script>
 
 <style lang="less">
-	.jiarugouwuche image{width: 28px !important;height:28px !important;}
-	.qiangwang{width: 100px;height: 28px;background: #303440;border: 1px solid white;font-size: 13px;
-	text-align: center;color: white;line-height: 28px;border-radius: 5px;margin-top: 30px;}
-	.fukuan{color:white;font-size: 14px;background: #303440;padding:4px 15px 4px 15px;border-radius: 40px;}
-	.shanchu{width: 25px;height:25px;float: right;}
-	.genghuan{color:#EBEBEB;font-size: 14px;background: #303440;border-radius: 6px;width: 60px;height: 27px;
-	border:1px solid #EBEBEB;text-align: center;line-height: 27px;margin-top: 8px;}
+	.jiarugouwuche image {
+		width: 28px !important;
+		height: 28px !important;
+	}
+
+	.qiangwang {
+		width: 100px;
+		height: 28px;
+		background: #303440;
+		border: 1px solid white;
+		font-size: 13px;
+		text-align: center;
+		color: white;
+		line-height: 28px;
+		border-radius: 5px;
+		margin-top: 30px;
+	}
+
+	.fukuan {
+		color: white;
+		font-size: 14px;
+		background: #303440;
+		padding: 4px 15px 4px 15px;
+		border-radius: 40px;
+	}
+
+	.shanchu {
+		width: 25px;
+		height: 25px;
+		float: right;
+	}
+
+	.genghuan {
+		color: #EBEBEB;
+		font-size: 14px;
+		background: #303440;
+		border-radius: 6px;
+		width: 60px;
+		height: 27px;
+		border: 1px solid #EBEBEB;
+		text-align: center;
+		line-height: 27px;
+		margin-top: 8px;
+	}
 </style>