| | |
| | | screenWidth: 0, |
| | | currentIndex: 0, |
| | | category_id: '', |
| | | is_category: true, |
| | | store_open: false |
| | | }; |
| | | }, |
| | |
| | | this.restoreData(); |
| | | // 获取分类 by lyzflash |
| | | this.getCategory(); |
| | | /*获取订单列表*/ |
| | | this.getData(); |
| | | if (!this.category_id) { |
| | | /*获取订单列表*/ |
| | | this.getData(); |
| | | } |
| | | |
| | | }, |
| | | onLoad(option) { |
| | | let self = this; |
| | | self.category_id = option.category_id; |
| | | if (self.category_id) { |
| | | self.is_category = false; |
| | | } |
| | | }, |
| | | methods: { |
| | | /*初始化*/ |
| | |
| | | // 计算组件的高度 |
| | | let view = uni.createSelectorQuery().in(self).select('.top-box'); |
| | | view.boundingClientRect(data => { |
| | | console.log(data) |
| | | let h = self.phoneHeight - data.height; |
| | | self.scrollviewHigh = h; |
| | | }).exec(); |
| | |
| | | this.page = 1; |
| | | this.no_more = false; |
| | | this.loading = true; |
| | | this.category_id = 0; |
| | | if (this.is_category) { |
| | | this.category_id = 0; |
| | | } |
| | | this.searchtxt = ''; |
| | | this.sortType = ''; |
| | | this.sortPrice = 0; |
| | |
| | | /*获取分类*/ |
| | | getCategory() { |
| | | let self = this; |
| | | self._post('supplier.index/category', {category_type:20}, (res) => { |
| | | self._post('supplier.index/category', { |
| | | /* category_type: 20 */ |
| | | }, (res) => { |
| | | self.category = res.data.category; |
| | | if (self.category_id) { |
| | | self.calculateWindowWidth(); |
| | | setTimeout(function() { |
| | | self.calculateItemWidth(); |
| | | }, 100) |
| | | setTimeout(function() { |
| | | self.category.forEach(function(item, index) { |
| | | if (item.category_id == self.category_id) { |
| | | self.tabChange(index) |
| | | } |
| | | }) |
| | | }, 500); |
| | | } |
| | | }) |
| | | }, |
| | | onRefresh() { |
| | |
| | | |
| | | //跳转店铺首页 |
| | | goto_shop(shop_supplier_id) { |
| | | uni.setStorageSync('shop_supplier_id',shop_supplier_id) |
| | | uni.setStorageSync('shop_supplier_id', shop_supplier_id) |
| | | this.gotoPage('/pages/shop/shop?shop_supplier_id=' + shop_supplier_id); |
| | | }, |
| | | //跳转商品页面 |
| | |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | width: 100%; */ |
| | | display: -webkit-box; |
| | | -webkit-box-orient: vertical; |
| | | -webkit-line-clamp: 2; |
| | | overflow: hidden; |
| | | word-wrap: break-word; |
| | | display: -webkit-box; |
| | | -webkit-box-orient: vertical; |
| | | -webkit-line-clamp: 2; |
| | | overflow: hidden; |
| | | word-wrap: break-word; |
| | | } |
| | | |
| | | .address-text { |