Эх сурвалжийг харах

style: 发票抬头修改

John-Hong 2 жил өмнө
parent
commit
8939771ba7

+ 1 - 0
src/App.vue

@@ -28,6 +28,7 @@ export default {
   },
   },
   methods: {
   methods: {
     async init() {
     async init() {
+      // 当前页面是否是
       CacheTool.init()
       CacheTool.init()
       if (window.location.href.search(/pageId=|token=/g) < 0) {
       if (window.location.href.search(/pageId=|token=/g) < 0) {
         return;
         return;

+ 470 - 441
src/pages/parkingFee/parkingReceipt/parkingChangeHeader.vue

@@ -1,441 +1,470 @@
-<template>
-  <scroll-view class="scroll-Y" scroll-y>
-    <div class="part top">
-      <div class="invoice-header">
-        <div class="part-item header-type lines">
-          <span class="part-item-key">抬头类型</span>
-          <van-radio-group v-model="condition.invoiceTitleType" direction="horizontal" class="part-item-value" @change="radioChange">
-            <van-radio
-                v-for="item in items"
-                :key="item.name+item.value"
-                checked-color="#064C8A"
-                :name="item.value"
-              >
-              {{ item.name }}
-            </van-radio>
-          </van-radio-group>
-        </div>
-        <div class="part-item lines">
-          <span class="part-item-key">抬头名称</span>
-          <div class="part-item-value">
-            <!-- <input
-              type="text"
-              placeholder="请输入抬头名称"
-              v-model="condition.invoiceTitleName"
-            /> -->
-            <van-field
-              v-model="condition.invoiceTitleName"
-              right-icon="arrow"
-              input-align="right"
-              placeholder="请输入抬头名称"
-            />
-          </div>
-        </div>
-        <div class="part-item lines" v-if="isCompany">
-          <span class="part-item-key">公司税号</span>
-          <div class="part-item-value">
-            <!-- <input
-              type="text"
-              placeholder="请输入公司税号"
-              v-model="condition.corporationTax"
-            /> -->
-            <van-field
-              v-model="condition.corporationTax"
-              right-icon="arrow"
-              input-align="right"
-              placeholder="请输入公司税号"
-            />
-          </div>
-        </div>
-        <div class="part-item lines">
-          <span class="part-item-key">设为默认</span>
-          <div class="part-item-value">
-            <switch
-              color="#8CC63F"
-              :checked="isDefault"
-              @change="switch1Change"
-            />
-          </div>
-        </div>
-      </div>
-      <div class="invoice-more" v-if="isCompany">
-        <div class="tab-title">更多信息(以下为选填内容)</div>
-        <div class="company-box">
-          <div class="part-item lines">
-            <span class="part-item-key">公司地址</span>
-            <div class="part-item-value">
-              <input
-                type="text"
-                placeholder="请输入公司地址"
-                v-model="condition.companyAddress"
-              />
-            </div>
-          </div>
-          <div class="part-item lines">
-            <span class="part-item-key">公司电话</span>
-            <div class="part-item-value">
-              <input
-                type="text"
-                placeholder="请输入公司电话"
-                v-model="condition.companyTel"
-              />
-            </div>
-          </div>
-          <div class="part-item lines">
-            <span class="part-item-key">开户银行</span>
-            <div class="part-item-value">
-              <input
-                type="text"
-                placeholder="请输入开户银行"
-                v-model="condition.depositBank"
-              />
-            </div>
-          </div>
-          <div class="part-item lines" style="border: none">
-            <span class="part-item-key">开户账户</span>
-            <div class="part-item-value">
-              <input
-                type="text"
-                placeholder="请输入开户银行"
-                v-model="condition.accountNumber"
-              />
-            </div>
-          </div>
-        </div>
-      </div>
-    </div>
-    <!-- <uni-view class="part middle">
-            <uni-view class="part-item">
-                <span class="part-item-key">总金额</span>
-                <span class="part-item-value"><span class="purple">10.00</span>元</span>
-            </uni-view>
-        </uni-view> -->
-    <div class="part footer">
-      <!-- <uni-view class="tab-title">接收方式</uni-view>
-            <uni-view class="part-item lines">
-                <span class="part-item-key">电子邮箱</span>
-                <span class="part-item-value">sota_xu@hafengkeji.com</span>
-            </uni-view> -->
-      <div
-        :class="{
-          'push-again-btn': true,
-          'blue-push-again-btn': custTypeId === 1,
-          'green-push-again-btn': custTypeId === 2,
-        }"
-        @click="submit"
-        >保存</div
-      >
-    </div>
-  </scroll-view>
-</template>
-
-<script>
-// const app = getApp()
- const app = {}
-import { mapState } from 'vuex'
-import MemberCacheTool from '@/utils/member-cache-tool.js'
-import uni from '@/utils/uniHooks'
-export default {
-  data() {
-    return {
-      picUrl: this.$picUrl,
-      type: 'add',
-      id: '',
-      globalData: app.globalData,
-      items: [
-        { value: '0', name: '单位' },
-        { value: '1', name: '个人/非企业单位' },
-      ],
-      isDefault: true, // 记录
-      condition: {
-        id: '', // |Long|否|抬头id
-        invoiceTitleType: 0, // |int|是|抬头类型( 0:单位,1:个人/非企业单位)
-        invoiceTitleName: '', // |String|是|抬头名称
-        corporationTax: '', // |String|是|公司税号|
-        setDefault: '', // |int|是|设为默认(0:不默认,1:默认)
-        depositBank: '', // |String|否|开户银行
-        accountNumber: '', // |String|否|开户账号
-        companyAddress: '', // |String|否|公司地址
-        companyTel: '', // |String|否|公司电话
-        createUser: '', // |String|是|创建人
-        creator: '', // |Long|是|创建者id
-        updateUser: this.member?.nickname, // |String|是|更新人
-        updater: this.member?.id, // |Long|是|更新人id
-        mobile: this.member?.mobile, // |String|是|手机号
-        vipcode: this.member?.vipcode, // |String|是|会员号
-        // openid: MemberCacheTool.getOpenId(app), // |String|是|openid
-      },
-      preUrl: '',
-    }
-  },
-  computed: {
-    isCompany: function () {
-      return this.condition.invoiceTitleType == 0
-    },
-    ...mapState({
-      custTypeId: (state) => state.custTypeId,
-      member: (state) => state.member,
-      openid: (state) => state.openid,// |String|是|openid
-    }),
-  },
-  onLoad(options) {
-    console.log(this.globalData)
-    if (options.type) this.type = options.type
-    if (options.id) (this.id = options.id), this.getInvoiceTitleById()
-    // 埋点本地化
-    this.preUrl = uni.getStorageSync('previousUrl')
-    uni.setStorageSync(
-      'previousUrl',
-      '/pages/parkingFee/parkingReceipt/parkingChangeHeader.vue'
-    )
-  },
-  methods: {
-    radioChange: function (e) {
-      for (let i = 0; i < this.items.length; i++) {
-        if (this.items[i].value === e.detail.value) {
-          this.condition.invoiceTitleType = i
-          break
-        }
-      }
-    },
-    switch1Change: function (e) {
-      console.log('switch1 发生 change 事件,携带值为', e.target.value)
-      this.isDefault = e.target.value
-    },
-    // 根据抬头ID获取抬头详情信息  api/1.0/invoiceTitle/{id}
-    getInvoiceTitleById() {
-      const self = this
-      const params = {
-        id: this.id,
-      }
-      self.$md(params)
-      uni.request({
-        url: self.$baseURL + 'api/1.0/invoiceTitle/' + this.id,
-        method: 'GET',
-        data: params,
-        header: JSON.parse(uni.getStorageSync('handleUser')),
-        success: (res) => {
-          console.log('获取抬头详情信息', res.data)
-          if (res.data.code === 0) {
-            self.condition = res.data.data
-            // 单独对默认选项进行赋值
-            self.isDefault = res.data.data.setDefault === 1 ? true : false
-          } else {
-            uni.showToast({
-              title: res.data.msg,
-              duration: 2000,
-              icon: 'none',
-            })
-          }
-        },
-        fail: () => {
-          uni.showToast({
-            title: '服务器开小差了呢,请您稍后再试',
-            icon: 'none',
-          })
-        },
-      })
-    },
-    // 添加、编辑抬头信息
-    submit() {
-      const self = this
-      const url =
-        self.type === 'add' ? 'api/1.0/invoiceTitle' : 'api/1.0/invoiceTitle'
-      const methodType = self.type === 'add' ? 'POST' : 'PUT'
-      if (self.type === 'add') {
-        self.condition.createUser = self.globalData.wxMember.nickname
-        self.condition.creator = self.globalData.wxMember.id
-      }
-      self.condition.setDefault = self.isDefault ? 1 : 0
-      const params = {
-        ...self.condition,
-      }
-      console.log('提交信息', params)
-      self.$md(params)
-      uni.request({
-        url: self.$baseURL + url,
-        method: methodType,
-        data: params,
-        header: JSON.parse(uni.getStorageSync('handleUser')),
-        success: (res) => {
-          console.log(res.data)
-          if (res.data.code === 0) {
-            // 保存结果埋点
-            self.sensorsClick('$ClickSubmitHeader', {
-              redirect_url: '',
-              type_header:
-                params.invoiceTitleType == 0
-                  ? 'SelectCompany'
-                  : 'SelectPersonal',
-              default_header:
-                params.setDefault == 0
-                  ? 'SetAsDefaultClose'
-                  : 'SetAsDefaultOpen',
-            })
-            uni.navigateBack({ delta: 1 })
-          } else {
-            uni.showToast({
-              title: res.data.msg,
-              duration: 2000,
-              icon: 'none',
-            })
-          }
-        },
-        fail: () => {
-          uni.showToast({
-            title: '服务器开小差了呢,请您稍后再试',
-            icon: 'none',
-          })
-        },
-      })
-    },
-    // 埋点方法
-    sensorsClick(eventName, params) {
-      let optionsQuery = uni.getStorageSync('options_query')
-      let fixedParams = {
-          cta_itemno: '',
-          cta_name: '',
-          previous_url: this.preUrl || '',
-          $brand_id:uni.getStorageSync('groupId'),
-          $location: uni.getStorageSync('mallid'),
-          $channel: optionsQuery.channel || '',
-          // $utm_lbs: this.optionsQuery.utm_lbs || '',
-          $utm_channel: optionsQuery.utm_channel || '',
-          $utm_method: optionsQuery.utm_method || '',
-          $utm_source: optionsQuery.utm_source || '',
-          $utm_function: optionsQuery.utm_function || '',
-          $utm_user: optionsQuery.utm_user || '',
-        },
-        finalParams = Object.assign(fixedParams, params)
-      this.$sensors.track(eventName, finalParams)
-    },
-  },
-}
-</script>
-
-<style lang="less" scoped>
-// @import '../../../styles/common.less';
-.scroll-Y {
-  width: 100%;
-  display: flex;
-  flex-direction: column;
-  height: 100vh;
-  // background: #f2f2f2;
-  background: #F4F7FF;
-  padding: 30px 30px 30px 30px;
-  .part {
-    // background-color: #FAFBFF;
-    width: calc(100% - 60px);
-    .part-item {
-      display: flex;
-      justify-content: space-between;
-      align-items: center;
-      // padding: 32px 0;
-      font-size: 28px;
-      width: 91.4%;
-      height: 87px;
-      margin: 0 auto;
-      .part-item-key {
-        color: #999;
-      }
-      .part-item-value {
-        color: #999;
-        text-align: right;
-        > label {
-          margin-left: 20px;
-        }
-        .van-cell {
-          background-color: transparent;
-          font-size: 30px;
-        }
-      }
-    }
-    .tab-title {
-      color: #676767;
-      padding-top: 36px;
-      padding-bottom: 20px;
-      // padding: 30px 35px;
-      // background-color: #f1f1f1;
-      font-size: 30px;
-      font-weight: 400;
-      color: #333333;
-      line-height: 42px;
-    }
-    .company-box {
-      background: #FAFBFF;
-      border-radius: 4px;
-      border: 1px solid #D8DAE0;
-    }
-    .lines {
-      border-bottom: 2px solid #ececec;
-    }
-    .invoice-more {
-      padding-bottom: 8px;
-    }
-    .invoice-header {
-      background: #FAFBFF;
-      border-radius: 4px;
-      border: 1px solid #D8DAE0;
-    }
-  }
-  .top {
-    // margin-top: 20px;
-  }
-  .middle {
-    margin: 20px 0;
-    .purple {
-      color: #a668b1;
-    }
-  }
-  .footer {
-    width: 100%;
-    height: 110px;
-    position: fixed;
-    bottom: 0px;
-    // padding-bottom: constant(safe-area-inset-bottom);
-    // padding-bottom: env(safe-area-inset-bottom);
-    padding-bottom: 20px;
-    box-shadow: 0 0 10px 0 hsla(0, 6%, 58%, 0.6);
-    -webkit-box-shadow: 0 0 20px 0 hsla(0, 6%, 58%, 0.6);
-    -moz-box-shadow: 0 0 20px 0 hsla(0, 6%, 58%, 0.6);
-    // padding-top: 20px;
-    .invoive-img {
-      text-align: center;
-      > img {
-        width: 100%;
-      }
-      .download {
-        margin-top: 20px;
-        margin-bottom: 20px;
-        display: flex;
-        justify-content: center;
-        align-items: center;
-        > img {
-          width: 32px;
-        }
-        > span {
-          margin-left: 10px;
-          color: #808080;
-        }
-      }
-    }
-    .push-again-btn {
-      margin: 25px 30px;
-      background-image: linear-gradient(to right, #7d4ea1, #40397c);
-      border-radius: 50px;
-      color: #ffffff;
-      text-align: center;
-      padding: 25px 0;
-    }
-    .blue-push-again-btn {
-      .color-background-color('blue');
-    }
-    .green-push-again-btn {
-      .color-background-color('green');
-    }
-  }
-}
-</style>
-
-
-
+<template>
+  <scroll-view class="scroll-Y" scroll-y>
+    <div class="part top">
+      <div class="invoice-header">
+        <div class="part-item header-type lines">
+          <span class="part-item-key">抬头类型</span>
+          <van-radio-group v-model="condition.invoiceTitleType" direction="horizontal" class="part-item-value" @change="radioChange">
+            <van-radio
+              v-for="item in items"
+              :key="item.name+item.value"
+              checked-color="#064C8A"
+              :name="item.value"
+            >
+              {{ item.name }}
+            </van-radio>
+          </van-radio-group>
+        </div>
+        <div class="part-item lines">
+          <span class="part-item-key">抬头名称</span>
+          <div class="part-item-value">
+            <!-- <input
+              type="text"
+              placeholder="请输入抬头名称"
+              v-model="condition.invoiceTitleName"
+            /> -->
+            <van-field
+              v-model="condition.invoiceTitleName"
+              right-icon="arrow"
+              input-align="right"
+              placeholder="请输入抬头名称"
+            />
+          </div>
+        </div>
+        <div class="part-item lines" v-if="isCompany">
+          <span class="part-item-key">公司税号</span>
+          <div class="part-item-value">
+            <!-- <input
+              type="text"
+              placeholder="请输入公司税号"
+              v-model="condition.corporationTax"
+            /> -->
+            <van-field
+              v-model="condition.corporationTax"
+              right-icon="arrow"
+              input-align="right"
+              placeholder="请输入公司税号"
+            />
+          </div>
+        </div>
+        <div class="part-item lines">
+          <span class="part-item-key">设为默认</span>
+          <div class="part-item-value">
+            <switch
+              color="#8CC63F"
+              :checked="isDefault"
+              @change="switch1Change"
+            />
+          </div>
+        </div>
+      </div>
+      <div class="invoice-more" v-if="isCompany">
+        <div class="tab-title">更多信息(以下为选填内容)</div>
+        <div class="company-box">
+          <div class="part-item lines">
+            <span class="part-item-key">公司地址</span>
+            <div class="part-item-value">
+              <van-field
+                v-model="condition.companyAddress"
+                right-icon="arrow"
+                input-align="right"
+                placeholder="请输入公司地址"
+              />
+            </div>
+          </div>
+          <div class="part-item lines">
+            <span class="part-item-key">公司电话</span>
+            <div class="part-item-value">
+              <van-field
+                v-model="condition.companyTel"
+                right-icon="arrow"
+                input-align="right"
+                placeholder="请输入公司电话"
+              />
+            </div>
+          </div>
+          <div class="part-item lines">
+            <span class="part-item-key">开户银行</span>
+            <div class="part-item-value">
+              <van-field
+                v-model="condition.depositBank"
+                right-icon="arrow"
+                input-align="right"
+                placeholder="请输入开户银行"
+              />
+            </div>
+          </div>
+          <div class="part-item lines" style="border: none">
+            <span class="part-item-key">开户账户</span>
+            <div class="part-item-value">
+              <van-field
+                v-model="condition.accountNumber"
+                right-icon="arrow"
+                input-align="right"
+                placeholder="请输入开户账户"
+              />
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+    <div class="part footer">
+      <div
+        :class="{
+          'push-again-btn': true,
+          'blue-push-again-btn': custTypeId === 1,
+          'green-push-again-btn': custTypeId === 2,
+        }"
+        @click="submit"
+      >保存
+      </div>
+    </div>
+  </scroll-view>
+</template>
+
+<script>
+// const app = getApp()
+const app = {}
+import { mapState } from 'vuex'
+import MemberCacheTool from '@/utils/member-cache-tool.js'
+import uni from '@/utils/uniHooks'
+
+export default {
+  data() {
+    return {
+      picUrl: this.$picUrl,
+      type: 'add',
+      id: '',
+      globalData: app.globalData,
+      items: [
+        {value: '0',name: '单位'},
+        {value: '1',name: '个人/非企业单位'},
+      ],
+      isDefault: true, // 记录
+      condition: {
+        id: '', // |Long|否|抬头id
+        invoiceTitleType: 0, // |int|是|抬头类型( 0:单位,1:个人/非企业单位)
+        invoiceTitleName: '', // |String|是|抬头名称
+        corporationTax: '', // |String|是|公司税号|
+        setDefault: '', // |int|是|设为默认(0:不默认,1:默认)
+        depositBank: '', // |String|否|开户银行
+        accountNumber: '', // |String|否|开户账号
+        companyAddress: '', // |String|否|公司地址
+        companyTel: '', // |String|否|公司电话
+        createUser: '', // |String|是|创建人
+        creator: '', // |Long|是|创建者id
+        updateUser: this.member?.nickname, // |String|是|更新人
+        updater: this.member?.id, // |Long|是|更新人id
+        mobile: this.member?.mobile, // |String|是|手机号
+        vipcode: this.member?.vipcode, // |String|是|会员号
+        // openid: MemberCacheTool.getOpenId(app), // |String|是|openid
+      },
+      preUrl: '',
+    }
+  },
+  computed: {
+    isCompany: function () {
+      return this.condition.invoiceTitleType == 0
+    },
+    ...mapState({
+      custTypeId: ( state ) => state.custTypeId,
+      member: ( state ) => state.member,
+      openid: ( state ) => state.openid,// |String|是|openid
+    }),
+  },
+  created() {
+    const options = this.$route.query;
+    console.log(this.globalData)
+    if ( options.type ) this.type = options.type
+    if ( options.id ) ( this.id = options.id ), this.getInvoiceTitleById()
+    // 埋点本地化
+    this.preUrl = uni.getStorageSync('previousUrl')
+    uni.setStorageSync(
+      'previousUrl',
+      '/pages/parkingFee/parkingReceipt/parkingChangeHeader.vue'
+    )
+  },
+  mounted() {
+    setTimeout(() => {
+      uni.setNavigationBarTitle({
+        title: "发票抬头"
+      })
+    }, 300)
+  },
+  methods: {
+    radioChange: function ( e ) {
+      for ( let i = 0; i < this.items.length; i++ ) {
+        if ( this.items[i].value === e.detail.value ) {
+          this.condition.invoiceTitleType = i
+          break
+        }
+      }
+    },
+    switch1Change: function ( e ) {
+      console.log('switch1 发生 change 事件,携带值为',e.target.value)
+      this.isDefault = e.target.value
+    },
+    // 根据抬头ID获取抬头详情信息  api/1.0/invoiceTitle/{id}
+    getInvoiceTitleById() {
+      const self = this
+      const params = {
+        id: this.id,
+      }
+      self.$md(params)
+      uni.request({
+        url: self.$baseURL + 'api/1.0/invoiceTitle/' + this.id,
+        method: 'GET',
+        data: params,
+        header: JSON.parse(uni.getStorageSync('handleUser')),
+        success: ( res ) => {
+          console.log('获取抬头详情信息',res.data)
+          if ( res.data.code === 0 ) {
+            self.condition = res.data.data
+            // 单独对默认选项进行赋值
+            self.isDefault = res.data.data.setDefault === 1 ? true : false
+          } else {
+            uni.showToast({
+              title: res.data.msg,
+              duration: 2000,
+              icon: 'none',
+            })
+          }
+        },
+        fail: () => {
+          uni.showToast({
+            title: '服务器开小差了呢,请您稍后再试',
+            icon: 'none',
+          })
+        },
+      })
+    },
+    // 添加、编辑抬头信息
+    submit() {
+      const self = this
+      const url =
+        self.type === 'add' ? 'api/1.0/invoiceTitle' : 'api/1.0/invoiceTitle'
+      const methodType = self.type === 'add' ? 'POST' : 'PUT'
+      if ( self.type === 'add' ) {
+        self.condition.createUser = self.globalData.wxMember.nickname
+        self.condition.creator = self.globalData.wxMember.id
+      }
+      self.condition.setDefault = self.isDefault ? 1 : 0
+      const params = {
+        ...self.condition,
+      }
+      console.log('提交信息',params)
+      self.$md(params)
+      uni.request({
+        url: self.$baseURL + url,
+        method: methodType,
+        data: params,
+        header: JSON.parse(uni.getStorageSync('handleUser')),
+        success: ( res ) => {
+          console.log(res.data)
+          if ( res.data.code === 0 ) {
+            // 保存结果埋点
+            self.sensorsClick('$ClickSubmitHeader',{
+              redirect_url: '',
+              type_header:
+                params.invoiceTitleType == 0
+                  ? 'SelectCompany'
+                  : 'SelectPersonal',
+              default_header:
+                params.setDefault == 0
+                  ? 'SetAsDefaultClose'
+                  : 'SetAsDefaultOpen',
+            })
+            uni.navigateBack({delta: 1})
+          } else {
+            uni.showToast({
+              title: res.data.msg,
+              duration: 2000,
+              icon: 'none',
+            })
+          }
+        },
+        fail: () => {
+          uni.showToast({
+            title: '服务器开小差了呢,请您稍后再试',
+            icon: 'none',
+          })
+        },
+      })
+    },
+    // 埋点方法
+    sensorsClick( eventName,params ) {
+      let optionsQuery = uni.getStorageSync('options_query')
+      let fixedParams = {
+          cta_itemno: '',
+          cta_name: '',
+          previous_url: this.preUrl || '',
+          $brand_id: uni.getStorageSync('groupId'),
+          $location: uni.getStorageSync('mallid'),
+          $channel: optionsQuery.channel || '',
+          // $utm_lbs: this.optionsQuery.utm_lbs || '',
+          $utm_channel: optionsQuery.utm_channel || '',
+          $utm_method: optionsQuery.utm_method || '',
+          $utm_source: optionsQuery.utm_source || '',
+          $utm_function: optionsQuery.utm_function || '',
+          $utm_user: optionsQuery.utm_user || '',
+        },
+        finalParams = Object.assign(fixedParams,params)
+      this.$sensors.track(eventName,finalParams)
+    },
+  },
+}
+</script>
+
+<style lang="less" scoped>
+// @import '../../../styles/common.less';
+.scroll-Y {
+  width: 100%;
+  display: flex;
+  flex-direction: column;
+  height: 100vh;
+  // background: #f2f2f2;
+  background: #F4F7FF;
+  //padding: 30px 30px 30px 30px;
+
+  .part {
+    // background-color: #FAFBFF;
+    width: calc(100% - 60px);
+
+    .part-item {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      // padding: 32px 0;
+      font-size: 28px;
+      width: 91.4%;
+      height: 87px;
+      margin: 0 auto;
+
+      .part-item-key {
+        color: #999;
+      }
+
+      .part-item-value {
+        color: #999;
+        text-align: right;
+
+        > label {
+          margin-left: 20px;
+        }
+
+        .van-cell {
+          background-color: transparent;
+          font-size: 30px;
+          padding-right: 0;
+        }
+      }
+    }
+
+    .tab-title {
+      color: #676767;
+      padding-top: 36px;
+      padding-bottom: 20px;
+      // padding: 30px 35px;
+      // background-color: #f1f1f1;
+      font-size: 30px;
+      font-weight: 400;
+      color: #333333;
+      line-height: 42px;
+    }
+
+    .company-box {
+      background: #FAFBFF;
+      border-radius: 4px;
+      border: 1px solid #D8DAE0;
+    }
+
+    .lines {
+      border-bottom: 2px solid #ececec;
+    }
+
+    .invoice-more {
+      padding-bottom: 8px;
+    }
+
+    .invoice-header {
+      background: #FAFBFF;
+      border-radius: 4px;
+      border: 1px solid #D8DAE0;
+    }
+  }
+
+  .top {
+     margin-top: 30px;
+    margin-left: 30px;
+
+  }
+
+  .middle {
+    margin: 20px 0;
+
+    .purple {
+      color: #a668b1;
+    }
+  }
+
+  .footer {
+    width: 100%;
+    height: 150px;
+    position: fixed;
+    bottom: 0px;
+     padding-bottom: constant(safe-area-inset-bottom);
+     padding-bottom: env(safe-area-inset-bottom);
+    //padding-bottom: 20px;
+    box-shadow: 0 0 10px 0 hsla(0, 6%, 58%, 0.6);
+    -webkit-box-shadow: 0 0 20px 0 hsla(0, 6%, 58%, 0.6);
+    -moz-box-shadow: 0 0 20px 0 hsla(0, 6%, 58%, 0.6);
+    // padding-top: 20px;
+    .invoive-img {
+      text-align: center;
+
+      > img {
+        width: 100%;
+      }
+
+      .download {
+        margin-top: 20px;
+        margin-bottom: 20px;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+
+        > img {
+          width: 32px;
+        }
+
+        > span {
+          margin-left: 10px;
+          color: #808080;
+        }
+      }
+    }
+
+    .push-again-btn {
+      margin: 25px 30px;
+      //background-image: linear-gradient(to right, #7d4ea1, #40397c);
+      background: #064C8A;
+      border-radius: 45px;
+      //border-radius: 50px;
+      color: #ffffff;
+      text-align: center;
+      padding: 25px 0;
+    }
+
+    .blue-push-again-btn {
+      .color-background-color('blue');
+    }
+
+    .green-push-again-btn {
+      .color-background-color('green');
+    }
+  }
+}
+</style>
+
+
+

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
src/pages/parkingFee/parkingReceipt/parkingInvoiceApply.vue


+ 246 - 243
src/pages/parkingFee/parkingReceipt/parkingOrderDetail.vue

@@ -1,243 +1,246 @@
-<template>
-  <scroll-view class="scroll-Y" scroll-y>
-    <div class="order-price">
-      <div class="text">开票金额</div>
-      <div class="price">¥{{ parFee }}元</div>
-    </div>
-    <div class="tab-header">缴费订单总数 <span class="red">{{orderList.length}}单</span></div>
-    <div class="order-list">
-      <div class="order-item" v-for="(item, index) in orderList" :key="index" @click="gotoDetail(item)">
-        <!-- 0:停车缴费  1:活动报名 2:积分兑换 -->
-        <template v-if="item.invoiceCategory === 0">
-          <div class="item-header">
-            <div class="carNo">{{ item.carNo }}</div>
-            <div class="price">¥{{ getOrderItemPrice(item) }}</div>
-          </div>
-          <div class="item-bottom">
-            <div>{{ item.parkName }}</div>
-            <div>订单号: {{ item.orderNo }}</div>
-            <div>入场时间: {{ item.enterTime }}</div>
-            <div>停车时长: {{ item.serviceHour }}分钟</div>
-          </div>
-        </template>
-        <template v-else-if="item.invoiceCategory === 1"></template>
-        <template v-else-if="item.invoiceCategory === 2"></template>
-      </div>
-    </div>
-  </scroll-view>
-</template>
-
-<script>
-// const app = getApp()
-import uni from '@/utils/uniHooks'
-export default {
-  data() {
-    return {
-      picUrl: this.$picUrl,
-      order: {},
-      parFee: '',
-      id: '',
-      orderList: [],
-      optionsQuery: null,
-      useParkingOrderCache: false,
-    }
-  },
-  created() {
-    const options = this.$route.query
-    this.optionsQuery = options;
-    this.id = options.id;
-    const useParkingOrderCache = options?.useParkingOrderCache || 'false';
-    // 如果是通过"发票申请"页面进入的,可以适用本地缓存直接获取数据
-    if (useParkingOrderCache == 'true') {
-      this.useParkingOrderCache = true;
-      const tempParkingOrder = this.$store.state?.tempParkingOrder;
-      this.parFee = (tempParkingOrder.invoiceAmount / 100).toFixed(2);
-      const orderList = tempParkingOrder.list;
-      orderList.forEach(item => {
-        item.invoiceCategory = 0;
-      });
-      this.orderList = orderList;
-    } else {
-      this.useParkingOrderCache = false;
-    }
-  },
-  mounted() {
-    setTimeout(() => {
-        uni.setNavigationBarTitle({
-            title: '支付订单详情',
-        });
-    }, 300);
-    if (!this.useParkingOrderCache) {
-      this.getInvoicedDetail(this.id);
-    }
-  },
-  methods: {
-    gotoDetail(item) {
-      console.log(this.orderList);
-      // this.$router.push({ path: '/pages/parkingFee/parkingFeeDetailSuccess?orderNo=' + item.orderNo });
-    },
-    // 根据发票id获取支付记录详情信息
-    getInvoicedDetail(id) {
-      const self = this;
-      const data = {
-        id: id
-      }
-      self.$md(data);
-      uni.request({
-        url: self.$baseURL + 'api/1.0/invoice/myParkOrderListByInvoiceId?id=' + id,
-        method: 'POST',
-        data: data,
-        header: JSON.parse(uni.getStorageSync('handleUser')),
-        success: (res) => {
-          console.log('获取订单详情信息', res.data)
-          if (res.data.code === 0) {
-            self.order = res.data.data.list[0];
-            self.parFee = (res.data.data.invoiceAmount / 100).toFixed(2);
-            self.orderList = res.data.data.list;
-          } else {
-            uni.showToast({
-              title: res.data.msg,
-              duration: 2000,
-              icon: 'none'
-            });
-          }
-        },
-        fail: () => {
-          uni.showToast({
-            title: '服务器开小差了呢,请您稍后再试',
-            icon: 'none'
-          });
-        },
-      });
-    },
-    getOrderItemPrice(item) {
-      if (this.useParkingOrderCache) {
-        const payFee = item.serviceFee;
-        return (payFee / 100).toFixed(2)
-      } else {
-        const payFee = item.invoiceAmount;
-        return (payFee / 100).toFixed(2)
-      }
-    },
-  }
-}
-</script>
-
-<style lang="less" scoped>
-.scroll-Y {
-  width: 100%;
-  display: flex;
-  flex-direction: column;
-  height: 100vh;
-  background: #F4F7FF;
-  padding: 20px;
-  box-sizing: border-box;
-
-  .order-price {
-    // border-radius: 10px;
-    text-align: center;
-    // background-color: #ffffff;
-    padding: 30px;
-    margin-bottom: 36px;
-    // width: 690px;
-    // height: 189px;
-
-    background: #FAFBFF;
-    border-radius: 4px;
-    border: 1px solid #D8DAE0;
-
-    .text {
-      font-size: 30px;
-      font-weight: 400;
-      color: #333333;
-      line-height: 42px;
-      margin-bottom: 20px;
-    }
-
-    .price {
-      // width: 158px;
-      // height: 67px;
-      font-size: 48px;
-      // font-family: PingFangSC-Semibold, PingFang SC;
-      font-weight: 600;
-      color: #333333;
-      line-height: 67px;
-    }
-  }
-
-  .tab-header {
-    color: #808080;
-    padding: 10px 20px 20px;
-    // width: 690px;
-    // height: 189px;
-
-    // background: #FAFBFF;
-    // border-radius: 4px;
-    // border: 1px solid #D8DAE0;
-
-  }
-
-  .order-list {
-    .order-item {
-      // border-radius: 20px;
-      // background-color: #ffffff;
-      padding: 30px;
-      // margin-bottom: 20px;
-
-      // width: 690px;
-      // height: 345px;
-      background: #FAFBFF;
-      border-radius: 4px;
-      border: 1px solid #D8DAE0;
-
-      .item-header {
-        padding-top: 6px;
-        padding-bottom: 6px;
-        font-size: 30px;
-        display: flex;
-        align-items: center;
-        justify-content: space-between;
-        border: 400;
-        border-bottom: 1px solid #D8DAE0;
-        padding-bottom: 20px;
-        padding-left: 10px;
-
-        .carNo {
-          font-size: 36px;
-          font-weight: 600;
-          color: #333333;
-          line-height: 50px;
-        }
-        .price {
-          font-size: 30px;
-          font-weight: 600;
-          color: #333333;
-          line-height: 42px;
-        }
-      }
-
-      .item-bottom {
-        // color: #808080;
-        // padding-top: 20px;
-        // padding-left: 10px;
-
-        font-size: 28px;
-        font-weight: 400;
-        color: #999999;
-        line-height: 40px;
-        padding-top: 8px;
-        >div {
-          padding-top: 12px;
-        }
-      }
-    }
-  }
-
-  .red {
-    color: #064C8A;
-  }
-}
-</style>
-
-
-
+<template>
+  <scroll-view class="scroll-Y" scroll-y>
+    <div class="order-price">
+      <div class="text">开票金额</div>
+      <div class="price">¥{{ parFee }}元</div>
+    </div>
+    <div class="tab-header">缴费订单总数 <span class="red">{{ orderList.length }}单</span></div>
+    <div class="order-list">
+      <div class="order-item" v-for="(item, index) in orderList" :key="index" @click="gotoDetail(item)">
+        <!-- 0:停车缴费  1:活动报名 2:积分兑换 -->
+        <template v-if="item.invoiceCategory === 0">
+          <div class="item-header">
+            <div class="carNo">{{ item.carNo }}</div>
+            <div class="price">¥{{ getOrderItemPrice(item) }}</div>
+          </div>
+          <div class="item-bottom">
+            <div>{{ item.parkName }}</div>
+            <div>订单号: {{ item.orderNo }}</div>
+            <div>入场时间: {{ item.enterTime }}</div>
+            <div>停车时长: {{ item.serviceHour }}分钟</div>
+          </div>
+        </template>
+        <template v-else-if="item.invoiceCategory === 1"></template>
+        <template v-else-if="item.invoiceCategory === 2"></template>
+      </div>
+    </div>
+  </scroll-view>
+</template>
+
+<script>
+// const app = getApp()
+import uni from '@/utils/uniHooks'
+
+export default {
+  data() {
+    return {
+      picUrl: this.$picUrl,
+      order: {},
+      parFee: '',
+      id: '',
+      orderList: [],
+      optionsQuery: null,
+      useParkingOrderCache: false,
+    }
+  },
+  created() {
+    const options = this.$route.query
+    this.optionsQuery = options;
+    this.id = options.id;
+    const useParkingOrderCache = options?.useParkingOrderCache || 'false';
+    // 如果是通过"发票申请"页面进入的,可以适用本地缓存直接获取数据
+    if ( useParkingOrderCache == 'true' ) {
+      this.useParkingOrderCache = true;
+      const tempParkingOrder = this.$store.state?.tempParkingOrder;
+      this.parFee = ( tempParkingOrder.invoiceAmount / 100 ).toFixed(2);
+      const orderList = tempParkingOrder.list;
+      orderList.forEach(item => {
+        item.invoiceCategory = 0;
+      });
+      this.orderList = orderList;
+    } else {
+      this.useParkingOrderCache = false;
+    }
+  },
+  mounted() {
+    setTimeout(() => {
+      uni.setNavigationBarTitle({
+        title: '支付订单详情',
+      });
+    },300);
+    if ( !this.useParkingOrderCache ) {
+      this.getInvoicedDetail(this.id);
+    }
+  },
+  methods: {
+    gotoDetail( item ) {
+      console.log(this.orderList);
+      // this.$router.push({ path: '/pages/parkingFee/parkingFeeDetailSuccess?orderNo=' + item.orderNo });
+    },
+    // 根据发票id获取支付记录详情信息
+    getInvoicedDetail( id ) {
+      const self = this;
+      const data = {
+        id: id
+      }
+      self.$md(data);
+      uni.request({
+        url: self.$baseURL + 'api/1.0/invoice/myParkOrderListByInvoiceId?id=' + id,
+        method: 'POST',
+        data: data,
+        header: JSON.parse(uni.getStorageSync('handleUser')),
+        success: ( res ) => {
+          console.log('获取订单详情信息',res.data)
+          if ( res.data.code === 0 ) {
+            self.order = res.data.data.list[0];
+            self.parFee = ( res.data.data.invoiceAmount / 100 ).toFixed(2);
+            self.orderList = res.data.data.list;
+          } else {
+            uni.showToast({
+              title: res.data.msg,
+              duration: 2000,
+              icon: 'none'
+            });
+          }
+        },
+        fail: () => {
+          uni.showToast({
+            title: '服务器开小差了呢,请您稍后再试',
+            icon: 'none'
+          });
+        },
+      });
+    },
+    getOrderItemPrice( item ) {
+      if ( this.useParkingOrderCache ) {
+        const payFee = item.serviceFee;
+        return ( payFee / 100 ).toFixed(2)
+      } else {
+        const payFee = item.invoiceAmount;
+        return ( payFee / 100 ).toFixed(2)
+      }
+    },
+  }
+}
+</script>
+
+<style lang="less" scoped>
+.scroll-Y {
+  width: 100%;
+  display: flex;
+  flex-direction: column;
+  height: 100vh;
+  background: #F4F7FF;
+  padding: 20px;
+  box-sizing: border-box;
+
+  .order-price {
+    // border-radius: 10px;
+    text-align: center;
+    // background-color: #ffffff;
+    padding: 30px;
+    margin-bottom: 36px;
+    // width: 690px;
+    // height: 189px;
+
+    background: #FAFBFF;
+    border-radius: 4px;
+    border: 1px solid #D8DAE0;
+
+    .text {
+      font-size: 30px;
+      font-weight: 400;
+      color: #333333;
+      line-height: 42px;
+      margin-bottom: 20px;
+    }
+
+    .price {
+      // width: 158px;
+      // height: 67px;
+      font-size: 48px;
+      // font-family: PingFangSC-Semibold, PingFang SC;
+      font-weight: 600;
+      color: #333333;
+      line-height: 67px;
+    }
+  }
+
+  .tab-header {
+    color: #808080;
+    padding: 10px 20px 20px;
+    // width: 690px;
+    // height: 189px;
+
+    // background: #FAFBFF;
+    // border-radius: 4px;
+    // border: 1px solid #D8DAE0;
+
+  }
+
+  .order-list {
+    .order-item {
+      // border-radius: 20px;
+      // background-color: #ffffff;
+      padding: 30px;
+      // margin-bottom: 20px;
+
+      // width: 690px;
+      // height: 345px;
+      background: #FAFBFF;
+      border-radius: 4px;
+      border: 1px solid #D8DAE0;
+
+      .item-header {
+        padding-top: 6px;
+        padding-bottom: 6px;
+        font-size: 30px;
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        border: 400;
+        border-bottom: 1px solid #D8DAE0;
+        padding-bottom: 20px;
+        padding-left: 10px;
+
+        .carNo {
+          font-size: 36px;
+          font-weight: 600;
+          color: #333333;
+          line-height: 50px;
+        }
+
+        .price {
+          font-size: 30px;
+          font-weight: 600;
+          color: #333333;
+          line-height: 42px;
+        }
+      }
+
+      .item-bottom {
+        // color: #808080;
+        // padding-top: 20px;
+        // padding-left: 10px;
+
+        font-size: 28px;
+        font-weight: 400;
+        color: #999999;
+        line-height: 40px;
+        padding-top: 8px;
+
+        > div {
+          padding-top: 12px;
+        }
+      }
+    }
+  }
+
+  .red {
+    color: #064C8A;
+  }
+}
+</style>
+
+
+

+ 4 - 2
src/utils/cache-tool.js

@@ -34,9 +34,11 @@ export default {
 	},
 	},
 	getCurEnvConst (key) {
 	getCurEnvConst (key) {
 		const curEnvName = this.getEnv();
 		const curEnvName = this.getEnv();
-    console.log(373737, curEnvName)
+    	console.log(373737, curEnvName)
 		const curEnvConst =  ENV_LIST.find( item => item.name == curEnvName);
 		const curEnvConst =  ENV_LIST.find( item => item.name == curEnvName);
-    console.log('curEnvConst37', curEnvConst)
+    	console.log('curEnvConst37', curEnvConst)
+		// 如果是来自 window.injectConfig
+		
 		if (key) {
 		if (key) {
 			return curEnvConst?.constants[key];
 			return curEnvConst?.constants[key];
 		} else {
 		} else {

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно