activityDetail.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757
  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. <webAuthAlert ref="webAuthAlert" tipsContent="首次现金投票助力需用户授权" @confirm="webAuthConfirm"></webAuthAlert>
  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 webAuthAlert from "@/components/alert/webAuthAlert.vue"
  82. export default {
  83. components: {
  84. voteSuccess,
  85. smsAlert,
  86. sharePopup,
  87. timelinePopup,
  88. votePopup,
  89. poster,
  90. webAuthAlert
  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. computed: {
  123. content() {
  124. return decodeURIComponent(this.activity.content)
  125. },
  126. btnText: {
  127. get() {
  128. let now = new Date().getTime()
  129. let startTime = this.$dateTime.getTime(this.activity.activeStartTime)
  130. let endTime = this.$dateTime.getTime(this.activity.activeEndTime)
  131. if (now < startTime) {
  132. return "活动未开始"
  133. }
  134. if (now > endTime) {
  135. return "活动已结束"
  136. }
  137. return "给ta投票"
  138. }
  139. }
  140. },
  141. data() {
  142. return {
  143. count: 0,
  144. //是否自定义返回,防止授权时返回到webview页面
  145. isCustomBack: true,
  146. defaultAvatar: 'https://vote.guosen-fumao.cn/obsfile/446d9e043f3748e4a47ea4d0de81b140-3b748fea4150c469b8eb66f98cd29e2.png',
  147. loading: false,
  148. //作品id
  149. id: '',
  150. //订单结果
  151. orderResult: {},
  152. //授权结果
  153. authResult: {},
  154. //分享
  155. qrCodeImg: '',
  156. //选中的道具
  157. selectGoods: {},
  158. mpShare: {},
  159. posetrParams: {
  160. avatar: '',
  161. title: '我是普法帮帮代言人',
  162. subTitle: '邀请您为888号作品投票!',
  163. activeId: ''
  164. },
  165. activity: {},
  166. customStyle: {
  167. color: 'white',
  168. background: "#ffffff",
  169. fontSize: '32rpx',
  170. width: '500rpx',
  171. margin: '25rpx auto'
  172. },
  173. disabledStyle: {
  174. background: "#f1f1f1",
  175. fontSize: '32rpx',
  176. width: '500rpx',
  177. margin: '25rpx auto'
  178. },
  179. //活动设置
  180. activitySetting: {},
  181. }
  182. },
  183. onShareAppMessage(res) {
  184. return {
  185. title: `${this.$isNotEmpty(this.activitySetting.pullVoteParam) ? `【${this.activitySetting.pullVoteParam.sponsor}】` : ``}${this.mpShare.title}`,
  186. path: this.mpShare.path,
  187. imageUrl: this.mpShare.imageUrl
  188. }
  189. },
  190. onShareTimeline(res) {
  191. return {
  192. title: `${this.$isNotEmpty(this.activitySetting.pullVoteParam) ? `【${this.activitySetting.pullVoteParam.sponsor}】` : ``}${this.mpShare.title}`,
  193. path: this.mpShare.path,
  194. imageUrl: this.mpShare.imageUrl
  195. }
  196. },
  197. methods: {
  198. goVote() {
  199. if (this.btnText == '给ta投票') {
  200. this.login()
  201. return
  202. }
  203. this.$refs.toast.error(this.btnText)
  204. },
  205. showLoading() {
  206. // #ifdef MP-WEIXIN
  207. this.$refs.loading.showLoading()
  208. // #endif
  209. // #ifndef MP-WEIXIN
  210. this.$dialog.showLoading()
  211. // #endif
  212. },
  213. videoError(e) {
  214. console.log(e, "error");
  215. },
  216. hideLoading() {
  217. // #ifdef MP-WEIXIN
  218. this.$refs.loading.hide()
  219. // #endif
  220. // #ifndef MP-WEIXIN
  221. uni.hideLoading()
  222. // #endif
  223. this.loading = false
  224. },
  225. async fetchData() {
  226. this.activity = (await this.$api.activity.getWorksDetail(this.id)).data.data
  227. },
  228. async handelShareParams() {
  229. let title = await this.getPosetrParamsTitle();
  230. const userInfo = uni.getStorageSync("userInfo");
  231. /**
  232. * 海报分享参数
  233. * avatar: 显示优先级:作品封面 >>> 用户头像 >>> 默认头像
  234. * title: 显示优先级:平台自定义标题 >>> 我是第X号大赛代言人!>>> 我是普法帮帮代言人!
  235. */
  236. this.posetrParams = {
  237. avatar: this.activity.imgUrl || userInfo.avatar || this.defaultAvatar,
  238. title: this.activitySetting.pullVoteParam.title || title,
  239. subTitle: '邀请您为' + this.activity.productNo + '号作品投票!',
  240. activeId: this.activity.activeId
  241. }
  242. let userId = this.vuex_userId || '000000' //游客
  243. let sharePath = '/pages/activity/activityDetail?id=' + this.activity.id + '&userId=' + userId
  244. let encodePath = encodeURIComponent(sharePath)
  245. /**
  246. * 小程序分享参数
  247. * title:【主办方名字】 || '' + 用户自定义标题 || 我是第X号大赛代言人!+ 邀请您为《XXX》投票!
  248. */
  249. this.mpShare = {
  250. title: `${this.activitySetting.pullVoteParam.title || title} , 邀请您为《${this.activity.title}》投票!`,
  251. path: '/pages/index/home?path=' + encodePath,
  252. imageUrl: this.activity.imgUrl
  253. }
  254. this.h5share()
  255. },
  256. async h5share() {
  257. // #ifdef H5
  258. /**
  259. * H5分享参数
  260. * title:【主办方名字】 || '' + 用户自定义标题 || 我是第X号大赛代言人!|| 我是普法帮帮代言人!+ 邀请您为《XXX》投票!
  261. */
  262. let shareParam = {
  263. title: `${this.$isNotEmpty(this.activitySetting.pullVoteParam.sponsor) ? `【${this.activitySetting.pullVoteParam.sponsor}】` : ``}${this.posetrParams.title}`,
  264. desc: `邀请您为《${this.activity.title}》投票!`,
  265. imgUrl: this.activity.imgUrl,
  266. link: window.location.href
  267. }
  268. this.$shareConfig.H5Share(shareParam);
  269. // #endif
  270. },
  271. async getPosetrParamsTitle() {
  272. let title = "我是普法帮帮代言人"
  273. if (this.$isEmpty(this.vuex_phone)) {
  274. return title
  275. }
  276. let params = {
  277. activeId: this.activity.activeId,
  278. phone: this.vuex_phone
  279. }
  280. let res = await this.$api.activity.getPromoteNum(params)
  281. if (this.$isNotEmpty(res.data) && this.$isNotEmpty(res.data.data.index)) {
  282. let index = res.data.data.startIndex
  283. title = `我是第${index}位大赛代言人!`
  284. }
  285. return title
  286. },
  287. handelAuthResult(options) {
  288. if (options.authResult == undefined) {
  289. return
  290. }
  291. this.authResult = JSON.parse(options.authResult)
  292. if (this.authResult.resultCode == '0000') {
  293. //授权成功,直接弹出礼物框
  294. this.hideLoading()
  295. this.showVote()
  296. return
  297. }
  298. // #ifdef MP-WEIXIN
  299. if (this.authResult.resultCode == '9999') {
  300. //授权失败
  301. this.$refs.toast.error(this.authResult.message)
  302. return
  303. }
  304. // #endif
  305. },
  306. handelOrderResult(options) {
  307. if (options.orderPass && this.$cache.get('orderResult')) {
  308. this.orderResult = this.$cache.get('orderResult')
  309. this.createOrder()
  310. }
  311. },
  312. async showVote() {
  313. this.$refs.votePopup.showVote(this.vuex_phone, this.id, this.activity.activeId);
  314. },
  315. init() {
  316. if (this.vuex_phone) {
  317. this.showVote()
  318. }
  319. },
  320. //去投票
  321. toVote(item) {
  322. if (this.$cache.get('orderResult')) {
  323. this.orderResult = this.$cache.get('orderResult')
  324. this.orderResult.goodsId = item.id
  325. this.$cache.put('orderResult', this.orderResult, 1 * 60 * 60)
  326. }
  327. this.selectGoods = item
  328. //移动积分礼物
  329. if(item.payType === 'POINT_EXCHANGE_GOODS'){
  330. if (item.point == 0 ) {
  331. //免费投票
  332. this.freeVote()
  333. return
  334. }
  335. this.$refs.votePopup.hideVote()
  336. //移动积分投票,创建订单
  337. if (this.$cache.get('orderResult')) {
  338. this.createOrder()
  339. return
  340. }
  341. // #ifdef MP-WEIXIN
  342. let params = {
  343. url: 'https://vote.guosen-fumao.cn/order.html',
  344. goodsId: this.selectGoods.id
  345. }
  346. this.$jump('/pages/webview/createOrder' + this.$u.queryParams(params))
  347. // #endif
  348. }else{
  349. // #ifdef H5
  350. if(this.$isEmpty(this.vuex_gzh_userOpenid)){
  351. let code = this.$util.getUrlParam("code");
  352. if(this.$isEmpty(code)){
  353. this.$refs.webAuthAlert.show = true;
  354. }else{
  355. this.getWxUserInfo(code)
  356. console.log("code",code)
  357. }
  358. }else{
  359. this.cashCreateOrder();
  360. }
  361. // #endif
  362. // #ifdef MP-WEIXIN
  363. this.$refs.toast.warn('小程序暂未开放现金投票,请前往H5投票')
  364. this.$refs.votePopup.hideVote();
  365. // #endif
  366. }
  367. },
  368. //移动积分创建订单
  369. async createOrder() {
  370. if (this.$isEmpty(this.orderResult.fingerprint) ||
  371. this.$isEmpty(this.orderResult.sessionId) ||
  372. this.$isEmpty(this.orderResult.goodsId)) {
  373. this.$refs.toast.error('创建订单失败')
  374. return
  375. }
  376. let params = {
  377. fingerprint: this.orderResult.fingerprint,
  378. helpGoodsId: this.orderResult.goodsId,
  379. sessionId: this.orderResult.sessionId,
  380. num: 1,
  381. phone: this.vuex_phone,
  382. userId: this.vuex_userId
  383. }
  384. let res = await this.$api.order.create(params)
  385. if (res.data.success) {
  386. console.log("orderResult", this.orderResult);
  387. this.orderResult.outOrderId = res.data.data
  388. this.orderResult.mobile = this.vuex_phone
  389. this.$refs.smsAlert.showSmsAndSend(this.orderResult)
  390. } else {
  391. this.$refs.toast.error(res.data.msg)
  392. }
  393. },
  394. //获取微信网页授权用户信息
  395. async getWxUserInfo(code) {
  396. let params = {
  397. code: code
  398. }
  399. let res = await this.$api.wxApp.getH5WxUserInfo(params)
  400. if (res.data.success) {
  401. this.$u.vuex('vuex_gzh_userOpenid', res.data.data.openid);
  402. this.cashCreateOrder();
  403. } else {
  404. // if(res.data.code == 400){
  405. // this.$webAuth.getUserOpenid();
  406. // return
  407. // }
  408. this.$refs.toast.error(res.data.msg)
  409. }
  410. },
  411. //现金投票创建订单
  412. async cashCreateOrder() {
  413. let params = {
  414. helpGoodsId: this.selectGoods.id,
  415. num: 1,
  416. phone: this.vuex_phone,
  417. productId: this.id,
  418. userId: this.vuex_userId,
  419. openId: this.vuex_gzh_userOpenid
  420. }
  421. let res = await this.$api.order.cashExchange(params)
  422. if (res.data.success) {
  423. let url = encodeURIComponent(location.href);
  424. let params = {
  425. orderId: res.data.data.bankOrderId,
  426. orderUrl: url,
  427. color: this.vuex_theme.bgColor
  428. }
  429. this.$api.yeepay.saveOrderUrlAndColor(params)
  430. this.$shareConfig.H5Pay(JSON.parse(res.data.data.prePayTn)).then((res) => {
  431. console.log("作品投票页面res", res)
  432. this.voteSuccess();
  433. },(err) => {
  434. console.log("作品投票页面err", err)
  435. this.$refs.toast.error(err.errMsg)
  436. })
  437. } else {
  438. this.$refs.toast.error(res.data.msg)
  439. }
  440. this.$refs.votePopup.hideVote();
  441. },
  442. //网页授权
  443. webAuthConfirm(){
  444. let url = encodeURIComponent(window.location.href)
  445. this.$webAuth.getUserOpenid(url);
  446. },
  447. async cmccVote(item) {
  448. this.$refs.smsAlert.hideSms()
  449. let params = {
  450. ...item,
  451. machinetype: 'phone',
  452. productId: this.id,
  453. helpGoodsId: this.orderResult.goodsId,
  454. userId: this.vuex_userId,
  455. num: 1,
  456. }
  457. let res = await this.$api.order.exchange(params)
  458. if (res.data.success) {
  459. this.voteSuccess()
  460. this.$refs.smsAlert.hideSms()
  461. } else {
  462. this.$refs.toast.error(res.data.msg)
  463. }
  464. },
  465. voteSuccess() {
  466. try {
  467. let avatar = this.$cache.get('userInfo').avatar || this.defaultAvatar
  468. let activeVote = this.selectGoods.votePointRate
  469. this.$refs.voteSuccess.showSuccess(avatar, activeVote)
  470. } catch (e) {
  471. this.$refs.toast.info('助力成功')
  472. }
  473. },
  474. async freeVote() {
  475. let params = {
  476. helpGoodsId: this.selectGoods.id,
  477. userId: this.vuex_userId,
  478. num: 1,
  479. productId: this.activity.id,
  480. }
  481. let res = await this.$api.order.exchange(params)
  482. if (res.data.success) {
  483. this.$refs.votePopup.hideVote()
  484. this.fetchData()
  485. let avatar = this.$cache.get('userInfo').avatar
  486. let voteCount = this.selectGoods.votePointRate
  487. let pointNum = this.vuex_active_setting.voteAndPointRate
  488. setTimeout(() => {
  489. this.voteSuccess()
  490. }, 200)
  491. } else {
  492. this.$refs.votePopup.hideVote()
  493. setTimeout(() => {
  494. this.$refs.toast.error(res.data.msg)
  495. }, 200)
  496. }
  497. },
  498. customBack() {
  499. if (this.isCustomBack == true) {
  500. uni.switchTab({
  501. url: '/pages/index/home'
  502. })
  503. } else {
  504. uni.navigateBack({
  505. delta: 1
  506. })
  507. }
  508. },
  509. //分享
  510. showPoster() {
  511. this.$refs.poster.showCanvas()
  512. },
  513. async shareConfirm(item) {
  514. if (item.name == '海报') {
  515. this.showPoster()
  516. return
  517. }
  518. if (item.name == '好友') {
  519. // #ifdef H5
  520. this.$refs.timelinePopup.PopupTyPe = 'friend';
  521. this.$refs.timelinePopup.show()
  522. // #endif
  523. return
  524. }
  525. if (item.name == '朋友圈') {
  526. this.$refs.timelinePopup.PopupTyPe = 'friendsCircle';
  527. this.$refs.timelinePopup.show()
  528. }
  529. },
  530. async showShare() {
  531. await this.handelShareParams()
  532. this.$refs.sharePopup.show()
  533. },
  534. skipShop() {
  535. uni.setStorageSync('isWorksSkip', true)
  536. uni.switchTab({
  537. url: '/pages/shop/shop'
  538. })
  539. },
  540. // h5 创建订单 begin
  541. h5CreateOrder() {
  542. if (this.$cache.get('orderResult')) {
  543. this.orderResult = this.$cache.get('orderResult')
  544. return
  545. }
  546. //初始化js脚本
  547. this.initScript()
  548. //获取Fmopt
  549. this.fetchFmopt()
  550. //获取sessionId
  551. this.loadScriptFunc("", this.fetchSessionId())
  552. //打印数据
  553. this.cacheOrderData()
  554. },
  555. cacheOrderData() {
  556. let _this = this
  557. setTimeout(() => {
  558. _this.$nextTick(function() {
  559. try {
  560. _this.count++
  561. console.log("sessionId:" + window.sessionId);
  562. console.log("fingerprint:" + _fmOpt.getinfo());
  563. console.log("获取成功啦");
  564. _this.pushInCache(_fmOpt.getinfo(), window.sessionId)
  565. } catch (e) {
  566. console.log(_this.count);
  567. if (_this.count < 10) {
  568. _this.cacheOrderData()
  569. }
  570. }
  571. })
  572. }, 20)
  573. },
  574. pushInCache(fingerprint, sessionId) {
  575. this.orderResult = {
  576. fingerprint: encodeURIComponent(fingerprint),
  577. sessionId,
  578. goodsId: this.selectGoods.id
  579. }
  580. this.$cache.put('orderResult', this.orderResult)
  581. },
  582. initScript() {
  583. let monitorURL = "https://static.tongdun.net/monitor/monitor.js"
  584. this.loadScript(monitorURL)
  585. let tfdURL = "https://j.changyoyo.com/static/js/common/tfd.js"
  586. this.loadScript(tfdURL)
  587. let jqueryURL = "https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"
  588. this.loadScript(jqueryURL)
  589. },
  590. fetchFmopt() {
  591. window._fmOpt = {
  592. partner: 'changyou',
  593. appName: 'changyou_web',
  594. token: 'changyou' + "-" + new Date().getTime() + "-" +
  595. Math.random().toString(16).substr(2),
  596. fmb: true,
  597. success: function(data) {
  598. console.log('blackbox: ', data)
  599. },
  600. fpHost: "https://fp.tongdun.net"
  601. };
  602. var cimg = new Image(1, 1);
  603. cimg.onload = function() {
  604. _fmOpt.imgLoaded = true;
  605. };
  606. cimg.src =
  607. "https://fp.tongdun.net/fp/clear.png?partnerCode=changyou&appName=changyou_web&tokenId=" +
  608. _fmOpt.token;
  609. var fm = document.createElement('script');
  610. fm.type = 'text/javascript';
  611. fm.async = true;
  612. fm.src = ('https:' == document.location.protocol ? 'https://' : 'http://') +
  613. 'static.tongdun.net/v3/fm.js?ver=0.1&t=' + (new Date().getTime() / 3600000).toFixed(0);
  614. var s = document.getElementsByTagName('script')[0];
  615. s.parentNode.insertBefore(fm,
  616. s);
  617. },
  618. loadScript(src) {
  619. var script = document.createElement('script');
  620. script.src = src;
  621. document.body.appendChild(script);
  622. },
  623. loadScriptFunc(url, callback) {
  624. callback = typeof callback === 'function' ? callback : function() {};
  625. var head = document.getElementsByTagName('head')[0];
  626. var script = document.createElement('script');
  627. script.type = 'text/javascript';
  628. script.src = url;
  629. script.onreadystatechange = function() {
  630. if (this.readyState == "loaded" || this.readyState == "complete") {
  631. callback();
  632. }
  633. }
  634. script.onload = callback;
  635. head.appendChild(script);
  636. },
  637. fetchSessionId() {
  638. var url, ts, sessionId, appId, appkey;
  639. url = "tfd.changyoyo.com";
  640. appId = "5308e20b";
  641. appkey = "3daf27ea2fe840ada6af8e1ec0d7b760";
  642. ts = new Date().getTime();
  643. sessionId = "changyo-pc-" + ts + "-" + Math.random().toString(16).substr(2);
  644. window.sessionId = sessionId;
  645. [document.getElementsByTagName('script')[0].parentNode.appendChild(document.createElement('script')).src =
  646. "http://" +
  647. url + "/did/js/dp.js?appId=" + appId + "&appkey=" + appkey + "&sessionId=" + sessionId +
  648. "&ts=" +
  649. ts
  650. ][0];
  651. },
  652. //h5 创建订单end
  653. //获取活动参数
  654. async getActivitySetting() {
  655. // if (this.$isNotEmpty(this.vuex_active_setting)) { //有缓存直接从缓存获取
  656. // this.activitySetting = this.vuex_active_setting;
  657. // return;
  658. // }
  659. let params = {
  660. activeId: this.activity.activeId,
  661. platformSettingEnum: 'ACTIVE_SETTING'
  662. }
  663. let activeSetting = JSON.parse((await this.$api.platform.getPlatformValue(params)).data.data);
  664. this.$config.setTheme(activeSetting.theme, this);
  665. this.customStyle.background = this.vuex_theme.bgColor;
  666. this.activitySetting = activeSetting;
  667. activeSetting.defaultActiveId = this.activity.activeId
  668. this.$u.vuex('vuex_active_setting', activeSetting);
  669. },
  670. },
  671. }
  672. </script>
  673. <style lang="scss" scoped>
  674. .works-video {
  675. width: 100vw;
  676. height: 422rpx;
  677. }
  678. .title {
  679. padding: 20rpx;
  680. .work-no {
  681. padding: 5rpx 10rpx 5rpx 10rpx;
  682. border-radius: 7rpx;
  683. }
  684. .work-title {
  685. padding: 0 0 0 20rpx;
  686. color: #353535;
  687. font-size: 32rpx;
  688. font-weight: 800;
  689. }
  690. }
  691. .work-info-box {
  692. padding: 30rpx 0 15rpx 10rpx;
  693. .remen-icon {
  694. width: 30rpx;
  695. height: 30rpx;
  696. }
  697. .vote-count {
  698. padding: 0 20rpx 0 10rpx;
  699. font-size: 40rpx;
  700. color: #353535;
  701. font-weight: 800;
  702. }
  703. .work-rank {
  704. margin-left: -10rpx;
  705. color: #353535;
  706. background: #FDEBEC;
  707. border-radius: 21px 21px 21px 21px;
  708. font-size: 22rpx;
  709. padding: 8rpx 15rpx 8rpx 15rpx;
  710. }
  711. }
  712. .footer-bar {
  713. position: fixed;
  714. bottom: 0;
  715. left: 0;
  716. width: 100%;
  717. height: 170rpx;
  718. background-color: white;
  719. }
  720. .canvas-hide {
  721. position: fixed;
  722. right: 100vw;
  723. bottom: 100vh;
  724. z-index: -9999;
  725. opacity: 0;
  726. }
  727. </style>