|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<view class="start-index">
|
|
<view class="start-index">
|
|
- <view v-if="tabberPageLoadFlag[0]" :style="{display: currentIndex === 0 ? '' : 'none'}">
|
|
|
|
|
|
+ <view v-if="tabberPageLoadFlag[1]" :style="{display: currentIndex === 1 ? '' : 'none'}">
|
|
<tn-nav-bar customBack>
|
|
<tn-nav-bar customBack>
|
|
<view slot="back" class='tn-custom-nav-bar__back' @click="reFetchData()">
|
|
<view slot="back" class='tn-custom-nav-bar__back' @click="reFetchData()">
|
|
<text v-if="!loading" class="tn-icon-circle-arrow" style="font-size: 30px;"></text>
|
|
<text v-if="!loading" class="tn-icon-circle-arrow" style="font-size: 30px;"></text>
|
|
@@ -22,7 +22,7 @@
|
|
|
|
|
|
</scroll-view>
|
|
</scroll-view>
|
|
</view>
|
|
</view>
|
|
- <view v-if="tabberPageLoadFlag[1]" :style="{display: currentIndex === 1 ? '' : 'none'}">
|
|
|
|
|
|
+ <view v-if="tabberPageLoadFlag[2]" :style="{display: currentIndex === 2 ? '' : 'none'}">
|
|
<tn-nav-bar customBack>
|
|
<tn-nav-bar customBack>
|
|
<view slot="back" class='tn-custom-nav-bar__back' @click="reFetchData()">
|
|
<view slot="back" class='tn-custom-nav-bar__back' @click="reFetchData()">
|
|
<text v-if="!loading" class="tn-icon-circle-arrow" style="font-size: 30px;"></text>
|
|
<text v-if="!loading" class="tn-icon-circle-arrow" style="font-size: 30px;"></text>
|
|
@@ -43,16 +43,11 @@
|
|
<Comm ref="comm"></Comm>
|
|
<Comm ref="comm"></Comm>
|
|
</scroll-view>
|
|
</scroll-view>
|
|
</view>
|
|
</view>
|
|
- <view v-if="tabberPageLoadFlag[2]" :style="{display: currentIndex === 2 ? '' : 'none'}">
|
|
|
|
|
|
+ <view v-if="tabberPageLoadFlag[0]" :style="{display: currentIndex === 0 ? '' : 'none'}">
|
|
<scroll-view class="custom-tabbar-page" scroll-y enable-back-to-top @scrolltolower="tabbarPageScrollLower">
|
|
<scroll-view class="custom-tabbar-page" scroll-y enable-back-to-top @scrolltolower="tabbarPageScrollLower">
|
|
<Discovery ref="discovery"></Discovery>
|
|
<Discovery ref="discovery"></Discovery>
|
|
</scroll-view>
|
|
</scroll-view>
|
|
</view>
|
|
</view>
|
|
- <!-- <view v-if="tabberPageLoadFlag[3]" :style="{display: currentIndex === 3 ? '' : 'none'}">
|
|
|
|
- <scroll-view class="custom-tabbar-page" scroll-y enable-back-to-top @scrolltolower="tabbarPageScrollLower">
|
|
|
|
- <Message ref="message"></Message>
|
|
|
|
- </scroll-view>
|
|
|
|
- </view> -->
|
|
|
|
<view v-if="tabberPageLoadFlag[3]" :style="{display: currentIndex === 3 ? '' : 'none'}">
|
|
<view v-if="tabberPageLoadFlag[3]" :style="{display: currentIndex === 3 ? '' : 'none'}">
|
|
<scroll-view class="custom-tabbar-page" scroll-y enable-back-to-top @scrolltolower="tabbarPageScrollLower">
|
|
<scroll-view class="custom-tabbar-page" scroll-y enable-back-to-top @scrolltolower="tabbarPageScrollLower">
|
|
<Mine ref="mine"></Mine>
|
|
<Mine ref="mine"></Mine>
|
|
@@ -86,7 +81,14 @@
|
|
triggered: false,
|
|
triggered: false,
|
|
_freshing: false,
|
|
_freshing: false,
|
|
// 底部tabbar菜单数据
|
|
// 底部tabbar菜单数据
|
|
- tabbarList: [{
|
|
|
|
|
|
+ tabbarList: [
|
|
|
|
+ {
|
|
|
|
+ title: '供需发布平台',
|
|
|
|
+ activeIcon: 'add-fill',
|
|
|
|
+ inactiveIcon: 'add-circle',
|
|
|
|
+ // count: 12
|
|
|
|
+ },
|
|
|
|
+ {
|
|
title: '我要什么',
|
|
title: '我要什么',
|
|
activeIcon: 'trust-fill',
|
|
activeIcon: 'trust-fill',
|
|
inactiveIcon: 'trust'
|
|
inactiveIcon: 'trust'
|
|
@@ -96,21 +98,6 @@
|
|
activeIcon: 'team-fill',
|
|
activeIcon: 'team-fill',
|
|
inactiveIcon: 'team'
|
|
inactiveIcon: 'team'
|
|
},
|
|
},
|
|
- // {
|
|
|
|
- // title: '发现',
|
|
|
|
- // activeIcon: 'rocket',
|
|
|
|
- // inactiveIcon: 'cube',
|
|
|
|
- // activeIconColor: '#FFFFFF',
|
|
|
|
- // inactiveIconColor: '#FFFFFF',
|
|
|
|
- // iconSize: 50,
|
|
|
|
- // out: true
|
|
|
|
- // },
|
|
|
|
- {
|
|
|
|
- title: '供需发布平台',
|
|
|
|
- activeIcon: 'add-fill',
|
|
|
|
- inactiveIcon: 'add-circle',
|
|
|
|
- // count: 12
|
|
|
|
- },
|
|
|
|
{
|
|
{
|
|
title: '我的',
|
|
title: '我的',
|
|
activeIcon: 'my-fill',
|
|
activeIcon: 'my-fill',
|
|
@@ -134,17 +121,6 @@
|
|
this.switchTabbar(index);
|
|
this.switchTabbar(index);
|
|
let that = this;
|
|
let that = this;
|
|
uni.hideShareMenu();
|
|
uni.hideShareMenu();
|
|
- // uni.login({
|
|
|
|
- // success(res) {
|
|
|
|
- // console.error(res);
|
|
|
|
- // that.loginByCode(res.code);
|
|
|
|
- // },
|
|
|
|
- // fail(res) {
|
|
|
|
- // console.error(res);
|
|
|
|
- // uni.hideLoading();
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
-
|
|
|
|
},
|
|
},
|
|
onShow(options){
|
|
onShow(options){
|
|
if (this.currentIndex === 3&&this.$refs.mine) {
|
|
if (this.currentIndex === 3&&this.$refs.mine) {
|
|
@@ -167,6 +143,22 @@
|
|
}else{
|
|
}else{
|
|
uni.setStorageSync('lastTime',new Date().getTime())
|
|
uni.setStorageSync('lastTime',new Date().getTime())
|
|
}
|
|
}
|
|
|
|
+ if(uni.getStorageSync('version')!='2.0.6'){
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: '更新提示',
|
|
|
|
+ content: '新版本已经准备好,是否重启应用?\r\n 更新内容:优化首页',
|
|
|
|
+ success: (res) => {
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ uni.setStorageSync('version','2.0.6');
|
|
|
|
+ uni.reLaunch({
|
|
|
|
+ url:'/pages/index/index'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
if (wx.canIUse('getUpdateManager')) {
|
|
if (wx.canIUse('getUpdateManager')) {
|
|
const updateManager = wx.getUpdateManager();
|
|
const updateManager = wx.getUpdateManager();
|
|
@@ -205,81 +197,14 @@
|
|
// 切换导航
|
|
// 切换导航
|
|
switchTabbar(index) {
|
|
switchTabbar(index) {
|
|
this._switchTabbarPage(index)
|
|
this._switchTabbarPage(index)
|
|
- if (index !== 1) {
|
|
|
|
- this.$refs?.commRef?.stopAllVideo()
|
|
|
|
- }
|
|
|
|
},
|
|
},
|
|
- //获取openId,unionid
|
|
|
|
- getOpenId(code) {
|
|
|
|
- const that = this;
|
|
|
|
- request.post('/wxma/code2Session',{
|
|
|
|
- code: code,
|
|
|
|
- platType: "slb",
|
|
|
|
- mpType: "engineer",
|
|
|
|
- }).then(res=>{
|
|
|
|
- console.error(res);
|
|
|
|
- if(res.success){
|
|
|
|
- //登录成功
|
|
|
|
- uni.setStorageSync('userMap', JSON.stringify(res.resultMap));
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- loginByCode(frontId) {
|
|
|
|
- const that = this;
|
|
|
|
- uni.setStorageSync('loginStatus', 'false');
|
|
|
|
- wx.getUserInfo({
|
|
|
|
- success: function(res) {
|
|
|
|
- console.error(res);
|
|
|
|
- request.post("/slbMpAutoLogin", {
|
|
|
|
- code:frontId,
|
|
|
|
- appType:'ma',
|
|
|
|
- encryptedData:res.encryptedData,
|
|
|
|
- iv: res.iv
|
|
|
|
- }, {
|
|
|
|
- login: false,
|
|
|
|
- warn:false,
|
|
|
|
- loading:false
|
|
|
|
- }).then(res2=>{
|
|
|
|
- console.error(res2);
|
|
|
|
- if(res2.success){
|
|
|
|
- //登录成功
|
|
|
|
- uni.setStorageSync('loginStatus', 'true');
|
|
|
|
- uni.setStorageSync('userMap', JSON.stringify(res2.resultMap));
|
|
|
|
- uni.setStorageSync('userNo', res2.resultMap.accountName);
|
|
|
|
- }else{
|
|
|
|
- console.error(12345);
|
|
|
|
- uni.setStorageSync('loginStatus', 'false');
|
|
|
|
-
|
|
|
|
- //登录失败,
|
|
|
|
- uni.login({
|
|
|
|
- success(res) {
|
|
|
|
- console.error(res);
|
|
|
|
- that.getOpenId(res.code);
|
|
|
|
- },
|
|
|
|
- fail(res) {
|
|
|
|
- console.error(res);
|
|
|
|
- uni.hideLoading();
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- console.error(res2);
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
// 瀑布流导航页面滚动到底部
|
|
// 瀑布流导航页面滚动到底部
|
|
tabbarPageScrollLower(e) {
|
|
tabbarPageScrollLower(e) {
|
|
- if (this.currentIndex === 0) {
|
|
|
|
- this.$refs.home.loadMore();
|
|
|
|
- }
|
|
|
|
if (this.currentIndex === 1) {
|
|
if (this.currentIndex === 1) {
|
|
- this.$refs.comm.loadMore();
|
|
|
|
|
|
+ this.$refs.home.loadMore();
|
|
}
|
|
}
|
|
if (this.currentIndex === 2) {
|
|
if (this.currentIndex === 2) {
|
|
-
|
|
|
|
|
|
+ this.$refs.comm.loadMore();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onPulling(e) {
|
|
onPulling(e) {
|
|
@@ -292,12 +217,10 @@
|
|
onRefresh(){
|
|
onRefresh(){
|
|
if (this._freshing) return;
|
|
if (this._freshing) return;
|
|
this._freshing = true;
|
|
this._freshing = true;
|
|
- if (this.currentIndex === 0) {
|
|
|
|
- console.error('this');
|
|
|
|
|
|
+ if (this.currentIndex === 1) {
|
|
this.$refs.home.reFetchData();
|
|
this.$refs.home.reFetchData();
|
|
}
|
|
}
|
|
- if (this.currentIndex === 1) {
|
|
|
|
- console.error('this');
|
|
|
|
|
|
+ if (this.currentIndex === 2) {
|
|
this.$refs.comm.reFetchData();
|
|
this.$refs.comm.reFetchData();
|
|
}
|
|
}
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
@@ -307,7 +230,6 @@
|
|
},
|
|
},
|
|
onRestore() {
|
|
onRestore() {
|
|
this.triggered = false; // 需要重置
|
|
this.triggered = false; // 需要重置
|
|
- console.error("onRestore");
|
|
|
|
},
|
|
},
|
|
|
|
|
|
addButton() {
|
|
addButton() {
|
|
@@ -330,17 +252,14 @@
|
|
//已登录,去新增第一步
|
|
//已登录,去新增第一步
|
|
},
|
|
},
|
|
reFetchData() {
|
|
reFetchData() {
|
|
-
|
|
|
|
- if (this.currentIndex === 0) {
|
|
|
|
- console.error('this');
|
|
|
|
- this.$refs.home.reFetchData();
|
|
|
|
- }
|
|
|
|
- if (this.currentIndex === 1) {
|
|
|
|
- console.error('this');
|
|
|
|
- this.$refs.comm.reFetchData();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ if (this.currentIndex === 1) {
|
|
|
|
+ console.error('this');
|
|
|
|
+ this.$refs.home.reFetchData();
|
|
|
|
+ }
|
|
|
|
+ if (this.currentIndex === 2) {
|
|
|
|
+ console.error('this');
|
|
|
|
+ this.$refs.comm.reFetchData();
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
// 切换导航页面
|
|
// 切换导航页面
|
|
@@ -353,7 +272,7 @@
|
|
this.tabberPageLoadFlag[index] = true
|
|
this.tabberPageLoadFlag[index] = true
|
|
}
|
|
}
|
|
this.currentIndex = index
|
|
this.currentIndex = index
|
|
- if (this.currentIndex === 2&&this.$refs.discovery) {
|
|
|
|
|
|
+ if (this.currentIndex === 0&&this.$refs.discovery) {
|
|
this.$refs.discovery.fetchData();
|
|
this.$refs.discovery.fetchData();
|
|
}
|
|
}
|
|
if (this.currentIndex === 3&&this.$refs.mine) {
|
|
if (this.currentIndex === 3&&this.$refs.mine) {
|
|
@@ -457,10 +376,10 @@
|
|
},
|
|
},
|
|
onShareAppMessage: function(option) {
|
|
onShareAppMessage: function(option) {
|
|
if(option.from=="button"){
|
|
if(option.from=="button"){
|
|
- if (this.currentIndex === 0) {
|
|
|
|
|
|
+ if (this.currentIndex === 1) {
|
|
this.$refs.home.hideSheet();
|
|
this.$refs.home.hideSheet();
|
|
}
|
|
}
|
|
- if (this.currentIndex === 1) {
|
|
|
|
|
|
+ if (this.currentIndex === 2) {
|
|
this.$refs.comm.hideSheet();
|
|
this.$refs.comm.hideSheet();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -499,23 +418,7 @@
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- onShareAppMessage0: function(option) {
|
|
|
|
- if(option.from=="button"){
|
|
|
|
- if (this.currentIndex === 0) {
|
|
|
|
- this.$refs.home.hideSheet();
|
|
|
|
- }
|
|
|
|
- if (this.currentIndex === 1) {
|
|
|
|
- this.$refs.comm.hideSheet();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return {
|
|
|
|
- title: '速立保',
|
|
|
|
- path: '/pages/index/index',
|
|
|
|
- };
|
|
|
|
- },
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|