zouyanyan 1 week ago
parent 33d84b1118
commit 97819e4d8d

@ -54,6 +54,10 @@
<uni-popup ref="message" type="message"> <uni-popup ref="message" type="message">
<uni-popup-message :type="msgType" :message="messageText" :duration="2000"></uni-popup-message> <uni-popup-message :type="msgType" :message="messageText" :duration="2000"></uni-popup-message>
</uni-popup> </uni-popup>
<!-- 是否登录 -->
<openlogin ref="loginId" @getPhoneNumber="getPhoneNumber"></openlogin>
</view> </view>
</template> </template>
@ -61,11 +65,16 @@
import { mapState, mapActions, mapGetters } from 'vuex' import { mapState, mapActions, mapGetters } from 'vuex'
import dateTime from '@/common/dateTime.js' import dateTime from '@/common/dateTime.js'
import {myCache,logindo,clearBadgeNumber} from "../../utils/utils"; import {myCache,logindo,clearBadgeNumber} from "../../utils/utils";
import openlogin from "../components/openlogin.vue";
export default { export default {
components: {
openlogin
},
data() { data() {
return { return {
loadStatus: 'loadmore', loadStatus: 'loadmore',
userid:"",
activeSwipeId:-1, activeSwipeId:-1,
options: [ options: [
{ {
@ -106,9 +115,20 @@ export default {
onShow() { onShow() {
//判断登录,跳转去登录 //判断登录,跳转去登录
// logindo(); // logindo();
console.log("this.chats列表.......",this.chats) // console.log("this.chats列表.......",this.chats)
this.loadStatus = 'nomore' var user = myCache('user');
this.setBadge(this.unreadCount) this.userid = user.userid? user.userid:'';
if(this.userid==""||this.userid=="0"){
}
else{
this.loadStatus = 'nomore'
this.setBadge(this.unreadCount)
}
},
mounted() {
if(this.userid==""||this.userid=="0"){
this.$refs.loginId.open();
}
}, },
onPullDownRefresh() { onPullDownRefresh() {
// 下拉刷新仅刷新角标,数据由全局WebSocket维护 // 下拉刷新仅刷新角标,数据由全局WebSocket维护
@ -120,6 +140,11 @@ export default {
methods: { methods: {
...mapActions('chatStore', ['removeChat', 'moveTop','loadFriend']), ...mapActions('chatStore', ['removeChat', 'moveTop','loadFriend']),
getPhoneNumber(e){
if(e.userid){
this.userid = e.userid
}
},
// 设置底部角标 // 设置底部角标
setBadge(count) { setBadge(count) {
myCache("massageCount",count); myCache("massageCount",count);

@ -319,8 +319,9 @@
}, },
mounted() { mounted() {
uni.setStorageSync("privacyType", "1");
let firstLaunchFlag = uni.getStorageSync("firstLaunchFlag"); let firstLaunchFlag = uni.getStorageSync("firstLaunchFlag");
uni.setStorageSync("firstLaunchFlag", false) // uni.setStorageSync("firstLaunchFlag", false)
// 隐私政策判定start------------------------------ // 隐私政策判定start------------------------------
// #ifdef APP-PLUS // #ifdef APP-PLUS
if (firstLaunchFlag) { if (firstLaunchFlag) {

@ -78,7 +78,7 @@
<view class="xycon"> <view class="xycon">
<view class="sitem"> <view class="sitem">
<view class="selbtn"> <view class="selbtn">
<uni-data-checkbox multiple v-model="checkbox1" :localdata="checkboxitem"></uni-data-checkbox> <uni-data-checkbox multiple v-model="checkbox1" :localdata="checkboxitem" @change="change"></uni-data-checkbox>
</view> </view>
<view class="conright"> <view class="conright">
<text class="sname"> <text class="sname">
@ -133,7 +133,7 @@
address:'', address:'',
longitude:'', // 经度 longitude:'', // 经度
latitude:'', // 维度 latitude:'', // 维度
checkbox1: [1], checkbox1: [0],
checkboxitem: [{ checkboxitem: [{
text: '', text: '',
value: 1, value: 1,
@ -147,9 +147,53 @@
onLoad(){ onLoad(){
this.getcheckImg(); this.getcheckImg();
this.getsystemInfo(); this.getsystemInfo();
},
mounted() {
uni.setStorageSync("privacyType", "2");
let firstLoginFlag = uni.getStorageSync("firstLoginFlag");
// 隐私政策判定start------------------------------
// #ifdef APP-PLUS
if (firstLoginFlag) {
this.checkbox1=[1];
this.$forceUpdate();
return true;
}else{
uni.navigateTo({
url: `/pages/user/privacy`
});
}
// #endif
// 隐私政策判定end--------------
},
onShow(){
let firstLoginFlag = uni.getStorageSync("firstLoginFlag");
// 隐私政策判定start------------------------------
// #ifdef APP-PLUS
if (firstLoginFlag) {
this.checkbox1=[1];
this.$forceUpdate();
// 获取定位信息
this.getPosition();
}
// #endif
// 隐私政策判定end--------------
// #ifdef H5
this.checkbox1=[1];
this.$forceUpdate();
// 获取定位信息
this.getPosition(); this.getPosition();
// #endif
}, },
methods: { methods: {
change(e){
console.log('e:',e);
if(e.detail.value.length>0&&e.detail.value[0]){
// 选中
// 获取定位信息
this.getPosition();
}
},
gotoregister() { gotoregister() {
// 注册账号 // 注册账号
uni.navigateTo({ uni.navigateTo({

@ -189,7 +189,6 @@
if(e.customer_id){ if(e.customer_id){
this.customer_id = e.customer_id this.customer_id = e.customer_id
} }
this.getmember();
}, },
async getList() { async getList() {
// console.log('customer_id2',this.customer_id) // console.log('customer_id2',this.customer_id)

@ -497,7 +497,6 @@
if(e.userid){ if(e.userid){
this.userid = e.userid this.userid = e.userid
} }
this.getmember();
}, },
async getList() { async getList() {
if(this.loadStatus!=="noMore") if(this.loadStatus!=="noMore")

@ -560,7 +560,6 @@
if(e.userid){ if(e.userid){
this.userid = e.userid this.userid = e.userid
} }
this.getmember();
}, },
// 达人好物及精品课程 // 达人好物及精品课程
async getggList() { async getggList() {

@ -479,7 +479,6 @@
if(e.userid){ if(e.userid){
this.userid = e.userid this.userid = e.userid
} }
this.getmember();
}, },
async getList() { async getList() {
if(this.loadStatus!=="noMore") if(this.loadStatus!=="noMore")

@ -189,7 +189,6 @@
if(e.customer_id){ if(e.customer_id){
this.customer_id = e.customer_id this.customer_id = e.customer_id
} }
this.getmember();
}, },
async getList() { async getList() {
// console.log('customer_id2',this.customer_id) // console.log('customer_id2',this.customer_id)

@ -2,7 +2,7 @@
<view class="primask"> <view class="primask">
<!-- 首次进入app 隐私协议弹框 --> <!-- 首次进入app 隐私协议弹框 -->
<uni-popup ref="privacyDialog" type="dialog" > <uni-popup ref="privacyDialog" type="dialog" >
<uni-popup-dialog :before-close="true" type="info" mode="base" cancelText="暂不同意并退出APP" confirmText="同意并接受" title="隐私政策" <uni-popup-dialog :before-close="true" type="info" mode="base" cancelText="暂不同意并退出APP" confirmText="同意并接受" title="用户协议和隐私政策"
@confirm="agreeEnter" @confirm="agreeEnter"
@close="exitapply"> @close="exitapply">
<view class="privacy_con"> <view class="privacy_con">
@ -47,7 +47,13 @@ export default {
}, },
// 同意并进入应用 // 同意并进入应用
agreeEnter(){ agreeEnter(){
uni.setStorageSync("firstLaunchFlag", true) let privacyType = uni.getStorageSync("privacyType");
if(privacyType=="1"){
uni.setStorageSync("firstLaunchFlag", true);
}
else if(privacyType=="2"){
uni.setStorageSync("firstLoginFlag", true);
}
plus.runtime.agreePrivacy() plus.runtime.agreePrivacy()
this.close(); this.close();
uni.navigateBack(); uni.navigateBack();

Loading…
Cancel
Save