123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- const pages = require('../../mixin/pages')
- const productList = '/api/user/collect/product/list'
- const shopList = '/api/user/collect/shop/list'
- Page({
-
- data: {
- ...pages.data(),
- listUrl: productList,
- searchForm: {
- 'key_words': ''
- },
- nav: [
- {
- name: '商品',
- value: '1'
- },
- {
- name: '供应商',
- value: '2'
- }
- ],
- active: '1'
- },
- ...pages.methods,
-
- onLoad(options) {
- this.fetchOrderList()
- },
-
- onReady() {
- },
-
- onShow() {
- },
-
- onHide() {
- },
-
- onUnload() {
- },
-
- onPullDownRefresh() {
- if (this.data.freshing) {
- return
- }
- this.setData({
- freshing: true
- })
- this.bindCallBack()
- },
-
- onReachBottom() {
- this.fetchOrderList()
- },
-
- onShareAppMessage() {
- },
- bindCallBack() {
- this.refreshOrderList()
- },
- handleNav(e) {
- const { value } = e.detail
- this.setData({
- active: value,
- listUrl: value === '1' ? productList : shopList
- }, () => {
- this.refreshOrderList()
- })
- }
- })
|