浏览代码

fix:修改消息中心点立刻跳转到课程的问题和订单申请发票问题

xuqiaoying 3 年之前
父节点
当前提交
15db950a93
共有 3 个文件被更改,包括 90 次插入22 次删除
  1. 16 4
      pages2/invoice/index.vue
  2. 72 17
      pages2/msg/detail.vue
  3. 2 1
      pages2/wd/info.vue

+ 16 - 4
pages2/invoice/index.vue

@@ -84,7 +84,7 @@
 							</view>
 						</u-form-item>
 						<view>
-							<view class="check-order" v-for="(item,index) in orderList" :key="index" v-if="item.disabled">
+							<view class="check-order" v-for="(item,index) in filterOrderList" :key="index" >
 									<view class="close" @click="deleteOrder(index)">
 										<u-icon name="close-circle-fill" color="#FF2D55" size="40"></u-icon>
 									</view>
@@ -174,7 +174,7 @@
 				<u-line color="#D6D6DB" />
 				<view>
 					<scroll-view scroll-y="true" style="height: 500rpx;">
-						<view>
+						<view v-if="orderList.length">
 							<u-checkbox-group>
 								<view v-for="(item, index) in orderList" :key="index" >
 									<view class="order-item">
@@ -199,6 +199,9 @@
 								</view>
 							</u-checkbox-group>
 						</view>
+						<view v-else class="no_data">
+							<text>暂无可开发票的订单</text>
+						</view>
 					</scroll-view>
 				</view>
 				<view class="confrim-btn">
@@ -609,7 +612,7 @@ export default {
 			return number.toFixed(2)
 		},
 		/**
-		 * 获取可开发票的订单
+		 * 获取可开发票的订单,/order/invoice/canInvoiceList
 		 */
 		orderInvoiceCanInvoiceList() {
 			this.$api.orderInvoiceCanInvoiceList().then(res => {
@@ -870,7 +873,12 @@ export default {
 			
 		}
 	},
-	computed: { ...mapGetters(['userInfo']) }
+	computed: { 
+		...mapGetters(['userInfo']),
+		filterOrderList() {
+			return this.orderList.filter(i => i.disabled) || []
+		}
+	}
 };
 </script>
 <style>
@@ -1174,6 +1182,10 @@ page {
 					border-radius: 32rpx;
 				}
 			}
+			.no_data {
+				text-align: center;
+				margin-top: 40rpx;
+			}
 		}
 		
 		.order-detail {

+ 72 - 17
pages2/msg/detail.vue

@@ -187,27 +187,51 @@ export default {
 								return;
 							}
 							console.log(item,'item')
-							if(item.courseNum == 1 ) {
-								
-								this.$api.courseCourseList({
-									pageNum:1,
-									pageSize:1,
-									goodsId:item.goodsId,
-									gradeId:item.gradeId
-								}).then(res => {
-									if(res.data.code == 200) {
+							this.$api.courseCourseList({
+								pageNum: 1,
+								pageSize: 1,
+								goodsId: item.goodsId,
+								gradeId: item.gradeId,
+								orderGoodsId: this.orderGoodsId,
+							}).then(res => {
+								if (res.data.code == 200) {
+
+									if(res.data.total > 1) {
+										this.$navTo.togo(`/pages2/wd/course?id=${item.goodsId}&gid=${item.gradeId}&orderGoodsId=${this.orderGoodsId}`);
+									} else if(res.data.total == 1) {
 										uni.navigateTo({
-											url:`/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}`
+											url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${this.orderGoodsId}`
+										})
+									} else {
+										uni.showToast({
+											icon:'none',
+											title:'暂无可观看的视频课程'
 										})
 									}
-								});
-								return;
-							}
+
+								}
+							})
+							// if(item.courseNum == 1 ) {
+								
+							// 	this.$api.courseCourseList({
+							// 		pageNum:1,
+							// 		pageSize:1,
+							// 		goodsId:item.goodsId,
+							// 		gradeId:item.gradeId
+							// 	}).then(res => {
+							// 		if(res.data.code == 200) {
+							// 			uni.navigateTo({
+							// 				url:`/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}`
+							// 			})
+							// 		}
+							// 	});
+							// 	return;
+							// }
 							
-							this.$navTo.togo('/pages2/wd/course', {
-								id: item.goodsId,
-								gid: item.gradeId
-							});
+							// this.$navTo.togo('/pages2/wd/course', {
+							// 	id: item.goodsId,
+							// 	gid: item.gradeId
+							// });
 						})
 						
 						// arsty = '立刻学习';
@@ -217,6 +241,9 @@ export default {
 						this.$navTo.togo('/pages2/bank/question_detail', {
 							id: item.goodsId
 						});
+					} else if (item.goodsType == 6) {
+						// 进入直播课
+						this.toLive(item)
 					}
 					
 					break;
@@ -261,6 +288,33 @@ export default {
 					break;
 			}
 		},
+		toLive(item) {
+			this.$api.courseCourseList({
+				pageNum: 1,
+				pageSize: 1,
+				goodsId: item.goodsId,
+				gradeId: 0,
+				orderGoodsId: this.orderGoodsId,
+			}).then(res => {
+				if (res.data.code == 200) {
+					if(res.data.total > 1) {
+						uni.navigateTo({
+							url:'/pages5/liveDetail/course?orderGoodsId='+this.orderGoodsId+'&goodsId='+item.goodsId+'&gradeId=0'
+						})
+					} else if(res.data.total == 1) {
+						uni.navigateTo({
+							url:'/pages3/live/detail?orderGoodsId='+this.orderGoodsId+'&goodsId='+item.goodsId+'&gradeId=0&courseId='+ res.data.rows[0].courseId
+						})
+					} else {
+						uni.showToast({
+							icon:'none',
+							title:'暂无可观看的直播课程'
+						})
+					}
+				
+				}
+			})
+		},
 		/**
 		 * @param {Object} goodsId 商品id
 		 * 查询商品重修状态
@@ -341,6 +395,7 @@ export default {
 					}
 					
 					this.listData = res.data.data;
+					console.log('listDatalistData:', this.listData)
 					if(res.data.data.goodsId) {
 						if(res.data.data.gradeId) {
 							this.$api.goodsDetail(res.data.data.goodsId).then(rs => {

+ 2 - 1
pages2/wd/info.vue

@@ -298,8 +298,9 @@ export default {
 			let that = this
 			uni.chooseImage({
 			    count: 1, //默认9
-			    sizeType: [  'compressed'], //可以指定是原图还是压缩图,默认二者都有
+			    sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
 			    success: function (res) {
+					console.log('res:,', res)
 					that.avatarUrl = res.tempFilePaths[0]
 					that.submitAvatar()
 			    }