Commit 5907d469e7a981eb26f064160215387cdb035b3f

Authored by 刘淇
1 parent e82dfe17

西城 电子发票

src/router/index.js
@@ -49,6 +49,16 @@ export default new Router({ @@ -49,6 +49,16 @@ export default new Router({
49 }, 49 },
50 50
51 // ---------------- 电子发票导航 51 // ---------------- 电子发票导航
  52 +
  53 +
  54 + {
  55 + path: '/eInvoiceNav',
  56 + name: 'eInvoiceNav',
  57 + component: () => import("@/views/eInvoice/eInvoiceNav.vue"),
  58 + meta:{
  59 + title:'电子发票'
  60 + }
  61 + },
52 { 62 {
53 path: '/eInvoiceWrap', 63 path: '/eInvoiceWrap',
54 name: 'eInvoiceWrap', 64 name: 'eInvoiceWrap',
src/views/eInvoice/eInvoiceNav.vue 0 → 100644
  1 +<template>
  2 + <div>
  3 + <group>
  4 + <cell
  5 + title="停车发票"
  6 + inline-desc='仅支持微信支付订单,按照实际消费金额开票'
  7 + is-link
  8 + :link="{path:'./parkInvoice',query:{invoiceType:1}}"
  9 + >
  10 + <!-- anything -->
  11 + </cell>
  12 +
  13 + <cell
  14 + title="购买会员卡发票"
  15 + inline-desc='支持购买月卡、季卡、年卡产生的费用,开具发票'
  16 + is-link
  17 + :link="{path:'./parkInvoice',query:{invoiceType:2}}"
  18 + >
  19 + <!-- anything -->
  20 + </cell>
  21 +
  22 + <cell
  23 + title="开票历史" is-link
  24 + :link="{path:'./invoiceRecord'}"
  25 + >
  26 + <!-- anything -->
  27 + </cell>
  28 +
  29 + <cell-box>
  30 + 注: 开具电子发票之前请绑定车牌并提交行驶证审核通过。
  31 + </cell-box>
  32 + </group>
  33 + </div>
  34 +</template>
  35 +
  36 +<script>
  37 +import {
  38 + getOpenIdByCode,
  39 + getTokenByOpenId,
  40 + queryUserInfo,
  41 + queryCustPersonBaseInfo,
  42 + logout
  43 +} from "@/api/selfNav/selfNav";
  44 +export default {
  45 + name: "eInvoiceNav",
  46 + data() {
  47 + return {
  48 + webCode: ""
  49 + };
  50 + },
  51 + created() {
  52 + this.webCode = this.getUrlParam("code");
  53 + },
  54 + mounted() {
  55 + this.getopenid();
  56 + },
  57 + methods: {
  58 + getUrlParam(name) {
  59 + var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  60 + var r = window.location.search.substr(1).match(reg);
  61 + if (r != null) return unescape(r[2]);
  62 + return null;
  63 + },
  64 + getopenid() {
  65 + let jsondata = {
  66 + appId: this.$utils.myVxAppId,
  67 + code: this.webAppCode
  68 + };
  69 + getOpenIdByCode(jsondata).then(data => {
  70 + console.log(data);
  71 + if (data.code == "0") {
  72 + let openid = data.data;
  73 + sessionStorage.setItem("wx_openId", openid);
  74 + console.log("用户 openid " + openid);
  75 + this.getTokenByOpenId(openid);
  76 + } else {
  77 + this.$vux.toast.text(data.message, "top");
  78 + }
  79 + });
  80 + },
  81 + // 获取token
  82 + getTokenByOpenId(openid) {
  83 + let that = this;
  84 + var jsondata = {
  85 + openid: openid,
  86 + deviceInfo: this.$utils.myDeviceInfo
  87 + };
  88 + getTokenByOpenId(jsondata).then(data => {
  89 + console.log("执行获取token的接口 " + JSON.stringify(data));
  90 + if (data.code == 0) {
  91 + console.log("用户 token " + data.data.token);
  92 + let _token = data.data.token;
  93 + console.log("getTokenByOpenId获取到的" + _token);
  94 + sessionStorage.setItem("wx_Token", data.data.token);
  95 + // alert(data.data.token)
  96 + sessionStorage.setItem("WXPhone", data.data.phoneNum);
  97 + that.getinfoself(); //获取用户信息
  98 + } else {
  99 + this.$vux.toast.text(data.message, "top");
  100 + }
  101 + this.$vux.loading.hide();
  102 + });
  103 + }
  104 + }
  105 +};
  106 +</script>
  107 +
  108 +<style scoped>
  109 + >>> .vux-label {
  110 + padding-right: 20px;
  111 + }
  112 +</style>
src/views/mySelf/mySelf.vue 0 → 100644
  1 +<template>
  2 +
  3 +</template>
  4 +
  5 +<script>
  6 +export default {
  7 + name: "mySelf"
  8 +};
  9 +</script>
  10 +
  11 +<style scoped>
  12 +
  13 +</style>
src/views/mySelf/selfNav.vue
@@ -48,9 +48,9 @@ @@ -48,9 +48,9 @@
48 48
49 <!--<mt-cell title="建议反馈" is-link></mt-cell>--> 49 <!--<mt-cell title="建议反馈" is-link></mt-cell>-->
50 50
51 - <!--<div class="leftRightPadding" style="margin-top: 34px" v-show="loginShow">-->  
52 - <!--<mt-button type="primary" size="large" @click="loginHandle">{{ loginTxt }}</mt-button>-->  
53 - <!--</div>--> 51 + <div class="leftRightPadding" style="margin-top: 34px" v-show="loginShow">
  52 + <mt-button type="primary" size="large" @click="loginHandle">{{ loginTxt }}</mt-button>
  53 + </div>
54 54
55 </div> 55 </div>
56 </template> 56 </template>