|
@@ -39,7 +39,7 @@
|
|
|
|
|
|
|
|
</scroll-view>
|
|
</scroll-view>
|
|
|
<view class="send-box" :style="{ 'padding-bottom' : isShowKeyBoard + 'px'}">
|
|
<view class="send-box" :style="{ 'padding-bottom' : isShowKeyBoard + 'px'}">
|
|
|
- <input type="text" class="enter-box" v-model="inputInfo" :adjust-position="true"
|
|
|
|
|
|
|
+ <input type="text" class="enter-box" v-model="inputInfo" :adjust-position="true" @focus="isNeedAuth()"
|
|
|
:style="{'width':inputWidth}" confirm-hold='true' confirm-type='send' @confirm="sendInputInfo" />
|
|
:style="{'width':inputWidth}" confirm-hold='true' confirm-type='send' @confirm="sendInputInfo" />
|
|
|
<!-- @input='isInputing' -->
|
|
<!-- @input='isInputing' -->
|
|
|
<!-- <button type="primary" class="submit-message" @click="sendInputInfo()" v-if='isShowSend'>发送</button> -->
|
|
<!-- <button type="primary" class="submit-message" @click="sendInputInfo()" v-if='isShowSend'>发送</button> -->
|
|
@@ -103,6 +103,9 @@
|
|
|
mitemHeight: 0
|
|
mitemHeight: 0
|
|
|
},
|
|
},
|
|
|
isAuth:true,
|
|
isAuth:true,
|
|
|
|
|
+ iv:'',
|
|
|
|
|
+ session_key:'',
|
|
|
|
|
+ encryptedData:''
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
components: {
|
|
components: {
|
|
@@ -111,14 +114,23 @@
|
|
|
onPageScroll(e) {
|
|
onPageScroll(e) {
|
|
|
this.scrollTopNav = e.scrollTop;
|
|
this.scrollTopNav = e.scrollTop;
|
|
|
},
|
|
},
|
|
|
|
|
+ onShareAppMessage(){
|
|
|
|
|
+ return {
|
|
|
|
|
+ title: '阿拉灯神丁',
|
|
|
|
|
+ path: '/pages/index/index'
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
onLoad() {
|
|
onLoad() {
|
|
|
this.userLogin();
|
|
this.userLogin();
|
|
|
this.getEquipmentHeight();
|
|
this.getEquipmentHeight();
|
|
|
},
|
|
},
|
|
|
onShow() {
|
|
onShow() {
|
|
|
- this.getNowTime();
|
|
|
|
|
- this.userHeadUrl = getApp().globalData.user_headUrl || '../../static/userDefault.png',
|
|
|
|
|
- this.isAuth = getApp().globalData.isAuth;
|
|
|
|
|
|
|
+ // this.getNowTime();
|
|
|
|
|
+ console.log(getApp().globalData.isAuth)
|
|
|
|
|
+ this.userHeadUrl = getApp().globalData.user_headUrl || '../../static/userDefault.png',
|
|
|
|
|
+ getApp().globalData.isAuth ? this.isAuth = true : this.isAuth = false ;
|
|
|
|
|
+ getApp().globalData.isAuth ? this.getHistory() : this.isAuth = false ;
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
userLogin(){
|
|
userLogin(){
|
|
@@ -206,14 +218,13 @@
|
|
|
// getApp().globalData.user_name = res.data.msg.name;
|
|
// getApp().globalData.user_name = res.data.msg.name;
|
|
|
// that.userHeadUrl = res.data.msg.headimg || '../../static/userDefault.png';
|
|
// that.userHeadUrl = res.data.msg.headimg || '../../static/userDefault.png';
|
|
|
// that.getHistory();
|
|
// that.getHistory();
|
|
|
-
|
|
|
|
|
- var isAuth = res.data.msg.isauth === 1;
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- if(isAuth){
|
|
|
|
|
|
|
+ var isAuth = res.data.msg.isauth === 1;
|
|
|
|
|
+ that.session_key = res.data.msg.session_key;
|
|
|
|
|
+ if(isAuth){
|
|
|
|
|
+ this.isAuth = true;
|
|
|
getApp().globalData.user_id = res.data.msg.id;
|
|
getApp().globalData.user_id = res.data.msg.id;
|
|
|
getApp().globalData.open_id = res.data.msg.openid;
|
|
getApp().globalData.open_id = res.data.msg.openid;
|
|
|
- getApp().globalData.isAuth = isAuth;
|
|
|
|
|
|
|
+ getApp().globalData.isAuth = true;
|
|
|
getApp().globalData.times = res.data.msg.times;
|
|
getApp().globalData.times = res.data.msg.times;
|
|
|
getApp().globalData.total_times = res.data.msg.total_times;
|
|
getApp().globalData.total_times = res.data.msg.total_times;
|
|
|
getApp().globalData.user_headUrl = res.data.msg.headimg;
|
|
getApp().globalData.user_headUrl = res.data.msg.headimg;
|
|
@@ -222,7 +233,7 @@
|
|
|
that.getHistory();
|
|
that.getHistory();
|
|
|
}else{
|
|
}else{
|
|
|
getApp().globalData.session_key = res.data.msg.session_key;
|
|
getApp().globalData.session_key = res.data.msg.session_key;
|
|
|
- that.isAuth = isAuth;
|
|
|
|
|
|
|
+ that.isAuth = isAuth;
|
|
|
wx.hideLoading();
|
|
wx.hideLoading();
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -265,6 +276,7 @@
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
getHistory(isShow) {
|
|
getHistory(isShow) {
|
|
|
|
|
+ // if(getApp.globalData.isAuth){this.isAuth = true}
|
|
|
let that = this;
|
|
let that = this;
|
|
|
uni.request({
|
|
uni.request({
|
|
|
url: getApp().globalData.shareUrl, //需要设置为全局
|
|
url: getApp().globalData.shareUrl, //需要设置为全局
|
|
@@ -371,7 +383,20 @@
|
|
|
this.isShowSend = false;
|
|
this.isShowSend = false;
|
|
|
this.isShowSetCenter = true;
|
|
this.isShowSetCenter = true;
|
|
|
}
|
|
}
|
|
|
- },
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ isNeedAuth(){
|
|
|
|
|
+ console.log(this.isAuth)
|
|
|
|
|
+ if(!this.isAuth){
|
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: '../auth/index',
|
|
|
|
|
+ success: res => {},
|
|
|
|
|
+ fail: () => {},
|
|
|
|
|
+ complete: () => {}
|
|
|
|
|
+ });
|
|
|
|
|
+ },500)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
// 滚动至底部触发的事件
|
|
// 滚动至底部触发的事件
|
|
|
lower() {
|
|
lower() {
|
|
|
if (this.scrollRequestEnable) {
|
|
if (this.scrollRequestEnable) {
|
|
@@ -392,7 +417,16 @@
|
|
|
},
|
|
},
|
|
|
openModal(){
|
|
openModal(){
|
|
|
// 需要在 popup 组件,指定 ref 为 popup
|
|
// 需要在 popup 组件,指定 ref 为 popup
|
|
|
- this.$refs.popup.open();
|
|
|
|
|
|
|
+ if(!this.isAuth){
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: '../auth/index',
|
|
|
|
|
+ success: res => {},
|
|
|
|
|
+ fail: () => {},
|
|
|
|
|
+ complete: () => {}
|
|
|
|
|
+ });
|
|
|
|
|
+ }else {
|
|
|
|
|
+ this.$refs.popup.open();
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
cancelModal(){
|
|
cancelModal(){
|
|
|
// 需要在 popup 组件,指定 ref 为 popup
|
|
// 需要在 popup 组件,指定 ref 为 popup
|