diff --git a/pages/bookShop/orderLCont.vue b/pages/bookShop/orderLCont.vue index adb2d91..bdab518 100644 --- a/pages/bookShop/orderLCont.vue +++ b/pages/bookShop/orderLCont.vue @@ -166,6 +166,23 @@
+ + + + + {{ orderContet.remark }} + + + + +
+
+
+
+ + + + + + {{ slotProps.row.remark }} + + + + + + + { - // console.log(res, "内容获取成功"); + console.log("订单列表内容获取成功",res ); that.pagination.total = res.data.total; if (res.data.total == 0) { this.isLoadingHide = true; diff --git a/pages/component/commonComponents/selectGoods.vue b/pages/component/commonComponents/selectGoods.vue index bd64bf9..916fc9d 100644 --- a/pages/component/commonComponents/selectGoods.vue +++ b/pages/component/commonComponents/selectGoods.vue @@ -44,8 +44,8 @@ 课程有效期截止到:{{librayList[curIndex].endTime}} 续费 - 复读 + @click="handleClickGetGoodsList(librayList[curIndex])">续费 @@ -245,6 +243,10 @@ + + @@ -465,10 +467,10 @@ - @@ -625,7 +627,8 @@ list: "sociology/course/getCourseDetail", goodsList: "sociology/product/getProductListForCourse", startStudyForMF: "sociology/course/startStudyForMF", - newPayment:"common/courseRelearn/courseCatalogueCanRelearn", // 复读地址 + newPayment:"common/courseRelearn/courseCatalogueCanRelearn", // 检查复读地址 + newPaymentList:"common/courseRelearn/relearnShopProductList", // 获取复读列表 }, isAndorid: true, oprateOsName: '', @@ -642,6 +645,8 @@ canJoinTestTime: false, //时间上是否可以参加自考考试 courseCompletion: undefined, // 课程学习进度 showNewPayBtn:false, + newPaymentProList:[], + isFudu:false, // 是否复读 }; }, //第一次加载 @@ -1112,6 +1117,7 @@ typeId: 0, navTitle: this.course.title, title: this.course.title, + isFudu: this.isFudu // sourceType: "curriculum", }); // 这里转换成 字符串 uni.navigateTo({ @@ -1123,9 +1129,41 @@ this.pricespop = false; this.protocolShow = true; }, + // 查询课程复读列表 + async getNewPaymentList(id){ + uni.showLoading({ + title:'加载中' + }) + await this.$http + .request({ + url: this.urlList.newPaymentList, + method: "POST", + data: { + catalogueId: id, + }, + header: { + //默认 无 说明:请求头 + "Content-Type": "application/json", + }, + }) + .then(async (res) => { + console.log("复读列表", res); + uni.hideLoading() + if(res.code != 0){return this.$commonJS.showToast(res.errMsg);} + // if (res.code == 0) { + this.newPaymentProList = res.productList + // } + this.$forceUpdate(); + }).catch(e => { + uni.hideLoading() + console.log('e',e); + this.newPaymentProList = [] + this.$commonJS.showToast(e.errMsg); + }); + + }, // 查询目录续费情况 - async checkRenewPayment(id){ - console.log('999999999999999999999999999'); + async checkRenewPayment(id){ var ss = false await this.$http .request({ @@ -1192,6 +1230,7 @@ } }, getCourseDescriptionData(v){ + this.isFudu = false this.$http .request({ url: this.urlList.goodsList, @@ -1817,6 +1856,22 @@ console.log("datas at line 1300:", datas); return datas; }, + // 选择复读选项 + async goNewPay(item){ + this.showNewPayBtn ? await this.getNewPaymentList(item.id) : '' + if(this.newPaymentProList.length > 0){ + // this.getCourseDescriptionData(v); + this.goodsList = this.newPaymentProList; + this.selectGoodsData = this.goodsList[0]; + this.$refs.commonSelectGoods.open(); + this.isFudu = true + this.show = true; + }else{ + this.show = false + this.isFudu = false + this.$commonJS.showToast('暂无复读方案'); + } + }, async clicklib(item, index) { console.log('hhhhhhhhhhhhhhhhhhh++++++++', item); @@ -1829,10 +1884,10 @@ if(item.isBuy == 0 && this.userMsg.vip != 2 && this.userMsg.vip != 1 ){ console.log('hhhhhhhhhhhhhhhhhhh++++++++'); - this.showNewPayBtn = await this.checkRenewPayment(item.id) - }else{ - // this.showNewPayBtn = await this.checkRenewPayment(item.id) - console.log('hhhhhhhhhhhhhhhhhhh不用复读'); + this.showNewPayBtn = await this.checkRenewPayment(item.id) + console.log('可以复读吗?', this.showNewPayBtn ); + }else{ // this.showNewPayBtn = await this.checkRenewPayment(item.id) + console.log('不用复读'); } this.chapterList = await this.getChapterList(item.id); diff --git a/pages/goods/order/index.vue b/pages/goods/order/index.vue index 1ed3e96..6fe6da6 100644 --- a/pages/goods/order/index.vue +++ b/pages/goods/order/index.vue @@ -89,7 +89,7 @@ - + @@ -571,6 +571,7 @@ detailInfo: "app/phoneDoctor.do?getTaiHuClassInfo_new", addressList: "common/userAddress/getUserAddress", freightNum: "book/buyOrder/calculateTransportPrice", //运费 + renewPayment:'common/courseRelearn/relearnSave' , // 复读下单地址 }, customButton: [{ width: "340rpx", @@ -804,6 +805,19 @@ }, // 获取订单初始话 async initPrepareOrder() { + if(this.options.isFudu){ + this.priceBreakdownList = [{ + text: "商品总价", + imgUrl: "", + type: 1, + }, + { + text: "运费", + imgUrl: "", + type: 2, + } + ]; + }else{ this.priceBreakdownList = [{ text: "商品总价", imgUrl: "", @@ -820,6 +834,7 @@ type: 3, } ]; + } // this.goodsDataList console.log("this.goodsDataList at line 595:", this.goodsDataList); @@ -852,7 +867,7 @@ if (res.code == 0) { this.initData = res.data; this.isShowAddress = res.data.is_course ? false : true; - if (!this.isShowAddress) { + if (!this.isShowAddress && !this.options.isFudu) { this.priceBreakdownList.push({ text: "积分", imgUrl: require("@/static/icon/jifen.png"), @@ -1090,47 +1105,61 @@ // productId: this.cartList[i].productId, // quantity: this.cartList[i].productAmount, // }); - // } - if (this.options.goods[0].goodsType != "05") { - if (!this.addressData.id) { - this.$commonJS.showToast("请选择收货地址"); - return false; + // } + console.log('99999999999',this.options); + let data = {} + if(this.options.isFudu){ + console.log(888888888, this.goodsDataList.map((e) => e.productId +","+ e.productName ).join(',')); + data = { + paymentMethod: this.payType, //支付方式 2支付宝,1微信,3ios内购 4,天医币购买 + orderMoney: this.totalPrice, //订单金额 + realMoney: this.actualPayment, //实收金额 + remark: this.goodsDataList.map((e) => e.productId +","+ e.productName ).join(','), //productId,商品名 + come: "2", + }; + }else{ + if (this.options.goods[0].goodsType != "05") { + if (!this.addressData.id) { + this.$commonJS.showToast("请选择收货地址"); + return false; + } } - } + data = { + buyType: this.options.typeId, //0- 商品页直接下单 1- 购物车结算 + userId: this.userInfo.id, //下单人ID + shippingUser: this.addressData ? this.addressData.consigneeName : "111", //收货人姓名 + userPhone: this.addressData.consigneePhone, //收货人手机号 + jfDeduction: this.jfNumber, + paymentMethod: this.payType, //支付方式 2支付宝,1微信,3ios内购 4,天医币购买 + orderMoney: this.totalPrice, //订单金额 + realMoney: this.actualPayment, //实收金额 + shippingMoney: this.freightNum, //运费 + remark: this.remark, //备注 + couponId: this.curCouponId ? this.curCoupon.id : null, //优惠券Id + // isSend: this.isSend, + couponName: this.curCouponId && this.curCoupon.id ? this.curCoupon.couponEntity.couponName : '', //优惠券名称 + districtMoney: 0, //优惠金额 + + productList: this.goodsDataList.map((e) => { + return { + productId: e.productId, + quantity: 1, + }; + }), //订单列表商品 + orderType: "order", //订单类型 + addressId: this.options.goods[0].goodsType != "05" ? this.addressData.id : 0, // 地址ID + appName: "wumen", + come: "2", + }; + var productList = [...data.productList] + var thisproduct = productList.map(item => { + return item.productId+"_"+item.quantity + }) + thisproduct = thisproduct.join(',') + } - let data = { - buyType: this.options.typeId, //0- 商品页直接下单 1- 购物车结算 - userId: this.userInfo.id, //下单人ID - shippingUser: this.addressData ? this.addressData.consigneeName : "111", //收货人姓名 - userPhone: this.addressData.consigneePhone, //收货人手机号 - jfDeduction: this.jfNumber, - paymentMethod: this.payType, //支付方式 2支付宝,1微信,3ios内购 4,天医币购买 - orderMoney: this.totalPrice, //订单金额 - realMoney: this.actualPayment, //实收金额 - shippingMoney: this.freightNum, //运费 - remark: this.remark, //备注 - couponId: this.curCouponId ? this.curCoupon.id : null, //优惠券Id - // isSend: this.isSend, - couponName: this.curCouponId && this.curCoupon.id ? this.curCoupon.couponEntity.couponName : '', //优惠券名称 - districtMoney: 0, //优惠金额 - - productList: this.goodsDataList.map((e) => { - return { - productId: e.productId, - quantity: 1, - }; - }), //订单列表商品 - orderType: "order", //订单类型 - addressId: this.options.goods[0].goodsType != "05" ? this.addressData.id : 0, // 地址ID - appName: "wumen", - come: "2", - }; - var productList = [...data.productList] - var thisproduct = productList.map(item => { - return item.productId+"_"+item.quantity - }) - thisproduct = thisproduct.join(',') - console.log("data at line 477:", data); + + console.log("data at line 477 提交后台的下单数据:", data); // console.log('成功信息',product,thisproduct,data.addressId, data.realMoney); if(this.historyOrderInfo && thisproduct == this.historyOrderInfo.product && @@ -1166,11 +1195,12 @@ }) // this.buyingFlag = false console.log('进来请求了吗?'); - let that = this + let that = this + await $http .request({ // url: "book/buyOrder/buySave", - url: that.urlList.buyOrder, + url: that.options.isFudu ? that.urlList.renewPayment : that.urlList.buyOrder, method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档 data, header: { @@ -1179,18 +1209,19 @@ }, }) .then(async (res) => { - that.buyingFlag = false - var product = data.productList.map(item => { - return item.productId+"_"+item.quantity - }) - product = product.join(',') - that.historyOrderInfo = { - 'product':product, - 'addressId':data.addressId, - 'realMoney':data.realMoney - } - console.log("res at line 598系统下单返回结果:", res); + that.buyingFlag = false + if(!that.options.isFudu){ + var product = data.productList.map(item => { + return item.productId+"_"+item.quantity + }) + product = product.join(',') + that.historyOrderInfo = { + 'product':product, + 'addressId':data.addressId, + 'realMoney':data.realMoney + } + } if (res.code == 0) { if (res.orderSn == null) { uni.showToast({ diff --git a/static/icon/fugou.png b/static/icon/fugou.png new file mode 100644 index 0000000..add72f0 Binary files /dev/null and b/static/icon/fugou.png differ