Commit eb8d0e9b authored by liwei's avatar liwei

发布动态增加了完善个人资料的条件

parent ac8f281c
...@@ -39,12 +39,29 @@ ...@@ -39,12 +39,29 @@
</swiper-item> </swiper-item>
</swiper> </swiper>
<login @change="getToLogin" :isLoginPop="isLoginPop" class="my-select"></login> <login @change="getToLogin" :isLoginPop="isLoginPop" class="my-select"></login>
<!-- 完善个人信息弹窗-->
<u-popup u-popup :show="tipsShow" mode="center" round="12" :safeAreaInsetBottom="false">
<view class="popup-container">
<image class="pop-bgc" :src="baseUrl+'/common/home-pop-bg.png'"></image>
<view class="div-popo">
<view class="pop-title">温馨提示</view>
<view class="tips-content">
完善个人资料后,才可以进行发布
</view>
<view class="btn-c">
<view class="pop-btn agree" @click="handAgree">前往完善</view>
<view class="pop-btn" @click="handleNoAgree">暂不完善</view>
</view>
</view>
</view>
</u-popup>
</z-paging-swiper> </z-paging-swiper>
</template> </template>
<script> <script>
import ListVue from '../components/article/List.vue'; import ListVue from '../components/article/List.vue';
import login from '../../components/login/login.vue'; import login from '../../components/login/login.vue';
import {userDetail} from "../../api/user";
export default { export default {
options: { options: {
styleIsolation: 'shared' styleIsolation: 'shared'
...@@ -55,6 +72,8 @@ ...@@ -55,6 +72,8 @@
}, },
data() { data() {
return { return {
//完善个人资料提示弹窗
tipsShow:false,
//图片路径 //图片路径
baseUrl: this.$IMG_URL, baseUrl: this.$IMG_URL,
//tab标签 //tab标签
...@@ -101,16 +120,48 @@ ...@@ -101,16 +120,48 @@
}, },
//发布动态按钮 //发布动态按钮
publishArticle(path) { publishArticle(path) {
if (uni.getStorageSync('userInfo') != '') { const token = uni.getStorageSync('token')
//已登录 const userInfo = uni.getStorageSync('userInfo')
uni.navigateTo({ if (token != '') {
url: '/pagesArticle/publishArticle' //已登录 判断授权
}) if (userInfo && userInfo.wxNickName !== '' && userInfo.wxNickName != null) {
//已授权过
//判断是否完善个人资料 完善之后才可发布动态
userDetail(userInfo.memberId).then(res=>{
const memInfo = res.data.data
if (memInfo.memNickName != null && memInfo.memNickName != '' && memInfo.memBirthday != null && memInfo.memMaxEducation != null
&& memInfo.memCareer != '' && memInfo.memCareer != null && memInfo.memResidenceProvince != null && memInfo.memResidenceCity != null){
//已完善个人资料 可以发布动态
uni.navigateTo({
url: '/pagesArticle/publishArticle'
})
}else {
//没完善个人资料 需要去完善
this.tipsShow = true
}
})
} else {
//没授权过,需要授权
uni.switchTab({
url: '/pages/tab/index'
});
}
} else { } else {
//未登录 //未登录
this.isLoginPop = true this.isLoginPop = true
} }
}, },
//完善个人信息 确认按钮
handAgree(){
this.tipsShow = false
uni.navigateTo({
url: '/pagesme/me/updateBasicInformation'
})
},
//完善个人信息 取消按钮
handleNoAgree(){
this.tipsShow = false
},
goMessage() { goMessage() {
}, },
...@@ -189,4 +240,67 @@ ...@@ -189,4 +240,67 @@
::v-deep .u-badge { ::v-deep .u-badge {
font-weight: 600; font-weight: 600;
} }
.popup-container {
height: 500rpx;
width: 544rpx;
overflow: hidden;
.div-popo {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
.pop-title {
color: rgba(45, 49, 50, 0.8);
font-size: 40rpx;
font-family: 'PingFang SC-Heavy, PingFang SC';
display: flex;
justify-content: center;
margin-top: 50rpx;
}
.tips-content {
width: 448rpx;
margin: auto;
text-align: left;
margin-top: 50rpx;
line-height: 56rpx;
color: #666;
font-size: 28rpx;
font-family: 'PingFang SC-Regular, PingFang SC';
.agreement-btn {
display: inline-block;
color: #5b83e8;
font-family: 'PingFang SC-Bold, PingFang SC';
text-decoration: underline;
}
}
.btn-c {
display: flex;
margin: auto;
margin-top: 64rpx;
justify-content: space-between;
width: 428rpx;
}
}
.pop-btn {
width: 204rpx;
height: 76rpx;
border-radius: 38rpx;
text-align: center;
line-height: 76rpx;
border: 2rpx solid #446cd2;
color: #5b83e8;
font-family: 'PingFang SC-Regular, PingFang SC';
&.agree {
border: none;
background: linear-gradient(86deg, #c2d2f9 0%, #c5c2f3 100%);
}
}
}
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment