index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967
  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. onLoad(op) {
  248. this.activity_project_id = op.id
  249. this.getDetail(op.id)
  250. this.admin = this.$store.getters.userInfo
  251. this.advise = this.$store.getters.allset.add_member
  252. //vip图标
  253. this.indexVipImg = this.advise.value.index_page
  254. this.jump_type_vip = this.advise.value.index_jump_type
  255. if( this.jump_type_vip == 1){
  256. this.jump_config_vip = this.advise.value.index_h5_url
  257. }else if(this.jump_type_vip == 2){
  258. this.jump_config_vip.appid = this.advise.value.index_appid
  259. this.jump_config_vip.path = this.advise.value.index_path
  260. }else if(this.jump_type_vip == 3){
  261. this.jump_config_vip =this.advise.value.index_other_path
  262. }
  263. //活动投票跳转vip
  264. this.voteVipImg = this.advise.value.vote_activity
  265. this.jump_type_vip_Activity = this.advise.value.vote_activity_jump_type
  266. if( this.jump_type_vip_Activity == 1){
  267. this.jump_config_vip_Activity = this.advise.value.vote_activity_h5_url
  268. }else if(this.jump_type_vip_Activity == 2){
  269. this.jump_config_vip_Activity.appid = this.advise.value.vote_activity_appid
  270. this.jump_config_vip_Activity.path = this.advise.value.vote_activity_path
  271. }else if(this.jump_type_vip_Activity == 3){
  272. this.jump_config_vip_Activity =this.advise.value.vote_activity_other_path
  273. }
  274. },
  275. watch: {
  276. vipRewardTicketNum: {
  277. handler(newName, oldName) {
  278. // console.log(newName, '--->监听')
  279. },
  280. immediate: true,
  281. deep: true
  282. }
  283. },
  284. methods: {
  285. shareing() {
  286. uni.showLoading({
  287. title: "海报生成中...",
  288. mask: true
  289. })
  290. // this.inviteQR = this.codeImg
  291. // this.createPoster();
  292. },
  293. //去兑换页面
  294. goConvert(isConvert=true) {
  295. this.$utils.jump({
  296. jump_type: 4,
  297. jump_config: '/pages/my/prize/prize'
  298. })
  299. },
  300. //视频自动播放
  301. openVideoPlay() {
  302. this.videoContext.play()
  303. },
  304. //隐藏
  305. handleCancel() {
  306. console.log('取消审生成海报');
  307. },
  308. //生产海报
  309. getPoster() {
  310. this.$refs.hchPoster.posterShow()
  311. },
  312. // 切换轮播图指示点
  313. change1(e) {
  314. this.current1 = e.detail.current;
  315. },
  316. getDetail(id,callback) {
  317. this.$api.active.getActiveProjectDetail({
  318. activity_project_id: id
  319. }).then(res => {
  320. if (res.code == 0) {
  321. this.voteDetail = res.data
  322. uni.getStorage({
  323. key: `is_vip_${this.voteDetail.id}`,
  324. success: (data)=> {
  325. this.is_vip = data.data === 1 ? true : false
  326. },
  327. fail:()=>{
  328. this.is_vip = false;
  329. }
  330. });
  331. this.startTime = res.data.activity.start_time.replace(/-/g, "/")
  332. // “yyyy-MM-dd-hh-mm-ss”.replace(/-/g,"/")
  333. this.endTime = res.data.activity.end_time.replace(/-/g, "/")
  334. this.cancelTime(this.startTime, this.endTime)
  335. //活动可以使用的投票数
  336. this.userCanVoteNum = res.data.user_can_vote_num
  337. if (this.userCanVoteNum > 0) {
  338. this.isVoteNum = true
  339. } else {
  340. this.isVoteNum = false
  341. }
  342. callback && callback()
  343. this.sourceId = res.data.id
  344. //跳转vip小程序获得投票数
  345. this.vipRewardTicketNum = res.data.activity.vip_reward_ticket_num
  346. // this.info =JSON.parse( res.data.img_urls)
  347. this.info = JSON.parse(res.data.img_urls).map(item => {
  348. return {
  349. img: item
  350. }
  351. })
  352. //跳转h5和小程序
  353. this.jump_type = res.data.jump_type,
  354. this.jump_config = res.data.jump_config
  355. //banner展示视频或者图片
  356. this.resource_type = res.data.resource_type
  357. this.video_url = res.data.video_url
  358. //视频自动播放
  359. this.openVideoPlay()
  360. // //海报图片
  361. // this.posterData.mainImg = res.data.share_img
  362. // this.codeImg = res.data.qrcode_url
  363. }
  364. })
  365. },
  366. //轮播图跳转h5或者小程序和内部页面
  367. goSwiperSmall() {
  368. if(this.jump_type==3 && this.jump_config.substr(0, 7) != '/pages/'){
  369. console.log(this.jump_config)
  370. this.$refs.dialogPanel.open()
  371. }else{
  372. this.$utils.jump({
  373. jump_type: this.jump_type,
  374. jump_config: this.jump_config
  375. })
  376. }
  377. },
  378. cancelTime(i, j) {
  379. let nowtime = new Date() //获取当前时间
  380. let startime = new Date(i) //活动开始时间
  381. let endtime = new Date(j); //活动结束时间
  382. let lefttime = endtime.getTime() - nowtime.getTime() //距离结束时间的毫秒数
  383. let spendtime = nowtime.getTime() - startime.getTime() //距离结束时间的毫秒数
  384. if (lefttime > 0 && spendtime > 0) {
  385. //活动进行中
  386. this.spending = true
  387. } else if (lefttime < 0) {
  388. //活动结束
  389. this.isEnd = true
  390. } else if (spendtime < 0) {
  391. //活动未开始
  392. this.isStart = true
  393. }
  394. },
  395. // 打开弹出层
  396. openVote(mode = true) {
  397. this.pupopSuccess = mode
  398. this.$refs.popup.open()
  399. },
  400. // 关闭弹出层
  401. closeVote() {
  402. this.is_prize = false
  403. this.$refs.popup.close()
  404. },
  405. //再次投票
  406. voteAgain(id) {
  407. this.goVote(id, true)
  408. },
  409. //跳转其他项目
  410. goOtherItem() {
  411. uni.navigateBack()
  412. },
  413. //获取当前页面路径
  414. getPageUrl() {
  415. const pages = getCurrentPages();
  416. if (pages.length == 1) {
  417. const currentPage = pages[0];
  418. let pageUrl = `/${currentPage.route}`;
  419. return pageUrl
  420. } else {
  421. const currentPage = pages[pages.length - 1];
  422. let pageUrl = `/${currentPage.route}`;
  423. return pageUrl
  424. }
  425. },
  426. // 跳转其他小程序
  427. goJoinActivity(){
  428. let _this = this
  429. this.jumpHAppID(this.jump_type_vip_Activity, this.jump_config_vip_Activity)
  430. },
  431. goJoin() {
  432. let _this = this
  433. this.jumpHAppID(this.jump_type_vip, this.jump_config_vip)
  434. },
  435. // 跳转其他小程序
  436. jumpHAppID(id, urls) {
  437. if (id == 1) {
  438. const url = urls; // 跳转的外链
  439. const navtitle = 'H5'; // 这个标题是你自己可以设置的
  440. uni.navigateTo({
  441. // 跳转到webview页面
  442. url: `/pages/webview/webview?url=${url}&nav=${navtitle}`,
  443. success: () => {
  444. console.log('成功')
  445. },
  446. fail: (e) => {
  447. console.log(e, "失败")
  448. }
  449. });
  450. } else if (id == 2) {
  451. let _this = this
  452. let obj = urls;
  453. console.log(obj, '----->obj');
  454. wx.navigateToMiniProgram({
  455. appId: `${obj.appid}`, //appid
  456. path: `${obj.path}`, //path
  457. extraData: { //参数
  458. foo: 'bar'
  459. },
  460. // envVersion: 'develop', //开发版develop 开发版 trial 体验版 release 正式版
  461. success(res) {
  462. const page = _this.getPageUrl()
  463. let user_id = ''
  464. if (_this.admin != null) {
  465. user_id = _this.admin.id
  466. } else {
  467. user_id = 0
  468. }
  469. _this.$api.my.userMemberAdd({
  470. user_id,
  471. page,
  472. })
  473. //增加票数
  474. _this.$api.my.userJoinVip({
  475. source_type: 1,
  476. source_id: _this.sourceId
  477. }).then(res => {
  478. console.log(res)
  479. uni.setStorage({
  480. key: `is_vip_${_this.voteDetail.id}`,
  481. data: 1,
  482. });
  483. _this.is_vip = true
  484. _this.closeVote()
  485. })
  486. // 打开成功
  487. },
  488. fail(e) {
  489. console.log(e, '失败')
  490. }
  491. })
  492. } else if (id == 3) {
  493. uni.redirectTo({
  494. url: urls,
  495. fail: (err) => {
  496. uni.reLaunch({
  497. url: urls
  498. })
  499. }
  500. })
  501. }
  502. },
  503. // 跳转其他小程序
  504. // goJoin() {
  505. // this.$utils.jumpJoinVip().then( _=>{
  506. // const page = this.getPageUrl()
  507. // let user_id = ''
  508. // if (this.admin != null) {
  509. // user_id = this.admin.id
  510. // } else {
  511. // user_id = 0
  512. // }
  513. // this.$api.my.userMemberAdd({
  514. // user_id,
  515. // page,
  516. // })
  517. // //增加票数
  518. // this.$api.my.userJoinVip({
  519. // source_type: 1,
  520. // source_id: this.sourceId
  521. // }).then(res => {
  522. // console.log(res)
  523. // uni.setStorage({
  524. // key: `is_vip_${this.voteDetail.id}`,
  525. // data: 1,
  526. // });
  527. // this.is_vip = true
  528. // this.closeVote()
  529. // })
  530. // })
  531. // },
  532. // 投票
  533. goVote(id, again = false) {
  534. again && this.closeVote();
  535. this.$api.active.vote({
  536. activity_project_id: id
  537. }).then(res => {
  538. console.log(res, '投票')
  539. if (res.code == 0) {
  540. this.is_prize = res.data.is_prize
  541. if (this.is_prize == 1) {
  542. this.prizeProduct = res.data?.product?.name ? res.data.product.name : `${res.data.integral}积分`
  543. }
  544. this.getDetail(this.activity_project_id, this.openVote())
  545. } else if(res.code === 2){
  546. console.log(this.is_vip)
  547. if(!this.is_vip){
  548. this.openVote(false)
  549. }else{
  550. uni.showToast({
  551. icon: 'none',
  552. title: res.msg
  553. })
  554. }
  555. } else {
  556. uni.showToast({
  557. icon: 'none',
  558. title: res.msg?res.msg:"暂无权限"
  559. })
  560. }
  561. }).catch(err => {
  562. console.log(err)
  563. uni.showToast({
  564. icon: 'error',
  565. title: '投票失败'
  566. })
  567. })
  568. },
  569. //帮我拉票
  570. showPoster(){
  571. /**
  572. * 注意这里的图片接口好像有问题 .activity.cover_img信息
  573. * 报错内容:{"errMsg":"getImageInfo:fail invalid"}
  574. * 可能是图片域名不在微信开发者白名单
  575. * 添加不校验规则依然报错
  576. * 核实后取消下方注释即可
  577. */
  578. this.$refs.poster.show({
  579. name: this.voteDetail.project_name,
  580. title: this.voteDetail.activity.title,
  581. imgUrl: this.voteDetail.share_img,
  582. qrcodeUrl: this.voteDetail.qrcode_url,
  583. })
  584. console.log(this.voteDetail)
  585. },
  586. saveImg(){
  587. uni.getImageInfo({
  588. src: this.jump_config,
  589. success:(res)=>{
  590. uni.saveImageToPhotosAlbum({
  591. filePath: res.path,
  592. success(_) {
  593. uni.showToast({
  594. title: '已保存到相册',
  595. icon: 'success',
  596. duration: 2000
  597. })
  598. },
  599. fail(err){
  600. console.log(err)
  601. }
  602. })
  603. }
  604. })
  605. }
  606. }
  607. }
  608. </script>
  609. <style lang="scss" scoped>
  610. $pageColor:#F9F9F9;
  611. $bgColor:#FFFFFF;
  612. @mixin flexlayout {
  613. display: flex;
  614. align-items: center;
  615. justify-content: center;
  616. }
  617. page {
  618. height: 100% !important;
  619. background: #F9F9F9 !important;
  620. }
  621. .vote-detail {
  622. height: 100%;
  623. background: #F9F9F9;
  624. }
  625. .reserve {
  626. // position: fixed;
  627. // bottom: 0;
  628. width: 100%;
  629. height: 148rpx;
  630. padding: 0 30rpx;
  631. background-color: #fff;
  632. display: flex;
  633. align-items: center;
  634. justify-content: space-between;
  635. font-size: 30rpx;
  636. color: #fff;
  637. font-weight: bold;
  638. .reserve-left {
  639. width: 204rpx;
  640. height: 92rpx;
  641. background: linear-gradient(270deg, #FF6200 0%, #FF9342 100%);
  642. border-radius: 12rpx;
  643. display: flex;
  644. align-items: center;
  645. justify-content: center;
  646. }
  647. .reserve-right {
  648. width: 466rpx;
  649. height: 92rpx;
  650. background: linear-gradient(270deg, #FF6200 0%, #FF9342 100%);
  651. border-radius: 12rpx;
  652. display: flex;
  653. align-items: center;
  654. justify-content: center;
  655. }
  656. }
  657. .introduce {
  658. padding: 0 30rpx;
  659. margin-bottom: 102rpx;
  660. .introduce-title {
  661. font-size: 32rpx;
  662. font-weight: bold;
  663. color: #333;
  664. display: flex;
  665. align-items: center;
  666. justify-content: center;
  667. }
  668. .introduce-text {
  669. margin-top: 44rpx;
  670. // line-height: 40rpx;
  671. // color: #333333;
  672. // font-size: 28rpx;
  673. }
  674. }
  675. .help {
  676. padding: 0 30rpx;
  677. margin-top: 30rpx;
  678. position: relative;
  679. .help-btn {
  680. height: 108rpx;
  681. background: #F9F9F9;
  682. border-radius: 14rpx;
  683. border: 2rpx solid #FF6200;
  684. display: flex;
  685. align-items: center;
  686. justify-content: center;
  687. color: #FF6200;
  688. font-weight: bold;
  689. font-size: 30rpx;
  690. }
  691. .img-IHg {
  692. width: 84rpx;
  693. height: 84rpx;
  694. background-color: #fff;
  695. box-shadow: 0px 8rpx 24rpx 0px rgba(220, 222, 229, 0.4);
  696. border-radius: 50%;
  697. display: flex;
  698. align-items: center;
  699. justify-content: center;
  700. position: fixed;
  701. // top: -28rpx;
  702. // right: 14rpx;
  703. top: 1030rpx;
  704. right: 30rpx;
  705. z-index: 99;
  706. }
  707. }
  708. .btn {
  709. padding: 0 30rpx;
  710. margin-top: 48rpx;
  711. .btn-vote {
  712. height: 108rpx;
  713. background: linear-gradient(338deg, #FF6200 0%, #FF9D4F 100%);
  714. border-radius: 12rpx;
  715. display: flex;
  716. align-items: center;
  717. justify-content: center;
  718. color: #FFFFFF;
  719. font-size: 30rpx;
  720. font-weight: bold;
  721. }
  722. .btn-vote-fasle {
  723. height: 108rpx;
  724. background: #CCCCCC;
  725. border-radius: 12rpx;
  726. display: flex;
  727. align-items: center;
  728. justify-content: center;
  729. color: #FFFFFF;
  730. font-size: 30rpx;
  731. font-weight: bold;
  732. }
  733. }
  734. .swiper {
  735. padding: 0 30rpx;
  736. margin-top: 64rpx;
  737. }
  738. .home-swiper {
  739. height: 576rpx;
  740. .swiper-box {
  741. height: 576rpx;
  742. }
  743. }
  744. .title {
  745. padding-top: 30rpx;
  746. display: flex;
  747. flex-direction: column;
  748. align-items: center;
  749. justify-content: center;
  750. .title-text {
  751. margin: 32rpx 0 16rpx;
  752. font-size: 40rpx;
  753. font-weight: bold;
  754. color: #333;
  755. }
  756. .title-btn {
  757. color: #FF6200;
  758. font-size: 28rpx;
  759. }
  760. }
  761. .rank {
  762. padding: 0 30rpx;
  763. }
  764. .vote-detail-btn {
  765. height: 190rpx;
  766. background-color: #fff;
  767. box-shadow: 0px 20rpx 40rpx 0px rgba(220, 222, 229, 0.4);
  768. border-radius: 16rpx;
  769. display: flex;
  770. align-items: center;
  771. justify-content: space-around;
  772. .vote-detail-btn-item {
  773. display: flex;
  774. flex-direction: column;
  775. align-items: center;
  776. justify-content: space-between;
  777. font-size: 28rpx;
  778. color: #333;
  779. .vote-detail-btn-item-num {
  780. font-size: 44rpx;
  781. font-weight: bold;
  782. }
  783. .vote-detail-btn-item-text {
  784. margin-top: 20rpx;
  785. }
  786. }
  787. }
  788. .pop {
  789. width: 640rpx;
  790. height: 740rpx;
  791. background: #FFFFFF;
  792. border-radius: 20rpx;
  793. padding-top: 32rpx;
  794. box-sizing: border-box;
  795. .title {
  796. @include flexlayout();
  797. margin-bottom: 32rpx;
  798. text {
  799. font-size: 34rpx;
  800. font-family: PingFangSC-Medium, PingFang SC;
  801. font-weight: 500;
  802. color: #000;
  803. }
  804. }
  805. .img {
  806. margin-left: 48rpx;
  807. width: 544rpx;
  808. height: 306rpx;
  809. background: $bgColor;
  810. border-radius: 12rpx;
  811. @include flexlayout();
  812. margin-bottom: 32rpx;
  813. image {
  814. width: 100%;
  815. height: 100%;
  816. border-radius: 10rpx;
  817. }
  818. }
  819. .textfont {
  820. margin-left: 30rpx;
  821. margin-bottom: 40rpx;
  822. @include flexlayout();
  823. width: 572rpx;
  824. height: 106rpx;
  825. text {
  826. text-align: center;
  827. font-size: 34rpx;
  828. font-weight: 400;
  829. color: #828282;
  830. }
  831. }
  832. .btn {
  833. width: 100%;
  834. height: 110rpx;
  835. padding: 0;
  836. display: flex;
  837. align-items: center;
  838. .cancel {
  839. @include flexlayout();
  840. width: 50%;
  841. height: 100%;
  842. border-top: #E5E5E5 solid 1rpx;
  843. border-right: #E5E5E5 solid 1rpx;
  844. text {
  845. font-size: 32rpx;
  846. font-family: PingFangSC-Medium, PingFang SC;
  847. font-weight: 500;
  848. color: #666666;
  849. }
  850. }
  851. .download {
  852. border-top: #E5E5E5 solid 1rpx;
  853. // border-left:#E5E5E5 solid 0.3rpx;
  854. @include flexlayout();
  855. height: 100%;
  856. width: 50%;
  857. text {
  858. font-size: 32rpx;
  859. font-family: PingFangSC-Medium, PingFang SC;
  860. font-weight: 500;
  861. color: #FF7119;
  862. }
  863. }
  864. }
  865. }
  866. .movableArea {
  867. position: fixed;
  868. top: 0;
  869. left: 0;
  870. width: 100%;
  871. height: 100%;
  872. pointer-events: none; //设置area元素不可点击,则事件便会下移至页面下层元素
  873. .movableView {
  874. pointer-events: auto; //可以点击
  875. width: 84rpx;
  876. height: 84rpx;
  877. padding: 0 30rpx;
  878. .img-IHg {
  879. width: 84rpx;
  880. height: 84rpx;
  881. background-color: #fff;
  882. box-shadow: 0px 8rpx 24rpx 0px rgba(220, 222, 229, 0.4);
  883. border-radius: 50%;
  884. display: flex;
  885. align-items: center;
  886. justify-content: center;
  887. }
  888. }
  889. }
  890. </style>