zhangback
2026-04-02 b6a09eba8db30103dd04ff06d52d051afaa7e249
新增线上配置
5个文件已修改
88 ■■■■■ 已修改文件
ui/car_wx_app/App.vue 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ui/car_wx_app/components/OdometerPopup/index.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ui/car_wx_app/config.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ui/car_wx_app/pages/examine/operate.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ui/car_wx_app/uni_modules/uview-ui/components/u-number-box/u-number-box.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ui/car_wx_app/App.vue
@@ -16,36 +16,40 @@
            console.log('App Hide')
        },
        methods:{
             updateApp() {
              const updateManager = uni.getUpdateManager();
              updateManager.onCheckForUpdate(function (res) {
                // 请求完新版本信息的回调
              });
            updateApp() {
                const updateManager = uni.getUpdateManager();
              updateManager.onUpdateReady(function (res) {
                uni.showModal({
                  title: '更新提示',
                  content: '新版本已经准备好,是否重启应用?',
            showCancel: false,
                  success(res) {
                    if (res.confirm) {
                      // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
                      updateManager.applyUpdate();
                    } else if (res.cancel) {
                      console.log('用户点击取消,不更新');
                    }
                  }
                });
                updateManager.onCheckForUpdate(function (res) {
                    // 请求完新版本信息的回调
                    console.log('检查更新结果:', res.hasUpdate);
                    if (res.hasUpdate) {
                        console.log('发现新版本,正在下载...');
                    } else {
                        console.log('当前已是最新版本');
                    }
                });
              });
                updateManager.onUpdateReady(function (res) {
                    uni.showModal({
                        title: '更新提示',
                        content: '新版本已经准备好,是否重启应用?',
                        success(res) {
                            if (res.confirm) {
                                // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
                                updateManager.applyUpdate();
                            }
                        }
                    });
                });
              updateManager.onUpdateFailed(function (res) {
                // 新的版本下载失败
                uni.showModal({
                  title: '已经有新版本了哟~',
                  content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~',
                })
              });
                updateManager.onUpdateFailed(function (res) {
                    // 新的版本下载失败
                    uni.showModal({
                        title: '更新失败',
                        content: '新版本下载失败,请检查网络后重试',
                        showCancel: false
                    });
                });
            }
ui/car_wx_app/components/OdometerPopup/index.vue
@@ -13,7 +13,6 @@
            <u-number-box
              v-model="localForm.odometer"
              class="number-box"
              :min="0"
              :step="1"
              button-size="28"
              inputWidth="90"
@@ -65,7 +64,7 @@
  data() {
    return {
      localForm: {
        odometer: 0,
        odometer: undefined,
        iscc: '1'
      }
    }
@@ -74,11 +73,13 @@
  watch: {
    show(val) {
      if (val) {
        // 弹窗打开时,同步父组件的数据到本地
        this.localForm = {
          odometer: this.form.odometer || 0,
          odometer: this.form.odometer || '',
          iscc: this.form.iscc || '1'
        }
        console.log(this.form.odometer,this.localForm)
      }
    }
  },
ui/car_wx_app/config.js
@@ -1,6 +1,6 @@
//const host = 'https://tmsapi.ygalogisticspark.com/api/';
const host = 'https://tmsapi.ygalogisticspark.com/api/';
//const host = 'http://61.143.42.70:7010/cwgltest-api/';
const host = 'http://192.168.1.92:8060/';
//const host = 'http://192.168.1.92:8060/';
// const host = 'https://jyjyapi.ygalogisticspark.com/api2/zhfw/api/third';
const imageUrlYL = 'http://localhost:8080';
const aliOssUrl = 'https://huichang-tms.oss-cn-hongkong.aliyuncs.com';
ui/car_wx_app/pages/examine/operate.vue
@@ -20,7 +20,7 @@
          <u--form ref="uForm" :rules="rules" :model="form" labelPosition="left">
            <u-form-item borderBottom label=" " labelWidth="0" prop="address">
              <view class="form-row" @click="getLocation">
                <view class="form-label required">
                <view class="form-label">
                  <view class="label-icon">
                    <u--image :showLoading="true" src="/static/bt.png" width="18" height="18" />
                  </view>
@@ -47,6 +47,14 @@
                  <text>时间</text>
                </view>
                <uni-datetime-picker type="datetime" v-model="form.tripTime" class="flex-1" />
              </view>
            </u-form-item>
            <u-form-item borderBottom label=" " v-if="form.odometer" labelWidth="0" prop="odometer">
              <view class="form-row">
                <view class="form-label">
                  <text>仪表里程</text>
                </view>
                <view class="form-label">{{form.odometer || 0}} KM</view>
              </view>
            </u-form-item>
@@ -223,7 +231,7 @@
const ODOMETER_TYPES = Object.freeze(['3', '5', '7'])
const INITIAL_FORM = Object.freeze({
  address: '', tripTime: '', odometer: 0, tripType: '',
  address: '', tripTime: '', odometer: undefined, tripType: '',
  feeType: '', currency: '', actualFeeAmount: 0,
  iscc: '1', longitude: '', latitude: ''
})
@@ -468,10 +476,10 @@
      if (type !== '1') {
        if (ODOMETER_TYPES.includes(type)) {
          this.form.odometer = this.tmsTripTables[0]?.odometer || 0
          this.form.odometer = this.tmsTripTables[0]?.odometer || undefined
          this.form.iscc = '1'
        } else {
          this.form.odometer = 0
          this.form.odometer = undefined
        }
        this.$nextTick(() => { this.showPopup = true })
      }
ui/car_wx_app/uni_modules/uview-ui/components/u-number-box/u-number-box.vue
@@ -194,6 +194,9 @@
            // 格式化整理数据,限制范围
            format(value) {
                value = this.filter(value)
        if (!value){
          return value
        }
                // 如果为空字符串,那么设置为0,同时将值转为Number类型
                value = value === '' ? 0 : +value
                // 对比最大最小值,取在min和max之间的值