+
@@ -69,6 +74,8 @@
export default {
name: 'AppCircle',
appName: '邻里互助',
+ navigationBarBackgroundColor: '#ffffff',
+ navigationBarTextStyle: 'black',
data () {
return {
@@ -85,23 +92,54 @@
...mapState(['user', 'token']),
topic () {
- return this.topicList.filter((v, index) => index < 8)
+ return this.topicList.filter((v, index) => index < 7)
}
},
- onLoad() {
+ onLoad () {
this.getTopicList()
uni.$on('updateList', () => {
+ this.getMyPublishCount()
this.changeTab(this.currIndex)
})
- if (this.token) {
+ if (!this.token) {
+ this.autoLogin().then(() => {
+ this.getMyPublishCount()
+ })
+ } else {
this.getMyPublishCount()
}
},
+ onUnload () {
+ uni.$off('updateList')
+ },
+
methods: {
+ ...mapActions(['autoLogin']),
+
+ previewImage (url, files) {
+ uni.previewImage({
+ current: url,
+ urls: files.map(v => v.url)
+ })
+ },
+
+ onBtnClick (e) {
+ },
+
+ reciate (id, appreciateStatus) {
+ this.$instance.post(`/app/appneighborhoodassistance/appreciate?id=${id}`).then(res => {
+ if (res.code === 0) {
+ this.$toast(appreciateStatus ? '取消点赞' : '点赞成功')
+
+ this.changeTab(this.currIndex)
+ }
+ })
+ },
+
getMyPublishCount () {
this.$instance.post(`/app/appneighborhoodassistance/list`, null, {
params: {
@@ -117,6 +155,12 @@
})
},
+ toAdd () {
+ if (!this.user.AreaId) {
+ this.$linkTo('./Add')
+ }
+ },
+
getTopicList () {
this.$instance.post(`/app/appneighborhoodassistancetheme/list`, null, {
withoutToken: true,
@@ -147,8 +191,8 @@
this.$loading()
this.$instance.post(`/app/appneighborhoodassistance/list`, null, {
+ withoutToken: this.token ? false : true,
params: {
- withoutToken: this.token ? false : true,
current: this.current,
size: 10,
visibleRange: this.currIndex === 0 ? 1 : 0
@@ -190,6 +234,19 @@
onReachBottom () {
this.getList()
+ },
+
+ onShareAppMessage (e) {
+ this.$instance.post(`/app/appneighborhoodassistance/share?id=${e.target.dataset.id}`).then(res => {
+ if (res.code === 0) {
+ this.changeTab(this.currIndex)
+ }
+ })
+
+ return {
+ title: e.target.dataset.content.substr(0, 20),
+ path: `/pages/AppCircle/Detail?id=${e.target.dataset.id}&themeId=${e.target.dataset.themeid}&name=${e.target.dataset.name}`
+ }
}
}
@@ -283,20 +340,23 @@
.item-imgs {
display: flex;
align-items: center;
+ flex-wrap: wrap;
image {
- flex: 1;
- height: 202px;
- margin-right: 12px;
+ height: 208px;
+ width: 33.33%;
+ padding-right: 12px;
+ margin-bottom: 12px;
+ box-sizing: border-box;
&:nth-of-type(3n) {
- margin-right: 0;
+ padding-right: 0;
}
}
}
& > p {
- margin: 24px 0;
+ margin: 12px 0;
font-size: 28px;
color: #333333;
}
@@ -307,7 +367,7 @@
height: 88px;
border-top: 1px solid #eeeeee;
- div {
+ div, button {
display: flex;
align-items: center;
justify-content: center;
@@ -326,10 +386,17 @@
}
}
+
.item-content {
margin: 16px 0;
line-height: 1.3;
text-align: justify;
+ word-break: break-all;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
span {
font-size: 28px;
diff --git a/src/project/fengdu/AppCircle/Detail.vue b/src/project/fengdu/AppCircle/Detail.vue
index 90b2950..e9f5ddf 100644
--- a/src/project/fengdu/AppCircle/Detail.vue
+++ b/src/project/fengdu/AppCircle/Detail.vue
@@ -13,14 +13,14 @@
{{ info.content }}