toJoin.vue 10.0 KB

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