Commit eae77c584afebe708c9ac62ba5516fa7bc84340b

Authored by 刘淇
1 parent 6e9a3492

江阴领取优惠券

.env.development 0 → 100644
  1 +NODE_ENV='development'
  2 +let VUE_APP_URL='https://bus.jycrtc.com/'
  3 +let VUE_APP_URL_TWO='https://pay.jycrtc.com/'
... ...
.env.production 0 → 100644
  1 +NODE_ENV='production'
  2 +let VUE_APP_URL='https://bus.jycrtc.com/'
  3 +let VUE_APP_URL_TWO='https://pay.jycrtc.com/'
... ...
src/api/couponPay/couponPay.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +
  3 +export function scanCouponQR(params) {
  4 + return request({
  5 + requestBase:'VUE_APP_URL',
  6 + url: 'business/h5/qr/scanCouponQR',
  7 + method: 'post',
  8 + data: params
  9 + })
  10 +}
  11 +
  12 +
  13 +
  14 +
... ...
src/api/orderPay/orderPay.js
... ... @@ -36,6 +36,7 @@ export function bankH5Pay(params) { // 农行
36 36  
37 37 export function queryParkingRecordPageByCarNumbers(params) { // 支付完成后查询记录
38 38 return request({
  39 + requestBase:'VUE_APP_URL_TWO',
39 40 url: 'queryParkOrder/queryParkingRecordPageByCarNumbers',
40 41 method: 'post',
41 42 data: params
... ...
src/router/index.js
... ... @@ -11,7 +11,7 @@ export default new Router({
11 11 {
12 12 path: '/',
13 13 redirect: {
14   - name: 'plateNumber'
  14 + name: 'coupon'
15 15 }
16 16 },
17 17 // {
... ...
src/utils/request.js
... ... @@ -2,16 +2,34 @@ import axios from 'axios'
2 2  
3 3 // let _url = process.env.API_ROOT
4 4 // axios.defaults.baseURL = process.env.API_ROOT
  5 +
5 6 const service = axios.create({
6   - // https://dev.renniting.cn/pay/ 赤峰测试
7   - // http://pay.service.renniting.cn/ 赤峰
8   - baseURL: 'https://pay.jycrtc.com/', // url = base url + request url
  7 + // baseURL:'https://bus.jycrtc.com/',
  8 + baseURL:process.env.VUE_APP_URL,
9 9 // withCredentials: true, // send cookies when cross-domain requests
10   - timeout: 6000 // request timeout
  10 + timeout: 6000, // request timeout
  11 + withCredentials: false,
  12 + headers:{
  13 + 'Access-Control-Allow-Origin':'*',
  14 + 'Content-Type':'application/x-www-form-urlencoded'
  15 + }
11 16 })
12 17  
13 18 service.interceptors.request.use(
  19 +
14 20 config => {
  21 + if(config.requestBase=='VUE_APP_URL'){
  22 + // config.headers['Content-Type']="application/x-www-form-urlencoded";
  23 + config.baseURL='https://bus.jycrtc.com/';
  24 + config.data=JSON.stringify(config.data);
  25 +
  26 + }else if(config.requestBase=='VUE_APP_URL_TWO'){
  27 + // config.headers['Content-Type']="application/x-www-form-urlencoded";
  28 + config.baseURL='https://pay.jycrtc.com/';
  29 + config.data=JSON.stringify(config.data);
  30 +
  31 + }
  32 +
15 33 return config
16 34 },
17 35 error => {
... ...
src/utils/utils.js
... ... @@ -145,7 +145,7 @@ export default {
145 145  
146 146 myDeviceInfo: 'BC0703A4-AFB0-4B51-9089-9B7487C0CC6E', // 公共请求设备信息
147 147  
148   - myVxAppId: 'wxfdc1af620d3ab750',
  148 + myVxAppId: 'wx74f1b0ec227958da',
149 149  
150 150 myOrgId: '10107', //
151 151  
... ...
src/views/parkPay/coupon.vue
1 1 <template>
2   - <div>
3   - <img :src="successiconUrl" alt="" style="margin: 10px auto;width: 64px;height: 64px;">
4   - <div style="padding: 10px 30px 50px">
5   - <p>尊敬的车主您好:</p>
6   - <p>尊敬的车主您好:</p>
7   - <p>尊敬的车主您好:</p>
8   - </div>
  2 + <div>
  3 + <img :src="successiconUrl" alt="" style="margin: 10px auto;width: 64px;height: 64px;">
  4 + <div style="padding: 10px 30px 50px">
  5 + <p>尊敬的车主您好:</p>
  6 + <p>尊敬的车主您好:</p>
  7 + <p>尊敬的车主您好:</p>
  8 + </div>
9 9 <div style="padding: 0 20px">
10 10 <mt-button size="large" type="primary" @click="toPay" style="margin-bottom: 20px;">去支付</mt-button>
11 11 <mt-button size="large" type="danger" @click="toBackPage">返回</mt-button>
12 12 </div>
13 13  
14   - </div>
  14 + </div>
15 15 </template>
16 16  
17 17 <script>
  18 +
  19 +
  20 +import { scanCouponQR } from '@/api/couponPay/couponPay.js'
  21 +
18 22 export default {
19 23 name: "coupon",
20   - data(){
21   - return{
22   - successiconUrl:require('../../assets/images/successIcon.png'),
23   - loseiconUrl:require('../../assets/images/loseIcon.png'),
  24 + data() {
  25 + return {
  26 + successiconUrl: require('../../assets/images/successIcon.png'),
  27 + loseiconUrl: require('../../assets/images/loseIcon.png'),
  28 + carNum: '苏BB210V',
  29 + carNumberColor: ''
24 30 }
25 31 },
26   - methods:{
27   - toPay(){
  32 + created() {
  33 +
  34 + // this.carNum = this.$route.query.carNumber // 获取车牌号
  35 + // this.carNumberColor = this.$route.query.carNumberColor // 获取颜色 0:蓝牌;1:黄牌;2:白牌;3:黑牌;4:绿色
  36 + // this.currentTabActive = this.$route.query.parkFlag ? this.$route.query.parkFlag : 0
  37 + // console.log(this.currentTabActive)
  38 + // console.log(this.carNumber)
  39 + this.scanCouponQR()
  40 + },
  41 + methods: {
  42 + scanCouponQR(){
  43 + var salt = this.$utils.myCommonSalt(32);
  44 + var jsondata = {
  45 + app_id: this.$utils.myVarAppid,
  46 + deviceInfo: this.$utils.myDeviceInfo,
  47 + salt: salt,
  48 + sign_type: "md5",
  49 + carType:'02',
  50 + codeType:'2',
  51 + cardRelParkNo:'123qwe',
  52 + key:'1',
  53 + carNum: this.carNum,
  54 + // carNumberColor: this.carNumberColor,
  55 + orgId: this.$utils.myOrgId,
  56 + terminalSource:'7',
  57 + // token:'e2c1e43722dd43a5b7e268001b39e6f0'
  58 + }
  59 + jsondata.sign = this.$utils.signObject(jsondata)
  60 + console.log(jsondata)
  61 + scanCouponQR(jsondata).then(response => {
  62 + console.log(response)
  63 + })
  64 + },
  65 + toPay() {
28 66 this.$router.push({
29   - path:'couponPay'
  67 + path: 'couponPay'
30 68 })
31 69 },
32   - toBackPage(){
  70 + toBackPage() {
33 71 this.$router.back()
34 72 }
35 73 }
... ...
src/views/parkPay/plateNumber.vue
... ... @@ -307,8 +307,8 @@ export default {
307 307 activeBG:'#0054C0',
308 308 formData: {
309 309 commonCard: '1',
310   - num0: '蒙',
311   - num1: 'D',
  310 + num0: '苏',
  311 + num1: 'B',
312 312 num2: '',
313 313 num3: '',
314 314 num4: '',
... ... @@ -452,7 +452,7 @@ export default {
452 452  
453 453  
454 454 this.$router.push({
455   - path:'parkRecord',
  455 + path:'coupon',
456 456 query:{
457 457 carNumber:plateLicense,
458 458 carNumberColor: this.currentColor
... ...
vue.config.js
1   -module.exports = {chainWebpack:config=>{    config.rule('js').include.add(/node_modules\/(dom7|swiper)\/.*/)  }}
  1 +//
  2 +// module.exports = {
  3 +// dev: {
  4 +//
  5 +// // Paths
  6 +// assetsSubDirectory: 'static',
  7 +// assetsPublicPath: '/',
  8 +// proxyTable: {
  9 +// '/api': {
  10 +// target: 'https://bus.jycrtc.com/', //后期可以改
  11 +// changeOrigin: true,
  12 +// pathRewrite: {
  13 +// '^/api': ''
  14 +// }
  15 +// }
  16 +// }, //配置跨域支持
  17 +// }
  18 +// }
... ...