freeInstallment.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  1. <template>
  2. <view class="all">
  3. <u-navbar title="免费安桩" :is-back="back" ></u-navbar>
  4. <view class="main">
  5. <view class="text">
  6. 为响应政府号召,积极推动充电桩普及,“51充电联盟”现面向公共停车场、私家车位提供“免费安桩”服务,有意加盟“51充电联盟”的机构和个人,均可申请免费安装电动汽车/摩托车/自行车充电桩,在平台的运营支持下,共享风口红利。
  7. </view>
  8. <view class="suited">
  9. <p class="title">适合对象 :</p>
  10. <view class="content">
  11. <p>1.停车场、停车棚</p>
  12. <view class="suited-text">
  13. 商超、小区、园区、医院等停车场。通过经营充电业务开源增收。
  14. </view>
  15. </view>
  16. <view class="content">
  17. <p>2.私人车位所有者</p>
  18. <view class="suited-text">
  19. 可通过共享车位空闲时段,为他人提供充电便利获取被动收入。
  20. </view>
  21. </view>
  22. </view>
  23. <view class="application-form ">
  24. <view class="name">
  25. <p>申请人姓名</p>
  26. <u-input v-model="name" :customStyle="placeholderStyle" :placeholderStyle="placeholderStyle" placeholder=""></u-input>
  27. </view>
  28. <view class="tel">
  29. <p>联系电话</p>
  30. <u-input v-model="subForm.phone" :customStyle="placeholderStyle" :placeholderStyle="placeholderStyle" placeholder=""></u-input>
  31. </view>
  32. <view class="place">
  33. <p>安装地点</p>
  34. <u-input class="textarea" type="textarea" height="200" v-model="address" placeholder="填写详细位置" ></u-input>
  35. </view>
  36. <view class="type">
  37. <p>场地类型</p>
  38. <view class="checkbox">
  39. <view class="">
  40. <u-checkbox-group active-color="#00B962">
  41. <u-checkbox
  42. v-model="item.checked"
  43. v-for="(item, index) in typeList" :key="index"
  44. :name="item.name"
  45. >{{item.name}}</u-checkbox>
  46. </u-checkbox-group>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="want">
  51. <p>想要安装</p>
  52. <view class="checkbox">
  53. <view class="">
  54. <u-checkbox-group active-color="#00B962">
  55. <u-checkbox
  56. v-model="item.checked"
  57. v-for="(item, index) in wantList" :key="index"
  58. :name="item.name"
  59. >{{item.name}}</u-checkbox>
  60. </u-checkbox-group>
  61. </view>
  62. </view>
  63. </view>
  64. <view class="hint">
  65. <span style="color: red;">*</span>请保持手机畅通,我们将安排专人与您联系。您也可以拨打
  66. <text class="tel-num">400-8899-619</text>查询申请审核进度!
  67. </view>
  68. <u-button type="warning" @click="submit" >提交申请</u-button>
  69. </view>
  70. </view>
  71. </view>
  72. </template>
  73. <script>
  74. import * as API from '@/apis/friends.js'
  75. import {
  76. checkPhone
  77. } from '@/utils'
  78. export default{
  79. data() {
  80. return {
  81. name:"",
  82. address:"",
  83. back:false,
  84. text1:[],
  85. text2:[],
  86. subForm:{
  87. phone:"",
  88. openId:"",
  89. type:"2",
  90. content:""
  91. },
  92. elderMode:false,
  93. placeholderStyle:{
  94. 'font-size':'28rpx'
  95. },
  96. typeList: [
  97. {
  98. name: '停车场',
  99. checked: false,
  100. disabled: false
  101. },
  102. {
  103. name: '私家车位',
  104. checked: false,
  105. disabled: false
  106. },
  107. {
  108. name: '停车棚',
  109. checked: false,
  110. disabled: false
  111. }
  112. ],
  113. wantList: [
  114. {
  115. name: '电动汽车充电桩',
  116. checked: false,
  117. disabled: false
  118. },
  119. {
  120. name: '电动摩托/自行车充电桩',
  121. checked: false,
  122. disabled: false
  123. },
  124. ]
  125. };
  126. },
  127. onLoad(op) {
  128. if(op.isback){
  129. this.back=true;
  130. }
  131. },
  132. methods:{
  133. submit(){
  134. var obj=[]
  135. if(!this.name){
  136. uni.showToast({
  137. title:"请输入申请人姓名"
  138. })
  139. return
  140. }
  141. if(!this.subForm.phone){
  142. uni.showToast({
  143. title:"请输入联系电话"
  144. })
  145. return
  146. }
  147. var checkPhoneResult = checkPhone(this.subForm.phone);
  148. if (checkPhoneResult !== true) {
  149. uni.showToast({
  150. title: checkPhoneResult,
  151. })
  152. return;
  153. }
  154. if(!this.address){
  155. uni.showToast({
  156. title:"请填写详细位置"
  157. })
  158. return
  159. }
  160. obj.push({
  161. name:"申请人姓名",
  162. value:this.name,
  163. type:"text"
  164. })
  165. obj.push({
  166. name:"安装地点",
  167. value:this.address,
  168. type:"text"
  169. })
  170. this.text1="";
  171. this.text1b=false;
  172. this.text2="";
  173. this.text2b=false;
  174. var list1=this.typeList.map(item=>{
  175. if(item.checked){
  176. this.text1+="1"
  177. this.text1b=true;
  178. }else{
  179. this.text1+="0"
  180. }
  181. return item.name
  182. })
  183. var list2=this.wantList.map(item=>{
  184. if(item.checked){
  185. this.text2+="1"
  186. this.text2b=true;
  187. }else{
  188. this.text2+="0"
  189. }
  190. return item.name
  191. })
  192. if(!this.text1b){
  193. uni.showToast({
  194. title:"请至少勾选一项“场地类型”"
  195. })
  196. return
  197. }
  198. if(!this.text2b){
  199. uni.showToast({
  200. title:"请至少勾选一项“想要安装”"
  201. })
  202. return
  203. }
  204. obj.push({
  205. name:"场地类型",
  206. value:this.text1,
  207. type:"list",
  208. list:list1
  209. })
  210. obj.push({
  211. name:"想要安装",
  212. value:this.text2,
  213. type:"list",
  214. list:list2
  215. })
  216. this.subForm.openId=this.carhelp.getOpenId();
  217. this.subForm.content=JSON.stringify(obj);
  218. console.log(this.subForm)
  219. uni.showLoading({
  220. title: "加载中",
  221. mask: true,
  222. })
  223. API.submit(this.subForm).then((res) => {
  224. uni.hideLoading()
  225. uni.showModal({
  226. showCancel:false,
  227. title:"提示",
  228. content:"提交成功!",
  229. confirmText:"前往主页",
  230. success() {
  231. uni.reLaunch({
  232. url:"/"
  233. })
  234. }
  235. })
  236. }).catch(error => {
  237. uni.showToast({
  238. title: error,
  239. icon: "none"
  240. })
  241. })
  242. },
  243. theme(type) {
  244. if(type == 'elder')
  245. {
  246. document.getElementsByTagName('body')[0].setAttribute('data-theme',type);
  247. let data = {
  248. "font-size":'32rpx',
  249. };
  250. this.placeholderStyle = data;
  251. }
  252. else
  253. {
  254. document.getElementsByTagName('body')[0].setAttribute('data-theme',type);
  255. let data = {
  256. "font-size":'28rpx'
  257. };
  258. this.placeholderStyle = data;
  259. }
  260. }
  261. },
  262. onReady(){
  263. this.elderMode = this.carhelp.get('getElderModeClass') == '长辈模式';
  264. if(this.elderMode)
  265. this.theme('elder')
  266. else
  267. this.theme('standard')
  268. }
  269. }
  270. </script>
  271. <style>
  272. page{
  273. background-color: #00b962;
  274. }
  275. </style>
  276. <style lang="scss" scoped>
  277. @import "@/_theme.scss";
  278. .all{
  279. @include themeify{
  280. font-size: themed('font-size2');
  281. }
  282. }
  283. .main{
  284. padding: 36px 28px 85px;
  285. .text{
  286. color: rgba(255, 255, 255, 100);
  287. @include themeify{
  288. font-size: themed('font-size4');
  289. }
  290. /* font-size: 18px;*/
  291. text-align: justify;
  292. }
  293. .suited{
  294. background-color: #fff;
  295. margin-top: 24px;
  296. padding: 24px;
  297. border-radius: 16px;
  298. .title{
  299. /*height: 18px;*/
  300. color: rgba(16, 16, 16, 100);
  301. @include themeify{
  302. font-size: themed('font-size4');
  303. height: themed('font-size4');
  304. }
  305. /* font-size: 18px;*/
  306. font-weight: 600;
  307. }
  308. .content{
  309. margin-top: 12px;
  310. p{
  311. font-weight: 550;
  312. @include themeify{
  313. font-size: themed('font-size2');
  314. }
  315. /* font-size: 14px*/
  316. }
  317. .suited-text{
  318. margin-top: 10px;
  319. line-height: 20px;
  320. }
  321. }
  322. }
  323. .application-form{
  324. background-color: #fff;
  325. border-radius: 16px;
  326. margin-top: 24px;
  327. padding: 24px;
  328. .u-input{
  329. border-radius: 50px;
  330. background-color: rgba(232, 236, 234, 100);
  331. margin-top: 12px;
  332. }
  333. /deep/.uni-input-input{
  334. margin: 20px;
  335. }
  336. /deep/.u-input__right-icon{
  337. margin-right: 10px;
  338. }
  339. p{
  340. @include themeify{
  341. font-size: themed('font-size4');
  342. line-height: themed('font-size4');
  343. height: themed('font-size4');
  344. }
  345. /* height: 18px;
  346. line-height: 18px;*/
  347. color: rgba(16, 16, 16, 100);
  348. /* font-size: 18px;*/
  349. }
  350. .tel,.place,.type,.want{
  351. margin-top: 24px;
  352. }
  353. .textarea{
  354. width: 72.2vw;
  355. height: 140px;
  356. border-radius: 22px;
  357. background-color: rgba(232, 236, 234, 100);
  358. margin-top: 12px;
  359. overflow-y: scroll;
  360. @include themeify{
  361. font-size: themed('font-size2');
  362. line-height: themed('font-size2');
  363. }
  364. .uni-textarea-placeholder{
  365. padding: 12px;
  366. @include themeify{
  367. font-size: themed('font-size2');
  368. line-height: themed('font-size2');
  369. }
  370. }
  371. /deep/.uni-textarea-textarea{
  372. width: 90%;
  373. padding: 10px 20px;
  374. }
  375. /deep/.u-input__right-icon {
  376. display: none;
  377. }
  378. }
  379. }
  380. .type{
  381. .checkbox{
  382. margin-top: 12px;
  383. /deep/.u-checkbox{
  384. width: 50% !important;
  385. margin-top: 4px;
  386. }
  387. }
  388. }
  389. .want{
  390. /deep/.u-checkbox{
  391. margin-top: 8px;
  392. }
  393. }
  394. .hint{
  395. margin-top: 12px;
  396. @include themeify{
  397. font-size: themed('font-size2');
  398. line-height: themed('font-size5');
  399. }
  400. /*
  401. font-size: 14px;
  402. line-height: 20px;
  403. */
  404. text-align: justify;
  405. .tel-num{
  406. color: #9FC7FF;
  407. }
  408. }
  409. /deep/.u-btn{
  410. border-radius: 50px ;
  411. margin-top: 24px;
  412. }
  413. }
  414. </style>