index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972
  1. <template>
  2. <view class="vote-detail">
  3. <!-- 活动查询 -->
  4. <view class="title">
  5. <image style="width: 158rpx;height: 158rpx;border-radius: 50%; " :src="voteDetail.logo" mode="">
  6. </image>
  7. <text class="title-text">{{voteDetail.project_name}}</text>
  8. <text class="title-btn">{{voteDetail.activity.title}}</text>
  9. </view>
  10. <!-- 分割线 -->
  11. <view style="width: 92%; height: 2rpx; background-color:#F0F0F0;margin: 40rpx auto; "></view>
  12. <!-- 排名 -->
  13. <view class="rank">
  14. <view class="vote-detail-btn">
  15. <view class="vote-detail-btn-item">
  16. <text class="vote-detail-btn-item-num">{{voteDetail.project_no}}</text>
  17. <text class="vote-detail-btn-item-text">编号</text>
  18. </view>
  19. <view style="width: 2rpx;height: 52rpx;background-color: #ccc;"></view>
  20. <view class="vote-detail-btn-item">
  21. <text class="vote-detail-btn-item-num"
  22. v-if="voteDetail.ticket_num>=0">{{voteDetail.ticket_num + voteDetail.virtual_ticket_num}}</text>
  23. <text class="vote-detail-btn-item-text">票数</text>
  24. </view>
  25. <view style="width: 2rpx;height: 52rpx;background-color: #ccc;"></view>
  26. <view class="vote-detail-btn-item">
  27. <text class="vote-detail-btn-item-num">{{voteDetail.rank}}</text>
  28. <text class="vote-detail-btn-item-text">排名</text>
  29. </view>
  30. <view style="width: 2rpx;height: 52rpx;background-color: #ccc;"></view>
  31. <view class="vote-detail-btn-item">
  32. <text class="vote-detail-btn-item-num">{{voteDetail.next_rank_ticket_num}}</text>
  33. <text class="vote-detail-btn-item-text">距上名</text>
  34. </view>
  35. </view>
  36. </view>
  37. <!-- 轮播图 -->
  38. <view style="background-color: #f9f9f9;">
  39. <view class="swiper">
  40. <view class="home-swiper">
  41. <uni-swiper-dot :mode="mode" :info="info" :current="current1" :dots-styles="dotsStyles">
  42. <swiper class="swiper-box" @change="change1" circular>
  43. <swiper-item v-for="(item ,index) in info" :key="index" v-if="resource_type == 1 ">
  44. <view class="swiper-item">
  45. <image style="width: 100%;height:576rpx; border-radius: 12rpx; " :src="item.img"
  46. mode="aspectFill"></image>
  47. </view>
  48. </swiper-item>
  49. <swiper-item v-if="resource_type == 2 ">
  50. <view class="swiper-item">
  51. <video id="myVideo" ref="myVideo"
  52. style="width: 100%; height: 576rpx;border-radius: 12rpx; " :src="video_url"
  53. controls :enable-progress-gesture="false">
  54. </video>
  55. </view>
  56. </swiper-item>
  57. </swiper>
  58. </uni-swiper-dot>
  59. </view>
  60. </view>
  61. <!-- 投票 -->
  62. <view class="btn" @click="goVote(activity_project_id)">
  63. <view v-if="spending || isStart" class="btn-vote"
  64. :class="spending?'btn-vote': isStart?'btn-vote-fasle' :'' ">
  65. <text>{{voteDetail.activity.vote_name}}</text>
  66. </view>
  67. <view class="btn-vote-fasle" v-if="isEnd">
  68. <text>投票结束</text>
  69. </view>
  70. </view>
  71. <!-- 帮我拉票 -->
  72. <view class="help">
  73. <!-- <view class="help-btn" @click="getPoster">
  74. <text>帮我拉票</text>
  75. </view> -->
  76. <view class="help-btn" @click="showPoster">
  77. <text>帮我拉票</text>
  78. </view>
  79. </view>
  80. <movable-area class="movableArea">
  81. <movable-view class="movableView" direction="all" x="630rpx" y="700rpx">
  82. <view class="img-IHg" @click="goJoin">
  83. <image style="width: 84rpx; height: 84rpx;border-radius: 50%; " :src="indexVipImg" mode=""></image>
  84. </view>
  85. </movable-view>
  86. </movable-area>
  87. <!-- 分割线 -->
  88. <view style="width: 92%; height: 2rpx; background-color:#F0F0F0;margin: 64rpx auto; "></view>
  89. <!-- 介绍 -->
  90. <view class="introduce">
  91. <view class="introduce-title">
  92. <text>参赛介绍</text>
  93. </view>
  94. <view class="introduce-text">
  95. <u-parse :content="voteDetail.intro"></u-parse>
  96. </view>
  97. </view>
  98. <!-- 预约 -->
  99. <view class="reserve">
  100. <view class="reserve-left" @click="goSwiperSmall">
  101. <image style="width: 36rpx;height: 36rpx; margin-right: 10rpx;" src="/static/icon/reserve02.png"
  102. mode=""></image>
  103. <text>预约</text>
  104. </view>
  105. <view class="reserve-right" @click="goJoinActivity">
  106. <image style="width: 44rpx;height: 44rpx; margin-right: 10rpx;border-radius: 50%; " :src="voteVipImg"
  107. mode=""></image>
  108. <text>加入IHG会员</text>
  109. </view>
  110. </view>
  111. </view>
  112. <!-- 弹出层 -->
  113. <uni-popup ref="popup" type="center">
  114. <view class="pop">
  115. <view class="title"><text>{{pupopSuccess? "投票成功" : "票数不足"}}</text></view>
  116. <view class="img" v-if="is_prize==0">
  117. <image :src="voteDetail.activity.success_img"></image>
  118. </view>
  119. <view class="img" v-if="is_prize==1">
  120. <image :src="voteDetail.activity.success_img"></image>
  121. </view>
  122. <view class="textfont">
  123. <text v-if="!isVoteNum && is_prize==0">今日投票数已用完
  124. {{!isVoteNum&&!is_vip&&vipRewardTicketNum ? `点击 加入IHG会员 可享受额外${vipRewardTicketNum}票` : ""}}</text>
  125. <text v-if="isVoteNum && is_prize==0 ">今日投票数还有 {{userCanVoteNum}} 次
  126. 点击再次投票可再次为本项目投票也可为其他项目投票</text>
  127. <text v-if="is_prize==1">恭喜你中奖了!
  128. 获得了{{prizeProduct}}{{prizeProduct.indexOf('积分')==-1?',请尽快领取':''}}</text>
  129. </view>
  130. <view class="btn">
  131. <view v-if="is_prize==0" class="cancel"
  132. @click="isVoteNum?goVote(activity_project_id,true):closeVote()">
  133. <text>{{isVoteNum?'再次投票':'关闭'}}</text>
  134. </view>
  135. <view v-if="is_prize==0" class="download" @click="isVoteNum||is_vip?goOtherItem():goJoinActivity()">
  136. <text>{{isVoteNum||is_vip||!vipRewardTicketNum?'其他项目':'加入IHG会员' }}</text>
  137. </view>
  138. <view v-if="is_prize==1" class="cancel" @click="closeVote">
  139. <text>关闭</text>
  140. </view>
  141. <view v-if="is_prize==1" class="download" @click="goConvert(prizeProduct.indexOf('积分')==-1)">
  142. <text>{{prizeProduct.indexOf('积分')==-1?'去兑换':'去查看'}}</text>
  143. </view>
  144. </view>
  145. </view>
  146. </uni-popup>
  147. <Poster :activity_project_id='activity_project_id' ref="poster" :name="voteDetail.project_name" :title="voteDetail.activity.title"/>
  148. <!-- 弹出层/核销码 -->
  149. <uni-popup ref="dialogPanel" type="center">
  150. <view class="pop">
  151. <view class="title"><text>识别下方二维码即可购买</text></view>
  152. <view style="margin-left:30rpx;width: 580rpx;height: 2rpx;background: #F0F0F0;"></view>
  153. <view class="img">
  154. <image :src="jump_config" mode="aspectFit"/>
  155. </view>
  156. <view class="btn">
  157. <view class="cancel" @click="$refs.dialogPanel.close()"><text>取消</text></view>
  158. <view class="download" @click="saveImg"><text>保存图片</text></view>
  159. </view>
  160. </view>
  161. </uni-popup>
  162. </view>
  163. </template>
  164. <script>
  165. // import HchPoster from "@/components/hch-poster/hch-poster.vue"
  166. import Poster from "./poster.vue";
  167. export default {
  168. components:{Poster},
  169. data() {
  170. return {
  171. //vip图标
  172. indexVipImg:'',
  173. voteVipImg:'',
  174. //活动加入vip跳转
  175. jump_type_vip_Activity: '',
  176. jump_config_vip_Activity: {},
  177. //图标跳转h5,小程序,其他页面
  178. jump_type_vip: '',
  179. jump_config_vip: {},
  180. //加入会员广告配置
  181. advise: '',
  182. is_vip: false,
  183. pupopSuccess: true,
  184. pupopWidth: 590,
  185. pupopHeight: 788,
  186. //一定要注意像素密度的问题,这里使用的固定数值
  187. pixelRatio: 3, //屏幕像数密度
  188. inviteQR: '', //动态二维码
  189. posterImg: '', //最后生成的海报
  190. //二维码
  191. codeImg: '',
  192. //投票是否中奖,1中奖,0未中奖
  193. is_prize: '',
  194. //中奖礼物
  195. prizeProduct: '',
  196. //banner视频路径
  197. video_url: '',
  198. //banner图展示视频或者图片
  199. resource_type: '',
  200. //跳转h5和小程序
  201. jump_type: '',
  202. jump_config: 'https://zhengda.oss-cn-chengdu.aliyuncs.com/ihg/images/微信截图_20221219162756.png',
  203. //跳转vip小程序获得投票数
  204. vipRewardTicketNum: '',
  205. //活动id
  206. sourceId: '',
  207. //活动可以使用的投票数
  208. userCanVoteNum: '',
  209. isVoteNum: false,
  210. //判断活动是否正在进行中
  211. spending: false,
  212. //判断活动是否开始
  213. isStart: false,
  214. //判断活动是否结束
  215. isEnd: false,
  216. //活动开始时间
  217. startTime: '',
  218. //活动结束时间
  219. endTime: "",
  220. // 活动项目id
  221. activity_project_id: '',
  222. // 活动项目详情
  223. voteDetail: '',
  224. //轮播图
  225. info: [],
  226. dotsStyles: {
  227. backgroundColor: 'rgba(255, 255, 255, .3)',
  228. border: '1px rgba(255, 255, 255, .3) solid',
  229. color: '#fff',
  230. selectedBackgroundColor: 'rgba(255, 255, 255, 1)',
  231. selectedBorder: '1px rgba(255, 255, 255, 1) solid'
  232. },
  233. //指示点显示位置
  234. current1: 0,
  235. mode: 'dot'
  236. }
  237. },
  238. onReady: function(res) {
  239. if(!this.$store.getters.userInfo){
  240. uni.navigateTo({
  241. url: '/pages/login/login'
  242. })
  243. return;
  244. }
  245. this.videoContext = uni.createVideoContext('myVideo')
  246. },
  247. onUnload() {
  248. uni.$emit('refreshVoteNum');
  249. },
  250. onLoad(op) {
  251. this.activity_project_id = op.id
  252. this.getDetail(op.id)
  253. this.admin = this.$store.getters.userInfo
  254. this.advise = this.$store.getters.allset.add_member
  255. //vip图标
  256. this.indexVipImg = this.advise.value.index_page
  257. this.jump_type_vip = this.advise.value.index_jump_type
  258. if( this.jump_type_vip == 1){
  259. this.jump_config_vip = this.advise.value.index_h5_url
  260. }else if(this.jump_type_vip == 2){
  261. this.jump_config_vip.appid = this.advise.value.index_appid
  262. this.jump_config_vip.path = this.advise.value.index_path
  263. }else if(this.jump_type_vip == 3){
  264. this.jump_config_vip =this.advise.value.index_other_path
  265. }
  266. //活动投票跳转vip
  267. this.voteVipImg = this.advise.value.vote_activity
  268. this.jump_type_vip_Activity = this.advise.value.vote_activity_jump_type
  269. if( this.jump_type_vip_Activity == 1){
  270. this.jump_config_vip_Activity = this.advise.value.vote_activity_h5_url
  271. }else if(this.jump_type_vip_Activity == 2){
  272. this.jump_config_vip_Activity.appid = this.advise.value.vote_activity_appid
  273. this.jump_config_vip_Activity.path = this.advise.value.vote_activity_path
  274. }else if(this.jump_type_vip_Activity == 3){
  275. this.jump_config_vip_Activity =this.advise.value.vote_activity_other_path
  276. }
  277. },
  278. watch: {
  279. vipRewardTicketNum: {
  280. handler(newName, oldName) {
  281. // console.log(newName, '--->监听')
  282. },
  283. immediate: true,
  284. deep: true
  285. }
  286. },
  287. methods: {
  288. shareing() {
  289. uni.showLoading({
  290. title: "海报生成中...",
  291. mask: true
  292. })
  293. // this.inviteQR = this.codeImg
  294. // this.createPoster();
  295. },
  296. //去兑换页面
  297. goConvert(isConvert=true) {
  298. this.$utils.jump({
  299. jump_type: 4,
  300. jump_config: '/pages/my/prize/prize'
  301. })
  302. },
  303. //视频自动播放
  304. openVideoPlay() {
  305. this.videoContext.play()
  306. },
  307. //隐藏
  308. handleCancel() {
  309. console.log('取消审生成海报');
  310. },
  311. //生产海报
  312. getPoster() {
  313. this.$refs.hchPoster.posterShow()
  314. },
  315. // 切换轮播图指示点
  316. change1(e) {
  317. this.current1 = e.detail.current;
  318. },
  319. getDetail(id,callback) {
  320. this.$api.active.getActiveProjectDetail({
  321. activity_project_id: id
  322. }).then(res => {
  323. if (res.code == 0) {
  324. this.voteDetail = res.data
  325. uni.getStorage({
  326. key: `is_vip_${this.voteDetail.id}`,
  327. success: (data)=> {
  328. this.is_vip = data.data === 1 ? true : false
  329. },
  330. fail:()=>{
  331. this.is_vip = false;
  332. }
  333. });
  334. this.startTime = res.data.activity.start_time.replace(/-/g, "/")
  335. // “yyyy-MM-dd-hh-mm-ss”.replace(/-/g,"/")
  336. this.endTime = res.data.activity.end_time.replace(/-/g, "/")
  337. this.cancelTime(this.startTime, this.endTime)
  338. //活动可以使用的投票数
  339. this.userCanVoteNum = res.data.user_can_vote_num
  340. if (this.userCanVoteNum > 0) {
  341. this.isVoteNum = true
  342. } else {
  343. this.isVoteNum = false
  344. }
  345. callback && callback()
  346. this.sourceId = res.data.id
  347. //跳转vip小程序获得投票数
  348. this.vipRewardTicketNum = res.data.activity.vip_reward_ticket_num
  349. // this.info =JSON.parse( res.data.img_urls)
  350. this.info = JSON.parse(res.data.img_urls).map(item => {
  351. return {
  352. img: item
  353. }
  354. })
  355. //跳转h5和小程序
  356. this.jump_type = res.data.jump_type,
  357. this.jump_config = res.data.jump_config
  358. //banner展示视频或者图片
  359. this.resource_type = res.data.resource_type
  360. this.video_url = res.data.video_url
  361. //视频自动播放
  362. this.openVideoPlay()
  363. // //海报图片
  364. // this.posterData.mainImg = res.data.share_img
  365. // this.codeImg = res.data.qrcode_url
  366. }
  367. })
  368. },
  369. //轮播图跳转h5或者小程序和内部页面
  370. goSwiperSmall() {
  371. if(this.jump_type==3 && this.jump_config.substr(0, 7) != '/pages/'){
  372. console.log(this.jump_config)
  373. this.$refs.dialogPanel.open()
  374. }else{
  375. this.$utils.jump({
  376. jump_type: this.jump_type,
  377. jump_config: this.jump_config
  378. })
  379. }
  380. },
  381. cancelTime(i, j) {
  382. let nowtime = new Date() //获取当前时间
  383. let startime = new Date(i) //活动开始时间
  384. let endtime = new Date(j); //活动结束时间
  385. let lefttime = endtime.getTime() - nowtime.getTime() //距离结束时间的毫秒数
  386. let spendtime = nowtime.getTime() - startime.getTime() //距离结束时间的毫秒数
  387. if (lefttime > 0 && spendtime > 0) {
  388. //活动进行中
  389. this.spending = true
  390. } else if (lefttime < 0) {
  391. //活动结束
  392. this.isEnd = true
  393. } else if (spendtime < 0) {
  394. //活动未开始
  395. this.isStart = true
  396. }
  397. },
  398. // 打开弹出层
  399. openVote(mode = true) {
  400. this.pupopSuccess = mode
  401. this.$refs.popup.open()
  402. },
  403. // 关闭弹出层
  404. closeVote() {
  405. this.is_prize = false
  406. this.$refs.popup.close()
  407. },
  408. //再次投票
  409. voteAgain(id) {
  410. this.goVote(id, true)
  411. },
  412. //跳转其他项目
  413. goOtherItem() {
  414. uni.navigateBack()
  415. },
  416. //获取当前页面路径
  417. getPageUrl() {
  418. const pages = getCurrentPages();
  419. if (pages.length == 1) {
  420. const currentPage = pages[0];
  421. let pageUrl = `/${currentPage.route}`;
  422. return pageUrl
  423. } else {
  424. const currentPage = pages[pages.length - 1];
  425. let pageUrl = `/${currentPage.route}`;
  426. return pageUrl
  427. }
  428. },
  429. // 跳转其他小程序
  430. goJoinActivity(){
  431. let _this = this
  432. this.jumpHAppID(this.jump_type_vip_Activity, this.jump_config_vip_Activity)
  433. },
  434. goJoin() {
  435. let _this = this
  436. this.jumpHAppID(this.jump_type_vip, this.jump_config_vip)
  437. },
  438. // 跳转其他小程序
  439. jumpHAppID(id, urls) {
  440. if (id == 1) {
  441. const url = urls; // 跳转的外链
  442. const navtitle = 'H5'; // 这个标题是你自己可以设置的
  443. uni.navigateTo({
  444. // 跳转到webview页面
  445. url: `/pages/webview/webview?url=${url}&nav=${navtitle}`,
  446. success: () => {
  447. console.log('成功')
  448. },
  449. fail: (e) => {
  450. console.log(e, "失败")
  451. }
  452. });
  453. } else if (id == 2) {
  454. let _this = this
  455. let obj = urls;
  456. console.log(obj, '----->obj');
  457. wx.navigateToMiniProgram({
  458. appId: `${obj.appid}`, //appid
  459. path: `${obj.path}`, //path
  460. extraData: { //参数
  461. foo: 'bar'
  462. },
  463. // envVersion: 'develop', //开发版develop 开发版 trial 体验版 release 正式版
  464. success(res) {
  465. const page = _this.getPageUrl()
  466. let user_id = ''
  467. if (_this.admin != null) {
  468. user_id = _this.admin.id
  469. } else {
  470. user_id = 0
  471. }
  472. _this.$api.my.userMemberAdd({
  473. user_id,
  474. page,
  475. })
  476. //增加票数
  477. _this.$api.my.userJoinVip({
  478. source_type: 1,
  479. source_id: _this.sourceId
  480. }).then(res => {
  481. console.log(res)
  482. uni.setStorage({
  483. key: `is_vip_${_this.voteDetail.id}`,
  484. data: 1,
  485. });
  486. _this.is_vip = true
  487. _this.closeVote()
  488. })
  489. // 打开成功
  490. },
  491. fail(e) {
  492. console.log(e, '失败')
  493. }
  494. })
  495. } else if (id == 3) {
  496. uni.redirectTo({
  497. url: urls,
  498. fail: (err) => {
  499. uni.reLaunch({
  500. url: urls
  501. })
  502. }
  503. })
  504. }
  505. },
  506. // 跳转其他小程序
  507. // goJoin() {
  508. // this.$utils.jumpJoinVip().then( _=>{
  509. // const page = this.getPageUrl()
  510. // let user_id = ''
  511. // if (this.admin != null) {
  512. // user_id = this.admin.id
  513. // } else {
  514. // user_id = 0
  515. // }
  516. // this.$api.my.userMemberAdd({
  517. // user_id,
  518. // page,
  519. // })
  520. // //增加票数
  521. // this.$api.my.userJoinVip({
  522. // source_type: 1,
  523. // source_id: this.sourceId
  524. // }).then(res => {
  525. // console.log(res)
  526. // uni.setStorage({
  527. // key: `is_vip_${this.voteDetail.id}`,
  528. // data: 1,
  529. // });
  530. // this.is_vip = true
  531. // this.closeVote()
  532. // })
  533. // })
  534. // },
  535. // 投票
  536. goVote(id, again = false) {
  537. again && this.closeVote();
  538. this.$api.active.vote({
  539. activity_project_id: id
  540. }).then(res => {
  541. console.log(res, '投票')
  542. if (res.code == 0) {
  543. this.is_prize = res.data.is_prize
  544. if (this.is_prize == 1) {
  545. this.prizeProduct = res.data?.product?.name ? res.data.product.name : `${res.data.integral}积分`
  546. }
  547. this.getDetail(this.activity_project_id, this.openVote())
  548. } else if(res.code === 2){
  549. console.log(this.is_vip)
  550. if(!this.is_vip){
  551. this.openVote(false)
  552. }else{
  553. uni.showToast({
  554. icon: 'none',
  555. title: res.msg
  556. })
  557. }
  558. } else {
  559. uni.showToast({
  560. icon: 'none',
  561. title: res.msg?res.msg:"暂无权限"
  562. })
  563. }
  564. }).catch(err => {
  565. console.log(err)
  566. uni.showToast({
  567. icon: 'error',
  568. title: '投票失败'
  569. })
  570. })
  571. },
  572. //帮我拉票
  573. showPoster(){
  574. /**
  575. * 注意这里的图片接口好像有问题 .activity.cover_img信息
  576. * 报错内容:{"errMsg":"getImageInfo:fail invalid"}
  577. * 可能是图片域名不在微信开发者白名单
  578. * 添加不校验规则依然报错
  579. * 核实后取消下方注释即可
  580. */
  581. this.$refs.poster.show({
  582. name: this.voteDetail.project_name,
  583. title: this.voteDetail.activity.title,
  584. imgUrl: this.voteDetail.share_img,
  585. qrcodeUrl: this.voteDetail.qrcode_url,
  586. })
  587. console.log(this.voteDetail)
  588. },
  589. saveImg(){
  590. uni.getImageInfo({
  591. src: this.jump_config,
  592. success:(res)=>{
  593. uni.saveImageToPhotosAlbum({
  594. filePath: res.path,
  595. success(_) {
  596. uni.showToast({
  597. title: '已保存到相册',
  598. icon: 'success',
  599. duration: 2000
  600. })
  601. },
  602. fail(err){
  603. console.log(err)
  604. }
  605. })
  606. }
  607. })
  608. }
  609. }
  610. }
  611. </script>
  612. <style lang="scss" scoped>
  613. $pageColor:#F9F9F9;
  614. $bgColor:#FFFFFF;
  615. @mixin flexlayout {
  616. display: flex;
  617. align-items: center;
  618. justify-content: center;
  619. }
  620. page {
  621. height: 100% !important;
  622. background: #F9F9F9 !important;
  623. }
  624. .vote-detail {
  625. height: 100%;
  626. background: #F9F9F9;
  627. }
  628. .reserve {
  629. // position: fixed;
  630. // bottom: 0;
  631. width: 100%;
  632. height: 148rpx;
  633. padding: 0 30rpx;
  634. background-color: #fff;
  635. display: flex;
  636. align-items: center;
  637. justify-content: space-between;
  638. font-size: 30rpx;
  639. color: #fff;
  640. font-weight: bold;
  641. .reserve-left {
  642. width: 204rpx;
  643. height: 92rpx;
  644. background: linear-gradient(270deg, #FF6200 0%, #FF9342 100%);
  645. border-radius: 12rpx;
  646. display: flex;
  647. align-items: center;
  648. justify-content: center;
  649. }
  650. .reserve-right {
  651. width: 466rpx;
  652. height: 92rpx;
  653. background: linear-gradient(270deg, #FF6200 0%, #FF9342 100%);
  654. border-radius: 12rpx;
  655. display: flex;
  656. align-items: center;
  657. justify-content: center;
  658. }
  659. }
  660. .introduce {
  661. padding: 0 30rpx;
  662. margin-bottom: 102rpx;
  663. .introduce-title {
  664. font-size: 32rpx;
  665. font-weight: bold;
  666. color: #333;
  667. display: flex;
  668. align-items: center;
  669. justify-content: center;
  670. }
  671. .introduce-text {
  672. margin-top: 44rpx;
  673. // line-height: 40rpx;
  674. // color: #333333;
  675. // font-size: 28rpx;
  676. }
  677. }
  678. .help {
  679. padding: 0 30rpx;
  680. margin-top: 30rpx;
  681. position: relative;
  682. .help-btn {
  683. height: 108rpx;
  684. background: #F9F9F9;
  685. border-radius: 14rpx;
  686. border: 2rpx solid #FF6200;
  687. display: flex;
  688. align-items: center;
  689. justify-content: center;
  690. color: #FF6200;
  691. font-weight: bold;
  692. font-size: 30rpx;
  693. }
  694. .img-IHg {
  695. width: 84rpx;
  696. height: 84rpx;
  697. background-color: #fff;
  698. box-shadow: 0px 8rpx 24rpx 0px rgba(220, 222, 229, 0.4);
  699. border-radius: 50%;
  700. display: flex;
  701. align-items: center;
  702. justify-content: center;
  703. position: fixed;
  704. // top: -28rpx;
  705. // right: 14rpx;
  706. top: 1030rpx;
  707. right: 30rpx;
  708. z-index: 99;
  709. }
  710. }
  711. .btn {
  712. padding: 0 30rpx;
  713. margin-top: 48rpx;
  714. .btn-vote {
  715. height: 108rpx;
  716. background: linear-gradient(338deg, #FF6200 0%, #FF9D4F 100%);
  717. border-radius: 12rpx;
  718. display: flex;
  719. align-items: center;
  720. justify-content: center;
  721. color: #FFFFFF;
  722. font-size: 30rpx;
  723. font-weight: bold;
  724. }
  725. .btn-vote-fasle {
  726. height: 108rpx;
  727. background: #CCCCCC;
  728. border-radius: 12rpx;
  729. display: flex;
  730. align-items: center;
  731. justify-content: center;
  732. color: #FFFFFF;
  733. font-size: 30rpx;
  734. font-weight: bold;
  735. }
  736. }
  737. .swiper {
  738. padding: 0 30rpx;
  739. margin-top: 64rpx;
  740. }
  741. .home-swiper {
  742. height: 576rpx;
  743. .swiper-box {
  744. height: 576rpx;
  745. }
  746. }
  747. .title {
  748. padding-top: 30rpx;
  749. display: flex;
  750. flex-direction: column;
  751. align-items: center;
  752. justify-content: center;
  753. .title-text {
  754. margin: 32rpx 0 16rpx;
  755. font-size: 40rpx;
  756. font-weight: bold;
  757. color: #333;
  758. }
  759. .title-btn {
  760. color: #FF6200;
  761. font-size: 28rpx;
  762. }
  763. }
  764. .rank {
  765. padding: 0 30rpx;
  766. }
  767. .vote-detail-btn {
  768. height: 190rpx;
  769. background-color: #fff;
  770. box-shadow: 0px 20rpx 40rpx 0px rgba(220, 222, 229, 0.4);
  771. border-radius: 16rpx;
  772. display: flex;
  773. align-items: center;
  774. justify-content: space-around;
  775. .vote-detail-btn-item {
  776. display: flex;
  777. flex-direction: column;
  778. align-items: center;
  779. justify-content: space-between;
  780. font-size: 28rpx;
  781. color: #333;
  782. .vote-detail-btn-item-num {
  783. font-size: 44rpx;
  784. font-weight: bold;
  785. }
  786. .vote-detail-btn-item-text {
  787. margin-top: 20rpx;
  788. }
  789. }
  790. }
  791. .pop {
  792. width: 640rpx;
  793. height: 740rpx;
  794. background: #FFFFFF;
  795. border-radius: 20rpx;
  796. padding-top: 32rpx;
  797. box-sizing: border-box;
  798. .title {
  799. @include flexlayout();
  800. margin-bottom: 32rpx;
  801. text {
  802. font-size: 34rpx;
  803. font-family: PingFangSC-Medium, PingFang SC;
  804. font-weight: 500;
  805. color: #000;
  806. }
  807. }
  808. .img {
  809. margin-left: 48rpx;
  810. width: 544rpx;
  811. height: 306rpx;
  812. background: $bgColor;
  813. border-radius: 12rpx;
  814. @include flexlayout();
  815. margin-bottom: 32rpx;
  816. image {
  817. width: 100%;
  818. height: 100%;
  819. border-radius: 10rpx;
  820. }
  821. }
  822. .textfont {
  823. margin-left: 30rpx;
  824. margin-bottom: 40rpx;
  825. @include flexlayout();
  826. width: 572rpx;
  827. height: 106rpx;
  828. text {
  829. text-align: center;
  830. font-size: 34rpx;
  831. font-weight: 400;
  832. color: #828282;
  833. }
  834. }
  835. .btn {
  836. width: 100%;
  837. height: 110rpx;
  838. padding: 0;
  839. display: flex;
  840. align-items: center;
  841. .cancel {
  842. @include flexlayout();
  843. width: 50%;
  844. height: 100%;
  845. border-top: #E5E5E5 solid 1rpx;
  846. border-right: #E5E5E5 solid 1rpx;
  847. text {
  848. font-size: 32rpx;
  849. font-family: PingFangSC-Medium, PingFang SC;
  850. font-weight: 500;
  851. color: #666666;
  852. }
  853. }
  854. .download {
  855. border-top: #E5E5E5 solid 1rpx;
  856. // border-left:#E5E5E5 solid 0.3rpx;
  857. @include flexlayout();
  858. height: 100%;
  859. width: 50%;
  860. text {
  861. font-size: 32rpx;
  862. font-family: PingFangSC-Medium, PingFang SC;
  863. font-weight: 500;
  864. color: #FF7119;
  865. }
  866. }
  867. }
  868. }
  869. .movableArea {
  870. position: fixed;
  871. top: 0;
  872. left: 0;
  873. width: 100%;
  874. height: 100%;
  875. pointer-events: none; //设置area元素不可点击,则事件便会下移至页面下层元素
  876. .movableView {
  877. pointer-events: auto; //可以点击
  878. width: 84rpx;
  879. height: 84rpx;
  880. padding: 0 30rpx;
  881. .img-IHg {
  882. width: 84rpx;
  883. height: 84rpx;
  884. background-color: #fff;
  885. box-shadow: 0px 8rpx 24rpx 0px rgba(220, 222, 229, 0.4);
  886. border-radius: 50%;
  887. display: flex;
  888. align-items: center;
  889. justify-content: center;
  890. }
  891. }
  892. }
  893. </style>