cooperation.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  1. <template>
  2. <view class="cooperation">
  3. <!-- #ifdef H5 -->
  4. <u-navbar back-text="" :custom-back='goBack' title="商务合作" :border-bottom="false" :background="{backgroundColor: '#d52e4c'}" back-icon-color="#fff" title-color="#fff"></u-navbar>
  5. <!-- #endif -->
  6. <u-toast ref="uToast" />
  7. <view class="formBgc">
  8. <view class="form">
  9. <view class="type">
  10. <view class="label">
  11. 您是:
  12. </view>
  13. <u-radio-group v-model="type" active-color="#d52e4c" @change="typeChange">
  14. <view class="inputBox">
  15. <u-radio name="1" >
  16. 个人
  17. </u-radio>
  18. <input v-model="nameType_1" @focus="type=1" placeholder-style="font-size:24rpx;" placeholder="输入您的名字" type="text" />
  19. </view>
  20. <view class="inputBox inputBoxTop">
  21. <u-radio name="2" >
  22. 公司
  23. </u-radio>
  24. <input v-model="nameType_2" @focus="type=2" placeholder-style="font-size:24rpx;" placeholder="输入公司的名字" type="text" />
  25. </view>
  26. </u-radio-group>
  27. </view>
  28. <view class="item">
  29. <view class="label">
  30. 合作方向:
  31. </view>
  32. <view class="radioGroup">
  33. <u-radio-group active-color="#d52e4c" width="33.33%" v-model="fors" @change="forsChange">
  34. <u-radio name="1" >
  35. 直播合作
  36. </u-radio>
  37. <u-radio name="2" >
  38. 学习直播
  39. </u-radio>
  40. <u-radio name="3" >
  41. 卡商合作
  42. </u-radio>
  43. </u-radio-group>
  44. </view>
  45. </view>
  46. <view class="item">
  47. <view class="label">
  48. 有无直播卖货经验:
  49. </view>
  50. <view class="radioGroup">
  51. <u-radio-group active-color="#d52e4c" width="50%" v-model="has_exp" @change="has_expChange">
  52. <u-radio name="1" >
  53. </u-radio>
  54. <u-radio name="0" >
  55. </u-radio>
  56. </u-radio-group>
  57. </view>
  58. </view>
  59. <view class="item message">
  60. <view class="label">
  61. 手机号:
  62. </view>
  63. <view class="sms">
  64. <input v-model="phone" maxlength="11" placeholder-style="font-size:24rpx;" placeholder="输入您的联系人手机号" type="text" />
  65. <!-- -->
  66. <view class="wrap" v-if="configAll.system_sms_open">
  67. <u-toast ref="uToast"></u-toast>
  68. <u-verification-code :seconds="seconds" start-text="验证码" @end="end" @start="start" ref="uCode"
  69. @change="codeChange"></u-verification-code>
  70. <view class="tips" @tap="getCode" >{{tips}}</view>
  71. </view>
  72. </view>
  73. </view>
  74. <!-- v-if="configAll.system_sms_open" -->
  75. <view class="item message" v-if="configAll.system_sms_open">
  76. <view class="label">
  77. 验证码:
  78. </view>
  79. <input maxlength="4" v-model="sms_code" placeholder-style="font-size:24rpx;" placeholder="输入收到的验证码" type="text" />
  80. </view>
  81. </view>
  82. <view style="margin: 0 20rpx;">
  83. <view class="btn">
  84. <u-button @click="business_form()">提交</u-button>
  85. </view>
  86. <view class="tips">
  87. <view>
  88. <text class="weigh">温馨提醒 : </text>
  89. </view>
  90. <view>
  91. <text>亲爱的用户,如果你想从事电商事业,并在对我们的理念有共识,认同我们的合作理念以通讯业务,我们将在看到后的第一时间联系!期待您的加入!</text>
  92. </view>
  93. <text class="weigh" v-if="configAll.bussiness_contact_mobile!=''">商务合作:{{configAll.bussiness_contact_mobile}}</text>
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. </template>
  99. <script>
  100. export default {
  101. data() {
  102. return {
  103. chanId:'',
  104. type:'', //1个人2公司
  105. nameType_1:'',
  106. nameType_2:'',
  107. fors:'',//合作方向
  108. has_exp:'',//有无经验
  109. phone:'',//手机号
  110. sms_code:'',//短信
  111. list: [
  112. {
  113. name: 'apple',
  114. disabled: false
  115. },
  116. {
  117. name: 'banner',
  118. disabled: false
  119. },
  120. {
  121. name: 'orange',
  122. disabled: false
  123. }
  124. ],
  125. // u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
  126. value: '',
  127. tips: '',
  128. // refCode: null,
  129. seconds: 60,
  130. };
  131. },
  132. onLoad(option){
  133. // this.type=1
  134. if(option.chanId){
  135. uni.setStorageSync('chanId', option.chanId);
  136. this.chanId=option.chanId
  137. }else{
  138. uni.removeStorageSync('chanId');
  139. }
  140. },
  141. methods: {
  142. goBack(){
  143. if(getCurrentPages().length==1){
  144. return
  145. }else{
  146. uni.redirectTo({
  147. url:'/pages/index/index?chanId='+this.chanId
  148. })
  149. }
  150. },
  151. open() {
  152. this.$refs.popup.open()
  153. },
  154. /**
  155. * 点击取消按钮触发
  156. * @param {Object} done
  157. */
  158. close() {
  159. // TODO 做一些其他的事情,before-close 为true的情况下,手动执行 close 才会关闭对话框
  160. this.$refs.popup.close()
  161. },
  162. // 选中某个单选框时,由radio时触发
  163. typeChange(e){
  164. console.log(e)
  165. // console.log(this.type)
  166. },
  167. forsChange(e){
  168. console.log(e)
  169. // console.log(this.fors)
  170. },
  171. has_expChange(e){
  172. console.log(e)
  173. // console.log(this.has_exp)
  174. },
  175. codeChange(text) {
  176. this.tips = text;
  177. },
  178. //商务合作
  179. business_form(){
  180. let obj={
  181. type:this.type,
  182. name:this.nameType_1,
  183. for:this.fors,
  184. has_exp:this.has_exp,
  185. phone:this.phone,
  186. sms_code:this.sms_code,
  187. }
  188. if(this.type==2){
  189. obj.name=this.nameType_2
  190. }
  191. this.$http.business_form(obj).then(res=>{
  192. if(res.data.code==1){
  193. uni.showToast({
  194. title: '提交成功',
  195. duration: 500,
  196. icon: 'none'
  197. });
  198. uni.reLaunch({
  199. url: '/pages/index/index',
  200. })
  201. }else{
  202. this.$refs.uToast.show({
  203. title: res.data.msg,
  204. type: 'error ',
  205. })
  206. }
  207. })
  208. },
  209. // 获取短信
  210. getCode() {
  211. if(this.$refs.uCode.canGetCode) {
  212. // 模拟向后端请求验证码
  213. // uni.showLoading({
  214. // title: '正在获取验证码'
  215. // })
  216. console.log(this.phone)
  217. if(this.phone==''){
  218. this.$refs.uToast.show({
  219. title: '请输入手机号',
  220. type: 'warning ',
  221. })
  222. return;
  223. }
  224. if (!this.$check.checkMobile.test(this.phone)) {
  225. this.$refs.uToast.show({
  226. title: '请输入正确的手机号格式',
  227. type: 'warning ',
  228. })
  229. return false;
  230. }
  231. this.$http.send({mobile:this.phone,event:'cooperate'})
  232. .then(res=>{
  233. if(res.data.code==1){
  234. this.$u.toast('验证码已发送');
  235. this.$refs.uCode.start();
  236. }else{
  237. this.$refs.uToast.show({
  238. title: res.data.msg,
  239. type: 'error ',
  240. })
  241. }
  242. })
  243. } else {
  244. this.$u.toast('倒计时结束后再发送');
  245. }
  246. },
  247. end() {
  248. // this.$u.toast('倒计时结束');
  249. },
  250. start() {
  251. // this.$u.toast('倒计时开始');
  252. },
  253. }
  254. };
  255. </script>
  256. <style lang="scss">
  257. .cooperation{
  258. width: 100%;
  259. .formBgc{
  260. padding-top: 30rpx;
  261. width: 100%;
  262. height: 725rpx;
  263. background: linear-gradient(rgb(213, 46, 76), #fff);
  264. .form{
  265. box-sizing: border-box;
  266. background-color: #fff;
  267. margin: 0rpx 30rpx 0;
  268. box-sizing: border-box;
  269. padding: 20rpx 30rpx;
  270. border-radius: 20rpx;
  271. /deep/ .u-radio__label{
  272. font-size: 25rpx;
  273. margin-right: 0;
  274. }
  275. .item{
  276. /deep/ .u-radio-group{
  277. justify-content: space-around;
  278. width: 100%;
  279. }
  280. }
  281. /deep/ .u-radio-group{
  282. box-sizing: border-box;
  283. padding-left: 28rpx;
  284. // margin-bottom:4rpx;
  285. flex: 1;
  286. }
  287. /deep/ input::-webkit-input-placeholder {
  288. /* placeholder颜色 */
  289. color: #aab2bd;
  290. /* placeholder字体大小 */
  291. font-size: 24rpx;
  292. }
  293. view:last-child{
  294. border-bottom: 0;
  295. }
  296. .label{
  297. position: relative;
  298. font-size: 24rpx;
  299. color: #333;
  300. padding-left: 20rpx;
  301. }
  302. .label::after{
  303. position: absolute;
  304. content:'*';
  305. color: $uni-color-BGC;
  306. top: 50%;
  307. transform: translateY(-50%);
  308. left: 0;
  309. }
  310. .item{
  311. padding:26rpx 0;
  312. border-bottom: 1rpx solid #F2F2F7;
  313. display: flex;
  314. .radioGroup{
  315. flex:1 ;
  316. }
  317. }
  318. .type{
  319. position: relative;
  320. box-sizing: border-box;
  321. padding-left: 90rpx;
  322. border-bottom: 1rpx solid #F2F2F7;
  323. padding-bottom: 10rpx;
  324. .label{
  325. position: absolute;
  326. top: 50%;
  327. left: 0;
  328. transform: translateY(-50%);
  329. font-size: 25rpx;
  330. }
  331. .inputBox{
  332. display: flex;
  333. flex-wrap: wrap;
  334. // justify-content: space-between;
  335. }
  336. .inputBoxTop{
  337. margin-top: 16rpx;
  338. }
  339. /deep/ input{
  340. width:230rpx;
  341. height: 42rpx;
  342. line-height: 42rpx;
  343. background: #FFFFFF;
  344. min-height: 42rpx;
  345. max-height: 42rpx;
  346. border-radius: 8rpx;
  347. font-size: 20rpx;
  348. color: #BABABA;
  349. border: 1rpx solid rgba(86, 86, 86, 0.2);
  350. padding: 0 16rpx;
  351. margin-left: 20rpx;
  352. }
  353. }
  354. .message{
  355. position: relative;
  356. // justify-content: space-between;
  357. /deep/ .tips{
  358. width: 168rpx;
  359. height: 49rpx;
  360. text-align: center;
  361. line-height: 49rpx;
  362. // border: 1rpx solid #D52E4C;
  363. border-radius: 20rpx;
  364. font-size: 24rpx;
  365. color: #fff;
  366. background-color: $uni-color-BGC;
  367. }
  368. .sms{
  369. flex: 1;
  370. display: flex;
  371. justify-content: space-between;
  372. }
  373. /deep/ .u-input.u-input--border{
  374. border: 0!important;
  375. }
  376. /deep/ input{
  377. width:260rpx;
  378. border: 0;
  379. line-height: 40rpx !important;
  380. height: 40rpx;
  381. min-height: 40rpx!important;
  382. font-size: 24rpx;
  383. text-align: left;
  384. padding-left: 30rpx;
  385. }
  386. }
  387. }
  388. .btn{
  389. .u-size-default{
  390. height: 80rpx;
  391. line-height: 80rpx;
  392. background: #D52E4C;
  393. border-radius: 40px;
  394. color: #fff;
  395. margin-top: 40rpx;
  396. margin-bottom: 40rpx;
  397. overflow: hidden!important;
  398. }
  399. .u-default-hover{
  400. background: #c02b46!important;
  401. border-radius: 40px!important;
  402. color: #fff!important;
  403. }
  404. }
  405. .tips{
  406. font-size: 24rpx;
  407. color: #333;
  408. line-height: 40rpx;
  409. .weigh{
  410. color: #2F2F2F;
  411. font-weight: 700;
  412. }
  413. }
  414. }
  415. }
  416. </style>