123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- // 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<IAppOption>()
- // 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'
- }
- }
- })
|