gcz vor 2 Jahren
Ursprung
Commit
1b3a923c1e
12 geänderte Dateien mit 333 neuen und 33 gelöschten Zeilen
  1. 3 1
      center/center.vue
  2. 16 0
      common/apiurl.js
  3. 14 0
      pages.json
  4. 4 0
      pages/index/index.vue
  5. 1 1
      shopping/comment.vue
  6. 28 11
      shopping/distribution.vue
  7. 63 10
      shopping/order.vue
  8. 2 0
      shopping/pay.vue
  9. 58 0
      shopping/paysuccess.vue
  10. 114 0
      shopping/refund.vue
  11. 8 2
      utils/filter.js
  12. 22 8
      xushuo/about.vue

+ 3 - 1
center/center.vue

@@ -89,6 +89,7 @@
 				orderState:[
 					{name:'全部订单',status:'',ico:this.$commonConfig.staticUrl+'/img/orderstateico-all.png'},
 					{name:'待付款',status:'0',ico:this.$commonConfig.staticUrl+'/img/orderstateico-01.png',badge:'noPayNum'},
+					// {name:'待发货',status:'1',ico:this.$commonConfig.staticUrl+'/img/orderstateico-01.png',badge:'noPayNum'},
 					{name:'待收货',status:'2',ico:this.$commonConfig.staticUrl+'/img/orderstateico-02.png',badge:'collectNum'},
 					{name:'待评价',status:'3',ico:this.$commonConfig.staticUrl+'/img/orderstateico-03.png',badge:'commentNum'},
 					{name:'退款/售后',status:'7',ico:this.$commonConfig.staticUrl+'/img/orderstateico-04.png',badge:'refundNum'},
@@ -130,7 +131,8 @@
 			orderClick(item,index){
 				console.log('item',item);
 				uni.$u.route('/shopping/order', {
-					current: index,
+					// current: index,
+					status: item.status,
 					type: 'redirectTo'
 				});
 			},

+ 16 - 0
common/apiurl.js

@@ -184,6 +184,21 @@ const apiurl = {
 		url: '/order/getSettlement',
 		type: 'post'
 	},
+	// 订单退款提交
+	refundSubmit: {
+		url: '/order/refundSubmit',
+		type: 'post'
+	},
+	// 订单查询物流
+	getDilevery: {
+		url: '/order/getDilevery',
+		type: 'post'
+	},
+	// 订单关闭
+	cancelOrder: {
+		url: '/order/cancel',
+		type: 'post'
+	},
 	// 订单支付
 	gotoPay: {
 		url: '/payment/gotoPay',
@@ -194,6 +209,7 @@ const apiurl = {
 		url: '/payment/payQuery',
 		type: 'post'
 	},
+	
 }
 
 

+ 14 - 0
pages.json

@@ -123,6 +123,13 @@
 						"navigationStyle": "custom"
 					}
 				},
+				{
+					"path": "paysuccess",
+					"style": {
+						"navigationBarTitleText": "支付成功",
+						"navigationStyle": "custom"
+					}
+				},
 				{
 					"path": "order",
 					"style": {
@@ -150,6 +157,13 @@
 						"navigationBarTitleText": "评价",
 						"navigationStyle": "custom"
 					}
+				},
+				{
+					"path": "refund",
+					"style": {
+						"navigationBarTitleText": "申请退款",
+						"navigationStyle": "custom"
+					}
 				}
 			]
 		},

+ 4 - 0
pages/index/index.vue

@@ -38,6 +38,10 @@
 			</view>
 			
 			<view class="icon-nav u-flex u-row-around">
+				<view class="nav-item" @click="$u.route('/shopping/paysuccess',{type:'reLaunch'})">
+					<u--image class="image" :src="staticUrl+'/img/index-nav-4.png'" width="101rpx" height="101rpx"></u--image>
+					需要删除
+				</view>
 				<view class="nav-item" @click="$u.route('/shopping/productList',{typeId:1,typeName:'特价专区',type:'reLaunch'})">
 					<u--image class="image" :src="staticUrl+'/img/index-nav-1.png'" width="101rpx" height="101rpx"></u--image>
 					特价专区

+ 1 - 1
shopping/comment.vue

@@ -24,7 +24,7 @@
 						</view>
 						<view class="time">{{item.createTime}}</view>
 					</view>
-					<u-rate count="5" active-color="#FFB600" v-model="item.star"></u-rate>
+					<u-rate count="5" active-color="#FFB600" v-model="item.star" readonly></u-rate>
 					<view class="text">{{item.contentText}}</view>
 					<view class="imgs" v-if="item.contentImgList">
 						<u-album :urls="item.contentImgList"></u-album>

+ 28 - 11
shopping/distribution.vue

@@ -6,25 +6,26 @@
 			 :safeAreaInsetTop="true"
 		>
 		</u-navbar>
-		<view class="map-wrap">
+		<!-- <view class="map-wrap">
 			<map style="width: 100%; height: 300px;" :latitude="latitude" :longitude="longitude" :markers="covers"></map>
-		</view>
+		</view> -->
 
 		<view class="base-info page-wrap">
-			<view class="company base-item u-flex">
+			<view class="company base-item u-flex"  v-if="details.logisticsNum">
 				<u--image :showLoading="false" :src="companylogo" width="60rpx" height="60rpx"></u--image>
-				<text>顺丰快递:34535664987</text>
+				<text>{{details.logisticsCompany}}:{{details.logisticsNum}}</text>
 			</view>
-			<view class="orderNo base-item">订单号:6754364543553545</view>
-			<view class="addr base-item">收货地址:广东省广州市越秀区顶峰路334号腾讯大厦32楼3002号</view>
+			<view class="orderNo base-item">订单号:{{details.orderNum}}</view>
+			<view class="addr base-item">收货地址:{{details.receiveAdress + details.address }}</view>
 		</view>
 		<view class="distribution page-wrap">
 			<u-steps current="0" activeColor="#00A447" dot direction="column">
-				<u-steps-item title="已下单" desc="10:30">
-				</u-steps-item>
-				<u-steps-item title="已出库" desc="10:35">
+				<u-steps-item 
+					v-for="(item,index) in details.dileveryList" :key="index"
+					:title="item.reason" 
+					:desc="item.time">
 				</u-steps-item>
-				<u-steps-item title="运输中" desc="11:40"></u-steps-item>
+				<!-- <u-steps-item title="已出库" desc="10:35"></u-steps-item> -->
 			</u-steps>
 		</view>
 	</view>
@@ -34,6 +35,12 @@
 	export default{
 		data(){
 			return {
+				orderId:'',
+				details:{
+					orderNum:'',
+					receiveAdress:'',
+					address:''
+				},
 				staticUrl:this.$commonConfig.staticUrl,
 				latitude: 30.659462,
 				longitude: 104.065735,
@@ -42,7 +49,9 @@
 			}
 		},
 		onLoad(page) {
-			this.setCovers(this.latitude, this.longitude)
+			this.orderId = page.orderId;
+			this.getDilevery();
+			// this.setCovers(this.latitude, this.longitude);
 		},
 		methods:{
 			//设置点位
@@ -58,6 +67,14 @@
 				}
 				this.covers = [location]
 			},
+			getDilevery(){
+				this.$u.api.getDilevery({orderId:this.orderId}).then(res=>{
+					this.details = res.data;
+					console.log('res',res.data);
+				}).catch(err=>{
+					console.log('getDilevery',err);
+				})
+			}
 		}
 	}
 </script>

+ 63 - 10
shopping/order.vue

@@ -27,7 +27,7 @@
 							<text class="status">{{item.status|filterOrderState}}</text>
 						</view>
 						<view class="center">
-							<view v-for="goods in item.detailList" class="goods u-flex u-row-between">
+							<view v-for="goods in item.detailList" :key="goods.id" class="goods u-flex u-row-between">
 								<view class="left u-flex">
 									<u--image :showLoading="true" :src="goods.mainImg" width="128rpx" height="128rpx"></u--image>
 									<view class="text">
@@ -37,10 +37,12 @@
 								</view>
 								<view class="right">
 									<u-icon name="arrow-right" color="#999" size="24"></u-icon>
-									<text class="price red">¥ <text class="price-num">{{goods.price}}</text></text>
+									<text class="price red">¥ <text class="price-num">{{goods.price}} </text></text>
+									<view class="quantity red">x {{goods.quantity}}</view>
 								</view>
 							</view>
 						</view>
+						<view class="order-price red">合计金额: ¥ {{item.orderPrice}}</view>
 						<view class="bottom u-flex u-row-between">
 							<view class="left"></view>
 							<view class="right u-flex">
@@ -57,6 +59,7 @@
 				</view>
 			</mescroll-body>
 		</view>
+		<u-toast ref="uToast"></u-toast>
 	</view>
 </template>
 
@@ -70,10 +73,12 @@
 		},
 		data() {
 			return {
+				hasfetch:false,
 				tabsCurrent:1,
 				tabsList:[
 					{name:'全部',status:'',},
 					{name:'待付款',status:'0',},
+					{name:'待发货',status:'1',},
 					{name:'待收货',status:'2'},
 					{name:'待评价',status:'3'},
 					{name:'退款/售后',status:'7'}
@@ -81,14 +86,14 @@
 				status:'',
 				dataList:[{status:0},{status:1},{status:2},{status:3},{status:4}],
 				statusBtn:{
-					0:[{name:'取消订单',fun:'cancel ',class:''},{name:'去支付',fun:'pay',class:'red'}],
+					0:[{name:'取消订单',fun:'cancelOrder',class:''},{name:'去支付',fun:'pay',class:'red'}],
 					1:[{name:'申请退款',fun:'refund',class:'green'}],
 					2:[{name:'查看物流',fun:'logistics',class:''},{name:'确认收货',fun:'confirmReceipt',class:'green'}],
 					3:[{name:'查看物流',fun:'logistics',class:''},{name:'评价',fun:'evaluate',class:'green'}],
 					// 4:[{name:'查看物流',fun:'logistics',class:''},{name:'评价',fun:'evaluate',class:'green'}],
 					5:[{name:'查看退款',fun:'viewRefund',class:'green'}],
 					// 6:[{name:'查看退款',fun:'viewRefund',class:'green'}],
-					// 7:[{name:'查看退款',fun:'viewRefund',class:'green'}]
+					7:[{name:'查看退款',fun:'viewRefund',class:'green'}]
 				}
 			}
 		},
@@ -112,8 +117,13 @@
 		    }
 		},
 		onLoad(page) {
-			console.log('page',page);
-			this.tabsCurrent = page.current || 0;
+			// console.log('page',page);
+			const status = page.status;
+			const index = this.tabsList.findIndex(item => item.status === status);
+			this.tabsCurrent = index || 0;
+		},
+		onShow() {
+			this.hasfetch&&this.reloadList()
 		},
 		methods: {
 			leftClick(){
@@ -145,9 +155,11 @@
 					pageNum : page.num,
 					pageSize :  page.size,
 					status : this.tabsList[this.tabsCurrent].status,
+					// status : this.tabsList[this.tabsCurrent].status,
 				}
 				// console.log('this.params',params);
 				this.$u.api.orderList(params).then(data => {
+					this.hasfetch = true;
 					console.log('data',JSON.parse(JSON.stringify(data)));
 					// 接口返回的当前页数据列表 (数组)
 					let curPageData = data.data.rows;
@@ -198,26 +210,62 @@
 				let funObj = {
 				  pay: this.pay,
 				  logistics:this.logistics,
-				  evaluate:this.evaluate
+				  evaluate:this.evaluate,
+				  refund:this.refund,
+				  cancelOrder:this.cancelOrder,
+				  viewRefund:this.viewRefund
 				};
+				// console.log('funObj[fun]',funObj[fun]);
 				if (fun in funObj) {
 				  funObj[fun](item);
 				}
 			},
 			pay(item){
 				console.log('pay',item);
+				uni.$u.route('/shopping/pay', {
+					orderId: item.id,
+					// openid: that.vuex_wechatOpenid,
+					payAmount:item.orderPrice
+				});
 			},
 			logistics(item){
-				console.log('logistics',item);
+				// console.log('logistics',item);
 				uni.$u.route('/shopping/distribution', {
-					name: 'lisa'
+					orderId: item.id
 				});
 			},
 			evaluate(item){
-				console.log('logistics',item);
+				// console.log('logistics',item);
 				uni.$u.route('/shopping/evaluate', {
 					id: item.id
 				});
+			},
+			refund(item){
+				// console.log('logistics',item);
+				uni.$u.route('/shopping/refund', {
+					id: item.id
+				});
+			},
+			cancelOrder(item){
+				let that = this;
+				// console.log('logistics',item);
+				this.$u.api.cancelOrder({orderId:item.id}).then(res=>{
+					this.$refs.uToast.show({
+						message:res.msg,
+						complete() {
+							that.reloadList();
+						}
+					});
+					// uni.$u.toast(res.msg);
+					console.log('res',res.data);
+				}).catch(err=>{
+					console.log('cancelOrder',err);
+				})
+			},
+			viewRefund(item){
+				uni.$u.route('/shopping/viewRefund', {
+					id: item.id
+				});
 			}
 		}
 	}
@@ -282,6 +330,11 @@ page{
 			}
 		}
 	}
+	.order-price{
+		text-align: right;
+		margin-bottom: 20rpx;
+		font-weight: 600;
+	}
 	.bottom{
 		font-size: 24rpx;
 		.left{color: #333;}

+ 2 - 0
shopping/pay.vue

@@ -64,6 +64,8 @@
 				this.$u.api.gotoPay(this.params).then(res=>{
 					if(this.params.paymentMode==1){
 						this.wxPay()
+					}else{
+						uni.$u.route('/shopping/paysuccess');
 					}
 					console.log('res',res.data);
 				}).catch(err=>{

+ 58 - 0
shopping/paysuccess.vue

@@ -0,0 +1,58 @@
+<template>
+	<view class="pages">
+		<view class="icon-wrap u-flex u-row-center">
+			<u-icon name="checkmark" color="#fff" size="80"></u-icon>
+		</view>
+		<view class="title">{{title}}</view>
+		<view class="full-btn" @click="btnClick">完成</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				title:'付款成功'
+			}
+		},
+		onShow() {		
+		},
+		onLoad() {
+
+		},
+		methods: {
+			btnClick(){
+				uni.reLaunch({url: '/pages/index/index'});
+			}
+		}
+	}
+</script>
+<style>
+	page{
+		background-color: #F5F5F5;
+	}
+</style>
+<style lang="scss" scoped>
+.pages{
+	text-align: center;
+}
+
+.icon-wrap{
+	width: 180rpx;
+	height: 180rpx;
+	margin: 120rpx auto 20rpx;
+	padding: 20rpx;
+	background-color: #00A447;
+	border-radius: 50%;
+}
+.title{
+	font-size: 32rpx;
+	font-weight: 600;
+	color: #333333;
+	line-height: 40rpx;
+	margin-bottom: 120rpx;
+}
+.full-btn{
+	margin: 20rpx 10%;
+}
+</style>

+ 114 - 0
shopping/refund.vue

@@ -0,0 +1,114 @@
+<template>
+	<view class="">
+		<u-navbar title="申请退款" :autoBack="true" :safeAreaInsetTop="true">
+		</u-navbar>
+		
+		<view class="page-wrap">
+			<view class="box">
+				<u--form labelPosition="left" :model="model" labelWidth="160rpx" :rules="rules" ref="uForm">
+					<u-form-item required label="退款原因" borderBottom @click="showRefundReason = true;"
+						ref="refundReason">
+						<text v-if="model.refundReason">{{model.refundReason}}</text>
+						<text v-else style="color: #999;">请选择退款原因</text>
+						<!-- <u--input v-model="model.refundReason"  disabledColor="#ffffff" placeholder="请选择退款原因"
+							border="none"></u--input> -->
+						<u-icon slot="right" name="arrow-right"></u-icon>
+					</u-form-item>
+					<u-form-item label="补充说明">
+						<u--textarea v-model="remark" placeholder="请输入内容" ></u--textarea>
+					</u-form-item>
+				</u--form>
+			</view>
+			<view class="full-btn" @click="submit">提交申请</view>
+		</view>
+		
+		<u-action-sheet :show="showRefundReason" :actions="actions" title="请选择退款原因"
+			@close="showRefundReason = false" @select="reasonSelect">
+		</u-action-sheet>
+
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				model: {
+					orderId:'',
+					refundReason:'',
+					remark:''
+				},
+				showRefundReason:false,
+				actions: [
+					{name: '不想要了'},
+					{name: '拍错了'},
+					{name: '商家联系缺货'},
+				],
+				rules: {
+					'model.refundReason': {
+						type: 'string',
+						required: true,
+						message: '请选择退款原因',
+						trigger: ['blur', 'change']
+					}
+				},
+
+			}
+		},
+		onReady() {
+			//如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
+			// this.$refs.uForm.setRules(this.rules)
+		},
+		onShow() {},
+		onLoad(page) {
+			console.log('page',page);
+			this.model.orderId = page.id;
+		},
+		methods: {
+			sexSelect(e) {
+				this.model1.userInfo.sex = e.name
+				this.$refs.uForm.validateField('userInfo.sex')
+			},
+			reasonSelect(e){
+				// console.log('reasonSelect',e);
+				this.model.refundReason = e.name;
+			},
+			submit() {
+				// console.log('model',this.model);
+				if(!this.model.orderId){uni.$u.toast('没有订单ID');return}
+				if(!this.model.refundReason){uni.$u.toast('请选择退款原因');return}
+				this.$u.api.refundSubmit(this.model).then(res=>{
+					uni.$u.toast(res.msg)
+					uni.navigateBack()
+					console.log('res',res.data);
+				}).catch(err=>{
+					console.log('refundSubmit',err);
+				})
+				// this.$refs.uForm.validate().then(res => {
+				// 	// uni.$u.toast('校验通过')
+				// 	this.$u.api.refundSubmit({id:id}).then(res=>{
+				// 		uni.$u.toast(res.msg)
+				// 		uni.navigateBack()
+				// 		console.log('res',res.data);
+				// 	}).catch(err=>{
+				// 		console.log('refundSubmit',err);
+				// 	})
+				// }).catch(errors => {
+				// 	uni.$u.toast('校验失败')
+				// })
+			}
+		}
+	}
+</script>
+<style>
+page{
+	background-color: #F5F5F5;
+}
+</style>
+<style lang="scss" scoped>
+.box{
+	background: #FFFFFF;
+	border-radius: 8rpx;
+	padding: 20rpx;
+}
+</style>

+ 8 - 2
utils/filter.js

@@ -82,11 +82,17 @@ Vue.filter("filterToFixed", function(val) {
 
 // 订单状态
 Vue.filter("filterOrderState", function(val) {	
-	let orderList = ['待支付', '待出库', '待收货', '待评论', '己取消', '己退款', '己完成', '退款']
+	let orderList = ['待支付', '待出库', '待收货', '待评论', '己取消', '己退款', '己完成', '退款']
 	return orderList[val]
 });
 
-// 订单状态
+// 物流状态
+Vue.filter("filterDilevery", function(val) {	
+	let dileveryList = ['下单', '揽件', '运输中', '派件中', '签收', '退回', '拒签']
+	return dileveryList[val]
+});
+
+// 评分文字
 Vue.filter("rateText", function(val) {	
 	let rateList = ['很差', '差', '一般', '很好', '非常好']
 	return rateList[val-1]

+ 22 - 8
xushuo/about.vue

@@ -39,7 +39,10 @@
 				</view>
 				<!-- <img :src="pageData.uxImg" style="width: 100%;" alt=""> -->
 				<view class="map-wrap" @click="mapClick">
-					<map style="width: 100%; height: 340rpx;" :latitude="latitude" :longitude="longitude" :markers="covers"></map>
+					<map style="width: 100%; height: 340rpx;" 
+						:latitude="curNow==0?xsLatitude:shopLatitude" 
+						:longitude="curNow==0?xsLongitude:shopLongitude" :markers="covers">
+					</map>
 				</view>
 			</view>
 		</view>
@@ -54,8 +57,10 @@
 		data() {
 			return {
 				staticUrl:this.$commonConfig.staticUrl,
-				latitude: 30.659462,
-				longitude: 104.065735,
+				shopLatitude: 30.659462,
+				shopLongitude: 104.065735,
+				xsLatitude: 30.659462,
+				xsLongitude: 104.065735,
 				covers: [], //存放标记点数组
 				navbarTitle:'',
 				typeList:['旭烁简介','商行简介'],
@@ -84,7 +89,16 @@
 				let type = this.curNow + 1;
 				this.$u.api.xsGetIntro({type:type}).then(res=>{
 					this.pageData = res.data;
-					this.setCovers(this.latitude,this.longitude);
+					this.shopLatitude = res.data.shopLatitude;
+					this.shopLongitude = res.data.shopLongitude;
+					this.xsLatitude = res.data.xsLatitude;
+					this.xsLongitude = res.data.xsLongitude;
+					if(this.curNow==0){
+						this.setCovers(this.xsLatitude,this.xsLongitude);
+					}else{
+						this.setCovers(this.shopLatitude,this.shopLongitude);
+					}
+					
 					// console.log('res',res);
 				}).catch(err=>{
 					console.log('xsGetIntro',err.data);
@@ -106,16 +120,16 @@
 			mapClick(){
 				if(this.curNow==0){
 					uni.openLocation({
-					  latitude:this.latitude,	//维度
-					  longitude: this.longitude, //经度
+					  latitude:this.xsLatitude,	//维度
+					  longitude: this.xsLongitude, //经度
 					  name: "旭烁地址",	//目的地定位名称
 					  scale: 15,	//缩放比例
 					  address: this.pageData.xsAddress	//导航详细地址
 					})
 				}else{
 					uni.openLocation({
-					  latitude:this.latitude,	//维度
-					  longitude: this.longitude, //经度
+					  latitude:this.shopLatitude,	//维度
+					  longitude: this.shopLongitude, //经度
 					  name: "商行地址",	//目的地定位名称
 					  scale: 15,	//缩放比例
 					  address: this.pageData.shopAddress	//导航详细地址