ylbtech-小程序-demo:知乎日报 |
1.返回顶部 |
0、
1、app.js
//app.js
App({
onLaunch: function () {
//调用API从本地缓存中获取数据
var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
},
getUserInfo:function(cb){
var that = this
if(this.globalData.userInfo){
typeof cb == "function" && cb(this.globalData.userInfo)
}else{
//调用登录接口
wx.login({
success: function () {
wx.getUserInfo({
success: function (res) {
that.globalData.userInfo = res.userInfo
typeof cb == "function" && cb(that.globalData.userInfo)
}
})
}
})
}
},
globalData:{
userInfo:null
}
})
2、app.json
{
"pages":[
"pages/index/index",
"pages/theme/theme",
"pages/detail/detail",
"pages/list/list"
],
"window":{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#00a2ea",
"navigationBarTitleText": "知乎日报",
"navigationBarTextStyle": "white"
},
"tabBar": {
"color": "#353535",
"selectedColor": "#3cc51f",
"borderStyle": "white",
"backgroundColor": "#ffffff",
"list": [{
"pagePath": "pages/index/index",
"iconPath": "images/icon_API.png",
"selectedIconPath": "images/icon_API_HL.png",
"text": "主页"
}, {
"pagePath": "pages/theme/theme",
"iconPath": "images/icon_component.png",
"selectedIconPath": "images/icon_component_HL.png",
"text": "主题日报"
}]
},
"networkTimeout": {
"request": 120000,
"downloadFile": 120000
}
}
3、app.wxss
/**app.wxss**/
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
background-color: #f2f2f2;
}
4、project.config.json
{
"description": "项目配置文件。",
"packOptions": {
"ignore": []
},
"setting": {
"urlCheck": false,
"es6": true,
"postcss": true,
"minified": true,
"newFeature": true
},
"compileType": "miniprogram",
"libVersion": "2.2.3",
"appid": "wx7d22ab7088f2db6a",
"projectname": "zhihuApp",
"isGameTourist": false,
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"game": {
"currentL": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": []
}
}
}
5、pages
6、images
7、util.js
-util.js
function formatTime(date) {
var year = date.getFullYear()
var month = date.getMonth() + 1
var day = date.getDate() var hour = date.getHours()
var minute = date.getMinutes()
var second = date.getSeconds() return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
} function formatDate(date, split) {
var year = date.getFullYear()
var month = date.getMonth() + 1
var day = date.getDate()
return [year, month, day].map(formatNumber).join(split || '')
} function formatNumber(n) {
n = n.toString()
return n[1] ? n : '0' + n
} module.exports = {
formatTime: formatTime,
formatDate: formatDate
}
8、
2. pages返回顶部 |
1、detail
a) .js
Page({
data: {
art: {},
},
onReady () {
wx.setNavigationBarTitle({
title: '详情页面'
})
},
onLoad (options) {
var that = this
wx.request({
url: 'http://news-at.zhihu.com/api/4/news/' + options.id,
headers: {
'Content-Type': 'application/json'
},
success (res) {
if (res.data.body) {
var body = res.data.body;
body = body.match( /<p>.*?<\/p>/g );
var ss = [];
if (body) {
for( var i = 0, len = body.length; i < len;i++ ) {
ss[ i ] = /<img.*?>/.test( body[ i ] );
if( ss[ i ] ) {
body[ i ] = body[ i ].match( /(http:|https:).*?\.(jpg|jpeg|gif|png)/ );
} else {
body[ i ] = body[ i ].replace( /<p>/g, '' )
.replace( /<\/p>/g, '' )
.replace( /<strong>/g, '' )
.replace( /<\/strong>/g, '' )
.replace( /<a.*?\/a>/g, '' )
.replace( / /g, ' ' )
.replace( /“/g, '"' )
.replace( /”/g, '"' );
}
}
}
res.data.body = body
}
that.setData({
art: res.data
})
}
})
}
})
b) .json
c) .wxml
<!--detail.wxml-->
<view class="container">
<view class="art-header">
<image src="{{art.image}}" class="art-img"/>
<view class="art-title">{{art.title}}</view>
<view class="art-source">{{art.image_source}}</view>
</view>
<view class="art-content">
{{art.body}}
</view>
</view>
d) .wxss
.art-header{
position: relative;
width: 100%;
height: 219px;
color: #FFF;
} .art-img{
width: 100%;
height: 219px;
} .art-title{
position: absolute;
bottom: 36px;
left: 8px;
font-size: 16px;
} .art-source {
position: absolute;
bottom: 8px;
font-size: 14px;
right: 8px;
} .art-content{
font-size: 14px;
color: #616466;
padding-left: 16px;
padding-right: 16px;
padding-top: 10px;
background-color: #FFF;
line-height: 1.5;
}
e)
2、index
a) .js
//index.js
//获取应用实例
var app = getApp()
var utils = require('../../utils/util.js')
Page({
data: {
list: [],
duration: 2000,
indicatorDots: true,
autoplay: true,
interval: 3000,
loading: false,
plain: false
},
//事件处理函数
bindViewTap(e) {
wx.navigateTo({
url: '../detail/detail?id=' + e.target.dataset.id
})
},
loadMore (e) {
if (this.data.list.length === 0) return
var date = this.getNextDate()
var that = this
that.setData({ loading: true })
wx.request({
url: 'http://news.at.zhihu.com/api/4/news/before/' + (Number(utils.formatDate(date)) + 1),
headers: {
'Content-Type': 'application/json'
},
success (res) {
that.setData({
loading: false,
list: that.data.list.concat([{ header: utils.formatDate(date, '-') }]).concat(res.data.stories)
})
}
})
},
getNextDate (){
const now = new Date()
now.setDate(now.getDate() - this.index++)
return now
},
onLoad () {
let that = this
wx.request({
url: 'http://news-at.zhihu.com/api/4/news/latest',
headers: {
'Content-Type': 'application/json'
},
success (res) {
that.setData({
banner: res.data.top_stories,
list: [{ header: '今日热闻' }].concat(res.data.stories)
})
}
})
this.index = 1
//调用应用实例的方法获取全局数据
// app.getUserInfo(function(userInfo){
// //更新数据
// that.setData({
// userInfo:userInfo
// })
// }) }
})
b) .json
c) .wxml
<!--index.wxml-->
<view class="container">
<swiper indicator-dots="{{indicatorDots}}"
autoplay="{{autoplay}}" class="banners" interval="{{interval}}" duration="{{duration}}">
<block wx:for="{{banner}}">
<swiper-item class="banner" >
<image src="{{item.image}}" data-id="{{item.id}}" bindtap="bindViewTap" class="banner-image" width="100%" height="100%"/>
<text class="banner-title">{{item.title}}</text>
</swiper-item>
</block>
</swiper>
<view class="news-item-container">
<block wx:for="{{list}}" wx:for-index="id">
<text wx:if="{{item.header}}" class="sub-title">{{item.header}}</text>
<navigator wx:else url="../detail/detail?id={{item.id}}">
<view class="news-item" >
<view class="news-item-left">
<text class="news-item-title">{{item.title}}</text>
</view>
<view class="news-item-right">
<image src="{{item.images[0]}}" class="news-image"/>
</view>
</view>
</navigator>
</block>
<button type="primary" class="load-btn" loading="{{loading}}" plain="{{plain}}" bindtap="loadMore"> 更多 </button>
</view> </view>
d) .wxss
/**index.wxss**/
.banners {
width: 100%;
height: 200px;
} .banner{
position: relative;
} .banner-image{
width: 100%;
height: 100%;
} .banner-title{
color: #FFF;
position: absolute;
width: 100%;
padding-left: 16px;
padding-right: 16px;
bottom: 30px;
font-size: 16px;
left:;
} .sub-title{
color: #76787e;
height: 36px;
line-height: 36px;
padding: 0 16px;
width: 100%;
font-size: 14px;
padding-left: 16px;
padding-right: 16px;
} .news-item-container {
background-color: #f2f2f2;
width: 100%;
padding-left: 8px;
padding-right: 8px;
} .news-item {
display: flex;
flex-direction: row;
justify-content: space-between;
padding-left: 8px;
padding-top: 8px;
padding-right: 8px;
padding-bottom: 8px;
margin-left: 8px;
margin-right: 8px;
margin-top: 8px;
background-color: #fff;
border: 1px solid #eaeaea;
border-bottom: 1px solid #d0d0d0;
border-radius: 5px;
} .news-item-right{
width: 80px;
height: 80px;
} .news-image{
width: 80px;
height: 80px;
} .news-item-title{
font-size: 16px;
} .load-btn{
margin-left: 8px;
margin-right: 8px;
margin-top: 16px;
margin-bottom: 16px;
display: block;
line-height: 2.3;
font-size: 13px;
padding: 0 1.34em;
}
e)
3、list
a) .js
Page({
data: {
list: {}
},
onReady: function () {
wx.setNavigationBarTitle({
title: this.title
})
},
onLoad: function (options) {
var that = this
this.title = options.title
wx.request({
url: 'http://news-at.zhihu.com/api/4/theme/' + options.id,
headers: {
'Content-Type': 'application/json'
},
success: function (res) {
that.setData({
list: res.data.stories
})
console.log(res.data)
}
})
}
})
b) .json
c) .wxml
<!--list.wxml-->
<view class="container">
<view class="news-item-container">
<navigator url="../detail/detail?id={{item.id}}" wx:for="{{list}}" wx:for-index="id">
<view class="news-item" >
<view class="news-item-left">
<text class="news-item-title">{{item.title}}</text>
</view>
<view class="news-item-right">
<image src="{{item.images[0]}}" class="news-image"/>
</view>
</view>
</navigator>
</view>
</view>
d) .wxss
.news-item-container {
background-color: #f2f2f2;
width: 100%;
padding-left: 8px;
padding-right: 8px;
} .news-item {
display: flex;
flex-direction: row;
justify-content: space-between;
padding-left: 8px;
padding-top: 8px;
padding-right: 8px;
padding-bottom: 8px;
margin-left: 8px;
margin-right: 8px;
margin-top: 8px;
background-color: #fff;
border: 1px solid #eaeaea;
border-bottom: 1px solid #d0d0d0;
border-radius: 5px;
} .news-item-right{
width: 80px;
height: 80px;
} .news-image{
width: 80px;
height: 80px;
} .news-item-title{
font-size: 16px;
}
e)
4、them
a) .js
Page({
data: {
list: []
},
onLoad: function () {
var that = this
wx.request({
url: 'http://news-at.zhihu.com/api/4/themes',
headers: {
'Content-Type': 'application/json'
},
success: function (res) {
that.setData({
list: res.data.others
})
}
})
}
})
b) .json
c) .wxml
<!--theme.wxml-->
<view class="container">
<navigator class="card" url="../list/list?id={{item.id}}&title={{item.name}}" wx:for="{{list}}">
<image src="{{item.thumbnail}}" class="card-image"></image>
<view class="card-content">
<view>
<text class="card-title">{{item.name}}</text>
</view>
<view>
<text class="card-desc">{{item.description}}</text>
</view>
</view>
</navigator>
</view>
d) .wxss
.card {
width: 100%;
margin-top: 8px;
margin-bottom: 8px;
background-color: #FFF;
}
.card-image{
width: 100%;
height: 168px;
} .card-content{
padding-left: 16px;
padding-right: 16px;
padding-bottom: 10px;
} .card-title{
font-size: 16px;
line-height: 1.6;
} .card-desc {
font-size: 14px;
}
e)
5、
a) .js
b) .json
c) .wxml
d) .wxss
e)
6、
3.返回顶部 |
6、
a) .js
b) .json
c) .wxml
d) .wxss
e)
4. 资源Json返回顶部 |
1、index
-http://news-at.zhihu.com/api/4/news/latest
{"date":"20180821","stories":[{"images":["https:\/\/pic3.zhimg.com\/v2-465f0a8298f7fce574c7368e12d31512.jpg"],"type":0,"id":9692289,"ga_prefix":"082113","title":"校园招聘、实习生招聘、秋招的区别是什么?"},{"images":["https:\/\/pic4.zhimg.com\/v2-7b140adccb8359f6b6dc53677d5b26eb.jpg"],"type":0,"id":9693626,"ga_prefix":"082112","title":"大误 · 一滴水如果从足够高的地方落下,能不能打死人?"},{"images":["https:\/\/pic2.zhimg.com\/v2-e3369ec6da7dba5ebe40e77a0da23725.jpg"],"type":0,"id":9693572,"ga_prefix":"082110","title":"看不懂血、尿、便常规的报告单?手把手教教你"},{"images":["https:\/\/pic2.zhimg.com\/v2-6abf42a09000eeec3e93fccd0d144c15.jpg"],"type":0,"id":9693669,"ga_prefix":"082109","title":"刚毕业在国外租房,前台给办理一下就入住了……"},{"images":["https:\/\/pic4.zhimg.com\/v2-4cadabda1516c9b5772695bbdb9e795b.jpg"],"type":0,"id":9692796,"ga_prefix":"082108","title":"孩子的每一次失控,都是「求助信号」"},{"images":["https:\/\/pic3.zhimg.com\/v2-c1d370cb878e1e816092d7430ae9af86.jpg"],"type":0,"id":9692910,"ga_prefix":"082107","title":"如何面对室友的孤立排挤?"},{"images":["https:\/\/pic3.zhimg.com\/v2-420f9ff43b1b02ee8f55ca0076c32bc2.jpg"],"type":0,"id":9693547,"ga_prefix":"082107","title":"好端端的装机必备软件,一顿神勇操作之后毁个稀烂"},{"images":["https:\/\/pic2.zhimg.com\/v2-502b15833122c1073882e1a22e5a2a0d.jpg"],"type":0,"id":9693582,"ga_prefix":"082107","title":"卧底工厂,这是我的蓝领调研全纪实"},{"images":["https:\/\/pic2.zhimg.com\/v2-1aa40e3f270a9fbd954b5aacc9cd98f5.jpg"],"type":0,"id":9693689,"ga_prefix":"082106","title":"瞎扯 · 如何正确地吐槽"}],"top_stories":[{"image":"https:\/\/pic4.zhimg.com\/v2-30f8a94e9f9acf0e80383e591c6e90ab.jpg","type":0,"id":9693666,"ga_prefix":"082018","title":"中介恶性竞争导致房租暴涨?这并非全部的真相"},{"image":"https:\/\/pic2.zhimg.com\/v2-63824be2bea749a8e6e8536ad05ddf05.jpg","type":0,"id":9693150,"ga_prefix":"082016","title":"那些动不动就上千还要煲的耳机,真有那么神奇吗?"},{"image":"https:\/\/pic4.zhimg.com\/v2-0754eddc64bf58fdd45a8c2be06086bb.jpg","type":0,"id":9693582,"ga_prefix":"082107","title":"卧底工厂,这是我的蓝领调研全纪实"},{"image":"https:\/\/pic4.zhimg.com\/v2-028e6da5d9285aa4d2e70d852ba21f2b.jpg","type":0,"id":9692796,"ga_prefix":"082108","title":"孩子的每一次失控,都是「求助信号」"},{"image":"https:\/\/pic3.zhimg.com\/v2-62f867675f39ae366bc9c1d27b3deeaa.jpg","type":0,"id":9691683,"ga_prefix":"081913","title":"每周一吸 · 摸完猫狗必须洗手?"}]} |
-http://news.at.zhihu.com/api/4/news/before/20180821
{"date":"20180820","stories":[{"images":["https:\/\/pic4.zhimg.com\/v2-6c3a3016c82c6d9017d6e6408521be8f.jpg"],"type":0,"id":9693567,"ga_prefix":"082022","title":"小事 · 冲动还在,血仍未冷"},{"images":["https:\/\/pic2.zhimg.com\/v2-8919d6146ebafb75b4e0476fc0d9da31.jpg"],"type":0,"id":9693590,"ga_prefix":"082021","title":"今晚点映 · 满州里有一只大象,它整天就坐在那"},{"images":["https:\/\/pic4.zhimg.com\/v2-5f42b189a91982464e99cec36e53becf.jpg"],"type":0,"id":9693223,"ga_prefix":"082019","title":"作为法官,有些亲身经历你们肯定很难相信"},{"images":["https:\/\/pic2.zhimg.com\/v2-d1840f47f20bf0f7ec128ab2af3b76e1.jpg"],"type":0,"id":9693666,"ga_prefix":"082018","title":"中介恶性竞争导致房租暴涨?这并非全部的真相"},{"images":["https:\/\/pic4.zhimg.com\/v2-1a7ffa35a7c385f8b54a364f8447e87b.jpg"],"type":0,"id":9692072,"ga_prefix":"082017","title":"孩子和工作,我到底选哪个?"},{"images":["https:\/\/pic2.zhimg.com\/v2-b7aa21469460cbbfa0d68e85e42c1201.jpg"],"type":0,"id":9693150,"ga_prefix":"082016","title":"那些动不动就上千还要煲的耳机,真有那么神奇吗?"},{"images":["https:\/\/pic2.zhimg.com\/v2-2c434ef50275099fc78785533a59ef85.jpg"],"type":0,"id":9692740,"ga_prefix":"082015","title":"情侣牵手可以「同步脑波」?"},{"images":["https:\/\/pic3.zhimg.com\/v2-0044148868cf76ac0d3062f9c078046a.jpg"],"type":0,"id":9691509,"ga_prefix":"082013","title":"一些关于结婚的法律小常识,还是心里有数比较好"},{"title":"大误 · 能伤人的电子","ga_prefix":"082012","images":["https:\/\/pic1.zhimg.com\/v2-9c1d906acfbc6df6efdfcff23bf1a13c.jpg"],"multipic":true,"type":0,"id":9693391},{"images":["https:\/\/pic1.zhimg.com\/v2-b69a30479f538e4c0dcbeb698983db38.jpg"],"type":0,"id":9693281,"ga_prefix":"082010","title":"诶,你这个做偶像游戏的,怎么突然开起了车?"},{"images":["https:\/\/pic2.zhimg.com\/v2-3cc349a3233b5ea4566c4cd469cb3fb5.jpg"],"type":0,"id":9693231,"ga_prefix":"082009","title":"- 游泳嘛,去深水区喝几口就会了\r\n- 开车嘛,开上街剐蹭几下就会了"},{"images":["https:\/\/pic3.zhimg.com\/v2-1098ffa8c2a15144e5158507b310851a.jpg"],"type":0,"id":9692041,"ga_prefix":"082008","title":"治理沙漠为什么不直接用管道输送海水?"},{"images":["https:\/\/pic2.zhimg.com\/v2-fc0664c1836789195ba792f20d2ec851.jpg"],"type":0,"id":9692522,"ga_prefix":"082007","title":"工作中遇到问题是该自己琢磨还是马上请教?"},{"images":["https:\/\/pic4.zhimg.com\/v2-d9a711025f4954af5845e113aa94ba5f.jpg"],"type":0,"id":9693296,"ga_prefix":"082007","title":"「星座学」不靠谱,但不信也别有什么优越感"},{"images":["https:\/\/pic2.zhimg.com\/v2-339df242fb3f59b35fff0fc309b60ee5.jpg"],"type":0,"id":9693471,"ga_prefix":"082006","title":"瞎扯 · 如何正确地吐槽"}]} |
2、home
-http://news-at.zhihu.com/api/4/themes
{"limit":1000,"subscribed":[],"others":[{"color":15007,"thumbnail":"http:\/\/pic3.zhimg.com\/0e71e90fd6be47630399d63c58beebfc.jpg","description":"了解自己和别人,了解彼此的欲望和局限。","id":13,"name":"日常心理学"},{"color":8307764,"thumbnail":"http:\/\/pic4.zhimg.com\/2c38a96e84b5cc8331a901920a87ea71.jpg","description":"内容由知乎用户推荐,海纳主题百万,趣味上天入地","id":12,"name":"用户推荐日报"},{"color":14483535,"thumbnail":"http:\/\/pic3.zhimg.com\/00eba01080138a5ac861d581a64ff9bd.jpg","description":"除了经典和新片,我们还关注技术和产业","id":3,"name":"电影日报"},{"color":8307764,"thumbnail":"http:\/\/pic4.zhimg.com\/4aa8400ba46d3d46e34a9836744ea232.jpg","description":"为你发现最有趣的新鲜事,建议在 WiFi 下查看","id":11,"name":"不许无聊"},{"color":62140,"thumbnail":"http:\/\/p1.zhimg.com\/d3\/7b\/d37b38d5c82b4345ccd7e50c4ae997da.jpg","description":"好设计需要打磨和研习,我们分享灵感和路径","id":4,"name":"设计日报"},{"color":1615359,"thumbnail":"http:\/\/pic4.zhimg.com\/aa94e197491fb9c44d384c4747773810.jpg","description":"商业世界变化越来越快,就是这些家伙干的","id":5,"name":"大公司日报"},{"color":16031744,"thumbnail":"http:\/\/pic2.zhimg.com\/f2e97ff073e5cf9e79c7ed498727ebd6.jpg","description":"从业者推荐的财经金融资讯","id":6,"name":"财经日报"},{"color":9699556,"thumbnail":"http:\/\/pic2.zhimg.com\/98d7b4f8169c596efb6ee8487a30c8ee.jpg","description":"把黑客知识科普到你的面前","id":10,"name":"互联网安全"},{"color":59647,"thumbnail":"http:\/\/pic3.zhimg.com\/2f214a4ca51855670668530f7d333fd8.jpg","description":"如果你喜欢游戏,就从这里开始","id":2,"name":"开始游戏"},{"color":1564695,"thumbnail":"http:\/\/pic4.zhimg.com\/eac535117ed895983bd2721f35d6e8dc.jpg","description":"有音乐就很好","id":7,"name":"音乐日报"},{"color":6123007,"thumbnail":"http:\/\/pic1.zhimg.com\/a0f97c523c64e749c700b2ddc96cfd7c.jpg","description":"用技术的眼睛仔细看懂每一部动画和漫画","id":9,"name":"动漫日报"},{"color":16046124,"thumbnail":"http:\/\/pic1.zhimg.com\/bcf7d594f126e5ceb22691be32b2650a.jpg","description":"关注体育,不吵架。","id":8,"name":"体育日报"}]} |
3、list
-http://news-at.zhihu.com/api/4/theme/13
{"stories":[{"type":0,"id":7097426,"title":"人们在虚拟生活中投入的精力是否对现实生活的人际关系有积极意义?"},{"images":["http:\/\/pic1.zhimg.com\/56d1d1202077c7b5b0e48e3b7d3ebb60_t.jpg"],"type":0,"id":7101963,"title":"写给想成为心理咨询师的学生同仁"},{"type":0,"id":7086807,"title":"职人介绍所 · 自闭儿童的解锁人"},{"images":["http:\/\/pic2.zhimg.com\/afecdc04983a8e261326386995150599_t.jpg"],"type":0,"id":7066097,"title":"家庭的生命周期:关于「离家」"},{"images":["http:\/\/pic4.zhimg.com\/1c4d1cd8edb7ed1e2045109c79870127_t.jpg"],"type":0,"id":7032789,"title":"艰难的孩子和孩子的艰难"},{"type":0,"id":7015707,"title":"家长该如何处理儿童的自慰行为?"},{"type":0,"id":7014561,"title":"从心理层面看,「婚外情」究竟是什么?"},{"type":0,"id":7014068,"title":"人类为什么需要仪式?"},{"type":0,"id":4856502,"title":"心理学从业者怎么看待近年来在国内心理咨询和治疗中十分流行的沙盘(箱庭)疗法?"},{"type":0,"id":4854969,"title":"为什么她总爱上同一类型的「渣」男?"},{"type":0,"id":4851024,"title":"国外幼教现状如何?"},{"images":["http:\/\/pic1.zhimg.com\/c7cd4c64f429b79e6d269723bd7b10f0_t.jpg"],"type":0,"id":4827436,"title":"从日俄战争到神经科学的二次革命(多图)"},{"images":["http:\/\/pic1.zhimg.com\/673f13f858f5fe6970104ba3319c33b8_t.jpg"],"type":0,"id":4820022,"title":"就这样面对爱人的糟糕情绪"},{"type":0,"id":4814564,"title":"意识、感知和注意力之间有怎样的关系?"},{"type":0,"id":4806764,"title":"小时候缺爱,成年后如何解决?"},{"type":0,"id":4802579,"title":"为什么得到了想要的,却不像想象中那样开心?"},{"type":0,"id":4738657,"title":"为什么很多老人都不喜欢使用家用电器?"},{"type":0,"id":4739134,"title":"心理咨询的时间为什么要控制在一小时左右?"}],"description":"了解自己和别人,了解彼此的欲望和局限。","background":"http:\/\/pic2.zhimg.com\/71c8bcd3d99958de45ed87b8fc213224.jpg","color":15007,"name":"日常心理学","image":"http:\/\/pic4.zhimg.com\/60b69ef145a472f2c6b5302453f95eaa.jpg","editors":[{"url":"http:\/\/www.zhihu.com\/people\/moheng-esther","bio":"树上的女爵","id":79,"avatar":"http:\/\/pic1.zhimg.com\/0a6456810_m.jpg","name":"刘柯"}],"image_source":""} |
4、detail
-http://news-at.zhihu.com/api/4/news/4739134
{"body":"<div class=\"main-wrap content-wrap\">\n<div class=\"headline\">\n\n\n<h1 class=\"headline-title onlyheading\">心理咨询的时间为什么要控制在一小时左右?<\/h1>\n\n\n\n\n<\/div>\n\n<div class=\"content-inner\">\n\n\n\n\n<div class=\"question\">\n<h2 class=\"question-title\"><\/h2>\n\n<div class=\"answer\">\n\n<div class=\"meta\">\n<img class=\"avatar\" src=\"http:\/\/pic4.zhimg.com\/c4601862edf6b197c501c798455568df_is.jpg\">\n<span class=\"author\">钱庄,<\/span><span class=\"bio\">(微信公号know yourself)临床心理,女性主义,话语及诗歌。<\/span>\n<\/div>\n\n<div class=\"content\">\n谢邀。早就想回答关于“咨询一小时”的问题了……这其实是一个历史问题和经济问题。<br><br><b>一、心理咨询小节并不是一开始就是“一小时\"的。<\/b><br><br>先给大家讲个段子:<br>祖师爷弗洛伊德是以不守规矩而“臭名昭著”的。<br>Once upon a time, 奥地利著名作曲家、指挥家古斯塔夫·马勒曾经因为重度抑郁和妻子出轨求助弗洛伊德,我们的弗洛伊德大爷(昨天是他的生日)给他做了一个长达4小时的精神分析取向咨询,并且他们俩不是在咨询室里做的,而是在城市里游走,边走边做的。<br>那次的咨询是卓有成效的,因为第二天,马勒给妻子发电报说,感觉棒极了!讨论的太好了!经过这次咨询,马勒修复了自己的“性能量”,和妻子和解了。(虽然他一年后就死了,噗)<br><br>如今我们有了很多的规则,这样的咨询小节在现在看来是不可想象的(甚至是有罪的)。是什么规则在规定小节的时间呢?<br><br><b>二、规定心理咨询小节时间的Current Procedural Terminology (CPT) Code<\/b><br><br>现行心理咨询行业的规则,基本都来源于西方,尤其是美国。而国内的我们很少能够理解,在美国心理咨询属于医疗行业的一部分,它的设置受到医疗保险的直接影响(有机会请邀请我回答关于美国医保的问题)。心理医生能不能接收第三方保险,病人能不能享用第三方保险,至关重要。几乎没有人是自己掏钱看心理咨询的(很贵),保险让心理医生有饭吃,让病人看得起心理咨询,所以保险是影响心理咨询行业设置的重要因素(if not the most important one).<br><br><b>Current Procedural Terminology (CPT) Code set 是一套医疗Code体系,由美国医疗协会<\/b>American Medical Association (AMA)开发,用来规定医药的、手术的、诊断的服务,同时它是普适的关于医疗服务(包括外科医生、精神科医生、保险人员、病人、认证机构、支付方等等)流程的沟通机制。每年十月会发布新版本,先行的CPT Code是2014年10月发布的。<br><br>一个心理医生,能不能收到保险公司的费用,除了执照问题之外,他如何收到钱,是由这个CPT码决定的。<br><br>现行CPT规定,心理咨询(psychotherapy)是根据时间来收费的,但收费的方式有三种,30分钟,45分钟和60分钟。很神奇的是,17-37分钟的小节,都按照30分钟来收费,38-52分钟的小节都按照45分钟来收费,52分钟以上的小节按照60分钟来收费。<br><br><b>也就是说,假如一个咨询师,今天给来访者做了超过60分钟的咨询,比如90分钟,120分钟甚至(我看到国内有些心理咨询师说自己的设置是一次两小时),在美国就不会有这种情况(除非是精神科医生或小节中有其他内容,后续会说到),因为多做的60分钟无法收费的啊!按规定不给钱的!咨询师又不傻…………<\/b><br><br>三、<b>心理咨询既是一门专业,也是一门生意<\/b><br><br><br>其实很少有数据能够显示,多长时间的咨询小节是效果最理想的。这跟更根本的原因有关,一直以来,心理领域的研究获得的资金会少于其他科学领域(这是因为整个西方,尤其美国,现在推崇“实证”——即有明显的证据,可以通过实验检验,在条件相同的前提下结果可以重复发生),心理领域的实证性显然是存疑的。<b>所以,一切都是因为穷,我们并不真正知道多长的时间作为一小节最合适。<\/b><br><br><br><br><b>那为什么现行的最常见的心理咨询是一小时左右?因为心理咨询是服务,对心理咨询师来说,这是他的专业(profession),也是他的生意(business)<\/b><br><br><br>在保证效果的前提下,一个咨询师一天能接的客户越多,他的财务越能得到保证。因为还会有一些突然取消的情况,美国的心理医生都会预先多安排一些小节。<b>他们在长期尝试之后发现50分钟是比较可行的,能够在保证效果的前提下,让他一周安排进最多的小节的时间长度。<\/b><br><br><br><b>我们很多人,包括心理咨询师自己,都回避心理咨询business的一面,在回答“为什么心理咨询要付费\"、“为什么一小时只有50分钟”一类的问题是,过多强调利他性,回避提供心理咨询服务对咨询师本身“利己”的一面,这其实也是伦理有害的。<\/b><br><br>心理咨询师不是圣人,不是拯救者。客观性是我们的专业要求。这个客观性也包括客观的看待自己的需求和利益。这有利于来访者和我们建立专业的、边界清晰的咨询关系。<br><br>最后给一些大家常用的解释,仅供参考,<br><br><p>1 心理咨询是精神紧张的,一个人一次能够吸取的有限,所以不能太长。<\/p><br><p>2. 心理咨询师需要有一个间歇的时间来做笔记,思考,计划。<\/p><br><p>3. 这个时间能够让来访者形成一个习惯,有足够的时间释放激烈的情绪,然后维持他们,并在出门继续上班前收拾好自己。<\/p><br><p>4.标准化的设置(包括停止时间和场地)是一种评估来访者行为习惯的方式,比如来访者是不是总在超过时间的时候表达自己,来访者会不会尝试拖延时间。这种观察通常很重要也有效。<\/p><br><p>5.心理咨询师都知道,来访者通常会在咨询快结束的时候说一些重要的事情。这就是传说中的“门把效应”,设置一个结束时间可以看到这个门把效应。<\/p><br><p>不过我自己最喜欢这个通用的答案:<\/p><br><p><b>心理咨询小节为什么只有50分钟?因为祖师爷爷弗洛伊德不到50分钟就忍不住要上厕所了 ……<\/b><\/p><br><br><p>以上。<\/p><br><br><p>补充,前面有人提到第一次见面做2小时的问题,说法不太精确。<\/p><br><p><b>现在心理咨询还有超过1小时的时候么?有,叫Double Session。确实是发生在第一次咨询的时候。但是Double Session虽然在实际的感受中是一个连续的超过1小时的咨询,在账单Billing和保险公司使用的code中,其实是两个内容。<\/b><\/p><br><p>其实美国的心理咨询服务billing是很复杂的。<\/p><p>单纯的心理咨询对应一种billing code,包括了开药(由精神科医生提供的心理咨询)的对应另外一种billing code。包括了education教育内容的(比如性教育)对应的也是另外一种billing code。<\/p><br><p>最常见的bouble session是由两个CPT规定的45分钟的session组成的,(复习一下,实际操作在38-52分钟的小节都按照45分钟计算),所以double sesssion的时间在80-100分钟,最常见的还是90分钟,一个半小时,并且是由精神科医生提供的。内容除了包括心理咨询,还有药物评估的服务(或者有开药的服务)。<\/p><br><p>收到账单的时候,你会看到两行,一行是心理咨询,一行是药物服务,分别计费。<\/p><br><p>国内因为太混乱,也实在没啥可说的……欢迎下次邀请我回答中美心理咨询制度差异问题。<\/p><br><p>以上。<\/p><p>----------------------------------------------------------------------------------------------------------------------------------------<\/p><br><p>2015年5月8日更新<\/p><br><p>补充一下,关于心理咨询室内的时间控制,并不是像微波炉一样,45分钟到了“ding”的一声,咨询师立刻站起来说对不起时间到了。<\/p><br><p>时间控制的技巧,从咨询的第一分钟就已经开始了,通过提问的节奏,和对话题的把握,在时间快到的时候,让整个咨询有一种自然的接近尾声的感觉,让双方都觉得这次停在这里很合适——这是需要能耐的,我把它看成“活儿好”的其中一个标准。<\/p><br><p>大多数时候,就像有些其他答主说的,稳定的设置非常重要,但是总有那么一两个剑走偏锋的奇葩,有一个叫做Jacques Lacan拉冈的法国精神分析师,精神科医生(虽然我说的很随意,但这个人很有名的,超级有名的),他提出了<b>variable-length session <\/b>可变长度的小节。<\/p><br><p>有一位女士在接受拉冈的治疗时,刚聊了7分钟,拉冈忽然站起来说,我们今天的咨询到此为止。(奏是这么任性啊!)<\/p><br><p>他把精神分析小节的时间缩短到几分钟,并且完全由咨询师掌握。他认为这样做能够让来访者在咨询中更专注于一些特别关键的时刻crucial moments。<\/p><br><p>不过显然他的同事不买账……他被同事们开除出了IPA精神分析协会,不过他后来还是愈挫愈勇建立了自己的精神分析协会,成为现在国际上最大的精神分析协会之一……这是后话了。<\/p><br><p>以上。<\/p>\n<\/div>\n<\/div>\n\n\n<div class=\"view-more\"><a href=\"http:\/\/www.zhihu.com\/question\/30160875\">查看知乎讨论<span class=\"js-question-holder\"><\/span><\/a><\/div>\n\n<\/div>\n\n\n<\/div>\n<\/div><script type=“text\/javascript”>window.daily=true<\/script>","title":"心理咨询的时间为什么要控制在一小时左右?","recommenders":[{"avatar":"http:\/\/pic3.zhimg.com\/78b7e4e32_m.jpg"},{"avatar":"http:\/\/pic3.zhimg.com\/a532ee0ee_m.jpg"},{"avatar":"http:\/\/pic4.zhimg.com\/083b51287_m.jpg"}],"share_url":"http:\/\/daily.zhihu.com\/story\/4739134","js":[],"theme":{"thumbnail":"http:\/\/pic3.zhimg.com\/0e71e90fd6be47630399d63c58beebfc.jpg","id":13,"name":"日常心理学"},"ga_prefix":"051908","type":0,"id":4739134,"css":["http:\/\/news-at.zhihu.com\/css\/news_qa.auto.css?v=4b3e3"]} |
5、
5.返回顶部 |
0、
1、
6.返回顶部 |
作者:ylbtech 出处:http://ylbtech.cnblogs.com/ 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。 |