newYear2024.vue 17 KB

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