index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966
  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 ? '' : `点击 加入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?'其他项目':'加入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.$refs.popup.close()
  403. },
  404. //再次投票
  405. voteAgain(id) {
  406. this.goVote(id, true)
  407. },
  408. //跳转其他项目
  409. goOtherItem() {
  410. uni.navigateBack()
  411. },
  412. //获取当前页面路径
  413. getPageUrl() {
  414. const pages = getCurrentPages();
  415. if (pages.length == 1) {
  416. const currentPage = pages[0];
  417. let pageUrl = `/${currentPage.route}`;
  418. return pageUrl
  419. } else {
  420. const currentPage = pages[pages.length - 1];
  421. let pageUrl = `/${currentPage.route}`;
  422. return pageUrl
  423. }
  424. },
  425. // 跳转其他小程序
  426. goJoinActivity(){
  427. let _this = this
  428. this.jumpHAppID(this.jump_type_vip_Activity, this.jump_config_vip_Activity)
  429. },
  430. goJoin() {
  431. let _this = this
  432. this.jumpHAppID(this.jump_type_vip, this.jump_config_vip)
  433. },
  434. // 跳转其他小程序
  435. jumpHAppID(id, urls) {
  436. if (id == 1) {
  437. const url = urls; // 跳转的外链
  438. const navtitle = 'H5'; // 这个标题是你自己可以设置的
  439. uni.navigateTo({
  440. // 跳转到webview页面
  441. url: `/pages/webview/webview?url=${url}&nav=${navtitle}`,
  442. success: () => {
  443. console.log('成功')
  444. },
  445. fail: (e) => {
  446. console.log(e, "失败")
  447. }
  448. });
  449. } else if (id == 2) {
  450. let _this = this
  451. let obj = urls;
  452. console.log(obj, '----->obj');
  453. wx.navigateToMiniProgram({
  454. appId: `${obj.appid}`, //appid
  455. path: `${obj.path}`, //path
  456. extraData: { //参数
  457. foo: 'bar'
  458. },
  459. // envVersion: 'develop', //开发版develop 开发版 trial 体验版 release 正式版
  460. success(res) {
  461. const page = _this.getPageUrl()
  462. let user_id = ''
  463. if (_this.admin != null) {
  464. user_id = _this.admin.id
  465. } else {
  466. user_id = 0
  467. }
  468. _this.$api.my.userMemberAdd({
  469. user_id,
  470. page,
  471. })
  472. //增加票数
  473. _this.$api.my.userJoinVip({
  474. source_type: 1,
  475. source_id: _this.sourceId
  476. }).then(res => {
  477. console.log(res)
  478. uni.setStorage({
  479. key: `is_vip_${_this.voteDetail.id}`,
  480. data: 1,
  481. });
  482. _this.is_vip = true
  483. _this.closeVote()
  484. })
  485. // 打开成功
  486. },
  487. fail(e) {
  488. console.log(e, '失败')
  489. }
  490. })
  491. } else if (id == 3) {
  492. uni.redirectTo({
  493. url: urls,
  494. fail: (err) => {
  495. uni.reLaunch({
  496. url: urls
  497. })
  498. }
  499. })
  500. }
  501. },
  502. // 跳转其他小程序
  503. // goJoin() {
  504. // this.$utils.jumpJoinVip().then( _=>{
  505. // const page = this.getPageUrl()
  506. // let user_id = ''
  507. // if (this.admin != null) {
  508. // user_id = this.admin.id
  509. // } else {
  510. // user_id = 0
  511. // }
  512. // this.$api.my.userMemberAdd({
  513. // user_id,
  514. // page,
  515. // })
  516. // //增加票数
  517. // this.$api.my.userJoinVip({
  518. // source_type: 1,
  519. // source_id: this.sourceId
  520. // }).then(res => {
  521. // console.log(res)
  522. // uni.setStorage({
  523. // key: `is_vip_${this.voteDetail.id}`,
  524. // data: 1,
  525. // });
  526. // this.is_vip = true
  527. // this.closeVote()
  528. // })
  529. // })
  530. // },
  531. // 投票
  532. goVote(id, again = false) {
  533. again && this.closeVote();
  534. this.$api.active.vote({
  535. activity_project_id: id
  536. }).then(res => {
  537. console.log(res, '投票')
  538. if (res.code == 0) {
  539. this.is_prize = res.data.is_prize
  540. if (this.is_prize == 1) {
  541. this.prizeProduct = res.data?.product?.name ? res.data.product.name : `${res.data.integral}积分`
  542. }
  543. this.getDetail(this.activity_project_id, this.openVote())
  544. } else if(res.code === 2){
  545. console.log(this.is_vip)
  546. if(!this.is_vip){
  547. this.openVote(false)
  548. }else{
  549. uni.showToast({
  550. icon: 'error',
  551. title: res.msg
  552. })
  553. }
  554. } else {
  555. uni.showToast({
  556. icon: 'error',
  557. title: res.msg?res.msg:"暂无权限"
  558. })
  559. }
  560. }).catch(err => {
  561. console.log(err)
  562. uni.showToast({
  563. icon: 'none',
  564. title: '投票失败'
  565. })
  566. })
  567. },
  568. //帮我拉票
  569. showPoster(){
  570. /**
  571. * 注意这里的图片接口好像有问题 .activity.cover_img信息
  572. * 报错内容:{"errMsg":"getImageInfo:fail invalid"}
  573. * 可能是图片域名不在微信开发者白名单
  574. * 添加不校验规则依然报错
  575. * 核实后取消下方注释即可
  576. */
  577. this.$refs.poster.show({
  578. name: this.voteDetail.project_name,
  579. title: this.voteDetail.activity.title,
  580. imgUrl: this.voteDetail.share_img,
  581. qrcodeUrl: this.voteDetail.qrcode_url,
  582. })
  583. console.log(this.voteDetail)
  584. },
  585. saveImg(){
  586. uni.getImageInfo({
  587. src: this.jump_config,
  588. success:(res)=>{
  589. uni.saveImageToPhotosAlbum({
  590. filePath: res.path,
  591. success(_) {
  592. uni.showToast({
  593. title: '已保存到相册',
  594. icon: 'success',
  595. duration: 2000
  596. })
  597. },
  598. fail(err){
  599. console.log(err)
  600. }
  601. })
  602. }
  603. })
  604. }
  605. }
  606. }
  607. </script>
  608. <style lang="scss" scoped>
  609. $pageColor:#F9F9F9;
  610. $bgColor:#FFFFFF;
  611. @mixin flexlayout {
  612. display: flex;
  613. align-items: center;
  614. justify-content: center;
  615. }
  616. page {
  617. height: 100% !important;
  618. background: #F9F9F9 !important;
  619. }
  620. .vote-detail {
  621. height: 100%;
  622. background: #F9F9F9;
  623. }
  624. .reserve {
  625. // position: fixed;
  626. // bottom: 0;
  627. width: 100%;
  628. height: 148rpx;
  629. padding: 0 30rpx;
  630. background-color: #fff;
  631. display: flex;
  632. align-items: center;
  633. justify-content: space-between;
  634. font-size: 30rpx;
  635. color: #fff;
  636. font-weight: bold;
  637. .reserve-left {
  638. width: 204rpx;
  639. height: 92rpx;
  640. background: linear-gradient(270deg, #FF6200 0%, #FF9342 100%);
  641. border-radius: 12rpx;
  642. display: flex;
  643. align-items: center;
  644. justify-content: center;
  645. }
  646. .reserve-right {
  647. width: 466rpx;
  648. height: 92rpx;
  649. background: linear-gradient(270deg, #FF6200 0%, #FF9342 100%);
  650. border-radius: 12rpx;
  651. display: flex;
  652. align-items: center;
  653. justify-content: center;
  654. }
  655. }
  656. .introduce {
  657. padding: 0 30rpx;
  658. margin-bottom: 102rpx;
  659. .introduce-title {
  660. font-size: 32rpx;
  661. font-weight: bold;
  662. color: #333;
  663. display: flex;
  664. align-items: center;
  665. justify-content: center;
  666. }
  667. .introduce-text {
  668. margin-top: 44rpx;
  669. // line-height: 40rpx;
  670. // color: #333333;
  671. // font-size: 28rpx;
  672. }
  673. }
  674. .help {
  675. padding: 0 30rpx;
  676. margin-top: 30rpx;
  677. position: relative;
  678. .help-btn {
  679. height: 108rpx;
  680. background: #F9F9F9;
  681. border-radius: 14rpx;
  682. border: 2rpx solid #FF6200;
  683. display: flex;
  684. align-items: center;
  685. justify-content: center;
  686. color: #FF6200;
  687. font-weight: bold;
  688. font-size: 30rpx;
  689. }
  690. .img-IHg {
  691. width: 84rpx;
  692. height: 84rpx;
  693. background-color: #fff;
  694. box-shadow: 0px 8rpx 24rpx 0px rgba(220, 222, 229, 0.4);
  695. border-radius: 50%;
  696. display: flex;
  697. align-items: center;
  698. justify-content: center;
  699. position: fixed;
  700. // top: -28rpx;
  701. // right: 14rpx;
  702. top: 1030rpx;
  703. right: 30rpx;
  704. z-index: 99;
  705. }
  706. }
  707. .btn {
  708. padding: 0 30rpx;
  709. margin-top: 48rpx;
  710. .btn-vote {
  711. height: 108rpx;
  712. background: linear-gradient(338deg, #FF6200 0%, #FF9D4F 100%);
  713. border-radius: 12rpx;
  714. display: flex;
  715. align-items: center;
  716. justify-content: center;
  717. color: #FFFFFF;
  718. font-size: 30rpx;
  719. font-weight: bold;
  720. }
  721. .btn-vote-fasle {
  722. height: 108rpx;
  723. background: #CCCCCC;
  724. border-radius: 12rpx;
  725. display: flex;
  726. align-items: center;
  727. justify-content: center;
  728. color: #FFFFFF;
  729. font-size: 30rpx;
  730. font-weight: bold;
  731. }
  732. }
  733. .swiper {
  734. padding: 0 30rpx;
  735. margin-top: 64rpx;
  736. }
  737. .home-swiper {
  738. height: 576rpx;
  739. .swiper-box {
  740. height: 576rpx;
  741. }
  742. }
  743. .title {
  744. padding-top: 30rpx;
  745. display: flex;
  746. flex-direction: column;
  747. align-items: center;
  748. justify-content: center;
  749. .title-text {
  750. margin: 32rpx 0 16rpx;
  751. font-size: 40rpx;
  752. font-weight: bold;
  753. color: #333;
  754. }
  755. .title-btn {
  756. color: #FF6200;
  757. font-size: 28rpx;
  758. }
  759. }
  760. .rank {
  761. padding: 0 30rpx;
  762. }
  763. .vote-detail-btn {
  764. height: 190rpx;
  765. background-color: #fff;
  766. box-shadow: 0px 20rpx 40rpx 0px rgba(220, 222, 229, 0.4);
  767. border-radius: 16rpx;
  768. display: flex;
  769. align-items: center;
  770. justify-content: space-around;
  771. .vote-detail-btn-item {
  772. display: flex;
  773. flex-direction: column;
  774. align-items: center;
  775. justify-content: space-between;
  776. font-size: 28rpx;
  777. color: #333;
  778. .vote-detail-btn-item-num {
  779. font-size: 44rpx;
  780. font-weight: bold;
  781. }
  782. .vote-detail-btn-item-text {
  783. margin-top: 20rpx;
  784. }
  785. }
  786. }
  787. .pop {
  788. width: 640rpx;
  789. height: 740rpx;
  790. background: #FFFFFF;
  791. border-radius: 20rpx;
  792. padding-top: 32rpx;
  793. box-sizing: border-box;
  794. .title {
  795. @include flexlayout();
  796. margin-bottom: 32rpx;
  797. text {
  798. font-size: 34rpx;
  799. font-family: PingFangSC-Medium, PingFang SC;
  800. font-weight: 500;
  801. color: #000;
  802. }
  803. }
  804. .img {
  805. margin-left: 48rpx;
  806. width: 544rpx;
  807. height: 306rpx;
  808. background: $bgColor;
  809. border-radius: 12rpx;
  810. @include flexlayout();
  811. margin-bottom: 32rpx;
  812. image {
  813. width: 100%;
  814. height: 100%;
  815. border-radius: 10rpx;
  816. }
  817. }
  818. .textfont {
  819. margin-left: 30rpx;
  820. margin-bottom: 40rpx;
  821. @include flexlayout();
  822. width: 572rpx;
  823. height: 106rpx;
  824. text {
  825. text-align: center;
  826. font-size: 34rpx;
  827. font-weight: 400;
  828. color: #828282;
  829. }
  830. }
  831. .btn {
  832. width: 100%;
  833. height: 110rpx;
  834. padding: 0;
  835. display: flex;
  836. align-items: center;
  837. .cancel {
  838. @include flexlayout();
  839. width: 50%;
  840. height: 100%;
  841. border-top: #E5E5E5 solid 1rpx;
  842. border-right: #E5E5E5 solid 1rpx;
  843. text {
  844. font-size: 32rpx;
  845. font-family: PingFangSC-Medium, PingFang SC;
  846. font-weight: 500;
  847. color: #666666;
  848. }
  849. }
  850. .download {
  851. border-top: #E5E5E5 solid 1rpx;
  852. // border-left:#E5E5E5 solid 0.3rpx;
  853. @include flexlayout();
  854. height: 100%;
  855. width: 50%;
  856. text {
  857. font-size: 32rpx;
  858. font-family: PingFangSC-Medium, PingFang SC;
  859. font-weight: 500;
  860. color: #FF7119;
  861. }
  862. }
  863. }
  864. }
  865. .movableArea {
  866. position: fixed;
  867. top: 0;
  868. left: 0;
  869. width: 100%;
  870. height: 100%;
  871. pointer-events: none; //设置area元素不可点击,则事件便会下移至页面下层元素
  872. .movableView {
  873. pointer-events: auto; //可以点击
  874. width: 84rpx;
  875. height: 84rpx;
  876. padding: 0 30rpx;
  877. .img-IHg {
  878. width: 84rpx;
  879. height: 84rpx;
  880. background-color: #fff;
  881. box-shadow: 0px 8rpx 24rpx 0px rgba(220, 222, 229, 0.4);
  882. border-radius: 50%;
  883. display: flex;
  884. align-items: center;
  885. justify-content: center;
  886. }
  887. }
  888. }
  889. </style>