activityDetail.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716
  1. <template>
  2. <view :style="vuex_skin">
  3. <!-- #ifdef MP-WEIXIN -->
  4. <u-navbar :custom-back="customBack" :is-back="true" title="作品详情"></u-navbar>
  5. <!-- #endif -->
  6. <view class="" v-show="!loading" style="padding-bottom: 250rpx;">
  7. <video v-if="activity.activeType == 'VIDEO_TEXT'" class="works-video" @error="videoError"
  8. :poster="activity.imgUrl" :src="activity.videoUrl"></video>
  9. <image v-else class="works-video" @click="$util.preview(activity.imgUrl)" :src="activity.imgUrl"
  10. mode="widthFix">
  11. </image>
  12. <view style="padding: 20rpx 30rpx 50rpx 30rpx;background: white;">
  13. <view class="title" style="border-bottom: 1rpx solid #EEEEEE ;">
  14. <span class="bg-base work-no"> {{activity.productNo}}号</span>
  15. <span class="work-title">{{activity.title}}</span>
  16. <view class="work-info-box" style="display: flex;">
  17. <view class="center">
  18. <text class="cuIcon-hotfill text-base" style="font-size: 36rpx;"></text>
  19. </view>
  20. <view class="vote-count">{{activity.voteCount}}</view>
  21. <view class="center" style="justify-content: flex-start;">
  22. <view class="cu-tag round sm bg-tag" style="font-size: 22rpx;">
  23. <text>排行榜第{{activity.rank}}名</text>
  24. </view>
  25. </view>
  26. <!-- <view class="work-rank" style="background-color: rgba(102, 73, 239,.2);">排行榜第{{activity.rank}}名</view> -->
  27. </view>
  28. </view>
  29. <view style="font-size: 24rpx;color: #888888;padding: 30rpx 10rpx 20rpx 10rpx;">
  30. <u-parse :html="content"></u-parse>
  31. </view>
  32. </view>
  33. <view @click="showShare" class="bg-white padding-30 margin-top-30 flex">
  34. <view class="center margin-left-20">
  35. <view class="bg-base cu-btn round cuIcon" style="width: 70rpx;height: 70rpx;">
  36. <text class="cuIcon-forwardfill"></text>
  37. </view>
  38. <!-- <image style="width: 84rpx;height: 84rpx;" src="../../static/icon/ic_zhuanfa.png"></image> -->
  39. </view>
  40. <view class="basis-lg flex flex-direction" style="margin-left: 30rpx;">
  41. <view style="font-size: 28rpx;color: #353535;">为TA拉票</view>
  42. <view style="font-size: 22rpx;color: #AEACAF;padding-top: 10rpx;">
  43. <!-- <text>成功邀请一位好友投票,获得{{vuex_active_setting.voteAndHeatRate}}热力值</text> -->
  44. <text>转发邀请好友为该作品助力</text>
  45. </view>
  46. </view>
  47. <view class="flex justify-center align-center"
  48. style="color: #666666;flex-basis: 20%;font-size: 26rpx;font-family: PingFang-SC-Medium;">去邀请 >
  49. </view>
  50. </view>
  51. <view class="footer-bar" style="z-index: 1;">
  52. <u-button @click="goVote" shape="circle" :custom-style="btnText=='给ta投票'?customStyle:disabledStyle">
  53. {{btnText}}
  54. </u-button>
  55. </view>
  56. </view>
  57. <login ref="login" @signIn="signIn" @phoneSuccess="showVote"></login>
  58. <toast ref="toast"></toast>
  59. <!-- #ifdef MP-WEIXIN -->
  60. <loading ref="loading" type="3" theme="2" />
  61. <!-- #endif -->
  62. <vote-popup ref="votePopup" @toVote="toVote"></vote-popup>
  63. <!-- 海报 -->
  64. <poster v-if="$isNotEmpty(posetrParams.activeId)" ref="poster" :avatar="posetrParams.avatar"
  65. :activeId="posetrParams.activeId" :title="posetrParams.title" :subTitle="posetrParams.subTitle"></poster>
  66. <share-popup ref="sharePopup" @confirm="shareConfirm"></share-popup>
  67. <timeline-popup ref="timelinePopup"></timeline-popup>
  68. <sms-alert ref="smsAlert" @exchange="cmccVote"></sms-alert>
  69. <vote-success ref="voteSuccess" @support="skipShop"></vote-success>
  70. <home-btn></home-btn>
  71. <payPopup></payPopup>
  72. </view>
  73. </template>
  74. <script>
  75. import voteSuccess from "@/components/alert/voteSuccess.vue"
  76. import sharePopup from "@/components/alert/sharePopup.vue"
  77. import timelinePopup from "@/components/alert/timelinePopup.vue"
  78. import votePopup from '@/components/alert/votePopup.vue'
  79. import poster from "@/components/poster/poster.vue"
  80. import smsAlert from "@/components/alert/smsAlert.vue"
  81. import payPopup from "@/components/alert/payPopup.vue"
  82. export default {
  83. components: {
  84. voteSuccess,
  85. smsAlert,
  86. sharePopup,
  87. timelinePopup,
  88. votePopup,
  89. poster,
  90. payPopup
  91. },
  92. async onLoad(props) {
  93. // #ifdef MP-WEIXIN
  94. uni.showShareMenu({
  95. menus: ['shareAppMessage', 'shareTimeline']
  96. })
  97. // #endif
  98. this.isCustomBack = props.isCustomBack || true
  99. this.showLoading()
  100. //作品id
  101. this.id = props.id;
  102. //获取详情
  103. await this.fetchData()
  104. //处理授权结果
  105. this.handelAuthResult(props)
  106. // #ifdef MP-WEIXIN
  107. //处理创建订单结果
  108. this.handelOrderResult(props)
  109. // #endif
  110. // #ifdef H5
  111. this.h5CreateOrder()
  112. // #endif
  113. //处理海报参数
  114. this.handelShareParams()
  115. //隐藏loading
  116. setTimeout(() => {
  117. this.hideLoading()
  118. }, 20)
  119. this.getActivitySetting();
  120. },
  121. onShow() {
  122. let that = this
  123. uni.$on('updateData',function(payStatus){
  124. that.payStatus = payStatus;
  125. that.voteSuccess();
  126. console.log('监听到事件来自 updateData ,携带参数为:' + payStatus);
  127. })
  128. },
  129. computed: {
  130. content() {
  131. return decodeURIComponent(this.activity.content)
  132. },
  133. btnText: {
  134. get() {
  135. let now = new Date().getTime()
  136. let startTime = this.$dateTime.getTime(this.activity.activeStartTime)
  137. let endTime = this.$dateTime.getTime(this.activity.activeEndTime)
  138. if (now < startTime) {
  139. return "活动未开始"
  140. }
  141. if (now > endTime) {
  142. return "活动已结束"
  143. }
  144. return "给ta投票"
  145. }
  146. }
  147. },
  148. data() {
  149. return {
  150. count: 0,
  151. //是否自定义返回,防止授权时返回到webview页面
  152. isCustomBack: true,
  153. defaultAvatar: 'https://vote.guosen-fumao.cn/obsfile/446d9e043f3748e4a47ea4d0de81b140-3b748fea4150c469b8eb66f98cd29e2.png',
  154. loading: false,
  155. //作品id
  156. id: '',
  157. //订单结果
  158. orderResult: {},
  159. //授权结果
  160. authResult: {},
  161. //分享
  162. qrCodeImg: '',
  163. //选中的道具
  164. selectGoods: {},
  165. mpShare: {},
  166. posetrParams: {
  167. avatar: '',
  168. title: '我是普法帮帮代言人',
  169. subTitle: '邀请您为888号作品投票!',
  170. activeId: ''
  171. },
  172. activity: {},
  173. customStyle: {
  174. color: 'white',
  175. background: "#ffffff",
  176. fontSize: '32rpx',
  177. width: '500rpx',
  178. margin: '25rpx auto'
  179. },
  180. disabledStyle: {
  181. background: "#f1f1f1",
  182. fontSize: '32rpx',
  183. width: '500rpx',
  184. margin: '25rpx auto'
  185. },
  186. //活动设置
  187. activitySetting: {},
  188. //支付状态
  189. payStatus: ''
  190. }
  191. },
  192. onShareAppMessage(res) {
  193. return {
  194. title: `${this.$isNotEmpty(this.activitySetting.pullVoteParam) ? `【${this.activitySetting.pullVoteParam.sponsor}】` : ``}${this.mpShare.title}`,
  195. path: this.mpShare.path,
  196. imageUrl: this.mpShare.imageUrl
  197. }
  198. },
  199. onShareTimeline(res) {
  200. return {
  201. title: `${this.$isNotEmpty(this.activitySetting.pullVoteParam) ? `【${this.activitySetting.pullVoteParam.sponsor}】` : ``}${this.mpShare.title}`,
  202. path: this.mpShare.path,
  203. imageUrl: this.mpShare.imageUrl
  204. }
  205. },
  206. methods: {
  207. goVote() {
  208. if (this.btnText == '给ta投票') {
  209. this.login()
  210. return
  211. }
  212. this.$refs.toast.error(this.btnText)
  213. },
  214. showLoading() {
  215. // #ifdef MP-WEIXIN
  216. this.$refs.loading.showLoading()
  217. // #endif
  218. // #ifndef MP-WEIXIN
  219. this.$dialog.showLoading()
  220. // #endif
  221. },
  222. videoError(e) {
  223. console.log(e, "error");
  224. },
  225. hideLoading() {
  226. // #ifdef MP-WEIXIN
  227. this.$refs.loading.hide()
  228. // #endif
  229. // #ifndef MP-WEIXIN
  230. uni.hideLoading()
  231. // #endif
  232. this.loading = false
  233. },
  234. async fetchData() {
  235. this.activity = (await this.$api.activity.getWorksDetail(this.id)).data.data
  236. },
  237. async handelShareParams() {
  238. let title = await this.getPosetrParamsTitle();
  239. const userInfo = uni.getStorageSync("userInfo");
  240. /**
  241. * 海报分享参数
  242. * avatar: 显示优先级:作品封面 >>> 用户头像 >>> 默认头像
  243. * title: 显示优先级:平台自定义标题 >>> 我是第X号大赛代言人!>>> 我是普法帮帮代言人!
  244. */
  245. this.posetrParams = {
  246. avatar: this.activity.imgUrl || userInfo.avatar || this.defaultAvatar,
  247. title: this.activitySetting.pullVoteParam.title || title,
  248. subTitle: '邀请您为' + this.activity.productNo + '号作品投票!',
  249. activeId: this.activity.activeId
  250. }
  251. let userId = this.vuex_userId || '000000' //游客
  252. let sharePath = '/pages/activity/activityDetail?id=' + this.activity.id + '&userId=' + userId
  253. let encodePath = encodeURIComponent(sharePath)
  254. /**
  255. * 小程序分享参数
  256. * title:【主办方名字】 || '' + 用户自定义标题 || 我是第X号大赛代言人!+ 邀请您为《XXX》投票!
  257. */
  258. this.mpShare = {
  259. title: `${this.activitySetting.pullVoteParam.title || title} , 邀请您为《${this.activity.title}》投票!`,
  260. path: '/pages/index/home?path=' + encodePath,
  261. imageUrl: this.activity.imgUrl
  262. }
  263. this.h5share()
  264. },
  265. async h5share() {
  266. // #ifdef H5
  267. /**
  268. * H5分享参数
  269. * title:【主办方名字】 || '' + 用户自定义标题 || 我是第X号大赛代言人!|| 我是普法帮帮代言人!+ 邀请您为《XXX》投票!
  270. */
  271. let shareParam = {
  272. title: `${this.$isNotEmpty(this.activitySetting.pullVoteParam.sponsor) ? `【${this.activitySetting.pullVoteParam.sponsor}】` : ``}${this.posetrParams.title}`,
  273. desc: `邀请您为《${this.activity.title}》投票!`,
  274. imgUrl: this.activity.imgUrl,
  275. link: window.location.href
  276. }
  277. this.$shareConfig.H5Share(shareParam);
  278. // #endif
  279. },
  280. async getPosetrParamsTitle() {
  281. let title = "我是普法帮帮代言人"
  282. if (this.$isEmpty(this.vuex_phone)) {
  283. return title
  284. }
  285. let params = {
  286. activeId: this.activity.activeId,
  287. phone: this.vuex_phone
  288. }
  289. let res = await this.$api.activity.getPromoteNum(params)
  290. if (this.$isNotEmpty(res.data) && this.$isNotEmpty(res.data.data.index)) {
  291. let index = res.data.data.startIndex
  292. title = `我是第${index}位大赛代言人!`
  293. }
  294. return title
  295. },
  296. handelAuthResult(options) {
  297. if (options.authResult == undefined) {
  298. return
  299. }
  300. this.authResult = JSON.parse(options.authResult)
  301. if (this.authResult.resultCode == '0000') {
  302. //授权成功,直接弹出礼物框
  303. this.hideLoading()
  304. this.showVote()
  305. return
  306. }
  307. // #ifdef MP-WEIXIN
  308. if (this.authResult.resultCode == '9999') {
  309. //授权失败
  310. this.$refs.toast.error(this.authResult.message)
  311. return
  312. }
  313. // #endif
  314. },
  315. handelOrderResult(options) {
  316. if (options.orderPass && this.$cache.get('orderResult')) {
  317. this.orderResult = this.$cache.get('orderResult')
  318. this.createOrder()
  319. }
  320. },
  321. async showVote() {
  322. this.$refs.votePopup.showVote(this.vuex_phone, this.id, this.activity.activeId);
  323. },
  324. init() {
  325. if (this.vuex_phone) {
  326. this.showVote()
  327. }
  328. },
  329. //去投票
  330. toVote(item) {
  331. if (this.$cache.get('orderResult')) {
  332. this.orderResult = this.$cache.get('orderResult')
  333. this.orderResult.goodsId = item.id
  334. this.$cache.put('orderResult', this.orderResult, 1 * 60 * 60)
  335. }
  336. this.selectGoods = item
  337. //移动积分礼物
  338. if(item.payType === 'POINT_EXCHANGE_GOODS'){
  339. if (item.point == 0 ) {
  340. //免费投票
  341. this.freeVote()
  342. return
  343. }
  344. this.$refs.votePopup.hideVote()
  345. //移动积分投票,创建订单
  346. if (this.$cache.get('orderResult')) {
  347. this.createOrder()
  348. return
  349. }
  350. // #ifdef MP-WEIXIN
  351. let params = {
  352. url: 'https://vote.guosen-fumao.cn/order.html',
  353. goodsId: this.selectGoods.id
  354. }
  355. this.$jump('/pages/webview/createOrder' + this.$u.queryParams(params))
  356. // #endif
  357. }else{
  358. this.cashCreateOrder();
  359. }
  360. },
  361. //移动积分创建订单
  362. async createOrder() {
  363. if (this.$isEmpty(this.orderResult.fingerprint) ||
  364. this.$isEmpty(this.orderResult.sessionId) ||
  365. this.$isEmpty(this.orderResult.goodsId)) {
  366. this.$refs.toast.error('创建订单失败')
  367. return
  368. }
  369. let params = {
  370. fingerprint: this.orderResult.fingerprint,
  371. helpGoodsId: this.orderResult.goodsId,
  372. sessionId: this.orderResult.sessionId,
  373. num: 1,
  374. phone: this.vuex_phone,
  375. userId: this.vuex_userId
  376. }
  377. let res = await this.$api.order.create(params)
  378. if (res.data.success) {
  379. console.log("orderResult", this.orderResult);
  380. this.orderResult.outOrderId = res.data.data
  381. this.orderResult.mobile = this.vuex_phone
  382. this.$refs.smsAlert.showSmsAndSend(this.orderResult)
  383. } else {
  384. this.$refs.toast.error(res.data.msg)
  385. }
  386. },
  387. //现金投票创建订单
  388. async cashCreateOrder() {
  389. let params = {
  390. helpGoodsId: this.selectGoods.id,
  391. num: 1,
  392. phone: this.vuex_phone,
  393. productId: this.id,
  394. userId: this.vuex_userId
  395. }
  396. let res = await this.$api.order.cashExchange(params)
  397. if (res.data.success) {
  398. this.payStatus = ''; //创建新订单,清空订单状态
  399. uni.navigateTo({
  400. url: `/pages/webview/payOrder?url=${res.data.data.qrCodeUrl}&orderId=${res.data.data.id}`
  401. })
  402. } else {
  403. this.$refs.toast.error(res.data.msg)
  404. }
  405. this.$refs.votePopup.hideVote();
  406. },
  407. async cmccVote(item) {
  408. this.$refs.smsAlert.hideSms()
  409. let params = {
  410. ...item,
  411. machinetype: 'phone',
  412. productId: this.id,
  413. helpGoodsId: this.orderResult.goodsId,
  414. userId: this.vuex_userId,
  415. num: 1,
  416. }
  417. let res = await this.$api.order.exchange(params)
  418. if (res.data.success) {
  419. this.voteSuccess()
  420. this.$refs.smsAlert.hideSms()
  421. } else {
  422. this.$refs.toast.error(res.data.msg)
  423. }
  424. },
  425. voteSuccess() {
  426. try {
  427. let avatar = this.$cache.get('userInfo').avatar || this.defaultAvatar
  428. let activeVote = this.selectGoods.votePointRate
  429. this.$refs.voteSuccess.showSuccess(avatar, activeVote)
  430. } catch (e) {
  431. this.$refs.toast.info('助力成功')
  432. }
  433. },
  434. async freeVote() {
  435. let params = {
  436. helpGoodsId: this.selectGoods.id,
  437. userId: this.vuex_userId,
  438. num: 1,
  439. productId: this.activity.id,
  440. }
  441. let res = await this.$api.order.exchange(params)
  442. if (res.data.success) {
  443. this.$refs.votePopup.hideVote()
  444. this.fetchData()
  445. let avatar = this.$cache.get('userInfo').avatar
  446. let voteCount = this.selectGoods.votePointRate
  447. let pointNum = this.vuex_active_setting.voteAndPointRate
  448. setTimeout(() => {
  449. this.voteSuccess()
  450. }, 200)
  451. } else {
  452. this.$refs.votePopup.hideVote()
  453. setTimeout(() => {
  454. this.$refs.toast.error(res.data.msg)
  455. }, 200)
  456. }
  457. },
  458. customBack() {
  459. if (this.isCustomBack == true) {
  460. uni.switchTab({
  461. url: '/pages/index/home'
  462. })
  463. } else {
  464. uni.navigateBack({
  465. delta: 1
  466. })
  467. }
  468. },
  469. //分享
  470. showPoster() {
  471. this.$refs.poster.showCanvas()
  472. },
  473. async shareConfirm(item) {
  474. if (item.name == '海报') {
  475. this.showPoster()
  476. return
  477. }
  478. if (item.name == '好友') {
  479. // #ifdef H5
  480. this.$refs.timelinePopup.PopupTyPe = 'friend';
  481. this.$refs.timelinePopup.show()
  482. // #endif
  483. return
  484. }
  485. if (item.name == '朋友圈') {
  486. this.$refs.timelinePopup.PopupTyPe = 'friendsCircle';
  487. this.$refs.timelinePopup.show()
  488. }
  489. },
  490. async showShare() {
  491. await this.handelShareParams()
  492. this.$refs.sharePopup.show()
  493. },
  494. skipShop() {
  495. uni.setStorageSync('isWorksSkip', true)
  496. uni.switchTab({
  497. url: '/pages/shop/shop'
  498. })
  499. },
  500. // h5 创建订单 begin
  501. h5CreateOrder() {
  502. if (this.$cache.get('orderResult')) {
  503. this.orderResult = this.$cache.get('orderResult')
  504. return
  505. }
  506. //初始化js脚本
  507. this.initScript()
  508. //获取Fmopt
  509. this.fetchFmopt()
  510. //获取sessionId
  511. this.loadScriptFunc("", this.fetchSessionId())
  512. //打印数据
  513. this.cacheOrderData()
  514. },
  515. cacheOrderData() {
  516. let _this = this
  517. setTimeout(() => {
  518. _this.$nextTick(function() {
  519. try {
  520. _this.count++
  521. console.log("sessionId:" + window.sessionId);
  522. console.log("fingerprint:" + _fmOpt.getinfo());
  523. console.log("获取成功啦");
  524. _this.pushInCache(_fmOpt.getinfo(), window.sessionId)
  525. } catch (e) {
  526. console.log(_this.count);
  527. if (_this.count < 10) {
  528. _this.cacheOrderData()
  529. }
  530. }
  531. })
  532. }, 20)
  533. },
  534. pushInCache(fingerprint, sessionId) {
  535. this.orderResult = {
  536. fingerprint: encodeURIComponent(fingerprint),
  537. sessionId,
  538. goodsId: this.selectGoods.id
  539. }
  540. this.$cache.put('orderResult', this.orderResult)
  541. },
  542. initScript() {
  543. let monitorURL = "https://static.tongdun.net/monitor/monitor.js"
  544. this.loadScript(monitorURL)
  545. let tfdURL = "https://j.changyoyo.com/static/js/common/tfd.js"
  546. this.loadScript(tfdURL)
  547. let jqueryURL = "https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"
  548. this.loadScript(jqueryURL)
  549. },
  550. fetchFmopt() {
  551. window._fmOpt = {
  552. partner: 'changyou',
  553. appName: 'changyou_web',
  554. token: 'changyou' + "-" + new Date().getTime() + "-" +
  555. Math.random().toString(16).substr(2),
  556. fmb: true,
  557. success: function(data) {
  558. console.log('blackbox: ', data)
  559. },
  560. fpHost: "https://fp.tongdun.net"
  561. };
  562. var cimg = new Image(1, 1);
  563. cimg.onload = function() {
  564. _fmOpt.imgLoaded = true;
  565. };
  566. cimg.src =
  567. "https://fp.tongdun.net/fp/clear.png?partnerCode=changyou&appName=changyou_web&tokenId=" +
  568. _fmOpt.token;
  569. var fm = document.createElement('script');
  570. fm.type = 'text/javascript';
  571. fm.async = true;
  572. fm.src = ('https:' == document.location.protocol ? 'https://' : 'http://') +
  573. 'static.tongdun.net/v3/fm.js?ver=0.1&t=' + (new Date().getTime() / 3600000).toFixed(0);
  574. var s = document.getElementsByTagName('script')[0];
  575. s.parentNode.insertBefore(fm,
  576. s);
  577. },
  578. loadScript(src) {
  579. var script = document.createElement('script');
  580. script.src = src;
  581. document.body.appendChild(script);
  582. },
  583. loadScriptFunc(url, callback) {
  584. callback = typeof callback === 'function' ? callback : function() {};
  585. var head = document.getElementsByTagName('head')[0];
  586. var script = document.createElement('script');
  587. script.type = 'text/javascript';
  588. script.src = url;
  589. script.onreadystatechange = function() {
  590. if (this.readyState == "loaded" || this.readyState == "complete") {
  591. callback();
  592. }
  593. }
  594. script.onload = callback;
  595. head.appendChild(script);
  596. },
  597. fetchSessionId() {
  598. var url, ts, sessionId, appId, appkey;
  599. url = "tfd.changyoyo.com";
  600. appId = "5308e20b";
  601. appkey = "3daf27ea2fe840ada6af8e1ec0d7b760";
  602. ts = new Date().getTime();
  603. sessionId = "changyo-pc-" + ts + "-" + Math.random().toString(16).substr(2);
  604. window.sessionId = sessionId;
  605. [document.getElementsByTagName('script')[0].parentNode.appendChild(document.createElement('script')).src =
  606. "http://" +
  607. url + "/did/js/dp.js?appId=" + appId + "&appkey=" + appkey + "&sessionId=" + sessionId +
  608. "&ts=" +
  609. ts
  610. ][0];
  611. },
  612. //h5 创建订单end
  613. //获取活动参数
  614. async getActivitySetting() {
  615. // if (this.$isNotEmpty(this.vuex_active_setting)) { //有缓存直接从缓存获取
  616. // this.activitySetting = this.vuex_active_setting;
  617. // return;
  618. // }
  619. let params = {
  620. activeId: this.activity.activeId,
  621. platformSettingEnum: 'ACTIVE_SETTING'
  622. }
  623. let activeSetting = JSON.parse((await this.$api.platform.getPlatformValue(params)).data.data);
  624. this.$config.setTheme(activeSetting.theme, this);
  625. this.customStyle.background = this.vuex_theme.bgColor;
  626. this.activitySetting = activeSetting;
  627. activeSetting.defaultActiveId = this.activity.activeId
  628. this.$u.vuex('vuex_active_setting', activeSetting);
  629. },
  630. },
  631. }
  632. </script>
  633. <style lang="scss" scoped>
  634. .works-video {
  635. width: 100vw;
  636. height: 422rpx;
  637. }
  638. .title {
  639. padding: 20rpx;
  640. .work-no {
  641. padding: 5rpx 10rpx 5rpx 10rpx;
  642. border-radius: 7rpx;
  643. }
  644. .work-title {
  645. padding: 0 0 0 20rpx;
  646. color: #353535;
  647. font-size: 32rpx;
  648. font-weight: 800;
  649. }
  650. }
  651. .work-info-box {
  652. padding: 30rpx 0 15rpx 10rpx;
  653. .remen-icon {
  654. width: 30rpx;
  655. height: 30rpx;
  656. }
  657. .vote-count {
  658. padding: 0 20rpx 0 10rpx;
  659. font-size: 40rpx;
  660. color: #353535;
  661. font-weight: 800;
  662. }
  663. .work-rank {
  664. margin-left: -10rpx;
  665. color: #353535;
  666. background: #FDEBEC;
  667. border-radius: 21px 21px 21px 21px;
  668. font-size: 22rpx;
  669. padding: 8rpx 15rpx 8rpx 15rpx;
  670. }
  671. }
  672. .footer-bar {
  673. position: fixed;
  674. bottom: 0;
  675. left: 0;
  676. width: 100%;
  677. height: 170rpx;
  678. background-color: white;
  679. }
  680. .canvas-hide {
  681. position: fixed;
  682. right: 100vw;
  683. bottom: 100vh;
  684. z-index: -9999;
  685. opacity: 0;
  686. }
  687. </style>