researchChoose.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. <template>
  2. <view class="resear-container" v-if="haveResearch">
  3. <view class="theme">
  4. <view class="theme-title">最新主题关键词</view>
  5. <view class="theme-item">
  6. <text @click="goDetail(item, '标的')" v-for="item in listNew" :key="item.ArticleId">{{ item.IndustryName }}</text>
  7. </view>
  8. </view>
  9. <view class="author-list" v-for="item in dataList" :key="item.DepartmentId">
  10. <view class="author-item">
  11. <view class="img-box">
  12. <image :src="item.ImgUrl" @click="goDetail(item, '作者')"></image>
  13. </view>
  14. <text style="font-size: 28rpx; margin-top: 5rpx" @click="goDetail(item, '作者')">{{ item.NickName }}</text>
  15. <text class="attention attention-cancel" @click="reportFllowDepartment(item.DepartmentId)" v-if="item.IsMyFollow">取消关注</text>
  16. <text class="attention" @click="reportFllowDepartment(item.DepartmentId)" v-else>+关注</text>
  17. </view>
  18. <view class="label-item">
  19. <text v-for="val in item.List" :key="val.ArticleId" @click="goDetail(val)">{{ val.IndustryName }}</text>
  20. </view>
  21. <view class="lucency">
  22. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/broadside-ico.png" mode=""></image>
  23. </view>
  24. </view>
  25. <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="totalPage > 1" />
  26. <view class="bottom-env"> 【研选系列】是机构投资者分享研究内容和原创观点的平台,试行阶段,限时免费,欢迎有内容贡献意愿的客户联系对口销售了解参与方式 </view>
  27. <u-modal
  28. v-model="goFollowShow"
  29. :content-style="{ fontSize: '32rpx' }"
  30. @confirm="goFollowShowBtn"
  31. :show-cancel-button="isCancelBtn"
  32. :confirm-text="confirmText"
  33. @cancel="isCancelBtn = false"
  34. :show-title="false"
  35. :cancel-style="{ borderRight: '1rpx solid #EBEBEB' }"
  36. :confirm-style="{ fontWeight: '700' }"
  37. >
  38. <view class="slot-content">
  39. <rich-text :nodes="accounts"></rich-text>
  40. </view>
  41. </u-modal>
  42. </view>
  43. </template>
  44. <script>
  45. import { Reports } from "@/config/api.js";
  46. import { Throttle } from "@/config/util.js";
  47. export default {
  48. props: {
  49. strategyIndex: {
  50. type: Number,
  51. required: true,
  52. },
  53. tabAct: {
  54. type: Number,
  55. required: true,
  56. },
  57. isNum: {
  58. type: Number,
  59. required: true,
  60. },
  61. pageNumFather: {
  62. type: Number,
  63. default: "",
  64. required: true,
  65. },
  66. },
  67. data() {
  68. return {
  69. dataList: [],
  70. pageSize: 10,
  71. page_no: 1,
  72. listNew: [],
  73. haveData: true,
  74. status: "loadmore",
  75. loadText: {
  76. loadmore: "上拉加载更多",
  77. loading: "加载中",
  78. nomore: "已经到底了",
  79. },
  80. totalPage: "",
  81. haveResearch: false,
  82. goFollowShow: false,
  83. accounts: "",
  84. confirmText: "知道了",
  85. isCancelBtn: false,
  86. };
  87. },
  88. watch: {
  89. strategyIndex: {
  90. handler(val) {
  91. if (val == 5) {
  92. this.industryListByDepartment();
  93. }
  94. },
  95. immediate: true,
  96. },
  97. isNum: {
  98. handler(val) {
  99. if (val > 1 && this.strategyIndex) {
  100. if (this.status === "nomore") return;
  101. this.status = "loading";
  102. this.page_no++;
  103. this.industryListByDepartment();
  104. }
  105. },
  106. },
  107. pageNumFather: {
  108. handler(val) {
  109. if (val == 1) {
  110. this.page_no = 1;
  111. (this.dataList = []), (this.listNew = []);
  112. this.industryListByDepartment();
  113. this.$parent.pageNumFather = "";
  114. }
  115. },
  116. },
  117. },
  118. methods: {
  119. reportFllowDepartment(id) {
  120. Reports.reportFllowDepartment({
  121. DepartmentId: id,
  122. }).then((res) => {
  123. if (res.Ret == 200) {
  124. if (res.Data.Status == 1) {
  125. this.goFollowShow = true;
  126. this.confirmText = res.Data.GoFollow ? "去关注" : "知道了";
  127. if (res.Data.GoFollow) {
  128. this.accounts = `作者关注成功 <br> 想要及时获取该作者新发报告时的消息推送,请关注【查研观向小助手】公众号`;
  129. this.isCancelBtn = true;
  130. } else {
  131. this.accounts = `作者关注成功 <br> 请关注【查研观向小助手】公众号,及时获取该作者的报告更新提醒`;;
  132. }
  133. } else {
  134. uni.showToast({
  135. title: "已取消关注",
  136. duration: 2000,
  137. icon: "none",
  138. });
  139. }
  140. this.dataList.forEach((item) => {
  141. if (item.DepartmentId == id) {
  142. item.IsMyFollow = !item.IsMyFollow;
  143. }
  144. });
  145. }
  146. });
  147. },
  148. industryListByDepartment() {
  149. Reports.industryListByDepartment({
  150. PageSize: this.pageSize,
  151. CurrentIndex: this.page_no,
  152. ChartPermissionId: this.tabAct,
  153. }).then((res) => {
  154. if (res.Ret === 200) {
  155. this.haveResearch = res.Data.HaveResearch;
  156. if (!res.Data.HaveResearch) {
  157. this.$util.modalShow("", "您暂无查看研选权限", "", () => {
  158. uni.reLaunch({
  159. url: "/pages/index/index",
  160. });
  161. });
  162. }
  163. this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
  164. this.totalPage = res.Data.Paging.Pages; //总页数
  165. this.listNew = res.Data.ListnNew || [];
  166. if (this.page_no === 1) {
  167. this.dataList = res.Data.List || [];
  168. this.haveData = this.dataList.length ? true : false;
  169. if (this.refresh) {
  170. uni.stopPullDownRefresh();
  171. this.refresh = false;
  172. }
  173. } else {
  174. this.dataList = this.dataList.concat(res.Data.List);
  175. }
  176. }
  177. });
  178. },
  179. goDetail(item, genre = "") {
  180. const { ArticleId, IndustrialManagementId, DepartmentId } = item;
  181. let id = IndustrialManagementId || "";
  182. let article = ArticleId || "";
  183. let genreId = DepartmentId || "";
  184. uni.navigateTo({
  185. url: "/reportPages/industrialReport/industrialReport?id=" + id + "&idArticle=" + article + "&idGenre=" + genreId + "&type=研选" + "&isGenre=" + genre,
  186. });
  187. },
  188. goFollowShowBtn() {
  189. if (this.confirmText == "去关注") {
  190. uni.navigateTo({
  191. url: "/activityPages/accountsOfficial/accountsOfficial",
  192. });
  193. }
  194. this.goFollowShow = false;
  195. },
  196. },
  197. };
  198. </script>
  199. <style lang="scss" scoped>
  200. .resear-container {
  201. padding: 220rpx 0 0;
  202. background-color: #f7f7f7;
  203. .theme {
  204. padding: 30rpx 34rpx 0;
  205. margin-bottom: 20rpx;
  206. background: #ffffff;
  207. .theme-title {
  208. font-size: 32rpx;
  209. font-weight: bold;
  210. margin-bottom: 20rpx;
  211. color: #333333;
  212. }
  213. .theme-item {
  214. display: flex;
  215. flex-wrap: wrap;
  216. text {
  217. box-sizing: border-box;
  218. padding: 13rpx 45rpx;
  219. color: #2c83ff;
  220. font-size: 28rpx;
  221. background: #ebf4ff;
  222. border-radius: 35rpx;
  223. margin: 0 30rpx 30rpx 0;
  224. overflow: hidden;
  225. white-space: nowrap;
  226. text-overflow: ellipsis;
  227. }
  228. }
  229. }
  230. .author-list {
  231. position: relative;
  232. margin-bottom: 10rpx;
  233. padding: 20rpx 30rpx 20rpx 55rpx;
  234. background: #ffffff;
  235. display: flex;
  236. .author-item {
  237. height: 240rpx;
  238. padding: 0rpx 78rpx 0rpx 0;
  239. border-right: 2rpx solid #e5e5e5;
  240. text-align: center;
  241. .img-box {
  242. width: 140rpx;
  243. height: 140rpx;
  244. overflow: hidden;
  245. border-radius: 10rpx;
  246. image {
  247. width: 100%;
  248. height: 100%;
  249. }
  250. }
  251. .attention {
  252. margin-top: 6rpx;
  253. padding: 4rpx 20rpx;
  254. font-size: 24rpx;
  255. border-radius: 30rpx;
  256. color: #ffffff;
  257. background: #2c83ff;
  258. }
  259. .attention-cancel {
  260. color: #666666 !important;
  261. background: #f8f8fa !important;
  262. }
  263. }
  264. .label-item {
  265. padding: 10rpx 0 0 34rpx;
  266. overflow: hidden;
  267. white-space: nowrap;
  268. text {
  269. color: #2c83ff;
  270. font-size: 28rpx;
  271. margin-bottom: 12rpx;
  272. }
  273. }
  274. .lucency {
  275. position: absolute;
  276. top: 0;
  277. right: 0;
  278. width: 80rpx;
  279. height: 100%;
  280. image {
  281. width: 100%;
  282. height: 100%;
  283. }
  284. }
  285. }
  286. .bottom-env {
  287. background: #f7f7f7;
  288. padding: 10rpx 50rpx;
  289. color: #999999;
  290. font-size: 26rpx;
  291. }
  292. }
  293. </style>