researchTheme.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. <template>
  2. <view class="container theme-hot-content">
  3. <view class="tab-bar-ul">
  4. <view class="item-content">
  5. <view @click="tabBarSwitchHandel(item)" :class="['item', tabBarActive === item.value && 'item-act']" v-for="item in tabBarList" :key="item.value">{{ item.name }}</view>
  6. </view>
  7. </view>
  8. <view class="content-ul">
  9. <view class="global_card_content hot-li" v-for="item in dataList" :key="item.IndustrialManagementId">
  10. <image class="hot-icon" v-if="item.IsHot" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/hot_report.png" mode=""></image>
  11. <view class="li-item hot-item" :style="{ 'margin-top': item.IsHot ? '40rpx' : '' }">
  12. <view style="display: flex" class="text_oneLine hot-new" @click="themeDetails(item, '主题热度榜')">
  13. <text class="text_oneLine global_title" style="display: inline">{{ item.IndustryName }} </text>
  14. </view>
  15. <view class="item-wrap">
  16. <zb-popover placement="bottom-end" :options="actions" theme="dark" ref="Popover1" @handleClick="() => popoverHandleClick(item)" @select="selectOption($event, item)">
  17. <view :class="['follw', 'global_content_center']">
  18. <image class="follw-image" :src="getDisplayImg(item)"></image>
  19. {{ getDisplayText(item) }}
  20. </view>
  21. </zb-popover>
  22. </view>
  23. </view>
  24. <view class="li-item read-more" @click="themeDetails(item, '主题热度榜')">
  25. <text class="text-box text_oneLine" v-for="val in item.IndustrialSubjectList" :key="val.IndustrialSubjectId">
  26. {{ val.SubjectName }}
  27. </text>
  28. </view>
  29. </view>
  30. </view>
  31. <u-loadmore :status="status" :load-text="loadText" v-if="page_no > 1" />
  32. <u-modal
  33. v-model="goFollowShow"
  34. :content-style="{ fontSize: '32rpx' }"
  35. @confirm="goFollowShowBtn"
  36. :show-cancel-button="isCancelBtn"
  37. :confirm-text="confirmText"
  38. @cancel="isCancelBtn = false"
  39. :show-title="false"
  40. :cancel-style="{ borderRight: '1rpx solid #EBEBEB' }"
  41. :confirm-style="{ fontWeight: '700' }"
  42. >
  43. <view class="slot-content">
  44. <rich-text :nodes="accounts"></rich-text>
  45. </view>
  46. </u-modal>
  47. <Loading />
  48. </view>
  49. </template>
  50. <script>
  51. import { Reports, Research, Report } from "@/config/api.js";
  52. import mixinsAuthorTheme from "../components/mixinsAuthorTheme";
  53. export default {
  54. data() {
  55. return {
  56. tabBarList: [
  57. {
  58. name: "更新时间",
  59. value: 2,
  60. },
  61. {
  62. name: "主题热度",
  63. value: 1,
  64. },
  65. ],
  66. actions: [
  67. { text: "接受推送", imgUrl: "https://hzstatic.hzinsights.com/new_cygx/AcceptBtn.png", key: 0 },
  68. { text: "重点关注", imgUrl: "https://hzstatic.hzinsights.com/new_cygx/FocusBtn.png", key: 1 },
  69. { text: "不感兴趣", imgUrl: "https://hzstatic.hzinsights.com/new_cygx/uninterestedBtn.png", key: 3 },
  70. ], // 动态设置的气泡选项内容
  71. };
  72. },
  73. mixins: [mixinsAuthorTheme],
  74. methods: {
  75. //主题热度/近期更新更多
  76. async getDataList() {
  77. const res = await Research.researchHotList({
  78. ChartPermissionId: 31,
  79. PageSize: this.pageSize,
  80. CurrentIndex: this.page_no,
  81. ThemeType: this.tabBarActive,
  82. });
  83. if (res.Ret === 200) {
  84. this.status = res.Data.Paging.IsEnd ? "nomore" : "loadmore";
  85. if (this.refresh) {
  86. uni.stopPullDownRefresh();
  87. this.refresh = false;
  88. }
  89. this.dataList = this.page_no === 1 ? res.Data.List || [] : [...this.dataList, ...res.Data.List];
  90. }
  91. },
  92. popoverHandleClick(option) {
  93. this.actions = [
  94. { text: "接受推送", imgUrl: "https://hzstatic.hzinsights.com/new_cygx/AcceptBtn.png", key: 0 },
  95. { text: "重点关注", imgUrl: "https://hzstatic.hzinsights.com/new_cygx/FocusBtn.png", key: 1 },
  96. { text: "不感兴趣", imgUrl: "https://hzstatic.hzinsights.com/new_cygx/uninterestedBtn.png", key: 3 },
  97. ].filter((item) => item.key !== option.FollowType);
  98. },
  99. async selectOption(e, item) {
  100. console.log();
  101. if (!e) return;
  102. await this.$store.dispatch("showLoginModal");
  103. const res = await Reports.reportFllow({ IndustrialManagementId: item.IndustrialManagementId, PageRouter: this.$store.state.pageRouterReport, FollowType: e.key });
  104. if (res.Ret === 200) {
  105. item.FollowType = res.Data.Status;
  106. let content =
  107. res.Data.Status == 1
  108. ? "请关注【查研观向小助手】公众号及时获取产业内容更新提醒"
  109. : res.Data.Status == 0
  110. ? "请关注【查研观向小助手】公众号给您推送产业内容更新"
  111. : "产业内容更新将不再以公众号消息推送给您";
  112. uni.showModal({
  113. title: res.Data.Status == 1 ? "已设置为重点关注产业" : "设置成功",
  114. content,
  115. confirmText: "知道了",
  116. confirmColor: "#376CBB",
  117. showCancel: false,
  118. });
  119. }
  120. },
  121. getDisplayText(item) {
  122. return item.FollowType == 1 ? "重点关注" : item.IsFollow == 0 ? "接受推送" : "不感兴趣";
  123. },
  124. getDisplayImg(item) {
  125. return item.FollowType == 1
  126. ? "https://hzstatic.hzinsights.com/new_cygx/FocusBtn.png"
  127. : item.IsFollow == 0
  128. ? "https://hzstatic.hzinsights.com/new_cygx/AcceptBtn.png"
  129. : "https://hzstatic.hzinsights.com/new_cygx/uninterestedBtn.png";
  130. },
  131. },
  132. };
  133. </script>
  134. <style lang="scss" scope>
  135. .theme-hot-content {
  136. background-color: $uni-bg-color;
  137. padding-bottom: 30rpx;
  138. .tab-bar-ul {
  139. position: sticky;
  140. top: 0;
  141. left: 0;
  142. height: 111rpx;
  143. align-items: center;
  144. display: flex;
  145. justify-content: flex-end;
  146. padding: 10px 20rpx;
  147. background-color: $uni-bg-color;
  148. border-bottom: 2rpx solid #f6f6f6;
  149. z-index: 9;
  150. .item-content {
  151. display: flex;
  152. height: 48rpx;
  153. background: #dcdfe6;
  154. width: 288rpx;
  155. font-size: 24rpx;
  156. font-weight: 600;
  157. border-radius: 150rpx;
  158. color: #666;
  159. }
  160. .item {
  161. display: flex;
  162. align-items: center;
  163. justify-content: center;
  164. width: 144rpx;
  165. height: 48rpx;
  166. border-radius: 150rpx;
  167. }
  168. .item-act {
  169. background-color: $uni-color-new;
  170. color: #fff;
  171. }
  172. }
  173. .content-ul {
  174. padding: 10rpx 30rpx;
  175. .hot-li {
  176. background-color: #fff;
  177. margin-bottom: 20rpx;
  178. position: relative;
  179. }
  180. .li-item {
  181. display: flex;
  182. .title {
  183. font-size: 28rpx;
  184. line-height: 39rpx;
  185. font-weight: 500;
  186. color: #333;
  187. }
  188. .li-industry {
  189. color: $uni-color-new;
  190. margin-left: 20rpx;
  191. display: inline-block;
  192. font-size: 32rpx;
  193. font-weight: 600;
  194. }
  195. .time-user {
  196. display: flex;
  197. align-items: center;
  198. font-size: 24rpx;
  199. }
  200. .li-user {
  201. display: flex;
  202. align-items: center;
  203. flex-shrink: 0;
  204. width: 170rpx;
  205. margin-left: 75rpx;
  206. }
  207. .li-title {
  208. display: flex;
  209. }
  210. }
  211. .read-more {
  212. display: flex;
  213. flex-wrap: wrap;
  214. margin-top: 20rpx;
  215. .text-box {
  216. margin-top: 30rpx;
  217. margin-right: 10rpx;
  218. width: 150rpx;
  219. height: 48rpx;
  220. background-color: #f8f8fa;
  221. color: $uni-color-new;
  222. line-height: 48rpx;
  223. border-radius: 200rpx;
  224. font-weight: 600;
  225. font-size: 24rpx;
  226. text-align: center !important;
  227. text-indent: 0em;
  228. }
  229. }
  230. .hot-item {
  231. justify-content: space-between;
  232. align-items: center;
  233. .hot-new {
  234. align-items: center;
  235. flex: 1;
  236. padding-right: 20rpx;
  237. }
  238. }
  239. .hot-icon {
  240. position: absolute;
  241. width: 106rpx !important;
  242. height: 48rpx !important;
  243. top: 0 !important;
  244. left: 0 !important;
  245. margin: 0 !important;
  246. padding: 0 !important;
  247. border-radius: 0 !important;
  248. }
  249. .follw {
  250. color: #fff;
  251. border-radius: 4rpx;
  252. font-size: 24rpx;
  253. height: 42rpx;
  254. padding: 0 12rpx;
  255. background-color: $uni-color-new;
  256. }
  257. .cancel-follw {
  258. background-color: #e5efff;
  259. color: $uni-color-new;
  260. }
  261. }
  262. .bottom-btn-content {
  263. padding: 15rpx 30px 30rpx;
  264. .opne-content {
  265. display: flex;
  266. align-items: center;
  267. justify-content: center;
  268. image {
  269. width: 24rpx;
  270. height: 24rpx;
  271. }
  272. .content-text {
  273. color: #376cbb;
  274. margin: 0 5rpx 0 10rpx;
  275. }
  276. margin-bottom: 15rpx;
  277. }
  278. .all-setup {
  279. .content-text {
  280. text-decoration: underline;
  281. }
  282. }
  283. }
  284. .follw-image {
  285. width: 32rpx;
  286. height: 32rpx;
  287. margin-right: 10rpx;
  288. }
  289. }
  290. </style>