|
@@ -160,38 +160,6 @@
|
|
|
...mapState(['hasLogin', 'userInfo'])
|
|
|
},
|
|
|
methods: {
|
|
|
-
|
|
|
- DotStyle(e) {
|
|
|
- this.dotStyle = e.detail.value
|
|
|
- },
|
|
|
- cardSwiper(e) {
|
|
|
- this.cardCur = e.detail.current
|
|
|
- },
|
|
|
- hangqing() {
|
|
|
- uni.navigateTo({
|
|
|
- url: `/pageB/news/news`
|
|
|
- })
|
|
|
- },
|
|
|
- tabSelect(e) {
|
|
|
- this.TabCur = e.currentTarget.dataset.id;
|
|
|
- this.category = this.TabCur
|
|
|
- this.pages = 1
|
|
|
- this.loadData()
|
|
|
- },
|
|
|
- //回到顶部
|
|
|
- goTop(e) { // 一键回到顶部
|
|
|
- console.log(e)
|
|
|
- if (wx.pageScrollTo) {
|
|
|
- wx.pageScrollTo({
|
|
|
- scrollTop: 0
|
|
|
- })
|
|
|
- } else {
|
|
|
- wx.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
async loadData() {
|
|
|
var that = this
|
|
|
// 新闻内容
|
|
@@ -212,139 +180,9 @@
|
|
|
that.newsInfo = data
|
|
|
uni.hideLoading()
|
|
|
})
|
|
|
-
|
|
|
- },
|
|
|
- //轮播图切换修改背景色
|
|
|
- swiperChange(e) {
|
|
|
- const index = e.detail.current;
|
|
|
- this.swiperCurrent = index;
|
|
|
- // this.titleNViewBackground = this.carouselList[index].color;
|
|
|
- },
|
|
|
- //详情
|
|
|
- navToDetailPage(item) {
|
|
|
- let id = item;
|
|
|
- uni.navigateTo({
|
|
|
- url: `/pageB/news/news_detail?id=${id}`
|
|
|
- })
|
|
|
+
|
|
|
},
|
|
|
- naviageToPage(page) {
|
|
|
- uni.navigateTo({
|
|
|
- url: page,
|
|
|
- fail() {
|
|
|
- uni.switchTab({
|
|
|
- url: page
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- getIndexSaleData() {
|
|
|
- // const that = this
|
|
|
- // var pages = that.pages
|
|
|
- // var limit = that.limit
|
|
|
- // uni.showLoading({
|
|
|
- // title: '正在加载'
|
|
|
- // })
|
|
|
- // that.$api.request('integral', 'getIndexSaleData', {
|
|
|
- // page: pages,
|
|
|
- // limit: limit
|
|
|
- // }, failres => {
|
|
|
- // that.$api.msg(failres.errmsg)
|
|
|
- // that.isLoadMore = false
|
|
|
- // that.loadStatus = 'nomore'
|
|
|
- // if (that.pages > 1) {
|
|
|
- // that.pages -= 1
|
|
|
- // }
|
|
|
- // uni.hideLoading()
|
|
|
- // }).then(res => {
|
|
|
- // let data = res.data
|
|
|
- // //销售信息
|
|
|
- // if (data.saleInfo.length > 0 ) {
|
|
|
- // that.saleInfo = that.saleInfo.concat(data.saleInfo)
|
|
|
- // that.isLoadMore = false
|
|
|
- // } else {
|
|
|
- // if (that.pages > 1) {
|
|
|
- // that.pages -= 1
|
|
|
- // }
|
|
|
- // that.isLoadMore = true
|
|
|
- // that.loadStatus = 'nomore'
|
|
|
- // }
|
|
|
- // if(data.saleInfo.length < that.limit){
|
|
|
- // if (that.pages > 1) {
|
|
|
- // that.pages -= 1
|
|
|
- // }
|
|
|
- // that.isLoadMore = true
|
|
|
- // that.loadStatus = 'nomore'
|
|
|
- // }
|
|
|
- // uni.hideLoading()
|
|
|
- // })
|
|
|
- const that = this
|
|
|
- var pages = that.pages
|
|
|
- var limit = that.limit
|
|
|
-
|
|
|
- uni.showLoading({
|
|
|
- title: '正在加载',
|
|
|
- mask: true
|
|
|
- })
|
|
|
- that.$api.request('news', 'getNewsInfo', {
|
|
|
- category: this.category,
|
|
|
- page: pages,
|
|
|
- limit: limit
|
|
|
- }, failres => {
|
|
|
- that.$api.msg(failres.errmsg)
|
|
|
- that.isLoadMore = false
|
|
|
- that.loadStatus = 'nomore'
|
|
|
- if (that.pages > 1) {
|
|
|
- that.pages -= 1
|
|
|
- }
|
|
|
- uni.hideLoading()
|
|
|
- }).then(res => {
|
|
|
- let data = res.data
|
|
|
- if (data.length > 0) {
|
|
|
- for (var k = 0; k < data.length; k++) {
|
|
|
- data[k].gmtUpdate = formatDate(Date.parse(data[k].gmtUpdate))
|
|
|
- }
|
|
|
- that.newsInfo = that.newsInfo.concat(data)
|
|
|
- that.isLoadMore = false
|
|
|
- } else {
|
|
|
- if (that.pages > 1) {
|
|
|
- that.pages -= 1
|
|
|
- }
|
|
|
- that.isLoadMore = true
|
|
|
- that.loadStatus = 'nomore'
|
|
|
- }
|
|
|
- uni.hideLoading()
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- // #ifndef MP
|
|
|
- // 标题栏input搜索框点击
|
|
|
- onNavigationBarSearchInputClicked: async function(e) {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pageA/product/search'
|
|
|
- })
|
|
|
- },
|
|
|
- //点击导航栏 buttons 时触发
|
|
|
- // onNavigationBarButtonTap(e) {
|
|
|
- // const index = e.index;
|
|
|
- // if (index === 0) {
|
|
|
- // this.$api.msg('点击了扫描');
|
|
|
- // } else if (index === 1) {
|
|
|
- // // #ifdef APP-PLUS
|
|
|
- // const pages = getCurrentPages();
|
|
|
- // const page = pages[pages.length - 1];
|
|
|
- // const currentWebview = page.$getAppWebview();
|
|
|
- // currentWebview.hideTitleNViewButtonRedDot({
|
|
|
- // index
|
|
|
- // });
|
|
|
- // // #endif
|
|
|
- // uni.navigateTo({
|
|
|
- // url: '/pages/notice/notice'
|
|
|
- // })
|
|
|
- // }
|
|
|
- // }
|
|
|
- // #endif
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
|