Skip to content

Commit be7f76b

Browse files
committed
删除 发帖/回复功能
1 parent c7889a0 commit be7f76b

11 files changed

Lines changed: 51 additions & 400 deletions

File tree

src/App.vue

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ export default {
44
wx.showShareMenu({
55
withShareTicket: true,
66
});
7-
// 调用API从本地缓存中获取数据
8-
const logs = wx.getStorageSync('logs') || [];
9-
logs.unshift(Date.now());
10-
wx.setStorageSync('logs', logs);
11-
12-
console.log('app created and cache logs by setStorageSync'); // eslint-disable-line
137
},
148
};
159
</script>

src/app.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"pages/index/main",
44
"pages/logs/main",
55
"pages/detail/main",
6-
"pages/publish/main",
76
"pages/good/main",
87
"pages/share/main",
98
"pages/ask/main",

src/pages/ask/index.vue

Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,11 @@
2626
</div>
2727
</div>
2828
</div>
29-
<div class="menu-list" :class="{ 'menu-list-ani': isRotate }">
30-
<ul @click="filterTab($event)" v-for="item of tabs" :key="item.key">
31-
<li :data-tab="item.key">{{ item.name }}</li>
32-
</ul>
33-
</div>
3429
<div
30+
v-if="isScan"
3531
class="cnode-menu-bar"
36-
:class="{ 'cnode-menu-bar-ani': isRotate }"
37-
@click="changeRotate()"
38-
>+</div>
32+
@click="scanLogin()"
33+
>[ ]</div>
3934
</div>
4035
</template>
4136

@@ -53,11 +48,6 @@ export default {
5348
topics: [],
5449
pageSize: 10,
5550
currentPage: 1,
56-
isRotate: false,
57-
tabs: [
58-
{ name: '发帖', key: 'publish' },
59-
{ name: '登录', key: 'scan' },
60-
],
6151
};
6252
},
6353
methods: {
@@ -95,13 +85,6 @@ export default {
9585
url: `${url}?${key}=${value}`,
9686
});
9787
},
98-
changeRotate() {
99-
if (this.isRotate) {
100-
this.isRotate = false;
101-
} else {
102-
this.isRotate = true;
103-
}
104-
},
10588
scanLogin() {
10689
scanCode().then((res) => {
10790
if (res.errMsg === 'scanCode:ok') {
@@ -120,16 +103,6 @@ export default {
120103
}
121104
});
122105
},
123-
filterTab(event) {
124-
const { dataset: { tab } } = event.target;
125-
if (tab !== 'scan') {
126-
wx.navigateTo({
127-
url: '/pages/publish/main',
128-
});
129-
} else {
130-
this.scanLogin();
131-
}
132-
},
133106
},
134107
onReachBottom() {
135108
this.scrolltolower();
@@ -138,6 +111,10 @@ export default {
138111
this.getTopics();
139112
},
140113
mounted() {
114+
const accesstoken = wx.getStorageSync('token');
115+
if (accesstoken) {
116+
this.isScan = false;
117+
}
141118
this.getTopics();
142119
},
143120
};
@@ -232,11 +209,12 @@ export default {
232209
right: 30px;
233210
bottom: 30px;
234211
color: #333;
235-
font-size: 24px;
212+
font-size: 16px;
236213
position: fixed;
237-
line-height: 36px;
214+
line-height: 40px;
238215
text-align: center;
239216
border-radius: 100%;
217+
transform: rotate(90deg);
240218
background-color: #eeeeee;
241219
transition: all 0.3s ease-in-out;
242220
}

src/pages/detail/index.vue

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,6 @@
4040
</div>
4141
</div>
4242
</div>
43-
<div class="reply-topic" @click="showReply()">
44-
+
45-
</div>
46-
<div class="reply-form" v-show="isShowReply">
47-
<div class="reply-mask"></div>
48-
<div class="reply-content">
49-
<textarea v-model="content" cols="30" rows="10"></textarea>
50-
<div class="reply-content-bottom">
51-
<div class="cancel button" @click="showReply()">取消</div>
52-
<div class="confirm button" @click="replay(detail.id)">确定</div>
53-
</div>
54-
</div>
55-
</div>
5643
</div>
5744
</div>
5845
</template>
@@ -129,52 +116,6 @@ export default {
129116
this.getTopicDetail(this.$root.$mp.query.id, this.accesstoken);
130117
});
131118
},
132-
showReply() {
133-
this.isShowReply = !this.isShowReply;
134-
},
135-
replay(id) {
136-
if (!this.accesstoken) {
137-
wx.showToast({
138-
title: '请先登录',
139-
icon: 'none',
140-
duration: 1200,
141-
});
142-
return;
143-
}
144-
if (!this.content) {
145-
wx.showToast({
146-
title: '请填写内容',
147-
icon: 'none',
148-
duration: 800,
149-
});
150-
return;
151-
}
152-
this.isShowReply = false;
153-
this.$ajax({
154-
method: 'POST',
155-
url: `https://cnodejs.org/api/v1/topic/${id}/replies`,
156-
data: {
157-
content: this.content,
158-
accesstoken: this.accesstoken,
159-
},
160-
}).then((res) => {
161-
const { success } = res;
162-
if (success) {
163-
wx.showToast({
164-
title: '回复成功',
165-
icon: 'success',
166-
duration: 1200,
167-
});
168-
} else {
169-
wx.showToast({
170-
title: '回复失败',
171-
icon: 'none',
172-
duration: 1200,
173-
});
174-
}
175-
this.getTopicDetail(this.$root.$mp.query.id, this.accesstoken);
176-
});
177-
},
178119
collect(id, collect) {
179120
let url = 'topic_collect/de_collect';
180121
if (!collect) {

src/pages/good/index.vue

Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,11 @@
2626
</div>
2727
</div>
2828
</div>
29-
<div class="menu-list" :class="{ 'menu-list-ani': isRotate }">
30-
<ul @click="filterTab($event)" v-for="item of tabs" :key="item.key">
31-
<li :data-tab="item.key">{{ item.name }}</li>
32-
</ul>
33-
</div>
3429
<div
30+
v-if="isScan"
3531
class="cnode-menu-bar"
36-
:class="{ 'cnode-menu-bar-ani': isRotate }"
37-
@click="changeRotate()"
38-
>+</div>
32+
@click="scanLogin()"
33+
>[ ]</div>
3934
</div>
4035
</template>
4136

@@ -53,11 +48,6 @@ export default {
5348
topics: [],
5449
pageSize: 10,
5550
currentPage: 1,
56-
isRotate: false,
57-
tabs: [
58-
{ name: '发帖', key: 'publish' },
59-
{ name: '登录', key: 'scan' },
60-
],
6151
};
6252
},
6353
methods: {
@@ -95,13 +85,6 @@ export default {
9585
url: `${url}?${key}=${value}`,
9686
});
9787
},
98-
changeRotate() {
99-
if (this.isRotate) {
100-
this.isRotate = false;
101-
} else {
102-
this.isRotate = true;
103-
}
104-
},
10588
scanLogin() {
10689
scanCode().then((res) => {
10790
if (res.errMsg === 'scanCode:ok') {
@@ -120,16 +103,6 @@ export default {
120103
}
121104
});
122105
},
123-
filterTab(event) {
124-
const { dataset: { tab } } = event.target;
125-
if (tab !== 'scan') {
126-
wx.navigateTo({
127-
url: '/pages/publish/main',
128-
});
129-
} else {
130-
this.scanLogin();
131-
}
132-
},
133106
},
134107
onReachBottom() {
135108
this.scrolltolower();
@@ -138,6 +111,10 @@ export default {
138111
this.getTopics();
139112
},
140113
mounted() {
114+
const accesstoken = wx.getStorageSync('token');
115+
if (accesstoken) {
116+
this.isScan = false;
117+
}
141118
this.getTopics();
142119
},
143120
};
@@ -232,11 +209,12 @@ export default {
232209
right: 30px;
233210
bottom: 30px;
234211
color: #333;
235-
font-size: 24px;
212+
font-size: 16px;
236213
position: fixed;
237-
line-height: 36px;
214+
line-height: 40px;
238215
text-align: center;
239216
border-radius: 100%;
217+
transform: rotate(90deg);
240218
background-color: #eeeeee;
241219
transition: all 0.3s ease-in-out;
242220
}

src/pages/index/index.vue

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,11 @@
2626
</div>
2727
</div>
2828
</div>
29-
<div class="menu-list" :class="{ 'menu-list-ani': isRotate }">
30-
<ul @click="filterTab($event)" v-for="item of tabs" :key="item.key">
31-
<li :data-tab="item.key">{{ item.name }}</li>
32-
</ul>
33-
</div>
3429
<div
30+
v-show="isScan"
3531
class="cnode-menu-bar"
36-
:class="{ 'cnode-menu-bar-ani': isRotate }"
37-
@click="changeRotate()"
38-
>+</div>
32+
@click="scanLogin()"
33+
>[ ]</div>
3934
</div>
4035
</template>
4136

@@ -52,11 +47,7 @@ export default {
5247
topics: [],
5348
pageSize: 10,
5449
currentPage: 1,
55-
isRotate: false,
56-
tabs: [
57-
{ name: '发帖', key: 'publish' },
58-
{ name: '登录', key: 'scan' },
59-
],
50+
isScan: true,
6051
};
6152
},
6253
methods: {
@@ -93,13 +84,6 @@ export default {
9384
url: `${url}?${key}=${value}`,
9485
});
9586
},
96-
changeRotate() {
97-
if (this.isRotate) {
98-
this.isRotate = false;
99-
} else {
100-
this.isRotate = true;
101-
}
102-
},
10387
scanLogin() {
10488
scanCode().then((res) => {
10589
if (res.errMsg === 'scanCode:ok') {
@@ -118,16 +102,6 @@ export default {
118102
}
119103
});
120104
},
121-
filterTab(event) {
122-
const { dataset: { tab } } = event.target;
123-
if (tab !== 'scan') {
124-
wx.navigateTo({
125-
url: '/pages/publish/main',
126-
});
127-
} else {
128-
this.scanLogin();
129-
}
130-
},
131105
},
132106
onReachBottom() {
133107
this.scrolltolower();
@@ -136,6 +110,10 @@ export default {
136110
this.getTopics();
137111
},
138112
mounted() {
113+
const accesstoken = wx.getStorageSync('token');
114+
if (accesstoken) {
115+
this.isScan = false;
116+
}
139117
this.getTopics();
140118
},
141119
};
@@ -230,11 +208,12 @@ export default {
230208
right: 30px;
231209
bottom: 30px;
232210
color: #333;
233-
font-size: 24px;
211+
font-size: 16px;
234212
position: fixed;
235-
line-height: 36px;
213+
line-height: 40px;
236214
text-align: center;
237215
border-radius: 100%;
216+
transform: rotate(90deg);
238217
background-color: #eeeeee;
239218
transition: all 0.3s ease-in-out;
240219
}

0 commit comments

Comments
 (0)