作者 lihongjuan

Merge branch 'master' of http://114.215.101.231:8099/miniprogram/liqizhuang into lhj

# Conflicts:
#	app.js
... ... @@ -4,7 +4,6 @@ App({
// 展示本地存储能力
var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
this.changeToken();
// 获取用户信息
console.log(111)
... ... @@ -72,7 +71,17 @@ App({
resolve(res.data.data);
} else if (res.data.code == '201') {
resolve(res.data);
} else {
} else if (res.data.code == '401'){
wx.showToast({
title: res.data.msg,
icon: 'none',
})
setTimeout(() => {
wx.navigateTo({
url: '/pages/register/register',
})
}, 1200)
} else{
wx.showToast({
title: res.data.msg,
icon: 'none',
... ... @@ -122,6 +131,6 @@ App({
},
globalData: {
userInfo: null,
baseUrl: 'https://txgyy.jjjtech.cn',
baseUrl: 'https://txgyy.jjjtech.cn/',
}
})
\ No newline at end of file
... ...
... ... @@ -99,7 +99,7 @@ page {
.news_detail_item {
border-bottom: 2rpx solid #f5f5f5;
display: flex;
padding: 24rpx 0;
padding: 15rpx 0;
}
.news_detail_item:last-child {
... ...
... ... @@ -3,5 +3,5 @@
"navigationBarTitleText": "党建工作",
"navigationBarBackgroundColor": "#169BD5",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": true
"enablePullDownRefresh": false
}
\ No newline at end of file
... ...
// pages/dangjian/dangjian.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--pages/dangjian/dangjian.wxml-->
<text>pages/dangjian/dangjian.wxml</text>
... ...
/* pages/dangjian/dangjian.wxss */
\ No newline at end of file
... ...
... ... @@ -85,7 +85,7 @@ page{
.news_detail_item{
border-bottom:2rpx solid #f5f5f5;
display: flex;
padding: 24rpx 0;
padding: 15rpx 0;
}
.news_detail_item:last-child{
border: none;
... ...
... ... @@ -6,11 +6,11 @@ Page({
*/
data: {
navbar: [{
name: '企业咨询'
},
{
name: '企话吧'
}
name: '企业咨询'
},
{
name: '企话吧'
}
],
zixunList: [],
postList:[],
... ... @@ -24,7 +24,6 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let c = this; wx.getSystemInfo({
success: function (res) {
c.setData({
... ... @@ -136,7 +135,6 @@ Page({
wx.stopPullDownRefresh()
})
},
askQuestion() {
wx.navigateTo({
url: '/pages/question/question',
... ... @@ -150,7 +148,6 @@ Page({
b.setData({
auth: r
});
// r == 2 ? b.getzixun() : '';
wx.stopPullDownRefresh()
})
},
... ... @@ -177,25 +174,21 @@ Page({
postList:[],
page:1
}), idx ? t.postList() : t.getzixun();
},
jump() {
wx.navigateTo({
url: '',
})
wx.switchTab({
url: '',
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
... ... @@ -207,7 +200,6 @@ Page({
page: 1,
show:!0
})
this.data.currentTab=='0'?this.getzixun():this.postList()
},
... ...
... ... @@ -19,7 +19,8 @@ Page({
ifData:!1,
navScrollLeft:0,
noMore:!0,
beautiful_switch:0
beautiful_switch:0,
selectindex:0
},
changeShow(){
this.setData({
... ... @@ -81,7 +82,8 @@ Page({
success:function(res){
console.log(res)
app.post(url,{code:res.code}).then((r)=>{
wx.setStorageSync('token', r.userInfo.token)
wx.setStorageSync('token', r.userInfo.token);
t.getUserInfo()
})
}
})
... ... @@ -96,7 +98,18 @@ Page({
})
},
tabCharge(e) {
let s = this, singleWidth = s.data.windowWidth / 7, cur = e.currentTarget.dataset.index+1;
if (e.currentTarget.dataset.idx == -1) {
s.setData({
selectindex:0
})
} else{
s.setData({
selectindex: e.currentTarget.dataset.idx
})
}
s.setData({
beautiful_switch: e.currentTarget.dataset.beau,
companyList:[],
... ... @@ -113,7 +126,7 @@ Page({
*/
onLoad: function(options) {
let a = this;
a.changeToken(),a.getUserInfo(),a.getTypes(), a.getAreas(), a.getCompanyList(), wx.getSystemInfo({
a.changeToken(),a.getTypes(), a.getAreas(), a.getCompanyList(), wx.getSystemInfo({
success: function (t) {
a.setData({
scrollHeight: t.windowHeight-50,
... ... @@ -121,23 +134,17 @@ Page({
});
}
});
},
getUserInfo() {
let d = this, url = '/api/user/index', params = {
header: true
}; app.post(url, params).then((r) => {
console.log(84352784356347865)
let d = this, url = '/api/user/index';
app.post(url, {}).then((r) => {
console.log(r.noticeNum)
d.setData({ userInfo: r.userInfo, noticeNum: r.noticeNum })
if (r.noticeNum!=0){
console.log(723457717342345325)
let num = r.noticeNum
num = num.toString()
wx.setTabBarBadge({
index: 4,
text: num
... ... @@ -147,7 +154,6 @@ Page({
index: 4,
})
}
})
},
... ...
... ... @@ -8,15 +8,15 @@
</view> -->
<scroll-view class='tab_box' scroll-left="{{navScrollLeft}}" scroll-x='true' scroll-with-animation='true'>
<view class="tab_item {{current==0?'active':''}}" data-current='0' bindtap='tabCharge' data-beau="0">全部</view>
<view class="tab_item {{selectindex==0?'active':''}}" data-current='0' bindtap='tabCharge' data-idx='-1' data-beau="0">全部</view>
<view class="tab_item zuiactive" data-current='0' bindtap='tabCharge' data-beau="1">
<view class="tab_item zuiactive" data-idx='-2' data-current='0' bindtap='tabCharge' data-beau="1">
最美企业
<view class="iconfont icon-huangguan"></view>
</view>
<block wx:for="{{typeList}}" wx:key=''>
<view class="tab_item {{current == item.id?'active':''}}" data-current='{{item.id}}' bindtap='tabCharge' data-index='{{index}}' data-beau="0">{{item.name}}</view>
<view class="tab_item {{selectindex == item.id?'active':''}}" data-idx="{{item.id}}" data-current='{{item.id}}' bindtap='tabCharge' data-index='{{index}}' data-beau="0">{{item.name}}</view>
</block>
</scroll-view>
<view class='iconfont icon-gengduo1' bindtap='changeShow'></view>
... ...
... ... @@ -12,6 +12,7 @@ page {
left: 0;
display: flex;
z-index: 10;
}
.tab_box {
... ... @@ -20,6 +21,9 @@ page {
white-space: nowrap;
overflow: hidden;
line-height: 80rpx;
display:flex;
padding-left: 10rpx
}
.tab_item {
... ... @@ -27,7 +31,7 @@ page {
color: #999;
display: inline-block;
position: relative;
padding: 0 30rpx;
padding: 0 12rpx;
height: 100%;
text-align: center;
}
... ...
... ... @@ -32,26 +32,22 @@ Page({
b.setData({
auth: r
});
b.getUserInfo()
})
},
getUserInfo(){
let d = this, url ='/api/user/index',params={
header: true
}; t.post(url,params).then((r)=>{
d.checkstatus();
d.setData({ userInfo: r.userInfo, noticeNum: r.noticeNum})
console.log('13264632654237', r.noticeNum)
if (r.noticeNum != 0) {
console.log(723457717342345325)
let num = r.noticeNum
num = num.toString()
wx.setTabBarBadge({
index: 4,
text: num
})
}else{
wx.hideTabBarRedDot({
index: 4,
})
... ... @@ -59,7 +55,6 @@ Page({
})
},
btn_post() {
wx.navigateTo({
url: '../myPost/myPost',
})
... ... @@ -99,9 +94,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.checkstatus();
this.getUserInfo()
this.getUserInfo();
},
/**
* 生命周期函数--监听页面隐藏
... ...