Quellcode durchsuchen

合并直播订单/分享直播间

李妹妹 vor 2 Tagen
Ursprung
Commit
1d606739f7

+ 2 - 1
api/storeAfterSales.js

@@ -9,7 +9,8 @@ let request = new Request().http
  }
  
  export function getAfterSalesList(data) {
- 	 return request('/app/storeAfterSales/getStoreAfterSalesList',data,'GET');
+ 	 //return request('/app/storeAfterSales/getStoreAfterSalesList',data,'GET');///旧版
+	 return request('/app/order/getMergedAfterSalesList',data,'GET');
  } 
  
  export function getAfterSalesDetails(data) {

+ 6 - 2
api/storeOrder.js

@@ -3,7 +3,8 @@ let request = new Request().http
 
  
  export function getMyStoreOrderList(data) {
- 	 return request('/app/storeOrder/getMyStoreOrderList',data,'GET');
+ 	 //return request('/app/storeOrder/getMyStoreOrderList',data,'GET');//旧版
+ 	 return request('/app/order/getMyMergedOrderList',data,'GET')
  } 
  export function getCompanyStoreOrderList(data) {
  	 return request('/app/storeOrder/getCompanyStoreOrderList',data,'GET');
@@ -78,4 +79,7 @@ let request = new Request().http
  	 return request('/app/storeOrder/orderBindUser',data,'POST','application/json;charset=UTF-8');
  }  
  
- 
+ // 删除订单
+ export function deleteOrder(data) {
+ 	return request('/app/order/deleteOrder', data, 'POST', 'application/json;charset=UTF-8');
+ }

+ 4 - 4
common/request.js

@@ -7,9 +7,9 @@ export default class Request {
 		// let path ='http://k26a55d9.natappfree.cc/'//本地
 		// let path = 'https://userapp.kangniantangyiyao.top/store'//臻选
 		let path = 'https://userappB.kangniantangyiyao.top/store'//惠选和其他小程序
-		// let path = 'http://192.168.110.247:8113/store'
+		//let path = 'http://192.168.110.59:8113/store'
 		// let path2 = 'https://userapp.kangniantangyiyao.top'//直播
-		let path2 = 'http://192.168.110.59:8113'//本地(直播)
+		let path2 = 'https://userappB.kangniantangyiyao.top'//本地(直播)
 		let type = 0
 		uni.setStorageSync('requestPath',path)
 		// uni.showLoading({
@@ -19,11 +19,11 @@ export default class Request {
 					path = 'https://im.fhhx.runtzh.com';
 				}
 		if (router.indexOf("/app/order/getMyMergedOrderList") != -1 || router.indexOf("/app/order/deleteOrder") != -1) {
-			path = 'https://userapp.kangniantangyiyao.top';
+			path = 'https://userappB.kangniantangyiyao.top';
 		}
 			
 		if (router.indexOf("/app/order/getMergedAfterSalesList") != -1) {
-				path = 'https://userapp.kangniantangyiyao.top';
+				path = 'https://userappB.kangniantangyiyao.top';
 			}
 		if (router.indexOf("/live") !== -1 || router.indexOf("/liveAPP") !== -1) {
 			// path = 'https://userapp.kangniantangyiyao.top';

+ 1 - 1
manifest.json

@@ -53,7 +53,7 @@
     /* 小程序特有相关 */
     "mp-weixin" : {
         // "appid" : "wxd2892bb660356ecf",
-        "appid" : "wxd2892bb660356ecf",
+        "appid" : "wxd2edd379beb6581b",
         "setting" : {
             "urlCheck" : false
         },

+ 2 - 2
pages/user/index.vue

@@ -124,7 +124,7 @@
 								<image src="https://kntobs.jnmyunl.com/shop/images/qualification.png" mode=""></image>
 								<text class="text">资质证书</text>
 							</view>
-						<!-- 	<view class="item no-marin-bottom align-top" @click="navgetTo('/pages_course/livingList')">
+							<view class="item no-marin-bottom align-top" @click="navgetTo('/pages_course/livingList')">
 								<image
 									src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/integral.png"
 									mode=""></image>
@@ -135,7 +135,7 @@
 									src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/live.png"
 									mode=""></image>
 								<text class="text">直播订单</text>
-							</view> -->
+							</view>
 							<view class="item no-marin-bottom" @click="toManager()">
 								<image src="https://kntobs.jnmyunl.com/shop/images/products_icon.png" mode=""></image>
 								<text class="text">制单管理</text>

+ 2 - 2
pages_company/index.vue

@@ -48,10 +48,10 @@
 					 	<image src="https://kuanyitang-1317640934.cos.ap-shanghai.myqcloud.com/app/image/wechat.png" mode=""></image>
 					 	<text class="text">微信收款码</text>
 					 </view>
-					<!-- <view class="item" @click="toShareLive()">
+					<view class="item" @click="toShareLive()">
 					 	<image src="https://kntobs.jnmyunl.com/userapp/images/live_icon.png" mode=""></image>
 					 	<text class="text">分享直播间</text>
-					 </view> -->
+					 </view>
 				</view>
 			</view>
 			<!-- 退出登录按钮 -->

+ 2 - 2
pages_course/living.vue

@@ -4445,8 +4445,8 @@
 
 			try {
 				// const baseWsUrl = 'wss://ws.klbycp.com/ws/app/webSocket';
-				const baseWsUrl = 'ws://192.168.110.59:7114/ws/app/webSocket';
-				// const baseWsUrl = 'ws://d6998672.natappfree.cc/ws/app/webSocket';
+				//const baseWsUrl = 'ws://192.168.110.59:7114/ws/app/webSocket';
+				const baseWsUrl = 'wss://liveapp.kangniantangyiyao.top/ws/app/webSocket';
 				// const baseWsUrl = 'ws://nd967d83.natappfree.cc/ws/app/webSocket';
 				let wsUrl =
 					`${baseWsUrl}?userId=${this.userInfo.userId}&liveId=${this.liveId}&userType=${this.userType}&timestamp=${this.timestamp}&signature=${signature}`;

+ 1 - 1
pages_shopping/live/goods.vue

@@ -222,7 +222,7 @@
 			// 提交
 			submit() {
 				this.specVisible = false
-				this.doAddCart(this.type);
+				this.doAddCart('buy');
 			},
 			// 加入购物车
 			addCart(type) {

+ 179 - 28
pages_user/user/storeOrder.vue

@@ -11,7 +11,7 @@
 						@click="orderStatusChange(item)">
 						<view class="text">
 							{{ item.name }}
-							<image v-show="status ==item.value" class="tab-bg" src="https://kntobs.jnmyunl.com/shop/images/tab_bg.png" mode=""></image>
+							<image v-show="status ==item.value" class="tab-bg" src="https://jnlzjk-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/tab_bg.png" mode=""></image>
 						</view>
 					</view>
 				</view>
@@ -20,7 +20,7 @@
 			
 			<view class="search-cont">
 				<view class="inner">
-					<image class="icon-search" src="https://kntobs.jnmyunl.com/shop/images/search.png" mode=""></image>
+					<image class="icon-search" src="https://jnlzjk-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/search.png" mode=""></image>
 					<input type="text" value="" placeholder="输入订单号" confirm-type="搜索" @confirm="goSearch"   placeholder-style="font-size:28rpx;color:#BBBBBB;font-family: PingFang SC;" />
 				</view>
 			</view>
@@ -37,12 +37,13 @@
 						<view class="status-box">
 							<!-- <view   class="recom-box">推荐订单</view> -->
 							<text   class="text success">
-								{{utils.getDictLabelName("storeOrderStatus",item.status)}}
+								{{utils.getDictLabelName("storeOrderStatus",item.status)||''}}
 							</text>
 						</view>
 					</view>
-					<!-- 药品列表 -->
-					<view  class="drug-list"  >
+					<!-- 产品列表 -->
+					<!-- 商城 -->
+					<view  class="drug-list"  v-if="item.orderType!==2">
 						<view @click="showDetail(item)"  v-if="item.isPackage!=1" v-for="(subItem,subIndex) in item.items" :key="subIndex" class="drug-item" >
 							<view class="img-box">
 								<image :src="JSON.parse(subItem.jsonInfo).image" mode="aspectFill"></image>
@@ -57,7 +58,7 @@
 								<view class="num-box">
 									<view class="price">
 										<text class="unit">¥</text>
-										<text class="num">{{JSON.parse(subItem.jsonInfo).price.toFixed(2)}}</text>
+									<text class="num">{{JSON.parse(subItem.jsonInfo).price.toFixed(2)}}</text>
 									</view>
 									<view class="amount">x{{JSON.parse(subItem.jsonInfo).num}}</view>
 								</view>
@@ -97,6 +98,68 @@
 								<view v-if="item.status == 0" class="btn pay" @click="pay(item)">支付</view>
 								<view v-if="item.isAfterSales==1" class="btn cancel" @click="refund(item)">申请售后</view>
 								<view v-if="item.status >=2 &&item.deliveryId!=null" class="btn pay" @click.stop="showDelivery(item)">查看物流</view>
+								<view v-if="item.status == -3" class="btn cancel" @click="deleteOrder(item)">删除订单</view>
+								<!-- <view v-if="item.status==4" class="btn pay">再次购买</view> -->
+							</view>
+						</view>
+					</view>
+					<!-- 直播 -->
+					<view  class="drug-list"  v-if="item.orderType==2">
+						<view @click="showDetail(item)"  v-if="item.isPackage!=1" class="drug-item" >
+							<view class="img-box">
+								<image :src="JSON.parse(item.itemJson).image" mode="aspectFill"></image>
+							</view>
+							<view class="drug-info"  >
+								<view>
+									<view class="name-box ellipsis2">
+										<view v-if="item.isPrescribe==1" class="tag">处方药</view>{{JSON.parse(item.itemJson).productName}}
+									</view>
+									<view class="spec ellipsis2">{{JSON.parse(item.itemJson).sku}}</view>
+								</view>
+								<view class="num-box">
+									<view class="price">
+										<text class="unit">¥</text>
+									<text class="num">{{JSON.parse(item.itemJson).price.toFixed(2)}}</text>
+									</view>
+									<view class="amount">x{{item.totalNum}}</view>
+								</view>
+							</view>
+						</view>
+						<view v-if="item.isPackage==1&&item.packageJson!=null" class="drug-item" @click="showDetail(item)">
+							<view class="img-box">
+								<image :src="JSON.parse(item.packageJson).imgUrl" mode="aspectFill"></image>
+							</view>
+							<view class="drug-info"  >
+								<view>
+									<view class="name-box ellipsis2">
+										<view class="tag">套餐</view>{{JSON.parse(item.packageJson).title}}
+									</view>
+									<view class="spec ellipsis2">{{JSON.parse(item.packageJson).descs}}</view>
+								</view>
+								<!-- <view class="num-box">
+									<view class="price">
+										<text class="unit">¥</text>
+										<text class="num">{{JSON.parse(item.packageJson).payMoney.toFixed(2)}}</text>
+									</view>
+									<view class="amount"></view>
+								</view> -->
+							</view>
+						</view>
+						<!-- 实付金额、按钮 -->
+						<view class="bottom-box">
+							<view class="amount-paid">
+								<text class="label">订单金额:</text>
+								<view class="price-box">
+									<view class="unit">¥</view>
+									<view class="num" >{{item.payPrice.toFixed(2)}}</view>
+								</view>
+							</view>
+							<view class="btn-box">
+								<view v-if="item.status == 0" class="btn cancel" @click="cancel(item)">取消订单</view>
+								<view v-if="item.status == 0" class="btn pay" @click="pay(item)">支付</view>
+								<view v-if="item.isAfterSales==1" class="btn cancel" @click="refund(item)">申请售后</view>
+								<view v-if="item.status >=2 &&item.deliveryId!=null" class="btn pay" @click.stop="showDelivery(item)">查看物流</view>
+								<view v-if="item.status == -3" class="btn cancel" @click="deleteOrder(item)">删除订单</view>
 								<!-- <view v-if="item.status==4" class="btn pay">再次购买</view> -->
 							</view>
 						</view>
@@ -104,18 +167,14 @@
 				</view>
 			</view>
 		</mescroll-body>
-		<ykscreenRecord></ykscreenRecord>
 	</view>
 </template>
 
 <script>
-	import {getMyStoreOrderList,cancelOrder} from '@/api/storeOrder'
+	import {getMyStoreOrderList,cancelOrder,canceliveOrder, deleteOrder as deleteOrderApi, cancelLiveOrder} from '@/api/storeOrder'
+	import {getDicts} from '@/api/index'
 	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
-	import ykscreenRecord from "@/components/yk-screenRecord/yk-screenRecord.vue"
 	export default {
-		components:{
-			ykscreenRecord
-		},
 		mixins: [MescrollMixin], 
 		data() {
 			return {
@@ -139,7 +198,7 @@
 					},
 					noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
 					empty: {
-						icon:'https://kntobs.jnmyunl.com/shop/images/no_data.png',
+						icon:'https://jnlzjk-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/no_data.png',
 						tip: '暂无数据'
 					}
 				},
@@ -149,6 +208,7 @@
 		},
 		onLoad(option) {
 			this.status = option.status
+			this.getDicts();
 			var that=this;
 			uni.$on('refreshOrder', () => {
 				that.mescroll.resetUpScroll()
@@ -159,10 +219,31 @@
 				this.searchKey=e.detail.value;
 				this.mescroll.resetUpScroll()
 			},
+			getDicts:function(){
+				getDicts().then(
+					res => {
+						if(res.code==200){
+							uni.setStorageSync('dicts',JSON.stringify(res));
+							
+						}else{
+							 
+						}
+						// this.loadding=false;
+						// this.navigatHandler();
+					},
+					rej => {}
+				);
+			},
 			refund(item) {
-				uni.navigateTo({
-					url: './refundOrderProduct?orderId='+item.id
-				})	
+				if(item.orderType==2){
+					uni.navigateTo({
+						url: '/pages_shopping/live/refundOrderProduct?orderId=' + item.orderId
+					})
+				}else{
+					uni.navigateTo({
+						url: './refundOrderProduct?orderId='+item.id
+					})	
+				}
 			},
 			// tab切换
 			orderStatusChange(item) {
@@ -206,13 +287,21 @@
 						that.mescroll.endErr();
 					}
 				});
+
 			},
 			// 查看订单详情
 			showDetail(item) {
 				console.log(item)
-				uni.navigateTo({
-					url: './storeOrderDetail?id=' + item.id
-				})
+				if(item.orderType==2){
+					uni.navigateTo({
+						url: '/pages_shopping/live/storeOrderDetail?orderId=' + item.orderId
+					})
+				}else{
+					uni.navigateTo({
+						url: './storeOrderDetail?id=' + item.id
+					})
+				}
+				
 			},
 			cancel(item){
 				var that=this;
@@ -222,9 +311,10 @@
 				    success: function (res) {
 				        if (res.confirm) {
 							var data = {
-								orderId:item.id
+								orderId:item.orderType==2?item.orderId:item.id
 							};
-							cancelOrder(data).then(res => {
+							if(item.orderType==2){
+							cancelLiveOrder(data).then(res => {
 								if(res.code==200){
 									uni.showToast({
 										icon:'success',
@@ -238,6 +328,23 @@
 									});
 								}
 							});
+							}else{
+								cancelOrder(data).then(res => {
+									if(res.code==200){
+										uni.showToast({
+											icon:'success',
+											title: "操作成功",
+										});
+										 that.mescroll.resetUpScroll()
+									}else{
+										uni.showToast({
+											icon:'none',
+											title: res.msg,
+										});
+									}
+								});
+							}
+							
 				        } 
 						else if (res.cancel) {
 							
@@ -252,16 +359,60 @@
 					});
 				}
 				else{
-					uni.navigateTo({
-						url: '/pages/shopping/paymentOrder?orderId='+item.id
-					})
+					if(item.orderType==2){
+						// 支付
+						console.log("去支付", item)
+						uni.navigateTo({
+							url: `/pages_shopping/live/paymentOrder?orderList=${encodeURIComponent(JSON.stringify(item))}`
+						})
+					}else{
+						uni.navigateTo({
+							url: '/pages/shopping/paymentOrder?orderId='+item.id
+						})
+					}
 				}
 			},
 			// 查看物流
 			showDelivery(item) {
-				uni.navigateTo({
-					url: './storeOrderDelivery?orderId='+item.id
-				})
+				if(item.orderType==2){
+					uni.navigateTo({
+						url: `/pages_shopping/live/storeOrderDelivery?orderId=${item.orderId}`
+					})
+				}else{
+					uni.navigateTo({
+						url: './storeOrderDelivery?orderId='+item.id
+					})
+				}
+			},
+			// 删除订单
+			deleteOrder(item) {
+				var that = this;
+				uni.showModal({
+					title: '提示',
+					content: '确定删除订单吗?删除后无法恢复',
+					success: function (res) {
+						if (res.confirm) {
+							var data = {
+								orderId: item.orderType == 2 ? item.orderId : item.id,
+								orderType: item.orderType
+							};
+							deleteOrderApi(data).then(res => {
+								if(res.code == 200){
+									uni.showToast({
+										icon:'success',
+										title: "删除成功",
+									});
+									that.mescroll.resetUpScroll()
+								}else{
+									uni.showToast({
+										icon:'none',
+										title: res.msg,
+									});
+								}
+							});
+						}
+					}
+				});
 			}
 			
 		}
@@ -382,7 +533,7 @@
 						font-family: PingFang SC;
 						font-weight: 500;
 						color: #FFFFFF;
-						background-image: url(https://kntobs.jnmyunl.com/shop/images/recom.png);
+						background-image: url(https://jnlzjk-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/recom.png);
 						background-repeat: no-repeat;
 						background-size: 100% 100%;
 						margin-right: 8upx;

+ 2 - 2
store/index.js

@@ -24,8 +24,8 @@ export default new Vuex.Store({
 	// https://kntobs.jnmyunl.com/shop  惠选商城图片链接
 	logoname:'德信小站',
 	// appid:'wx1de020b57c05a990',//康年臻选
-	// appid:'wxd2edd379beb6581b',//康年惠选
-	appid:'wxd2892bb660356ecf',//其他
+	appid:'wxd2edd379beb6581b',//康年惠选
+	//appid:'wxd2892bb660356ecf',//其他
   },
   mutations: {
     setCount(state, value) {