Browse Source

注释:console.log

master
lqq 6 years ago
parent
commit
9dfeac82d7
  1. 2
      config.js
  2. 12
      pages/article/index.js
  3. 6
      pages/billboards/policy/index.js
  4. 6
      pages/billboards/policy/policy-list/index.js
  5. 22
      pages/home/index.js
  6. 18
      pages/topics/interactive/topicArticle/index.js
  7. 14
      pages/user/index.js
  8. 2
      project.config.json
  9. 20
      utils/http.js

2
config.js

@ -1,5 +1,5 @@
const config = { const config = {
// api_url: 'http://192.168.42.44:8083/fqsb', // 服务器地址 // api_url: 'http://192.168.42.44:8083/fqsb', // 服务器地址
api_url: 'https://shibeirencai.elinkit.com.cn:8083/fqsb' api_url: 'https://shibeirencai.elinkit.com.cn:7101/fqsb'
} }
export { config } export { config }

12
pages/article/index.js

@ -27,7 +27,7 @@ Page({
this.addOrRemoveCollectionApi() this.addOrRemoveCollectionApi()
}, },
onlineSubmit () { onlineSubmit () {
console.log('在线报名') //console.log('在线报名')
if (store.hasPhone()) { if (store.hasPhone()) {
this.onlineSignApi() // 在线报名 this.onlineSignApi() // 在线报名
} else { } else {
@ -41,7 +41,7 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
console.log(options) //console.log(options)
const {id} = options const {id} = options
this.setData({ this.setData({
aId: id aId: id
@ -50,8 +50,8 @@ Page({
}, },
fetchArticeApi () { fetchArticeApi () {
artice.getDetail(this.data.aId, (res) => { artice.getDetail(this.data.aId, (res) => {
console.log('artice detail') //console.log('artice detail')
console.log(res) //console.log(res)
const data = res.result const data = res.result
const date = dayjs(data.createTime).format('MM月DD日') const date = dayjs(data.createTime).format('MM月DD日')
this.setData({ this.setData({
@ -68,7 +68,7 @@ Page({
}, },
addOrRemoveCollectionApi () { addOrRemoveCollectionApi () {
artice.addOrRemoveCollect(this.data.aId, res => { artice.addOrRemoveCollect(this.data.aId, res => {
console.log(res) //console.log(res)
if (res.code == 200) { if (res.code == 200) {
this.setData({ this.setData({
isStar: !this.data.isStar isStar: !this.data.isStar
@ -82,7 +82,7 @@ Page({
}, },
onlineSignApi () { onlineSignApi () {
artice.onlineSign(this.data.aId, res => { artice.onlineSign(this.data.aId, res => {
console.log(res) //console.log(res)
wx.showToast({ wx.showToast({
title: res.message, title: res.message,
icon: 'none' icon: 'none'

6
pages/billboards/policy/index.js

@ -31,7 +31,7 @@ Page({
currPage: 1, currPage: 1,
searchKey: '' searchKey: ''
}) })
console.log(e) //console.log(e)
this.fetchPolicyList() this.fetchPolicyList()
}, },
onSearchInput (e) { onSearchInput (e) {
@ -40,7 +40,7 @@ Page({
searchKey: key, searchKey: key,
currPage: 1, currPage: 1,
}) })
console.log(e) //console.log(e)
this.fetchPolicyList() this.fetchPolicyList()
}, },
/** /**
@ -78,7 +78,7 @@ Page({
const {searchKey} = this.data const {searchKey} = this.data
const page = this.data.currPage const page = this.data.currPage
policy.fetchPolicyList(page, searchKey, res => { policy.fetchPolicyList(page, searchKey, res => {
console.log(res) //console.log(res)
const datas = res.list const datas = res.list
let tempDatas = [] let tempDatas = []
datas.forEach(item => { datas.forEach(item => {

6
pages/billboards/policy/policy-list/index.js

@ -18,7 +18,7 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
console.log(options) //console.log(options)
const tags = wx.getStorageSync('PolicyTags') const tags = wx.getStorageSync('PolicyTags')
let navs = tags.map(item=> {return item.name}) let navs = tags.map(item=> {return item.name})
const {index} = options const {index} = options
@ -32,7 +32,7 @@ Page({
this.fetchPolicyArtice() this.fetchPolicyArtice()
}, },
tapSegemnt (e) { tapSegemnt (e) {
console.log(e.detail) //console.log(e.detail)
const index = e.detail.index const index = e.detail.index
this.setData({ this.setData({
curCode: this.data.tags[index].code curCode: this.data.tags[index].code
@ -41,7 +41,7 @@ Page({
}, },
fetchPolicyArtice () { fetchPolicyArtice () {
policy.fetchPolicyArtice(this.data.curCode, res => { policy.fetchPolicyArtice(this.data.curCode, res => {
console.log(res) //console.log(res)
if (res.data) { if (res.data) {
this.setData({ this.setData({
nodes: res.data.content || '' nodes: res.data.content || ''

22
pages/home/index.js

@ -14,7 +14,7 @@ Page({
}, },
onLoad: function () { onLoad: function () {
homeModel.fetchAuthToken(res => { homeModel.fetchAuthToken(res => {
console.log('Home获取token成功后再请求数据') //console.log('Home获取token成功后再请求数据')
this.fetchHomeList() this.fetchHomeList()
this.fetchHomeBanner() this.fetchHomeBanner()
this.fetchHomeHot() this.fetchHomeHot()
@ -32,7 +32,7 @@ Page({
this.fetchHomeHot() this.fetchHomeHot()
wx.vibrateShort({ wx.vibrateShort({
success () { success () {
console.log('震动') //console.log('震动')
} }
}) })
}, },
@ -54,7 +54,7 @@ Page({
this.setData({ this.setData({
loading: false loading: false
}) })
console.log('啦啦啦') //console.log('啦啦啦')
const datas = res.list const datas = res.list
let tempDatas = [] let tempDatas = []
datas.forEach(item => { datas.forEach(item => {
@ -88,14 +88,14 @@ Page({
// }) // })
} }
} }
console.log(res) //console.log(res)
wx.stopPullDownRefresh() wx.stopPullDownRefresh()
}) })
}, },
fetchHomeBanner () { fetchHomeBanner () {
homeModel.getHomeBanner(res => { homeModel.getHomeBanner(res => {
console.log('Banner') //console.log('Banner')
console.log(res) //console.log(res)
const datas = res.list const datas = res.list
let tempBanners = [] let tempBanners = []
datas.forEach(item => { datas.forEach(item => {
@ -112,8 +112,8 @@ Page({
}, },
fetchHomeHot () { fetchHomeHot () {
homeModel.getHomeHot(res => { homeModel.getHomeHot(res => {
console.log('Hot') //console.log('Hot')
console.log(res) //console.log(res)
const datas = res.list const datas = res.list
let tempHots = [] let tempHots = []
datas.forEach(item => { datas.forEach(item => {
@ -129,15 +129,15 @@ Page({
}, },
// Banner/Hot/List事件 // Banner/Hot/List事件
tapSwiperItem (e) { tapSwiperItem (e) {
console.log(e.detail) //console.log(e.detail)
this.gotoArticePage(e.detail.id) this.gotoArticePage(e.detail.id)
}, },
tapFocusItem (e) { tapFocusItem (e) {
console.log(e.detail) //console.log(e.detail)
this.gotoArticePage(e.detail.id) this.gotoArticePage(e.detail.id)
}, },
clickListItem (e) { clickListItem (e) {
console.log(e.detail) //console.log(e.detail)
const {id, index} = e.detail const {id, index} = e.detail
this.gotoArticePage(id) this.gotoArticePage(id)
}, },

18
pages/topics/interactive/topicArticle/index.js

@ -41,7 +41,7 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
console.log(options.topicId) //console.log(options.topicId)
this.setData({ this.setData({
topicId: options.topicId topicId: options.topicId
}) })
@ -60,7 +60,7 @@ Page({
}, },
fetchDetail(){ fetchDetail(){
let topicId = this.data.topicId let topicId = this.data.topicId
console.log('议题详情' + topicId) //console.log('议题详情' + topicId)
topicModel.getTopicDetail(topicId,res => { topicModel.getTopicDetail(topicId,res => {
let data = res.result let data = res.result
this.setData({ this.setData({
@ -82,7 +82,7 @@ Page({
let topicId = this.data.topicId let topicId = this.data.topicId
let page = this.data.currPage let page = this.data.currPage
topicModel.getTopicDetailComment(topicId,page,res => { topicModel.getTopicDetailComment(topicId,page,res => {
console.log('议题评论') //console.log('议题评论')
const datas = res.result.list const datas = res.result.list
let tempDatas = [] let tempDatas = []
@ -119,14 +119,14 @@ Page({
}) })
} }
} }
console.log(this.data.commentList) //console.log(this.data.commentList)
wx.stopPullDownRefresh() wx.stopPullDownRefresh()
}) })
}, },
fetchTopicCollect(){ fetchTopicCollect(){
let topicId = this.data.topicId let topicId = this.data.topicId
topicModel.topicCollect(topicId,res =>{ topicModel.topicCollect(topicId,res =>{
console.log('收藏') //console.log('收藏')
if(res.code === 200){ if(res.code === 200){
this.fetchDetail() this.fetchDetail()
wx.showToast({ wx.showToast({
@ -140,7 +140,7 @@ Page({
fetchTopicUnCollect(){ fetchTopicUnCollect(){
let collectionId = this.data.collectionId let collectionId = this.data.collectionId
topicModel.topicUnCollect(collectionId, res => { topicModel.topicUnCollect(collectionId, res => {
console.log('取消收藏') //console.log('取消收藏')
if (res.code === 200) { if (res.code === 200) {
this.fetchDetail() this.fetchDetail()
wx.showToast({ wx.showToast({
@ -184,7 +184,7 @@ Page({
}, },
onClickPraise(e){ onClickPraise(e){
console.log(e) //console.log(e)
const sIndex = e.currentTarget.dataset.index const sIndex = e.currentTarget.dataset.index
var selectItem = e.currentTarget.dataset.item var selectItem = e.currentTarget.dataset.item
const commentList = this.data.commentList const commentList = this.data.commentList
@ -198,7 +198,7 @@ Page({
// 点击查看图片 // 点击查看图片
previewImg: function (e) { previewImg: function (e) {
console.log(e.currentTarget.dataset.index); //console.log(e.currentTarget.dataset.index);
var index = e.currentTarget.dataset.index; var index = e.currentTarget.dataset.index;
var imgArr = this.data.imgArr; var imgArr = this.data.imgArr;
wx.previewImage({ wx.previewImage({
@ -246,7 +246,7 @@ Page({
// 评论输入框 // 评论输入框
bingTextAreaInput(e){ bingTextAreaInput(e){
console.log(e.detail.value) //console.log(e.detail.value)
this.setData({ this.setData({
currentComment: e.detail.value currentComment: e.detail.value
}) })

14
pages/user/index.js

@ -40,7 +40,7 @@ Page({
// 授权登录 // 授权登录
bindGetUserInfo (e) { bindGetUserInfo (e) {
console.log(e.detail.userInfo) //console.log(e.detail.userInfo)
if (e.detail.userInfo){ if (e.detail.userInfo){
let avatarUrl = e.detail.userInfo.avatarUrl let avatarUrl = e.detail.userInfo.avatarUrl
let nickName = e.detail.userInfo.nickName let nickName = e.detail.userInfo.nickName
@ -64,7 +64,7 @@ Page({
let avatarUrl = res.result.avatarUrl let avatarUrl = res.result.avatarUrl
if (nickName && avatarUrl){ if (nickName && avatarUrl){
console.log('已授权') //console.log('已授权')
this.setData({ this.setData({
userInfo: res.result, userInfo: res.result,
avatarUrl: res.result.avatarUrl, avatarUrl: res.result.avatarUrl,
@ -72,10 +72,10 @@ Page({
reAuth: true, reAuth: true,
},()=>{ },()=>{
if (store.hasPhone()) { if (store.hasPhone()) {
console.log('已经绑定手机号码') //console.log('已经绑定手机号码')
this.getMsgStatus() this.getMsgStatus()
} else { } else {
console.log('未绑定手机号码') //console.log('未绑定手机号码')
wx.redirectTo({ wx.redirectTo({
url: '/pages/register/index', url: '/pages/register/index',
}) })
@ -87,7 +87,7 @@ Page({
phone: res.result.phone || '' phone: res.result.phone || ''
}) })
} else { } else {
console.log('未授权') //console.log('未授权')
this.setData({ this.setData({
isAuth: true isAuth: true
}) })
@ -98,7 +98,7 @@ Page({
// 获取未读消息 // 获取未读消息
getMsgStatus () { getMsgStatus () {
userModel.getMyMessageTotal(res => { userModel.getMyMessageTotal(res => {
console.log(res.result.total) //console.log(res.result.total)
this.setData({ this.setData({
messageTotal: Number(res.result.total) messageTotal: Number(res.result.total)
}) })
@ -108,7 +108,7 @@ Page({
// cell点击 // cell点击
onTapItem (e) { onTapItem (e) {
const { type } = e.currentTarget.dataset const { type } = e.currentTarget.dataset
console.log(type) //console.log(type)
if (type === 'myInfo'){ if (type === 'myInfo'){
wx.navigateTo({ wx.navigateTo({
url: `/pages/user/${type}/index?userIcon=${this.data.userInfo.avatarUrl}&userName=${this.data.userInfo.nickName}&userPhone=${this.data.userInfo.phone || ''}&company=${this.data.userInfo.company || ''}&position=${this.data.userInfo.position || ''}`, url: `/pages/user/${type}/index?userIcon=${this.data.userInfo.avatarUrl}&userName=${this.data.userInfo.nickName}&userPhone=${this.data.userInfo.phone || ''}&company=${this.data.userInfo.company || ''}&position=${this.data.userInfo.position || ''}`,

2
project.config.json

@ -4,7 +4,7 @@
"ignore": [] "ignore": []
}, },
"setting": { "setting": {
"urlCheck": false, "urlCheck": true,
"es6": true, "es6": true,
"enhance": false, "enhance": false,
"postcss": true, "postcss": true,

20
utils/http.js

@ -18,19 +18,19 @@ class HTTP {
// let token = wx.getStorageSync(HTTPConst.TokenStoreKey) || '' // let token = wx.getStorageSync(HTTPConst.TokenStoreKey) || ''
const token = store.readToken() const token = store.readToken()
let url = this.baseUrl + params.url let url = this.baseUrl + params.url
console.log(params.url) //console.log(params.url)
if (!params.method) { if (!params.method) {
params.method = Method.GET params.method = Method.GET
} }
// token 拼接到 请求体中 // token 拼接到 请求体中
let data = params.data let data = params.data
console.log('请求Header和Body参数:') //console.log('请求Header和Body参数:')
let header = { let header = {
'token': token, 'token': token,
'content-type': 'application/json', 'content-type': 'application/json',
} }
console.log(header) //console.log(header)
console.log(data || {}) //console.log(data || {})
wx.request({ wx.request({
url: url, url: url,
data: data, data: data,
@ -38,7 +38,7 @@ class HTTP {
method: params.method, method: params.method,
dataType: 'json', dataType: 'json',
success: (res) => { success: (res) => {
console.log(res.data) //console.log(res.data)
let code = res.statusCode.toString() let code = res.statusCode.toString()
let startCode = code.charAt(0) let startCode = code.charAt(0)
if (startCode == '2') { if (startCode == '2') {
@ -53,14 +53,14 @@ class HTTP {
} }
}) })
} else { } else {
console.log('数据请求失败') //console.log('数据请求失败')
wx.showToast({ wx.showToast({
title: res.data.message || '服务器错误,请稍后重试', title: res.data.message || '服务器错误,请稍后重试',
icon: 'none' icon: 'none'
}) })
} }
} else { } else {
console.log('请求错误') //console.log('请求错误')
wx.showToast({ wx.showToast({
title: '服务器错误!', title: '服务器错误!',
icon: 'none' icon: 'none'
@ -81,8 +81,8 @@ class HTTP {
fetchAuthToken (success) { fetchAuthToken (success) {
// 获取token // 获取token
this._fetchWXCode().then(res => { this._fetchWXCode().then(res => {
console.log('啦啦啦啦凉啊') //console.log('啦啦啦啦凉啊')
console.log(res) //console.log(res)
if (!res) return if (!res) return
let params = { let params = {
url: HTTPConst.TokenURL, url: HTTPConst.TokenURL,
@ -106,7 +106,7 @@ class HTTP {
return new Promise(resolve => { return new Promise(resolve => {
wx.login({ wx.login({
success (res) { success (res) {
console.log('获取Code成功 ' + res.code) //console.log('获取Code成功 ' + res.code)
resolve(res.code) resolve(res.code)
} }
}) })

Loading…
Cancel
Save