specialResearchPage.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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="专项调研行程持续更新中,满五家即开团,欢迎点击感兴趣预报名" />
  6. </view>
  7. <view class="inform-btn" @click="specialFollow">{{ isFollow ? "取消通知" : "新调研通知" }}</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. <text class="text_twoLine">预期时间:{{ item.ActivityTimeText }} </text>
  28. </view>
  29. <view class="bottom-box">
  30. <view class="" style="width: 130rpx"> </view>
  31. <text @click="lookImg(item)">行程安排</text>
  32. <text class="button" v-if="item.IsSignup !== 1" @click="interest(item)">感兴趣</text>
  33. <text class="button" @click="beNotInterested(item)" v-else>已预报名</text>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="totalPage > 1" />
  39. </view>
  40. <view class="select-box"> </view>
  41. <!-- 所有自定义弹框 -->
  42. </view>
  43. <freeCharge class="free-charge" :isShowFreeBtn="isShowFree" />
  44. <u-modal
  45. v-model="goFollowShow"
  46. :content-style="{ fontSize: '32rpx' }"
  47. :show-cancel-button="false"
  48. confirm-text="知道了"
  49. @cancel="isCancelBtn = false"
  50. :show-title="false"
  51. :cancel-style="{ borderRight: '1rpx solid #EBEBEB' }"
  52. :confirm-style="{ fontWeight: '700' }"
  53. >
  54. <view class="slot-content">
  55. <rich-text :nodes="accounts"></rich-text>
  56. </view>
  57. </u-modal>
  58. </view>
  59. </template>
  60. <script>
  61. import { activity, User } from "@/config/api.js";
  62. import { Throttle } from "@/config/util.js";
  63. import freeCharge from "@/components/freeCharge";
  64. export default {
  65. data() {
  66. return {
  67. page_no: 1,
  68. pageSize: 10,
  69. collectList: [],
  70. status: "loadmore",
  71. refresh: false, //正在下拉
  72. loadText: {
  73. loadmore: "上拉加载更多",
  74. loading: "加载中",
  75. nomore: "已经到底了",
  76. },
  77. isFollow: false,
  78. accounts: `您已开启【专项调研】新活动通知<br/><br/>请关注【查研观向小助手】公众号,及时获取微信消息提醒`,
  79. goFollowShow: false,
  80. };
  81. },
  82. components: {
  83. freeCharge,
  84. },
  85. methods: {
  86. //获取事件
  87. async getActivityList() {
  88. const res = await activity.getSpecialList({
  89. PageSize: this.pageSize,
  90. CurrentIndex: this.page_no,
  91. });
  92. if (res.Ret === 200) {
  93. this.isFollow = res.Data.IsFollow;
  94. this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
  95. if (this.page_no === 1) {
  96. this.collectList = res.Data.List || [];
  97. if (this.refresh) {
  98. uni.stopPullDownRefresh();
  99. this.refresh = false;
  100. }
  101. } else {
  102. this.collectList = this.collectList.concat(res.Data.List);
  103. }
  104. }
  105. },
  106. //查看行程的事件
  107. lookImg(item) {
  108. uni.previewImage({
  109. urls: [item.TripImgLink], //查看图片的数组
  110. });
  111. },
  112. //去往详情页面
  113. goDetail(item) {
  114. this.$store.dispatch("checkHandle", "/activityPages/specialDetail/specialDetail?id=" + item.ActivityId);
  115. },
  116. //感兴趣
  117. async interest(item) {
  118. const res = await activity.postSpecialSignupAdd({
  119. ActivityId: item.ActivityId,
  120. });
  121. if (res.Ret === 200) {
  122. item.IsSignup = 1;
  123. uni.showModal({
  124. content: "预报名成功,已通知您的销售",
  125. confirmText: "知道了",
  126. showCancel: false,
  127. confirmColor: "#3385FF",
  128. });
  129. }
  130. },
  131. //已预报名、就是不感兴趣
  132. beNotInterested(item) {
  133. uni.showModal({
  134. content: "您要取消此次专研调研的预报名吗?",
  135. confirmColor: "#3385FF",
  136. cancelColor: "#606266",
  137. success: async (res) => {
  138. if (res.confirm) {
  139. const res = await activity.postSpecialSignupAdd({
  140. ActivityId: item.ActivityId,
  141. });
  142. if (res.Ret === 200) {
  143. item.IsSignup = 0;
  144. }
  145. }
  146. },
  147. });
  148. },
  149. //新调研通知
  150. async specialFollow() {
  151. if (this.isFollow) {
  152. uni.showModal({
  153. content: "您要取消【专项调研】新活动通知吗?",
  154. confirmColor: "#3385FF",
  155. cancelColor: "#606266",
  156. success: async (res) => {
  157. if (res.confirm) {
  158. const res = await activity.postSpecialFollow();
  159. if (res.Ret === 200) {
  160. this.isFollow = !this.isFollow;
  161. }
  162. }
  163. },
  164. });
  165. } else {
  166. const res = await activity.postSpecialFollow();
  167. if (res.Ret === 200) {
  168. this.isFollow = !this.isFollow;
  169. this.goFollowShow = true;
  170. }
  171. }
  172. },
  173. },
  174. onLoad(option) {
  175. this.getActivityList();
  176. },
  177. onShow() {
  178. this.$store.dispatch("checkHandle");
  179. },
  180. /* 触底 */
  181. onReachBottom: Throttle(function () {
  182. if (this.status === "nomore") return;
  183. this.status = "loading";
  184. this.page_no++;
  185. this.getActivityList();
  186. }),
  187. /* 下拉刷新 */
  188. onPullDownRefresh: Throttle(function () {
  189. this.page_no = 1;
  190. this.refresh = true;
  191. this.getActivityList();
  192. }),
  193. /** 用户点击分享 */
  194. onShareAppMessage: function (res) {
  195. return {
  196. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费试用月卡!" : "专项产业调研",
  197. path: "/activityPages/specialResearchPage/specialResearchPage",
  198. };
  199. },
  200. };
  201. </script>
  202. <style lang="scss" scoped>
  203. .special-research {
  204. background: #f7f7f7;
  205. padding-bottom: 30rpx;
  206. position: relative;
  207. .top-notice {
  208. position: sticky;
  209. top: 0;
  210. z-index: 99;
  211. background-color: #fe9000;
  212. display: flex;
  213. align-items: center;
  214. height: 60rpx;
  215. padding-right: 20rpx;
  216. overflow: hidden;
  217. .notice {
  218. width: 80%;
  219. }
  220. .inform-btn {
  221. width: 147rpx;
  222. height: 40rpx;
  223. background: #ffffff;
  224. border-radius: 4rpx;
  225. text-align: center;
  226. line-height: 40rpx;
  227. font-size: 24rpx;
  228. color: #ff9e58;
  229. }
  230. }
  231. .collect-ul {
  232. padding-top: 10rpx;
  233. }
  234. .city-img {
  235. display: flex;
  236. align-items: center;
  237. image {
  238. width: 27rpx;
  239. height: 32rpx;
  240. margin-right: 12rpx;
  241. }
  242. }
  243. }
  244. @import "@/components/activity/indexActivity.scss";
  245. </style>