specialDetail.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  1. <template>
  2. <block>
  3. <view v-if="sourceType == '微信分享' && mixinIsSceneNumber == 1154" class="share-line-content">
  4. <view class="share-content-box">
  5. <view class="share-content">
  6. <image v-if="detailDataShare.TripStatus == 1" class="item-special" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/Ybm.png"></image>
  7. <image v-if="detailDataShare.TripStatus == 2" class="item-special" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/trip_icon.png"></image>
  8. <text class="share-title"> {{ detailDataShare.title }}</text>
  9. <view class="share-item" v-if="detailDataShare.time">
  10. <text>活动时间</text>
  11. <text>{{ detailDataShare.time }}</text>
  12. </view>
  13. <view class="share-item" v-if="detailDataShare.type">
  14. <text>调研形式</text>
  15. <text>{{ detailDataShare.type }}</text>
  16. </view>
  17. <view class="share-item" v-if="detailDataShare.label">
  18. <text>相关主题</text>
  19. <!-- <text>{{ detailDataShare.label }}</text> -->
  20. <rich-text :nodes="detailDataShare.label"></rich-text>
  21. </view>
  22. </view>
  23. </view>
  24. <image class="share-report-go_cygx_xcx" src="https://hzstatic.hzinsights.com/new_cygx/go_cygx_xcx.png"></image>
  25. </view>
  26. <block v-else>
  27. <view class="container special-detail" v-if="isUserBindingPhoneNumber">
  28. <view class="" v-if="haveAuth == 1">
  29. <view class="top-notice-special">
  30. <view class="notice">
  31. <van-notice-bar color="#E37318" background="#FFF1E9" text="专项调研行程持续更新中,满五家即开团,欢迎点击感兴趣预报名" />
  32. </view>
  33. <view class="inform-btn" @click="specialFollow">{{ specialIsFollow ? "取消通知" : "新调研通知" }}</view>
  34. </view>
  35. <view class="content">
  36. <view class="reminder-item">
  37. <image v-if="detailData.TripStatus == 1" class="item" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/Ybm.png"></image>
  38. <image v-if="detailData.TripStatus == 2" class="item" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/trip_icon.png"></image>
  39. <image v-if="detailData.Explain" @click="reminderTextHandler(detailData)" class="reminder" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/error-circle-filled.png"></image>
  40. </view>
  41. <view class="global_title content-title">{{ detailData.ResearchTheme }}</view>
  42. <view class="content-item">
  43. <view class="item-left">活动类型:</view>
  44. <view class="item-right">{{ detailData.ActivityTypeName }}</view>
  45. </view>
  46. <view class="content-item">
  47. <view class="item-left">所属行业:</view>
  48. <view class="item-right">{{ detailData.ChartPermissionName }}</view>
  49. </view>
  50. <view class="content-item" v-if="detailData.TripStatus == 2">
  51. <view class="item-left">开始时间:</view>
  52. <view class="item-right">{{ detailData.ActivityTimeTextByDay }}</view>
  53. </view>
  54. <view class="content-item" v-else>
  55. <view class="item-left">预期时间:</view>
  56. <view class="item-right">{{ detailData.ActivityTimeText }}</view>
  57. </view>
  58. <view class="content-item">
  59. <view class="item-left">调研形式:</view>
  60. <view class="item-right">
  61. {{ detailData.SpecialType == 1 ? "线上" : "线下" }}
  62. <block v-if="detailData.SpecialType == 2">({{ detailData.City }})</block>
  63. </view>
  64. </view>
  65. <block v-if="detailData.IndustrialName || detailData.IndustrialSubjectName">
  66. <view class="content-item">
  67. <view class="item-left">产业名称:</view>
  68. <view class="item-right">{{ detailData.IndustrialName }}</view>
  69. </view>
  70. <view class="content-item">
  71. <view class="item-left">相关公司:</view>
  72. <view class="item-right">{{ detailData.IndustrialSubjectName }}</view>
  73. </view>
  74. </block>
  75. <block v-else>
  76. <view class="content-item">
  77. <view class="item-left">相关主题:</view>
  78. <view class="item-right">{{ detailData.Label }}</view>
  79. </view>
  80. </block>
  81. <!-- <view class="reminder-item">
  82. <image v-if="detailData.TripStatus == 1" class="item" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/Y_apply.png"></image>
  83. <image v-if="detailData.TripStatus == 2" class="item" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/confirm_XC.png"></image>
  84. <image v-if="detailData.Explain" @click="reminderTextHandler(detailData)" class="reminder" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/reminder_icon.png"></image>
  85. </view> -->
  86. <view class="global_content_center look-Trip" @click="lookImg"> 查看行程安排 > </view>
  87. <view class="interest-btn">
  88. <block v-if="detailData.TripStatus == 2">
  89. <text v-if="detailData.ActiveState == 1" class="button" @click="applyOfcancel(detailData)">
  90. {{ detailData.IsTrip == 0 ? `我要报名(${detailData.TripNum}/${detailData.LimitPeopleNum})` : "取消报名" }}
  91. </text>
  92. </block>
  93. <block v-else>
  94. <text class="button" v-if="detailData.IsSignup !== 1" @click="interest">感兴趣</text>
  95. <text class="button" @click="beNotInterested" v-else>已预报名</text>
  96. </block>
  97. </view>
  98. </view>
  99. </view>
  100. <!-- 权限部分 -->
  101. <view v-else>
  102. <jurisdiction :idAct="id" :jurisdictionList="jurisdictionList"></jurisdiction>
  103. </view>
  104. <freeCharge class="free-charge" :isShowFreeBtn="isShowFree" />
  105. <u-modal
  106. v-model="specialGoFollowShow"
  107. :content-style="{ fontSize: '32rpx' }"
  108. :show-cancel-button="show_cancel_button"
  109. confirm-text="知道了"
  110. :show-confirm-button="show_confirm_button"
  111. :show-title="false"
  112. :cancel-style="{ borderRight: '1rpx solid #EBEBEB' }"
  113. :confirm-style="{ fontWeight: '700' }"
  114. :mask-close-able="specialIsHintShow"
  115. @confirm="ininModalHandler"
  116. @cancel="ininModalHandler"
  117. >
  118. <view class="slot-content">
  119. <block v-if="specialPopupMsg">
  120. <text>{{ specialAccounts }}</text>
  121. <text class="light-hint">{{ specialPopupMsg }}</text>
  122. </block>
  123. <rich-text v-else :nodes="specialAccounts"></rich-text>
  124. </view>
  125. </u-modal>
  126. <Loading />
  127. </view>
  128. <not-have-login v-else />
  129. </block>
  130. </block>
  131. </template>
  132. <script>
  133. import { activity, User } from "@/config/api.js";
  134. import jurisdiction from "../activityDetail/jurisdiction/components.vue";
  135. import freeCharge from "@/components/freeCharge";
  136. import specialMixins from "../components/specialMixins";
  137. import NotHaveLogin from "@/components/notHaveLogin.vue";
  138. let app = getApp({ allowDefault: true });
  139. export default {
  140. data() {
  141. return {
  142. id: "",
  143. detailData: {},
  144. haveAuth: "",
  145. specialIsFollow: false,
  146. jurisdictionList: {},
  147. sourceType: "",
  148. detailDataShare: {},
  149. };
  150. },
  151. components: {
  152. jurisdiction,
  153. freeCharge,
  154. NotHaveLogin,
  155. },
  156. mixins: [specialMixins],
  157. methods: {
  158. // 获取详情
  159. async getActivityDetail() {
  160. const res = await activity.getSpecialDetailList({ ActivityId: this.id, PageRouter: this.$store.state.pageRouterActivity });
  161. if (res.Ret == 200) {
  162. this.specialIsFollow = res.Data.IsFollow;
  163. this.haveAuth = res.Data.HasPermission;
  164. this.jurisdictionList = res.Data;
  165. this.jurisdictionList.Type = "专项调研";
  166. if (res.Data.HasPermission == 1) {
  167. this.detailData = res.Data.Detail;
  168. }
  169. }
  170. },
  171. //感兴趣
  172. async interest() {
  173. const res = await activity.postSpecialSignupAdd({
  174. ActivityId: this.detailData.ActivityId,
  175. PageRouter: this.$store.state.pageRouterActivity,
  176. });
  177. if (res.Ret === 200) {
  178. this.currentPages();
  179. this.modalShow(res);
  180. if (res.Data.SignupStatus == 1) {
  181. this.detailData.IsSignup = 1;
  182. }
  183. }
  184. },
  185. // 已预报名、就是不感兴趣
  186. beNotInterested() {
  187. uni.showModal({
  188. content: "您要取消此次专研调研的预报名吗?",
  189. confirmColor: "#376cbb",
  190. cancelColor: "#606266",
  191. success: async (res) => {
  192. if (res.confirm) {
  193. const res = await activity.postSpecialSignupAdd({
  194. ActivityId: this.detailData.ActivityId,
  195. PageRouter: this.$store.state.pageRouterActivity,
  196. });
  197. if (res.Ret === 200) {
  198. this.detailData.IsSignup = 0;
  199. this.currentPages();
  200. }
  201. }
  202. },
  203. });
  204. },
  205. // 控制列表页面的状态
  206. currentPages() {
  207. let pages = getCurrentPages();
  208. let prevPage = pages[pages.length - 2];
  209. let path = prevPage.$page.fullPath;
  210. if (path == "/activityPages/specialResearchPage/specialResearchPage") {
  211. const index = prevPage.$vm.collectList.findIndex((item) => item.ActivityId == this.id);
  212. prevPage.$vm.collectList[index].IsSignup = this.detailData.IsSignup;
  213. }
  214. },
  215. // 查看行程的事件
  216. lookImg() {
  217. this.getRecordTracking(this.$store.state.pageRouterActivity, { ActivityId: this.detailData.ActivityId, Source: "查看行程" });
  218. uni.previewImage({
  219. urls: [this.detailData.TripImgLink], //查看图片的数组
  220. });
  221. },
  222. //新调研通知
  223. async specialFollow() {
  224. if (this.specialIsFollow) {
  225. uni.showModal({
  226. content: "您要取消【专项调研】新活动通知吗?",
  227. confirmColor: "#376cbb",
  228. cancelColor: "#606266",
  229. success: async (res) => {
  230. if (res.confirm) {
  231. const res = await activity.postSpecialFollow();
  232. if (res.Ret === 200) {
  233. this.specialIsFollow = !this.specialIsFollow;
  234. }
  235. }
  236. },
  237. });
  238. } else {
  239. const res = await activity.postSpecialFollow();
  240. if (res.Ret === 200) {
  241. this.show_confirm_button = true;
  242. this.specialIsFollow = !this.specialIsFollow;
  243. this.specialGoFollowShow = true;
  244. }
  245. }
  246. },
  247. },
  248. onLoad(option) {
  249. this.id = option.id || "";
  250. this.sourceType = option.sourceType || "";
  251. this.detailDataShare = option.detailDataShare ? JSON.parse(decodeURIComponent(option.detailDataShare) || {}) : "";
  252. console.log(this.sourceType, this.detailDataShare);
  253. },
  254. onShow() {
  255. if (this.mixinIsSceneNumber == 1154) return;
  256. if (!this.$store.state.isAuth && !this.$store.state.isBind) {
  257. //已授权已绑定
  258. this.getActivityDetail();
  259. }
  260. },
  261. /**
  262. * 用户点击分享
  263. */
  264. onShareAppMessage: function (res) {
  265. return {
  266. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费试用月卡!" : "活动详情",
  267. path: "/activityPages/specialDetail/specialDetail?id=" + this.id,
  268. success: (res) => {},
  269. fail: (err) => {},
  270. };
  271. },
  272. /**
  273. * 用户点击分享朋友圈
  274. */
  275. onShareTimeline() {
  276. let shaerObj = {
  277. title: this.detailData.ResearchTheme,
  278. time: this.detailData.ActivityTimeTextByDay,
  279. type: `${this.detailData.SpecialType == 1 ? "线上" : "线下"}${this.detailData.SpecialType == 2 ? "(" + this.detailData.City + ")" : ""}`,
  280. label: this.detailData.Label,
  281. TripStatus: this.detailData.TripStatus,
  282. };
  283. let detailDataShare = JSON.stringify(shaerObj).replace(/%/g, "%25");
  284. return {
  285. title: this.detailData.ResearchTheme,
  286. query: "id=" + this.id + "&sourceType=微信分享&detailDataShare=" + encodeURIComponent(detailDataShare),
  287. imageUrl: this.detailData.ImgUrl,
  288. };
  289. },
  290. };
  291. </script>
  292. <style lang="scss" scoped>
  293. .special-detail {
  294. background-color: $uni-color-new;
  295. .top-notice-special {
  296. padding-right: 20rpx;
  297. background-color: #fff1e9;
  298. position: relative;
  299. display: flex;
  300. align-items: center;
  301. height: 60rpx;
  302. overflow: hidden;
  303. .notice {
  304. width: 80%;
  305. }
  306. .inform-btn {
  307. position: absolute;
  308. right: 20rpx;
  309. top: 50%;
  310. transform: translateY(-50%);
  311. width: 140rpx;
  312. height: 36rpx;
  313. background: #e37318;
  314. border-radius: 8rpx;
  315. text-align: center;
  316. line-height: 36rpx;
  317. font-size: 24rpx;
  318. color: #fff;
  319. }
  320. }
  321. .notice {
  322. height: 60rpx;
  323. width: 100%;
  324. }
  325. .choose-limit {
  326. position: relative;
  327. display: flex;
  328. align-items: center;
  329. // margin-left: 20rpx;
  330. image {
  331. width: 93rpx;
  332. height: 38rpx;
  333. }
  334. .limit-img {
  335. position: absolute;
  336. top: -13rpx;
  337. right: -30rpx;
  338. width: 46rpx;
  339. height: 26rpx;
  340. }
  341. }
  342. .content {
  343. margin: 30rpx 35rpx;
  344. background-color: #fff;
  345. padding: 30rpx;
  346. color: #333333;
  347. font-size: 28rpx;
  348. position: relative;
  349. border-radius: 16rpx;
  350. overflow: hidden;
  351. .content-title {
  352. margin: 20rpx 0 30rpx;
  353. }
  354. .content-item {
  355. display: flex;
  356. font-size: 28rpx;
  357. line-height: 40rpx;
  358. color: #333;
  359. margin-bottom: 20rpx;
  360. align-items: flex-start;
  361. vertical-align: text-top;
  362. .item-left {
  363. width: 140rpx;
  364. flex-shrink: 0;
  365. }
  366. .item-right {
  367. color: #333;
  368. }
  369. }
  370. .reminder-item {
  371. position: relative;
  372. margin: -30rpx 0 0 -30rpx;
  373. width: 176rpx;
  374. height: 48rpx;
  375. .item {
  376. width: 176rpx;
  377. height: 48rpx;
  378. }
  379. .reminder {
  380. position: absolute;
  381. top: 0rpx;
  382. right: 0rpx;
  383. width: 28rpx;
  384. height: 28rpx;
  385. z-index: 10;
  386. padding: 10rpx 10rpx 20rpx 20rpx;
  387. }
  388. }
  389. .dialog-title {
  390. width: 682rpx;
  391. padding: 20rpx;
  392. background: #f2f2f2;
  393. opacity: 0.8;
  394. text-align: center;
  395. font-size: 30rpx;
  396. font-weight: bold;
  397. margin-bottom: 30rpx;
  398. color: #000;
  399. }
  400. .brackets-title {
  401. padding-left: 20rpx;
  402. }
  403. }
  404. .light-hint {
  405. color: #999;
  406. font-size: 24rpx;
  407. }
  408. .content-item {
  409. margin-bottom: 30rpx;
  410. padding: 0 !important;
  411. display: flex;
  412. .item-left {
  413. width: 160rpx;
  414. text-align-last: justify;
  415. text-align: justify;
  416. }
  417. .item-right {
  418. width: 480rpx;
  419. }
  420. }
  421. .look-Trip {
  422. margin: 50rpx auto;
  423. width: 188rpx;
  424. height: 42rpx;
  425. font-size: 24rpx;
  426. color: $uni-color-new;
  427. font-weight: 600;
  428. border-radius: 4rpx;
  429. background-color: #e5efff;
  430. }
  431. .interest-btn {
  432. width: 100%;
  433. text-align: center;
  434. text {
  435. width: 504rpx;
  436. height: 60rpx;
  437. background: $uni-color-new;
  438. font-size: 24rpx;
  439. color: #fff;
  440. font-weight: 600;
  441. border-radius: 8rpx;
  442. line-height: 60rpx;
  443. margin: 30rpx auto 40rpx;
  444. }
  445. }
  446. /deep/ .van-notice-bar {
  447. height: 62rpx;
  448. }
  449. }
  450. </style>