specialResearchPage.vue 9.7 KB

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