|
@@ -1,5 +1,6 @@
|
|
|
const pages = require('../../mixin/pages')
|
|
|
const { getProductCategoryList } = require('../../api/common')
|
|
|
+const { getLunboList } = require('./api/index')
|
|
|
let leftHeight = 0
|
|
|
let rightHeight = 0
|
|
|
let query = null
|
|
@@ -16,12 +17,7 @@ Page({
|
|
|
key_words: '',
|
|
|
category_id: ''
|
|
|
},
|
|
|
- background: ['demo-text-1', 'demo-text-2', 'demo-text-3'],
|
|
|
- txtlist: [
|
|
|
- '这是第一条公告内容',
|
|
|
- '小程序上下滚动效果总结',
|
|
|
- '这是一行上下滚动的文字,文字最好短点,超过一行省略'
|
|
|
- ],
|
|
|
+ txtlist: [],
|
|
|
headerNav: [
|
|
|
{
|
|
|
icon: 'partner@2x.png',
|
|
@@ -45,7 +41,6 @@ Page({
|
|
|
}
|
|
|
],
|
|
|
categoryList: [],
|
|
|
- list: [],
|
|
|
leftList: [],
|
|
|
rightList: []
|
|
|
},
|
|
@@ -54,6 +49,7 @@ Page({
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
async onLoad(options) {
|
|
|
+ this.fetchLunboList()
|
|
|
await this.fetchProductCategoryList()
|
|
|
this.fetchOrderList()
|
|
|
},
|
|
@@ -114,6 +110,23 @@ Page({
|
|
|
},
|
|
|
bindCallBack() {
|
|
|
this.refreshOrderList()
|
|
|
+ this.fetchLunboList()
|
|
|
+ },
|
|
|
+ async fetchLunboList() {
|
|
|
+ try {
|
|
|
+ const { status, data, msg } = await getLunboList()
|
|
|
+ if (status) {
|
|
|
+ const { lunbos } = data
|
|
|
+ this.setData({
|
|
|
+ lunbos: lunbos
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ wx.showToast({
|
|
|
+ title: msg,
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } catch (err) {}
|
|
|
},
|
|
|
async fetchProductCategoryList() {
|
|
|
try {
|
|
@@ -145,12 +158,12 @@ Page({
|
|
|
},
|
|
|
async isLeft() {
|
|
|
const {
|
|
|
- list,
|
|
|
+ listData,
|
|
|
leftList,
|
|
|
rightList
|
|
|
} = this.data
|
|
|
query = wx.createSelectorQuery()
|
|
|
- for (const item of list) {
|
|
|
+ for (const item of listData) {
|
|
|
leftHeight <= rightHeight ? leftList.push(item) : rightList.push(item)
|
|
|
await this.getBoxHeight(leftList, rightList)
|
|
|
}
|