index_screen.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897
  1. const app = getApp();
  2. Page({
  3. data: {
  4. Ageid: 0,
  5. AgeArray: [], // 年龄-数据
  6. AgeIndex: [0, 0], // 年龄-下标
  7. heightid: 0,
  8. heightArray: [], // 身高-数据
  9. heightindex: [0, 0], // 身高-下标
  10. EducationArray: [], // 学历-数据
  11. Educationindex: '', // 学历-下标
  12. MarriageArray: [], // 婚史-数据
  13. Marriageindex: '', // 婚史-下标
  14. incomeid: 0,
  15. incomeArray: [], // 收入-数据
  16. incomeindex: [0, 0], // 收入-下标
  17. inputValue: '', // id
  18. age: '', // 年龄
  19. height: '', // 身高
  20. marry: '', // 婚史
  21. idmarry: 0,
  22. education: '', // 学历
  23. educationid: 0,
  24. income: 0, // 收入
  25. Zero:0, //处理不限
  26. Zero1: 0, //处理不限
  27. heightZero: 0, //处理不限
  28. heightZero1: 0, //处理不限
  29. incomeZero:0,
  30. incomeZero1:0,
  31. // min = '';
  32. // max = '';
  33. // 省市区
  34. province: 0, // 省 要传的数据
  35. city: 0, // 市 要传的数据
  36. area: 0, // 区 要传的数据
  37. provinceName: '', // 省 要传的数据
  38. cityName: '', // 市 要传的数据
  39. areaName: '', // 区 要传的数据
  40. provincedata: '', //省数据
  41. provinceid: 1, //省选中ID
  42. provincetext: '北京', //省 名字
  43. citydata: '', //市数据
  44. cityidx: '', //市选中ID
  45. citytext: '', //市 名字
  46. areadata: '', //区数据
  47. scrolltop: '', //市区滚动条
  48. hiddenName: true, //显示隐藏
  49. },
  50. onLoad: function (option) {
  51. var that = this
  52. console.log(option)
  53. getApp().showLoading(); //提示加载中
  54. //先清空要传的数据
  55. app.globalData.Selection = 0; // 是否选中
  56. app.globalData.age = 0; // 年龄
  57. app.globalData.height = 0; // 身高
  58. app.globalData.marry = 0 // 婚史
  59. app.globalData.education = 0 // 学历
  60. app.globalData.income = 0; // 收入
  61. var _province = option.province // 省
  62. var _city = option.city // 市
  63. var _area = option.area // 区
  64. var _provincename = option.provinceName // 省
  65. var _cityname = option.cityName // 市
  66. var _areaname = option.areaName // 区
  67. var _idmarry = option.idmarry
  68. var _educationid = option.educationid
  69. that.setData({
  70. province: _province,
  71. city: _city,
  72. area: _area,
  73. provinceName: _provincename, // 省
  74. cityName: _cityname, // 市
  75. areaName: _areaname, // 区
  76. idmarry: _idmarry,
  77. educationid: _educationid,
  78. })
  79. // console.log(that.data.province)
  80. // console.log(that.data.city)
  81. // console.log(that.data.area)
  82. // console.log(that.data.provinceName)
  83. // console.log(that.data.cityName)
  84. // console.log(that.data.areaName)
  85. // 年龄 ajax
  86. let Age_url = 'public/paramsgather?type=age';
  87. let Age_data = {};
  88. var _age = option.age // 年龄
  89. var agenewArry = _age.split("-"); //转成数组
  90. var _age_min = agenewArry[0]
  91. var _age_max = agenewArry[1]
  92. // console.log(_age_min)
  93. // console.log(_age_max)
  94. that.setData({
  95. age: _age
  96. })
  97. app.postRequest(Age_url, Age_data, function (res) { // 年龄 ajax
  98. if (res.code == 201) {
  99. let newarray = ['不限'];
  100. var res_data = newarray.concat(res.data); //在原有的数据上 凭借上 不限
  101. let newarray1 = ['以上'];
  102. var res_data1 = newarray1.concat(res.data); //在原有的数据上 凭借上 以上
  103. let min = data_processing(res_data, _age_min); //已选中的数据处理 min
  104. let max = data_processing(res_data1, _age_max); //已选中的数据处理 max
  105. if (min == 0 && max == 0){
  106. that.setData({
  107. AgeIndex: [min, max],
  108. Zero:1,
  109. })
  110. }else{
  111. that.setData({
  112. AgeIndex: [min, max],
  113. Zero:0,
  114. })
  115. }
  116. let dictObject = res.data; //对象不能直接使用 以下转成数组
  117. // 对象转成数组
  118. var createArr = []
  119. for (let i in dictObject) {
  120. createArr.push(dictObject[i] + "岁"); //在数据后面凭借 岁
  121. }
  122. let bx = ['不限'];
  123. var Unlimited = bx.concat(createArr); //在原有的数据上 凭借上 不限
  124. let ys = ['以上'];
  125. var Above = ys.concat(createArr); //在原有的数据上 凭借上 以上
  126. that.setData({
  127. AgeArray: [Unlimited, Above],
  128. })
  129. // console.log(createArr);
  130. }
  131. })
  132. // 身高 ajax
  133. let height_url = 'public/paramsgather?type=height';
  134. let height_data = {
  135. pid: '0'
  136. };
  137. var _height = option.height // 身高
  138. var heightnewArry = _height.split("-"); //转成数组
  139. var heightSmall = heightnewArry[0]
  140. var heightlarge = heightnewArry[1]
  141. // console.log(heightSmall)
  142. // console.log(heightlarge)
  143. that.setData({
  144. height: _height
  145. })
  146. app.postRequest(height_url, height_data, function (res) { // 身高 ajax
  147. if (res.code == 201) {
  148. let newarray = ['不限'];
  149. var res_data = newarray.concat(res.data); //在原有的数据上 凭借上 不限
  150. let newarray1 = ['以上'];
  151. var res_data1 = newarray1.concat(res.data); //在原有的数据上 凭借上 以上
  152. let min = data_processing(res_data, heightSmall); //已选中的数据处理 min
  153. let max = data_processing(res_data1, heightlarge); //已选中的数据处理 max
  154. if (min == 0 && max == 0) {
  155. that.setData({
  156. heightindex: [min, max],
  157. heightZero: 1,
  158. })
  159. } else {
  160. that.setData({
  161. heightindex: [min, max],
  162. heightZero: 0,
  163. })
  164. }
  165. let dictObject = res.data; //对象不能直接使用 以下转成数组
  166. // 对象转成数组
  167. var createArr = []
  168. for (let i in dictObject) {
  169. createArr.push(dictObject[i] + "cm");
  170. }
  171. let bx = ['不限'];
  172. var Unlimited = bx.concat(createArr);
  173. let ys = ['以上'];
  174. var Above = ys.concat(createArr);
  175. // console.log(createArr);
  176. that.setData({
  177. heightArray: [Unlimited, Above],
  178. })
  179. }
  180. })
  181. // 婚史 ajax
  182. let Marriage_url = 'public/paramsgather?type=marriage';
  183. let Marriage_data = {
  184. pid: '0'
  185. };
  186. var _marry = option.marry // 婚史
  187. // console.log(_marry)
  188. that.setData({
  189. marry: _marry
  190. })
  191. app.postRequest(Marriage_url, Marriage_data, function (res) { // 婚史 ajax
  192. if (res.code == 201) {
  193. // console.log(res.data);
  194. for (let i = 0; i < res.data.length; i++) { //已选中的数据处理
  195. if (i == _marry) {
  196. that.setData({
  197. Marriageindex: i,
  198. })
  199. }
  200. }
  201. that.setData({
  202. MarriageArray: res.data,
  203. idmarry: that.data.idmarry,
  204. })
  205. }
  206. })
  207. // 学历 ajax
  208. let Education_url = 'public/paramsgather?type=xueli';
  209. let Education_data = {
  210. // pid: '0'
  211. };
  212. var _education = option.education // 学历
  213. // console.log(_education)
  214. that.setData({
  215. education: _education
  216. })
  217. app.postRequest(Education_url, Education_data, function (res) { // 学历 ajax
  218. if (res.code == 201) {
  219. // console.log(res.data);
  220. var obj = { id: 0, name: '不限' };
  221. var datares = res.data;
  222. datares.unshift(obj)
  223. for (let i = 0; i < datares.length; i++) { //已选中的数据处理
  224. if (datares[i].id == _education) {
  225. that.setData({
  226. Educationindex: i,
  227. })
  228. }
  229. }
  230. that.setData({
  231. EducationArray: datares,
  232. educationid: that.data.educationid
  233. })
  234. }
  235. })
  236. // 收入 ajax
  237. let income_url = 'public/paramsgather?type=shouru';
  238. let income_data = {
  239. // pid: '0'
  240. };
  241. var _income = option.income // 收入
  242. var incomenewArry = _income.split("-"); //转成数组
  243. var incomemin = incomenewArry[0];
  244. var incomemax = incomenewArry[1];
  245. that.setData({
  246. income: _income
  247. })
  248. app.postRequest(income_url, income_data, function (res) { // 收入 ajax
  249. if (res.code == 201) {
  250. let newarray = ['不限'];
  251. var res_data = newarray.concat(res.data); //在原有的数据上 凭借上 不限
  252. let newarray1 = ['以上'];
  253. var res_data1 = newarray1.concat(res.data); //在原有的数据上 凭借上 以上
  254. var min = data_processing(res_data, incomemin); //已选中的数据处理 min
  255. var max = data_processing(res_data1, incomemax); //已选中的数据处理 max
  256. if (min == 0 && max == 0) {
  257. that.setData({
  258. incomeindex: [min, max],
  259. incomeZero: 1,
  260. })
  261. } else {
  262. that.setData({
  263. incomeindex: [min, max],
  264. incomeZero: 0,
  265. })
  266. }
  267. that.setData({
  268. incomeArray: [res_data, res_data1],
  269. })
  270. }
  271. })
  272. },
  273. // 年龄双选
  274. AgeEvent: function (e) {
  275. var that= this;
  276. // console.log('picker发送选择改变,携带值为', e.detail.value)
  277. var _value = e.detail.value; //发送选择改变,携带值为
  278. var Small = this.data.AgeArray[0][e.detail.value[0]].substring(0, 2);
  279. var large = this.data.AgeArray[1][e.detail.value[1]].substring(0, 2);
  280. // console.log(Agedata);
  281. if (Small > large && Small != '不限' && large != '以上') { //判断 最小值 大于 最大值 数据互换
  282. // console.log('调换')
  283. var Agedata = large + '-' + Small;
  284. that.Exchange(_value); // 调用数组调换
  285. } else {
  286. var Agedata = Small + '-' + large; //否则正常选中
  287. }
  288. if (Small == '不限' && large == '以上'){
  289. that.setData({
  290. Zero1: 1
  291. })
  292. }else{
  293. that.setData({
  294. Zero1:0
  295. })
  296. }
  297. this.setData({
  298. AgeIndex: _value,
  299. age: Agedata,
  300. Ageid: 1,
  301. })
  302. },
  303. // 数组数据调换
  304. Exchange: function (data) {
  305. for (var i = 0; i < data.length / 2; i++) {
  306. var data_i = data[i];
  307. data[i] = data[data.length - 1 - i];
  308. data[data.length - 1 - i] = data_i;
  309. }
  310. return;
  311. },
  312. heightEvent: function (e) { // 身高
  313. var that = this;
  314. // console.log(this);
  315. // console.log(e);
  316. // console.log(this.data.heightArray[e.detail.value]);
  317. // console.log('picker发送选择改变,携带值为', e.detail.value)
  318. var _value = e.detail.value; //发送选择改变,携带值为
  319. var heightSmall = this.data.heightArray[0][e.detail.value[0]].substring(0, 3);
  320. var heightlarge = this.data.heightArray[1][e.detail.value[1]].substring(0, 3);
  321. // console.log(heightdata)
  322. if (heightSmall > heightlarge && heightSmall != '不限' && heightlarge != '以上') { //判断 最小值 大于 最大值 数据互换
  323. // console.log('调换')
  324. var heightdata = heightlarge + '-' + heightSmall;
  325. that.Exchange(_value); // 调用数组调换
  326. } else {
  327. var heightdata = heightSmall + '-' + heightlarge;
  328. }
  329. if (heightSmall == '不限' && heightlarge == '以上') {
  330. that.setData({
  331. heightZero1: 1
  332. })
  333. } else {
  334. that.setData({
  335. heightZero1: 0
  336. })
  337. }
  338. that.setData({
  339. heightindex: _value,
  340. height: heightdata,
  341. heightid: 1,
  342. })
  343. },
  344. MarriageEvent: function (e) { // 婚史 单项选择器
  345. // console.log(this);
  346. // console.log(e);
  347. // console.log(this.data.MarriageArray[e.detail.value]);
  348. // console.log('picker发送选择改变,携带值为', e.detail.value)
  349. this.setData({
  350. Marriageindex: e.detail.value,
  351. marry: e.detail.value,
  352. idmarry: 1,
  353. })
  354. },
  355. EducationEvent: function (e) { // 学历 单项选择器
  356. // console.log(this);
  357. // console.log(e);
  358. // console.log(this.data.EducationArray[e.detail.value].id);
  359. // console.log('picker发送选择改变,携带值为', e.detail.value)
  360. this.setData({
  361. Educationindex: e.detail.value,
  362. education: this.data.EducationArray[e.detail.value].id,
  363. educationid: 1,
  364. })
  365. },
  366. incomeEvent: function (e) { // 收入 单项选择器
  367. var that = this;
  368. // console.log(this);
  369. // console.log(e);
  370. // console.log(this.data.incomeArray[e.detail.value].id);
  371. // console.log('picker发送选择改变,携带值为', e.detail.value)
  372. var _value = e.detail.value; //发送选择改变,携带值为
  373. var srSmall = this.data.incomeArray[0][e.detail.value[0]];
  374. var srlarge = this.data.incomeArray[1][e.detail.value[1]];
  375. // console.log(Agedata);
  376. if (srSmall > srlarge && srSmall != '不限' && srlarge != '以上') { //判断 最小值 大于 最大值 数据互换
  377. // console.log('调换')
  378. var srdata = srlarge + '-' + srSmall;
  379. that.Exchange(_value); // 调用数组调换
  380. } else {
  381. var srdata = srSmall + '-' + srlarge; //否则正常选中
  382. }
  383. if (srSmall == '不限' && srlarge == '以上') {
  384. that.setData({
  385. incomeZero1: 1
  386. })
  387. } else {
  388. that.setData({
  389. incomeZero1: 0
  390. })
  391. }
  392. that.setData({
  393. incomeindex: _value,
  394. income: srdata,
  395. incomeid: 1,
  396. })
  397. },
  398. // 会员编码
  399. getPhone: function (e) {
  400. var _inputValue = e.detail.value;
  401. console.log(_inputValue);
  402. this.setData({
  403. inputValue: _inputValue
  404. });
  405. },
  406. //下一步事件
  407. register: function (e) {
  408. var _this= this;
  409. //设置全局变量(app已经定义 var app=getApp()) 赋值要传的参数
  410. app.globalData.inputValue = String(_this.data.inputValue); //用户ID
  411. app.globalData.age = String(_this.data.age); // 年龄
  412. app.globalData.height = String(_this.data.height); // 身高
  413. app.globalData.marry = String(_this.data.marry) // 婚史
  414. app.globalData.idmarry = String(_this.data.idmarry) // 婚史
  415. app.globalData.education = String(_this.data.education) // 学历
  416. app.globalData.educationid = String(_this.data.educationid) // 学历
  417. app.globalData.income = String(_this.data.income); // 收入
  418. app.globalData.Selection = String(1); // 是否选中 1 选中 0没选中
  419. app.globalData.province = String(_this.data.province); // 省
  420. app.globalData.city = String(_this.data.city); // 市
  421. app.globalData.area = String(_this.data.area); // 区
  422. app.globalData.provinceName = String(_this.data.provinceName); // 省
  423. app.globalData.cityName = String(_this.data.cityName); // 市
  424. app.globalData.areaName = String(_this.data.areaName); // 区
  425. wx.switchTab({
  426. url: '../index/index',
  427. })
  428. _this.setData({
  429. inputValue:'',
  430. })
  431. },
  432. // 重置
  433. Reset: function (e) {
  434. var _this = this;
  435. _this.setData({
  436. AgeIndex: ['', ''], // 年龄-下标
  437. age: 0, // 年龄
  438. Ageid: 0,
  439. heightindex: ['', ''], // 身高-下标
  440. height: 0, //身高
  441. heightid: 0,
  442. Marriageindex: '', // 婚史-下标
  443. marry: 0,
  444. idmarry: 0,
  445. Educationindex: '', //学历
  446. education: 0, //学历
  447. educationid: 0,
  448. incomeindex: ['', ''], //收入
  449. income: 0, //收入
  450. inputValue: '', //ID
  451. province: 0, // 市
  452. city: 0, // 市
  453. area: 0, // 区
  454. provinceName: '', // 省
  455. cityName: '', // 市
  456. areaName: '', // 区
  457. })
  458. app.globalData.inputValue = String(_this.data.inputValue); //用户ID
  459. app.globalData.age = String(_this.data.age); // 年龄
  460. app.globalData.height = String(_this.data.height); // 身高
  461. app.globalData.marry = String(_this.data.marry) // 婚史
  462. app.globalData.idmarry = String(_this.data.idmarry) // 婚史
  463. app.globalData.education = String(_this.data.education) // 学历
  464. app.globalData.educationid = String(_this.data.educationid) // 学历
  465. app.globalData.income = String(_this.data.income); // 收入
  466. app.globalData.Selection = String(1); // 是否选中 1 选中 0没选中
  467. app.globalData.province = String(_this.data.province); // 省
  468. app.globalData.city = String(_this.data.city); // 市
  469. app.globalData.area = String(_this.data.area); // 区
  470. app.globalData.provinceName = String(_this.data.provinceName); // 省
  471. app.globalData.cityName = String(_this.data.cityName); // 市
  472. app.globalData.areaName = String(_this.data.areaName); // 区
  473. },
  474. // 省市区三级联动 点击弹窗
  475. linkage: function (e) {
  476. var that = this;
  477. let citypid_url = 'public/citypid';
  478. let citypid_data = {};
  479. app.postRequest(citypid_url, citypid_data, function (res) { // 省市区三级联动 ajax
  480. if (res.code == 201) {
  481. that.setData({
  482. provincedata: res.data, // 省数据
  483. })
  484. // console.log(res.data)
  485. that.provinceOn();
  486. }
  487. })
  488. },
  489. // 省事件
  490. provinceOn: function (e) {
  491. var that = this;
  492. // console.log(e);
  493. if (e) {
  494. that.setData({
  495. provinceid: e.currentTarget.dataset.id, //省ID
  496. provincetext: e.currentTarget.dataset.text, //省名字
  497. })
  498. }
  499. // console.log(that.data.provinceid);
  500. // console.log(that.data.provincetext)
  501. let citypid_url = 'public/citypid';
  502. let citypid_data = {
  503. pid: that.data.provinceid,
  504. };
  505. app.postRequest(citypid_url, citypid_data, function (res) { // 省市区三级联动 ajax
  506. if (res.code == 201) {
  507. that.setData({
  508. hiddenName: false,
  509. citydata: res.data, // 市数据
  510. scrolltop: 0, //市区滚动条
  511. areadata: '', //区域数据清空
  512. cityidx: '', // idx 选中清空
  513. })
  514. console.log(res.data)
  515. }
  516. })
  517. },
  518. // 市事件
  519. cityOn: function (e) {
  520. var that = this;
  521. var _cityidx = that.data.cityidx
  522. var cityid = e.currentTarget.dataset.id; //市ID
  523. var citytext = e.currentTarget.dataset.text; //市名字
  524. var _index = e.currentTarget.dataset.index + 1; //下标
  525. // console.log(_index);
  526. // console.log(_index*42,);
  527. // console.log(_cityidx);
  528. // console.log(cityid);
  529. that.setData({
  530. cityidx: cityid, // 市 选中
  531. citytext: citytext, // 市 选中名字
  532. areadata: '', //区域数据清空
  533. })
  534. let citypid_url = 'public/citypid';
  535. let citypid_data = {
  536. pid: cityid,
  537. };
  538. app.postRequest(citypid_url, citypid_data, function (res) { // 省市区三级联动 ajax
  539. if (res.code == 201) {
  540. if (_cityidx == cityid) {
  541. that.setData({
  542. areadata: '', // 区数据
  543. cityidx: '', // idx 选中清空
  544. })
  545. } else {
  546. that.setData({
  547. areadata: res.data, // 区数据
  548. scrolltop: _index * 42,
  549. })
  550. // console.log('执行')
  551. // console.log(_index * 42);
  552. }
  553. console.log(res.data)
  554. }
  555. })
  556. },
  557. //区选中事件
  558. areaOn: function (e) {
  559. var that = this;
  560. var _style = e.currentTarget.dataset.style;
  561. // console.log(_style);
  562. switch (_style) {
  563. case 'provinceLx':
  564. // console.log('省');
  565. that.setData({
  566. province: that.data.provinceid, // 省数据
  567. provinceName: that.data.provincetext, // 省名字
  568. city: 0, // 市数据清空
  569. cityName: '', // 市名字清空
  570. area: 0, // 区数据清空
  571. areaName: "", // 区名字
  572. })
  573. break;
  574. case 'cityLx':
  575. // console.log('市');
  576. that.setData({
  577. province: that.data.provinceid, // 省数据
  578. provinceName: that.data.provincetext, // 省名字
  579. city: that.data.cityidx, // 市数据
  580. cityName: that.data.citytext, // 省名字
  581. area: 0, // 区数据清空
  582. areaName: "", // 区名字
  583. })
  584. break;
  585. case 'areaLx':
  586. // console.log('区');
  587. var areaid = e.currentTarget.dataset.id; //区ID
  588. var areatext = e.currentTarget.dataset.text; //区名字
  589. that.setData({
  590. province: that.data.provinceid, // 省数据
  591. provinceName: that.data.provincetext, // 省名字
  592. city: that.data.cityidx, // 市数据
  593. cityName: that.data.citytext, // 省名字
  594. area: areaid, // 区数据
  595. areaName: areatext, // 区名字
  596. })
  597. break;
  598. }
  599. // console.log(that.data.province)
  600. // console.log(that.data.city)
  601. // console.log(that.data.area)
  602. // console.log(that.data.provinceName)
  603. // console.log(that.data.cityName)
  604. // console.log(that.data.areaName)
  605. //选择完清空
  606. that.setData({
  607. hiddenName: true,
  608. provinceid: 1,
  609. provincetext: '北京', //省 名字
  610. cityidx: 0,
  611. citytext: '',
  612. })
  613. },
  614. //省市区不限 清空
  615. regionBx: function () {
  616. var that = this;
  617. that.setData({
  618. hiddenName: true,
  619. provinceid: 1,
  620. provincetext: '北京', //省 名字
  621. cityidx: 0,
  622. citytext: '',
  623. province: 0, // 省数据
  624. provinceName: '', // 省名字
  625. city: 0, // 市数据清空
  626. cityName: '', // 市名字清空
  627. area: 0, // 区数据清空
  628. areaName: "", // 区名字
  629. })
  630. },
  631. //省市区关闭 清空
  632. Close: function () {
  633. var that = this;
  634. that.setData({
  635. hiddenName: true,
  636. provinceid: 1,
  637. provincetext: '北京', //省 名字
  638. cityidx: 0,
  639. citytext: '',
  640. })
  641. },
  642. })
  643. var data_processing = function (data, min_max,) {
  644. for (let i = 0; i < data.length; i++) { //已选中的数据处理
  645. if (data[i] == min_max) {
  646. return i;
  647. }
  648. }
  649. }