新增首页园区和商户的交互
This commit is contained in:
38
components/picker/index.js
Normal file
38
components/picker/index.js
Normal file
@@ -0,0 +1,38 @@
|
||||
// components/picker/index.js
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
valueKey: {
|
||||
type: String,
|
||||
default: "name"
|
||||
},
|
||||
show: Boolean,
|
||||
columns: Array,
|
||||
type: String
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
// columns:['杭州', '宁波', '温州', '嘉兴', '湖州']
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
onClose() {
|
||||
this.triggerEvent("close");
|
||||
},
|
||||
confirm(e) {
|
||||
this.triggerEvent("ok", {...e.detail, type: this.data.type})
|
||||
},
|
||||
cancel() {
|
||||
this.triggerEvent("cancel")
|
||||
}
|
||||
}
|
||||
})
|
7
components/picker/index.json
Normal file
7
components/picker/index.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-popup": "@vant/weapp/popup/index",
|
||||
"van-picker": "@vant/weapp/picker/index"
|
||||
}
|
||||
}
|
11
components/picker/index.wxml
Normal file
11
components/picker/index.wxml
Normal file
@@ -0,0 +1,11 @@
|
||||
<!--components/picker/index.wxml-->
|
||||
<van-popup
|
||||
show="{{ show }}"
|
||||
position="bottom"
|
||||
bind:close="onClose"
|
||||
>
|
||||
<view style="width: 100vw;">
|
||||
<van-picker show-toolbar
|
||||
title="标题" columns="{{ columns }}" bind:change="onChange" value-key="name" bind:confirm="confirm" bind:cancel="cancel" />
|
||||
</view>
|
||||
</van-popup>
|
1
components/picker/index.wxss
Normal file
1
components/picker/index.wxss
Normal file
@@ -0,0 +1 @@
|
||||
/* components/picker/index.wxss */
|
Reference in New Issue
Block a user