فهرست منبع

研学更新可用日期方式

vaecebyZ 9 ماه پیش
والد
کامیت
52c56e3f95
3فایلهای تغییر یافته به همراه35 افزوده شده و 13 حذف شده
  1. 10 0
      api/study.js
  2. 3 1
      study/pay/order.vue
  3. 22 12
      study/studyGoodsDetail.vue

+ 10 - 0
api/study.js

@@ -237,4 +237,14 @@ export function coursePlayLog(data) {
 		method:'post',
 		data
 	})
+}
+
+// 创建研学订单
+// springbatchservice/studyOrder/creat
+export function studyOrderCreat(data) {
+	return request({
+		url: '/springbatchservice/studyOrder/creat',
+		method:'post',
+		data
+	})
 }

+ 3 - 1
study/pay/order.vue

@@ -109,6 +109,7 @@ import {
 	queryPayOrder,
 	payDetails
 } from '@/api/payment.js'
+import { studyOrderCreat } from '@/api/study.js'
 import guid from '@/utils/guid.js'
 export default {
 	data() {
@@ -261,7 +262,7 @@ export default {
 					extend = this.info.reservationTime || ''
 				}
 
-				creat({
+				studyOrderCreat({
 					discountId: (this.payInfo.couponGoodsLogId || this.payInfo.couponGoodsLogId == -1) ? [this
 						.payInfo.couponGoodsLogId
 					] : [],
@@ -269,6 +270,7 @@ export default {
 					channel: 'ZhongShu',
 					goodsList: this.info.goodsId ? [this.info.goodsId] : [],
 					idempotent: guid(),
+					reserveTime: this.info.reserveTime,
 					shopId: this.info.shopId
 				}).then(res => {
 					this.loading = false

+ 22 - 12
study/studyGoodsDetail.vue

@@ -240,6 +240,16 @@ export default {
 						} catch (error) {
 						}
 						this.info.reservationDate = content.msg
+						if(content.newlyTime){
+							this.selectDate = this.$u.timeFormat(new Date(content.newlyTime), 'yyyy-mm-dd')
+						}else{
+							uni.showToast({
+								title: '无可购买日期',
+								duration: 2000,
+								icon: 'none'
+							});
+							this.info.realStockNum = 0
+						}
 						const { communityVo } = content
 						const { list, total } = communityVo
 						this.total = total
@@ -323,18 +333,18 @@ export default {
 					}
 				})
 
-				this.selectDate = this.selected.find(e => !e.disable)?.date;
-				console.log('this.selectDate', this.selectDate);
-				if (!this.selectDate) {
-					// 看下个月
-					let dateTime = new Date();
-					dateTime = dateTime.setMonth(dateTime.getMonth() + 1);
-					dateTime = new Date(dateTime);
-					this.chnageMonth({
-						year: dateTime.getFullYear(),
-						month: dateTime.getMonth() + 1
-					})
-				}
+				// this.selectDate = this.selected.find(e => !e.disable)?.date;
+				// console.log('this.selectDate', this.selectDate);
+				// if (!this.selectDate) {
+				// 	// 看下个月
+				// 	let dateTime = new Date();
+				// 	dateTime = dateTime.setMonth(dateTime.getMonth() + 1);
+				// 	dateTime = new Date(dateTime);
+				// 	this.chnageMonth({
+				// 		year: dateTime.getFullYear(),
+				// 		month: dateTime.getMonth() + 1
+				// 	})
+				// }
 			})
 		},
 		clickImg() {