freeInstallment.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  1. <template>
  2. <view class="all">
  3. <ujp-navbar title="邀请好友" :is-back="back" ></ujp-navbar>
  4. <view class="main">
  5. <view class="text">
  6. 为响应政府号召,积极推动充电桩普及,“{{projectName}}”现面向公共停车场、私家车位提供“免费安桩”服务,有意加盟“{{projectName}}”的机构和个人,均可申请免费安装电动汽车/摩托车/自行车充电桩,在平台的运营支持下,共享风口红利。
  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. //(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. text-indent: 36px;
  293. }
  294. .suited{
  295. background-color: #fff;
  296. margin-top: 24px;
  297. padding: 24px;
  298. border-radius: 16px;
  299. .title{
  300. /*height: 18px;*/
  301. color: rgba(16, 16, 16, 100);
  302. @include themeify{
  303. font-size: themed('font-size4');
  304. height: themed('font-size4');
  305. }
  306. /* font-size: 18px;*/
  307. font-weight: 600;
  308. }
  309. .content{
  310. margin-top: 12px;
  311. p{
  312. font-weight: 550;
  313. @include themeify{
  314. font-size: themed('font-size2');
  315. }
  316. /* font-size: 14px*/
  317. }
  318. .suited-text{
  319. margin-top: 10px;
  320. line-height: 20px;
  321. }
  322. }
  323. }
  324. .application-form{
  325. background-color: #fff;
  326. border-radius: 16px;
  327. margin-top: 24px;
  328. padding: 24px;
  329. .u-input{
  330. border-radius: 50px;
  331. background-color: rgba(232, 236, 234, 100);
  332. margin-top: 12px;
  333. }
  334. /deep/.uni-input-input{
  335. margin: 20px;
  336. }
  337. /deep/.u-input__right-icon{
  338. margin-right: 10px;
  339. }
  340. p{
  341. @include themeify{
  342. font-size: themed('font-size4');
  343. line-height: themed('font-size4');
  344. height: themed('font-size4');
  345. }
  346. /* height: 18px;
  347. line-height: 18px;*/
  348. color: rgba(16, 16, 16, 100);
  349. /* font-size: 18px;*/
  350. }
  351. .tel,.place,.type,.want{
  352. margin-top: 24px;
  353. }
  354. .textarea{
  355. width: 72.2vw;
  356. height: 140px;
  357. border-radius: 22px;
  358. background-color: rgba(232, 236, 234, 100);
  359. margin-top: 12px;
  360. overflow-y: scroll;
  361. @include themeify{
  362. font-size: themed('font-size2');
  363. line-height: themed('font-size2');
  364. }
  365. .uni-textarea-placeholder{
  366. padding: 12px 20px;
  367. @include themeify{
  368. font-size: themed('font-size2');
  369. line-height: themed('font-size2');
  370. }
  371. }
  372. /deep/.uni-textarea-textarea{
  373. width: 90%;
  374. padding: 10px 20px;
  375. }
  376. /deep/.u-input__right-icon {
  377. display: none;
  378. }
  379. }
  380. }
  381. .type{
  382. .checkbox{
  383. margin-top: 12px;
  384. /deep/.u-checkbox{
  385. width: 50% !important;
  386. margin-top: 4px;
  387. }
  388. }
  389. }
  390. .want{
  391. /deep/.u-checkbox{
  392. margin-top: 8px;
  393. }
  394. }
  395. .hint{
  396. margin-top: 12px;
  397. @include themeify{
  398. font-size: themed('font-size2');
  399. line-height: themed('font-size5');
  400. }
  401. /*
  402. font-size: 14px;
  403. line-height: 20px;
  404. */
  405. text-align: justify;
  406. .tel-num{
  407. color: #9FC7FF;
  408. }
  409. }
  410. /deep/.u-btn{
  411. border-radius: 50px ;
  412. margin-top: 24px;
  413. }
  414. }
  415. </style>