lex-xin 5 月之前
父節點
當前提交
de316b4755

+ 1 - 1
miniprogram/app.ts

@@ -73,7 +73,7 @@ App<IAppOption>({
           wx.removeStorageSync("token");
           this.globalData.isLogin = false
         }
-        console.log(users)
+        // console.log(users)
       } else {
         this.globalData.isLogin = false;
       }

+ 1 - 1
miniprogram/config.ts

@@ -1,4 +1,4 @@
-const environmentVariable = "test";
+const environmentVariable = "dev";
 const apiUrlInfo = {
   dev: "https://dev.kt.colexiu.com",
   test: "https://test.kt.colexiu.com",

+ 0 - 0
miniprogram/components/buyerInformation/images/icon-back.png → miniprogram/pages/index/buyerInformation/images/icon-back.png


+ 0 - 0
miniprogram/components/buyerInformation/index.json → miniprogram/pages/index/buyerInformation/index.json


+ 15 - 15
miniprogram/components/buyerInformation/index.less → miniprogram/pages/index/buyerInformation/index.less

@@ -48,23 +48,23 @@
     margin: 20rpx 0 18rpx 28rpx;
   }
 
-  
-    .van-cell {
-      padding: 28rpx;
-      font-size: 30rpx;
-      line-height: 42rpx;
-
-      .van-field__label {
-        font-weight: 600;
-        color: #666666;
-      }
 
-      .van-icon-arrow {
-        color: #CCCCCC;
-        font-weight: 600;
-      }
+  .van-cell {
+    padding: 28rpx !important;
+    font-size: 30rpx !important;
+    line-height: 42rpx;
+
+    .van-field__label {
+      font-weight: 600;
+      color: #666666;
     }
-  
+
+    .van-icon-arrow {
+      color: #CCCCCC;
+      font-weight: 600;
+    }
+  }
+
 
   .gender-section {
     display: flex;

+ 5 - 3
miniprogram/components/buyerInformation/index.ts → miniprogram/pages/index/buyerInformation/index.ts

@@ -1,6 +1,4 @@
-// components/buyerInformation/index.ts
 Component({
-
   /**
    * 组件的属性列表
    */
@@ -30,7 +28,11 @@ Component({
     regionCode: null,
     regionName: "",
   },
-
+  lifetimes: {
+    attached() {
+      // console.log(this.data, "data")
+    }
+  },
   /**
    * 组件的方法列表
    */

+ 2 - 2
miniprogram/components/buyerInformation/index.wxml → miniprogram/pages/index/buyerInformation/index.wxml

@@ -18,8 +18,8 @@
         </van-field>
 
         <van-field required label="所在地区" value="{{ provinceName ? provinceName + ' ' + cityName + ' ' + regionName : '' }}" bind:tap="onShowAreaList" placeholder="请选择地区" input-align="right" is-link readonly />
-        <van-field required model:value="{{ schoolAreaName }}" label="就读学校" placeholder="请选择学校" input-align="right" is-link readonly bind:tap="onSelectSchool" />
-        <van-field border="{{ false }}" value="{{ currentGradeClassTxt }}" required label="年级班级" placeholder="请选择年级" input-align="right" is-link readonly bind:tap="onSelectGradeClass" />
+        <!-- <van-field required model:value="{{ schoolAreaName }}" label="就读学校" placeholder="请选择学校" input-align="right" is-link readonly bind:tap="onSelectSchool" />
+        <van-field border="{{ false }}" value="{{ currentGradeClassTxt }}" required label="年级班级" placeholder="请选择年级" input-align="right" is-link readonly bind:tap="onSelectGradeClass" /> -->
       </view>
     </view>
   </view>

二進制
miniprogram/pages/index/images/icon-back.png


二進制
miniprogram/pages/index/images/icon-search.png


+ 6 - 1
miniprogram/pages/index/index.json

@@ -1,8 +1,13 @@
 {
   "usingComponents": {
     "navigation-bar": "/components/navigation-bar/navigation-bar",
-    "buyerInformation": "/components/buyerInformation/index",
     "van-popup": "@vant/weapp/popup/index",
+    "van-area": "@vant/weapp/area/index",
+    "van-picker": "@vant/weapp/picker/index",
+    "van-search": "@vant/weapp/search/index",
+    "van-field": "@vant/weapp/field/index",
+    "van-loading": "@vant/weapp/loading/index",
+    "van-action-sheet": "@vant/weapp/action-sheet/index",
     "service": "/components/service/service"
   }
 }

+ 300 - 23
miniprogram/pages/index/index.less

@@ -421,41 +421,44 @@ page {
 
 // 'demo-text-1', 'demo-text-2', 'demo-text-3'
 .popup-section {
-  max-height: 86vh;
-  overflow-x: hidden;
-  overflow-y: auto;
-
-  &.hidden {
-    display: none;
-  }
-
-  .popup-mask {
-    position: fixed;
-    top: 0;
-    left: 0;
-    right: 0;
-    bottom: 0;
-    background-color: rgba(0, 0, 0, 0.6);
-    z-index: 9;
-  }
+  // max-height: 86vh;
+  // overflow-x: hidden;
+  // overflow-y: auto;
+
+  // &.hidden {
+  //   display: none;
+  // }
+
+  // .popup-mask {
+  //   position: fixed;
+  //   top: 0;
+  //   left: 0;
+  //   right: 0;
+  //   bottom: 0;
+  //   background-color: rgba(0, 0, 0, 0.6);
+  //   z-index: 9;
+  // }
 
   .popup-container {
-    position: fixed;
-    bottom: 0;
-    left: 0;
-    right: 0;
-    z-index: 10;
+    // position: fixed;
+    // bottom: 0;
+    // left: 0;
+    // right: 0;
+    // z-index: 10;
     width: 100%;
     background: #FFFFFF;
     border-radius: 32rpx 32rpx 0rpx 0rpx;
     // padding: 40rpx 0 0;
     box-sizing: border-box;
+    max-height: 86vh;
+    display: flex;
+    flex-direction: column;
 
     .popup-scroll {
-      max-height: 66vh;
       overflow-x: hidden;
       overflow-y: scroll;
       border-radius: 32rpx 32rpx 0rpx 0rpx;
+      flex: 1 auto;
     }
 
     .top-vip-img {
@@ -641,6 +644,7 @@ page {
     color: #D2D2D2;
     padding: 0 12rpx;
   }
+
   .prices {
     display: flex;
     align-items: flex-end;
@@ -662,3 +666,276 @@ page {
     font-size: 36rpx;
   }
 }
+
+/* components/buyerInformation/index.wxss */
+.icon-close-pop {
+  position: absolute;
+  z-index: 2;
+  top: 28rpx;
+  left: 20rpx;
+  padding: 20rpx;
+  width: 36rpx;
+  height: 36rpx;
+}
+
+.container-pop {
+  background: linear-gradient(180deg, #FFDEE7 0%, #FFFFFF 12%, #FFFFFF 100%);
+  border-radius: 32rpx 32rpx 0rpx 0rpx;
+  height: 86vh;
+  display: flex;
+  flex-direction: column;
+}
+
+
+.pop-address-title {
+  position: relative;
+  z-index: 1;
+  text-align: center;
+  padding-top: 40rpx;
+  padding-bottom: 20rpx;
+  font-weight: 600;
+  font-size: 36rpx;
+  color: #131415;
+  line-height: 50rpx;
+}
+
+
+.section {
+  margin: 24rpx 0;
+  // background: linear-gradient(180deg, #E3F9FF 0%, #FFFFFF 9%, #FFFFFF 100%);
+  border-radius: 18rpx;
+  overflow-x: hidden;
+  overflow-y: auto;
+
+  flex: 1 auto;
+
+
+  .section-content {
+    // background: linear-gradient(180deg, #E3F9FF 0%, #FFFFFF 9%, #FFFFFF 100%);
+    border-radius: 12rpx;
+    overflow: hidden;
+  }
+
+  .section-title {
+    width: 236rpx;
+    height: 46rpx;
+    margin: 20rpx 0 18rpx 28rpx;
+  }
+
+
+  .van-cell {
+    padding: 40rpx !important;
+    font-size: 30rpx !important;
+    line-height: 42rpx;
+    background-color: transparent !important;
+
+    .van-field__label {
+      color: #666666;
+    }
+
+    .van-icon-arrow {
+      color: #BBBBBB;
+      // font-weight: 600;
+    }
+  }
+
+
+  // .gender-section {
+  //   display: flex;
+
+  //   .gender-item {
+  //     margin-left: 24rpx;
+  //     background: rgba(28, 172, 241, 0.11);
+  //     border-radius: 12rpx;
+  //     font-weight: 500;
+  //     font-size: 28rpx;
+  //     color: #1CACF1;
+  //     width: 104rpx;
+  //     line-height: 48rpx;
+  //     text-align: center;
+
+  //     &.active {
+  //       background: #1CACF1;
+  //       color: #FFFFFF;
+  //     }
+  //   }
+  // }
+}
+
+.pop-btn-group {
+  padding: 24rpx 32rpx 58rpx;
+
+  .submit-btn {
+    width: 100% !important;
+    margin: 0 !important;
+    padding: 0 !important;
+    line-height: 88rpx;
+    background: linear-gradient(270deg, #FF204B 0%, #FE5B71 100%);
+    border-radius: 88rpx;
+    font-weight: 500;
+    font-size: 32rpx;
+    color: #fff;
+  }
+}
+
+
+.van-picker__toolbar,
+.toolbar-top {
+  margin: 0 40rpx !important;
+  padding: 0 14rpx !important;
+  border-bottom: 2rpx solid #F2F2F2;
+  height: auto !important;
+  line-height: normal !important;
+}
+
+.van-picker__cancel,
+.van-picker__confirm,
+.toolbar-cancel,
+toolbar-confirm {
+  font-size: 32rpx !important;
+  padding: 28rpx 0 !important;
+  color: #777777 !important;
+}
+
+.van-picker__confirm,
+.toolbar-confirm {
+  color: #FE2451 !important;
+}
+
+.toolbar-top {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.select-school {
+  .van-cell {
+    padding: 32rpx 40rpx;
+    font-size: 32rpx;
+
+    .van-icon-arrow {
+      color: #BBBBBB;
+      // font-weight: 600;
+    }
+  }
+}
+
+.searchList {
+  .icon-search {
+    width: 32rpx;
+    height: 32rpx;
+    margin: auto 10rpx auto auto;
+  }
+
+  .van-search {
+    margin: 0 26rpx 0 !important;
+    padding: 0 !important;
+    height: 70rpx !important;
+    background: #F6F6F6 !important;
+    border-radius: 35rpx !important;
+    border: 1rpx solid #FFFFFF !important;
+  }
+
+  .van-search__content {
+    border-top-left-radius: 35rpx !important;
+    border-bottom-left-radius: 35rpx !important;
+  }
+
+  .van-cell {
+    font-size: 26rpx !important;
+  }
+
+  .searchBtn {
+    width: 112rpx;
+    line-height: 54rpx !important;
+    padding: 0 !important;
+    text-align: center;
+    background: linear-gradient(270deg, #FF204B 0%, #FE5B71 100%);
+    font-weight: 500;
+    font-size: 28rpx;
+    color: #FFFFFF;
+    line-height: 40rpx;
+    border-radius: 40rpx;
+    margin-right: 6rpx;
+  }
+}
+
+.van-action-sheet__description {
+  font-size: 32rpx !important;
+  color: #777777 !important;
+  line-height: 44rpx !important;
+  padding: 28 0rpx !important;
+  margin: 0 26rpx !important;
+}
+
+
+.one-gender,
+.two-gender {
+  font-weight: 600;
+  padding: 24rpx 0 !important;
+  font-size: 32rpx !important;
+  margin: 0 40rpx 16rpx !important;
+  width: calc(100% - 80rpx) !important;
+  color: #000000 !important;
+  line-height: 44rpx !important;
+}
+.one-gender {
+  margin-top: 24rpx !important;
+}
+.two-gender {
+  margin-bottom: 24rpx !important;
+}
+
+.van-action-sheet__gap {
+  height: 2rpx !important;
+  margin: 0 40rpx !important;
+}
+
+.cancel-gender {
+  font-weight: 400 !important;
+  color: #AAAAAA !important;
+}
+
+.van-picker-column__item--selected {
+  font-weight: 600;
+  font-size: 32rpx;
+  color: #000 !important;
+}
+
+.empty-box {
+  padding-top: 44rpx;
+  padding-bottom: 48rpx;
+  box-sizing: border-box;
+  text-align: center;
+  font-size: 32rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #999999;
+  position: relative;
+
+  .empty_loading {
+    align-items: center;
+    background-color: var(--picker-loading-mask-color, hsla(0, 0%, 100%, .9));
+    bottom: 0;
+    display: flex;
+    justify-content: center;
+    left: 0;
+    position: absolute;
+    right: 0;
+    top: 0;
+    z-index: 4;
+  }
+
+  image {
+    width: 364rpx;
+    height: 190rpx;
+  }
+
+  .empty-text {
+    font-size: 28rpx;
+    color: #777777;
+    line-height: 40rpx;
+    text-align: center;
+    padding-top: 36rpx;
+  }
+}

+ 737 - 17
miniprogram/pages/index/index.ts

@@ -1,7 +1,44 @@
 // index.ts
 
 import { api_shopInstruments, api_shopProduct } from "../../api/login";
-import { debounce, formatPrice } from '../../utils/util'
+import { api_schoolAreaDetail, api_schoolAreaList, api_sysAreaQueryAllProvince, api_userBeneficiarySave, api_userBeneficiaryUpdate } from "../../api/new";
+import { debounce, formatPrice, GRADE_ENUM } from '../../utils/util'
+
+const classList: any = [];
+for (let i = 1; i <= 40; i++) {
+  classList.push({ text: i + '班', value: i });
+}
+
+/** 获取年级 */
+const getGradeList = (gradeYear?: string, instrumentCode?: string) => {
+  let tempList: any = [];
+  const five = [
+    { text: '一年级', value: 1, instrumentCode },
+    { text: '二年级', value: 2, instrumentCode },
+    { text: '三年级', value: 3, instrumentCode },
+    { text: '四年级', value: 4, instrumentCode },
+    { text: '五年级', value: 5, instrumentCode }
+  ];
+  const one = [{ text: '六年级', value: 6, instrumentCode }];
+  const three = [
+    { text: '七年级', value: 7, instrumentCode },
+    { text: '八年级', value: 8, instrumentCode },
+    { text: '九年级', value: 9, instrumentCode }
+  ];
+  if (gradeYear === 'FIVE_YEAR_SYSTEM') {
+    tempList.push(...[...five]);
+  } else if (gradeYear === 'SIX_YEAR_SYSTEM') {
+    tempList.push(...[...five, ...one]);
+  } else if (gradeYear === 'THREE_YEAR_SYSTEM') {
+    tempList.push(...[...three]);
+  } else if (gradeYear === 'FORE_YEAR_SYSTEM') {
+    tempList.push(...[...one, ...three]);
+  } else {
+    tempList.push(...[...five, ...one, ...three]);
+  }
+  return tempList;
+};
+
 
 // 获取应用实例
 const app = getApp<IAppOption>()
@@ -55,14 +92,72 @@ Page({
     } as any, // 格式化所有选中的数据
     showService: false,
     isFromPreviewImage: false,
-    showBuyer: true, // 收益人
+    showBuyer: false, // 收益人
+
+    phone: '',
+    name: '',
+    gender: '',
+    schoolAreaId: '',
+    schoolAreaName: '',
+    currentClassTxt: '', // 班级
+    currentClass: null,
+    currentGradeTxt: '', // 年级
+    currentGradeNum: null,
+    cityCode: null,
+    cityName: "",
+    provinceCode: null,
+    provinceName: "",
+    regionCode: null,
+    regionName: "",
+
+    showGender: false,
+    genderList: [{
+      name: '男',
+      value: '1',
+      className: 'one-gender cancel-gender'
+    }, {
+      name: '女',
+      value: '0',
+      className: 'two-gender cancel-gender'
+    }],
+    userBeneficiaryId: '', // 选中用户的编号
+    userBeneficiaryInfo: {
+      name: '',
+      phoneNumber: '',
+      schoolInfo: ''
+    },
+    showArea: false,
+    areaList: [] as any,
+    showSchool: false,
+    showSchoolAfterLeave: false, // 离开后
+    /** 学校列表 */
+    schoolAreaList: [] as any,
+    schoolAreaIndex: 0,
+    /** 临时切换时选择的学校编号 */
+    tempChangeSchoolAreaId: '',
+    schoolLoading: false,
+    /** 搜索学校 */
+    searchName: '',
+    /** 学校类型 */
+    schoolInstrumentSetType: '',
+    /** 年级 */
+    gradeGradeList: [] as any,
+    gradeGradeIndex: 0,
+    showGradeClass: false,
+    showGradeClassAfterLeave: false, // 离开后
+    /** 班级 */
+    classList: [] as any,
+    classIndex: 0,
+    showClass: false,
+    showClassAfterLeave: false, // 离开后
+    buyerLoading: false,
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad() {
-    this.onInit()
+    // this.onInit()
   },
   /**
    * 获取基础信息
@@ -71,7 +166,7 @@ Page({
     try {
       const result = await api_shopInstruments({ appId: app.globalData.appId })
       const instrumentList = result.data.data || []
-      instrumentList.forEach((item: any) => {
+      instrumentList?.forEach((item: any) => {
         item.showSalePrice = formatPrice(item.salePrice || 0, 'ALL')
       })
       const { data } = await api_shopProduct({ appId: app.globalData.appId });
@@ -100,7 +195,7 @@ Page({
         }
 
         // 获取最小金额
-        if(smallGoods?.salePrice) {
+        if (smallGoods?.salePrice) {
           smallGoods = smallGoods.salePrice <= item.salePrice ? smallGoods : item
         } else {
           smallGoods = item
@@ -284,15 +379,49 @@ Page({
   onSubmit() {
     // 判断是否登录
     const that = this
+    if (!this.data.userBeneficiaryId) {
+      wx.showToast({
+        title: '请填写享用者信息',
+        icon: 'none'
+      })
+      return
+    }
     debounce(function () {
       if (!that.isLogin()) {
         return
       }
+      const params = [] as any
+      const selected = that.data.selected
+      if (selected.id) {
+        params.push({
+          pic: selected.pic,
+          name: selected.name,
+          originalPrice: selected.originalPrice,
+          salePrice: selected.salePrice,
+          shopId: selected.shopId,
+          id: selected.id,
+          goodsType: 'ACTIVATION_CODE', // INSTRUMENTS
+        })
+      }
+      const selectedInstrument = that.data.selectedInstrument
+      if (selectedInstrument.id) {
+        params.push({
+          pic: selectedInstrument.pic,
+          name: selectedInstrument.name,
+          originalPrice: selectedInstrument.originalPrice,
+          salePrice: selectedInstrument.salePrice,
+          shopId: selectedInstrument.shopId,
+          id: selectedInstrument.id,
+          goodsType: 'INSTRUMENTS', // INSTRUMENTS
+        })
+      }
+
       let info = JSON.stringify({
-        ...that.data.selected
+        ...params
       });
-      // console.log(that.data.selected, "that.data.selected")
       info = encodeURIComponent(info);
+
+      console.log(params, "params")
       wx.navigateTo({
         url: `../orders/order-detail?orderInfo=${info}`,
         success: () => {
@@ -303,16 +432,6 @@ Page({
       })
     }, 500)()
   },
-  onSelectBuyer() {
-    this.setData({
-      showBuyer: true
-    })
-  },
-  onCloseBuyer(e: {detail: any}) {
-    this.setData({
-      showBuyer: e.detail
-    })
-  },
   onPreivewBannerImg(e: { currentTarget: { dataset: any } }) {
     wx.previewImage({
       current: e.currentTarget.dataset.src,
@@ -371,5 +490,606 @@ Page({
       path: '/pages/index/index',
       imageUrl: 'https://oss.dayaedu.com/ktyq/1733312164991.png'
     }
+  },
+
+
+  onSelectBuyer() {
+    // 从缓存里面获取用户信息
+    this.getUserDetail()
+    if (this.data.areaList.length <= 0) {
+      this.getAreas()
+    }
+    this.getSchools()
+    this.setData({
+      showBuyer: true
+    })
+  },
+  onCloseBuyer() {
+    this.setData({
+      showBuyer: false
+    }, () => {
+      if(!this.data.userBeneficiaryId) {
+        this.onSetCatch(this.data)
+      }
+    })
+  },
+  async getUserDetail() {
+    try {
+      // const { data } = await api_userBeneficiaryDetail({
+      //   id: this.data.userBeneficiaryId
+      // })
+      // console.log(data, 'data')
+      const information = wx.getStorageSync('buyerInfomation')
+      const users = information ? JSON.parse(information) : null
+      if (users) {
+        this.setData({
+          phone: users.phone,
+          name: users.name,
+          gender: users.gender,
+          schoolAreaId: users.schoolAreaId,
+          schoolAreaName: users.schoolAreaName,
+          currentGradeTxt: users.currentGradeTxt,
+          currentClass: users.currentClass,
+          currentClassTxt: users.currentClassTxt,
+          currentGradeNum: users.currentGradeNum,
+          cityCode: users.cityCode,
+          cityName: users.cityName,
+          provinceCode: users.provinceCode,
+          provinceName: users.provinceName,
+          regionCode: users.regionCode,
+          regionName: users.regionName,
+          schoolAreaIndex: users.schoolAreaIndex,
+          gradeGradeIndex: users.gradeGradeIndex,
+          classIndex: users.classIndex
+        }, () => {
+          this.getSchoolAreaDetail()
+        })
+      }
+    } catch {
+      // 
+    }
+  },
+  /** 获取省市区 */
+  async getAreas() {
+    try {
+      const { data } = await api_sysAreaQueryAllProvince({})
+      this.setData({
+        areaList: this.formateArea(data.data)
+      })
+    } catch {
+      // 
+    }
+  },
+  formateArea(area: any[]) {
+    const province_list: { [_: string]: string } = {};
+    const city_list: { [_: string]: string } = {};
+    const county_list: { [_: string]: string } = {};
+    area.forEach((item: any) => {
+      province_list[item.code] = item.name;
+    });
+    area.forEach((item: any) => {
+      item.areas && item.areas.forEach((city: any) => {
+        city_list[city.code] = city.name;
+      });
+    });
+    area.forEach((item: any) => {
+      item.areas && item.areas.forEach((city: any) => {
+        city.areas && city.areas.forEach((county: any) => {
+          county_list[county.code] = county.name;
+        });
+      });
+    });
+    return {
+      province_list,
+      city_list,
+      county_list
+    };
+  },
+  /** 获取学校列表 */
+  async getSchools(name?: string) {
+    this.setData({
+      schoolLoading: true
+    })
+    try {
+      // 判断是否有地区信息
+      if (!this.data.provinceCode || !this.data.cityCode || !this.data.regionCode) {
+        return
+      }
+      const { data } = await api_schoolAreaList({
+        name,
+        testFlag: true,
+        provinceCode: this.data.provinceCode,
+        cityCode: this.data.cityCode,
+        regionCode: this.data.regionCode
+      })
+      const result = data.data || []
+      const tempList: any[] = []
+      result.forEach((item: any) => {
+        tempList.push({
+          text: item.name,
+          value: item.id
+        })
+      })
+
+      let tempSchoolId = ''
+      if (tempList.length > 0) {
+        const first = tempList[0]
+        tempSchoolId = first.value || ''
+      }
+
+      this.setData({
+        schoolAreaList: tempList,
+        tempChangeSchoolAreaId: tempSchoolId
+      })
+    } catch {
+      // 
+    }
+    this.setData({
+      schoolLoading: false
+    })
+  },
+  onCheckedGender() {
+    this.setData({
+      showGender: true
+    })
+  },
+  onCloseGender() {
+    this.setData({
+      showGender: false,
+    })
+  },
+  onSelectGender(e: any) {
+    const genderList = this.data.genderList
+    const gender = e.detail.value
+    genderList.forEach((item: any, index: number) => {
+      if (item.value === gender) {
+        item.className = index === 0 ? 'one-gender select-gender' : 'two-gender select-gender'
+      } else {
+        item.className = index === 0 ? 'one-gender cancel-gender' : 'two-gender cancel-gender'
+      }
+    })
+    console.log(e, genderList, gender, '1212')
+    this.setData({
+      gender,
+      genderList
+    })
+  },
+  /** 获取学校详情 */
+  async getSchoolAreaDetail() {
+    if(!this.data.schoolAreaId) return
+    const { data } = await api_schoolAreaDetail({ id: this.data.schoolAreaId })
+    const result = data.data || {}
+    if (result.school) {
+      const schoolInfo = result.school || {};
+      const schoolInstrumentList = schoolInfo.schoolInstrumentList || [];
+      // forms.schoolInstrumentSetType = schoolInfo.instrumentSetType;
+      if (schoolInfo.instrumentSetType === 'SCHOOL') {
+        this.setData({
+          gradeGradeList: getGradeList(schoolInfo.gradeYear),
+          classList: classList,
+          schoolInstrumentSetType: schoolInfo.instrumentSetType
+        })
+      } else if (schoolInfo.instrumentSetType === 'GRADE') {
+        const gradeList: any = []
+        schoolInstrumentList.forEach((item: any) => {
+          gradeList.push({
+            text: GRADE_ENUM[item.gradeNum],
+            value: item.gradeNum,
+            instrumentId: item.instrumentId
+          })
+        });
+        gradeList.sort((a: any, b: any) => a.value - b.value);
+        this.setData({
+          gradeGradeList: gradeList,
+          classList: classList,
+          schoolInstrumentSetType: schoolInfo.instrumentSetType
+        })
+      } else if (schoolInfo.instrumentSetType === 'CLASS') {
+        //   // 班级
+        const tempGradeList: any[] = [];
+        schoolInstrumentList.forEach((item: any) => {
+          if (!tempGradeList.includes(item.gradeNum)) {
+            tempGradeList.push(item.gradeNum);
+          }
+        });
+
+        const lastGradeList: any[] = [];
+        tempGradeList.forEach((temp: any) => {
+          const list = {
+            text: GRADE_ENUM[temp],
+            value: temp,
+            instrumentId: '',
+            instrumentCode: '',
+            instrumentName: '',
+            classList: [] as any
+          };
+          schoolInstrumentList.forEach((item: any) => {
+            if (temp === item.gradeNum) {
+              list.instrumentId = item.instrumentId;
+              list.instrumentCode = item.instrumentCode;
+              list.instrumentName = item.instrumentName;
+              list.classList.push({
+                text: item.classNum + '班',
+                value: item.classNum,
+                instrumentCode: item.instrumentCode
+              });
+            }
+          });
+          // 排序班级
+          list.classList.sort((a: any, b: any) => a.value - b.value);
+          lastGradeList.push(list);
+        });
+        lastGradeList.sort((a: any, b: any) => a.value - b.value);
+
+        this.setData({
+          gradeGradeList: lastGradeList,
+          classList: lastGradeList[this.data.gradeGradeIndex]?.classList || [],
+          schoolInstrumentSetType: schoolInfo.instrumentSetType
+        })
+      } else {
+        this.setData({
+          gradeGradeList: getGradeList(),
+          classList: classList,
+          schoolInstrumentSetType: ''
+        })
+      }
+    } else {
+      this.setData({
+        gradeGradeList: getGradeList(),
+        classList: classList,
+        schoolInstrumentSetType: ''
+      })
+    }
+  },
+  /** 选择男女 */
+  onCheckGender(e: any) {
+    const { dataset } = e.target
+    this.setData({
+      gender: dataset.gender
+    })
+  },
+  /** 显示选择地区 */
+  onShowAreaList() {
+    this.setData({
+      showArea: true
+    })
+  },
+  /** 关闭选择地区 */
+  onCloseAreaList() {
+    this.setData({
+      showArea: false
+    })
+  },
+  /** 确定选择地区 */
+  submitArea(e: any) {
+    const selectedOptions: any = e.detail.values
+    this.setData({
+      provinceCode: selectedOptions[0].code,
+      cityCode: selectedOptions[1].code,
+      regionCode: selectedOptions[2].code,
+      provinceName: selectedOptions[0].name,
+      cityName: selectedOptions[1].name,
+      regionName: selectedOptions[2].name,
+      showArea: false,
+
+      searchName: '',
+      schoolAreaId: '',
+      schoolAreaName: '',
+      schoolAreaIndex: 0,
+      currentGradeNum: null,
+      currentGradeTxt: '',
+      gradeGradeIndex: 0,
+      currentClass: null,
+      currentClassTxt: '',
+      classIndex: 0
+    }, () => {
+      this.getSchools()
+    })
+  },
+  /** 关闭选择学校 */
+  onCloseSchool() {
+    this.setData({
+      showSchool: false
+    })
+  },
+  /** 选择学校关闭后 */
+  onSchoolAfterLeave() {
+    this.setData({
+      showSchoolAfterLeave: true
+    })
+  },
+  /** 选择学校打开前 */
+  onSchoolBeforeEnter() {
+    this.setData({
+      showSchoolAfterLeave: false
+    })
+  },
+  /** 选择学校 */
+  onSelectSchool() {
+    if (!this.data.provinceName) {
+      wx.showToast({
+        title: '请选择地区',
+        icon: 'none'
+      })
+      return
+    }
+    this.setData({
+      showSchool: true
+    })
+  },
+  /** 确定选择学校 */
+  onSubmitSchool() {
+    const detail = this.data.schoolAreaList.find((item: any) => item.value === this.data.tempChangeSchoolAreaId)
+    const detailIndex = this.data.schoolAreaList.findIndex((item: any) => item.value === this.data.tempChangeSchoolAreaId)
+    // console.log(detail, detailIndex, this.data.tempChangeSchoolAreaId)
+    if (detailIndex === -1) return
+    this.setData({
+      schoolAreaName: detail.text,
+      schoolAreaId: detail.value,
+      schoolAreaIndex: detailIndex,
+      showSchool: false,
+
+      currentGradeNum: null,
+      currentGradeTxt: '',
+      gradeGradeIndex: 0,
+      currentClass: null,
+      currentClassTxt: '',
+      classIndex: 0
+    }, () => {
+      this.getSchoolAreaDetail()
+    })
+  },
+  onChangeSchool(e: any) {
+    const { value } = e.detail.value
+    this.setData({
+      tempChangeSchoolAreaId: value
+    })
+  },
+  onSearch() {
+    this.setData({
+      schoolAreaIndex: 0
+    }, () => {
+      this.getSchools(this.data.searchName);
+    })
+  },
+  onSearchChange(e: any) {
+    this.setData({
+      searchName: e.detail
+    })
+  },
+  /** 选择年级班级 */
+  onSelectGradeClass() {
+    if (!this.data.schoolAreaId) {
+      wx.showToast({
+        title: '请选择学校',
+        icon: 'none'
+      })
+      return
+    }
+    this.setData({
+      showGradeClass: true
+    })
+  },
+  /** 年级班级 */
+  onCloseGradeClass() {
+    this.setData({
+      showGradeClass: false
+    })
+  },
+  onGradeClassBeforeEnter() {
+    this.setData({
+      showGradeClassAfterLeave: false
+    })
+  },
+  onGradeClassAfterLeave() {
+    this.setData({
+      showGradeClassAfterLeave: true
+    })
+  },
+  /** 确认选择年级班级 */
+  onSubmitGradeClass(e: any) {
+    const selectedOptions: any = e.detail.value
+    const selectedIndexs: any = e.detail.index
+    if (this.data.schoolInstrumentSetType === "CLASS") {
+      const gradeDetail = this.data.gradeGradeList;
+      const classList = gradeDetail?.find((item: any) => item.value === selectedOptions.value)
+      console.log(classList, "classList")
+      if (classList) {
+        this.setData({
+          classIndex: 0,
+          classList: classList.classList
+        })
+      }
+    }
+    this.setData({
+      currentGradeTxt: selectedOptions.text,
+      currentGradeNum: selectedOptions.value,
+      gradeGradeIndex: selectedIndexs,
+      showGradeClass: false,
+
+      currentClass: null,
+      currentClassTxt: ''
+    })
+  },
+
+  /** 选择班级 */
+  onSelectClass() {
+    if (!this.data.schoolAreaId) {
+      wx.showToast({
+        title: '请选择所在年级',
+        icon: 'none'
+      })
+      return
+    }
+    this.setData({
+      showClass: true
+    })
+  },
+  /** 班级 */
+  onCloseClass() {
+    this.setData({
+      showClass: false
+    })
+  },
+  onClassBeforeEnter() {
+    this.setData({
+      showClassAfterLeave: false
+    })
+  },
+  onClassAfterLeave() {
+    this.setData({
+      showClassAfterLeave: true
+    })
+  },
+  /** 确认选择班级 */
+  onSubmitClass(e: any) {
+    const selectedOptions: any = e.detail.value
+    const selectedIndexs: any = e.detail.index
+    this.setData({
+      currentClassTxt: selectedOptions.text,
+      currentClass: selectedOptions.value,
+      classIndex: selectedIndexs,
+      showClass: false
+    })
+  },
+
+  /** 最终提交 */
+  async onSubmitBuyer() {
+    try {
+      const params = this.data
+      if (!params.name) {
+        wx.showToast({
+          title: '请填写享用者姓名',
+          icon: "none"
+        })
+        return
+      }
+
+      if (!params.phone || !/^1[3456789]\d{9}$/.test(params.phone)) {
+        wx.showToast({
+          title: '请填写正确的电话号码',
+          icon: "none"
+        })
+        return
+      }
+
+      if(!params.gender) {
+        wx.showToast({
+          title: '请选择性别',
+          icon: 'none'
+        })
+        return
+      }
+
+      if (!params.provinceCode || !params.cityCode || !params.regionCode) {
+        wx.showToast({
+          title: '请选择学校地区',
+          icon: "none"
+        })
+        return
+      }
+
+      if (!params.schoolAreaId) {
+        wx.showToast({
+          title: '请选择所在学校',
+          icon: "none"
+        })
+        return
+      }
+
+      if (!params.currentGradeNum) {
+        wx.showToast({
+          title: '请选择所在年级',
+          icon: "none"
+        })
+        return
+      }
+
+      if (!params.currentClass) {
+        wx.showToast({
+          title: '请选择所在班级',
+          icon: "none"
+        })
+        return
+      }
+
+      const objs = {
+        phone: params.phone,
+        name: params.name,
+        gender: params.gender,
+        currentGradeNum: params.currentGradeNum,
+        currentClass: params.currentClass,
+        schoolAreaId: params.schoolAreaId,
+        defaultStatus: false
+      }
+      const userBeneficiary = {
+        name: params.name,
+        phoneNumber: params.phone,
+        schoolInfo: params.schoolAreaName + params.currentGradeTxt + params.currentClassTxt
+      }
+      let userBeneficiaryId = ''
+      this.setData({
+        buyerLoading: true
+      })
+      if (params.userBeneficiaryId) {
+        const { data } = await api_userBeneficiaryUpdate({
+          id: params.userBeneficiaryId,
+          ...objs
+        })
+
+        wx.showToast({
+          title: '保存成功',
+          icon: 'none'
+        })
+        userBeneficiaryId = data.data.id
+      } else {
+        const { data } = await api_userBeneficiarySave({
+          ...objs
+        })
+
+        wx.showToast({
+          title: '保存成功',
+          icon: 'none'
+        })
+        userBeneficiaryId = data.data.id
+      }
+
+      this.setData({
+        userBeneficiaryId,
+        userBeneficiaryInfo: userBeneficiary
+      })
+
+      this.onSetCatch(params)
+      this.onCloseBuyer()
+    } catch {
+      //
+    }
+
+    this.setData({
+      buyerLoading: false
+    })
+  },
+  /** 设置缓存 */
+  onSetCatch(params: any) {
+    wx.setStorageSync('buyerInfomation', JSON.stringify({
+      phone: params.phone,
+      name: params.name,
+      gender: params.gender,
+      schoolAreaId: params.schoolAreaId,
+      schoolAreaName: params.schoolAreaName,
+      currentGradeTxt: params.currentGradeTxt,
+      currentClass: params.currentClass,
+      currentClassTxt: params.currentClassTxt,
+      currentGradeNum: params.currentGradeNum,
+      cityCode: params.cityCode,
+      cityName: params.cityName,
+      provinceCode: params.provinceCode,
+      provinceName: params.provinceName,
+      regionCode: params.regionCode,
+      regionName: params.regionName,
+      schoolAreaIndex: params.schoolAreaIndex,
+      gradeGradeIndex: params.gradeGradeIndex,
+      classIndex: params.classIndex
+    }))
   }
 })

+ 129 - 51
miniprogram/pages/index/index.wxml

@@ -88,75 +88,153 @@
             </view> -->
           </view>
 
-          <view class="popup-section" wx:if="{{popupShow}}">
-            <view class="popup-mask" bind:tap="onClose"></view>
-            <view class="popup-container">
-              <image bind:tap="onClose" src="./images/icon-close-1.png" class="iconClose"></image>
-              <view class="popup-scroll">
-                <image src="https://oss.dayaedu.com/ktyq/1739242193106.png" mode="widthFix" class="top-vip-img"></image>
-                <!-- 添加权益人 -->
-                <view class="addBuyer">
-                  <view class="addBuyer-left" bind:tap="onSelectBuyer">
-                    <image src="./images/icon-man.png" class="icon-man"></image>
-                    <view class="info">
-                      <view class="users">
-                        <text>请填写享用者的个人信息</text>
-                        <!-- <text>15527282726</text> -->
+
+          <van-popup show="{{ popupShow }}" safe-area-inset-bottom="{{false}}" lock-scroll="{{true}}" bind:close="onClose" position="bottom" round z-index="101">
+            <view class="popup-section" >
+            <!-- wx:if="{{popupShow}}" -->
+              <!-- <view class="popup-mask" bind:tap="onClose"></view> -->
+              <view class="popup-container">
+                <image bind:tap="onClose" src="./images/icon-close-1.png" class="iconClose"></image>
+                <view class="popup-scroll">
+                  <image src="https://oss.dayaedu.com/ktyq/1739242193106.png" mode="widthFix" class="top-vip-img"></image>
+                  <!-- 添加权益人 -->
+                  <view class="addBuyer" bind:tap="onSelectBuyer">
+                    <view class="addBuyer-left">
+                      <image src="./images/icon-man.png" class="icon-man"></image>
+                      <view class="info" wx:if="{{ userBeneficiaryId }}">
+                        <view class="users">
+                          <text>{{ userBeneficiaryInfo.name }}</text>
+                          <text>{{ userBeneficiaryInfo.phoneNumber }}</text>
+                        </view>
+                        <view class="address">{{ userBeneficiaryInfo.schoolInfo }}</view>
+                      </view>
+                      <view class="info" wx:else>
+                        <view class="users">
+                          <text>请填写享用者的个人信息</text>
+                        </view>
                       </view>
-                      <!-- <view class="address">武汉市洪山区第二十一小学一年级3班</view> -->
                     </view>
+                    <image src="./images/icon-arrow-right.png" class="arrow-right"></image>
                   </view>
-                  <image src="./images/icon-arrow-right.png" class="arrow-right"></image>
-                </view>
 
-                <view class="goodsInfo">
-                  <view class="desc">会员有效期</view>
-                  <view class="goodsList">
-                    <view wx:for="{{ list }}" wx:key="index" class="goodsItem {{ item.id == selected.id ? 'selected' : '' }} {{ item.stockNum <= 0 ? 'nosale' : '' }}" bind:tap="onSelectGoods" data-id="{{ item.id }}">{{ item.typeName }}
-                      <image wx:if="{{ item.stockNum <= 0 }}" src="./images/nosale.png"></image>
+                  <view class="goodsInfo">
+                    <view class="desc">会员有效期</view>
+                    <view class="goodsList">
+                      <view wx:for="{{ list }}" wx:key="index" class="goodsItem {{ item.id == selected.id ? 'selected' : '' }} {{ item.stockNum <= 0 ? 'nosale' : '' }}" bind:tap="onSelectGoods" data-id="{{ item.id }}">{{ item.typeName }}
+                        <image wx:if="{{ item.stockNum <= 0 }}" src="./images/nosale.png"></image>
+                      </view>
                     </view>
                   </view>
-                </view>
 
-                <view class="goodsInfo">
-                  <view class="desc">乐器搭配<text>(非必选)</text></view>
-                  <view class="goodsList">
-                    <view wx:for="{{ instrumentList }}" wx:key="index" class="goodsItem {{ item.id == selectInstrumentId ? 'selected' : '' }}" bind:tap="onSelectInstrument" data-id="{{ item.id }}">
-                      {{ item.name }} <text>¥{{ item.showSalePrice }}</text>
+                  <view class="goodsInfo">
+                    <view class="desc">乐器搭配<text>(非必选)</text></view>
+                    <view class="goodsList">
+                      <view wx:for="{{ instrumentList }}" wx:key="index" class="goodsItem {{ item.id == selectInstrumentId ? 'selected' : '' }}" bind:tap="onSelectInstrument" data-id="{{ item.id }}">
+                        {{ item.name }} <text>¥{{ item.showSalePrice }}</text>
+                      </view>
                     </view>
                   </view>
                 </view>
-              </view>
-              <view class="popupBottom">
-                <!-- 有选择商品的时候 -->
-                <view class="current-item" wx:if="{{!isOverSaled && selected.id}}">
-                  <!-- <view class="current-item-text">您已选择:</view> -->
-                  <view class="current-top">
-                    共计 <view class="prices"><text class="stuff">¥</text>
-                      <text class="priceZ">{{ formatSelectGood.integerPart || 0 }}</text>
-                      <text class="priceF">.{{ formatSelectGood.decimalPart || '00' }}</text>
+                <view class="popupBottom">
+                  <!-- 有选择商品的时候 -->
+                  <view class="current-item" wx:if="{{!isOverSaled && selected.id}}">
+                    <!-- <view class="current-item-text">您已选择:</view> -->
+                    <view class="current-top">
+                      共计 <view class="prices"><text class="stuff">¥</text>
+                        <text class="priceZ">{{ formatSelectGood.integerPart || 0 }}</text>
+                        <text class="priceF">.{{ formatSelectGood.decimalPart || '00' }}</text>
+                      </view>
+                      <text class="line">|</text>原价 ¥ {{ formatSelectGood.originalPrice }}
+                      <block wx:if="{{ formatSelectGood.originalPrice > formatSelectGood.salePrice }}">
+                        <text class="line">|</text>
+                        <text>优惠 ¥ {{ formatSelectGood.discountPrice }}</text>
+                      </block>
                     </view>
-                    <text class="line">|</text>原价 ¥ {{ formatSelectGood.originalPrice }}
-                    <block wx:if="{{ formatSelectGood.originalPrice > formatSelectGood.salePrice }}">
-                      <text class="line">|</text>
-                      <text>优惠 ¥ {{ formatSelectGood.discountPrice }}</text>
-                    </block>
-                  </view>
 
-                  <view class="current-select-text">已选:{{ formatSelectGood.typeName }}</view>
-                </view>
-                <view class="btnGroup">
-                  <button type="primary" catch:tap="onSubmit">立即享受专属权益</button>
+                    <view class="current-select-text">已选:{{ formatSelectGood.typeName }}</view>
+                  </view>
+                  <view class="btnGroup">
+                    <button type="primary" catch:tap="onSubmit">立即享受专属权益</button>
+                  </view>
                 </view>
               </view>
             </view>
-          </view>
+          </van-popup>
+
         </view>
 
         <!-- <service popShow="{{ showService }}" bind:changePop="changePop"></service> -->
-        <!-- <buyerInformation show="{{ popShow }}" bind:cancel="onCloseBuyer" /> -->
-        <van-popup show="{{ popShow }}" safe-area-inset-bottom="{{false}}" lock-scroll="{{true}}" bind:close="onCloseBuyer" position="bottom" round z-index="101">
-          12121212
+        <!-- <buyerInformation popShow="{{ showBuyer }}" bind:cancel="onCloseBuyer" /> -->
+        <van-popup show="{{ showBuyer }}" safe-area-inset-bottom="{{false}}" lock-scroll="{{true}}" bind:close="onCloseBuyer" position="bottom" round z-index="101">
+          <image src="./images/icon-back.png" class="icon-close-pop" bind:tap="onCloseBuyer" />
+          <view class="container-pop">
+            <view class="pop-address-title">享用者信息</view>
+            <view class="section">
+              <view class="section-content">
+                <van-field label="姓名" model:value="{{ name }}" placeholder="请填写享用者姓名" />
+                <van-field label="电话号码" model:value="{{ phone }}" maxlength="11" type="number" placeholder="请填写电话号码" />
+                <van-field label="性别" placeholder="请选择性别" value="{{ gender ? (gender === '1' ? '男' : '女') : '' }}" is-link readonly bind:tap="onCheckedGender"></van-field>
+
+                <van-field label="学校地区" value="{{ provinceName ? provinceName + ' ' + cityName + ' ' + regionName : '' }}" bind:tap="onShowAreaList" placeholder="请选择学校地区" is-link readonly />
+
+                <van-field model:value="{{ schoolAreaName }}" label="所在学校" placeholder="请选择所在学校" is-link readonly bind:tap="onSelectSchool" />
+                <van-field value="{{ currentGradeTxt }}" label="所在年级" placeholder="请选择所在年级" is-link readonly bind:tap="onSelectGradeClass" />
+                <van-field value="{{ currentClassTxt }}" label="所在班级" placeholder="请选择所在年级" is-link readonly bind:tap="onSelectClass" />
+              </view>
+            </view>
+
+            <view class="pop-btn-group">
+              <button disabled="{{ buyerLoading }}" class="submit-btn" bind:tap="onSubmitBuyer">保存信息</button>
+            </view>
+          </view>
+
+
+        </van-popup>
+
+        <!-- 性别 -->
+        <van-action-sheet z-index="103" show="{{ showGender }}" actions="{{ genderList }}" description="选择性别" cancel-text="取消" bind:close="onCloseGender" bind:select="onSelectGender" />
+
+        <!-- 地区 -->
+        <van-popup round="{{true}}" lock-scroll="{{true}}" z-index="{{103}}" show="{{showArea}}" position="bottom" safe-area-inset-bottom="{{false}}" bind:close="onCloseAreaList">
+          <van-area id='area1' areaList="{{areaList}}" visible-item-count="8" item-height="46" value="{{ regionCode }}" bind:cancel="onCloseAreaList" bind:confirm="submitArea" />
+        </van-popup>
+
+        <!-- 学校 -->
+        <van-popup round="{{true}}" lock-scroll="{{true}}" z-index="{{102}}" show="{{showSchool}}" position="bottom" safe-area-inset-bottom="{{false}}" bind:close="onCloseSchool" bind:after-leave="onSchoolAfterLeave" bind:before-enter="onSchoolBeforeEnter">
+          <view class="toolbar-top">
+            <view class="toolbar-cancel" bind:tap="onCloseSchool">取消</view>
+            <view class="toolbar-confirm" bind:tap="onSubmitSchool">确认</view>
+          </view>
+          <view class="select-school">
+            <van-field border="false" value="{{ provinceName ? provinceName + ' ' + cityName + ' ' + regionName : '' }}" bind:tap="onShowAreaList" placeholder="请选择学校地区" is-link readonly />
+          </view>
+          <view class="searchList" wx:if="{{ !showSchoolAfterLeave }}">
+            <van-search value="{{ searchName }}" use-left-icon-slot use-action-slot show-action custom-class="searchInput" placeholder="请输入学校名称关键词" bind:search="onSearch" bind:clear="onSearch" bind:change="onSearchChange">
+              <image slot="left-icon" src="./images/icon-search.png" class="icon-search" />
+              <view slot="action" class="searchBtn" bind:tap="onSearch">搜索</view>
+            </van-search>
+          </view>
+          <van-picker loading="{{ schoolLoading }}" wx:if="{{ !showSchoolAfterLeave && schoolAreaList.length > 0 }}" columns="{{ schoolAreaList }}" bind:change="onChangeSchool" visible-item-count="6" default-index="{{ schoolAreaIndex }}">
+          </van-picker>
+          <view class="empty-box" wx:if="{{ schoolAreaList.length <= 0 }}">
+            <view class="empty_loading" wx:if="{{ schoolLoading }}">
+              <van-loading color="#1989fa" />
+            </view>
+            <image mode="widthFix" src="https://oss.dayaedu.com/ktyq/1731839238916.png"></image>
+            <view class="empty-text">暂无数据</view>
+          </view>
+        </van-popup>
+
+
+        <!-- 年级 -->
+        <van-popup round="{{true}}" lock-scroll="{{true}}" z-index="{{102}}" show="{{showGradeClass}}" position="bottom" safe-area-inset-bottom="{{false}}" bind:close="onCloseGradeClass" bind:after-leave="onGradeClassAfterLeave" bind:before-enter="onGradeClassBeforeEnter">
+          <van-picker wx:if="{{ !showGradeClassAfterLeave }}" columns="{{ gradeGradeList }}" visible-item-count="6" show-toolbar default-index="{{ gradeGradeIndex }}" bind:cancel="onCloseGradeClass" bind:confirm="onSubmitGradeClass">
+          </van-picker>
+        </van-popup>
+        <!-- 班级 -->
+        <van-popup round="{{true}}" lock-scroll="{{true}}" z-index="{{102}}" show="{{showClass}}" position="bottom" safe-area-inset-bottom="{{false}}" bind:close="onCloseClass" bind:after-leave="onClassAfterLeave" bind:before-enter="onClassBeforeEnter">
+          <van-picker wx:if="{{ !showClassAfterLeave }}" columns="{{ classList }}" visible-item-count="6" show-toolbar default-index="{{ classIndex }}" bind:cancel="onCloseClass" bind:confirm="onSubmitClass">
+          </van-picker>
         </van-popup>
       </scroll-view>