toJoin.vue 10 KB

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