Commit ec779add authored by liwei's avatar liwei

修改了实名认证校验,根据数据字典判断

parent d067abd3
......@@ -19,6 +19,7 @@
</view>
<empty v-if="firstLoaded && !dataList.length"/>
</z-paging>
<ELM ref="elm" :msg="tipMsg" :isConfirm="isConfirm" confirmName="认证" @confirm="confirm"></ELM>
</view>
</template>
......@@ -30,11 +31,14 @@
import {getCity, getValue} from "../../../common/options";
import {calculateAge, parseDate} from "../../../common";
import {isStopAccount, userDetail} from "../../../api/user";
import {message} from "../../../common/message";
import ELM from '@/components/elm-toast/index.vue';
export default {
name:'ArticleList',
components: {
ItemVue,
empty
empty,
ELM
},
data() {
return {
......@@ -54,6 +58,8 @@
isCurrentPage: false,
//动态类型 0:关注
articleType: '',
// 弹窗信息
tipMsg:'',
}
},
props: {
......@@ -71,6 +77,13 @@
return 0
}
},
// 是否需要实名 1:需要 0:不需要
realAuthFlag:{
type: String,
default: function() {
return '1'
}
}
},
watch: {
currentIndex: {
......@@ -235,76 +248,18 @@
})
this.$refs.paging.completeByTotal(list,res.data.total);
})
// 组件加载时会自动触发此方法,因此默认页面加载时会自动触发,无需手动调用
// 这里的pageNo和pageSize会自动计算好,直接传给服务器即可
// 模拟请求服务器获取分页数据,请替换成自己的网络请求
// const params = {
// pageIndex: pageNo,
// pageSize: pageSize,
// type: this.tabIndex
// }
// if (this.tabIndex == 0) {
// params.tabType = "FOLLOW"
// } else if (this.tabIndex == 1) {
// params.tabType = "RECOMMEND"
// } else {
// params.tabType = "CITY"
// }
// this.$myRequest({
// url: `/nostalgia/article/page`,
// data: params,
// withToken: true,
// method: 'GET',
// }).then(res => {
// if (res.data.code == 200) {
// let arr = res.data.data.rows.map(item => {
// return {
// ...item,
// isDel: item.userId == this.userInfo != null ? this.userInfo.id : 0
// }
// })
// this.$refs.paging.complete(arr);
// setTimeout(() => {
// this.firstLoaded = true;
// }, 100)
// } else if (res.data.code == 10006) {
// let rows = [];
// let arr = rows.map(item => {
// return {
// ...item,
// isDel: item.userId == this.userInfo != null ? this.userInfo.id : 0
// }
// })
// this.$refs.paging.complete(arr);
// setTimeout(() => {
// this.firstLoaded = true;
// }, 100)
//
// } else {
// let rows = [];
// let arr = rows.map(item => {
// return {
// ...item,
// isDel: item.userId == this.userInfo != null ? this.userInfo.id : 0
// }
// })
// this.$refs.paging.complete(arr);
// setTimeout(() => {
// this.firstLoaded = true;
// }, 100)
// console.log("请求失败")
// }
// }).catch(res => {
// // 如果请求失败写this.$refs.paging.complete(false);
// // 注意,每次都需要在catch中写这句话很麻烦,z-paging提供了方案可以全局统一处理
// // 在底层的网络请求抛出异常时,写uni.$emit('z-paging-error-emit');即可
// console.log("请求接口失败了")
// this.$refs.paging.complete(false);
// })
},
// 点赞
praise(item) {
// 判断是否已实名 this.realAuthFlag=1需要判断是否已实名 否则不校验
if (this.realAuthFlag === '1'){
if (uni.getStorageSync('userInfo').memRealAuthen !== '1'){
this.tipMsg = message.authenticationMsg;
this.isConfirm = true;
this.$refs.elm.showDialog();
return
}
}
var type = ''
if (item.isLike == '0') {
//取消点赞
......@@ -323,6 +278,12 @@
let idx = this.dataList.findIndex(obj => obj.businessId == item.businessId)
this.dataList.splice(idx, 1, item)
})
},
confirm() {
this.isConfirm = false;
uni.navigateTo({
url: "/pagesme/me/doubleauth"
})
}
}
}
......
......@@ -35,7 +35,7 @@
<!-- swiper必须设置height:100%,因为swiper有默认的高度,只有设置高度100%才可以铺满页面 -->
<swiper class="swiper" :current="current" @animationfinish="swiperAnimationfinish">
<swiper-item class="swiper-item" v-for="(i,index) in list" :key="index">
<ListVue ref="listItem" :tabIndex="index" :currentIndex="current" @topicId="handleTopicId"/>
<ListVue ref="listItem" :tabIndex="index" :currentIndex="current" :realAuthFlag="realAuthFlag" @topicId="handleTopicId"/>
</swiper-item>
</swiper>
<!-- 完善个人信息弹窗-->
......@@ -64,6 +64,7 @@
import {isStopAccount, userDetail} from "../../api/user";
import ELM from '@/components/elm-toast/index.vue';
import {message} from "../../common/message";
import {getDict} from "../../api/system/dict/data";
export default {
options: {
styleIsolation: 'shared'
......@@ -98,6 +99,8 @@
topicId: null,
tipMsg: '',
isConfirm: false,
// 是否需要实名 1:需要 0:不需要
realAuthFlag: '1'
};
},
onShow() {
......@@ -106,8 +109,15 @@
this.$refs.listItem[this.current].reload()
uni.setStorageSync("isRefresh", false)
}
this.getRealAuthDict()
},
methods: {
//获取实名字典配置
getRealAuthDict(){
getDict('sys_config').then(res=> {
this.realAuthFlag = res.data.data.find(item => item.dictLabel === 'is_need_realAuth').dictValue;
})
},
//接收子组件传过来的话题id 为了进行发表动态使用
handleTopicId(value){
this.topicId = value
......@@ -144,17 +154,20 @@
//已登录 判断授权
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){
// 判断是否已实名 this.realAuthFlag=1需要判断是否已实名 否则不校验
if (this.realAuthFlag === '1'){
if (uni.getStorageSync('userInfo').memRealAuthen != '1'){
this.tipMsg = message.authenticationMsg;
this.isConfirm = true;
this.$refs.elm.showDialog();
return
}
}
//判断是否完善个人资料 完善之后才可发布动态
userDetail(userInfo.memberId).then(res=>{
const memInfo = res.data.data
if (memInfo.memNickName != null && memInfo.memNickName != '' && memInfo.memMaxEducation != null
&& memInfo.memCareer != '' && memInfo.memCareer != null && memInfo.memResidenceProvince != null && memInfo.memResidenceCity != null){
//已完善个人资料 可以发布动态
uni.navigateTo({
url: '/pagesArticle/publishArticle?topicId='+this.topicId
......
......@@ -77,6 +77,7 @@
import {getOssUrl} from "../../api/article";
import ELM from '@/components/elm-toast/index.vue';
import {message} from "../../common/message";
import {getDict} from "../../api/system/dict/data";
export default {
components: {
LsSwiper,
......@@ -99,6 +100,8 @@
userList: [],
tipMsg: '',
isConfirm: false,
// 是否需要实名 1:需要 0:不需要
realAuthFlag: '1'
};
},
onHide() {
......@@ -108,9 +111,16 @@
this.getNoticeList()
this.getBannerList()
this.getUserList()
this.getRealAuthDict()
this.userInfo = uni.getStorageSync('userInfo')
},
methods: {
//获取实名字典配置
getRealAuthDict(){
getDict('sys_config').then(res=> {
this.realAuthFlag = res.data.data.find(item => item.dictLabel === 'is_need_realAuth').dictValue;
})
},
//获取用户列表
getUserList() {
const query = {
......@@ -132,7 +142,6 @@
//处理城市
if (item.memResidenceProvince != null && item.memResidenceProvince != '' && item.memResidenceCity != null && item.memResidenceCity != ''){
item.city = getCity(item.memResidenceProvince,item.memResidenceCity)
console.log(item.city)
}
});
this.userList = res.data.data
......@@ -205,6 +214,15 @@
});
}, 500)
} else {
// 判断是否已实名 this.realAuthFlag=1需要判断是否已实名 否则不校验
if (this.realAuthFlag === '1'){
if (uni.getStorageSync('userInfo').memRealAuthen !== '1'){
this.tipMsg = message.authenticationMsg;
this.isConfirm = true;
this.$refs.elm.showDialog();
return
}
}
isStopAccount().then(res => {
//如果flag=0 被禁用了 踢出该用户
if (res.data.data == '0') {
......
......@@ -84,6 +84,8 @@ export default {
isApplication: false,
tipMsg: '',
isConfirm: false,
// 是否需要实名 1:需要 0:不需要
realAuthFlag: '1'
}
},
onLoad(options) {
......@@ -94,6 +96,12 @@ export default {
this.getUserInfo()
},
methods: {
//获取实名字典配置
getRealAuthDict(){
getDict('sys_config').then(res=> {
this.realAuthFlag = res.data.data.find(item => item.dictLabel === 'is_need_realAuth').dictValue;
})
},
// 获取活动详情
getActivityDetail(){
activityDetail(this.activityId).then(res=>{
......@@ -122,12 +130,15 @@ export default {
const token = uni.getStorageSync('token')
//校验token 如果没有token,跳到登录页进行登录
if (token && token !== '' && token != null){
if (uni.getStorageSync('userInfo').memRealAuthen != '1'){
// 判断是否已实名 this.realAuthFlag=1需要判断是否已实名 否则不校验
if (this.realAuthFlag === '1'){
if (uni.getStorageSync('userInfo').memRealAuthen !== '1'){
this.tipMsg = message.authenticationMsg;
this.isConfirm = true;
this.$refs.elm.showDialog();
return
}
}
this.show = true
this.countprice()
} else {
......
......@@ -129,6 +129,7 @@ import {calculateAge, parseDate} from "../common";
import {isStopAccount, userDetail} from "../api/user";
import ELM from '@/components/elm-toast/index.vue';
import {message} from "../common/message";
import {getDict} from "../api/system/dict/data";
export default{
components: {
ArticleItem,
......@@ -160,6 +161,8 @@ export default{
longPressedItem: null,
longPressTimeout: null,
isTopicName:false,
// 是否需要实名 1:需要 0:不需要
realAuthFlag: '1'
}
},
onLoad(params){
......@@ -168,8 +171,15 @@ export default{
this.isTopicName = true
}
this.getArticleDetail()
this.getRealAuthDict()
},
methods: {
//获取实名字典配置
getRealAuthDict(){
getDict('sys_config').then(res=> {
this.realAuthFlag = res.data.data.find(item => item.dictLabel === 'is_need_realAuth').dictValue;
})
},
reply(value){
this.commentPlaceholder = '回复 ' + value.memNickName + ':'
//设置被评论人id
......@@ -188,7 +198,6 @@ export default{
// 点赞
praise(item) {
const token = uni.getStorageSync('token')
const userInfo = uni.getStorageSync('userInfo')
//校验token 如果没有token,跳到登录页进行登录
if (token && token !== '' && token != null){
//已登录
......@@ -201,6 +210,15 @@ export default{
url: "/pageslogin/index"
})
} else {
// 判断是否已实名 this.realAuthFlag=1需要判断是否已实名 否则不校验
if (this.realAuthFlag === '1'){
if (uni.getStorageSync('userInfo').memRealAuthen !== '1'){
this.tipMsg = message.authenticationMsg;
this.isConfirm = true;
this.$refs.elm.showDialog();
return
}
}
var type = ''
if (item.isLike == '1') {
//取消点赞
......@@ -258,6 +276,15 @@ export default{
//校验token 如果没有token,跳到登录页进行登录
if (token && token !== '' && token != null){
//已登录
// 判断是否已实名 this.realAuthFlag=1需要判断是否已实名 否则不校验
if (this.realAuthFlag === '1'){
if (uni.getStorageSync('userInfo').memRealAuthen !== '1'){
this.tipMsg = message.authenticationMsg;
this.isConfirm = true;
this.$refs.elm.showDialog();
return
}
}
isStopAccount().then(res => {
//如果flag=0 被禁用了 踢出该用户
if (res.data.data == '0') {
......
......@@ -199,6 +199,7 @@
<ELM ref="elm" :msg="tipMsg" :isCancel="false" :isConfirm="isConfirm" @confirm="confirm"></ELM>
<ELM ref="elmCoin" :msg="tipMsg" :isConfirm="isCoinConfirm" confirmName="充值" @confirm="coinConfirm"></ELM>
<ELM ref="elmLike" :msg="tipMsg" :isConfirm="isLikeConfirm" @confirm="likeConfirm"></ELM>
<ELM ref="elmAuth" :msg="tipMsg" :isConfirm="isAuthConfirm" confirmName="认证" @confirm="authConfirm"></ELM>
</view>
</template>
......@@ -211,6 +212,7 @@
import {getOssUrl, userArticleList} from "../api/article";
import {getDict} from "../api/system/dict/data";
import ELM from '@/components/elm-toast/index.vue';
import {message} from "../common/message";
export default {
components: {
LsSwiper,
......@@ -257,6 +259,8 @@
isLikeConfirm: false,
scrollTop: 0,
data: [],
// 是否需要实名 1:需要 0:不需要
realAuthFlag: '1'
};
},
onLoad(options) {
......@@ -289,6 +293,12 @@
this.showAnima = false;
},
methods: {
//获取实名字典配置
getRealAuthDict(){
getDict('sys_config').then(res=> {
this.realAuthFlag = res.data.data.find(item => item.dictLabel === 'is_need_realAuth').dictValue;
})
},
//获取点赞花费金币数
getUserLikeDict(){
getDict('user_like_config').then(res=> {
......@@ -394,6 +404,15 @@
},
//关注
follow(id, type, url) {
// 判断是否已实名 this.realAuthFlag=1需要判断是否已实名 否则不校验
if (this.realAuthFlag === '1'){
if (uni.getStorageSync('userInfo').memRealAuthen !== '1'){
this.tipMsg = message.authenticationMsg;
this.isAuthConfirm = true;
this.$refs.elmAuth.showDialog();
return
}
}
if(type === true){
const form = {
userId: uni.getStorageSync('userInfo').businessId,
......@@ -418,6 +437,15 @@
},
//点赞
like(id,url){
// 判断是否已实名 this.realAuthFlag=1需要判断是否已实名 否则不校验
if (this.realAuthFlag === '1'){
if (uni.getStorageSync('userInfo').memRealAuthen !== '1'){
this.tipMsg = message.authenticationMsg;
this.isAuthConfirm = true;
this.$refs.elmAuth.showDialog();
return
}
}
const form = {
targetId: this.userData.userId,
isPay:'0'
......@@ -445,6 +473,15 @@
},
//留言
addMessage(id){
// 判断是否已实名 this.realAuthFlag=1需要判断是否已实名 否则不校验
if (this.realAuthFlag === '1'){
if (uni.getStorageSync('userInfo').memRealAuthen !== '1'){
this.tipMsg = message.authenticationMsg;
this.isAuthConfirm = true;
this.$refs.elmAuth.showDialog();
return
}
}
uni.navigateTo({
url: "/pagesUser/addMessage?userId=" + id
})
......
......@@ -99,6 +99,8 @@ export default {
show:false,
tipMsg: '',
isConfirm: false,
// 是否需要实名 1:需要 0:不需要
realAuthFlag: '1'
}
},
components: {
......@@ -117,8 +119,15 @@ export default {
},
onShow(){
this.getCoinBalance()
this.getRealAuthDict()
},
methods: {
//获取实名字典配置
getRealAuthDict(){
getDict('sys_config').then(res=> {
this.realAuthFlag = res.data.data.find(item => item.dictLabel === 'is_need_realAuth').dictValue;
})
},
//查询金币余额
getCoinBalance(){
getBalance().then(res =>{
......@@ -135,6 +144,15 @@ export default {
},
// 提交订单
submitorder() {
// 判断是否已实名 this.realAuthFlag=1需要判断是否已实名 否则不校验
if (this.realAuthFlag === '1'){
if (uni.getStorageSync('userInfo').memRealAuthen !== '1'){
this.tipMsg = message.authenticationMsg;
this.isConfirm = true;
this.$refs.elm.showDialog();
return
}
}
const params = {
price: 0,
num: this.coinCount
......
<template>
<view class="content">
<view class="auth-item">
<view class="auth-item" v-if="realAuthFlag === '1'">
<image class="auth-img" :src="baseUrl+'/user/sfauth.png'"></image>
<view class="auth-con">
<view class="auth-con-1">实名认证</view>
......@@ -36,6 +36,7 @@
<script>
import ELM from '@/components/elm-toast/index.vue';
import {userDetail} from "../../api/user";
import {getDict} from "../../api/system/dict/data";
export default {
data() {
return {
......@@ -43,16 +44,25 @@
baseUrl: this.$IMG_URL,
userInfo: {},
tipMsg: '',
isConfirm: false
isConfirm: false,
// 是否需要实名 1:需要 0:不需要
realAuthFlag: '1'
}
},
components: {
ELM
},
onShow() {
this.loadPage();
this.loadPage()
this.getRealAuthDict()
},
methods: {
//获取实名字典配置
getRealAuthDict(){
getDict('sys_config').then(res=> {
this.realAuthFlag = res.data.data.find(item => item.dictLabel === 'is_need_realAuth').dictValue;
})
},
//查询认证数据
loadPage() {
userDetail(uni.getStorageSync('userInfo').memberId).then(res => {
......
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