newYear2024.vue 18 KB

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