diff --git a/src/pages/course/experience/experience.vue b/src/pages/course/experience/experience.vue
index 024464b..c5a648a 100644
--- a/src/pages/course/experience/experience.vue
+++ b/src/pages/course/experience/experience.vue
@@ -151,6 +151,7 @@ export default {
id: e.id,
course_name: e.course.name,
course_id: e.course.id,
+ course_kind: e.course.kind,
user_name: e.name,
user_id: e.user_id,
offerInfo: {
diff --git a/src/pages/course/offer/offer.vue b/src/pages/course/offer/offer.vue
index 6f4d946..5169145 100644
--- a/src/pages/course/offer/offer.vue
+++ b/src/pages/course/offer/offer.vue
@@ -9,9 +9,21 @@
上课用户:
{{optionsQuery.user_name || '-'}}
+
+
+ 负责教练:
+
+
+
+
+
+
+
+
+
课程次数:
-
+
课程报价:
@@ -50,26 +62,57 @@ export default {
coursePrice: 1,
optionsQuery: {},
isShowConfirmModal: false,
+ offerInfo: {},
+ coachInfo: null,
}
},
onLoad(options){
let _query = util.jsonPar(options.query);
this.optionsQuery = _query;
- if(_query.offerInfo&&_query.offerInfo.price_option == 2){
- this.courseNumber = _query.offerInfo.number;
- this.coursePrice = _query.offerInfo.price;
- }
+ console.warn(_query)
+ this.getOfferInfo(_query.id);
+
+ this.courseNumber = _query.offerInfo.number;
+ this.coursePrice = _query.offerInfo.price;
},
methods: {
+ classTimeChange(e){
+ let { optionsQuery } = this;
+ if(e.detail.value < optionsQuery.offerInfo.number){
+ this.courseNumber = optionsQuery.offerInfo.number;
+ return util.showNone(`最小值为${optionsQuery.offerInfo.number}`);
+ }
+ console.warn(e);
+ },
+ coachChange(e){
+ let _coachList = [...this.offerInfo.course.coaches];
+ this.coachInfo = _coachList[e.detail.value];
+ console.warn(this.coachInfo)
+ console.warn(e);
+ },
+ getOfferInfo(id){
+ util.showLoad();
+ servers.get({
+ url: API.course.getOfferPriceInfo,
+ data: {id},
+ failMsg: '加载失败!'
+ })
+ .then(res=>{
+ util.hideLoad();
+ this.offerInfo = res;
+ console.warn(res)
+ })
+ },
submitBtn: util.debounce(function(){
- let { optionsQuery, courseNumber, coursePrice } = this;
+ let { optionsQuery, courseNumber, coursePrice, coachInfo } = this;
console.warn(optionsQuery, courseNumber, coursePrice);
servers.post({
url: API.course.offerExpBookingPrice,
data: {
id: optionsQuery.id,
price: coursePrice,
- number: courseNumber
+ number: courseNumber,
+ coach_id: coachInfo&&coachInfo.id || ''
},
isDefaultGet: false
})
@@ -98,7 +141,6 @@ export default {
.o-section{
padding: 34upx 24upx;
.s-line{
-
@include centerFlex(flex-start);
.l-tit{
flex-shrink: 0;
@@ -126,12 +168,19 @@ export default {
border: 2upx solid #D8D8D8;
border-radius: 10upx;
background-color: #f7f7f7;
+ @include centerFlex(space-between);
>input{
flex-grow: 1;
height: 100%;
font-size: 28upx;
color: #333;
}
+ >image{
+ margin-left: 10upx;
+ flex-shrink: 0;
+ width: 28upx;
+ height: 28upx;
+ }
}
}
}