index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524
  1. <template>
  2. <view class="index-box box-border-box flex-common-css" @click.stop="play()">
  3. <view class="flex-justify-space box-border-box plr-32">
  4. <image class="logo-img" src="@/static/img/c-logo.png" mode="scaleToFill"></image>
  5. <image class="music-img" v-if="!isIos" :class="isPlay?'music-anumation':'music-anumation'" src="@/static/img/c-music.png" mode="scaleToFill" @click.stop="musicPause()"></image>
  6. <mumu-music v-else ref="musicObj" musicSrc='https://jhxcnc.oss-cn-chengdu.aliyuncs.com/mp3/4272600974.mp3'></mumu-music>
  7. </view>
  8. <swiper class="swiper" :vertical='true' @change="swiperChange">
  9. <!-- 邀请函 -->
  10. <swiper-item>
  11. <view class="swiper-item index-1" v-if="index == 0">
  12. <image class="img-text wow animate__animated animate__bounceInUp" src="@/static/img/yqh-text.png"
  13. mode="scaleToFill"></image>
  14. <view class="fs-48 fc-f text-align-center mb-16 wow animate__animated animate__bounceInLeft">
  15. 振合网科技集团实体联盟</view>
  16. <view class="fs-32 fc-f text-align-center mb-72 wow animate__animated animate__bounceInRight">未来已来
  17. 一触即发1</view>
  18. <image class="img-xian wow animate__animated animate__bounceInUp" src="@/static/img/xian.png"
  19. mode="scaleToFill"></image>
  20. <image class="name-text wow animate__animated animate__bounceInLeft"
  21. src="@/static/img/name-text.png" mode="scaleToFill"></image>
  22. <image class="time-text wow animate__animated animate__bounceInRight"
  23. src="@/static/img/time-text.png" mode="scaleToFill"></image>
  24. <image class="up-icon wow animate__animated animate__bounceInUp" src="@/static/img/c-up-icon.png"
  25. mode="scaleToFill"></image>
  26. </view>
  27. </swiper-item>
  28. <!-- 诚挚邀请 -->
  29. <swiper-item>
  30. <view class="swiper-item">
  31. <view class="index-2" v-if="index == 1">
  32. <image class="text-img wow animate__animated animate__bounceInUp"
  33. src="@/static/img/czyq-text.png" mode="scaleToFill"></image>
  34. <view class="fs-32 fc-F2D4A9 fw-b mb-24 wow animate__animated animate__bounceInUp">
  35. 尊敬的{{userName?userName:'用户'}}</view>
  36. <view class="fs-32 fc-F2D4A9 text-box wow animate__animated animate__bounceInUp">
  37. 您好!感谢百忙之中阅读此邀请函。我们诚挚的邀请您参加于10月20日振合科技集团举办的2024年度招商说明会。我们深知在发展的道路上离不开您的信任与支持,我们取得的成绩中有您的辛勤付出。此次盛会邀请多位行业专家共聚一堂,特此诚邀您出席盛会,期待与您共话友情、
  38. 展望末来、共创属于我们新的商业传奇。
  39. </view>
  40. <view
  41. class="fc-F2D4A9 fw-b fs-32 text-align-right mt-32 wow animate__animated animate__bounceInUp">
  42. 振合网科技集团</view>
  43. <view class="fs-28 fc-F2D4A9 text-align-right wow animate__animated animate__bounceInUp">
  44. 2024年10月20日</view>
  45. </view>
  46. <image class="up-icon wow animate__animated animate__bounceInUp" src="@/static/img/c-up-icon.png"
  47. mode="scaleToFill"></image>
  48. </view>
  49. </swiper-item>
  50. <!-- 活动地址 -->
  51. <swiper-item>
  52. <view class="swiper-item">
  53. <view class="index-2" v-if="index == 2">
  54. <image class="text-img-1 wow animate__animated animate__bounceInUp"
  55. src="@/static/img/hdtd-text.png" mode="scaleToFill"></image>
  56. <image class="img-1 wow animate__animated animate__bounceInUp" src="@/static/img/h-1.png"
  57. mode="scaleToFill"></image>
  58. <view class="flex-justify-space">
  59. <image class="img-2 wow animate__animated animate__bounceInLeft" src="@/static/img/h-2.png"
  60. mode="scaleToFill"></image>
  61. <image class="img-2 wow animate__animated animate__bounceInRight" src="@/static/img/h-3.png"
  62. mode="scaleToFill"></image>
  63. </view>
  64. <view class="fc-F2D4A9 fs-40 text-align-center mb-16 wow animate__animated animate__bounceInUp">
  65. 重庆丽星君顿酒店</view>
  66. <view class="fs-28 fc-F2D4A9 text-align-center wow animate__animated animate__bounceInUp">
  67. 地址:重庆市渝北区服装城大道48号</view>
  68. </view>
  69. <image class="up-icon wow animate__animated animate__bounceInUp" src="@/static/img/c-up-icon.png"
  70. mode="scaleToFill"></image>
  71. </view>
  72. </swiper-item>
  73. <!-- 地址导航 -->
  74. <swiper-item>
  75. <view class="swiper-item" v-if="index == 3">
  76. <view class="index-2">
  77. <image class="text-img wow animate__animated animate__bounceInUp"
  78. src="@/static/img/dzdh-text.png" mode="scaleToFill"></image>
  79. <view class="b-f wow animate__animated animate__bounceInUp" @click.stop="toMap()">
  80. <image class="img-3" src="@/static/img/map.png" mode="scaleToFill"></image>
  81. <view class="b-c">开始导航</view>
  82. </view>
  83. <view
  84. class="fc-F2D4A9 fs-36 text-align-center mb-16 wow animate__animated animate__bounceInLeft">
  85. 会议地址</view>
  86. <view
  87. class="fc-F2D4A9 fs-28 text-align-center mb-32 wow animate__animated animate__bounceInRight">
  88. 重庆丽星君顿酒店</view>
  89. <view
  90. class="fc-F2D4A9 fs-36 text-align-center mb-16 wow animate__animated animate__bounceInLeft">
  91. 会议时间</view>
  92. <view
  93. class="fc-F2D4A9 fs-28 text-align-center mb-32 wow animate__animated animate__bounceInRight">
  94. 10月20日 上午08:30</view>
  95. <view
  96. class="fc-F2D4A9 fs-36 text-align-center mb-16 wow animate__animated animate__bounceInLeft"
  97. @click.stop="playPhone()">联系方式</view>
  98. <view
  99. class="fc-F2D4A9 fs-28 text-align-center mb-32 wow animate__animated animate__bounceInRight"
  100. @click.stop="playPhone()">
  101. <uni-icons style="margin-right: 10rpx;" type="phone-filled" color="#f2d4a9" size="14">
  102. </uni-icons>
  103. 023-67177907
  104. </view>
  105. </view>
  106. <image class="up-icon wow animate__animated animate__bounceInUp" src="@/static/img/c-up-icon.png"
  107. mode="scaleToFill"></image>
  108. </view>
  109. </swiper-item>
  110. <!-- 参与预约 -->
  111. <swiper-item>
  112. <view class="swiper-item" v-if="index == 4">
  113. <view class="index-2">
  114. <image class="text-img-2 wow animate__animated animate__bounceInUp"
  115. src="@/static/img/cyyy-text.png" mode="scaleToFill"></image>
  116. <view class="mb-32">
  117. <view class="fc-F2D4A9 fs-32 mb-16 wow animate__animated animate__bounceInLeft">您的姓名<span
  118. class="fc-ED301D fs-32">*</span></view>
  119. <input class="wow animate__animated animate__bounceInRight" v-model="fromData.name"
  120. type="text" placeholder="请输入您的姓名">
  121. </view>
  122. <view class="mb-32">
  123. <view class="fc-F2D4A9 fs-32 mb-16 wow animate__animated animate__bounceInLeft">您的手机号<span
  124. class="fc-ED301D fs-32">*</span></view>
  125. <input class="wow animate__animated animate__bounceInRight" v-model="fromData.phone"
  126. type="number" placeholder="请输入您的手机号">
  127. </view>
  128. <view class="mb-32">
  129. <view class="fc-F2D4A9 fs-32 mb-16 wow animate__animated animate__bounceInLeft">您的公司名称<span
  130. class="fc-ED301D fs-32">*</span></view>
  131. <input class="wow animate__animated animate__bounceInRight" v-model="fromData.corporate"
  132. type="text" placeholder="请输入您的公司名称">
  133. </view>
  134. <view class="mb-32">
  135. <view class="fc-F2D4A9 fs-32 mb-16 wow animate__animated animate__bounceInLeft">邀请人<span
  136. class="fc-ED301D fs-32">*</span></view>
  137. <input class="wow animate__animated animate__bounceInRight" v-model="fromData.inviter"
  138. type="text" placeholder="请输入您的邀请人">
  139. </view>
  140. <view class="mb-72">
  141. <view class="fc-F2D4A9 fs-32 mb-16 wow animate__animated animate__bounceInLeft">邀请人手机号<span
  142. class="fc-ED301D fs-32">*</span></view>
  143. <input class="wow animate__animated animate__bounceInRight" v-model="fromData.inviter_phone"
  144. type="number" placeholder="请输入邀请人的手机号">
  145. </view>
  146. <view class="save-box wow animate__animated animate__bounceInUp" @click.stop="save()">提交</view>
  147. </view>
  148. </view>
  149. </swiper-item>
  150. </swiper>
  151. </view>
  152. </template>
  153. <script>
  154. import {
  155. getJsConfig,
  156. userParticipation
  157. } from '@/api/user.js';
  158. import tools from "@/service/tools";
  159. import wxJs from "jweixin-module"
  160. import { useBgMusic } from '@/uni_modules/y-bg-music/js_sdk';
  161. export default {
  162. components: {},
  163. data() {
  164. return {
  165. userName: '',
  166. fromData: {
  167. m_id: '',
  168. name: '',
  169. phone: '',
  170. corporate: '',
  171. inviter: '', //邀请人
  172. inviter_phone: '',
  173. },
  174. isAJAX: false,
  175. index: 0,
  176. audioServe: undefined,
  177. isPlay: false,
  178. isAutoPlay: false,
  179. isIos: true,
  180. }
  181. },
  182. onshow() {
  183. this.$wow.init();
  184. },
  185. mounted() {
  186. this.userName = uni.getStorageSync('userName');
  187. let isWeiXin = tools.isWx();
  188. if (isWeiXin) {
  189. this.getJsConfig()
  190. }
  191. const isiOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
  192. this.isIos=isiOS
  193. if (isiOS) {
  194. console.log('This is an iOS device');
  195. } else {
  196. this.audioServe = useBgMusic({
  197. src: './static/mp3/4272600974.mp3',
  198. loop: 999, // 循环次数
  199. controls:false // 显示右上角控制元素
  200. });
  201. }
  202. },
  203. methods: {
  204. musicPlay() {
  205. // if (!this.audioServe) {
  206. // this.audioServe = uni.createInnerAudioContext();
  207. // this.audioServe.autoplay = true;
  208. // this.audioServe.loop = true;
  209. // this.audioServe.obeyMuteSwitch = true;
  210. // this.audioServe.src = 'https://jhxcnc.oss-cn-chengdu.aliyuncs.com/mp3/4272600974.mp3';
  211. // }
  212. // this.audioServe.play();
  213. // this.audioServe.onPlay(() => {
  214. // this.isPlay = true;
  215. // this.isAutoPlay = true
  216. // })
  217. // 创建bgAudioManager对象
  218. // const bgAudioManager = uni.getBackgroundAudioManager();
  219. // bgAudioManager.src = 'https://jhxcnc.oss-cn-chengdu.aliyuncs.com/mp3/4272600974.mp3';
  220. // // 开始播放的回调函数
  221. // bgAudioManager.onPlay(() => {
  222. // console.log('开始播放');
  223. // });
  224. // // 播放报错的事件监听
  225. // bgAudioManager.onError((res) => {
  226. // console.log(res.errMsg);
  227. // console.log(res.errCode);
  228. // });
  229. },
  230. play() {
  231. if (!this.isPlay && this.audioServe ) {
  232. // this.audioServe.play();
  233. // this.audioServe.onPlay(() => {
  234. // this.isPlay = true;
  235. // this.isAutoPlay = true
  236. // })
  237. }
  238. },
  239. musicPause() {
  240. // if (this.audioServe) {
  241. // this.audioServe.pause();
  242. // this.audioServe.onPause(() => {
  243. // this.isPlay = false;
  244. // });
  245. // }
  246. },
  247. getJsConfig() {
  248. console.log(window.location)
  249. let url = window.location.href.split('#')[0];
  250. getJsConfig({
  251. 'url': url
  252. }).then(res => {
  253. if (res.code === 1) {
  254. wxJs.config({
  255. debug: false,
  256. appId: res.data.appid,
  257. nonceStr: res.data.noncestr,
  258. signature: res.data.signature,
  259. timestamp: res.data.timestamp * 1, // 必填,生成签名的时间戳
  260. jsApiList: ['updateAppMessageShareData', 'updateTimelineShareData']
  261. })
  262. wxJs.ready(() => {
  263. //自定义“分享给朋友”
  264. // this.musicPlay()
  265. wxJs.updateAppMessageShareData({
  266. title: '振合网“实体联盟”招商说明会-邀请函',
  267. desc: '10月20日我们不见不散!',
  268. link: "https://enroll.jhcs888.com/#/", // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
  269. imgUrl: 'https://jhnewshop.oss-cn-chengdu.aliyuncs.com/storage/attest/20210927/949e48fb7c286836097efdd4ba4d0bd9.jpg', // 分享图标
  270. success: function() {
  271. // 设置成功
  272. }
  273. })
  274. //自定义“分享到朋友圈”
  275. wxJs.updateTimelineShareData({
  276. title: '振合网“实体联盟”招商说明会-邀请函',
  277. desc: '10月20日我们不见不散!',
  278. link: "https://enroll.jhcs888.com/#/", // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
  279. imgUrl: 'https://jhnewshop.oss-cn-chengdu.aliyuncs.com/storage/attest/20210927/949e48fb7c286836097efdd4ba4d0bd9.jpg', // 分享图标
  280. success: function() {
  281. // 设置成功
  282. }
  283. })
  284. if(this.audioServe){
  285. this.audioServe.play();
  286. }else if (!this.isIos){
  287. this.$refs.musicObj.playTo()
  288. }
  289. });
  290. }
  291. })
  292. },
  293. playPhone() {
  294. uni.makePhoneCall({
  295. phoneNumber: '023-67177907'
  296. });
  297. },
  298. swiperChange(e) {
  299. console.log('aaaaaaaaaaaaaaaaaaaaaaaaaaaa')
  300. this.play()
  301. if (e.detail.current != this.index) {
  302. this.index = e.detail.current;
  303. }
  304. },
  305. toMap() {
  306. uni.openLocation({
  307. latitude: 29.665085,
  308. longitude: 106.615366,
  309. scale: 18,
  310. name: '重庆丽星君顿酒店',
  311. address: '重庆市渝北区服装城大道48号',
  312. success() {},
  313. fail(error) {}
  314. });
  315. },
  316. save() {
  317. if (this.isAJAX) {
  318. return
  319. }
  320. this.isAJAX = true;
  321. this.fromData.m_id = uni.getStorageSync('m_id');
  322. userParticipation(this.fromData).then((res) => {
  323. if (res.code === 1) {
  324. tools.success('预约成功')
  325. this.fromData = {
  326. m_id: '',
  327. name: '',
  328. phone: '',
  329. corporate: '',
  330. inviter: '', //邀请人
  331. inviter_phone: '',
  332. }
  333. } else {
  334. tools.error(res.msg)
  335. }
  336. this.isAJAX = false;
  337. })
  338. }
  339. },
  340. }
  341. </script>
  342. <style lang="scss" scoped>
  343. .index-box {
  344. background-image: url('@/static/img/c-bg.png');
  345. background-size: 100% 100%;
  346. }
  347. .up-icon {
  348. width: 64rpx;
  349. height: 64rpx;
  350. margin: 0 auto;
  351. }
  352. .swiper {
  353. flex: 1;
  354. width: 100%;
  355. height: 100%;
  356. .swiper-item {
  357. width: 100%;
  358. height: 100%;
  359. }
  360. }
  361. .logo-img {
  362. width: 136rpx;
  363. height: 79rpx;
  364. margin-top: 8rpx;
  365. }
  366. .music-img {
  367. margin-top: 16rpx;
  368. width: 56rpx;
  369. height: 56rpx;
  370. }
  371. .music-anumation {
  372. animation: rotation 2s linear infinite;
  373. }
  374. @keyframes rotation {
  375. from {
  376. transform: rotate(0deg);
  377. }
  378. to {
  379. transform: rotate(360deg);
  380. }
  381. }
  382. .index-1 {
  383. .img-text {
  384. width: 384rpx;
  385. height: 232rpx;
  386. margin: 76rpx auto 36rpx auto;
  387. }
  388. .img-xian {
  389. width: 10rpx;
  390. height: 174rpx;
  391. margin: 0 auto 154rpx auto;
  392. }
  393. .name-text {
  394. width: 288rpx;
  395. height: 32rpx;
  396. margin: 0 auto 10rpx auto;
  397. }
  398. .time-text {
  399. width: 274rpx;
  400. height: 37rpx;
  401. margin: 0 auto 140rpx auto;
  402. }
  403. }
  404. .index-2 {
  405. width: 686rpx;
  406. min-height: 1032rpx;
  407. background: rgba(23, 49, 74, 0.51);
  408. border-radius: 12rpx;
  409. border: 2rpx solid rgba(51, 121, 163, 0.8);
  410. margin: 40rpx auto;
  411. box-sizing: border-box;
  412. padding: 32rpx;
  413. input {
  414. width: 622rpx;
  415. height: 80rpx;
  416. background: #FFFFFF;
  417. border-radius: 10rpx;
  418. box-sizing: border-box;
  419. padding: 0 20rpx;
  420. font-size: 28rpx;
  421. }
  422. .save-box {
  423. width: 622rpx;
  424. height: 80rpx;
  425. background: linear-gradient(90deg, #EBC795 0%, #E3BB83 100%);
  426. border-radius: 10rpx;
  427. text-align: center;
  428. line-height: 80rpx;
  429. font-size: 38rpx;
  430. font-weight: 600;
  431. color: #3A2E1C;
  432. }
  433. .text-img {
  434. width: 302rpx;
  435. height: 116rpx;
  436. margin: 0 auto 44rpx auto;
  437. }
  438. .text-box {
  439. line-height: 68rpx;
  440. letter-spacing: 4rpx;
  441. display: block;
  442. text-indent: 72rpx;
  443. }
  444. .text-img-1 {
  445. width: 224rpx;
  446. height: 116rpx;
  447. margin: 0 auto 44rpx auto;
  448. }
  449. .text-img-2 {
  450. width: 214rpx;
  451. height: 116rpx;
  452. margin: 0 auto 44rpx auto;
  453. }
  454. .img-1 {
  455. width: 622rpx;
  456. height: 328rpx;
  457. border-radius: 10rpx;
  458. margin-bottom: 24rpx;
  459. }
  460. .img-2 {
  461. width: 300rpx;
  462. height: 214rpx;
  463. margin-bottom: 60rpx;
  464. }
  465. .img-3 {
  466. width: 622rpx;
  467. height: 354rpx;
  468. border-radius: 10rpx;
  469. margin-bottom: 40rpx;
  470. }
  471. .b-f {
  472. position: relative;
  473. .b-c {
  474. position: absolute;
  475. right: 24rpx;
  476. bottom: 22rpx;
  477. width: 172rpx;
  478. height: 56rpx;
  479. background: #2F80ED;
  480. border-radius: 4rpx;
  481. text-align: center;
  482. line-height: 56rpx;
  483. font-size: 28rpx;
  484. color: #fff;
  485. }
  486. }
  487. }
  488. </style>