Skip to content
This repository has been archived by the owner on Nov 15, 2018. It is now read-only.

Commit

Permalink
fix: #403 动态详情点击需要付费的图片弹出付费窗口
Browse files Browse the repository at this point in the history
  • Loading branch information
mutoe committed Jun 27, 2018
1 parent 570bfb7 commit aa53b6d
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion src/page/feed/feedDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<img
slot-scope="props"
v-if="props.src"
:src="props.src"/>
:src="props.src" @click="onFileClick(img)"/>
</async-file>
<p class="m-text-box" v-html="formatBody(feedContent)"></p>
</div>
Expand Down Expand Up @@ -580,6 +580,30 @@ export default {
this.fetchFeed(() => {
this.$refs.loadmore.topEnd();
});
},
onFileClick(paid_node) {
if (!paid_node || paid_node.paid) return;
if (this.$lstore.hasData("H5_ACCESS_TOKEN")) {
bus.$emit("payfor", {
nodeType: "内容",
node: paid_node.paid_node,
amount: paid_node.amount,
onSuccess: data => {
this.$Message.success(data);
this.feed.images = null;
this.fetchFeed();
}
});
} else {
this.$nextTick(() => {
const path = this.$route.fullPath;
this.$router.push({
path: "/signin",
query: { redirect: path }
});
});
}
}
},
activated() {
Expand Down

0 comments on commit aa53b6d

Please sign in to comment.