// index.ts import { api_schoolAreaDetail, api_schoolAreaList, api_sysAreaQueryAllProvince, api_userBeneficiarySave, api_userBeneficiaryUpdate } from "../../api/new"; import { 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() // pages/orders/orders.ts Page({ /** * 页面的初始数据 */ data: { goodsImgList: [ 'https://oss.dayaedu.com/ktyq/1739524049205.png', 'https://oss.dayaedu.com/ktyq/1739523564827.png', 'https://oss.dayaedu.com/ktyq/1739523574402.png', 'https://oss.dayaedu.com/ktyq/1739523583463.png' ], current: 0, popupShow: false, showService: false, isFromPreviewImage: false, showBuyer: false, // 收益人 }, /** * 生命周期函数--监听页面加载 */ onLoad() { // this.onInit() }, isLogin() { // 判断是否登录 if (!app.globalData.isLogin) { wx.navigateTo({ url: '../login/login', }) return false } return true }, /** 我的订单 */ onOrder() { // 判断是否登录 if (!this.isLogin()) { return } wx.navigateTo({ url: '../orders/orders', }) }, /** 申请加入 */ onBuyGoods() { // 判断是否登录 if (!this.isLogin()) { return } wx.navigateTo({ url: '../select-goods/index', }) }, /** 客服 */ onService() { this.setData({ showService: true }) }, changePop(event: { detail: any }) { this.setData({ showService: event.detail }) }, onBuyShop() { // 判断是否登录 if (!this.isLogin()) { return } this.setData({ popupShow: true }) }, onClose() { this.setData({ popupShow: false, currentIndex: 1, userBeneficiaryId: '', userBeneficiaryInfo: { name: '', phoneNumber: '', schoolInfo: '' } }) }, onPreivewGoodsImg(e: { currentTarget: { dataset: any } }) { wx.previewImage({ current: e.currentTarget.dataset.src, urls: this.data.goodsImgList, success: () => { this.setData({ isFromPreviewImage: true }) } }) }, onPreivewGoods(e: { currentTarget: { dataset: any } }) { wx.previewImage({ current: e.currentTarget.dataset.src, urls: [e.currentTarget.dataset.src], success: () => { this.setData({ isFromPreviewImage: true }) } }) }, /** * 生命周期函数--监听页面显示 */ onShow() { }, onShareAppMessage() { return { title: '翼时代器乐数字Ai', path: '/pages/index/index', imageUrl: 'https://oss.dayaedu.com/ktyq/1733312164991.png' } }, onShareTimeline() { return { title: '器乐数字AI工具', path: '/pages/index/index', imageUrl: 'https://oss.dayaedu.com/ktyq/1733312164991.png' } } })