From 69aacb02c96be5cff99d1ef4a1e08ce1bf73ab63 Mon Sep 17 00:00:00 2001 From: meo <18801474720@163.com> Date: Mon, 16 Sep 2019 11:11:27 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E8=90=A5=E9=94=80=E7=89=A9=E6=96=99?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9F=90=E4=BA=9B=E9=A1=B5=E9=9D=A2=E7=9A=84?= =?UTF-8?q?=E7=89=A9=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project.config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.config.json b/project.config.json index cb99eff..b6bb9ba 100644 --- a/project.config.json +++ b/project.config.json @@ -14,7 +14,7 @@ }, "compileType": "miniprogram", "libVersion": "2.5.0", - "appid": "wxb11603577a84a86d", + "appid": "wxfa336cad86ed598d", "projectname": "C%E7%AB%AF%E5%B0%8F%E7%A8%8B%E5%BA%8F", "isGameTourist": false, "simulatorType": "wechat", From 83698d89212d797433ac1e8f20cf29a2367c779b Mon Sep 17 00:00:00 2001 From: meo <18801474720@163.com> Date: Tue, 17 Sep 2019 11:14:04 +0800 Subject: [PATCH 2/5] =?UTF-8?q?[=E9=97=A8=E5=BA=97=E5=88=97=E8=A1=A8][?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0]:[=E5=A2=9E=E5=8A=A0=E9=97=A8=E5=BA=97?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9A=84=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD?= =?UTF-8?q?]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 1 + index/searchbar.js | 7 +- index/searchbar.wxml | 5 +- pages/searchbar/searchbar.js | 211 +++++++++++++++++++++++++++++++++ pages/searchbar/searchbar.json | 8 ++ pages/searchbar/searchbar.wxml | 22 ++++ pages/searchbar/searchbar.wxss | 2 + project.config.json | 2 +- 8 files changed, 254 insertions(+), 4 deletions(-) create mode 100644 pages/searchbar/searchbar.js create mode 100644 pages/searchbar/searchbar.json create mode 100644 pages/searchbar/searchbar.wxml create mode 100644 pages/searchbar/searchbar.wxss diff --git a/app.json b/app.json index 8faae3a..1f53ff1 100644 --- a/app.json +++ b/app.json @@ -5,6 +5,7 @@ "index/searchbar", "index/passCar", "index/user", + "pages/searchbar/searchbar", "pages/integralmall/integraHistory/index", "pages/integralmall/payIntegcouponStatus/index", "pages/integralmall/payIntegcoupondetail/index", diff --git a/index/searchbar.js b/index/searchbar.js index 34a8720..a0fb6f9 100644 --- a/index/searchbar.js +++ b/index/searchbar.js @@ -1,4 +1,4 @@ -const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px' +const navigationBarHeight = (getApp().statusBarHeight + 44) const Http = require("../utils/HttpBasics"); const imgurl = require("../utils/imgurl"); const config = require("../config/config"); @@ -33,6 +33,11 @@ Page({ }) that.getList(1, that.data.businessId); }, + goSearchBar(){ + wx.navigateTo({ + url: '/pages/searchbar/searchbar', + }) + }, /** * 跳转到门店列表的详情页面 */ diff --git a/index/searchbar.wxml b/index/searchbar.wxml index b7956c2..3304717 100644 --- a/index/searchbar.wxml +++ b/index/searchbar.wxml @@ -1,9 +1,10 @@ - + + - + diff --git a/pages/searchbar/searchbar.js b/pages/searchbar/searchbar.js new file mode 100644 index 0000000..4d6ec3b --- /dev/null +++ b/pages/searchbar/searchbar.js @@ -0,0 +1,211 @@ +const navigationBarHeight = (getApp().statusBarHeight + 44)*2; +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 19); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 19: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Component({ + options: { + addGlobalClass: true + }, + properties: { + extClass: { + type: String, + value: '' + }, + focus: { + type: Boolean, + value: false + }, + placeholder: { + type: String, + value: '搜索' + }, + value: { + type: String, + value: '' + }, + search: { + type: Function, + value: null + }, + throttle: { + type: Number, + value: 500 + }, + cancelText: { + type: String, + value: '取消' + }, + cancel: { + type: Boolean, + value: true + } + }, + data: { + result: [], + navigationBarHeight + }, + lastSearch: Date.now(), + lifetimes: { + attached: function attached() { + if (this.data.focus) { + this.setData({ + searchState: true + }); + } + } + }, + methods: { + clearInput: function clearInput() { + this.setData({ + value: '' + }); + this.triggerEvent('clear'); + }, + inputFocus: function inputFocus(e) { + this.triggerEvent('focus', e.detail); + }, + inputBlur: function inputBlur(e) { + this.setData({ + focus: false + }); + this.triggerEvent('blur', e.detail); + }, + showInput: function showInput() { + this.setData({ + focus: true, + searchState: true + }); + }, + hideInput: function hideInput() { + this.setData({ + searchState: false + }); + }, + inputChange: function inputChange(e) { + var _this = this; + + this.setData({ + value: e.detail.value + }); + this.triggerEvent('input', e.detail); + if (Date.now() - this.lastSearch < this.data.throttle) { + return; + } + if (typeof this.data.search !== 'function') { + return; + } + this.lastSearch = Date.now(); + this.timerId = setTimeout(function () { + _this.data.search(e.detail.value).then(function (json) { + _this.setData({ + result: json + }); + }).catch(function (err) { + console.log('search error', err); + }); + }, this.data.throttle); + }, + selectResult: function selectResult(e) { + var index = e.currentTarget.dataset.index; + + var item = this.data.result[index]; + this.triggerEvent('selectresult', { index: index, item: item }); + } + } +}); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/pages/searchbar/searchbar.json b/pages/searchbar/searchbar.json new file mode 100644 index 0000000..35fae4e --- /dev/null +++ b/pages/searchbar/searchbar.json @@ -0,0 +1,8 @@ +{ + "navigationBarTitleText": "门店搜索", + "navigationBarBackgroundColor": "#F4F5F9", + "navigationBarTextStyle": "black", + "usingComponents": { + "navbar": "../../../components/navbar/navbar" + } +} \ No newline at end of file diff --git a/pages/searchbar/searchbar.wxml b/pages/searchbar/searchbar.wxml new file mode 100644 index 0000000..918e095 --- /dev/null +++ b/pages/searchbar/searchbar.wxml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + {{cancelText}} + + + + {{item.text}} + + \ No newline at end of file diff --git a/pages/searchbar/searchbar.wxss b/pages/searchbar/searchbar.wxss new file mode 100644 index 0000000..944f17e --- /dev/null +++ b/pages/searchbar/searchbar.wxss @@ -0,0 +1,2 @@ +@import "../../weui.wxss"; +.weui-search-bar{position:relative;padding:8px;display:flex;box-sizing:border-box;background-color:#EDEDED;-webkit-text-size-adjust:100%;align-items:center}.weui-icon-search{margin-right:8px;font-size:14px;vertical-align:top;margin-top:.64em;height:1em;line-height:1em}.weui-icon-search_in-box{position:absolute;left:12px;top:50%;margin-top:-8px}.weui-search-bar__text{display:inline-block;font-size:14px;vertical-align:top}.weui-search-bar__form{position:relative;flex:auto;border-radius:4px;background:#FFFFFF}.weui-search-bar__box{position:relative;padding-left:32px;padding-right:32px;width:100%;box-sizing:border-box;z-index:1}.weui-search-bar__input{height:32px;line-height:32px;font-size:14px;caret-color:#07C160}.weui-icon-clear{position:absolute;top:0;right:0;bottom:0;padding:0 12px;font-size:0}.weui-icon-clear:after{content:"";height:100%;vertical-align:middle;display:inline-block;width:0;overflow:hidden}.weui-search-bar__label{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;border-radius:4px;text-align:center;color:rgba(0,0,0,0.5);background:#FFFFFF;line-height:32px}.weui-search-bar__cancel-btn{margin-left:8px;line-height:32px;color:#576B95;white-space:nowrap} \ No newline at end of file diff --git a/project.config.json b/project.config.json index b6bb9ba..cb99eff 100644 --- a/project.config.json +++ b/project.config.json @@ -14,7 +14,7 @@ }, "compileType": "miniprogram", "libVersion": "2.5.0", - "appid": "wxfa336cad86ed598d", + "appid": "wxb11603577a84a86d", "projectname": "C%E7%AB%AF%E5%B0%8F%E7%A8%8B%E5%BA%8F", "isGameTourist": false, "simulatorType": "wechat", From 3519bbe66b8b96f6535cabae908e9d38d60d6a4d Mon Sep 17 00:00:00 2001 From: meo <18801474720@163.com> Date: Tue, 17 Sep 2019 14:25:23 +0800 Subject: [PATCH 3/5] =?UTF-8?q?[=E9=97=A8=E5=BA=97=E5=88=97=E8=A1=A8][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9]:[=E4=BF=AE=E6=94=B9=E9=97=A8=E5=BA=97?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9A=84=E6=90=9C=E7=B4=A2]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/config.js | 4 ---- index/searchbar.wxml | 6 +++--- index/searchbar.wxss | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/config/config.js b/config/config.js index 480214f..18be5cc 100755 --- a/config/config.js +++ b/config/config.js @@ -276,10 +276,6 @@ var config = { * 专题详情 */ topicFindById:"/topic/findById", - /** - * 积分兑换 - */ - addIntegral: "/credit/add", /** * 积分券详情 */ diff --git a/index/searchbar.wxml b/index/searchbar.wxml index 3304717..09ca56f 100644 --- a/index/searchbar.wxml +++ b/index/searchbar.wxml @@ -1,10 +1,10 @@ - - +搜索门店 + - + diff --git a/index/searchbar.wxss b/index/searchbar.wxss index eb3ec13..b30234e 100644 --- a/index/searchbar.wxss +++ b/index/searchbar.wxss @@ -1,3 +1,18 @@ +.search{ + z-index:5000; + left:0; + right: 0; + margin: auto; + width: 700rpx; + height: 68rpx; + line-height: 68rpx; + border:1px solid #ccc; + background: #fff; + border-radius:10rpx; + text-align: center; + color: #999; + font-size:30rpx; +} .under_line{ width: 100%; } From 7d40de52d8c9be0fe2b523907a577b6b86e5e0dc Mon Sep 17 00:00:00 2001 From: meo <18801474720@163.com> Date: Tue, 17 Sep 2019 16:32:34 +0800 Subject: [PATCH 4/5] =?UTF-8?q?[=E9=97=A8=E5=BA=97=E5=88=97=E8=A1=A8][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9]:[=E4=BF=AE=E6=94=B9=E9=97=A8=E5=BA=97?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9A=84=E6=90=9C=E7=B4=A2]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iconfont.wxss | 21 +++++++++++++++++++++ index/searchbar.js | 2 +- index/searchbar.wxml | 8 ++++---- index/searchbar.wxss | 6 +++++- pages/searchbar/searchbar.wxml | 2 +- 5 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 iconfont.wxss diff --git a/iconfont.wxss b/iconfont.wxss new file mode 100644 index 0000000..7c75e4e --- /dev/null +++ b/iconfont.wxss @@ -0,0 +1,21 @@ +@font-face {font-family: "iconfont"; + src: url('iconfont.eot?t=1568701793152'); /* IE9 */ + src: url('iconfont.eot?t=1568701793152#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAL4AAsAAAAABrwAAAKqAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCCcAqBSIFaATYCJAMICwYABCAFhG0HMBsABsgekkQC4ByegcrDAoAQCLRWZuAQ1ROBA7RA4BAKaNmybtVXtY7IAcnq3VqzIggboUqyiugVQ3aPc4szdQ+sCRogwMz8/1xO764CCmR+oFzmmnTUCzDeGuBe2CYrkAC8ZXjVpa2DPg8B2ImSQTRM1jYTBTQwTQBiyuVniULOi0bLCSsCc81ajbhIFqs8lC+BC+H3xR/ysoLEpICSto0vE703YYraMK4c+gi8+cyAvAkUkAE0iK7aaIs0QiYr7NEMcdhXoYDvTYbh6xF7/fMQZiDfCUAE5d4Tz+Xfao0EQHPv/VVgcNQDwORyOm3e9deXcM/79Y3jUPfb1cDbt9vv3u28ebP1+vUxF29G7Kzn7dvDo1b3tY2rXSInFmNx8vuXPoyor9T//xe4DlwNf38Nrm8r19Ln5+lryPJZnvWqepGyWMnrz758+lTuI4uyvZB88lTtMxaLVtXnD9y0otW6mLp5Uy7mMy1i+PFhWCaT6UkAxjd1S8X82t+wmf+so7de8d/q0AB8uP/fH04wvmlUDGC9AZuAH8nrWactAeikNni1SUkV0w2K7RgAA3D6fR2rDN11UmAldO92C5EpKKwkoJqUASYcFIAZK9VgJ13zZgcBC9IIbQPS7BIQeD0AiZvnoPB6hWrSFzAR9g/MeFNgp6fAng6SGi/VSzzTeAnnK3AvKGLcoEtR4TpyE5zJrCCkbKNUbgDaWTnFxBQjlHMsUJZ3tGbAJIUwIZdhEBDEkjy80A1H67jbzB6pe1PjgsJEiXoSOqOhS2DAChh3gUSY31wrlT6/DnFG4IxswTWZtyFJcQcHubLk9ECn0qgX7l6uWWRxHUs0BoyQSAg0ETMKMErAXP0oD7qgNYyNCMe6slmjkb7Sxvry8Ou2AHZAJQUOU5gXyShDiQQAAA==') format('woff2'), + url('iconfont.woff?t=1568701793152') format('woff'), + url('iconfont.ttf?t=1568701793152') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */ + url('iconfont.svg?t=1568701793152#iconfont') format('svg'); /* iOS 4.1- */ +} + +.iconfont { + font-family: "iconfont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-sousuo:before { + content: "\e646"; +} + diff --git a/index/searchbar.js b/index/searchbar.js index a0fb6f9..62534fd 100644 --- a/index/searchbar.js +++ b/index/searchbar.js @@ -68,7 +68,7 @@ Page({ wx.getSystemInfo({ success: function (res) { that.setData({ - windowHeight: res.windowHeight + parseInt(navigationBarHeight) + windowHeight: res.windowHeight + navigationBarHeight }) }, }) diff --git a/index/searchbar.wxml b/index/searchbar.wxml index 09ca56f..4f67ed6 100644 --- a/index/searchbar.wxml +++ b/index/searchbar.wxml @@ -1,10 +1,10 @@ -搜索门店 - +搜索门店 + - + @@ -19,7 +19,7 @@ - +