lhl 1 mēnesi atpakaļ
vecāks
revīzija
6cab1d78fc
3 mainītis faili ar 49 papildinājumiem un 14 dzēšanām
  1. 1 1
      api/index.js
  2. 1 1
      pages/index/index.vue
  3. 47 12
      pages/order/order.vue

+ 1 - 1
api/index.js

@@ -73,4 +73,4 @@ export function getDetail(id) {
 		url: '/api/article/details/' + id,
 		method: 'get'
 	});
-}
+}

+ 1 - 1
pages/index/index.vue

@@ -11,7 +11,7 @@
 			</swiper-item>
 		</swiper>
 		<view class="notice" v-if="notlist.length > 0">
-			<xzw-notice theme="base" :direction="notlist.length > 2?'row':'column'" speed="slow" :list="notlist" @goItem="goItem" @goMore="goMore" :showMore="notlist.length > 1"/>
+			<xzw-notice theme="base" direction="row" speed="slow" :list="notlist" @goItem="goItem" @goMore="goMore" :showMore="notlist.length > 1"/>
 		</view>
 		<!-- 轮播图 end -->
 		<view class="cate-section flex" v-if="flist.length > 0  && auth == 0">

+ 47 - 12
pages/order/order.vue

@@ -269,26 +269,61 @@ export default {
 		moneyNum(value){
 				return +value;
 		},
+		orderTakes(item,index) {
+			let obj = this;
+			orderTake({
+				uni: item.order_id
+			})
+				.then(e => {
+					
+					obj.navList[obj.tabCurrentIndex].orderList.splice(index, 1);
+					uni.showToast({
+						title: '收货成功'
+					});
+					// #ifdef MP
+					
+					// #endif
+				})
+				.catch(e => {
+					console.log(e);
+				});
+		},
 		// 确认收货
 		orderTake(item, index) {
 			let obj = this;
+			// #ifdef MP
+			if (wx.openBusinessView && item.order_id && item.mechId && item.wx_order_num) {
+			  wx.openBusinessView({
+			    businessType: 'weappOrderConfirm',
+			    extraData: {
+			      merchant_id: item.mechId,
+			      merchant_trade_no: item.order_id,
+			      transaction_id: item.wx_order_num
+			    },
+			    success() {
+			      //dosomething
+				  obj.orderTakes(item, index)
+			    },
+			    fail(err) {
+			      //dosomething
+			    },
+			    complete(ress) {
+			      //dosomething
+			    }
+			  });
+			}else {
+				obj.orderTakes(item, index)
+			}
+			// #endif
+			// #ifndef MP
 			uni.showModal({
 				title: '是否确认收货?',
 				success: () => {
-					orderTake({
-						uni: item.order_id
-					})
-						.then(e => {
-							obj.navList[obj.tabCurrentIndex].orderList.splice(index, 1);
-							uni.showToast({
-								title: '收货成功'
-							});
-						})
-						.catch(e => {
-							console.log(e);
-						});
+					obj.orderTakes(item, index)
 				}
 			});
+			// #endif
+			
 		},
 		//跳转到订单详情
 		goToOrderDetail(e) {