zs 2 سال پیش
والد
کامیت
79af476e0a
3فایلهای تغییر یافته به همراه22 افزوده شده و 5 حذف شده
  1. 2 2
      pagesHome/order/detail.vue
  2. 15 0
      pagesMessage/message/info.vue
  3. 5 3
      pagesMy/order/index.vue

+ 2 - 2
pagesHome/order/detail.vue

@@ -657,12 +657,12 @@
 						if (arr.errcode == '0' && arr.total > 0) { //有直接进入
 							if (arr.data) {
 								uni.navigateTo({
-									url: `/pagesMessage/message/info?id=${arr.data[0]._id}`
+									url: `/pagesMessage/message/info?id=${arr.data[0]._id}&goods=${that.id}`
 								})
 							}
 						} else { //没有创建进入
 							uni.navigateTo({
-								url: `/pagesMessage/message/info?shop=${form.shop}`
+								url: `/pagesMessage/message/info?shop=${form.shop}&goods=${that.id}`
 							})
 						}
 					} else {

+ 15 - 0
pagesMessage/message/info.vue

@@ -65,6 +65,8 @@
 				// 店铺信息
 				shop: {},
 				shop_id: "",
+				// 商品或订单信息
+				goods: {},
 				// 历史记录
 				msgList: [],
 				total: 0,
@@ -85,6 +87,7 @@
 		},
 		onLoad: async function(e) {
 			const that = this;
+			that.$set(that, `goods`, e);
 			that.$set(that, `id`, e.id);
 			that.$set(that, `shop_id`, e.shop);
 			that.watchlogin();
@@ -176,6 +179,18 @@
 						})
 					}
 				}
+				// 发送商品信息
+				if (that.goods && that.goods.goods) {
+					// 商品
+					res = await that.$api(`/viewGoods/goodsDetail`, `POST`, {
+						id: that.goods.goods
+					});
+					if (res.errcode == '0') {
+						console.log(res.data);
+					}
+				} else {
+					// 订单
+				}
 				// 跳转到最后一条数据 与前面的:id进行对照
 				// 如果是下拉刷新聊天记录不跳到最后一条
 				if (that.is_bottom == true) that.goBottom();

+ 5 - 3
pagesMy/order/index.vue

@@ -333,19 +333,21 @@
 				const that = this;
 				let form = {
 					"customer": e.customer && e.customer._id,
-					"shop": e.shop && e.shop._id || e.goods && e.goods[0].shop
+					"shop": e.shop && e.shop._id || e.goods && e.goods[0].shop,
+					"order": e && e._id,
+					"status": e && e.status,
 				}
 				// 查询该用户与该店铺是否有房间
 				let arr = await that.$api(`/room`, `GET`, form, 'chat');
 				if (arr.errcode == '0' && arr.total > 0) { //有直接进入
 					if (arr.data) {
 						uni.navigateTo({
-							url: `/pagesMessage/message/info?id=${arr.data[0]._id}`
+							url: `/pagesMessage/message/info?id=${arr.data[0]._id}&order=${form.order}&status=${form.status}`
 						})
 					}
 				} else { //没有创建进入
 					uni.navigateTo({
-						url: `/pagesMessage/message/info?shop=${form.shop}`
+						url: `/pagesMessage/message/info?shop=${form.shop}&order=${form.order}&status=${form.status}`
 					})
 				}
 			},