diff --git a/commons/css/base/button.wxss b/commons/css/base/button.wxss
index 930c46b..62e818e 100644
--- a/commons/css/base/button.wxss
+++ b/commons/css/base/button.wxss
@@ -5,7 +5,7 @@
.btn-36afa2{background: #36afa2;border:none;}
.btn-36afa2::after{border:none;}
.btn-36afa2-hover{background:#2fa195;}
-.btn-36afa2[disabled]{background:#ddd !important;border:none !important;color:#bbb !important;}
+.btn-36afa2[disabled]{background:#f0f0f0 !important;border:none !important;color:#ccc !important;}
.btn-f9394d{background: #f9394d;border:none;}
.btn-f9394d::after{border:none;}
.btn-f9394d-hover{background:#f0293e;}
@@ -18,4 +18,10 @@
.btn-no-border::after{border:none;}
.btn-no-border[disabled]{background:#ddd !important;border:none;color:#bbb;}
.btn-no-bg{background:none;}
-.btn-inset-shadow{box-shadow:inset 0rpx 0rpx 10rpx 5rpx rgba(0, 0, 0, .2);}
\ No newline at end of file
+.btn-inset-shadow{box-shadow:inset 0rpx 0rpx 10rpx 5rpx rgba(0, 0, 0, .2);}
+
+
+.btn-f0{background:#f0f0f0;border:none;}
+.btn-f0::after{border:none;}
+.btn-f0-hover{background:#ededed;}
+.btn-f0[disabled]{background:#ccc !important;border:none !important;}
diff --git a/components/brandSelect/index.js b/components/brandSelect/index.js
index dceb484..79093e2 100644
--- a/components/brandSelect/index.js
+++ b/components/brandSelect/index.js
@@ -1,4 +1,7 @@
// components/brandSelect/index.js
+import _ from '../../commons/js/commons'
+const app = getApp()
+let debouncetimer = null; //函数防抖-间隔时间
Component({
/**
@@ -34,12 +37,16 @@ Component({
value: 'background-color: rgba(0, 0, 0, 0.7)'
},
},
+ attached(){
+ debouncetimer = null
+ },
observers: {
'show': function (value) {
// 在 numberA 或者 numberB 被设置时,执行这个函数
this.setData({
show_page: value,
- cur: -1
+ cur: -1,
+ item: {}
})
}
},
@@ -51,41 +58,27 @@ Component({
show_page: false,
// list: [],
list: [{
+ id: 1,
name: '宝马'
},{
+ id: 1,
name: '宝马'
},{
+ id: 1,
name: '宝马'
},{
+ id: 1,
name: '宝马'
},{
+ id: 1,
name: '宝马'
},{
- name: '宝马'
- },{
- name: '宝马'
- },{
- name: '宝马'
- },{
- name: '宝马'
- },{
- name: '宝马'
- },{
- name: '宝马'
- },{
- name: '宝马'
- },{
- name: '宝马'
- },{
- name: '宝马'
- },{
- name: '宝马'
- },{
- name: '宝马'
- },{
+ id: 1,
name: '宝马'
}],
- cur: -1
+ cur: -1,
+ keyword: '',
+ item: {}
},
/**
@@ -106,8 +99,8 @@ Component({
// console.log(res)
},
onLeave(res) {
- // console.log(res)
- this.triggerEvent('leave', {index: this.data.cur})
+ console.log(this.data.item)
+ this.triggerEvent('leave', {index: this.data.cur,item: this.data.list[this.data.cur]})
},
onAfterLeave(res) {
// console.log(res)
@@ -119,11 +112,43 @@ Component({
exit() {
this.setData({ show_page: false })
},
+ cancel() {
+ this.setData({ show_page: false, cur: -1,item: {} })
+ },
+ bindInputKeyword(e){
+ let that = this
+ that.debounce(function(){
+ that.setData({
+ keyword: e.detail.value
+ })
+ console.log(1)
+ },200)
+ },
bindSelectIndex(e){
console.log(e)
this.setData({
cur: e.currentTarget.dataset.index
})
- }
+ },
+ /**
+ * 函数防抖
+ * @param {*} fn
+ * @param {*} wait
+ * @returns
+ */
+ debounce(fn, wait) {
+ var gapTime = wait || 200; //间隔时间,如果interval不传,则默认200ms
+ return (function () {
+ var context = this
+ var args = arguments
+ if (debouncetimer) {
+ clearTimeout(debouncetimer);
+ debouncetimer = null;
+ }
+ debouncetimer = setTimeout(function () {
+ fn.apply(context, args) //保持this和参数
+ }, gapTime)
+ })()
+ },
}
})
\ No newline at end of file
diff --git a/components/brandSelect/index.wxml b/components/brandSelect/index.wxml
index 48a5369..f1fd063 100644
--- a/components/brandSelect/index.wxml
+++ b/components/brandSelect/index.wxml
@@ -4,7 +4,7 @@
-
+
@@ -19,12 +19,13 @@
-
+
-
-
+
+
+
diff --git a/pages/login/index.wxml b/pages/login/index.wxml
index 7d55880..499648f 100644
--- a/pages/login/index.wxml
+++ b/pages/login/index.wxml
@@ -39,8 +39,8 @@
-->
-
-
+
+
diff --git a/pages/order/edit/index2.js b/pages/order/edit/index2.js
index 6dd49d2..031f989 100644
--- a/pages/order/edit/index2.js
+++ b/pages/order/edit/index2.js
@@ -59,6 +59,7 @@ Page({
confirm_amount: '', //定⾦
discount_amount: '', //⻋身优惠
business_type: 0,
+ brand_page_show: false
},
//生命周期函数--监听页面加载
onLoad: function (options) {
@@ -579,4 +580,11 @@ Page({
}
},
+ //显示选择品牌
+ bindShowBrand(){
+ this.setData({
+ brand_page_show: true
+ })
+ }
+
})
\ No newline at end of file
diff --git a/pages/order/edit/index2.json b/pages/order/edit/index2.json
index affeadb..a88fc6a 100644
--- a/pages/order/edit/index2.json
+++ b/pages/order/edit/index2.json
@@ -1,4 +1,6 @@
{
"navigationBarTitleText": "编辑订单",
- "usingComponents": {}
+ "usingComponents": {
+ "brandSelect": "/components/brandSelect/index"
+ }
}
\ No newline at end of file
diff --git a/pages/order/edit/index2.wxml b/pages/order/edit/index2.wxml
index 831ad01..abd15df 100644
--- a/pages/order/edit/index2.wxml
+++ b/pages/order/edit/index2.wxml
@@ -14,12 +14,15 @@
车辆品牌*
-
-
+
+
+ 请选择
+
+
@@ -235,6 +238,7 @@
+
diff --git a/pages/order/register/index.js b/pages/order/register/index.js
index dfa0d35..621d623 100644
--- a/pages/order/register/index.js
+++ b/pages/order/register/index.js
@@ -65,6 +65,7 @@ Page({
register_amount: '', //上牌费
confirm_amount: '', //定⾦
discount_amount: '', //⻋身优惠
+ brand_page_show: false
},
//生命周期函数--监听页面加载
onLoad: function (options) {
@@ -512,5 +513,12 @@ Page({
this.setData({
is_get_insure: e.detail.value ? 1 : 0
})
+ },
+
+ //显示选择品牌
+ bindShowBrand(){
+ this.setData({
+ brand_page_show: true
+ })
}
})
\ No newline at end of file
diff --git a/pages/order/register/index.json b/pages/order/register/index.json
index e90ae0e..ad4e494 100644
--- a/pages/order/register/index.json
+++ b/pages/order/register/index.json
@@ -1,4 +1,6 @@
{
"navigationBarTitleText": "订单登记",
- "usingComponents": {}
+ "usingComponents": {
+ "brandSelect": "/components/brandSelect/index"
+ }
}
\ No newline at end of file
diff --git a/pages/order/register/index.wxml b/pages/order/register/index.wxml
index 1ab766b..8dbdd26 100644
--- a/pages/order/register/index.wxml
+++ b/pages/order/register/index.wxml
@@ -77,12 +77,15 @@
车辆品牌*
-
-
+
+
+ 请选择
+
+