Commit cdab3fc7 by stingys@163.com

test

parents
node_modules/
\ No newline at end of file
# collision
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Run your tests
```
npm run test
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
module.exports = {
"presets": [
"@vue/cli-plugin-babel/preset"
],
"plugins": [
[
"import",
{
"libraryName": "vant",
"libraryDirectory": "es",
"style": true
},
"vant"
]
]
}
\ No newline at end of file
body[data-v-0fd9e7f6]{background:#f5f5f5}body .container .top[data-v-0fd9e7f6]{background:#fff;margin-bottom:8px}body .container .top h3[data-v-0fd9e7f6]{padding:10px;text-align:center;font-weight:700}body .container .top .banner[data-v-0fd9e7f6]{position:relative}body .container .top .banner .record[data-v-0fd9e7f6]{position:absolute;top:8px;right:0}body .container .top .price[data-v-0fd9e7f6]{padding:5px;font-size:15px}body .container .top .price>span[data-v-0fd9e7f6]:first-child{color:#ffb000;margin-right:20px}body .container .top .price>span[data-v-0fd9e7f6]:nth-child(2){color:#ff7b00;margin-right:8px}body .container .mid .icon i[data-v-0fd9e7f6]{display:inline-block;vertical-align:top}body .container .footer[data-v-0fd9e7f6]{background:#fff;padding:10px}body .container .footer .example[data-v-0fd9e7f6]{width:30%;margin-right:10px}body .container .footer .query[data-v-0fd9e7f6]{width:65%}body .container .footer .check[data-v-0fd9e7f6]{margin:8px 0;font-size:10px;color:#4a4a4a}body .container .footer .check span[data-v-0fd9e7f6]{color:#ff7b00}body .container .footer p[data-v-0fd9e7f6]{font-size:10px;color:#a9a9a9}body .container .footer_baner[data-v-0fd9e7f6]{position:fixed;bottom:0;padding:10px}.container[data-v-51fd81cf]{background:#f5f5f5}.container h3[data-v-51fd81cf]{padding:10px;font-weight:700;text-align:center;background:#fff;margin-bottom:10px}.container .van-cell-group__title[data-v-51fd81cf]{font-weight:700;color:#323232;background:#fff}.container .van-cell[data-v-51fd81cf]{color:#737373}.container .price[data-v-51fd81cf]{color:#ff7f00}.container .mid[data-v-51fd81cf]{margin:10px 0}.container .van-button[data-v-51fd81cf]{position:fixed;bottom:0;width:100%}.container .van-image[data-v-51fd81cf]{width:50px;height:50px;margin-right:8px}.info[data-v-544a0f25]{padding:10px 0 0 20px;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-box-flex:1;flex:1;padding-left:12px}.info .info-content[data-v-544a0f25]{-webkit-box-flex:1;flex:1;padding-left:12px}.info .info-content .phone[data-v-544a0f25]{font-weight:700}.order-list-content[data-v-544a0f25]{background:#f5f5f5;padding:10px}.order-list-content ul .order-item[data-v-544a0f25]{color:#666;padding:10px;margin-bottom:10px;border-bottom:1px solid #f2f2f2;border-radius:8px;background:#fff}.order-list-content ul .order-item .item-header[data-v-544a0f25]{height:40px;line-height:40px;background:#fcfcfc;border-radius:8px 8px 0 0}.order-list-content ul .order-item .item-header .item-car img[data-v-544a0f25]{float:left;width:25px;margin:5px 5px 0 0;vertical-align:-6px}.order-list-content ul .order-item .item-header .item-date[data-v-544a0f25]{float:right;color:#777}.order-list-content ul .order-item .item-body[data-v-544a0f25],.order-list-content ul .order-item .item-footer[data-v-544a0f25]{overflow:hidden;margin-bottom:5px}.order-list-content ul .order-item .item-body span[data-v-544a0f25]:nth-child(2),.order-list-content ul .order-item .item-footer span[data-v-544a0f25]:nth-child(2){float:right}.order-list-content ul .order-item .item-status[data-v-544a0f25]{border-top:1px solid #f2f2f2;position:relative;padding:8px 0;background:url(http://test.car.checheng.net/storage/2019-12-13/HVTRulewsvJVsnAf7cA7jkHDLjWiAoWJoyrcED5x.png) 98% no-repeat;background-size:14px}.order-list-content ul .order-item .item-status .item-apply[data-v-544a0f25]{text-decoration:none;position:absolute;right:7px;top:7px;display:inline-block;margin-left:5px;padding:6px 10px;line-height:1;color:#fff;font-size:14px;text-align:center;border-radius:15px;background:#f60;cursor:pointer}.order-list-content ul .order-item .item-status-0[data-v-544a0f25]{color:#f60}.order-list-content ul .order-item .item-status-1[data-v-544a0f25],.order-list-content ul .order-item .item-status-3[data-v-544a0f25],.order-list-content ul .order-item .item-status-4[data-v-544a0f25]{color:#67c23a}.order-list-content ul .order-item .item-status-2[data-v-544a0f25],.order-list-content ul .order-item .item-status-5[data-v-544a0f25],.order-list-content ul .order-item .item-status-10[data-v-544a0f25]{color:#e9190b}.container[data-v-0710390c]{background:#f5f5f5}.container .van-cell-group__title[data-v-0710390c]{font-weight:700;color:#323232;background:#fff}.container .van-cell-group[data-v-0710390c]{margin-bottom:8px}
\ No newline at end of file
@charset "utf-8";*{margin:0;padding:0}img{border:none;display:block}em,i{font-style:normal}blockquote,body,dd,div,dl,dt,fieldset,font,form,h1,h2,h3,h4,h5,h6,input,li,ol,p,pre,td,textarea,th,ul{padding:0;margin:0;font-family:微软雅黑}table{border-collapse:collapse;border-spacing:0}h1,h2,h3,h4,h5,h6{font-weight:400;font-size:100%}dd,dl,dt,li,ol,ul{list-style:none}button,checkbox,form,input,radio,select,textarea{vertical-align:top}a{color:#000}a,a:link,a:visited{text-decoration:none}a:hover{color:#cd0200;text-decoration:underline}button,input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:none}body,html{height:100%}
\ No newline at end of file
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.ico><title>collision</title><link href=/css/about.03c289ea.css rel=prefetch><link href=/js/about.36666d07.js rel=prefetch><link href=/css/app.73e02543.css rel=preload as=style><link href=/css/chunk-vendors.5303f83e.css rel=preload as=style><link href=/js/app.e5cf7944.js rel=preload as=script><link href=/js/chunk-vendors.c4403347.js rel=preload as=script><link href=/css/chunk-vendors.5303f83e.css rel=stylesheet><link href=/css/app.73e02543.css rel=stylesheet></head><body><noscript><strong>We're sorry but collision doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/js/chunk-vendors.c4403347.js></script><script src=/js/app.e5cf7944.js></script></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
(function(e){function t(t){for(var r,o,i=t[0],c=t[1],s=t[2],l=0,f=[];l<i.length;l++)o=i[l],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&f.push(a[o][0]),a[o]=0;for(r in c)Object.prototype.hasOwnProperty.call(c,r)&&(e[r]=c[r]);p&&p(t);while(f.length)f.shift()();return u.push.apply(u,s||[]),n()}function n(){for(var e,t=0;t<u.length;t++){for(var n=u[t],r=!0,o=1;o<n.length;o++){var i=n[o];0!==a[i]&&(r=!1)}r&&(u.splice(t--,1),e=c(c.s=n[0]))}return e}var r={},o={app:0},a={app:0},u=[];function i(e){return c.p+"js/"+({about:"about"}[e]||e)+"."+{about:"36666d07"}[e]+".js"}function c(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,c),n.l=!0,n.exports}c.e=function(e){var t=[],n={about:1};o[e]?t.push(o[e]):0!==o[e]&&n[e]&&t.push(o[e]=new Promise((function(t,n){for(var r="css/"+({about:"about"}[e]||e)+"."+{about:"03c289ea"}[e]+".css",a=c.p+r,u=document.getElementsByTagName("link"),i=0;i<u.length;i++){var s=u[i],l=s.getAttribute("data-href")||s.getAttribute("href");if("stylesheet"===s.rel&&(l===r||l===a))return t()}var f=document.getElementsByTagName("style");for(i=0;i<f.length;i++){s=f[i],l=s.getAttribute("data-href");if(l===r||l===a)return t()}var p=document.createElement("link");p.rel="stylesheet",p.type="text/css",p.onload=t,p.onerror=function(t){var r=t&&t.target&&t.target.src||a,u=new Error("Loading CSS chunk "+e+" failed.\n("+r+")");u.code="CSS_CHUNK_LOAD_FAILED",u.request=r,delete o[e],p.parentNode.removeChild(p),n(u)},p.href=a;var d=document.getElementsByTagName("head")[0];d.appendChild(p)})).then((function(){o[e]=0})));var r=a[e];if(0!==r)if(r)t.push(r[2]);else{var u=new Promise((function(t,n){r=a[e]=[t,n]}));t.push(r[2]=u);var s,l=document.createElement("script");l.charset="utf-8",l.timeout=120,c.nc&&l.setAttribute("nonce",c.nc),l.src=i(e);var f=new Error;s=function(t){l.onerror=l.onload=null,clearTimeout(p);var n=a[e];if(0!==n){if(n){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;f.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",f.name="ChunkLoadError",f.type=r,f.request=o,n[1](f)}a[e]=void 0}};var p=setTimeout((function(){s({type:"timeout",target:l})}),12e4);l.onerror=l.onload=s,document.head.appendChild(l)}return Promise.all(t)},c.m=e,c.c=r,c.d=function(e,t,n){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},c.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(c.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)c.d(n,r,function(t){return e[t]}.bind(null,r));return n},c.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="/",c.oe=function(e){throw console.error(e),e};var s=window["webpackJsonp"]=window["webpackJsonp"]||[],l=s.push.bind(s);s.push=t,s=s.slice();for(var f=0;f<s.length;f++)t(s[f]);var p=l;u.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("56d7")},"4ee2":function(e,t,n){},"56d7":function(e,t,n){"use strict";n.r(t);n("2d98"),n("041d"),n("3466"),n("c412");var r=n("0261"),o=(n("a4c2"),n("ff52"),n("f753")),a=n.n(o),u={},i=a.a.create(u);i.interceptors.request.use((function(e){return e}),(function(e){return Promise.reject(e)})),i.interceptors.response.use((function(e){return e}),(function(e){return Promise.reject(e)})),Plugin.install=function(e,t){e.axios=i,window.axios=i,Object.defineProperties(e.prototype,{axios:{get:function(){return i}},$axios:{get:function(){return i}}})},r["a"].use(Plugin);Plugin;var c=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"app"}},[n("router-view")],1)},s=[],l=n("4e82"),f={},p=Object(l["a"])(f,c,s,!1,null,null,null),d=p.exports,h=n("c478");n("4ee2");r["a"].use(h["a"]);var m=[{path:"/",name:"home",component:function(){return n.e("about").then(n.bind(null,"d504"))}},{path:"/order",name:"order",component:function(){return n.e("about").then(n.bind(null,"cf2a"))}},{path:"/record",name:"record",component:function(){return n.e("about").then(n.bind(null,"43ef"))}},{path:"/example",name:"example",component:function(){return n.e("about").then(n.bind(null,"f3c2"))}}],b=new h["a"]({routes:m}),v=b,g=(n("976a"),n("0266")),y=(n("610a"),n("09c1")),w=(n("0039"),n("9276")),P=(n("1daf"),n("d2d9")),j=(n("aba3"),n("768e")),x=(n("940b"),n("a0c8")),O=(n("b7e8"),n("7d26")),_=(n("051f"),n("fd31")),E=(n("fa70"),n("8ed0")),S=(n("0759"),n("ab6e")),T=(n("47a6"),n("01ae")),k=(n("4f8a"),n("6acf")),C=(n("127e"),n("e5fd"));r["a"].use(g["a"]).use(y["a"]).use(w["a"]).use(P["a"]).use(j["a"]).use(x["a"]).use(O["a"]).use(_["a"]).use(E["a"]).use(S["a"]).use(T["a"]).use(k["a"]).use(C["a"]);var A=n("aac1"),L=n.n(A),N=new L.a;r["a"].use(N),a.a.defaults.baseURL="http://weapp.car.checheng.net/api/",a.a.defaults.headers["Content-Type"]="application/x-www-form-urlencoded",r["a"].config.productionTip=!1,r["a"].prototype.$http=a.a,new r["a"]({router:v,render:function(e){return e(d)}}).$mount("#app")}});
//# sourceMappingURL=app.e5cf7944.js.map
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "collision",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"core-js": "^3.4.3",
"vant": "^2.0.5",
"vue": "^2.6.10",
"vue-router": "^3.1.3"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0",
"@vue/cli-service": "^4.1.0",
"axios": "^0.18.0",
"babel-plugin-import": "^1.8.0",
"less": "^3.0.4",
"less-loader": "^5.0.0",
"vconsole": "^3.3.4",
"vue-cli-plugin-axios": "0.0.4",
"vue-cli-plugin-vant": "^1.0.1",
"vue-template-compiler": "^2.6.10"
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>collision</title>
</head>
<body>
<noscript>
<strong>We're sorry but collision doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
<template>
<div id="app">
<router-view></router-view>
</div>
</template>
\ No newline at end of file
@charset "utf-8";
*{margin:0;padding:0;}
img {border:none; display:block;}
em,i{ font-style:normal;}
body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, form, fieldset, input, textarea, p, blockquote, th, td, font { padding: 0; margin: 0; font-family:"微软雅黑"; }
table { border-collapse: collapse; border-spacing: 0;}
h1, h2, h3, h4, h5, h6 { font-weight: normal; font-size: 100%; }
ol, ul, li, dl, dt, dd { list-style: none; }
input, button, textarea, checkbox, select, radio, form { vertical-align: top; }
a{ color: #000; text-decoration: none; }
a:link, a:visited { text-decoration: none; }
a:hover{color:#cd0200;text-decoration:underline}
input[type="submit"], input[type="reset"], input[type="button"], button {
-webkit-appearance: none;
}
html,body{height:100%}
\ No newline at end of file
import Vue from 'vue'
import './plugins/axios'
import App from './App.vue'
import router from './router'
import axios from 'axios'
import './plugins/vant.js'
import Vconsole from 'vconsole'
let vConsole = new Vconsole()
Vue.use(vConsole)
// axios.defaults.baseURL = '/api'
axios.defaults.baseURL = 'http://weapp.car.checheng.net/api/'
axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded'
Vue.config.productionTip = false
Vue.prototype.$http = axios
new Vue({
router,
render: h => h(App)
}).$mount('#app')
"use strict";
import Vue from 'vue';
import axios from "axios";
// Full config: https://github.com/axios/axios#request-config
// axios.defaults.baseURL = process.env.baseURL || process.env.apiUrl || '';
// axios.defaults.headers.common['Authorization'] = AUTH_TOKEN;
// axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
let config = {
// baseURL: process.env.baseURL || process.env.apiUrl || ""
// timeout: 60 * 1000, // Timeout
// withCredentials: true, // Check cross-site Access-Control
};
const _axios = axios.create(config);
_axios.interceptors.request.use(
function(config) {
// Do something before request is sent
return config;
},
function(error) {
// Do something with request error
return Promise.reject(error);
}
);
// Add a response interceptor
_axios.interceptors.response.use(
function(response) {
// Do something with response data
return response;
},
function(error) {
// Do something with response error
return Promise.reject(error);
}
);
Plugin.install = function(Vue, options) {
Vue.axios = _axios;
window.axios = _axios;
Object.defineProperties(Vue.prototype, {
axios: {
get() {
return _axios;
}
},
$axios: {
get() {
return _axios;
}
},
});
};
Vue.use(Plugin)
export default Plugin;
import Vue from 'vue'
import { Button, Image, Field, Cell, CellGroup, Icon, Checkbox, CheckboxGroup, Toast, RadioGroup, Radio, NavBar, List} from 'vant'
Vue.use(Button).use(Image).use(Field).use(Cell).use(CellGroup).use(Icon).use(Checkbox).use(CheckboxGroup).use(Toast).use(RadioGroup).use(Radio).use(NavBar).use(List);
import Vue from 'vue'
import VueRouter from 'vue-router'
import '@/assets/css/reset.css'
Vue.use(VueRouter)
const routes = [
{
path: '/',
name: 'home',
component: () => import(/* webpackChunkName: "about" */ '@/views/Index')
},
{
path: '/order',
name: 'order',
component: () => import(/* webpackChunkName: "about" */ '@/views/Order')
},
{
path: '/record',
name: 'record',
component: () => import(/* webpackChunkName: "about" */ '@/views/Record')
},
{
path: '/example',
name: 'example',
component: () => import(/* webpackChunkName: "about" */ '@/views/Example')
}
]
const router = new VueRouter({
routes
})
export default router
<template>
<div class="container">
<van-nav-bar title="碰撞记录报告" left-text="返回" left-arrow @click-left="back" />
<van-cell-group title="保险信息" v-for="(item,index) in report &&report.data&&report.data.insurance" :key="index">
<van-cell title="开始时间"
:value="item.start_date" />
<van-cell title="结束时间"
:value="item.end_date" />
</van-cell-group>
<van-cell-group title="事故信息" v-for="(item,index) in report &&report.data&&report.data.claims" :key="index">
<van-cell title="事故日期" :value="item.claim_date" />
<van-cell title="车主" :value="item.owner" />
<van-cell title="车牌号" :value="item.plate" />
<van-cell title="核损金额(元)" :value="item.total_fee" />
<van-cell title="人工费(元)" :value="item.labor_fee" />
<van-cell title="材料费(元)" :value="item.material_fee" />
<van-cell title="材料" :value="item.material ? item.material : '暂无'" />
<van-field label="维修项目" :value="item.repair_detail?item.repair_detail:'暂无'" type="textarea" autosize
disabled input-align="right"/>
<van-field label="事故描述" :value="item.description?item.description:'暂无描述信息'" type="textarea" autosize
disabled input-align="right"/>
<van-cell title="报告生成时间" :value="report.data.createtime" />
</van-cell-group>
</div>
</template>
<script>
export default {
data() {
return {
report: ""
};
},
methods: {
back() {
window.history.go(-1);
}
},
mounted() {
if (window.location.href.search("list") > -1) {
this.report = JSON.parse(localStorage.report_data);
}
if (window.location.href.search("index") > -1) {
this.report = JSON.parse(localStorage.report_index);
}
}
};
</script>
<style lang="less" scoped>
.container {
background: #f5f5f5;
.van-cell-group__title {
font-weight: 700;
color: #323232;
background: #fff;
}
.van-cell-group {
margin-bottom: 8px;
}
}
</style>
\ No newline at end of file
<template>
<div class="container">
<div class="top">
<h3>碰撞记录查询</h3>
<div class="banner">
<van-image width="100%" height="170"
src="http://test.car.checheng.net/storage/2019-12-10/VyEZRGEgJLMZ41rAkzLniF1DQtagQMkZ0sUcbRYL.png" />
<van-image @click="toRecord" class="record" width="80" height="27"
src="http://test.car.checheng.net/storage/2019-12-10/E7d2G1nHQuMQWlU21rMWCAMPdMxrj4p7LnYQugY7.png" />
</div>
<div class="price">
<span>39.9/次,购买套餐最高可省10.9元/次</span>
<span>购买套餐</span>
<van-image width="10" height="12"
src="http://test.car.checheng.net/storage/2019-12-10/CqqszHwD8Z4KMg03AQTzfc5TrFoT66h8l6H1dwQy.png">
</van-image>
</div>
</div>
<div class="mid">
<van-cell-group>
<van-field v-model="params.vin" required clearable label="车架号" placeholder="请输入17位车架号" maxlength="17">
<div slot="right-icon">
{{params.vin.length}}/17
</div>
</van-field>
<van-field disabled>
<!-- @click-right-icon="params.vin = " -->
<div slot="right-icon" class="icon">
<span>
<van-icon
name="http://test.car.checheng.net/storage/2019-12-10/Ke6iGHbSeknCtluOrWXXsOieKawJuAF2cBWDqoGe.png" />
车架号不知道在哪</span>
</div>
</van-field>
</van-cell-group>
</div>
<!-- <van-cell-group v-if="flag">
<van-field v-model="params.identity" label="身份证" placeholder="请输入身份证号码(选填)" />
<van-field v-model="params.engine" label="发动机号" placeholder="请输入发动机号(选填)" />
<van-field v-model="params.carPlate" label="车牌号" placeholder="请输入车牌号(选填)" />
</van-cell-group> -->
<div class="footer">
<van-button @click="toExample" class="example" plain hairline type="warning">样例</van-button>
<van-button @click="query" class="query" :disabled="params.vin.length != 17" color="#f60">开始查询</van-button>
<van-checkbox v-model="checked" class="check" icon-size="10px" checked-color="#F60">
使用本服务意味着您已经阅读并同意<span>《用户协议》</span></van-checkbox>
<p>最快20分钟返回查询结果,20:00后查询将于次日推送查询结果</p>
</div>
<div class="footer_baner">
<van-image width="100%"
src="http://test.car.checheng.net/storage/2019-12-10/wGw19mjGFTVE2E5r8Q16jWkIPooBZbu9C7Huf4pr.png" />
</div>
</div>
</template>
<script>
export default {
data() {
return {
params: {
vin: ""
// identity: "",
// engine: "",
// carPlate: "",
},
checked: true
};
},
methods: {
getUrlParam(type) {
var url = window.location.href;
var obj = {};
var reg = /[?&][^?&]+=[^?&#]+/g;
var arr = url.match(reg);
if (arr) {
arr.forEach(function(item) {
var tempArr = item.substring(1).split("=");
var key = decodeURIComponent(tempArr[0]);
var val = decodeURIComponent(tempArr[1]);
obj[key] = val;
});
}
return obj[type];
},
async getUserInfo(code, state) {
const { data: res } = await this.$http.get(
"main-customers/get-user-info",
{
params: {
code,
state
}
}
);
// getWechatConf();
localStorage.customer_id = res.id;
if (res.phone) {
localStorage.phone = res.phone;
}
},
async getAddOrder(vin) {
const { data: res } = await this.$http.get(
"http://car.meigym.com/api/main-orders",
{
params: {
customer_id: localStorage.customer_id,
vin,
// amount: localStorage.price,
type: 1
}
}
);
console.log(res,'main-orders');
if (res.message === "ok" && res.data && res.data.error === 1) {
this.$toast(res.data.msg);
} else {
var order = res.data.order;
localStorage.order = JSON.stringify(order);
this.$router.push({ path: "/order", query: {
price:0.01,
vin,
number:order.order_no
} })
}
},
query() {
this.getAddOrder(this.params.vin);
},
toRecord(){
this.$router.push('/record')
},
toExample(){
var item = {"id":1,"customer_id":0,"date":"2019-12-05","vin":"LFPM4ACC1C1AXXXXX","data":{"insurance":[{start_date:'2014-12',end_date:'2015-12'}],"claims":[{"claim_date":"2015-07-01","owner":"王XX","plate":"皖A 1111XX","description":"事故详情描述","total_fee":"500.00","labor_fee":"0.00","material_fee":"0.00","repair_detail":"前保险杠(半喷),左前叶子板(全喷)","material":"材料描述"}],"createtime":"2019-12-05 16:54:25","report_url":"https://customer.che300.com/ins-report?cid=516&order_id=3799741&sn=9ba43cea2b01620f72bede6405bfe780"},"status":0,"created_at":"2019-12-05 16:54:29","updated_at":"2019-12-05 16:54:29","type":1}
localStorage.report_index = JSON.stringify(item)
this.$router.push('/example?form=index')
}
},
mounted() {
let code = this.getUrlParam("code");
if (window.location.href.search('mobile') > -1) {
// getChannelInfo(code);
var phone = getUrlParam('mobile');
localStorage.phone = phone;
// getUserInfoByPhone(code, phone);
localStorage.source = 'externalBrowser';
localStorage.pay_gate = 2;
}else if (window.location.href.search("state") > -1) {
let state = this.getUrlParam("state");
localStorage.state = state;
localStorage.code = code;
localStorage.source = "wechat";
localStorage.pay_gate = 0;
// getChannelInfo(channel_code);
this.getUserInfo(code, state);
} else {
localStorage.clear();
}
}
};
</script>
<style lang="less" scoped>
body {
background: #f5f5f5;
.container {
.top {
background: #fff;
margin-bottom: 8px;
h3 {
padding: 10px;
text-align: center;
font-weight: 700;
}
.banner {
position: relative;
.record {
position: absolute;
top: 8px;
right: 0;
}
}
.price {
padding: 5px;
font-size: 15px;
> span:nth-child(1) {
color: #ffb000;
margin-right: 20px;
}
> span:nth-child(2) {
color: #ff7b00;
margin-right: 8px;
}
}
}
.mid {
// margin-bottom: 8px;
.icon {
i {
display: inline-block;
vertical-align: top;
}
}
}
.footer {
background: #fff;
padding: 10px;
.example {
width: 30%;
margin-right: 10px;
}
.query {
width: 65%;
}
.check {
margin: 8px 0;
font-size: 10px;
color: #4a4a4a;
span {
color: #ff7b00;
}
}
p {
font-size: 10px;
color: #a9a9a9;
}
}
.footer_baner {
position: fixed;
bottom: 0;
padding: 10px;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="container">
<h3>支付订单</h3>
<van-cell-group title="订单信息">
<van-cell title="订单金额" :value="params.price" value-class="price" />
<van-cell title="订单编号" :value="params.number" />
</van-cell-group>
<div class="mid">
<van-cell-group title="车辆信息">
<van-cell title="车架号" :value="params.vin" />
</van-cell-group>
</div>
<van-cell-group title="选择优惠券">
<van-cell title="暂无可用优惠券" />
</van-cell-group>
<van-radio-group v-model="result" v-if="flag">
<van-cell-group title="请选择支付方式">
<van-cell v-for="(item, index) in list" :key="item.id" :title="`${item.name}`" :label="`${item.desc}`"
:icon="`${item.icon}`">
<van-radio :name="item.id" ref="checkboxes" slot="right-icon" />
</van-cell>
</van-cell-group>
</van-radio-group>
<van-button color="linear-gradient(to right, #FFB200, #FF7B00 )" @click="confirm_pay">确认支付 {{params.price}}
</van-button>
</div>
</template>
<script>
export default {
data() {
return {
params: {
price: "",
number: "",
vin: ""
},
list: [
{
id: 0,
name: "微信",
desc: "推荐安装微信5.0及以上版本的用户使用",
icon:
"http://test.car.checheng.net/storage/2019-12-11/hg8H1w5bj85yXuT7p07CPLPiHI0Op0r3iGWCtTNg.png"
},
{
id: 1,
name: "支付宝",
desc: "推荐有支付宝账号的用户使用",
icon:
"http://test.car.checheng.net/storage/2019-12-11/jT5FjlIxBTNTZyim4MtDDhx7wPP6TLHCsgqMPT8t.png"
}
],
result: 0,
flag: false
};
},
mounted() {
// this.params.price = "¥" + this.$route.query.price;
// this.params.number = this.$route.query.number;
// this.params.vin = this.$route.query.vin;
var status = this.getUrlParam("status");
if (localStorage.source === "externalBrowser") {
this.flag = true;
}
// var timer = null;
// if (localStorage.source === 'externalBrowser') {
// searchOrder();
// }
if (status == "0") {
var res = JSON.parse(localStorage.report_data);
console.log(res,'123');
this.params.price = "¥" + res.amount;
this.params.number = res.order_no;
this.params.vin = res.vin;
} else {
// $('.money').html('¥' + localStorage.price);
this.params.price = "¥0.01"; /* 测试 */
this.params.number = JSON.parse(localStorage.order).order_no;
this.params.vin = JSON.parse(localStorage.order).vin;
}
},
methods: {
getUrlParam(type) {
var url = window.location.href;
var obj = {};
var reg = /[?&][^?&]+=[^?&#]+/g;
var arr = url.match(reg);
if (arr) {
arr.forEach(function(item) {
var tempArr = item.substring(1).split("=");
var key = decodeURIComponent(tempArr[0]);
var val = decodeURIComponent(tempArr[1]);
obj[key] = val;
});
}
return obj[type];
},
/* 重新支付 */
async pay(id, amount) {
const { data: res } = await this.$http.get(
`http://car.meigym.com/api/order-pay`,
{
params: {
order_no: id,
pay_gate: localStorage.pay_gate,
amount
}
}
);
console.log(res.data, "重新支付接口pay");
// 唤起H5
this.pay_type(res.data.pay);
},
confirm_pay() {
let order = JSON.parse(localStorage.order);
this.pay(order.id, 0.01);
},
/* 微信内H5调起支付 */
pay_type(order) {
let that = this;
if (localStorage.source === "wechat") {
function onBridgeReady() {
WeixinJSBridge.invoke(
"getBrandWCPayRequest",
{
appId: order.appId, // 公众号名称,由商户传入
timeStamp: order.timeStamp, // 时间戳,自1970年以来的秒数
nonceStr: order.nonceStr, // 随机串
package: order.package,
signType: order.signType, // 微信签名方式:
paySign: order.paySign // 微信签名
},
function(res) {
console.log(res, "H5支付结果pay_type");
if (res.err_msg == "get_brand_wcpay_request:ok") {
that.$toast("支付成功");
setTimeout(() => {
that.$router.replace("/record");
}, 1000);
}
}
);
}
if (typeof WeixinJSBridge == "undefined") {
if (document.addEventListener) {
document.addEventListener(
"WeixinJSBridgeReady",
onBridgeReady,
false
);
} else if (document.attachEvent) {
document.attachEvent("WeixinJSBridgeReady", onBridgeReady);
document.attachEvent("onWeixinJSBridgeReady", onBridgeReady);
}
} else {
onBridgeReady();
}
} else if (localStorage.source === "externalBrowser") {
if (typeof res.pay === "string") {
window.location.href = res.pay;
}
}
}
// first_pay() {
// var id = "",
// amount = "";
// if (window.location.href.search("status") > -1) {
// var data = JSON.parse(localStorage.report_data);
// id = data.id;
// amount = data.amount;
// } else {
// var res = JSON.parse(localStorage.order);
// id = res.id;
// amount = res.amount;
// }
// if (localStorage.pay_gate === "3") {
// // if (localStorage.source === "externalBrowser") {
// // getUserInfoByPhone(localStorage.phone, amount, id);
// // } else if (localStorage.source === "wechat") {
// // getUserInfo(localStorage.code, localStorage.channel_code, amount, id);
// // }
// } else {
// this.pay(id, amount);
// }
// }
}
};
</script>
<style lang="less" scoped>
.container {
background: #f5f5f5;
h3 {
padding: 10px;
font-weight: 700;
text-align: center;
background: #fff;
margin-bottom: 10px;
}
.van-cell-group__title {
font-weight: 700;
color: #323232;
background: #fff;
}
.van-cell {
color: #737373;
}
.price {
color: #ff7f00;
}
.mid {
margin: 10px 0;
}
.van-button {
position: fixed;
bottom: 0;
width: 100%;
}
.van-image {
width: 50px;
height: 50px;
margin-right: 8px;
}
}
</style>
\ No newline at end of file
<template>
<div>
<van-nav-bar title="碰撞记录" left-text="返回" left-arrow @click-left="back" />
<div class="info">
<img src="http://test.car.checheng.net/storage/2019-12-13/irNh7jRdtT8aagfBCe9tS3mbEasdcwmgrFS8UYgB.png"
width="50" alt="">
<div class="info-content">
<div class="phone">{{phone}}</div>
</div>
</div>
<div class="order-list-content" style="height:100%">
<van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="loads">
<ul>
<li v-for="(item,index) in list" class="order-item" data-id="4916" data-status="0">
<div class="item-header">
<span class="item-car">
<img v-if="item.inquire && item.inquire.data.brand_img"
:src="item.inquire && item.inquire.data.brand_img">
{{item.inquire && item.inquire.data.maker|| '--'}}
</span>
<span class="item-date">{{item.pay_time || item.created_at}}</span>
</div>
<div class="item-body">
<span class="item-label">车架号:</span>
<span class="vin-number">{{item.vin}}</span></div>
<div class="item-footer">
<div class="item-footer-content">
<span class="item-label">订单号:</span>
<span class="order-number">{{item.order_no}}</span></div>
</div>
<div class="item-status item-status-0" v-if="item.status == 0" @click="toOrder(item)">去支付</div>
<div class="item-status item-status-1"
@click="toReport(item)"
v-if="item.status === 1 && item.inquire && item.inquire.data && item.inquire.data.claims">
报告已出
</div>
<!-- <div class="item-status item-status-1"
v-if="item.status === 1 && item.response && (item.response !== 'Undefined index: resultInfo') && (JSON.parse(item.response).code == 2001 || JSON.parse(item.response).code == 5001)">
查询中,请等待</div> -->
<div class="item-status item-status-10"
v-if="item.status === 1 && (!item.inquire || (item.inquire.data && !item.inquire.data.claims))">
<div v-if="item.pay_gate == 1">查询失败,可申请退款</div>
<div v-else>查询失败,可申请退款<a @click="refund(item.id)" class="item-apply">申请退款</a></div>
</div>
<!-- <div class="item-status item-status-1" v-if="item.status == 0">报告已出</div> -->
<div class="item-status item-status-1" v-if="item.status == 3">退款成功</div>
<div class="item-status item-status-1" v-if="item.status == 4">退款成功</div>
<div class="item-status item-status-1" v-if="item.status == 5">驳回退款申请</div>
<!-- <div class="item-data">
{"id":4916,"channel_id":2,"customer_id":5,"inquire_id":0,"order_no":"2019121110255524","vin":"LSGZR5359KH049434","amount":"15.90","pay_gate":2,"pay_time":null,"provider_name":null,"provider_fee":"0.00","status":0,"created_at":"2019-12-11
15:56:31","updated_at":"2019-12-11
17:26:39","response":null,"reject_reason":null,"remote_order_no":null,"refund_no":null,"refund_time":null,"refund_response":null,"type":0,"customer":{"id":5,"channel_id":2,"open_id":null,"nick_name":"--","phone":"18021518053","sex":0,"city":null,"province":null,"country":null,"head_img_url":null,"coins":"0.00","status":1,"created_at":"2019-08-26
14:44:37","updated_at":"2019-08-26
14:44:37"},"channel":{"id":2,"name":"12123","level":"LV2","unique_code":"12123","status":0,"created_at":"2019-08-23
11:38:16","updated_at":"2019-09-11 16:45:32"},"inquire":null}
</div> -->
</li>
</ul>
</van-list>
</div>
</div>
</template>
<script>
export default {
data() {
return {
phone: "",
list: [],
loading: false,
finished: false,
page: 1,
total: null,
last_page: 1
};
},
methods: {
back() {
window.history.go(-1);
},
toOrder(item) {
localStorage.report_data = JSON.stringify(item);
this.$router.push({ path: "/order", query: { status: 0, from: "list" } });
},
toReport(item){
localStorage.report_data = JSON.stringify(item.inquire);
this.$router.push({path:'/example?from=list'})
},
async refund(id) {
const { data: res } = await this.$http.post(`main-orders/${id}/wechat-refund`)
console.log(res, 'refund-wechat');
if (res.message === 'ok') {
this.$toast('退款成功');
setTimeout(function () {
window.location.reload();
}, 2000)
}
},
loads() {
if (this.page > this.last_page) {
this.finished = true;
}
this.getList(this.page);
this.page++;
},
async getList(page) {
const { data: res } = await this.$http.get("main-orders", {
params: { type: 1, page ,customer_id:localStorage.customer_id}
});
this.list = [...this.list, ...res.data];
this.last_page = res.meta.last_page;
this.loading = false;
}
},
mounted() {
this.phone = localStorage.phone.replace(
/(\d{3})(\d{4})(\d{4})/,
"$1****$3"
);
}
};
</script>
<style lang="less" scoped>
.info {
padding: 10px 0 0 20px;
display: flex;
align-items: center;
flex: 1;
padding-left: 12px;
.info-content {
flex: 1;
padding-left: 12px;
.phone {
font-weight: bold;
}
}
}
.order-list-content {
background: #f5f5f5;
padding: 10px;
ul {
.order-item {
color: #666;
padding: 10px;
margin-bottom: 10px;
border-bottom: 1px solid #f2f2f2;
border-radius: 8px;
background: #fff;
.item-header {
height: 40px;
line-height: 40px;
background: #fcfcfc;
border-radius: 8px 8px 0 0;
.item-car {
img {
float: left;
width: 25px;
margin: 5px 5px 0 0;
vertical-align: -6px;
}
}
.item-date {
float: right;
color: #777;
}
}
.item-body,
.item-footer {
overflow: hidden;
margin-bottom: 5px;
span:nth-child(2) {
float: right;
}
}
.item-status {
border-top: 1px solid #f2f2f2;
position: relative;
padding: 8px 0;
background: url("http://test.car.checheng.net/storage/2019-12-13/HVTRulewsvJVsnAf7cA7jkHDLjWiAoWJoyrcED5x.png") 98% center no-repeat;
background-size: 14px;
.item-apply {
text-decoration: none;
position: absolute;
right: 7px;
top: 7px;
display: inline-block;
margin-left: 5px;
padding: 6px 10px;
line-height: 1;
color: #fff;
font-size: 14px;
text-align: center;
border-radius: 15px;
background: #f60;
cursor: pointer;
}
}
.item-status-0 {
color: #f60;
}
.item-status-1,
.item-status-3,
.item-status-4 {
color: #67c23a;
}
.item-status-2,
.item-status-5,
.item-status-10 {
color: #e9190b;
}
}
}
}
</style>
\ No newline at end of file
// module.exports = {
// devServer: {
// proxy: {
// "/api": {
// target: "http://weapp.car.checheng.net", // 要请求的后台地址
// changeOrigin: true, // 是否跨域
// pathRewrite: {
// "^/api": "" // 这里理解成用‘/api’代替target里面的地址,后面组件中我们掉接口时直接用api代替
// }
// },
// }
// }
// }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment