C端小程序
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

249 linhas
7.6 KiB

  1. const navigationBarHeight = (getApp().statusBarHeight + 44)*2;
  2. module.exports =
  3. /******/ (function(modules) { // webpackBootstrap
  4. /******/ // The module cache
  5. /******/ var installedModules = {};
  6. /******/
  7. /******/ // The require function
  8. /******/ function __webpack_require__(moduleId) {
  9. /******/
  10. /******/ // Check if module is in cache
  11. /******/ if(installedModules[moduleId]) {
  12. /******/ return installedModules[moduleId].exports;
  13. /******/ }
  14. /******/ // Create a new module (and put it into the cache)
  15. /******/ var module = installedModules[moduleId] = {
  16. /******/ i: moduleId,
  17. /******/ l: false,
  18. /******/ exports: {}
  19. /******/ };
  20. /******/
  21. /******/ // Execute the module function
  22. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  23. /******/
  24. /******/ // Flag the module as loaded
  25. /******/ module.l = true;
  26. /******/
  27. /******/ // Return the exports of the module
  28. /******/ return module.exports;
  29. /******/ }
  30. /******/
  31. /******/
  32. /******/ // expose the modules object (__webpack_modules__)
  33. /******/ __webpack_require__.m = modules;
  34. /******/
  35. /******/ // expose the module cache
  36. /******/ __webpack_require__.c = installedModules;
  37. /******/
  38. /******/ // define getter function for harmony exports
  39. /******/ __webpack_require__.d = function(exports, name, getter) {
  40. /******/ if(!__webpack_require__.o(exports, name)) {
  41. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  42. /******/ }
  43. /******/ };
  44. /******/
  45. /******/ // define __esModule on exports
  46. /******/ __webpack_require__.r = function(exports) {
  47. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  48. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  49. /******/ }
  50. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  51. /******/ };
  52. /******/
  53. /******/ // create a fake namespace object
  54. /******/ // mode & 1: value is a module id, require it
  55. /******/ // mode & 2: merge all properties of value into the ns
  56. /******/ // mode & 4: return value when already ns object
  57. /******/ // mode & 8|1: behave like require
  58. /******/ __webpack_require__.t = function(value, mode) {
  59. /******/ if(mode & 1) value = __webpack_require__(value);
  60. /******/ if(mode & 8) return value;
  61. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  62. /******/ var ns = Object.create(null);
  63. /******/ __webpack_require__.r(ns);
  64. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  65. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  66. /******/ return ns;
  67. /******/ };
  68. /******/
  69. /******/ // getDefaultExport function for compatibility with non-harmony modules
  70. /******/ __webpack_require__.n = function(module) {
  71. /******/ var getter = module && module.__esModule ?
  72. /******/ function getDefault() { return module['default']; } :
  73. /******/ function getModuleExports() { return module; };
  74. /******/ __webpack_require__.d(getter, 'a', getter);
  75. /******/ return getter;
  76. /******/ };
  77. /******/
  78. /******/ // Object.prototype.hasOwnProperty.call
  79. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  80. /******/
  81. /******/ // __webpack_public_path__
  82. /******/ __webpack_require__.p = "";
  83. /******/
  84. /******/
  85. /******/ // Load entry module and return exports
  86. /******/ return __webpack_require__(__webpack_require__.s = 19);
  87. /******/ })
  88. /************************************************************************/
  89. /******/ ({
  90. /***/ 19:
  91. /***/ (function(module, exports, __webpack_require__) {
  92. "use strict";
  93. Component({
  94. options: {
  95. addGlobalClass: true
  96. },
  97. properties: {
  98. extClass: {
  99. type: String,
  100. value: ''
  101. },
  102. focus: {
  103. type: Boolean,
  104. value: false
  105. },
  106. placeholder: {
  107. type: String,
  108. value: '请输入'
  109. },
  110. value: {
  111. type: String,
  112. value: ''
  113. },
  114. search: {
  115. type: Function,
  116. value: null
  117. },
  118. throttle: {
  119. type: Number,
  120. value: 500
  121. },
  122. cancelText: {
  123. type: String,
  124. value: '取消'
  125. },
  126. cancel: {
  127. type: Boolean,
  128. value: true
  129. }
  130. },
  131. data: {
  132. result: [],
  133. navigationBarHeight,
  134. multiArray: [['无脊柱动物', '脊柱动物'], ['扁性动物', '线形动物', '环节动物', '软体动物', '节肢动物']]
  135. },
  136. lastSearch: Date.now(),
  137. lifetimes: {
  138. attached: function attached() {
  139. if (this.data.focus) {
  140. this.setData({
  141. searchState: true
  142. });
  143. }
  144. }
  145. },
  146. methods: {
  147. getList: function () {
  148. let that = this;
  149. let data = {
  150. pageNum: page,
  151. pageSize: 8
  152. };
  153. Http.get({
  154. url: config.api.merchantList,
  155. data: data
  156. }).then(res => {
  157. wx.hideLoading();
  158. if (page == 1) {
  159. that.setData({
  160. merchantVoList: [],
  161. })
  162. }
  163. var tmpArr = that.data.merchantVoList;
  164. tmpArr.push.apply(tmpArr, res.data.list);
  165. that.setData({
  166. merchantVoList: tmpArr
  167. })
  168. })
  169. .catch(err => {
  170. wx.hideLoading();
  171. wx.showToast({
  172. title: err.errMsg,
  173. icon: 'none',
  174. duration: 2000,
  175. mask: false
  176. });
  177. })
  178. },
  179. bindMultiPickerChange(e){
  180. this.setData({
  181. value: this.data.multiArray[0][e.detail.value[0]] + this.data.multiArray[1][e.detail.value[1]]
  182. })
  183. },
  184. clearInput: function clearInput() {
  185. this.setData({
  186. value: ''
  187. });
  188. this.triggerEvent('clear');
  189. },
  190. inputFocus: function inputFocus(e) {
  191. this.triggerEvent('focus', e.detail);
  192. },
  193. inputBlur: function inputBlur(e) {
  194. this.setData({
  195. focus: false
  196. });
  197. this.triggerEvent('blur', e.detail);
  198. },
  199. showInput: function showInput() {
  200. this.setData({
  201. focus: true,
  202. searchState: true
  203. });
  204. },
  205. hideInput: function hideInput() {
  206. this.setData({
  207. searchState: false
  208. });
  209. },
  210. inputChange: function inputChange(e) {
  211. var _this = this;
  212. this.setData({
  213. value: e.detail.value
  214. });
  215. this.triggerEvent('input', e.detail);
  216. if (Date.now() - this.lastSearch < this.data.throttle) {
  217. return;
  218. }
  219. if (typeof this.data.search !== 'function') {
  220. return;
  221. }
  222. this.lastSearch = Date.now();
  223. this.timerId = setTimeout(function () {
  224. _this.data.search(e.detail.value).then(function (json) {
  225. _this.setData({
  226. result: json
  227. });
  228. }).catch(function (err) {
  229. console.log('search error', err);
  230. });
  231. }, this.data.throttle);
  232. },
  233. selectResult: function selectResult(e) {
  234. var index = e.currentTarget.dataset.index;
  235. var item = this.data.result[index];
  236. this.triggerEvent('selectresult', { index: index, item: item });
  237. }
  238. }
  239. });
  240. /***/ })
  241. /******/ });