From 68c7d5d698dc92e29ceefee0107e7e730951335d Mon Sep 17 00:00:00 2001 From: maclien <421129572@qq.com> Date: Wed, 17 Jul 2024 23:39:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=80=89=E6=8B=A9=E5=93=81?= =?UTF-8?q?=E7=89=8C=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/brandSelect/index.js | 129 ++++++++++++++++++++++++++++++ components/brandSelect/index.json | 6 ++ components/brandSelect/index.wxml | 32 ++++++++ components/brandSelect/index.wxss | 14 ++++ pages/login/index.js | 7 ++ pages/login/index.json | 1 + pages/login/index.wxml | 4 + project.config.json | 2 +- 8 files changed, 194 insertions(+), 1 deletion(-) create mode 100644 components/brandSelect/index.js create mode 100644 components/brandSelect/index.json create mode 100644 components/brandSelect/index.wxml create mode 100644 components/brandSelect/index.wxss diff --git a/components/brandSelect/index.js b/components/brandSelect/index.js new file mode 100644 index 0000000..dceb484 --- /dev/null +++ b/components/brandSelect/index.js @@ -0,0 +1,129 @@ +// components/brandSelect/index.js +Component({ + + /** + * 组件的属性列表 + */ + properties: { + show: { + type: Boolean, + value: false + }, + duration: { + type: Number, + value: 500 + }, + position: { + type: String, + value: 'right' + }, + round: { + type: Boolean, + value: false + }, + overlay: { + type: Boolean, + value: true + }, + customStyle: { + type: String, + value: '' + }, + overlayStyle: { + type: String, + value: 'background-color: rgba(0, 0, 0, 0.7)' + }, + }, + observers: { + 'show': function (value) { + // 在 numberA 或者 numberB 被设置时,执行这个函数 + this.setData({ + show_page: value, + cur: -1 + }) + } + }, + + /** + * 组件的初始数据 + */ + data: { + show_page: false, + // list: [], + list: [{ + name: '宝马' + },{ + name: '宝马' + },{ + name: '宝马' + },{ + name: '宝马' + },{ + name: '宝马' + },{ + name: '宝马' + },{ + name: '宝马' + },{ + name: '宝马' + },{ + name: '宝马' + },{ + name: '宝马' + },{ + name: '宝马' + },{ + name: '宝马' + },{ + name: '宝马' + },{ + name: '宝马' + },{ + name: '宝马' + },{ + name: '宝马' + },{ + name: '宝马' + }], + cur: -1 + }, + + /** + * 组件的方法列表 + */ + methods: { + onBeforeEnter(res) { + // console.log(res) + }, + onEnter(res) { + // console.log(res) + this.triggerEvent('enter') + }, + onAfterEnter(res) { + // console.log(res) + }, + onBeforeLeave(res) { + // console.log(res) + }, + onLeave(res) { + // console.log(res) + this.triggerEvent('leave', {index: this.data.cur}) + }, + onAfterLeave(res) { + // console.log(res) + }, + + onClickOverlay(res) { + // console.log(res) + }, + exit() { + this.setData({ show_page: false }) + }, + bindSelectIndex(e){ + console.log(e) + this.setData({ + cur: e.currentTarget.dataset.index + }) + } + } +}) \ No newline at end of file diff --git a/components/brandSelect/index.json b/components/brandSelect/index.json new file mode 100644 index 0000000..7867d18 --- /dev/null +++ b/components/brandSelect/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "listmore": "/components/listMore/index" + } +} \ No newline at end of file diff --git a/components/brandSelect/index.wxml b/components/brandSelect/index.wxml new file mode 100644 index 0000000..48a5369 --- /dev/null +++ b/components/brandSelect/index.wxml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + {{item.name}} + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/components/brandSelect/index.wxss b/components/brandSelect/index.wxss new file mode 100644 index 0000000..5fc54ed --- /dev/null +++ b/components/brandSelect/index.wxss @@ -0,0 +1,14 @@ +/* components/brandSelect/index.wxss */ +@import "../../commons/css/common.wxss"; +.detail-page { + width: 100%; + height: 100%; + min-height: 300rpx; + /* display: flex; + align-items: center; + justify-content: center; */ + /* position:fixed; + z-index: 1; + left: 0; + top: 0; */ +} \ No newline at end of file diff --git a/pages/login/index.js b/pages/login/index.js index aa9a5b9..60c610e 100644 --- a/pages/login/index.js +++ b/pages/login/index.js @@ -11,6 +11,7 @@ Page({ text: '验证码', pageshow: false, imgUrl: _.config.imgUrl, + brand_page_show: false }, onLoad: function (options) { @@ -157,4 +158,10 @@ Page({ } }, + bindShowBrand(){ + this.setData({ + brand_page_show: true + }) + } + }) \ No newline at end of file diff --git a/pages/login/index.json b/pages/login/index.json index 5ea3084..c49f3f4 100644 --- a/pages/login/index.json +++ b/pages/login/index.json @@ -5,5 +5,6 @@ "backgroundColor": "#ffffff", "backgroundColorTop": "#1a1c26", "usingComponents": { + "brandSelect": "/components/brandSelect/index" } } \ No newline at end of file diff --git a/pages/login/index.wxml b/pages/login/index.wxml index 25605e8..7d55880 100644 --- a/pages/login/index.wxml +++ b/pages/login/index.wxml @@ -39,7 +39,11 @@ --> + + + + \ No newline at end of file diff --git a/project.config.json b/project.config.json index b25ee9a..ee0f2a4 100644 --- a/project.config.json +++ b/project.config.json @@ -1,7 +1,7 @@ { "appid": "wx4733380c110313ec", "compileType": "miniprogram", - "libVersion": "3.0.0", + "libVersion": "latest", "packOptions": { "ignore": [], "include": []