specialResearchPage.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. <template>
  2. <block>
  3. <view class="container special-research" v-if="isUserBindingPhoneNumber">
  4. <view class="top-notice">
  5. <view class="notice">
  6. <van-notice-bar color="#E37318" background="#FFF1E9" :text="wholeShowListData.ActivitySpecialExplain" />
  7. </view>
  8. <view class="notice-right">
  9. <view :class="['inform-btn', specialIsFollow && 'inform-follow']" @click="specialFollow">{{ specialIsFollow ? "取消通知" : "新调研通知" }}</view>
  10. </view>
  11. </view>
  12. <!-- 活动列表 -->
  13. <view>
  14. <view class="collect-ul">
  15. <view class="collect-ltem global_card_content" v-for="(item, index) in collectList" :key="index">
  16. <view class="reminder-item">
  17. <image v-if="item.TripStatus == 1" class="item" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/Ybm.png"></image>
  18. <image v-if="item.TripStatus == 2" class="item" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/trip_icon.png"></image>
  19. <image v-if="item.Explain" @click="reminderTextHandler(item)" class="reminder" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/error-circle-filled.png"></image>
  20. </view>
  21. <view class="title-date" @click="goDetail(item)">
  22. <text :class="item.SpecialType == 1 ? '' : 'xianxia'">{{ item.SpecialType == 1 ? "线上" : "线下" }}</text>
  23. <view class="city-img" v-if="item.City">
  24. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/position.png"></image>
  25. {{ item.City }}
  26. </view>
  27. </view>
  28. <view class="item-li">
  29. <view class="item-img" @click="goDetail(item)">
  30. <image :src="item.ImgUrl"> </image>
  31. <image v-if="item.ActiveState == 1" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/not_started_activity.png" class="img-status"></image>
  32. <image v-else-if="item.ActiveState == 2" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/in_progress_activity.png" class="img-status"></image>
  33. <image v-else-if="item.ActiveState == 0 && item.TripStatus == 2" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/end_activity.png" class="img-status"></image>
  34. </view>
  35. <view class="item">
  36. <view class="item-text" @click="goDetail(item)">
  37. <text class="activity-title"> {{ item.ResearchTheme }} </text>
  38. <view style="display: flex" class="global_activity_content text_twoLine" v-if="item.TripStatus == 2">
  39. <text style="flex-shrink: 0"> 活动时间:</text>
  40. <text> {{ item.ActivityTimeTextByDay }}</text>
  41. </view>
  42. <text class="global_activity_content text_twoLine" v-else>预期时间:{{ item.ActivityTimeText }} </text>
  43. </view>
  44. <view class="bottom-box">
  45. <view class="" style="width: 130rpx"> </view>
  46. <text @click="lookImg(item)">行程安排</text>
  47. <block v-if="item.TripStatus == 2">
  48. <text v-if="item.ActiveState == 1" class="button" @click="applyOfcancel(item)">{{ item.IsTrip == 0 ? "我要报名" : "取消报名" }}</text>
  49. </block>
  50. <block v-else>
  51. <text class="button" v-if="item.IsSignup !== 1" @click="interest(item)">感兴趣</text>
  52. <text class="button" @click="beNotInterested(item)" v-else>已预报名</text>
  53. </block>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="totalPage > 1" />
  59. </view>
  60. <view class="select-box"> </view>
  61. <!-- 所有自定义弹框 -->
  62. </view>
  63. <freeCharge class="free-charge" :isShowFreeBtn="isShowFree" />
  64. <u-modal
  65. v-model="specialGoFollowShow"
  66. :content-style="{ fontSize: '32rpx' }"
  67. :show-cancel-button="show_cancel_button"
  68. confirm-text="知道了"
  69. :show-confirm-button="show_confirm_button"
  70. :show-title="false"
  71. :cancel-style="{ borderRight: '1rpx solid #EBEBEB' }"
  72. :confirm-style="{ fontWeight: '700' }"
  73. :mask-close-able="specialIsHintShow"
  74. @confirm="ininModalHandler"
  75. @cancel="ininModalHandler"
  76. >
  77. <view class="slot-content">
  78. <block v-if="specialPopupMsg">
  79. <text>{{ specialAccounts }}</text>
  80. <text class="light-hint">{{ specialPopupMsg }}</text>
  81. </block>
  82. <rich-text v-else :nodes="specialAccounts"></rich-text>
  83. </view>
  84. </u-modal>
  85. </view>
  86. <not-have-login v-else />
  87. <Loading />
  88. </block>
  89. </template>
  90. <script>
  91. import { activity, User } from "@/config/api.js";
  92. import { Throttle } from "@/config/util.js";
  93. import freeCharge from "@/components/freeCharge";
  94. import specialMixins from "../components/specialMixins";
  95. import NotHaveLogin from "@/components/notHaveLogin.vue";
  96. export default {
  97. data() {
  98. return {
  99. page_no: 1,
  100. pageSize: 10,
  101. collectList: [],
  102. status: "loadmore",
  103. refresh: false, //正在下拉
  104. loadText: {
  105. loadmore: "上拉加载更多",
  106. loading: "加载中",
  107. nomore: "已经到底了",
  108. },
  109. };
  110. },
  111. mixins: [specialMixins],
  112. components: {
  113. freeCharge,
  114. NotHaveLogin,
  115. },
  116. methods: {
  117. // 获取事件
  118. async getActivityList() {
  119. const res = await activity.getSpecialList({
  120. PageSize: this.pageSize,
  121. CurrentIndex: this.page_no,
  122. });
  123. if (res.Ret === 200) {
  124. this.specialIsFollow = res.Data.IsFollow;
  125. this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
  126. if (this.page_no === 1) {
  127. this.collectList = res.Data.List || [];
  128. if (this.refresh) {
  129. uni.stopPullDownRefresh();
  130. this.refresh = false;
  131. }
  132. } else {
  133. this.collectList = this.collectList.concat(res.Data.List);
  134. }
  135. }
  136. },
  137. // 查看行程的事件
  138. lookImg(item) {
  139. this.getRecordTracking(this.$store.state.pageRouterActivity, { ActivityId: item.ActivityId, Source: "查看行程" });
  140. uni.previewImage({
  141. urls: [item.TripImgLink], //查看图片的数组
  142. });
  143. },
  144. // 去往详情页面
  145. goDetail(item) {
  146. uni.navigateTo({ url: "/activityPages/specialDetail/specialDetail?id=" + item.ActivityId });
  147. },
  148. // 点击感兴趣
  149. async interest(item) {
  150. const res = await activity.postSpecialSignupAdd({
  151. ActivityId: item.ActivityId,
  152. PageRouter: this.$store.state.pageRouterActivity,
  153. });
  154. if (res.Ret === 200) {
  155. this.modalShow(res);
  156. if (res.Data.SignupStatus == 1) {
  157. item.IsSignup = 1;
  158. }
  159. }
  160. },
  161. // 已预报名、就是不感兴趣
  162. beNotInterested(item) {
  163. uni.showModal({
  164. content: "您要取消此次专研调研的预报名吗?",
  165. confirmColor: "#376cbb",
  166. cancelColor: "#606266",
  167. success: async (res) => {
  168. if (res.confirm) {
  169. const res = await activity.postSpecialSignupAdd({
  170. ActivityId: item.ActivityId,
  171. PageRouter: this.$store.state.pageRouterActivity,
  172. });
  173. if (res.Ret === 200) {
  174. item.IsSignup = 0;
  175. }
  176. }
  177. },
  178. });
  179. },
  180. // 新调研通知
  181. async specialFollow() {
  182. this.show_confirm_button = true;
  183. if (this.specialIsFollow) {
  184. uni.showModal({
  185. content: "您要取消【专项调研】新活动通知吗?",
  186. confirmColor: "#376cbb",
  187. cancelColor: "#606266",
  188. success: async (res) => {
  189. if (res.confirm) {
  190. const res = await activity.postSpecialFollow();
  191. if (res.Ret === 200) {
  192. this.specialIsFollow = !this.specialIsFollow;
  193. }
  194. }
  195. },
  196. });
  197. } else {
  198. const res = await activity.postSpecialFollow();
  199. if (res.Ret === 200) {
  200. this.show_cancel_button = true;
  201. this.specialIsFollow = !this.specialIsFollow;
  202. this.specialGoFollowShow = true;
  203. }
  204. }
  205. },
  206. },
  207. onLoad(option) {
  208. this.isUserBindingPhoneNumber && this.getActivityList();
  209. },
  210. onShow() {
  211. this.$store.commit("setRouterReport", "专项调研列表");
  212. this.$store.commit("setRouterActivity", "专项调研列表");
  213. },
  214. /* 触底 */
  215. onReachBottom: Throttle(function () {
  216. if (this.status === "nomore") return;
  217. this.status = "loading";
  218. this.page_no++;
  219. this.getActivityList();
  220. }),
  221. /* 下拉刷新 */
  222. onPullDownRefresh: Throttle(function () {
  223. this.page_no = 1;
  224. this.refresh = true;
  225. this.getActivityList();
  226. }),
  227. /** 用户点击分享 */
  228. onShareAppMessage: function (res) {
  229. return {
  230. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费试用月卡!" : "专项产业调研",
  231. path: "/activityPages/specialResearchPage/specialResearchPage",
  232. };
  233. },
  234. };
  235. </script>
  236. <style lang="scss" scoped>
  237. .special-research {
  238. background-color: $uni-bg-color;
  239. padding-top: 70rpx;
  240. position: relative;
  241. .top-notice {
  242. position: fixed;
  243. top: 0;
  244. left: 0;
  245. z-index: 9;
  246. display: flex;
  247. background-color: #fff;
  248. width: 100%;
  249. height: 62rpx;
  250. .notice {
  251. width: 80%;
  252. }
  253. .notice-right {
  254. display: flex;
  255. align-items: center;
  256. border-radius: 0 8rpx 8rpx 0;
  257. background-color: #fff1e9;
  258. height: 60rpx;
  259. }
  260. .inform-btn {
  261. width: 140rpx;
  262. height: 36rpx;
  263. display: flex;
  264. align-items: center;
  265. justify-content: center;
  266. border-radius: 6rpx;
  267. font-size: 24rpx;
  268. background-color: #e37318;
  269. color: #fff;
  270. }
  271. .inform-follow {
  272. background-color: #ffd9c2;
  273. color: #e37318;
  274. }
  275. }
  276. /deep/ .van-notice-bar {
  277. height: 62rpx;
  278. }
  279. .city-img {
  280. display: flex;
  281. align-items: center;
  282. color: $uni-color-new;
  283. image {
  284. width: 32rpx;
  285. height: 32rpx;
  286. margin-right: 12rpx;
  287. }
  288. }
  289. }
  290. @import "@/components/activity/indexActivity.scss";
  291. </style>