newYear2024.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803
  1. <template>
  2. <view class="all">
  3. <u-mask :show="show" @click="show = false">
  4. <u-image width="100%" height="500px" :mode="'widthFix'" src="/static/img/guide_point2.png"></u-image>
  5. </u-mask>
  6. <ujp-navbar title="凭话费领年卡活动" :startGz="false" :isBack="back"></ujp-navbar>
  7. <view class="InviteFriends" :class="{
  8. opacityClass:show
  9. }">
  10. <view class="text imgHead">
  11. <view class="imgHead1">
  12. <img style="width: 125px;" src="@/assets/img/piccShare/1.png"></img>
  13. </view>
  14. <view class="imgHead2">
  15. <img style="width: 252px;height: 40px;" src="@/assets/img/piccShare/5.png"></img>
  16. </view>
  17. </view>
  18. <view class="main">
  19. <view class="suited">
  20. <p class="title">活动对象 :</p>
  21. <view class="content">
  22. 不限
  23. </view>
  24. <p class="title">活动说明 :</p>
  25. <view class="content">
  26. 庆元旦,迎新年,用户凭手机号,免费领取<span
  27. style="color: rgb(12 11 11);font-weight: bold;">51充电联盟年卡</span>一张,最低可享<span
  28. style="color: #ec4f27;font-weight: bold;">两年免充电服务费</span>,最高可享万元礼包,老带新还能有额外红包大礼!
  29. </view>
  30. <view class="bottomView" v-if="false">
  31. <u-button class="button" shape="circle" @click="show=true">分享活动
  32. <u-icon name="share"></u-icon>
  33. </u-button>
  34. </view>
  35. </view>
  36. <view class="application-form ">
  37. <view class="tel">
  38. <p><span style="color: red;">*</span>填写手机号</p>
  39. <u-input v-model="subForm.phone" :customStyle="placeholderStyle"
  40. :placeholderStyle="placeholderStyle" placeholder="请填写手机号"></u-input>
  41. </view>
  42. <view class="bottomView">
  43. <u-button class="button" type="warning" @click="submit">我要领卡</u-button>
  44. </view>
  45. </view>
  46. <view class="application-table table">
  47. <view style="text-align: center;color: red;font-size: 36rpx;margin-bottom: 4px;">
  48. 年卡礼包
  49. </view>
  50. <table >
  51. <tr class="th">
  52. <td >年卡</td>
  53. <td>说明</td>
  54. <td>价值</td>
  55. </tr>
  56. <tr v-for="(item,i) in tableList" :key="i">
  57. <td class="td1">{{item.name}}</td>
  58. <td class="td2">{{item.value}}</td>
  59. <td class="td3">{{item.createBy}}</td>
  60. </tr>
  61. </table>
  62. </view>
  63. </view>
  64. </view>
  65. <u-modal v-model="show1" @confirm="gotoGz" cancel-text="暂不关注" confirm-text="前往关注" :show-cancel-button="false"
  66. confirm-color="#53b56b" ref="uModal2" :asyncClose="true">
  67. <view style="padding: 15px;">请先关注<span style=" color: #53b56b;">{{projectName}}</span>公众号,然后进行填报</view>
  68. </u-modal>
  69. <u-mask :show="carTempBl">
  70. <ucarkeyboard v-if="carTempBl" :tips="subForm.carNum" style="z-index: 9999;position: fixed !important;"
  71. ref="uKeyboard" mode="car" @confirm="carTempBl=false" @cancel="carTempBl=false" :showTips="true"
  72. :mask-close-able="false" @change="valChange" @backspace="backspace"></ucarkeyboard>
  73. </u-mask>
  74. </view>
  75. </template>
  76. <script>
  77. import wx from 'weixin-js-sdk'
  78. import {
  79. convertCanvasToImage,
  80. substrMb
  81. } from '@/utils'
  82. import {
  83. checkPhone
  84. } from '@/utils'
  85. import * as API from '@/apis/friends.js'
  86. import * as WxJsApi from '@/utils/wxJsApi.js'
  87. import * as API_weixin from '@/apis/weixin.js'
  88. import ucarkeyboard from '@/components/Ucarkeyboard.vue'
  89. export default {
  90. components: {
  91. ucarkeyboard
  92. },
  93. data() {
  94. return {
  95. tableList:[],
  96. isLogin: false,
  97. carAuthImg: "",
  98. id: "",
  99. carTempBl: false,
  100. code: "",
  101. show: false,
  102. uid: "",
  103. show1: false,
  104. show2: false,
  105. projectName: "",
  106. name: "",
  107. back: false,
  108. subForm: {
  109. realName: "",
  110. phone: "",
  111. carNum: "",
  112. licenseFileUrl: "",
  113. openId: "",
  114. shareUserId: ""
  115. },
  116. placeholderStyle: {
  117. 'font-size': '16px',
  118. 'padding': '4px 8px',
  119. },
  120. shareUserId: "",
  121. userInfo: null,
  122. carNum: '',
  123. carLicense: false,
  124. }
  125. },
  126. onLoad(op) {
  127. if (op.back) {
  128. this.back = false
  129. }
  130. this.projectName = process.car.ProjectName;
  131. if (op.sid) {
  132. this.shareUserId = op.sid
  133. this.carhelp.set("picc_shareUserId_1230", {
  134. sid: op.sid,
  135. time: new Date().getTime()
  136. });
  137. } else {
  138. var obj = this.carhelp.get("picc_shareUserId_1230")
  139. if (obj) {
  140. var time1 = new Date().getTime()
  141. var time2 = obj.time;
  142. if (time1 - time2 < 1000 * 60 * 5) {
  143. this.shareUserId = obj.sid;
  144. }
  145. }
  146. }
  147. //console.log(this.shareUserId )
  148. if (this.shareUserId) {
  149. uni.showToast({
  150. title: "来自好友的分享"
  151. })
  152. }
  153. this.get_wx_config();
  154. this.getList("凭话费送年卡")
  155. },
  156. onReady() {
  157. var info = this.carhelp.getPersonInfo();
  158. if (info.id && info.phone) {
  159. //this.isLogin=true
  160. this.userInfo = info;
  161. this.subForm.phone = info.phone;
  162. }
  163. },
  164. onShow() {
  165. this.checkSubscribe()
  166. },
  167. methods: {
  168. getList(key) {
  169. API.findByCatalogName({
  170. catalogName:key
  171. }).then((res) => {
  172. this.tableList=res.data.dataDictionaryList
  173. //setGzDate
  174. }).catch(error => {
  175. uni.showToast({
  176. title: error
  177. })
  178. })
  179. },
  180. checkSubscribe() {
  181. API_weixin.checkSubscribe({
  182. openId: this.carhelp.getOpenId()
  183. }).then((res) => {
  184. if (res.data == "0") {
  185. this.show1 = true
  186. } else {
  187. //this.init();
  188. this.show1 = false;
  189. this.show2 = true;
  190. //this.carhelp.setGzDate()
  191. }
  192. //setGzDate
  193. }).catch(error => {
  194. uni.showToast({
  195. title: error
  196. })
  197. })
  198. },
  199. gotoGz() {
  200. this.carhelp.setGzDate()
  201. // this.gotoGzShow = false;
  202. var url = "https://mp.weixin.qq.com/s/mCHz1nNvg0xAICiBeIyKRQ";
  203. window.location.href = url
  204. },
  205. submit() {
  206. this.subForm.openId = this.carhelp.getOpenId();
  207. this.subForm.shareUserId = this.shareUserId;
  208. this.subForm.event = 1;
  209. if (!this.subForm.phone) {
  210. uni.showToast({
  211. title: "请填写手机号"
  212. })
  213. return
  214. }
  215. var checkPhoneResult = checkPhone(this.subForm.phone);
  216. if (checkPhoneResult !== true) {
  217. uni.showToast({
  218. title: checkPhoneResult,
  219. })
  220. return;
  221. }
  222. uni.showLoading({
  223. title: "加载中",
  224. mask: true,
  225. })
  226. API.submitEventRegistration(this.subForm).then((res) => {
  227. uni.hideLoading()
  228. if (res.result) {
  229. uni.showModal({
  230. //showCancel:false,
  231. title: "提示",
  232. content: "提交成功!",
  233. cancelText: "继续填写",
  234. confirmText: "前往主页",
  235. success: (me) => {
  236. this.carAuthImg = "";
  237. this.subForm = {
  238. phone: "",
  239. }
  240. if (me.confirm) {
  241. uni.reLaunch({
  242. url: "/"
  243. })
  244. }
  245. }
  246. })
  247. }
  248. }).catch(error => {
  249. uni.showToast({
  250. title: error,
  251. icon: "none"
  252. })
  253. })
  254. },
  255. //获取微信jssdk配置信息
  256. get_wx_config() {
  257. //("get_wx_configget_wx_configget_wx_configget_wx_config")
  258. var _this = this
  259. API_weixin.getConfig().then(response => {
  260. var wxconfig = response.data.wxConfig;
  261. wx.config({
  262. debug: false, // 开启调试模式,
  263. appId: wxconfig.appId, // 必填,企业号的唯一标识,此处填写企业号corpid
  264. timestamp: wxconfig.timestamp, // 必填,生成签名的时间戳
  265. nonceStr: wxconfig.nonceStr, // 必填,生成签名的随机串
  266. signature: wxconfig.signature, // 必填,签名,见附录1
  267. jsApiList: ['updateAppMessageShareData',
  268. 'updateTimelineShareData', 'onMenuShareTimeline', 'onMenuShareAppMessage',
  269. 'onMenuShareQQ', 'onMenuShareQZone'
  270. ], // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
  271. });
  272. _this.wxShare()
  273. wx.error(function(res) {
  274. //('微信api配置出错');
  275. });
  276. }).catch(error => {
  277. //(error);
  278. })
  279. },
  280. //微信分享自定义
  281. wxShare() {
  282. var img =
  283. "http://oss.xiaoxinda.com/charging/chargingconfigure/2022/6/6/ec228c56-487a-4ae1-ac6f-37284060fbba/hongbao.jpg"
  284. // img="https://yktwechat.xiaoxinda.com/config/xxd2021.jpg"
  285. // if (indexLogo) {
  286. // this.indexLogo = indexLogo;
  287. // }
  288. var info = this.carhelp.getPersonInfo()
  289. //var img=require("@/static/img/aboutus.png")
  290. ////(this.nowItem);
  291. var ProjectName = process.car.ProjectName; //info.nickName+
  292. var nickName = info.nickName ? info.nickName : '好友';
  293. var title = nickName + "邀请你参加'凭话费领年卡活动'"
  294. //"["+ProjectName+"]"+'和好友一起领5元红包'
  295. var desc = ProjectName
  296. let joinUrl = window.location.href.split("/team51/")[0] + "/team51/#/pages/user/newYear2024?back=1"
  297. //this.joinUrl=joinUrl;
  298. if (info.id) {
  299. joinUrl += "&sid=" + info.id;
  300. }
  301. var _this = this;
  302. wx.ready(function() {
  303. wx.onMenuShareAppMessage({
  304. title: title,
  305. desc: desc,
  306. link: joinUrl,
  307. imgUrl: img,
  308. success: function() {
  309. // 设置成功
  310. _this.$emit("wxShare", null);
  311. }
  312. })
  313. wx.onMenuShareTimeline({
  314. title: title,
  315. desc: desc,
  316. link: joinUrl,
  317. imgUrl: img,
  318. success: function() {
  319. // 设置成功
  320. _this.$emit("wxShare", null);
  321. }
  322. })
  323. wx.updateAppMessageShareData({
  324. title: title,
  325. desc: desc,
  326. link: joinUrl,
  327. imgUrl: img,
  328. success: function() {
  329. //("updateAppMessageShareData")
  330. // 设置成功
  331. _this.$emit("wxShare", null);
  332. }
  333. })
  334. wx.updateTimelineShareData({
  335. title: title,
  336. desc: desc,
  337. link: joinUrl,
  338. imgUrl: img,
  339. success: function() {
  340. //("updateTimelineShareData")
  341. // 设置成功
  342. _this.$emit("wxShare", null);
  343. }
  344. })
  345. console.log("readyreadyreadyreadyready")
  346. });
  347. }
  348. }
  349. }
  350. </script>
  351. <style>
  352. page {
  353. background: #c9382c;
  354. }
  355. </style>
  356. <style lang="scss" scoped>
  357. @import "@/_theme.scss";
  358. .all {
  359. @include themeify {
  360. font-size: themed('font-size1');
  361. }
  362. }
  363. .imgHead {
  364. padding-top: 72rpx;
  365. display: flex;
  366. flex-direction: column;
  367. align-items: center;
  368. .imgHead1 {
  369. img {
  370. height: 24px;
  371. }
  372. display: flex;
  373. justify-content: center;
  374. }
  375. .imgHead2 {
  376. display: flex;
  377. img {
  378. width: 100%;
  379. height: 40px;
  380. }
  381. margin-top: 16px;
  382. }
  383. }
  384. .main {
  385. padding: 22rpx 56rpx 170rpx;
  386. .text {
  387. color: rgba(255, 255, 255, 100);
  388. @include themeify {
  389. font-size: themed('font-size4');
  390. }
  391. /* font-size: 18px;*/
  392. text-align: justify;
  393. text-indent: 36px;
  394. }
  395. .suited {
  396. background-color: #fff;
  397. //background: linear-gradient(180deg, rgba(189,255,224,1) 0%,rgba(255,255,255,1) 14%);
  398. background: linear-gradient(180deg, rgba(255, 224, 223, 1) 0%, rgba(255, 255, 255, 1) 14%);
  399. margin-top: 24px;
  400. padding: 24px;
  401. border-radius: 16px;
  402. .title {
  403. /*height: 18px;*/
  404. color: rgba(16, 16, 16, 100);
  405. font-size: 18px;
  406. font-weight: 600;
  407. }
  408. .content {
  409. margin: 16rpx 0;
  410. //font-weight: 550;
  411. color: rgba(102, 102, 102, 1);
  412. line-height: 20px;
  413. font-size: 14px;
  414. p {
  415. margin: 8rpx 0;
  416. }
  417. }
  418. }
  419. .application-table {
  420. background-color: #fff;
  421. border-radius: 16px;
  422. margin-top: 24px;
  423. padding: 24rpx 16rpx;
  424. }
  425. .application-form {
  426. background-color: #fff;
  427. border-radius: 16px;
  428. margin-top: 24px;
  429. padding: 24px;
  430. .u-input {
  431. border-radius: 50px;
  432. background-color: rgba(232, 236, 234, 100);
  433. margin-top: 12px;
  434. }
  435. /deep/.uni-input-input {
  436. margin: 20px;
  437. }
  438. /deep/.u-input__right-icon {
  439. margin-right: 10px;
  440. }
  441. p {
  442. font-size: 18px;
  443. @include themeify {
  444. line-height: themed('font-size4');
  445. height: themed('font-size4');
  446. }
  447. /* height: 18px;
  448. line-height: 18px;*/
  449. color: rgba(16, 16, 16, 100);
  450. /* font-size: 18px;*/
  451. }
  452. .tel,
  453. .place,
  454. .type,
  455. .want {
  456. //margin-top: 24px;
  457. }
  458. .textarea {
  459. width: 72.2vw;
  460. height: 140px;
  461. border-radius: 22px;
  462. background-color: rgba(232, 236, 234, 100);
  463. margin-top: 12px;
  464. overflow-y: scroll;
  465. @include themeify {
  466. font-size: themed('font-size2');
  467. line-height: themed('font-size2');
  468. }
  469. .uni-textarea-placeholder {
  470. padding: 12px 20px;
  471. @include themeify {
  472. font-size: themed('font-size2');
  473. line-height: themed('font-size2');
  474. }
  475. }
  476. /deep/.uni-textarea-textarea {
  477. width: 90%;
  478. padding: 10px 20px;
  479. }
  480. /deep/.u-input__right-icon {
  481. display: none;
  482. }
  483. }
  484. }
  485. .type {
  486. .checkbox {
  487. margin-top: 12px;
  488. /deep/.u-checkbox {
  489. width: 50% !important;
  490. margin-top: 4px;
  491. }
  492. }
  493. }
  494. .want {
  495. /deep/.u-checkbox {
  496. margin-top: 8px;
  497. }
  498. }
  499. .hint {
  500. margin-top: 12px;
  501. @include themeify {
  502. font-size: themed('font-size2');
  503. line-height: themed('font-size5');
  504. }
  505. /*
  506. font-size: 14px;
  507. line-height: 20px;
  508. */
  509. text-align: center;
  510. .tel-num {
  511. color: #9FC7FF;
  512. }
  513. }
  514. /deep/.u-btn {
  515. border-radius: 50px;
  516. margin-top: 24px;
  517. }
  518. }
  519. .InviteFriends {
  520. //background-image: linear-gradient(0deg, #a2e9c9, #01b963);
  521. background: #c9382c;
  522. }
  523. .opacityClass {
  524. opacity: 0.2;
  525. }
  526. // 底部
  527. .bottomView {
  528. border-radius: 50px;
  529. color: rgba(0, 185, 98, 100);
  530. // width: 100%;
  531. // height: 64px;
  532. // text-align: center;
  533. // background-color: #fff;
  534. .button {
  535. //width: 90%;
  536. border-radius: 50px;
  537. // background-color: #fff;
  538. color: #fff;
  539. font-size: 16px;
  540. background: linear-gradient(90deg, rgba(255, 98, 0, 1) 0%, rgba(255, 150, 0, 1) 100%);
  541. //border: 1px solid rgba(0, 163, 86, 1);
  542. }
  543. // button::after {
  544. // border: rgba(0, 185, 98, 100);
  545. // }
  546. }
  547. .carAuth {
  548. border-radius: 12px;
  549. background-color: rgba(255, 255, 255, 1);
  550. border: 2px dashed rgba(187, 187, 187, 1);
  551. //height: 400rpx;
  552. width: 100%;
  553. overflow: hidden;
  554. text-align: center;
  555. .carAuthImg {
  556. margin-top: 10px;
  557. margin-bottom: 10px;
  558. width: 510rpx;
  559. height: 360rpx;
  560. }
  561. .carAuthIcon {
  562. position: absolute;
  563. background: #6e7175;
  564. width: 44px;
  565. height: 44px;
  566. border-radius: 50px;
  567. /* left: 200px; */
  568. /* top: 200px; */
  569. margin: 160rpx 230rpx;
  570. z-index: 99;
  571. display: flex;
  572. justify-content: center;
  573. }
  574. }
  575. // .car-type{
  576. // display: flex;
  577. // flex-direction: row;
  578. // margin: 0 40rpx;
  579. // flex-wrap: wrap;
  580. // }
  581. .want {
  582. .wantView {
  583. display: flex;
  584. }
  585. button {
  586. width: 45%;
  587. color: rgba(51, 51, 51, 1);
  588. background-color: rgba(232, 236, 234, 1);
  589. }
  590. button::after {
  591. border: none;
  592. }
  593. .wantBtn {
  594. background-color: #fff;
  595. border: 2px solid #00B962;
  596. }
  597. .wanttpis {
  598. position: relative;
  599. top: -100rpx;
  600. left: 180rpx;
  601. z-index: 99;
  602. background: #00B962;
  603. padding: 2px 3px;
  604. font-size: 10px;
  605. color: #fff;
  606. border-radius: 4px;
  607. }
  608. }
  609. .carTempBlInput {
  610. display: flex;
  611. align-items: center;
  612. font-size: 16px;
  613. min-height: 44px;
  614. padding: 4px 16px;
  615. border-radius: 20px;
  616. background: #e9ecea;
  617. color: #808080
  618. }
  619. .table {
  620. table {
  621. border-spacing:0;
  622. font-size: 32rpx;
  623. .th {
  624. background-color: #f2efef;
  625. color: #101010;
  626. font-weight: bold;
  627. td{
  628. border: 1px solid #dbdbdb;
  629. }
  630. }
  631. .td1 {
  632. text-align: start;
  633. // background-color: rgba(243, 245, 247, 1);
  634. width: 216rpx;
  635. border-left: 1px solid #dbdbdb;
  636. border-right: 1px solid #dbdbdb;
  637. }
  638. .td3 {
  639. text-align: start;
  640. //background-color: rgba(243, 245, 247, 1);
  641. //width: 100rpx;
  642. border-left: 1px solid #dbdbdb;
  643. border-right: 1px solid #dbdbdb;
  644. }
  645. td {
  646. text-align: center;
  647. border-bottom: 1px solid #dbdbdb;
  648. //width: 160rpx;
  649. }
  650. }
  651. }
  652. </style>