Commit 19964db9 by null

init

parent 054c4381
......@@ -9,7 +9,7 @@ App({
enter: '',
result: '',
link: '2019062353971015',
link: '2019062610199102',
provinceList: [],
tiantianpaiche_cityList: ['南京', '无锡', '合肥', '南昌', '苏州', '绍兴',
......
......@@ -35,13 +35,17 @@ Page({
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)
if (_this.data.provinceList.length === 0) {
_this.getProvinceList()
} else {
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')
......@@ -77,6 +81,29 @@ Page({
this.data.terminal_names = []
},
// 获取省份
getProvinceList: function () {
let _this = this;
wx.request({
url: app.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.setData({
provinceList: arr
})
}
}
})
},
// 城市列表
getCityList: function(parent_id, _this) {
wx.request({
......@@ -373,7 +400,7 @@ Page({
let _this = this;
if (this.checkValue()) {
wx.showLoading({
title: '请求加载中',
title: '估价中',
mask: true
})
_this.data.terminal_names.push('瓜子二手车', '精真估')
......
......@@ -25,11 +25,6 @@ Page({
},
onShow: function() {
if (app.globalData.result) {
wx.showLoading({
title: '查询中',
})
}
this.getItem('specification_name')
this.getItem('buy_time')
this.getItem('mileage')
......@@ -44,7 +39,6 @@ Page({
time: carInfo.created_at.substr(0, 10)
}, () => {
if (app.globalData.result) {
wx.hideLoading()
wx.showToast({
icon: 'none',
title: '查询成功!',
......@@ -90,7 +84,7 @@ Page({
// 更新卖车状态
updateStatus: function() {
wx.showLoading({
title: '请求加载中',
title: '卖车中',
mask: true
})
let _this = this;
......
......@@ -66,13 +66,17 @@ Page({
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)
if (_this.data.provinceList.length === 0) {
_this.getProvinceList()
} else {
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')
......@@ -108,6 +112,29 @@ Page({
},
// 获取省份
getProvinceList: function() {
let _this = this;
wx.request({
url: app.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.setData({
provinceList: arr
})
}
}
})
},
// 城市列表
getCityList: function(parent_id, _this) {
wx.request({
......@@ -187,7 +214,7 @@ Page({
this.setData({
['userForms.' + item]: data ? data : ''
}, () => {
if(item === 'phone' && data) {
if (item === 'phone' && data) {
_this.setData({
showPhoneInput: true
})
......@@ -214,7 +241,7 @@ Page({
},
// 输入手机号 
phoneInput: function (e) {
phoneInput: function(e) {
let phone = e.detail.value
this.setData({
['userForms.phone']: phone
......@@ -226,7 +253,7 @@ Page({
},
// 获取手机号
getPhone: function (e) {
getPhone: function(e) {
let _this = this
let errMsg = e.detail.errMsg
if (errMsg === 'getPhoneNumber:ok') {
......@@ -241,7 +268,7 @@ Page({
url: app.globalData.url + 'decode-phone',
data: data,
method: 'POST',
success: function (res) {
success: function(res) {
if (res.data.message !== '解密失败') {
let phone = res.data.purePhoneNumber
_this.setData({
......@@ -268,10 +295,10 @@ Page({
},
// 重新获取code
login: function (e) {
login: function(e) {
let _this = this
wx.login({
success: function (res) {
success: function(res) {
if (res.errMsg === 'login:ok') {
let data = {
code: res.code,
......@@ -280,7 +307,7 @@ Page({
wx.request({
url: app.globalData.url + 'user-code',
data: data,
success: function (res) {
success: function(res) {
let data = {
session_key: res.data.session_key,
encrypted_data: e.detail.encryptedData,
......@@ -291,7 +318,7 @@ Page({
url: app.globalData.url + 'decode-phone',
data: data,
method: 'POST',
success: function (res) {
success: function(res) {
if (res.data.message !== '解密失败') {
let phone = res.data.purePhoneNumber
_this.setData({
......@@ -448,7 +475,7 @@ Page({
let _this = this;
if (this.checkValue()) {
wx.showLoading({
title: '请求加载中',
title: '卖车中',
mask: true
})
_this.data.terminal_names.push('精真估')
......
......@@ -62,7 +62,7 @@
<view class="weui-cell__hd">
<view class="weui-label">手机号码</view>
</view>
<view class="weui-cell__bd">
<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> -->
......
......@@ -6,14 +6,10 @@ Page({
},
onShow: function() {
wx.showLoading({
title: '提交中',
})
if (app.globalData.enter === 'index') {
this.setData({
submitText: '爱车估值'
}, () => {
wx.hideLoading()
wx.showToast({
icon: 'none',
title: '提交成功!',
......@@ -23,7 +19,6 @@ Page({
this.setData({
submitText: '高价卖车'
}, () => {
wx.hideLoading()
wx.showToast({
icon: 'none',
title: '提交成功!',
......
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