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,24 +5,38 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
info:'' info: '',
isLogin:false
}, },
onShow() { onShow() {
this.userInfo(); wx.getStorage({
key: 'token',
success: () => {
this.setData({
isLogin:true
})
this.userInfo();
},fail:()=>{ }
})
}, },
userInfo() { userInfo() {
wx.$api.user.userInfo().then(res => { wx.$api.user.userInfo().then(res => {
console.log(res); console.log(res);
this.setData({ this.setData({
info:res info: res
}) })
}) })
}, },
showtoast() { showtoast() {
wx.showToast({ wx.showToast({
title: '正在完善,看看其他的吧', title: '正在完善,看看其他的吧',
icon: 'none' icon: 'none'
}) })
} },
goLogin(){
wx.navigateTo({
url: '/pages/login/login',
})
}
}) })

View File

@@ -1,109 +1,116 @@
<!-- 个人中心 --> <block wx:if='{{isLogin}}'>
<view class="userTop"> <!-- 个人中心 -->
<view class="userTop-head"> <view class="userTop">
<view class="userTop-name"> {{info.user.nickname}}<text>{{info.vip.is_vip?'会员':'游客'}}</text> </view> <view class="userTop-head">
<image class="userTop-img" src="{{info.user.avatar}}"></image> <view class="userTop-name"> {{info.user.nickname}}<text>{{info.vip.is_vip?'会员':'游客'}}</text> </view>
</view> <image class="userTop-img" src="{{info.user.avatar}}"></image>
<view class="userTop-nav">
<!-- <view class="userTop-label"> <text>89</text> 钱包 </view> -->
<navigator hover-class="none" class="userTop-label" url="/pages/user/companyMine/myTeam/myTeam">
<text>{{info.counter.teams || 10}}</text> 团队 </navigator>
<navigator hover-class="none" class="userTop-label" url="/pages/user/companyMine/focusedCompany/focusedCompany">
<text>{{info.counter.subscriptions}}</text> 关注企业 </navigator>
</view>
<view class="userTop-vip" catchtap="showtoast">
<view class="userTop-text">
<image src="/static/user_iocn/user_crown.png"></image>升级VIP会员 享会员特权
</view> </view>
<view class="userTop-btn"> <view class="userTop-nav">
<image src="/static/user_iocn/user_vip.png"></image>立即开通 <!-- <view class="userTop-label"> <text>89</text> 钱包 </view> -->
<navigator hover-class="none" class="userTop-label" url="/pages/user/companyMine/myTeam/myTeam">
<text>{{info.counter.teams || 10}}</text> 团队 </navigator>
<navigator hover-class="none" class="userTop-label"
url="/pages/user/companyMine/focusedCompany/focusedCompany">
<text>{{info.counter.subscriptions}}</text> 关注企业 </navigator>
</view>
<view class="userTop-vip" catchtap="showtoast">
<view class="userTop-text">
<image src="/static/user_iocn/user_crown.png"></image>升级VIP会员 享会员特权
</view>
<view class="userTop-btn">
<image src="/static/user_iocn/user_vip.png"></image>立即开通
</view>
</view> </view>
</view> </view>
</view>
<view class="userNav"> <view class="userNav">
<navigator hover-class="none" url="/pages/user/user_coupon/user_coupon" class="userNav-label"> <navigator hover-class="none" url="/pages/user/user_coupon/user_coupon" class="userNav-label">
<view class="userNav-label-img"> <view class="userNav-label-img">
<image src="/static/user_iocn/userNav_00.png"></image> <image src="/static/user_iocn/userNav_00.png"></image>
</view>
<text>我的卡券</text>
</navigator>
<navigator hover-class="none" url="/pages/mall/mall_order/mall_order" class="userNav-label">
<view class="userNav-label-img">
<image src="/static/user_iocn/userNav_01.png"></image>
</view>
<text>我的订单</text>
</navigator>
<view class="userNav-label" catchtap="showtoast">
<view class="userNav-label-img">
<image src="/static/user_iocn/userNav_02.png"></image>
</view>
<text>分享海报</text>
</view> </view>
<text>我的卡券</text>
</navigator>
<navigator hover-class="none" url="/pages/mall/mall_order/mall_order" class="userNav-label">
<view class="userNav-label-img">
<image src="/static/user_iocn/userNav_01.png"></image>
</view>
<text>我的订单</text>
</navigator>
<view class="userNav-label" catchtap="showtoast">
<view class="userNav-label-img">
<image src="/static/user_iocn/userNav_02.png"></image>
</view>
<text>分享海报</text>
</view> </view>
</view>
<view class="userTool"> <view class="userTool">
<view class="userTool-title"> <view class="userTool-title">
更多服务 更多服务
</view>
<view class="userTool-list">
<navigator hover-class="none" url="/pages/user/companyMine/myActives/myActives" class="userTool-label">
<view class="userTool-label-img">
<image src="/static/user_iocn/userTool_00.png"></image>
</view>
<text>活动参与</text>
</navigator>
<navigator hover-class="none" url="/pages/user/companyMine/companyOrder" class="userTool-label">
<view class="userTool-label-img">
<image src="/static/user_iocn/userTool_01.png"></image>
</view>
<text>项目预购</text>
</navigator>
<navigator hover-class="none" url="/pages/mall/mall_cart/mall_cart" class="userTool-label">
<view class="userTool-label-img">
<image src="/static/user_iocn/userTool_02.png"></image>
<view class="userTool-label-tips">2</view>
</view>
<text>我的购物车</text>
</navigator>
<view class="userTool-label">
<button class="userTool-label-img-button" size="mini" open-type="contact" bindcontact="handleContact"
style='border:0;background-color:#fff;width:94rpx;height:94rpx;padding:0;margin:0;margin-bottom:10rpx;'>
<image src="/static/user_iocn/userTool_03.png"></image>
</button>
<view>客服服务</view>
</view> </view>
<navigator hover-class="none" url="/pages/mall/mall_address/mall_address" class="userTool-label"> <view class="userTool-list">
<view class="userTool-label-img"> <navigator hover-class="none" url="/pages/user/companyMine/myActives/myActives" class="userTool-label">
<image src="/static/user_iocn/userTool_04.png"></image> <view class="userTool-label-img">
<image src="/static/user_iocn/userTool_00.png"></image>
</view>
<text>活动参与</text>
</navigator>
<navigator hover-class="none" url="/pages/user/companyMine/companyOrder" class="userTool-label">
<view class="userTool-label-img">
<image src="/static/user_iocn/userTool_01.png"></image>
</view>
<text>项目预购</text>
</navigator>
<navigator hover-class="none" url="/pages/mall/mall_cart/mall_cart" class="userTool-label">
<view class="userTool-label-img">
<image src="/static/user_iocn/userTool_02.png"></image>
<view wx:if='{{info.cart_counts}}' class="userTool-label-tips">{{info.cart_counts}}</view>
</view>
<text>我的购物车</text>
</navigator>
<view class="userTool-label">
<button class="userTool-label-img-button" size="mini" open-type="contact" bindcontact="handleContact"
style='border:0;background-color:#fff;width:94rpx;height:94rpx;padding:0;margin:0;margin-bottom:10rpx;'>
<image src="/static/user_iocn/userTool_03.png"></image>
</button>
<view>客服服务</view>
</view> </view>
<text>收货地址</text> <navigator hover-class="none" url="/pages/mall/mall_address/mall_address" class="userTool-label">
</navigator> <view class="userTool-label-img">
<navigator hover-class="none" url="/pages/user/companyMine/focusedProject/focusedProject" <image src="/static/user_iocn/userTool_04.png"></image>
class="userTool-label"> </view>
<view class="userTool-label-img"> <text>收货地址</text>
<image src="/static/user_iocn/userTool_05.png"></image> </navigator>
</view> <navigator hover-class="none" url="/pages/user/companyMine/focusedProject/focusedProject"
<text>项目关注</text> class="userTool-label">
</navigator> <view class="userTool-label-img">
<navigator hover-class="none" url="/pages/user/companyMine/myBlockchain/myBlockchain" class="userTool-label"> <image src="/static/user_iocn/userTool_05.png"></image>
<view class="userTool-label-img"> </view>
<image src="/static/user_iocn/userTool_06.png"></image> <text>项目关注</text>
</view> </navigator>
<text>区块链证书</text> <navigator hover-class="none" url="/pages/user/companyMine/myBlockchain/myBlockchain"
</navigator> class="userTool-label">
<navigator class="userTool-label" hover-class="none" open-type="reLaunch" url="/pages/company/index"> <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_08.png"></image> </view>
</view> <text>区块链证书</text>
<text>企获客广场</text> </navigator>
</navigator> <navigator class="userTool-label" hover-class="none" open-type="reLaunch" url="/pages/company/index">
<navigator hover-class="none" url="/pages/user/setting/setting" class="userTool-label"> <view class="userTool-label-img">
<view class="userTool-label-img"> <image src="/static/user_iocn/userTool_08.png"></image>
<image src="/static/user_iocn/userTool_07.png"></image> </view>
</view> <text>企获客广场</text>
<text>设置</text> </navigator>
</navigator> <navigator hover-class="none" url="/pages/user/setting/setting" class="userTool-label">
<view class="userTool-label-img">
<image src="/static/user_iocn/userTool_07.png"></image>
</view>
<text>设置</text>
</navigator>
</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
} }
] ]