Browse Source

Merge branch 'develop' of http://git.chelingzhu.com/chelingzhu-web/zxyj-mini-html into develop

lilei 4 years ago
parent
commit
86a288aa78
3 changed files with 67 additions and 49 deletions
  1. 9 1
      api/order.js
  2. 57 47
      pages/order/LogList.vue
  3. 1 1
      pages/order/order.vue

+ 9 - 1
api/order.js

@@ -71,10 +71,18 @@ export const orderDetail = params => {
 // 查询物流
 // 查询物流
 export const queryOrderExpress = params => {
 export const queryOrderExpress = params => {
 	return axios.request({
 	return axios.request({
-	  url: `orderExpress/findByOrderNo/${params.id}`,
+	  url: `orderExpress/findByOrderNo/${params.orderSn}`,
 	  method: 'get',
 	  method: 'get',
 	})
 	})
 }
 }
+// 确认收货
+export const finishOrder = params => {
+	return axios.request({
+	  url: `orderExpress/finishOrderExpress`,
+	  method: 'post',
+	  data: params
+	})
+}
 // 查物流下商品信息
 // 查物流下商品信息
 export const queryOrderGoods = params => {
 export const queryOrderGoods = params => {
 	return axios.request({
 	return axios.request({

+ 57 - 47
pages/order/LogList.vue

@@ -2,32 +2,35 @@
 	<view class="pagesCons">
 	<view class="pagesCons">
 		<view class="tab-body">
 		<view class="tab-body">
 					<scroll-view scroll-y class="scroll-view" @scrolltolower="onreachBottom">
 					<scroll-view scroll-y class="scroll-view" @scrolltolower="onreachBottom">
-						<view class="check-order-list" v-for="(item,sindex) in list" :key="item.id"
+						<view class="check-order-list" v-for="item in list" :key="item.id"
 						 >
 						 >
 							<view class="order-log">
 							<view class="order-log">
-								<view v-if="item.orderFlag=='待发货'">待发货</view>
+								<view v-if="item.orderState=='WAIT_SEND'">待发货</view>
 								<view v-else>
 								<view v-else>
 									<view>
 									<view>
-										快递公司:<text class="address-title">{{item.logName}}</text>
-										<text class="btn-cont" @click="copyLogNum" style="float: right;">确认收货</text>
+										快递公司:<text class="address-title">{{item.expressName}}</text>
+										<u-button v-if="item.expressState=='WAIT_SIGN'" 
+										:custom-style="btnStyle" 
+										@click="handleGet(item)"
+										 type="primary" shape="circle" size="mini" >确认收货</u-button>
 									</view>
 									</view>
 									<view>
 									<view>
 										<text>运单编号:</text>
 										<text>运单编号:</text>
-										<text>{{item.logNum}}</text>
-										<u-button @click="copyLogNum" style="margin-left: 20upx;" shape="square" size="mini">复制</u-button>
+										<text>{{item.expressNum}}</text>
+										<u-button @click="copyLogNum(item.expressNum)" style="margin-left: 20upx;" shape="square" size="mini">复制</u-button>
 									</view>
 									</view>
 								</view>
 								</view>
 							</view>
 							</view>
 							<u-gap height="10" bg-color="#f8f8f8"></u-gap>
 							<u-gap height="10" bg-color="#f8f8f8"></u-gap>
-							<view class="bundle-list" v-for="row in item.itemList" :key="row.id">
+							<view class="bundle-list" v-for="row in item.orderGoodsList" :key="row.id">
 								<view class="img-cont">
 								<view class="img-cont">
-									<image :src="row.icon?row.icon:'../../static/goods.png'"></image>
+									<image :src="row.goodsImages"></image>
 								</view>
 								</view>
 								<view >
 								<view >
-									<view class="ellipsis-two">{{row.name}}</view>
+									<view class="ellipsis-two">{{row.goodsName}}</view>
 									<view class="bundle-num">
 									<view class="bundle-num">
-										<view ><text class="price-num">{{row.price}}</text> <text class="price-text">乐豆</text></view>
-										<view >X {{row.number}}</view>
+										<view ><text class="price-num">{{row.payGold}}</text> <text class="price-text">乐豆</text></view>
+										<view >X {{row.buyQty}}</view>
 									</view>
 									</view>
 								</view>
 								</view>
 							</view>
 							</view>
@@ -39,55 +42,38 @@
 						</view>
 						</view>
 					</scroll-view>
 					</scroll-view>
 		</view>
 		</view>
-		 <!-- 查看物流弹窗 -->
-		<view>
-			<u-modal v-model="isShow" :show-title="false" confirm-text="好的">
-				<view class="slot-content">
-					<view>
-						快递公司:{{logData.logName}}
-					</view>
-					<view>
-						运单编号:{{logData.logNum}}
-						<u-button @click="copyLogNum" style="margin-left: 20upx;" shape="square" size="mini">复制</u-button>
-					</view>
-				</view>
-			</u-modal>
-		</view>
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
-	import { queryOrderExpress } from '@/api/order.js'
+	import { queryOrderExpress, finishOrder } from '@/api/order.js'
 	export default {
 	export default {
 		components: {
 		components: {
 		},
 		},
 		data() {
 		data() {
 			return {
 			return {
+				btnStyle:{
+					width: '180rpx',
+					fontSize: '30rpx',
+					float: 'right'
+				},
 				isShow: false, // 是否显示物流弹框
 				isShow: false, // 是否显示物流弹框
 				status: 'loadmore',
 				status: 'loadmore',
 				noDataText: '暂无数据',
 				noDataText: '暂无数据',
-				current: 0,
-				swiperCurrent: 0,
-				pageNo: 1,
-				pageSize: 10,
 				list: [],
 				list: [],
-				logData: { // 物流信息
-					logName: '韵达快递',
-					logNum: 12356544544
-				},
 				total: 0,
 				total: 0,
-				action: 'swiperChange', // 操作类型,上划分页,或左右滑动
+				orderSn: '' // 订单编号
 			}
 			}
 		},
 		},
 		onLoad(option) {
 		onLoad(option) {
-			if(option.id) {
-				this.getRow(option.id)
+			if(option.orderNo) {
+				this.orderSn = option.orderNo
+				this.getRow()
 			}
 			}
 		},
 		},
 		methods: {
 		methods: {
 			// scroll-view到底部加载更多
 			// scroll-view到底部加载更多
 			onreachBottom() {
 			onreachBottom() {
-				this.action = 'onreachBottom'
 				if (this.list.length < this.total) {
 				if (this.list.length < this.total) {
 					this.pageNo += 1
 					this.pageNo += 1
 					this.getRow()
 					this.getRow()
@@ -100,9 +86,9 @@
 				}
 				}
 			},
 			},
 			// 查询列表
 			// 查询列表
-			getRow(id) {
+			getRow() {
 				this.status = "loading"
 				this.status = "loading"
-				queryOrderExpress({id:id}).then(res => {
+				queryOrderExpress({orderSn:this.orderSn}).then(res => {
 					console.log(res,'rrrrrrrr')
 					console.log(res,'rrrrrrrr')
 					if (res.status == 200) {
 					if (res.status == 200) {
 						this.list = res.data || []
 						this.list = res.data || []
@@ -114,17 +100,40 @@
 					this.status = "loadmore"
 					this.status = "loadmore"
 				})
 				})
 			},
 			},
+			// 确认收货
+			handleGet(item) {
+				console.log(item,'iiiiiiiiii')
+				let params = {
+					  "expressNo": item.expressNum,
+						"orderNo": item.orderNo,
+				}
+				finishOrder(params).then(res=>{
+					if(res.status==200) {
+						uni.showToast({
+							title:res.message,
+							icon: 'none'
+						})
+						this.getRow()
+					} else {
+						uni.showToast({
+							title:res.message,
+							icon: 'none'
+						})
+					}
+				})
+			},
 			
 			
 			// 复制运单编号 
 			// 复制运单编号 
-			copyLogNum () {
+			copyLogNum (logNum) {
 				// H5 不支持
 				// H5 不支持
 				uni.setClipboardData({
 				uni.setClipboardData({
-					data: this.logData.logNum,
+					data: logNum,
 					success: function(res) {
 					success: function(res) {
 						uni.getClipboardData({
 						uni.getClipboardData({
 							success: function(res) {
 							success: function(res) {
 								uni.showToast({
 								uni.showToast({
-									title: '已复制到剪贴板'
+									title: '已复制到剪贴板',
+									icon: 'none'
 								});
 								});
 							}
 							}
 						});
 						});
@@ -238,6 +247,7 @@
 						&:last-child {
 						&:last-child {
 							flex: 1;
 							flex: 1;
 							margin-left: 20upx;
 							margin-left: 20upx;
+							padding: 10upx 0upx;
 							display: flex;
 							display: flex;
 							flex-direction: column;
 							flex-direction: column;
 							justify-content: space-between;
 							justify-content: space-between;
@@ -252,10 +262,10 @@
 					width: 180upx;
 					width: 180upx;
 					height: 60upx;
 					height: 60upx;
 					float: right;
 					float: right;
-					background-color: #2979ff;
-					color: #fff;
-					text-align: center;
-					border-radius: 100upx;
+					// background-color: #2979ff;
+					// color: #fff;
+					// text-align: center;
+					// border-radius: 100upx;
 					font-size: 30upx;
 					font-size: 30upx;
 				}
 				}
 				.price-text{
 				.price-text{

+ 1 - 1
pages/order/order.vue

@@ -367,7 +367,7 @@
 			showLog(item) {
 			showLog(item) {
 				console.log(item, '111111')
 				console.log(item, '111111')
 				uni.navigateTo({
 				uni.navigateTo({
-					url: "/pages/order/LogList?id=" + item.id
+					url: "/pages/order/LogList?orderNo=" + item.orderNo
 				})
 				})
 			},
 			},
 			// 详细页
 			// 详细页