Commit 054c4381 by null

init

parents
File added
App({
onLaunch: function() {},
globalData: {
app_id: 'wx3722cae0d0b62fff',
url: 'https://test-es.checheng.com/api/',
width: 0,
height: 0,
session_key: '',
enter: '',
result: '',
link: '2019062353971015',
provinceList: [],
tiantianpaiche_cityList: ['南京', '无锡', '合肥', '南昌', '苏州', '绍兴',
'天津', '上海', '杭州', '宁波', '成都', '武汉',
'重庆', '义乌', '东莞', '佛山', '金华', '深圳',
'南通', '温州', '济南', '嘉兴', '西安', '广州',
'北京', '济南', '青岛', '临沂'
],
chezhibao_cityList: ['北京', '上海', '天津', '重庆', '石家庄', '唐山', '邯郸', '保定', '张家口', '沧州', '廊坊', '福州',
'厦门', '泉州', '漳州', '南昌', '赣州', '济南', '青岛', '淄博', '枣庄', '烟台', '潍坊', '济宁', '泰安', '威海', '日照',
'临沂', '滨州', '太原', '大同', '运城', '赤峰', '郑州', '洛阳', '新乡', '南阳', '商丘', '沈阳', '大连', '鞍山', '抚顺',
'锦州', '营口', '铁岭', '葫芦岛', '武汉', '宜昌', '长春', '吉林', '松原', '长沙', '湘潭', '衡阳', '岳阳', '常德', '哈尔滨',
'齐齐哈尔', '大庆', '绥化', '广州', '深圳', '珠海', '汕头', '佛山', '惠州', '东莞', '中山', '南京', '无锡', '徐州', '常州',
'苏州', '南通', '连云港', '淮安', '盐城', '泰州', '宿迁', '南宁', '柳州', '桂林', '成都', '绵阳', '南充', '杭州', '宁波',
'温州', '嘉兴', '绍兴', '金华', '台州', '昆明', '合肥', '芜湖', '蚌埠', '贵阳', '西安', '兰州', '西宁', '银川', '襄阳'
],
renrenche_cityList: ['唐山', '廊坊', '青岛', '天津', '北京', '哈尔滨', '大连', '沈阳', '长春', '石家庄', '保定', '济南', '临沂',
'秦皇岛', '沧州', '菏泽', '杭州', '金华', '温州', '南昌', '福州', '宁波', '厦门', '嘉兴', '洛阳', '苏州', '无锡', '合肥', '泉州',
'台州', '湖州', '南通', '常州', '上海', '绍兴', '南京', '芜湖', '扬州', '漳州', '许昌', '南宁', '惠州', '郑州', '佛山', '广州', '东莞',
'深圳', '长沙', '桂林', '中山', '安阳', '襄阳', '绵阳', '兰州', '昆明', '重庆', '太原', '贵阳', '乌鲁木齐', '西安', '武汉', '成都',
'包头', '威海', '东营', '潍坊', '伊犁', '珠海', '新乡', '南阳', '大同', '呼和浩特', '咸阳', '辽源', '商丘', '赤峰', '德州', '清远',
'南平', '保山', '韶关', '遵义', '临汾', '漯河', '德阳', '大庆', '聊城', '阜新', '张家口', '抚顺', '延边', '渭南', '达州', '亳州',
'咸宁', '烟台'
],
},
onLaunch: function(e) {
wx.clearStorage();
let _this = this;
wx.getSystemInfo({
success: function(res) {
_this.globalData.width = res.windowWidth;
_this.globalData.height = res.windowHeight;
}
}),
wx.login({
success: function(res) {
if (res.errMsg === 'login:ok') {
let data = {
code: res.code,
app_id: _this.globalData.app_id
}
wx.request({
url: _this.globalData.url + 'user-code',
data: data,
success: function(res) {
let session_key = res.data.session_key
_this.globalData.session_key = session_key
}
})
}
}
}),
_this.getProvinceList()
},
// 获取省份
getProvinceList: function () {
let _this = this;
wx.request({
url: _this.globalData.url + 'assess/provinces',
success: function (res) {
if (res.data && res.data.length > 0) {
let data = res.data
let arr = []
for (let key in data) {
if (data[key].id === 32) {
continue
}
arr.push(data[key])
}
_this.globalData.provinceList = arr
}
}
})
},
})
\ No newline at end of file
{
"pages": [
"pages/index/index",
"pages/result/result",
"pages/sellcar/sellcar",
"pages/car-select/brand",
"pages/car-select/series",
"pages/car-select/specification",
"pages/advantage/advantage",
"pages/guide/guide",
"pages/submit/submit"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fe9527",
"navigationBarTitleText": "爱车估价",
"navigationBarTextStyle": "white"
},
"tabBar": {
"color": "#666",
"selectedColor": "#fe9527",
"list": [
{
"pagePath": "pages/index/index",
"text": "估值",
"iconPath": "images/valuation.png",
"selectedIconPath": "images/valuation-active.png"
},
{
"pagePath": "pages/sellcar/sellcar",
"text": "卖车",
"iconPath": "images/sellcar.png",
"selectedIconPath": "images/sellcar-active.png"
},
{
"pagePath": "pages/advantage/advantage",
"text": "卖车优势",
"iconPath": "images/advantage.png",
"selectedIconPath": "images/advantage-active.png"
},
{
"pagePath": "pages/guide/guide",
"text": "卖车指南",
"iconPath": "images/guide.png",
"selectedIconPath": "images/guide-active.png"
}
]
},
"sitemapLocation": "sitemap.json"
}
\ No newline at end of file
checkbox {
vertical-align: top;
}
page {
line-height: 1.6;
}
icon {
vertical-align: middle;
}
.weui-cells {
position: relative;
margin-top: 1.17647059em;
background-color: #fff;
line-height: 1.41176471;
font-size: 34rpx;
}
.weui-cells:before {
content: " ";
position: absolute;
left: 0;
top: 0;
right: 0;
height: 1px;
border-top: 1rpx solid #e5e5e5;
color: #e5e5e5;
}
.weui-cells:after {
content: " ";
position: absolute;
left: 0;
bottom: 0;
right: 0;
height: 1px;
border-bottom: 1rpx solid #e5e5e5;
color: #e5e5e5;
}
.weui-cells__title {
margin-top: 0.77em;
margin-bottom: 0.3em;
padding-left: 30rpx;
padding-right: 30rpx;
color: #999;
font-size: 28rpx;
}
.weui-cells_after-title {
margin-top: 0;
border-radius: 12rpx;
}
.weui-cells__tips {
margin-top: 0.3em;
color: #999;
padding-left: 30rpx;
padding-right: 30rpx;
font-size: 28rpx;
}
.weui-cell {
padding: 20rpx 30rpx;
position: relative;
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
align-items: center;
}
.weui-cell > button {
font-size: 36rpx;
}
.weui-cell:before {
content: " ";
position: absolute;
top: 0;
right: 0;
height: 1px;
border-top: 1rpx solid #e5e5e5;
color: #e5e5e5;
left: 30rpx;
}
.weui-cell:first-child:before {
display: none;
}
.weui-cell_active {
background-color: #ececec;
}
.weui-cell_primary {
-webkit-box-align: start;
align-items: flex-start;
}
.weui-cell__bd {
-webkit-box-flex: 1;
flex: 1;
}
.weui-cell__ft {
text-align: right;
color: #999;
}
.weui-cell_access {
color: inherit;
}
.weui-cell__ft_in-access {
padding-right: 30rpx;
position: relative;
}
.weui-cell__ft_in-access:after {
content: " ";
display: inline-block;
height: 12rpx;
width: 12rpx;
border-width: 4rpx 4rpx 0 0;
border-color: #c8c8cd;
border-style: solid;
transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
top: -4rpx;
position: absolute;
top: 50%;
margin-top: -8rpx;
right: 4rpx;
}
.weui-cell_link {
color: #586c94;
font-size: 28rpx;
}
.weui-cell_link:active {
background-color: #ececec;
}
.weui-cell_link:first-child:before {
display: block;
}
.weui-icon-radio {
margin-left: 6rpx;
margin-right: 6rpx;
}
.weui-icon-checkbox_circle, .weui-icon-checkbox_success {
margin-left: 9rpx;
margin-right: 9rpx;
}
.weui-check__label:active {
background-color: #ececec;
}
.weui-check {
position: absolute;
left: -9999px;
}
.weui-check__hd_in-checkbox {
padding-right: 0.35em;
}
.weui-cell__ft_in-radio {
padding-left: 0.35em;
}
.weui-cell_input {
padding-top: 0;
padding-bottom: 0;
}
.weui-label {
width: 160rpx;
word-wrap: break-word;
word-break: break-all;
}
.weui-input {
height: 2.5em;
min-height: 2.5em;
line-height: 2.5em;
}
.weui-toptips {
position: fixed;
transform: translateZ(0);
top: 0;
left: 0;
right: 0;
padding: 10rpx;
font-size: 28rpx;
text-align: center;
color: #fff;
z-index: 5000;
word-wrap: break-word;
word-break: break-all;
}
.weui-toptips_warn {
background-color: #e64340;
}
.weui-textarea {
display: block;
width: 100%;
}
.weui-textarea-counter {
color: #b2b2b2;
text-align: right;
}
.weui-textarea-counter_warn {
color: #e64340;
}
.weui-cell_warn {
color: #e64340;
}
.weui-form-preview {
position: relative;
background-color: #fff;
}
.weui-form-preview:before {
content: " ";
position: absolute;
left: 0;
top: 0;
right: 0;
height: 1px;
border-top: 1rpx solid #e5e5e5;
color: #e5e5e5;
}
.weui-form-preview:after {
content: " ";
position: absolute;
left: 0;
bottom: 0;
right: 0;
height: 1px;
border-bottom: 1rpx solid #e5e5e5;
color: #e5e5e5;
}
.weui-form-preview__value {
font-size: 28rpx;
}
.weui-form-preview__value_in-hd {
font-size: 52rpx;
}
.weui-form-preview__hd {
position: relative;
padding: 20rpx 30rpx;
text-align: right;
line-height: 2.5em;
}
.weui-form-preview__hd:after {
content: " ";
position: absolute;
bottom: 0;
right: 0;
height: 1px;
border-bottom: 1rpx solid #e5e5e5;
color: #e5e5e5;
left: 30rpx;
}
.weui-form-preview__bd {
padding: 20rpx 30rpx;
font-size: 0.9em;
text-align: right;
color: #999;
line-height: 2;
}
.weui-form-preview__ft {
position: relative;
line-height: 100rpx;
display: -webkit-box;
display: -webkit-flex;
display: flex;
}
.weui-form-preview__ft:after {
content: " ";
position: absolute;
left: 0;
top: 0;
right: 0;
height: 1px;
border-top: 1rpx solid #e5e5e5;
color: #e5e5e5;
}
.weui-form-preview__item {
overflow: hidden;
}
.weui-form-preview__label {
float: left;
margin-right: 1em;
min-width: 4em;
color: #999;
text-align: justify;
text-align-last: justify;
}
.weui-form-preview__value {
display: block;
overflow: hidden;
word-break: normal;
word-wrap: break-word;
}
.weui-form-preview__btn {
position: relative;
display: block;
-webkit-box-flex: 1;
flex: 1;
color: #3cc51f;
text-align: center;
}
.weui-form-preview__btn:after {
content: " ";
position: absolute;
left: 0;
top: 0;
width: 1px;
bottom: 0;
border-left: 1rpx solid #e5e5e5;
color: #e5e5e5;
}
.weui-form-preview__btn:first-child:after {
display: none;
}
.weui-form-preview__btn_active {
background-color: #eee;
}
.weui-form-preview__btn_default {
color: #999;
}
.weui-form-preview__btn_primary {
color: #0bb20c;
}
.weui-cell_select {
padding: 0;
}
.weui-select {
position: relative;
padding-left: 30rpx;
padding-right: 60rpx;
height: 2.58823529em;
min-height: 2.58823529em;
line-height: 2.58823529em;
border-right: 1px solid #e5e5e5;
}
.weui-select:before {
content: " ";
display: inline-block;
height: 12rpx;
width: 12rpx;
border-width: 4rpx 4rpx 0 0;
border-color: #c8c8cd;
border-style: solid;
transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
top: -4rpx;
position: absolute;
top: 50%;
right: 30rpx;
margin-top: -8rpx;
}
.weui-select_in-select-after {
padding-left: 0;
}
.weui-cell__hd_in-select-after, .weui-cell__bd_in-select-before {
padding-left: 30rpx;
}
.weui-cell_vcode {
padding-right: 0;
}
.weui-vcode-img {
margin-left: 10rpx;
height: 2.58823529em;
vertical-align: middle;
}
.weui-vcode-btn {
display: inline-block;
height: 2.58823529em;
margin-left: 10rpx;
padding: 0 0.6em 0 0.7em;
border-left: 1px solid #e5e5e5;
line-height: 2.58823529em;
vertical-align: middle;
font-size: 34rpx;
color: #3cc51f;
white-space: nowrap;
}
.weui-vcode-btn:active {
color: #52a341;
}
.weui-cell_switch {
padding-top: 12rpx;
padding-bottom: 12rpx;
}
.weui-uploader__hd {
display: -webkit-box;
display: -webkit-flex;
display: flex;
padding-bottom: 20rpx;
-webkit-box-align: center;
align-items: center;
}
.weui-uploader__title {
-webkit-box-flex: 1;
flex: 1;
}
.weui-uploader__info {
color: #b2b2b2;
}
.weui-uploader__bd {
margin-bottom: -8rpx;
margin-right: -18rpx;
overflow: hidden;
}
.weui-uploader__file {
float: left;
margin-right: 18rpx;
margin-bottom: 18rpx;
}
.weui-uploader__img {
display: block;
width: 79px;
height: 79px;
}
.weui-uploader__file_status {
position: relative;
}
.weui-uploader__file_status:before {
content: " ";
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.5);
}
.weui-uploader__file-content {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: #fff;
}
.weui-uploader__input-box {
float: left;
position: relative;
margin-right: 9px;
margin-bottom: 9px;
width: 77px;
height: 77px;
border: 1px solid #e5e5e5;
}
.weui-uploader__input-box:before, .weui-uploader__input-box:after {
content: " ";
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: #e5e5e5;
}
.weui-uploader__input-box:before {
width: 2px;
height: 39.5px;
}
.weui-uploader__input-box:after {
width: 39.5px;
height: 2px;
}
.weui-uploader__input-box:active {
border-color: #999;
}
.weui-uploader__input-box:active:before, .weui-uploader__input-box:active:after {
background-color: #999;
}
.weui-uploader__input {
position: absolute;
z-index: 1;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
}
.weui-article {
padding: 20px 15px;
font-size: 15px;
}
.weui-article__section {
margin-bottom: 1.5em;
}
.weui-article__h1 {
font-size: 18px;
font-weight: 400;
margin-bottom: 0.9em;
}
.weui-article__h2 {
font-size: 16px;
font-weight: 400;
margin-bottom: 0.34em;
}
.weui-article__h3 {
font-weight: 400;
font-size: 15px;
margin-bottom: 0.34em;
}
.weui-article__p {
margin: 0 0 0.8em;
}
.weui-msg {
padding-top: 36px;
text-align: center;
}
.weui-msg__link {
display: inline;
color: #586c94;
}
.weui-msg__icon-area {
margin-bottom: 30px;
}
.weui-msg__text-area {
margin-bottom: 25px;
padding: 0 20px;
}
.weui-msg__title {
margin-bottom: 5px;
font-weight: 400;
font-size: 20px;
}
.weui-msg__desc {
font-size: 14px;
color: #999;
}
.weui-msg__opr-area {
margin-bottom: 25px;
}
.weui-msg__extra-area {
margin-bottom: 15px;
font-size: 14px;
color: #999;
}
@media screen and (min-height:438px) {
.weui-msg__extra-area {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
text-align: center;
}
}
.weui-flex {
display: -webkit-box;
display: -webkit-flex;
display: flex;
}
.weui-flex__item {
-webkit-box-flex: 1;
flex: 1;
}
.weui-btn {
margin-top: 15px;
}
.weui-btn:first-child {
margin-top: 0;
}
.weui-btn-area {
margin: 1.17647059em 15px 0.3em;
}
.weui-agree {
display: block;
padding: 0.5em 15px;
font-size: 13px;
}
.weui-agree__text {
color: #999;
}
.weui-agree__link {
display: inline;
color: #586c94;
}
.weui-agree__checkbox {
position: absolute;
left: -9999px;
}
.weui-agree__checkbox-icon {
position: relative;
top: 2px;
display: inline-block;
border: 1px solid #d1d1d1;
background-color: #fff;
border-radius: 3px;
width: 11px;
height: 11px;
}
.weui-agree__checkbox-icon-check {
position: absolute;
top: 1px;
left: 1px;
}
.weui-footer {
color: #999;
font-size: 14px;
text-align: center;
}
.weui-footer_fixed-bottom {
position: fixed;
bottom: 0.52em;
left: 0;
right: 0;
}
.weui-footer__links {
font-size: 0;
}
.weui-footer__link {
display: inline-block;
vertical-align: top;
margin: 0 0.62em;
position: relative;
font-size: 14px;
color: #586c94;
}
.weui-footer__link:before {
content: " ";
position: absolute;
left: 0;
width: 1px;
border-left: 1rpx solid #c7c7c7;
color: #c7c7c7;
left: -0.65em;
top: 0.36em;
bottom: 0.36em;
}
.weui-footer__link:first-child:before {
display: none;
}
.weui-footer__text {
padding: 0 0.34em;
font-size: 12px;
}
.weui-grids {
border-top: 1rpx solid #e5e5e5;
border-left: 1rpx solid #e5e5e5;
overflow: hidden;
}
.weui-grid {
position: relative;
float: left;
padding: 20px 10px;
width: 33.33333333%;
box-sizing: border-box;
border-right: 1rpx solid #e5e5e5;
border-bottom: 1rpx solid #e5e5e5;
}
.weui-grid_active {
background-color: #ececec;
}
.weui-grid__icon {
display: block;
width: 28px;
height: 28px;
margin: 0 auto;
}
.weui-grid__label {
margin-top: 5px;
display: block;
text-align: center;
color: #000;
font-size: 14px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.weui-loading {
margin: 0 5px;
width: 20px;
height: 20px;
display: inline-block;
vertical-align: middle;
animation: weuiLoading 1s steps(12, end) infinite;
background: transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;
background-size: 100%;
}
.weui-loading.weui-loading_transparent {
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect xmlns='http://www.w3.org/2000/svg' width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.56)' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.5)' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.43)' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.38)' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.32)' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.28)' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.25)' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.2)' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.17)' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.14)' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.1)' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.03)' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E");
}
@-webkit-keyframes weuiLoading {
0% {
transform: rotate3d(0, 0, 1, 0deg);
}
100% {
transform: rotate3d(0, 0, 1, 360deg);
}
}
@keyframes weuiLoading {
0% {
transform: rotate3d(0, 0, 1, 0deg);
}
100% {
transform: rotate3d(0, 0, 1, 360deg);
}
}
.weui-badge {
display: inline-block;
padding: 0.15em 0.4em;
min-width: 8px;
border-radius: 18px;
background-color: #e64340;
color: #fff;
line-height: 1.2;
text-align: center;
font-size: 12px;
vertical-align: middle;
}
.weui-badge_dot {
padding: 0.4em;
min-width: 0;
}
.weui-loadmore {
width: 65%;
margin: 1.5em auto;
line-height: 1.6em;
font-size: 14px;
text-align: center;
}
.weui-loadmore__tips {
display: inline-block;
vertical-align: middle;
}
.weui-loadmore_line {
border-top: 1px solid #e5e5e5;
margin-top: 2.4em;
}
.weui-loadmore__tips_in-line {
position: relative;
top: -0.9em;
padding: 0 0.55em;
background-color: #fff;
color: #999;
}
.weui-loadmore__tips_in-dot {
position: relative;
padding: 0 0.16em;
width: 4px;
height: 1.6em;
}
.weui-loadmore__tips_in-dot:before {
content: " ";
position: absolute;
top: 50%;
left: 50%;
margin-top: -1px;
margin-left: -2px;
width: 4px;
height: 4px;
border-radius: 50%;
background-color: #e5e5e5;
}
.weui-panel {
background-color: #fff;
margin-top: 10px;
position: relative;
overflow: hidden;
}
.weui-panel:first-child {
margin-top: 0;
}
.weui-panel:before {
content: " ";
position: absolute;
left: 0;
top: 0;
right: 0;
height: 1px;
border-top: 1rpx solid #e5e5e5;
color: #e5e5e5;
}
.weui-panel:after {
content: " ";
position: absolute;
left: 0;
bottom: 0;
right: 0;
height: 1px;
border-bottom: 1rpx solid #e5e5e5;
color: #e5e5e5;
}
.weui-panel__hd {
padding: 14px 15px 10px;
color: #999;
font-size: 13px;
position: relative;
}
.weui-panel__hd:after {
content: " ";
position: absolute;
bottom: 0;
right: 0;
height: 1px;
border-bottom: 1rpx solid #e5e5e5;
color: #e5e5e5;
left: 15px;
}
.weui-media-box {
padding: 15px;
position: relative;
}
.weui-media-box:before {
content: " ";
position: absolute;
top: 0;
right: 0;
height: 1px;
border-top: 1rpx solid #e5e5e5;
color: #e5e5e5;
left: 15px;
}
.weui-media-box:first-child:before {
display: none;
}
.weui-media-box__title {
font-weight: 400;
font-size: 17px;
width: auto;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-wrap: break-word;
word-break: break-all;
}
.weui-media-box__desc {
color: #999;
font-size: 13px;
line-height: 1.2;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.weui-media-box__info {
margin-top: 15px;
padding-bottom: 5px;
font-size: 13px;
color: #cecece;
line-height: 1em;
list-style: none;
overflow: hidden;
}
.weui-media-box__info__meta {
float: left;
padding-right: 1em;
}
.weui-media-box__info__meta_extra {
padding-left: 1em;
border-left: 1px solid #cecece;
}
.weui-media-box__title_in-text {
margin-bottom: 8px;
}
.weui-media-box_appmsg {
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
align-items: center;
}
.weui-media-box__thumb {
width: 100%;
height: 100%;
vertical-align: top;
}
.weui-media-box__hd_in-appmsg {
margin-right: 0.8em;
width: 60px;
height: 60px;
line-height: 60px;
text-align: center;
}
.weui-media-box__bd_in-appmsg {
-webkit-box-flex: 1;
flex: 1;
min-width: 0;
}
.weui-media-box_small-appmsg {
padding: 0;
}
.weui-cells_in-small-appmsg {
margin-top: 0;
}
.weui-cells_in-small-appmsg:before {
display: none;
}
.weui-progress {
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
align-items: center;
}
.weui-progress__bar {
-webkit-box-flex: 1;
flex: 1;
}
.weui-progress__opr {
margin-left: 15px;
font-size: 0;
}
.weui-navbar {
display: -webkit-box;
display: -webkit-flex;
display: flex;
position: absolute;
z-index: 500;
top: 0;
width: 100%;
border-bottom: 1rpx solid #ccc;
}
.weui-navbar__item {
position: relative;
display: block;
-webkit-box-flex: 1;
flex: 1;
padding: 13px 0;
text-align: center;
font-size: 0;
}
.weui-navbar__item.weui-bar__item_on {
color: #1aad19;
}
.weui-navbar__slider {
position: absolute;
content: " ";
left: 0;
bottom: 0;
width: 6em;
height: 3px;
background-color: #1aad19;
transition: transform 0.3s, -webkit-transform 0.3s;
}
.weui-navbar__title {
display: inline-block;
font-size: 15px;
max-width: 8em;
width: auto;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-wrap: normal;
}
.weui-tab {
position: relative;
height: 100%;
}
.weui-tab__panel {
box-sizing: border-box;
height: 100%;
padding-top: 50px;
overflow: auto;
-webkit-overflow-scrolling: touch;
}
.weui-search-bar {
position: relative;
padding: 8px 10px;
display: -webkit-box;
display: -webkit-flex;
display: flex;
box-sizing: border-box;
background-color: #efeff4;
border-top: 1rpx solid #d7d6dc;
border-bottom: 1rpx solid #d7d6dc;
}
.weui-icon-search {
margin-right: 8px;
font-size: inherit;
}
.weui-icon-search_in-box {
position: absolute;
left: 10px;
top: 7px;
}
.weui-search-bar__text {
display: inline-block;
font-size: 14px;
vertical-align: middle;
}
.weui-search-bar__form {
position: relative;
-webkit-box-flex: 1;
flex: auto;
border-radius: 5px;
background: #fff;
border: 1rpx solid #e6e6ea;
}
.weui-search-bar__box {
position: relative;
padding-left: 30px;
padding-right: 30px;
width: 100%;
box-sizing: border-box;
z-index: 1;
}
.weui-search-bar__input {
height: 28px;
line-height: 28px;
font-size: 14px;
}
.weui-icon-clear {
position: absolute;
top: 0;
right: 0;
padding: 7px 8px;
font-size: 0;
}
.weui-search-bar__label {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 2;
border-radius: 3px;
text-align: center;
color: #9b9b9b;
background: #fff;
line-height: 28px;
}
.weui-search-bar__cancel-btn {
margin-left: 10px;
line-height: 28px;
color: #09bb07;
white-space: nowrap;
}
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
}
.serivce-desc {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20px;
}
.serivce-desc .line {
width: 50%;
border-bottom: 1px solid #ccc;
}
.serivce-desc text {
font-size: 14px;
width: 90px;
font-weight: bold;
color: #999;
text-align: center;
}
button {
padding-top: 2px;
}
button[type=primary] {
background-color: #49586e;
}
button[type=primary]:active {
background-color: #49586e;
}
button[type=primary]:hover {
background-color: #49586e;
}
button[type=primary]:disabled {
background-color: #49586e;
}
button[disabled][type=primary] {
background-color: #6f7888;
}
button::after {
border: none;
}
.text-left {
text-align: left;
}
.text-center {
text-align: center;
}
.text-right {
text-align: right;
}
.left {
float: left;
}
.right {
float: right;
}
.relative {
position: relative;
}
.inline-block {
display: inline-block;
}
.hidden {
visibility: hidden;
}
.cursor {
cursor: pointer;
}
.width-full {
width: 100%;
}
.width-full-important {
width: 100% !important;
}
.line-height-default {
line-height: 1;
}
.table-box {
padding: 20px 15px;
background-color: #fff;
border-radius: 4px;
cursor: pointer;
}
.clearfix {
zoom: 1;
}
.clearfix::after {
content: ".";
display: block;
clear: both;
visibility: hidden;
height: 0;
font-size: 0;
}
File added
Page({
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<image mode="widthFix" src="../../images/advantage-1.png"></image>
<image mode="widthFix" src="../../images/advantage-2.jpg"></image>
<image mode="widthFix" src="../../images/advantage-3.jpg"></image>
/* pages/advantage/advantage.wxss */
image {
width: 100%;
}
\ No newline at end of file
const app = getApp();
Page({
data: {
list: {},
goto: "A",
ready: false,
touchStatus: false,
height: app.globalData.height
},
onShow: function() {
wx.showLoading({
title: '加载中',
})
let _this = this;
wx.request({
url: app.globalData.url + 'assess/brands',
success: function(res) {
if (res.data && Object.keys(res.data).length > 0) {
let data = res.data;
_this.setData({
list: data,
ready: true
}, () => {
wx.hideLoading()
})
}
}
})
},
setBrand: function(e) {
let brandId = e.currentTarget.dataset.brandId;
let brand_name = e.currentTarget.dataset.name;
wx.setStorageSync('brand_name', brand_name)
wx.navigateTo({
url: '/pages/car-select/series?id=' + brandId,
})
},
touchStart: function(e) {
this.setData({
touchStatus: true
})
},
touchEnd: function(e) {
let letter = e.currentTarget.dataset.letter;
if (this.data.touchStatus) {
this.setData({
goto: letter
})
}
},
touchMove: function(e) {
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarBackgroundColor": "#fe9527",
"navigationBarTextStyle": "white",
"navigationBarTitleText": "品牌选择",
"backgroundColor": "#fff",
"backgroundTextStyle": "light"
}
\ No newline at end of file
<scroll-view enable-back-to-top scroll-y class="brand-section" scroll-into-view="{{goto}}" style="height:{{height}}px">
<view class="letter-select common-padding" id="{{index}}" wx:for="{{list}}" wx:for-item="item" wx:key="{{index}}">
<text class="letter">{{index}}</text>
<view class="brand-items">
<view catchtap="setBrand" class="brand-row" data-brand-id="{{brand.id}}" data-name="{{brand.name}}" wx:for="{{item}}" wx:for-item="brand" wx:key="{{brand.id}}">
<view class="brand-name">{{brand.name}}</view>
</view>
</view>
</view>
</scroll-view>
<view class="navbar" wx:if="{{ready}}">
<view bindtouchstart="touchStart" catchtouchend="touchEnd" catchtouchmove="touchMove" class="tar" data-letter="{{index}}" wx:for="{{list}}" wx:for-item="item" wx:key="{{index}}">{{index}}</view>
</view>
\ No newline at end of file
page {
background-color: #f5f5f5;
}
.brand-items {
box-sizing: border-box;
width: 100%;
background: #fff;
padding: 0 20rpx;
}
.brand-row {
display: flex;
flex-flow: row;
align-items: center;
border-bottom: 1rpx solid #e5e5e5;
padding: 15rpx;
}
.brand-row:last-child {
border-bottom: none;
}
.logo image {
max-width: 100%;
max-height: 100%;
}
.letter {
font-size: 28rpx;
color: #999;
padding-left: 20rpx;
}
.brand-row .brand-name {
font-size: 30rpx;
color: #333;
line-height: 3;
margin-left: 30rpx;
}
.hot-brand {
padding: 10rpx 10rpx 0;
}
.logo {
width: 60rpx;
height: 60rpx;
}
.navbar {
position: fixed;
top: 50%;
transform: translate(0, -50%);
right: 0;
}
.navbar .tar {
width: 40px;
color: #3d7dff;
line-height: 42rpx;
text-align: center;
font-size: 28rpx;
}
const app = getApp();
Page({
data: {
list: []
},
onLoad: function(options) {
wx.showLoading({
title: '加载中',
})
let brand_id = options.id;
let _this = this;
wx.request({
url: app.globalData.url + 'assess/serials',
data: {
brand_id
},
success: function(res) {
if (res.data.data && res.data.data.length > 0) {
let data = res.data.data;
_this.setData({
list: data,
}, () => {
wx.hideLoading()
})
}
}
})
},
setSeries: function(e) {
let seriesId = e.currentTarget.dataset.seriesId;
let serial_name = e.currentTarget.dataset.name;
wx.setStorageSync('serial_name', serial_name)
wx.navigateTo({
url: '/pages/car-select/specification?id=' + seriesId,
})
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarBackgroundColor": "#fe9527",
"navigationBarTextStyle": "white",
"navigationBarTitleText": "车系选择",
"backgroundColor": "#fff",
"backgroundTextStyle": "light"
}
\ No newline at end of file
<scroll-view enable-back-to-top scroll-y class="series-section">
<view class="series-items">
<view catchtap="setSeries" class="series-row" data-series-id="{{series.id}}" data-name="{{series.name}}" wx:for="{{list}}" wx:for-item="series" wx:key="{{series.id}}">
<view class="series-name">{{series.name}}</view>
</view>
</view>
</scroll-view>
\ No newline at end of file
page {
background-color: #f5f5f5;
}
.series-items {
box-sizing: border-box;
width: 100%;
background: #fff;
padding: 0 20rpx;
}
.series-row {
display: flex;
flex-flow: row;
align-items: center;
border-bottom: 1rpx solid #e5e5e5;
padding: 15rpx;
}
.series-row:last-child {
border-bottom: none;
}
.logo image {
max-width: 100%;
max-height: 100%;
}
.letter {
font-size: 28rpx;
color: #999;
padding-left: 20rpx;
}
.series-row .series-name {
font-size: 30rpx;
color: #333;
line-height: 3;
margin-left: 10px;
}
.hot-series {
padding: 10rpx 10rpx 0;
}
.logo {
width: 60rpx;
height: 60rpx;
}
const app = getApp();
Page({
data: {
list: {},
hasData: false,
noDataText: '暂无车型信息'
},
onLoad: function(options) {
wx.showLoading({
title: '加载中',
})
let _this = this;
let serial_id = options.id;
wx.request({
url: app.globalData.url + 'assess/models',
data: {
serial_id
},
success: function(res) {
if (res.data.data && res.data.data.length > 0) {
let data = res.data.data;
if (data.length > 0) {
let obj = {}
for (let key in data) {
obj[data[key].y] = []
}
for (let key in data) {
obj[data[key].y].push(data[key])
}
_this.setData({
list: obj,
hasData: true
}, () => {
wx.hideLoading()
})
} else {
wx.hideLoading()
}
}
}
})
},
setSpecification: function(e) {
let specification_id = e.currentTarget.dataset.specificationId;
let specification_name = e.currentTarget.dataset.name;
let years = e.currentTarget.dataset.years;
let brand_name = wx.getStorageSync('brand_name')
let serial_name = wx.getStorageSync('serial_name')
if (serial_name.indexOf(brand_name) > -1) {
specification_name = serial_name + ' ' + specification_name;
} else {
specification_name = brand_name + ' ' + serial_name + ' ' + specification_name;
}
wx.setStorageSync('specification_id', specification_id)
wx.setStorageSync('specification_name', specification_name)
wx.setStorageSync('years', years)
wx.setStorageSync('buy_time', '')
if (app.globalData.enter === 'index') {
wx.switchTab({
url: '/pages/index/index'
})
} else {
wx.switchTab({
url: '/pages/sellcar/sellcar'
})
}
},
onShow: function() {
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarBackgroundColor": "#fe9527",
"navigationBarTextStyle": "white",
"navigationBarTitleText": "车型选择",
"backgroundColor": "#fff",
"backgroundTextStyle": "light"
}
\ No newline at end of file
<scroll-view enable-back-to-top scroll-y class="specification-section">
<view class="letter-select common-padding" wx:for="{{list}}" wx:for-item="item" wx:key="{{index}}" wx:if="{{hasData}}">
<text class="letter">{{index}}</text>
<view class="specification-items">
<view catchtap="setSpecification" class="specification-row" wx:for="{{item}}" wx:for-item="specification" wx:key="{{specification.id}}" data-specification-id="{{specification.id}}" data-name="{{specification.name}}" data-years="{{specification.years}}">
<view class="specification-name">{{specification.name}}</view>
</view>
</view>
</view>
<view wx:if="{{!hasData}}" class='no-data'>{{noDataText}}</view>
</scroll-view>
\ No newline at end of file
page {
background-color: #f5f5f5;
}
.specification-items {
box-sizing: border-box;
width: 100%;
background: #fff;
padding: 0 20rpx;
}
.specification-row {
display: flex;
flex-flow: row;
align-items: center;
border-bottom: 1rpx solid #e5e5e5;
padding: 15rpx;
}
.specification-row:last-child {
border-bottom: none;
}
.logo image {
max-width: 100%;
max-height: 100%;
}
.letter {
font-size: 28rpx;
color: #999;
padding-left: 20rpx;
}
.specification-row .specification-name {
font-size: 30rpx;
color: #333;
line-height: 3;
margin-left: 10px;
}
.hot-specification {
padding: 10rpx 10rpx 0;
}
.logo {
width: 60rpx;
height: 60rpx;
}
.no-data {
padding: 20rpx;
font-size: 28rpx;
color: rgba(57, 66, 77, 0.40);
}
Page({
data: {
lists: [{
title: "卖车需要准备什么?",
txts: "1.身份证 \n 2.行驶证 \n 3.车辆登记证\n 4.车辆钥匙\n 5.车示标(环保标、检字标、交强险标)\n 6.交强险单\n 7.购置税本及购置税发票\n 8.购车发票/最近一次过户发票",
status: false
}, {
title: "卖车流程是怎样的?",
txts: "1.在本页填写卖车信息 24小时内会有客服专员电话回访 并预约验车时间和地点 2.接受专业评估师免费到店检测或上门检测。注:具体需要依照车商服务特点而定 3.车辆完成检测,车商安排网络竞拍,数千家经销商竞价收购,确保以最高价成交",
status: false
}, {
title: "大概多久能成交?",
txts: "最快48小时内成交,签约即可打款。",
status: false
}, {
title: "是否收取费用?",
txts: "二手车圈及合作车商不会向卖家收取任何费用,整个服务过程全部免费。",
status: false
}]
},
showStatus: function(e) {
let index = e.currentTarget.dataset.index;
this.data.lists[index].status = !this.data.lists[index].status;
this.setData({
lists: this.data.lists
});
}
});
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<view class="guide-banner">
<image mode="widthFix" src="../../images/guide-bg.png"></image>
</view>
<view class='guide-content'>
<view class="guide-item" wx:for="{{lists}}" wx:key="index">
<view catchtap="showStatus" class="title" data-index="{{index}}">
<view>
<text>0{{index + 1}}</text> {{item.title}}</view>
<view>
<image class="{{item.status ? 'current' : ''}}" src="../../images/arrow.png"></image>
</view>
</view>
<view class="txts" wx:if="{{item.status}}">{{item.txts}}</view>
</view>
</view>
\ No newline at end of file
/* pages/guide/guide.wxss */
.guide-banner {
width: 100%;
height: 180rpx;
}
.guide-banner image {
width: 100%;
}
.guide-item {
border-bottom: 2rpx solid rgb(242,242,242);
font-size: 28rpx;
}
.guide-item .title {
display: flex;
justify-content: space-between;
height: 120rpx;
padding: 0 36rpx;
line-height: 120rpx;
}
.guide-item .title image {
position: relative;
top: 8rpx;
width: 36rpx;
height: 36rpx;
transform: rotate(90deg);
}
.guide-item .title image.current {
transform: rotate(270deg);
}
.guide-item .title text {
padding-right: 10rpx;
font-size: 38rpx;
color: #fe9527;
}
.guide-item .txts {
padding: 36rpx;
color: rgb(102,102,102);
background-color: rgb(251,251,251);
}
\ No newline at end of file
const app = getApp();
const utils = require('../../utils/util.js')
Page({
data: {
userForms: {
link: app.globalData.link,
specification_id: '',
specification_name: '',
buy_time: '',
mileage: '',
city_id: '',
city_name: '',
phone: ''
},
startTime: '',
endTime: '',
provinceList: [],
province: '',
province_index: '',
cityList: [],
city_index: '',
showPhoneInput: false,
valuation: {},
carInfo: {},
terminal_names: []
},
onShow: function() {
let _this = this
this.setData({
provinceList: app.globalData.provinceList,
province_index: wx.getStorageSync('province_index'),
city_index: wx.getStorageSync('city_index')
}, () => {
let index = wx.getStorageSync('province_index')
let id = wx.getStorageSync('province_id')
if (index) {
_this.setData({
province: _this.data.provinceList[index].name
})
_this.getCityList(id, _this)
}
})
let years = wx.getStorageSync('years')
let startTime, endTime
if (years.length > 4) {
startTime = years.substr(0, 4)
endTime = years.substr(-4, 4)
let today = utils.formatDate(new Date())
if (today.indexOf(endTime) > -1) {
endTime = today
} else {
endTime = endTime + '-12-31'
}
this.setData({
startTime: startTime + '-01-01',
endTime: endTime
})
}
this.getItem('specification_id')
this.getItem('specification_name')
this.getItem('city_id')
this.getItem('city_name')
this.getItem('buy_time')
this.getItem('mileage')
this.getItem('phone')
let province = wx.getStorageSync('province')
this.setData({
province: province ? province : ''
})
this.data.terminal_names = []
},
// 城市列表
getCityList: function(parent_id, _this) {
wx.request({
url: app.globalData.url + 'assess/cities',
data: {
parent_id
},
success: function(res) {
if (res.data && res.data.length > 0) {
let data = res.data
_this.setData({
cityList: data,
}, () => {
let index = wx.getStorageSync('city_index') || '0'
_this.setData({
['userForms.city_name']: _this.data.cityList[index].name
})
let city_id = _this.data.cityList[index].id;
let city_name = _this.data.cityList[index].name;
_this.setData({
['userForms.city_id']: city_id,
['userForms.city_name']: city_name,
})
wx.setStorageSync('city_id', city_id)
wx.setStorageSync('city_name', city_name)
})
}
}
})
},
// 选择省份
changeProvince: function(e) {
let _this = this
let index = e.detail.value
let parent_id = this.data.provinceList[index].id
this.getCityList(parent_id, _this)
let province = this.data.provinceList[index].name;
let province_id = this.data.provinceList[index].id;
wx.setStorageSync('province', province)
wx.setStorageSync('province_id', province_id)
wx.setStorageSync('province_index', index)
this.setData({
province: province,
city_index: '0'
}, () => {
wx.setStorageSync('city_index', '0')
})
},
// 选择城市
changeCity: function(e) {
let index = e.detail.value
let city_id = this.data.cityList[index].id;
let city_name = this.data.cityList[index].name;
this.setData({
['userForms.city_id']: city_id,
['userForms.city_name']: city_name,
})
wx.setStorageSync('city_id', city_id)
wx.setStorageSync('city_name', city_name)
wx.setStorageSync('city_index', index)
},
// 选择品牌
selectBrand: function() {
app.globalData.enter = 'index'
wx.navigateTo({
url: '/pages/car-select/brand',
})
},
// 更新值
getItem(item) {
let _this = this;
let data = wx.getStorageSync(item)
this.setData({
['userForms.' + item]: data ? data : ''
}, () => {
if (item === 'phone' && data) {
_this.setData({
showPhoneInput: true
})
}
})
},
// 选择日期
changeDate: function(e) {
let time = e.detail.value;
this.setData({
['userForms.buy_time']: time
})
wx.setStorageSync('buy_time', time)
},
// 输入行驶里程
mileageInput: function(e) {
let mileage = e.detail.value
this.setData({
['userForms.mileage']: mileage
})
wx.setStorageSync('mileage', mileage)
},
// 输入手机号 
phoneInput: function(e) {
let phone = e.detail.value
this.setData({
['userForms.phone']: phone
})
if (phone.length === 11) {
wx.setStorageSync('phone', phone)
}
},
// 获取手机号
getPhone: function(e) {
let _this = this
let errMsg = e.detail.errMsg
if (errMsg === 'getPhoneNumber:ok') {
if (app.globalData.session_key) {
let data = {
session_key: app.globalData.session_key,
encrypted_data: e.detail.encryptedData,
iv: e.detail.iv,
app_id: app.globalData.app_id
}
wx.request({
url: app.globalData.url + 'decode-phone',
data: data,
method: 'POST',
success: function(res) {
if (res.data.message !== '解密失败') {
let phone = res.data.purePhoneNumber
_this.setData({
['userForms.phone']: phone,
showPhoneInput: true
})
wx.setStorageSync('phone', phone)
} else {
wx.showToast({
icon: 'none',
title: '获取失败,请稍后重试!'
})
}
}
})
} else {
_this.login(e)
}
} else if (errMsg === 'getPhoneNumber:fail user deny') {
this.setData({
['userForms.phone']: '',
showPhoneInput: true
})
}
},
// 重新获取code
login: function(e) {
let _this = this
wx.login({
success: function(res) {
if (res.errMsg === 'login:ok') {
let data = {
code: res.code,
app_id: app.globalData.app_id
}
wx.request({
url: app.globalData.url + 'user-code',
data: data,
success: function(res) {
let data = {
session_key: res.data.session_key,
encrypted_data: e.detail.encryptedData,
iv: e.detail.iv,
app_id: app.globalData.app_id
}
wx.request({
url: app.globalData.url + 'decode-phone',
data: data,
method: 'POST',
success: function(res) {
if (res.data.message !== '解密失败') {
let phone = res.data.purePhoneNumber
_this.setData({
['userForms.phone']: phone,
showPhoneInput: true
})
wx.setStorageSync('phone', phone)
} else {
wx.showToast({
icon: 'none',
title: '获取失败,请稍后重试!'
})
}
}
})
}
})
}
}
})
},
// 检测是否为空
checkValue: function() {
if (!this.data.userForms.specification_name) {
wx.showToast({
icon: 'none',
title: '请选择车型!'
})
return false;
}
if (!this.data.userForms.buy_time) {
wx.showToast({
icon: 'none',
title: '请选择上牌时间!'
})
return false;
}
if (!this.data.userForms.city_name) {
wx.showToast({
icon: 'none',
title: '请选择城市!'
})
return false;
}
if (!this.data.userForms.mileage) {
wx.showToast({
icon: 'none',
title: '请输入行驶里程!'
})
return false;
}
if (Number(this.data.userForms.mileage) > 100) {
wx.showToast({
icon: 'none',
title: '行驶里程不能超过100万公里!'
})
return false;
}
if (!this.data.userForms.phone) {
wx.showToast({
icon: 'none',
title: '请输入手机号码!'
})
return false;
}
let reg = /^1(3|4|5|7|8|9)\d{9}$/;
if (!reg.test(this.data.userForms.phone)) {
wx.showToast({
icon: 'none',
title: '手机号码格式不正确!'
})
return false;
}
this.terminalAvailable(app.globalData.tiantianpaiche_cityList, '天天拍车');
let terminal_length = this.data.terminal_names.length;
let kaixun_terminal_index = this.data.terminal_names.indexOf('上海铠寻');
if (this.data.userForms.city_name === '上海' && kaixun_terminal_index < 0) {
this.data.terminal_names[terminal_length] = '上海铠寻'
} else if (this.data.userForms.city_name !== '上海' && kaixun_terminal_index > 0) {
this.data.terminal_names.splice(kaixun_terminal_index, 1);
}
this.terminalAvailable(app.globalData.chezhibao_cityList, '车置宝');
this.terminalAvailable(app.globalData.renrenche_cityList, '人人车');
return true;
},
// 城市是否覆盖 是否选择推送
terminalAvailable: function(cityList, name) {
let terminal_length = this.data.terminal_names.length;
let index = cityList.indexOf(this.data.userForms.city_name);
let terminal_index = this.data.terminal_names.indexOf(name);
if (index < 0 && terminal_index > -1) {
this.data.terminal_names.splice(terminal_index, 1);
} else if (index > -1 && terminal_index < 0) {
this.data.terminal_names[terminal_length] = name
}
},
// 估价
submit: function() {
let _this = this;
if (this.checkValue()) {
wx.showLoading({
title: '请求加载中',
mask: true
})
_this.data.terminal_names.push('瓜子二手车', '精真估')
_this.setData({
terminal_names: _this.data.terminal_names
}, () => {
_this.storeCar();
})
}
},
// 存储车
storeCar: function() {
let _this = this;
wx.request({
url: app.globalData.url + 'cars',
method: 'POST',
data: _this.data.userForms,
success: function(res) {
let data = res.data;
if (data.message === 'ok') {
let carInfo = data.data;
wx.setStorageSync('carInfo', carInfo)
let created_at = new Date(carInfo.created_at).getTime()
if (Date.now() - created_at < 3000) { // 新车
_this.sellCar();
} else { // 已存在
_this.evaluate();
}
} else {
wx.showToast({
icon: 'none',
title: '请求错误,请稍后重试!'
})
}
},
fail: function() {
wx.showToast({
icon: 'none',
title: '请求错误,请稍后重试!'
})
},
complete: function() {}
})
},
// 卖车接口
sellCar: function() {
let _this = this;
wx.request({
url: app.globalData.url + 'distributions/push-to-terminals',
data: {
car_id: wx.getStorageSync('carInfo').id,
terminal_names: this.data.terminal_names
},
method: "POST",
success: function(res) {
if (res.data.message === 'ok') {
_this.evaluate();
} else {
wx.showToast({
icon: 'none',
title: '请求错误,请稍后重试!'
})
}
},
fail: function() {
wx.showToast({
icon: 'none',
title: '请求错误,请稍后重试!'
})
},
complete: function() {}
})
},
// 估值接口
evaluate: function() {
let _this = this;
let data = {
model_id: this.data.userForms.specification_id,
road_haul: this.data.userForms.mileage * 10000,
license_year: this.data.userForms.buy_time.substr(0, 4),
license_month: this.data.userForms.buy_time.substr(5, 2),
city_id: this.data.userForms.city_id,
}
wx.request({
url: app.globalData.url + 'assess/assess',
data: data,
success: function(res) {
if (res.data.message !== '估值失败') {
let data = res.data;
wx.setStorageSync('valuation', data)
app.globalData.result = 'result'
wx.navigateTo({
url: '/pages/result/result',
})
} else {
wx.showToast({
icon: 'none',
title: '未查询到结果!'
})
}
},
fail: function() {
wx.showToast({
icon: 'none',
title: '请求错误,请稍后重试!'
})
},
complete: function() {
}
})
},
// 分享
onShareAppMessage: function() {
return {
title: "爱车估值",
path: "/pages/index/index"
};
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<view class="container">
<image class='banner' mode='widthFix' src='../../images/banner.png'></image>
</view>
<form>
<view class="form-section">
<view class="weui-cells weui-cells_after-title weui-fixed">
<view class="weui-cell weui-cell_input form-input-item">
<view class="weui-cell__hd">
<view class="weui-label">选择车型</view>
</view>
<view bindtap="selectBrand" class="weui-cell__bd weui-cell__ft_in-access">
<view class="input-content" wx:if="{{userForms.specification_name}}">{{userForms.specification_name}}</view>
<view class="placeholder" wx:else>请选择车型</view>
</view>
</view>
<view class="weui-cell weui-cell_input form-input-item">
<view class="weui-cell__hd">
<view class="weui-label">上牌时间</view>
</view>
<view class="weui-cell__bd weui-cell__ft_in-access">
<picker bindchange="changeDate" mode="date" start="{{startTime}}" end="{{endTime}}" value="{{userForms.buy_time}}" disabled='{{!userForms.specification_name}}'>
<view class="input-content" wx:if="{{userForms.buy_time}}">{{userForms.buy_time}}</view>
<view class="placeholder" wx:else>请选择上牌时间</view>
</picker>
</view>
</view>
<view class="weui-cell weui-cell_input form-input-item">
<view class="weui-cell__hd">
<view class="weui-label">所在省份</view>
</view>
<view class="weui-cell__bd weui-cell__ft_in-access">
<picker bindchange="changeProvince" mode="selector" range="{{provinceList}}" rangeKey="name" value="{{province_index}}">
<view class="input-content" wx:if="{{province}}">{{province}}</view>
<view class="placeholder" wx:else>请选择省份</view>
</picker>
</view>
</view>
<view class="weui-cell weui-cell_input form-input-item">
<view class="weui-cell__hd">
<view class="weui-label">所在城市</view>
</view>
<view class="weui-cell__bd weui-cell__ft_in-access">
<picker bindchange="changeCity" mode="selector" range="{{cityList}}" rangeKey="name" value="{{city_index}}" disabled='{{cityList.length === 0}}'>
<view class="input-content" wx:if="{{userForms.city_name}}">{{userForms.city_name}}</view>
<view class="placeholder" wx:else>请选择城市</view>
</picker>
</view>
</view>
<view class="weui-cell weui-cell_input form-input-item">
<view class="weui-cell__hd">
<view class="weui-label">行驶里程</view>
</view>
<view class="weui-cell__bd">
<input bindinput="mileageInput" maxlength="3" class="weui-input text-right" placeholder="请输入行驶里程" type="digit" value="{{userForms.mileage}}"></input>
</view>
<view class="weui-cell__ft">
<view class="weui-label mileage">万公里</view>
</view>
</view>
<view class="weui-cell weui-cell_input form-input-item">
<view class="weui-cell__hd">
<view class="weui-label">手机号码</view>
</view>
<view class="weui-cell__bd">
<input bindinput="phoneInput" class="weui-input" maxlength="11" placeholder="11位手机号" type="number" value="{{userForms.phone}}"></input>
<!-- <input bindinput="phoneInput" class="weui-input" maxlength="11" placeholder="11位手机号" type="number" value="{{userForms.phone}}" wx:if="{{showPhoneInput}}"></input>
<button bindgetphonenumber="getPhone" id="get-phone" openType="getPhoneNumber" size="mini" type="primary" wx:else>11位手机号</button> -->
</view>
</view>
</view>
</view>
<view class="weui-cell submit-section">
<button bindtap="submit" type="primary" hover-class="none">快速估价</button>
</view>
</form>
\ No newline at end of file
page {
background-color: #f5f5f5;
}
.banner {
width: 100%;
}
.form {
background-color: #fff;
}
.form-input-item {
height: 100rpx;
color: #39424D;
font-size: 30rpx;
}
.form-input-left {
text-align: right;
}
.submit-section {
text-align: center;
padding: 40rpx 0;
}
.submit-section button {
width: 70%;
background-color: #fe560e;
}
.submit-section button:hover {
background-color: #fe560e;
}
.desc-section {
padding: 0 30rpx 40rpx;
}
.logo {
height: 120rpx;
display: flex;
align-items: center;
justify-content: center;
}
.logo image {
width: 100rpx;
height: 48rpx;
}
.logo-item {
margin: 0 8rpx;
color: #666;
}
.get-yzm {
padding-left: 0;
padding-right: 0;
margin-right: 30rpx;
margin-left: 20rpx;
margin-top: 10rpx;
}
#get-yzm {
background-color: #00CB7C!important;
}
#get-yzm.cur {
background-color: #B4B4B4!important;
}
#get-yzm:hover {
background-color: #00CB7C!important;
}
.question .q {
color: #666;
font-size: 32rpx;
font-weight: bold;
margin: 20rpx 0;
}
.question .a {
color: #999;
font-size: 28rpx;
padding-left: 30rpx;
}
.weui-fixed::before {
border-top-width: 0;
}
.accept {
padding: 12rpx 30rpx;
font-size: 28rpx;
color: #666;
}
.submit-section::before {
border-top-width: 0;
}
#get-phone {
background-color: white;
display: block;
color: rgba(57,66,77,0.40);
border-color: white;
font-size: 30rpx;
padding: 0;
text-align: right;
margin: 0;
}
#get-phone::after {
border-color: white;
}
.placeholder {
color: rgba(57,66,77,0.40);
text-align: right;
}
.input-content {
color: #39424D;
text-align: right;
}
.mileage {
width: 120rpx;
color: #39424D;
}
.phone-text {
color: #39424D;
}
.weui-input {
color: #39424D;
text-align: right;
}
\ No newline at end of file
const app = getApp();
Page({
data: {
specification_name: '',
buy_time: '',
mileage: '',
city_name: '',
active: 'condition_excellent',
tabs: [{
text: '车况优秀',
index: 'condition_excellent'
}, {
text: '车况良好',
index: 'condition_good'
}, {
text: '车况一般',
index: 'condition_average'
}],
merchant_price: '',
personal_price: '',
time: ''
},
onShow: function() {
if (app.globalData.result) {
wx.showLoading({
title: '查询中',
})
}
this.getItem('specification_name')
this.getItem('buy_time')
this.getItem('mileage')
this.getItem('city_name')
let carInfo = wx.getStorageSync('carInfo');
let valuation = wx.getStorageSync('valuation');
this.setData({
merchant_price: valuation['condition_excellent'].dealer_high_buy_price,
personal_price: valuation['condition_excellent'].individual_price,
time: carInfo.created_at.substr(0, 10)
}, () => {
if (app.globalData.result) {
wx.hideLoading()
wx.showToast({
icon: 'none',
title: '查询成功!',
})
}
})
},
getItem: function(value) {
this.setData({
[value]: wx.getStorageSync(value)
})
},
// 切换车况
changeTab: function(e) {
let index = e.currentTarget.dataset.index;
let valuation = wx.getStorageSync('valuation');
this.setData({
active: index
}, () => {
this.setData({
merchant_price: valuation[index].dealer_high_buy_price,
personal_price: valuation[index].individual_price,
})
})
},
reevaluate: function() {
let phone = wx.getStorageSync('phone')
wx.clearStorageSync();
wx.setStorageSync('phone', phone)
wx.switchTab({
url: '/pages/index/index',
})
},
sellcar: function() {
this.updateStatus();
},
// 更新卖车状态
updateStatus: function() {
wx.showLoading({
title: '请求加载中',
mask: true
})
let _this = this;
wx.request({
url: app.globalData.url + 'distributions/update-sale-type',
data: {
sale_type: 1,
car_id: wx.getStorageSync('carInfo').id
},
method: "POST",
success: function(res) {
if (res.data.message === 'ok') {
app.globalData.enter = 'index'
app.globalData.result = ''
wx.navigateTo({
url: '/pages/submit/submit',
})
} else {
wx.showToast({
icon: 'none',
title: '请求错误,请稍后重试!'
})
}
},
fail: function() {
wx.showToast({
icon: 'none',
title: '请求错误,请稍后重试!'
})
},
complete: function() {
}
})
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarBackgroundColor": "#fe9527",
"navigationBarTextStyle": "white",
"navigationBarTitleText": "估值结果",
"backgroundColor": "#fff",
"backgroundTextStyle": "light"
}
\ No newline at end of file
<view class='car-container'>
<view class='car-info-content'>
<image class='car-img' src='../../images/avatar_car.png' mode='widthFix'></image>
<view class='car-desc'>
<view class='car-specification'>{{specification_name}}</view>
<view class='car-info'>
<text class='car-item'>{{buy_time}}</text>
<text class='car-item'>{{mileage}}万公里</text>
<text class='car-item'>{{city_name}}</text>
</view>
</view>
</view>
<view class='car-content'>
<view class='list'>
<view wx:for="{{tabs}}" wx:for-item="item" wx:key="{{index}}" class="item {{active === item.index ? 'active' : ''}}" data-index="{{item.index}}" bindtap='changeTab'>{{item.text}}</view>
</view>
</view>
<view class='tab-content'>
<view class='left'>
<image src='../../images/merchant.png' mode='widthFix'></image>
<view class='price-wrap'>
<text class='price-merchant'>{{merchant_price}}</text>万元
</view>
<view class='suggest-text'>建议售价</view>
</view>
<view class='right'>
<image src='../../images/personal.png' mode='widthFix'></image>
<view class='price-wrap'>
<text class='price-merchant'>{{personal_price}}</text>万元
</view>
<view class='suggest-text'>建议售价</view>
</view>
</view>
<view class='last-evaluate-time'>
上次报价时间: {{time}}
</view>
<view class="submit-section">
<button bindtap='sellcar' type="primary" hover-class="none">我要卖车</button>
<button bindtap='reevaluate' class='reevaluate' hover-class="none">再次估值</button>
</view>
</view>
\ No newline at end of file
page {
height: 100%;
background-color: #f5f5f5;
}
.car-info-content {
display: flex;
width: 100%;
height: 280rpx;
padding: 0 10rpx 0 30rpx;
box-sizing: border-box;
background: #ffa85d;
align-items: center;
}
.car-info-content .car-img {
width: 120rpx;
margin-right: 24rpx;
}
.car-info-content .car-desc {
flex: 1;
align-items: center;
}
.car-specification {
line-height: 44rpx;
margin-bottom: 20rpx;
font-size: 32rpx;
color: #fff;
}
.car-info {
margin-bottom: 20rpx;
line-height: 36rpx;
font-size: 28rpx;
color: #fff;
opacity: 0.8;
}
.car-info .car-item {
margin-right: 30rpx;
}
.car-content {
width: 100%;
}
.list {
display: flex;
justify-content: space-around;
line-height: 88rpx;
background-color: #fff;
}
.list .item {
text-align: center;
font-size: 28rpx;
color: rgba(57, 66, 77, 0.70);
}
.list .item.active {
font-size: 32rpx;
color: #39424d;
border-bottom: 4rpx solid #ffa85d;
}
.tab-content {
width: 100%;
padding: 30rpx;
overflow: hidden;
box-sizing: border-box;
}
.tab-content .left, .tab-content .right {
width: 48%;
height: 360rpx;
text-align: center;
background-color: #fff;
box-shadow: 0 0 20rpx 0 rgba(0, 0, 0, 0.10);
}
.tab-content image {
margin-top: 36rpx;
width: 188rpx;
}
.tab-content .price-wrap {
margin: 56rpx 0;
font-size: 32rpx;
color: #285bf6;
}
.tab-content .suggest-text {
font-size: 28rpx;
color: rgba(57, 66, 77, 0.40);
text-align: center;
}
.last-evaluate-time {
margin-top: 20rpx;
font-size: 24rpx;
color: rgba(57, 66, 77, 0.70);
text-align: center;
}
.submit-section {
margin-top: 60rpx;
text-align: center;
}
.submit-section button {
width: 70%;
background-color: #fe560e;
}
.submit-section button:hover {
background-color: #fe560e;
}
.submit-section .reevaluate {
margin-top: 30rpx;
color: #333;
background-color: #fff;
}
.submit-section .reevaluate:hover {
color: #333;
background-color: #fff;
}
const app = getApp();
const utils = require('../../utils/util.js')
Page({
data: {
userForms: {
link: app.globalData.link,
specification_id: '',
specification_name: '',
buy_time: '',
mileage: '',
city_id: '',
city_name: '',
phone: ''
},
startTime: '',
endTime: '',
provinceList: [],
province: '',
province_index: '',
cityList: [],
city_index: '',
showPhoneInput: false,
isShow: false,
collapseText: '展开',
valuation: {},
carInfo: {},
terminal_names: [],
partner: [{
id: 0,
logo: '../../images/shop_tiantianpaiche.png',
name: '天天拍车',
selected: true,
des: '全国性二手车竞拍平台,买家在线竞拍,覆盖全国50多个主要城市,免费上门检测,最快一天成交!'
},
{
id: 1,
logo: '../../images/shop_guazi.png',
name: '瓜子二手车',
selected: true,
des: '提供保卖服务。专注个人二手车交易,个人卖主直接把车卖给个人买家!'
},
{
id: 2,
logo: '../../images/shop_chezhibao.png',
name: '车置宝',
selected: true,
des: '一个专注收车的网站。通过全业务流程大数据驱动,可以提供免费上门检测服务。即日起在车置宝成功卖车,最高可享20000元卖车补贴。'
},
{
id: 3,
logo: '../../images/shop_renrenche.png',
name: '人人车',
selected: true,
des: '全程免费帮卖,免费上门评估,边开边卖,代办过户!最高多卖20%!'
}
],
},
onShow: function() {
let _this = this
this.setData({
provinceList: app.globalData.provinceList,
province_index: wx.getStorageSync('province_index'),
city_index: wx.getStorageSync('city_index')
}, () => {
let index = wx.getStorageSync('province_index')
let id = wx.getStorageSync('province_id')
if (index) {
_this.setData({
province: _this.data.provinceList[index].name
})
_this.getCityList(id, _this)
}
})
let years = wx.getStorageSync('years')
let startTime, endTime
if (years.length > 4) {
startTime = years.substr(0, 4)
endTime = years.substr(-4, 4)
let today = utils.formatDate(new Date())
if (today.indexOf(endTime) > -1) {
endTime = today
} else {
endTime = endTime + '-12-31'
}
this.setData({
startTime: startTime + '-01-01',
endTime: endTime
})
}
this.data.terminal_names = this.data.partner.map(item => item.name)
this.getItem('specification_id')
this.getItem('specification_name')
this.getItem('city_id')
this.getItem('city_name')
this.getItem('buy_time')
this.getItem('mileage')
this.getItem('phone')
let province = wx.getStorageSync('province')
this.setData({
province: province ? province : ''
})
},
// 城市列表
getCityList: function(parent_id, _this) {
wx.request({
url: app.globalData.url + 'assess/cities',
data: {
parent_id
},
success: function(res) {
if (res.errMsg === 'request:ok') {
let data = res.data
_this.setData({
cityList: data,
}, () => {
let index = wx.getStorageSync('city_index') || '0'
_this.setData({
['userForms.city_name']: _this.data.cityList[index].name
})
let city_id = _this.data.cityList[index].id;
let city_name = _this.data.cityList[index].name;
_this.setData({
['userForms.city_id']: city_id,
['userForms.city_name']: city_name,
})
wx.setStorageSync('city_id', city_id)
wx.setStorageSync('city_name', city_name)
})
}
}
})
},
// 选择省份
changeProvince: function(e) {
let _this = this
let index = e.detail.value
let parent_id = this.data.provinceList[index].id
this.getCityList(parent_id, _this)
let province = this.data.provinceList[index].name;
let province_id = this.data.provinceList[index].id;
wx.setStorageSync('province', province)
wx.setStorageSync('province_id', province_id)
wx.setStorageSync('province_index', index)
this.setData({
province: province,
city_index: '0'
}, () => {
wx.setStorageSync('city_index', '0')
})
},
// 选择城市
changeCity: function(e) {
let index = e.detail.value
let city_id = this.data.cityList[index].id;
let city_name = this.data.cityList[index].name;
this.setData({
['userForms.city_id']: city_id,
['userForms.city_name']: city_name,
})
wx.setStorageSync('city_id', city_id)
wx.setStorageSync('city_name', city_name)
wx.setStorageSync('city_index', index)
},
// 选择品牌
selectBrand: function() {
app.globalData.enter = 'sell-car'
wx.navigateTo({
url: '/pages/car-select/brand',
})
},
// 更新值
getItem(item) {
let _this = this;
let data = wx.getStorageSync(item)
this.setData({
['userForms.' + item]: data ? data : ''
}, () => {
if(item === 'phone' && data) {
_this.setData({
showPhoneInput: true
})
}
})
},
// 选择日期
changeDate: function(e) {
let time = e.detail.value;
this.setData({
['userForms.buy_time']: time
})
wx.setStorageSync('buy_time', time)
},
// 输入行驶里程
mileageInput: function(e) {
let mileage = e.detail.value
this.setData({
['userForms.mileage']: mileage
})
wx.setStorageSync('mileage', mileage)
},
// 输入手机号 
phoneInput: function (e) {
let phone = e.detail.value
this.setData({
['userForms.phone']: phone
})
if (phone.length === 11) {
wx.setStorageSync('phone', phone)
}
},
// 获取手机号
getPhone: function (e) {
let _this = this
let errMsg = e.detail.errMsg
if (errMsg === 'getPhoneNumber:ok') {
if (app.globalData.session_key) {
let data = {
session_key: app.globalData.session_key,
encrypted_data: e.detail.encryptedData,
iv: e.detail.iv,
app_id: app.globalData.app_id
}
wx.request({
url: app.globalData.url + 'decode-phone',
data: data,
method: 'POST',
success: function (res) {
if (res.data.message !== '解密失败') {
let phone = res.data.purePhoneNumber
_this.setData({
['userForms.phone']: phone,
})
wx.setStorageSync('phone', phone)
} else {
wx.showToast({
icon: 'none',
title: '获取失败,请稍后重试!'
})
}
}
})
} else {
_this.login(e)
}
} else if (errMsg === 'getPhoneNumber:fail user deny') {
this.setData({
['userForms.phone']: '',
showPhoneInput: true
})
}
},
// 重新获取code
login: function (e) {
let _this = this
wx.login({
success: function (res) {
if (res.errMsg === 'login:ok') {
let data = {
code: res.code,
app_id: app.globalData.app_id
}
wx.request({
url: app.globalData.url + 'user-code',
data: data,
success: function (res) {
let data = {
session_key: res.data.session_key,
encrypted_data: e.detail.encryptedData,
iv: e.detail.iv,
app_id: app.globalData.app_id
}
wx.request({
url: app.globalData.url + 'decode-phone',
data: data,
method: 'POST',
success: function (res) {
if (res.data.message !== '解密失败') {
let phone = res.data.purePhoneNumber
_this.setData({
['userForms.phone']: phone,
})
wx.setStorageSync('phone', phone)
} else {
wx.showToast({
icon: 'none',
title: '获取失败,请稍后重试!'
})
}
}
})
}
})
}
}
})
},
// 是否勾选
handleSelect: function(e) {
let index = e.currentTarget.dataset.index;
let selected = e.currentTarget.dataset.selected;
let item = 'partner[' + index + '].selected';
this.setData({
[item]: !selected
}, () => {
let list = []
for (let key in this.data.partner) {
let item = this.data.partner[key]
if (item.selected) {
list.push(item.name)
}
}
this.setData({
terminal_names: list
})
})
},
// 是否展示
showCollapse: function() {
this.setData({
isShow: !this.data.isShow
}, () => {
if (this.data.isShow) {
this.setData({
collapseText: '收起'
})
} else {
this.setData({
collapseText: '展开'
})
}
})
},
// 检测是否为空
checkValue: function() {
if (!this.data.userForms.specification_name) {
wx.showToast({
icon: 'none',
title: '请选择车型!'
})
return false;
}
if (!this.data.userForms.buy_time) {
wx.showToast({
icon: 'none',
title: '请选择上牌时间!'
})
return false;
}
if (!this.data.userForms.city_name) {
wx.showToast({
icon: 'none',
title: '请选择城市!'
})
return false;
}
if (!this.data.userForms.mileage) {
wx.showToast({
icon: 'none',
title: '请输入行驶里程!'
})
return false;
}
if (Number(this.data.userForms.mileage) > 100) {
wx.showToast({
icon: 'none',
title: '行驶里程不能超过100万公里!'
})
return false;
}
if (!this.data.userForms.phone) {
wx.showToast({
icon: 'none',
title: '请输入手机号码!'
})
return false;
}
let reg = /^1(3|4|5|7|8|9)\d{9}$/;
if (!reg.test(this.data.userForms.phone)) {
wx.showToast({
icon: 'none',
title: '手机号码格式不正确!'
})
return false;
}
if (this.data.terminal_names.length === 0) {
wx.showToast({
icon: 'none',
title: '至少选择一个卖车平台!'
})
return false;
}
this.terminalAvailable(app.globalData.tiantianpaiche_cityList, '天天拍车');
let terminal_length = this.data.terminal_names.length;
let kaixun_terminal_index = this.data.terminal_names.indexOf('上海铠寻');
if (this.data.userForms.city_name === '上海' && kaixun_terminal_index < 0) {
this.data.terminal_names[terminal_length] = '上海铠寻'
} else if (this.data.userForms.city_name !== '上海' && kaixun_terminal_index > 0) {
this.data.terminal_names.splice(kaixun_terminal_index, 1);
}
this.terminalAvailable(app.globalData.chezhibao_cityList, '车置宝');
this.terminalAvailable(app.globalData.renrenche_cityList, '人人车');
return true;
},
// 城市是否覆盖 是否选择推送
terminalAvailable: function(cityList, name) {
let terminal_length = this.data.terminal_names.length;
let index = cityList.indexOf(this.data.userForms.city_name);
let terminal_index = this.data.terminal_names.indexOf(name);
if (index < 0 && terminal_index > -1) {
this.data.terminal_names.splice(terminal_index, 1);
} else if (index > -1 && terminal_index < 0) {
this.data.terminal_names[terminal_length] = name
}
},
// 提交
submit: function() {
let _this = this;
if (this.checkValue()) {
wx.showLoading({
title: '请求加载中',
mask: true
})
_this.data.terminal_names.push('精真估')
_this.setData({
terminal_names: _this.data.terminal_names
}, () => {
_this.storeCar();
})
}
},
// 存储车
storeCar: function() {
let _this = this;
wx.request({
url: app.globalData.url + 'cars',
method: 'POST',
data: _this.data.userForms,
success: function(res) {
let data = res.data;
if (data.message === 'ok') {
let carInfo = data.data;
wx.setStorageSync('carInfo', carInfo)
let created_at = new Date(carInfo.created_at).getTime()
if (Date.now() - created_at < 3000) { // 新车
_this.sellCar();
} else { // 已存在
_this.updateStatus();
}
} else {
wx.showToast({
icon: 'none',
title: '请求错误,请稍后重试!'
})
}
},
fail: function() {
wx.showToast({
icon: 'none',
title: '请求错误,请稍后重试!'
})
},
complete: function() {}
})
},
// 卖车接口
sellCar: function() {
let _this = this
wx.request({
url: app.globalData.url + 'distributions/push-to-terminals',
data: {
car_id: wx.getStorageSync('carInfo').id,
terminal_names: this.data.terminal_names
},
method: "POST",
success: function(res) {
if (res.data.message === 'ok') {
_this.updateStatus();
} else {
wx.showToast({
icon: 'none',
title: '请求错误,请稍后重试!'
})
}
},
fail: function() {
wx.showToast({
icon: 'none',
title: '请求错误,请稍后重试!'
})
},
complete: function() {}
})
},
// 更新卖车状态
updateStatus: function() {
let _this = this;
wx.request({
url: app.globalData.url + 'distributions/update-sale-type',
data: {
sale_type: 1,
car_id: wx.getStorageSync('carInfo').id
},
method: "POST",
success: function(res) {
if (res.data.message === 'ok') {
app.globalData.enter = 'sell-car'
wx.navigateTo({
url: '/pages/submit/submit',
})
} else {
wx.showToast({
icon: 'none',
title: '请求错误,请稍后重试!'
})
}
},
fail: function() {
wx.showToast({
icon: 'none',
title: '请求错误,请稍后重试!'
})
},
complete: function() {}
})
},
// 分享
onShareAppMessage: function() {
return {
title: "高价卖车",
path: "/pages/sellcar/sellcar"
};
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<view class="container">
<image class='banner' mode='widthFix' src='../../images/banner-sell.png'></image>
</view>
<form class="form">
<view class="form-section">
<view class="weui-cells weui-cells_after-title weui-fixed">
<view class="weui-cell weui-cell_input form-input-item">
<view class="weui-cell__hd">
<view class="weui-label">选择车型</view>
</view>
<view bindtap="selectBrand" class="weui-cell__bd weui-cell__ft_in-access">
<view class="input-content" wx:if="{{userForms.specification_name}}">{{userForms.specification_name}}</view>
<view class="placeholder" wx:else>请选择车型</view>
</view>
</view>
<view class="weui-cell weui-cell_input form-input-item">
<view class="weui-cell__hd">
<view class="weui-label">上牌时间</view>
</view>
<view class="weui-cell__bd weui-cell__ft_in-access">
<picker bindchange="changeDate" mode="date" start="{{startTime}}" end="{{endTime}}" value="{{userForms.buy_time}}" disabled='{{!userForms.specification_name}}'>
<view class="input-content" wx:if="{{userForms.buy_time}}">{{userForms.buy_time}}</view>
<view class="placeholder" wx:else>请选择上牌时间</view>
</picker>
</view>
</view>
<view class="weui-cell weui-cell_input form-input-item">
<view class="weui-cell__hd">
<view class="weui-label">所在省份</view>
</view>
<view class="weui-cell__bd weui-cell__ft_in-access">
<picker bindchange="changeProvince" mode="selector" range="{{provinceList}}" rangeKey="name" value="{{province_index}}">
<view class="input-content" wx:if="{{province}}">{{province}}</view>
<view class="placeholder" wx:else>请选择省份</view>
</picker>
</view>
</view>
<view class="weui-cell weui-cell_input form-input-item">
<view class="weui-cell__hd">
<view class="weui-label">所在城市</view>
</view>
<view class="weui-cell__bd weui-cell__ft_in-access">
<picker bindchange="changeCity" mode="selector" range="{{cityList}}" rangeKey="name" value="{{city_index}}" disabled='{{cityList.length === 0}}'>
<view class="input-content" wx:if="{{userForms.city_name}}">{{userForms.city_name}}</view>
<view class="placeholder" wx:else>请选择城市</view>
</picker>
</view>
</view>
<view class="weui-cell weui-cell_input form-input-item">
<view class="weui-cell__hd">
<view class="weui-label">行驶里程</view>
</view>
<view class="weui-cell__bd">
<input bindinput="mileageInput" maxlength="3" class="weui-input text-right" placeholder="请输入行驶里程" type="digit" value="{{userForms.mileage}}"></input>
</view>
<view class="weui-cell__ft">
<view class="weui-label mileage">万公里</view>
</view>
</view>
<view class="weui-cell weui-cell_input form-input-item">
<view class="weui-cell__hd">
<view class="weui-label">手机号码</view>
</view>
<view class="weui-cell__bd">
<input bindinput="phoneInput" class="weui-input" maxlength="11" placeholder="11位手机号" type="number" value="{{userForms.phone}}"></input>
<!-- <input bindinput="phoneInput" class="weui-input" maxlength="11" placeholder="11位手机号" type="number" value="{{userForms.phone}}" wx:if="{{showPhoneInput}}"></input>
<button bindgetphonenumber="getPhone" id="get-phone" openType="getPhoneNumber" size="mini" type="primary" wx:else>11位手机号</button> -->
</view>
</view>
</view>
</view>
<view class='partner-wrap'>
<view class='partner'>
<view class='left'>
<view>选择卖车平台</view>
<view class='tips'>平台选择越多,高价卖车机会越多</view>
</view>
<view bindtap='showCollapse' class="collapse {{isShow ? 'collapse-up' : 'collapse-down'}}">
<text class='collapse-text'>{{collapseText}}</text>
</view>
</view>
<view class='collapse-content' wx:if="{{isShow}}" animation="{{animation}}">
<view wx:for="{{partner}}" wx:for-item="item" wx:key="{{item.id}}" class='collapse-item'>
<image src='{{item.logo}}'></image>
<view class='des'>{{item.des}}</view>
<view bindtap='handleSelect' data-index="{{item.id}}" data-selected='{{item.selected}}' class="{{item.selected ? 'selected' : 'unselected'}}"></view>
</view>
</view>
</view>
<view class="weui-cell submit-section">
<button bindtap="submit" type="primary" hover-class="none">一键卖车</button>
</view>
<view class='progress'>
<image src='../../images/maicheliucheng.png' class='progress-title'></image>
<image src='../../images/progress.jpg' mode='widthFix'></image>
</view>
</form>
\ No newline at end of file
page {
background-color: #f5f5f5;
}
.banner {
width: 100%;
}
.form {
display: block;
margin-top: -80rpx;
padding: 0 30rpx 40rpx 30rpx;
}
.form-section {
box-shadow: 0 4rpx 40rpx 0 rgba(57, 66, 77, 0.08);
}
.form-input-item {
height: 100rpx;
color: #39424d;
font-size: 30rpx;
}
.form-input-left {
text-align: right;
}
.submit-section {
text-align: center;
padding: 40rpx 0;
}
.submit-section button {
width: 70%;
background-color: #fe560e;
}
.submit-section button:hover {
background-color: #fe560e;
}
.desc-section {
padding: 0 30rpx 40rpx;
}
.logo {
height: 120rpx;
display: flex;
align-items: center;
justify-content: center;
}
.logo image {
width: 100rpx;
height: 48rpx;
}
.logo-item {
margin: 0 8rpx;
color: #666;
}
.get-yzm {
padding-left: 0;
padding-right: 0;
margin-right: 30rpx;
margin-left: 20rpx;
margin-top: 10rpx;
}
#get-yzm {
background-color: #00cb7c !important;
}
#get-yzm.cur {
background-color: #b4b4b4 !important;
}
#get-yzm:hover {
background-color: #00cb7c !important;
}
.question .q {
color: #666;
font-size: 32rpx;
font-weight: bold;
margin: 20rpx 0;
}
.question .a {
color: #999;
font-size: 28rpx;
padding-left: 30rpx;
}
.weui-fixed::before {
border-top-width: 0;
}
.accept {
padding: 12rpx 30rpx;
font-size: 28rpx;
color: #666;
}
.submit-section::before {
border-top-width: 0;
}
#get-phone {
background-color: white;
display: block;
color: rgba(57, 66, 77, 0.40);
border-color: white;
font-size: 30rpx;
padding: 0;
text-align: right;
margin: 0;
}
#get-phone::after {
border-color: white;
}
.placeholder {
color: rgba(57, 66, 77, 0.40);
text-align: right;
}
.input-content {
color: #39424d;
text-align: right;
}
.mileage {
width: 120rpx;
color: #39424d;
}
.weui-input {
color: #39424d;
text-align: right;
}
.partner-wrap {
margin: 30rpx 0;
}
.partner {
display: flex;
height: 100rpx;
align-items: center;
padding-left: 40rpx;
padding-right: 30rpx;
}
.partner .left {
flex: 1;
text-align: center;
font-size: 28rpx;
color: #39424d;
}
.partner .left .tips {
font-size: 24rpx;
color: #999;
}
.partner .collapse-down {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAp0lEQVR4AWMY1GAUjIJRMApGwf8wvpr/EQIN/9OMWcnSn6vCDtTf/D+Mv4x0zQmiEv/C+P6D8P9wvg0gR5BqOVDfNrgZUfyCZIQA/zJ0R5BleTj/PPKioMGBBah5FbojSLNcYMn/hgYmkByNHUHYcho6grDlNHQEYctp64gkEV58ltPeEWF8b3BZThdH0NFyTEeALIXlc6jl9AfgEm4og1EwCkbBKAAATe/cFey0HGkAAAAASUVORK5CYII=) 72rpx no-repeat;
background-size: 32rpx 32rpx;
}
.partner .collapse-up {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAmElEQVR4AWOgFIyCUTAKRsEo+J8gKjEwFqcZs/4P51/zL4zv//8w/mX/GxxY6Gw53waQ5TAMdMwqkCPobjmQ/YJOjkBYjmJhmhQXQgzhCBpbjrAInxwdLCeshg6WE1ZLM8tp7ghQPkc3iDyHCywhq4RDt5yi0IviFyTdERH8JUDLK0CWkx2FYXw1wBDIx6VmFIyCUTAKRgEAOJzaNq0wMsIAAAAASUVORK5CYII=) 72rpx no-repeat;
background-size: 32rpx 32rpx;
}
.partner .collapse {
width: 56rpx;
padding: 6rpx 40rpx 6rpx 20rpx;
border: 1px solid rgba(254, 86, 14, 0.4);
border-radius: 6rpx;
font-size: 24rpx;
color: #fe560e;
cursor: pointer;
}
.collapse-content .collapse-item {
display: flex;
margin-bottom: 30rpx;
padding: 24rpx;
align-items: center;
border: 2rpx solid #f0f0f0;
border-radius: 12rpx;
background: #fcfcfc;
}
.collapse-item image {
width: 120rpx;
height: 120rpx;
}
.collapse-item .des {
flex: 1;
padding: 0 24rpx;
font-size: 24rpx;
color: rgba(57, 66, 77, 0.70);
}
.collapse-item .selected {
flex: 0 0 80rpx;
width: 80rpx;
height: 80rpx;
text-align: center;
background: url(data:image/png;base64,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) no-repeat center;
background-size: 56rpx 56rpx;
}
.collapse-item .unselected {
flex: 0 0 80rpx;
width: 80rpx;
height: 80rpx;
text-align: center;
background: url(data:image/png;base64,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) no-repeat center;
background-size: 56rpx 56rpx;
}
.progress {
margin-bottom: 40rpx;
padding: 40rpx 0 10rpx 0;
background-color: #fff;
text-align: center;
}
.progress .progress-title {
width: 202rpx;
height: 32rpx;
}
const app = getApp();
Page({
data: {
submitText: ''
},
onShow: function() {
wx.showLoading({
title: '提交中',
})
if (app.globalData.enter === 'index') {
this.setData({
submitText: '爱车估值'
}, () => {
wx.hideLoading()
wx.showToast({
icon: 'none',
title: '提交成功!',
})
})
} else {
this.setData({
submitText: '高价卖车'
}, () => {
wx.hideLoading()
wx.showToast({
icon: 'none',
title: '提交成功!',
})
})
}
},
confirm: function() {
let phone = wx.getStorageSync('phone')
wx.clearStorageSync();
wx.setStorageSync('phone', phone)
if (app.globalData.enter === 'index') {
wx.switchTab({
url: '/pages/index/index',
})
} else {
wx.switchTab({
url: '/pages/sellcar/sellcar',
})
}
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarBackgroundColor": "#fe9527",
"navigationBarTextStyle": "white",
"navigationBarTitleText": "提交成功",
"backgroundColor": "#fff",
"backgroundTextStyle": "light"
}
\ No newline at end of file
<view class='container'>
<view class='submit-success-content'>
<image class='success-img' src='../../images/successful.png' mode='widthFix'></image>
<view class='success-text'>提交成功</view>
<view class='success-tips'>请保持手机通畅,稍后将会有工作人员联系您</view>
<view class='resell' bindtap='confirm'>
<text class='resell-text'>{{submitText}}</text>
<image class='resell-img' src='../../images/right_arrow.png' mode='widthFix'></image>
</view>
</view>
<view class="submit-section">
<button bindtap='confirm' type="primary" hover-class="none">确认</button>
</view>
</view>
\ No newline at end of file
.container {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.submit-success-content {
margin-top: 160rpx;
text-align: center;
}
.success-img {
width: 200rpx;
}
.success-text {
margin-top: 24rpx;
line-height: 50rpx;
font-size: 36rpx;
color: #39424d;
font-weight: bold;
}
.success-tips {
margin-top: 24rpx;
line-height: 36rpx;
font-size: 26rpx;
color: rgba(57, 66, 77, 0.70);
}
.resell {
margin-top: 24rpx;
line-height: 36rpx;
font-size: 26rpx;
color: #fe560e;
}
.resell-img {
width: 32rpx;
vertical-align: -6rpx;
}
.submit-section {
width: 100%;
padding-bottom: 80rpx;
text-align: center;
}
.submit-section button {
width: 70%;
background-color: #fe560e;
}
.submit-section button:hover {
background-color: #fe560e;
}
{
"description": "项目配置文件",
"packOptions": {
"ignore": []
},
"setting": {
"urlCheck": true,
"es6": true,
"postcss": true,
"minified": true,
"newFeature": true,
"autoAudits": false
},
"compileType": "miniprogram",
"libVersion": "2.7.2",
"appid": "wx3722cae0d0b62fff",
"projectname": "mp-car-evaluate-old",
"debugOptions": {
"hidedInDevtools": []
},
"isGameTourist": false,
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"game": {
"currentL": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": []
}
}
}
\ No newline at end of file
{
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
"rules": [{
"action": "allow",
"page": "*"
}]
}
\ No newline at end of file
const formatDate = date => {
const year = date.getFullYear()
const month = (date.getMonth() + 1) >= 10 ? (date.getMonth() + 1) : ('0' + (date.getMonth() + 1))
const day = date.getDate()
return year + '-' + month + '-' + day
}
const formatTime = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()
return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}
const formatNumber = n => {
n = n.toString()
return n[1] ? n : '0' + n
}
module.exports = {
formatDate,
formatTime
}
\ 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