specialResearchPage.vue 8.6 KB

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