|
@@ -17,11 +17,11 @@
|
|
|
<view v-if="detail.templateType!=null">
|
|
|
<u-line color="#D6D6DB" />
|
|
|
<view v-if="detail.templateType=='class'" style="display: flex;justify-content: space-between;align-items: center;height: 50rpx;" @click="openPopup(0)">
|
|
|
- <view style="color: #666666;font-size: 24rpx;">选择班级</view>
|
|
|
+ <view style="color: #666666;font-size: 24rpx;">{{gradeIndex<0?'报考地区':gradeList[gradeIndex].className}}</view>
|
|
|
<view><u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
|
|
|
</view>
|
|
|
- <view v-if="detail.templateType=='apply'" style="display: flex;justify-content: space-between;align-items: center;height: 50rpx;" @click="openPopup(1)">
|
|
|
- <view style="color: #666666;font-size: 24rpx;">报考地区</view>
|
|
|
+ <view v-if="detail.templateType=='apply'" style="display: flex;justify-content: space-between;align-items: center;height: 50rpx;" @click="openPopup(1)">
|
|
|
+ <view style="color: #666666;font-size: 24rpx;" >{{gradeIndex<0?'报考地区':gradeList[gradeIndex].className}}</view>
|
|
|
<view><u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -45,16 +45,14 @@
|
|
|
<view>
|
|
|
<scroll-view scroll-y="true" style="height: 500rpx;">
|
|
|
<view>
|
|
|
- <u-checkbox-group @change="checkboxGroupChange">
|
|
|
+ <u-radio-group v-model="gradeValue" @change="radioGroupChange">
|
|
|
<view v-for="(item, index) in gradeList" :key="index" >
|
|
|
<view style="display: flex;align-items: center;padding: 20rpx;">
|
|
|
<view>
|
|
|
- <u-checkbox
|
|
|
+ <u-radio
|
|
|
shape="circle"
|
|
|
- @change="checkboxChange"
|
|
|
- v-model="gradeList[index].checked"
|
|
|
- :name="gradeList[index].name"
|
|
|
- ></u-checkbox>
|
|
|
+ :name="index"
|
|
|
+ ></u-radio>
|
|
|
</view>
|
|
|
<view :class="item.checked?'white-box blue-box':'white-box'" >
|
|
|
<view>
|
|
@@ -65,12 +63,12 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </u-checkbox-group>
|
|
|
+ </u-radio-group>
|
|
|
</view>
|
|
|
</scroll-view>
|
|
|
</view>
|
|
|
<view class="confrim-btn">
|
|
|
- <view class="okBtn">确定</view>
|
|
|
+ <view class="okBtn" @click="okPopup(0)">确定</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</u-popup>
|
|
@@ -87,7 +85,7 @@
|
|
|
<view>
|
|
|
<picker-view :indicator-style="indicatorStyle" :value="value" @change="bindChange" class="picker-view">
|
|
|
<picker-view-column>
|
|
|
- <view class="picker-item" v-for="(item,index) in list1" :key="index">{{item.label}}</view>
|
|
|
+ <view class="picker-item" v-for="(item,index) in examine" :key="index">{{item.examineName}}</view>
|
|
|
</picker-view-column>
|
|
|
</picker-view>
|
|
|
</view>
|
|
@@ -97,17 +95,17 @@
|
|
|
<view>
|
|
|
<picker-view :indicator-style="indicatorStyle" :value="value" @change="bindChange" class="picker-view">
|
|
|
<picker-view-column>
|
|
|
- <view class="picker-item" v-for="(item,index) in list2" :key="index">{{item.label}}</view>
|
|
|
+ <view class="picker-item" v-for="(item,index) in provinceList" :key="index">{{item.areaName}}</view>
|
|
|
</picker-view-column>
|
|
|
<picker-view-column>
|
|
|
- <view class="picker-item" v-for="(item,index) in list3" :key="index">{{item.label}}</view>
|
|
|
+ <view class="picker-item" v-for="(item,index) in cityList" :key="index">{{item.areaName}}</view>
|
|
|
</picker-view-column>
|
|
|
</picker-view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="confrim-btn">
|
|
|
- <view class="okBtn">确定</view>
|
|
|
+ <view class="okBtn" @click="okPopup(1)">确定</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</u-popup>
|
|
@@ -123,6 +121,8 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ gradeValue:-1,
|
|
|
+ gradeIndex:-1,
|
|
|
id:0,
|
|
|
indicatorStyle: `height: 50px;`,
|
|
|
showArea:true,
|
|
@@ -193,7 +193,12 @@ export default {
|
|
|
value1:'',
|
|
|
show:false,
|
|
|
detail:{},
|
|
|
- gradeList:[]
|
|
|
+ gradeList:[],
|
|
|
+ provinceList:[],
|
|
|
+ cityList:[],
|
|
|
+ pAreaIndex:0,
|
|
|
+ cAreaIndex:0,
|
|
|
+ examine:[]
|
|
|
};
|
|
|
},
|
|
|
onPullDownRefresh(){
|
|
@@ -208,6 +213,57 @@ export default {
|
|
|
} */
|
|
|
},
|
|
|
methods: {
|
|
|
+ getExamine(id) {
|
|
|
+ let self = this
|
|
|
+ this.$api.getExamine({projectId:id}).then(res => {
|
|
|
+ if(res.data.code==200){
|
|
|
+ self.examine = res.data.rows
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getCityList(id) {
|
|
|
+ let self = this
|
|
|
+ this.$api.getCityList({parentId:id}).then(res => {
|
|
|
+ if(res.data.code==200){
|
|
|
+ self.cityList = res.data.rows
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getProvinceList() {
|
|
|
+ let self = this
|
|
|
+ if(self.provinceList.length>0){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$api.getProvinceList().then(res => {
|
|
|
+ if(res.data.code==200){
|
|
|
+ self.provinceList = res.data.rows
|
|
|
+ if(self.provinceList.length>0){
|
|
|
+ self.getCityList(self.provinceList[0].areaId)
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ okPopup(index){
|
|
|
+ if(index==0){
|
|
|
+ if(this.gradeValue<0){
|
|
|
+ uni.showModal({
|
|
|
+ title: "提示",
|
|
|
+ content: '请选择班级',
|
|
|
+ showCancel: false
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.gradeIndex = this.gradeValue
|
|
|
+ console.log(this.gradeIndex)
|
|
|
+ this.show = false
|
|
|
+ }else{
|
|
|
+ this.show1 = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ radioGroupChange(e){
|
|
|
+ console.log(e);
|
|
|
+ },
|
|
|
goodsGradeList() {
|
|
|
let self = this
|
|
|
this.$api.goodsGradeList({goodsId:this.id}).then(res => {
|
|
@@ -217,6 +273,14 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
goBuy(){
|
|
|
+ if(this.gradeIndex<0){
|
|
|
+ uni.showModal({
|
|
|
+ title: "提示",
|
|
|
+ content: '请选择班级',
|
|
|
+ showCancel: false
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
this.$navTo.togo('/pages2/order/confirm_pay');
|
|
|
},
|
|
|
getDetail() {
|
|
@@ -224,11 +288,20 @@ export default {
|
|
|
this.$api.goodsDetail(this.id).then(res => {
|
|
|
if(res.data.code==200){
|
|
|
self.detail = res.data.data
|
|
|
+ self.getExamine(self.detail.projectId)
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
bindChange(e) {
|
|
|
const val = e.detail.value
|
|
|
+ if(this.pAreaIndex!=e.detail.value[0]){
|
|
|
+ this.pAreaIndex = e.detail.value[0]
|
|
|
+ this.getCityList(this.provinceList[this.pAreaIndex].areaId)
|
|
|
+ }
|
|
|
+ if(this.cAreaIndex!=e.detail.value[1]){
|
|
|
+ this.cAreaIndex = e.detail.value[1]
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
checkboxChange(e) {
|
|
|
//console.log(e);
|
|
@@ -249,6 +322,7 @@ export default {
|
|
|
this.goodsGradeList()
|
|
|
}else{
|
|
|
this.show1 = true
|
|
|
+ this.getProvinceList()
|
|
|
}
|
|
|
|
|
|
}
|