This commit is contained in:
zdx
2020-12-31 08:43:25 +08:00
parent 775bc8d0c0
commit 550edad8a8
4 changed files with 136 additions and 116 deletions

View File

@@ -7,20 +7,24 @@ Page({
dynamic_id: '', //活动id dynamic_id: '', //活动id
info: '', //详情信息 info: '', //详情信息
loaded: false, loaded: false
company_id: wx.getStorageSync('company_id'),
}, },
onLoad(e) { onLoad(e) {
this.setData({ this.setData({
dynamic_id: e.id dynamic_id: e.id
}) })
this.dynamicsDetail(); wx.getStorage({
key: 'company_id',
success: res=>{
this.dynamicsDetail(res.data);
}
})
}, },
/** /**
* 获取详情 * 获取详情
*/ */
dynamicsDetail() { dynamicsDetail(companyId) {
wx.$api.companyModule.dynamicsDetail(this.data.company_id, this.data.dynamic_id).then(res => { wx.$api.companyModule.dynamicsDetail(companyId, this.data.dynamic_id).then(res => {
if (res.content) { if (res.content) {
var nodes = res.content.replace('<img', '<img style="max-width:100%;height:auto""'); var nodes = res.content.replace('<img', '<img style="max-width:100%;height:auto""');
} }

View File

@@ -5,10 +5,19 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
info:'' info: '',
isLogin:false
}, },
onShow() { onShow() {
wx.getStorage({
key: 'token',
success: () => {
this.setData({
isLogin:true
})
this.userInfo(); this.userInfo();
},fail:()=>{ }
})
}, },
userInfo() { userInfo() {
@@ -24,5 +33,10 @@ Page({
title: '正在完善,看看其他的吧', title: '正在完善,看看其他的吧',
icon: 'none' icon: 'none'
}) })
},
goLogin(){
wx.navigateTo({
url: '/pages/login/login',
})
} }
}) })

View File

@@ -1,3 +1,4 @@
<block wx:if='{{isLogin}}'>
<!-- 个人中心 --> <!-- 个人中心 -->
<view class="userTop"> <view class="userTop">
<view class="userTop-head"> <view class="userTop-head">
@@ -8,7 +9,8 @@
<!-- <view class="userTop-label"> <text>89</text> 钱包 </view> --> <!-- <view class="userTop-label"> <text>89</text> 钱包 </view> -->
<navigator hover-class="none" class="userTop-label" url="/pages/user/companyMine/myTeam/myTeam"> <navigator hover-class="none" class="userTop-label" url="/pages/user/companyMine/myTeam/myTeam">
<text>{{info.counter.teams || 10}}</text> 团队 </navigator> <text>{{info.counter.teams || 10}}</text> 团队 </navigator>
<navigator hover-class="none" class="userTop-label" url="/pages/user/companyMine/focusedCompany/focusedCompany"> <navigator hover-class="none" class="userTop-label"
url="/pages/user/companyMine/focusedCompany/focusedCompany">
<text>{{info.counter.subscriptions}}</text> 关注企业 </navigator> <text>{{info.counter.subscriptions}}</text> 关注企业 </navigator>
</view> </view>
<view class="userTop-vip" catchtap="showtoast"> <view class="userTop-vip" catchtap="showtoast">
@@ -62,7 +64,7 @@
<navigator hover-class="none" url="/pages/mall/mall_cart/mall_cart" class="userTool-label"> <navigator hover-class="none" url="/pages/mall/mall_cart/mall_cart" class="userTool-label">
<view class="userTool-label-img"> <view class="userTool-label-img">
<image src="/static/user_iocn/userTool_02.png"></image> <image src="/static/user_iocn/userTool_02.png"></image>
<view class="userTool-label-tips">2</view> <view wx:if='{{info.cart_counts}}' class="userTool-label-tips">{{info.cart_counts}}</view>
</view> </view>
<text>我的购物车</text> <text>我的购物车</text>
</navigator> </navigator>
@@ -86,7 +88,8 @@
</view> </view>
<text>项目关注</text> <text>项目关注</text>
</navigator> </navigator>
<navigator hover-class="none" url="/pages/user/companyMine/myBlockchain/myBlockchain" class="userTool-label"> <navigator hover-class="none" url="/pages/user/companyMine/myBlockchain/myBlockchain"
class="userTool-label">
<view class="userTool-label-img"> <view class="userTool-label-img">
<image src="/static/user_iocn/userTool_06.png"></image> <image src="/static/user_iocn/userTool_06.png"></image>
</view> </view>
@@ -107,3 +110,7 @@
</view> </view>
</view> </view>
<storeTabBar pages-url="pages/user/index"></storeTabBar> <storeTabBar pages-url="pages/user/index"></storeTabBar>
</block>
<block wx:else catchtap="goLogin">
去登陸
</block>

View File

@@ -90,12 +90,6 @@
"query": "orderid=20201229132338964625", "query": "orderid=20201229132338964625",
"scene": null "scene": null
}, },
{
"name": "pages/user/companyMine/companyOrder",
"pathName": "pages/user/companyMine/companyOrder",
"query": "orderid=20201229132338964625",
"scene": null
},
{ {
"name": "pages/user/companyMine/projectDetail/projectDetail", "name": "pages/user/companyMine/projectDetail/projectDetail",
"pathName": "pages/user/companyMine/projectDetail/projectDetail", "pathName": "pages/user/companyMine/projectDetail/projectDetail",
@@ -141,6 +135,7 @@
{ {
"name": "pages/home/index", "name": "pages/home/index",
"pathName": "pages/home/index", "pathName": "pages/home/index",
"query": "",
"scene": null "scene": null
} }
] ]