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

View File

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

View File

@@ -1,109 +1,116 @@
<!-- 个人中心 -->
<view class="userTop">
<view class="userTop-head">
<view class="userTop-name"> {{info.user.nickname}}<text>{{info.vip.is_vip?'会员':'游客'}}</text> </view>
<image class="userTop-img" src="{{info.user.avatar}}"></image>
</view>
<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会员 享会员特权
<block wx:if='{{isLogin}}'>
<!-- 个人中心 -->
<view class="userTop">
<view class="userTop-head">
<view class="userTop-name"> {{info.user.nickname}}<text>{{info.vip.is_vip?'会员':'游客'}}</text> </view>
<image class="userTop-img" src="{{info.user.avatar}}"></image>
</view>
<view class="userTop-btn">
<image src="/static/user_iocn/user_vip.png"></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 class="userTop-btn">
<image src="/static/user_iocn/user_vip.png"></image>立即开通
</view>
</view>
</view>
</view>
<view class="userNav">
<navigator hover-class="none" url="/pages/user/user_coupon/user_coupon" class="userNav-label">
<view class="userNav-label-img">
<image src="/static/user_iocn/userNav_00.png"></image>
<view class="userNav">
<navigator hover-class="none" url="/pages/user/user_coupon/user_coupon" class="userNav-label">
<view class="userNav-label-img">
<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>
<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 class="userTool">
<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 class="userTool">
<view class="userTool-title">
更多服务
</view>
<navigator hover-class="none" url="/pages/mall/mall_address/mall_address" class="userTool-label">
<view class="userTool-label-img">
<image src="/static/user_iocn/userTool_04.png"></image>
<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 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>
<text>收货地址</text>
</navigator>
<navigator hover-class="none" url="/pages/user/companyMine/focusedProject/focusedProject"
class="userTool-label">
<view class="userTool-label-img">
<image src="/static/user_iocn/userTool_05.png"></image>
</view>
<text>项目关注</text>
</navigator>
<navigator hover-class="none" url="/pages/user/companyMine/myBlockchain/myBlockchain" class="userTool-label">
<view class="userTool-label-img">
<image src="/static/user_iocn/userTool_06.png"></image>
</view>
<text>区块链证书</text>
</navigator>
<navigator class="userTool-label" hover-class="none" open-type="reLaunch" url="/pages/company/index">
<view class="userTool-label-img">
<image src="/static/user_iocn/userTool_08.png"></image>
</view>
<text>企获客广场</text>
</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>
<navigator hover-class="none" url="/pages/mall/mall_address/mall_address" class="userTool-label">
<view class="userTool-label-img">
<image src="/static/user_iocn/userTool_04.png"></image>
</view>
<text>收货地址</text>
</navigator>
<navigator hover-class="none" url="/pages/user/companyMine/focusedProject/focusedProject"
class="userTool-label">
<view class="userTool-label-img">
<image src="/static/user_iocn/userTool_05.png"></image>
</view>
<text>项目关注</text>
</navigator>
<navigator hover-class="none" url="/pages/user/companyMine/myBlockchain/myBlockchain"
class="userTool-label">
<view class="userTool-label-img">
<image src="/static/user_iocn/userTool_06.png"></image>
</view>
<text>区块链证书</text>
</navigator>
<navigator class="userTool-label" hover-class="none" open-type="reLaunch" url="/pages/company/index">
<view class="userTool-label-img">
<image src="/static/user_iocn/userTool_08.png"></image>
</view>
<text>企获客广场</text>
</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>
<storeTabBar pages-url="pages/user/index"></storeTabBar>
<storeTabBar pages-url="pages/user/index"></storeTabBar>
</block>
<block wx:else catchtap="goLogin">
去登陸
</block>