cats.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763
  1. route_advert<template>
  2. <app-layout>
  3. <template v-if="loading">
  4. <view class="app-search" v-if="search_bool">
  5. <app-search-for></app-search-for>
  6. </view>
  7. <!-- 样式一 -->
  8. <view v-if="cat_style.cat_style === '1'" class="margin-fixed">
  9. <style-one
  10. :list="list"
  11. :goods_list="goods_list"
  12. ></style-one>
  13. </view>
  14. <!-- 样式二 -->
  15. <view v-else-if="cat_style.cat_style === '2'" class="margin-fixed">
  16. <style-two
  17. :list="list"
  18. :windowHeight="windowHeight"
  19. :windowWidth="windowWidth"
  20. :botHeight="botHeight"
  21. :setHeight="setHeight"
  22. :activeIndex="activeIndex"
  23. @active="activeThree"
  24. @route_advert="route_advert"
  25. ></style-two>
  26. </view>
  27. <!-- 样式三 -->
  28. <view v-else-if="cat_style.cat_style === '3'" class="margin-fixed">
  29. <style-three
  30. :list="list"
  31. :goods_list="goods_list"
  32. ></style-three>
  33. </view>
  34. <!-- 样式四 -->
  35. <view v-else-if="cat_style.cat_style === '4'" class="margin-fixed">
  36. <style-four
  37. :list="list"
  38. :windowHeight="windowHeight"
  39. :windowWidth="windowWidth"
  40. :botHeight="botHeight"
  41. :setHeight="setHeight"
  42. :activeIndex="activeIndex"
  43. @active="activeThree"
  44. @route_advert="route_advert"
  45. ></style-four>
  46. </view>
  47. <!-- 样式五 -->
  48. <view v-else-if="cat_style.cat_style === '5'" class="margin-fixed">
  49. <style-five
  50. :list="list"
  51. @active="activeOne"
  52. @setNav="activeTwo"
  53. :activeIndex="activeIndex"
  54. :activeIndexTwo="activeIndexTwo"
  55. :goods_list="goods_list"
  56. ></style-five>
  57. </view>
  58. <!-- 样式六 -->
  59. <view v-else-if="cat_style.cat_style === '6'" class="margin-fixed">
  60. <style-six
  61. :list="list"
  62. :setHeight="setHeight"
  63. :activeIndex="activeIndex"
  64. :goods="goods"
  65. :botHeight="botHeight"
  66. @active="activeThree"
  67. @route_advert="route_advert"
  68. ></style-six>
  69. </view>
  70. <!-- 样式七 -->
  71. <view v-else-if="cat_style.cat_style === '7'" class="margin-fixed">
  72. <style-seven
  73. :list="list"
  74. :setHeight="setHeight"
  75. :activeIndex="activeIndex"
  76. :goods="goods"
  77. :botHeight="botHeight"
  78. :windowHeight="windowHeight"
  79. :windowWidth="windowWidth"
  80. @active="activeThree"
  81. @route_advert="route_advert"
  82. ></style-seven>
  83. </view>
  84. <!-- 样式八 -->
  85. <view v-else-if="cat_style.cat_style === '8'" class="margin-fixed">
  86. <style-eight
  87. :list="list"
  88. :goods_list="goods_list"
  89. theme="default"
  90. @active="active"
  91. ></style-eight>
  92. </view>
  93. <!-- 样式九 -->
  94. <view v-else-if="cat_style.cat_style === '9'" class="margin-fixed">
  95. <style-nine
  96. :list="list"
  97. :setHeight="setHeight"
  98. :activeIndex="activeIndex"
  99. :goods_list="goods_list"
  100. @active="activeThree"
  101. @lower="lower"
  102. @requestGoods="requestGoods"
  103. @attr="attr"
  104. @route_advert="route_advert"
  105. ></style-nine>
  106. </view>
  107. <!-- 样式十 -->
  108. <view v-else-if="cat_style.cat_style === '10'" class="margin-fixed">
  109. <style-ten
  110. :list="list"
  111. :setHeight="setHeight"
  112. :activeIndex="activeIndex"
  113. :goods_list="goods_list"
  114. :activeIndexTwo="activeIndexTwo"
  115. @active="activeThree"
  116. @lower="lower"
  117. @requestGoods="requestGoods"
  118. @setNav="activeTwo"
  119. @attr="attr"
  120. @route_advert="route_advert"
  121. ></style-ten>
  122. </view>
  123. <!-- 样式十一 -->
  124. <view v-else-if="cat_style.cat_style === '11'" class="margin-fixed">
  125. <style-eleven
  126. :list="list"
  127. :setHeight="setHeight"
  128. :activeIndex="activeIndex"
  129. :goods_list="goods_list"
  130. :activeIndexTwo="activeIndexTwo"
  131. @active="activeThree"
  132. @lower="catLower"
  133. @requestCatList="activeRequest"
  134. @setNav="requestCatList"
  135. @attr="attr"
  136. @route_advert="route_advert"
  137. ></style-eleven>
  138. </view>
  139. <app-attr
  140. ref="attr"
  141. :goods="item"
  142. :select-attr="selectAttr"
  143. :attr-group-list="attrGroup"
  144. :show="show"
  145. @attrtap="onAttr"
  146. :previewUrl="previewUrl"
  147. :submitUrl="submitUrl"
  148. ></app-attr>
  149. </template>
  150. </app-layout>
  151. </template>
  152. <script>
  153. import { mapGetters, mapState } from 'vuex';
  154. import styleOne from './style-one.vue';
  155. import styleTwo from './style-two';
  156. import styleThree from './style-three.vue';
  157. import styleFour from './style-four.vue';
  158. import styleFive from './style-five.vue';
  159. import styleSix from './style-six.vue';
  160. import styleSeven from './style-seven.vue';
  161. import styleEight from './style-eight.vue';
  162. import styleNine from './style-nine.vue';
  163. import styleTen from './style-ten.vue';
  164. import styleEleven from './style-eleven.vue';
  165. import appSearchFor from '../../components/page-component/app-search-for/app-search-for.vue';
  166. import routeJump from '../../core/routeJump.js';
  167. import appAttr from '../../components/page-component/app-attr/app-attr.vue';
  168. export default {
  169. components: {
  170. 'app-search-for': appSearchFor,
  171. 'style-one': styleOne,
  172. 'style-two': styleTwo,
  173. 'style-three': styleThree,
  174. 'style-four': styleFour,
  175. 'style-five': styleFive,
  176. 'style-six': styleSix,
  177. 'style-seven': styleSeven,
  178. 'style-eight': styleEight,
  179. 'style-nine': styleNine,
  180. 'style-ten': styleTen,
  181. 'style-eleven': styleEleven,
  182. 'app-attr': appAttr,
  183. },
  184. data() {
  185. return {
  186. search_bool: true,
  187. list: [],
  188. goods: [],
  189. request: true,
  190. page: 1,
  191. classId: 0,
  192. activeIndex: 0,
  193. activeIndexTwo: 0,
  194. over: false,
  195. scrollHeight: 0,
  196. tabbarbool: true,
  197. cat_id: 0,
  198. cat_ids: [],
  199. againLower: true,
  200. //
  201. goods_list: [],
  202. page_count: 1,
  203. select_cat_id: 0,
  204. first_id: 0,
  205. loading: false,
  206. selectAttr: {},
  207. previewUrl: '',
  208. submitUrl: '',
  209. show: 0,
  210. attrGroup: [],
  211. item: {}
  212. }
  213. },
  214. computed: {
  215. ...mapGetters('mallConfig', {
  216. cat_style: 'getCatStyle',
  217. }),
  218. ...mapState('gConfig', {
  219. windowHeight: state => state.systemInfo.windowHeight,
  220. windowWidth: state => state.systemInfo.windowWidth,
  221. }),
  222. ...mapGetters('iPhoneX', {
  223. botHeight: 'getBotHeight'
  224. }),
  225. setHeight() {
  226. let bottom = 0;
  227. if (this.tabbarbool) {
  228. bottom = this.botHeight;
  229. }
  230. return (this.windowHeight * (750 / this.windowWidth)) - bottom - 88;
  231. }
  232. },
  233. onReachBottom() {
  234. if (this.cat_style.cat_style === '3' || this.cat_style.cat_style === '1') return;
  235. if (this.page < this.page_count) {
  236. this.page++;
  237. this.$request({
  238. url: this.$api.default.goods_list,
  239. method: 'get',
  240. data: {
  241. page: this.page,
  242. cat_id: this.cat_id,
  243. }
  244. }).then(res => {
  245. if (res.code === 0) {
  246. if (this.cat_style.cat_style === '8' || this.cat_style.cat_style === '5') {
  247. this.dataProcessing(res.data.list);
  248. } else {
  249. this.goods_list.push(...res.data.list);
  250. }
  251. }
  252. });
  253. } else {
  254. uni.showToast({
  255. title: '暂无更多商品',
  256. icon: 'none'
  257. })
  258. }
  259. },
  260. methods: {
  261. onAttr(data) {
  262. this.selectAttr = data;
  263. },
  264. attr(previewUrl, submitUrl, attr_groups, goods) {
  265. this.previewUrl = previewUrl;
  266. this.submitUrl = submitUrl;
  267. this.attrGroup = attr_groups;
  268. this.item = goods;
  269. this.show = Math.random();
  270. },
  271. route_advert(data) {
  272. routeJump({
  273. open_type: data.advert_open_type,
  274. params: data.advert_params,
  275. page_url: data.advert_url
  276. });
  277. },
  278. // 点击导航栏
  279. active(item) {
  280. this.page = 1;
  281. this.goods_list = [];
  282. this.cat_id = item.id;
  283. this.select_cat_id = item.id;
  284. for (let i = 0; i < this.list.length; i++) {
  285. if (this.list[i].active !== item.active) {
  286. this.list[i].active = false;
  287. }
  288. if (this.list[i].id === item.id) {
  289. this.list[i].active = true;
  290. }
  291. }
  292. this.$request({
  293. url: `${this.$api.default.goods_list}&page=${this.page}&cat_id=${item.id}`
  294. }).then(res => {
  295. if (res.code === 0) {
  296. this.dataProcessing(res.data.list);
  297. this.page_count = res.data.pagination.page_count;
  298. }
  299. });
  300. },
  301. // 下拉分页请求
  302. req() {
  303. this.$request({
  304. url: `${this.$api.default.goods_list}&page=${this.page}&cat_id=${this.classId}`
  305. }).then(response => {
  306. if (response.data.list.length > 0) {
  307. if (this.cat_style.cat_style === '8' || this.cat_style.cat_style === '5') {
  308. this.dataProcessing(response.data.list);
  309. } else {
  310. this.goods.push(...response.data.list);
  311. }
  312. } else {
  313. this.over = true;
  314. }
  315. });
  316. },
  317. activeOne(item) {
  318. this.page = 1;
  319. this.activeIndexTwo = 0;
  320. this.cat_id = item.id;
  321. this.select_cat_id = item.id;
  322. for (let i = 0; i < this.list.length; i++) {
  323. if (this.list[i].active !== item.active) {
  324. this.list[i].active = false;
  325. }
  326. if (this.list[i].id === item.id) {
  327. this.list[i].active = true;
  328. this.activeIndex = i;
  329. }
  330. }
  331. if (this.cat_style.cat_style === '5') this.goods_list = [];
  332. if (this.list[this.activeIndex].child.length === 0) {
  333. this.$request({
  334. url: `${this.$api.default.goods_list}&page=${this.page}&cat_id=${item.id}`
  335. }).then(res => {
  336. let { list, pagination } = res.data;
  337. if (this.cat_style.cat_style === '8' || this.cat_style.cat_style === '5') {
  338. this.goods_list = [];
  339. this.dataProcessing(list);
  340. } else {
  341. this.goods_list = list;
  342. }
  343. this.page = 1;
  344. this.cat_id = item.id;
  345. this.select_cat_id = item.id;
  346. this.page_count = pagination.page_count;
  347. });
  348. } else {
  349. this.$request({
  350. url: `${this.$api.default.goods_list}&page=${this.page}&cat_id=${this.list[this.activeIndex].child[0].id}`
  351. }).then(res => {
  352. let { list, pagination } = res.data;
  353. if (this.cat_style.cat_style === '8' || this.cat_style.cat_style === '5') {
  354. this.goods_list = [];
  355. this.dataProcessing(list);
  356. } else {
  357. this.goods_list = list;
  358. }
  359. this.page = 1;
  360. this.cat_id = this.list[this.activeIndex].child[0].id;
  361. this.select_cat_id = item.id;
  362. this.page_count = pagination.page_count;
  363. });
  364. }
  365. },
  366. async activeTwo(item, index) {
  367. this.page = 1;
  368. this.activeIndexTwo = index;
  369. this.select_cat_id = item.id;
  370. this.cat_id = item.id;
  371. this.select_cat_id = item.id;
  372. const res = await this.$request({
  373. url: this.$api.default.goods_list,
  374. method: 'get',
  375. data: {
  376. page: 1,
  377. cat_id: item.id,
  378. }
  379. });
  380. if (res.code === 0) {
  381. let { list, pagination } = res.data;
  382. this.goods_list = [];
  383. if (this.cat_style.cat_style === '5') {
  384. this.goods_list = [];
  385. this.dataProcessing(list);
  386. } else {
  387. this.goods_list = list;
  388. }
  389. this.page_count = pagination.page_count;
  390. }
  391. },
  392. activeThree(item) {
  393. this.cat_id = item.id;
  394. this.select_cat_id = item.id;
  395. for (let i = 0; i < this.list.length; i++) {
  396. if (this.list[i].active !== item.active) {
  397. this.list[i].active = false;
  398. }
  399. if (this.list[i].id === item.id) {
  400. this.list[i].active = true;
  401. this.activeIndex = i;
  402. }
  403. }
  404. },
  405. async catLower() {
  406. if (!this.againLower) return;
  407. this.againLower = false;
  408. let goods_list = this.goods_list[this.goods_list.length - 1];
  409. const res = await this.$request({
  410. url: this.$api.default.cat_goods,
  411. method: 'get',
  412. data: {
  413. cat_ids: JSON.stringify(this.cat_ids),
  414. cat_id: goods_list.id,
  415. offset: goods_list.offset
  416. }
  417. });
  418. if (res.code === 0) {
  419. if (res.data.list[0].id === goods_list.id && res.data.list[0].goods_list.length > 0) {
  420. this.goods_list[this.goods_list.length - 1].goods_list.push(...res.data.list[0].goods_list);
  421. this.goods_list[this.goods_list.length - 1].offset = res.data.list[0].offset;
  422. }
  423. for (let i = 1; i < res.data.list.length; i++) {
  424. this.goods_list.push(res.data.list[i]);
  425. }
  426. this.againLower = true;
  427. }
  428. },
  429. activeRequest(data) {
  430. this.goods_list = [];
  431. if (data.child.length !== 0) {
  432. this.requestCatList(data.child[0], 0);
  433. }
  434. },
  435. async requestCatList(data, index) {
  436. this.page = 1;
  437. this.cat_id = data.id;
  438. this.select_cat_id = data.id;
  439. this.activeIndexTwo = index;
  440. this.goods_list = [];
  441. if (data.child.length !== 0) {
  442. this.cat_ids = [];
  443. for (let i = 0; i < data.child.length; i++) {
  444. this.cat_ids.push(data.child[i].id);
  445. }
  446. const res = await this.$request({
  447. url: this.$api.default.cat_goods,
  448. method: 'get',
  449. data: {
  450. cat_ids: JSON.stringify(this.cat_ids),
  451. cat_id: data.child[0].id,
  452. offset: 0
  453. }
  454. });
  455. if (res.code === 0) {
  456. this.goods_list = res.data.list;
  457. }
  458. }
  459. },
  460. // 求情商品列表
  461. async requestGoods(data, index) {
  462. this.page = 1;
  463. this.cat_id = data.id;
  464. this.select_cat_id = data.id;
  465. this.goods_list = [];
  466. console.log(this.cat_style.cat_style === '10');
  467. console.log(index);
  468. if (this.cat_style.cat_style === '10' && index !== undefined && this.list[index].child.length !== 0) {
  469. this.activeIndexTwo = 0;
  470. this.cat_id = this.list[index].child[0].id;
  471. console.log(this.cat_id);
  472. }
  473. const res = await this.$request({
  474. url: this.$api.default.goods_list,
  475. method: 'get',
  476. data: {
  477. page: this.page,
  478. cat_id: this.cat_id,
  479. }
  480. });
  481. if (res.code === 0) {
  482. this.goods_list = res.data.list;
  483. this.page_count = res.data.pagination.page_count;
  484. }
  485. },
  486. // 分页请求商品
  487. async lower(data) {
  488. console.log(data);
  489. if (this.page < this.page_count) {
  490. this.page++;
  491. const res = await this.$request({
  492. url: this.$api.default.goods_list,
  493. method: 'get',
  494. data: {
  495. page: this.page,
  496. cat_id: data.id,
  497. }
  498. });
  499. if (res.code === 0) {
  500. this.goods_list.push(...res.data.list);
  501. }
  502. } else {
  503. uni.showToast({
  504. title: '暂无更多商品',
  505. icon: 'none'
  506. })
  507. }
  508. },
  509. // 处理数据
  510. dataProcessing(list) {
  511. for (let i = 0; i < list.length; i += 2) {
  512. if (i + 1 !== list.length) {
  513. this.goods_list.push([list[i], list[i + 1]]);
  514. } else {
  515. this.goods_list.push([list[i]]);
  516. }
  517. }
  518. },
  519. async requestCat(cat_id, select_cat_id) {
  520. this.loading = false;
  521. const res = await this.$request({
  522. url: this.$api.default.cat_list,
  523. method: 'get',
  524. data: {
  525. cat_id: cat_id ? cat_id : '',
  526. select_cat_id: select_cat_id ? select_cat_id : ''
  527. }
  528. });
  529. if (res.code === 0) {
  530. this.list = res.data.list;
  531. // 分类跳转
  532. if (this.cat_style.cat_style === '1' && this.list.length === 0) {
  533. this.search_bool = false;
  534. return;
  535. };
  536. if (this.cat_style.cat_style === '2' || this.cat_style.cat_style === '1') {
  537. return;
  538. };
  539. if (this.cat_style.cat_style === '3' && this.list.length === 0) {
  540. this.search_bool = false;
  541. return;
  542. }
  543. if (cat_id || select_cat_id) {
  544. if (this.cat_style.cat_style === '11') {
  545. this.cat_ids = [];
  546. this.list.map((item, index) => {
  547. if (item.active) {
  548. this.activeIndex = index;
  549. }
  550. });
  551. if (this.list[this.activeIndex].child.length === 0) return;
  552. for (let i = 0; i < this.list[this.activeIndex].child[0].child.length; i++) {
  553. this.cat_ids.push(this.list[this.activeIndex].child[0].child[i].id);
  554. }
  555. if (this.cat_ids.length === 0) return;
  556. const res = await this.$request({
  557. url: this.$api.default.cat_goods,
  558. method: 'get',
  559. data: {
  560. cat_ids: JSON.stringify(this.cat_ids),
  561. cat_id: this.cat_ids[0],
  562. offset: 0
  563. }
  564. });
  565. if (res.code === 0) {
  566. this.goods_list = res.data.list;
  567. }
  568. return;
  569. }
  570. if (this.cat_style.cat_style === '6' || this.cat_style.cat_style === '7') {
  571. this.list.map((item, index) => {
  572. if (item.active) {
  573. this.activeIndex = index;
  574. }
  575. });
  576. return;
  577. }
  578. if (this.list.length > 0) {
  579. for (let i = 0; i < this.list.length; i++) {
  580. if (this.list[i].active) {
  581. this.cat_id = this.list[i].id;
  582. }
  583. }
  584. }
  585. if ((this.cat_style.cat_style === '5' || this.cat_style.cat_style === '10') && this.list.length > 0 && this.list[0].child.length > 0) {
  586. for (let i = 0; i < this.list.length; i++) {
  587. if (this.list[i].active) {
  588. this.cat_id = this.list[i].child[0].id;
  589. }
  590. }
  591. }
  592. if (this.list.length === 0 && (this.cat_style.cat_style === '4')) {
  593. this.search_bool = false;
  594. return;
  595. }
  596. const res = await this.$request({
  597. url: this.$api.default.goods_list,
  598. method: 'get',
  599. data: {
  600. page: 1,
  601. cat_id: this.cat_id,
  602. }
  603. });
  604. if (res.code === 0) {
  605. if (this.cat_style.cat_style === '8') {
  606. this.dataProcessing(res.data.list);
  607. } else if (this.cat_style.cat_style === '5') {
  608. this.dataProcessing(res.data.list);
  609. } else {
  610. this.goods_list = res.data.list;
  611. }
  612. this.page_count = res.data.pagination.page_count;
  613. if (this.list.length === 0 && this.goods_list.length === 0) {
  614. this.search_bool = false;
  615. }
  616. }
  617. } else {
  618. if (this.list.length > 0) {
  619. if (this.cat_style.cat_style === '11') {
  620. this.cat_ids = [];
  621. if (this.list.length === 0 || this.list[0].child.length === 0) return;
  622. for (let i = 0; i < this.list[0].child[0].child.length; i++) {
  623. this.cat_ids.push(this.list[0].child[0].child[i].id);
  624. }
  625. if (this.cat_ids.length === 0) return;
  626. const res = await this.$request({
  627. url: this.$api.default.cat_goods,
  628. method: 'get',
  629. data: {
  630. cat_ids: JSON.stringify(this.cat_ids),
  631. cat_id: this.cat_ids[0],
  632. offset: 0
  633. }
  634. });
  635. if (res.code === 0) {
  636. this.goods_list = res.data.list;
  637. }
  638. return;
  639. }
  640. this.cat_id = this.list[0].id;
  641. if ((this.cat_style.cat_style === '5' || this.cat_style.cat_style === '10') && this.list[0].child.length > 0) {
  642. this.cat_id = this.list[0].child[0].id;
  643. }
  644. const res = await this.$request({
  645. url: this.$api.default.goods_list,
  646. method: 'get',
  647. data: {
  648. page: 1,
  649. cat_id: this.cat_id,
  650. }
  651. });
  652. if (res.code === 0) {
  653. if (this.cat_style.cat_style === '8' || this.cat_style.cat_style === '5') {
  654. this.dataProcessing(res.data.list);
  655. } else {
  656. this.goods_list = res.data.list;
  657. }
  658. this.page_count = res.data.pagination.page_count;
  659. }
  660. } else {
  661. this.search_bool = false;
  662. }
  663. }
  664. }
  665. }
  666. },
  667. onLoad(options) {
  668. setTimeout(() => {
  669. this.tabbarbool = this.$children[0].tabbarbool;
  670. }, 500);
  671. this.cat_id = options.cat_id;
  672. this.first_id = options.cat_id;
  673. if (options.first_id && options.select_cat_id) {
  674. this.requestCat(options.first_id, options.select_cat_id).then(() => {
  675. this.loading = true;
  676. });
  677. } else if (!options.first_id && options.select_cat_id) {
  678. this.requestCat('', options.select_cat_id).then(() => {
  679. this.loading = true;
  680. });
  681. } else if (!options.first_id && !options.select_cat_id) {
  682. this.requestCat(options.cat_id).then(() => {
  683. this.loading = true;
  684. });
  685. }
  686. },
  687. onShareAppMessage() {
  688. return this.$shareAppMessage({
  689. path: '/pages/cats/cats',
  690. title: this.$children[0].navigationBarTitle,
  691. params: {
  692. cat_id: this.first_id,
  693. first_id: this.first_id,
  694. select_cat_id: this.select_cat_id,
  695. }
  696. });
  697. },
  698. }
  699. </script>
  700. <style lang="scss" scoped>
  701. .app-search {
  702. position: fixed;
  703. top: 0;
  704. left: 0;
  705. z-index: 1000;
  706. }
  707. .empty-search {
  708. height: #{88upx};
  709. width: #{750upx};
  710. background: #f7f7f7;
  711. }
  712. .margin-fixed {
  713. margin-top: #{88upx};
  714. }
  715. .app-top {
  716. width: $screen-width;
  717. }
  718. </style>