Commit 19964db9 by null

init

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