Bladeren bron

添加基础平板样式

lex-xin 2 maanden geleden
bovenliggende
commit
20556043ff

+ 37 - 28
miniprogram/app.ts

@@ -1,16 +1,16 @@
 // app.ts
-import { api_login, api_queryUserInfo } from './api/login';
+import { api_login, api_queryUserInfo } from "./api/login";
 const config = require("./config");
 
 App<IAppOption>({
   globalData: {
     // 在客服页面使用
-    top: 0,  // 初始的上偏移
+    top: 0, // 初始的上偏移
     baseUrl: config?.baseUrl,
-    appId: '',
-    deviceNum: '', // 设备信息
+    appId: "",
+    deviceNum: "", // 设备信息
     isLogin: false, // 是否登录
-    userInfo: {} as any
+    userInfo: {} as any,
   },
   onLaunch() {
     // 展示本地存储能力
@@ -23,9 +23,9 @@ App<IAppOption>({
     // 登录
     wx.login({
       success: async (res) => {
-        this.onLogin(res.code)
+        this.onLogin(res.code);
       },
-    })
+    });
   },
   setAppId() {
     //获取当前小程序appId
@@ -35,13 +35,20 @@ App<IAppOption>({
     //先设置appid再引入接口文件,防止appid未更新问题
     // require("./utils/request/api.js");
     // 获取设备信息
-    const deviceInfo = wx.getDeviceInfo()
-      // 品牌 设备型号 操作系统及版本 客户端平台
-    const deviceNum = deviceInfo.brand + '-' + deviceInfo.model + '-' + deviceInfo.platform + '-' + deviceInfo.system
-    this.globalData.deviceNum = deviceNum
+    const deviceInfo = wx.getDeviceInfo();
+    // 品牌 设备型号 操作系统及版本 客户端平台
+    const deviceNum =
+      deviceInfo.brand +
+      "-" +
+      deviceInfo.model +
+      "-" +
+      deviceInfo.platform +
+      "-" +
+      deviceInfo.system;
+    this.globalData.deviceNum = deviceNum;
     // 设置客服初始位置
     const systemInfo = wx.getWindowInfo();
-    this.globalData.top = systemInfo.windowHeight - 180
+    this.globalData.top = systemInfo.windowHeight - 180;
   },
   // userInfoReadyCallback(result) {
   //   console.log(result, 'result')
@@ -56,33 +63,35 @@ App<IAppOption>({
       // 开始登录
       const { data } = await api_login({
         autoRegister: false,
-        client_id: 'cooleshow-student-wxlite',
-        client_secret: 'cooleshow-student-wxlite',
+        client_id: "cooleshow-student-wxlite",
+        client_secret: "cooleshow-student-wxlite",
         deviceNum: this.globalData.deviceNum,
-        extra: '',
-        grant_type: 'password',
-        loginType: 'WECHAT_MA',
+        extra: "",
+        grant_type: "password",
+        loginType: "WECHAT_MA",
         multiUser: false,
         username: this.globalData.appId,
-        password: code
-      })
+        password: code,
+      });
 
-      if(data.code === 200) {
+      if (data.code === 200) {
         const userToken = data.data.token_type + " " + data.data.access_token;
         wx.setStorageSync("token", userToken);
         this.globalData.isLogin = true;
-        const users = await api_queryUserInfo({ wxAppId: this.globalData.appId })
-        if(users.data.code === 200) {
-          this.globalData.userInfo = users.data.data
+        const users = await api_queryUserInfo({
+          wxAppId: this.globalData.appId,
+        });
+        if (users.data.code === 200) {
+          this.globalData.userInfo = users.data.data;
         } else {
           wx.removeStorageSync("token");
-          this.globalData.isLogin = false
+          this.globalData.isLogin = false;
         }
-        console.log(users)
+        console.log(users);
       } else {
         this.globalData.isLogin = false;
       }
     } catch {}
-    wx.hideLoading()
-  }
-})
+    wx.hideLoading();
+  },
+});

+ 1 - 1
miniprogram/config.ts

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

+ 14 - 7
miniprogram/pages/buyerInformation/index.less

@@ -42,9 +42,10 @@
   }
 
   .van-cell {
-    padding: 28rpx;
-    font-size: 30rpx;
-    line-height: 42rpx;
+    padding: 28rpx !important;
+    font-size: 30rpx !important;
+    // line-height: 42rpx !important;
+    --cell-line-height: 42rpx!important;
 
     .required {
       font-weight: 600;
@@ -100,6 +101,7 @@
     line-height: 88rpx;
     background: linear-gradient(90deg, #544F4A 0%, #302F2B 100%);
     border-radius: 44rpx;
+    font-size: 32rpx;
     padding: 0 !important;
     color: #FBEAC9;
   }
@@ -117,7 +119,7 @@
 .van-picker__cancel,
 .van-picker__confirm,
 .toolbar-cancel,
-toolbar-confirm {
+.toolbar-confirm {
   font-size: 32rpx !important;
   padding: 28rpx 0 !important;
   color: #777777 !important;
@@ -148,6 +150,7 @@ toolbar-confirm {
     background: #F6F6F6 !important;
     border-radius: 35rpx !important;
     border: 1rpx solid #FFFFFF !important;
+    --cell-line-height: 48rpx!important;
   }
   .van-search__content {
     background: #F6F6F6 !important;
@@ -171,12 +174,16 @@ toolbar-confirm {
     font-weight: 500;
     font-size: 28rpx;
     color: #FFFFFF;
-    line-height: 40rpx;
+    // line-height: 40rpx;
     border-radius: 40rpx;
     margin-right: 6rpx;
   }
 }
 
+// .van-picker-column__item {
+  // font-size: 32rpx;
+// }
+
 .van-picker-column__item--selected {
   font-weight: 600;
   font-size: 32rpx;
@@ -212,8 +219,8 @@ toolbar-confirm {
   }
 
   image {
-    width: 364rpx;
-    height: 190rpx;
+    // width: 364rpx;
+    height: 190rpx !important;
   }
 
   .empty-text {

+ 13 - 2
miniprogram/pages/buyerInformation/index.ts

@@ -1,5 +1,5 @@
 import { api_schoolAreaDetail, api_schoolAreaList, api_sysAreaQueryAllProvince, api_userBeneficiarySave, api_userBeneficiaryUpdate } from "../../api/new";
-import { GRADE_ENUM } from "../../utils/util";
+import { debounce, GRADE_ENUM } from "../../utils/util";
 
 
 const classList: any = [];
@@ -81,6 +81,8 @@ Page({
     showGradeClass: false,
     showGradeClassAfterLeave: false, // 离开后
     showAreaAfterLeave: false, // 所在地区
+
+    timer: null as any
   },
 
   /**
@@ -535,10 +537,19 @@ Page({
     this.getSchools(this.data.searchName);
   },
   onSearchChange(e: any) {
-    this.setData({
+    const that = this
+    that.setData({
       searchName: e.detail
+    }, () => {
+      // 防抖
+       clearTimeout(that.data.timer); // 清除之前的定时器
+        that.data.timer = setTimeout(() => {
+          that.getSchools(that.data.searchName);
+          // 这里写业务逻辑
+        }, 500); // 1秒后执行
     })
   },
+
   /** 选择年级班级 */
   onSelectGradeClass() {
     if (!this.data.schoolAreaId) {

+ 1 - 1
miniprogram/pages/buyerInformation/index.wxml

@@ -68,7 +68,7 @@
       <view class="empty_loading" wx:if="{{ schoolLoading }}">
         <van-loading color="#1989fa" />
       </view>
-      <image mode="widthFix" src="https://oss.dayaedu.com/ktyq/1732182740363.png"></image>
+      <image mode="heightFix" src="https://oss.dayaedu.com/ktyq/1732182740363.png"></image>
       <view class="empty-text">暂无数据</view>
     </view>
   </van-popup>

+ 2 - 1
miniprogram/pages/index/index.less

@@ -620,7 +620,8 @@ page {
 }
 
 .combo-section {
-  max-height: 556rpx;
+  // max-height: 556rpx;
+  max-height: 30vh;
   overflow-x: hidden;
   overflow-y: auto;
 

+ 4 - 2
miniprogram/pages/orders/order-detail.less

@@ -599,8 +599,10 @@ page {
 
 .cell-group {
   .van-cell {
-    padding: 26rpx 28rpx;
-    font-size: 30rpx;
+    padding: 26rpx 28rpx !important;
+    font-size: 30rpx !important;
+    // line-height: 42rpx !important;
+    --cell-line-height: 42rpx!important;
   }
 
   .required {

+ 21 - 0
miniprogram/pages/orders/order-result.less

@@ -723,6 +723,9 @@ page {
 }
 
 .select-address {
+  .address-info {
+    width: 100%;
+  }
   .address-text {
     font-weight: 600;
     font-size: 30rpx;
@@ -737,9 +740,27 @@ page {
     font-size: 28rpx;
     color: #333333;
     line-height: 40rpx;
+    display: flex;
+
+    // text {
+    //   padding-right: 12rpx;
+    // }
+    .username {
+      display: inline-block;
+      word-break: break-all;
+      word-wrap: break-word;
+      max-width: 250rpx;
+      white-space: nowrap;
+      overflow: hidden;
+      text-overflow: ellipsis;
+    }
 
     text {
       padding-right: 12rpx;
+
+      &:last-child {
+        color: #777;
+      }
     }
   }
 

+ 1 - 1
miniprogram/pages/orders/order-result.wxml

@@ -56,7 +56,7 @@
           {{ goodsInfo.addresses.addressDetail }}
         </view>
         <view class="address-user">
-          <text>{{ goodsInfo.addresses.name }}</text>
+          <text class="username">{{ goodsInfo.addresses.name }}</text>
           <text>{{ goodsInfo.addresses.phoneNumber }}</text>
         </view>
       </view>