information.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  1. <template>
  2. <view class="">
  3. <view class="information">
  4. <view class="list">
  5. <view class="lable">{{isType?'姓名':'企业单位'}}:</view>
  6. <view class="input">
  7. <input type="text" v-model="list.name" :placeholder="isType?'请输入姓名':'请输入企业单位'" />
  8. </view>
  9. </view>
  10. <view class="list">
  11. <view class="lable">{{isType?'身份证号':'企业统一代码'}}:</view>
  12. <view class="input">
  13. <input type="text" v-model="list.id" :placeholder="isType?'请输入身份证号':'请输入企业统一代码'" />
  14. </view>
  15. </view>
  16. <view class="list">
  17. <view class="lable">联系方式:</view>
  18. <view class="input">
  19. <input type="text" v-model="list.phone" placeholder="请输入联系方式" />
  20. </view>
  21. </view>
  22. <view class="list">
  23. <view class="lable" style="">所在地区:</view>
  24. <view class="input" style="width: calc(100% - 240rpx);padding: 20rpx;">
  25. <pickerAddress class="pickerAddress" :class="{pickerColor: !location}" @change="onCityClick">
  26. {{location||'请选择地址'}}
  27. </pickerAddress>
  28. </view>
  29. <view><img src="@/static/img/jt.png" v-show="!location"></view>
  30. </view>
  31. <view class="list">
  32. <view class="lable">详细地址:</view>
  33. <view class="input">
  34. <input type="text" v-model="list.address" placeholder="请输入详细地址" />
  35. </view>
  36. </view>
  37. <view class="list">
  38. <view class="lable">{{isType?'职业':'主营领域'}}:</view>
  39. <view class="input">
  40. <input type="text" v-model="list.occupation" :placeholder="isType?'请输入职业':'请输入主营领域'" />
  41. </view>
  42. </view>
  43. <view class="list">
  44. <view class="lable">{{isType?'职业年限':'公司年限'}}:</view>
  45. <view class="input">
  46. <input type="text" v-model="list.careerYears" :placeholder="isType?'请输入职业年限':'请输入公司年限'" />
  47. </view>
  48. </view>
  49. <view class="list">
  50. <view class="lable">保荐人:</view>
  51. <view class="input">
  52. <input type="text" v-model="list.sponsor" placeholder="请输入保荐人" />
  53. </view>
  54. </view>
  55. </view>
  56. <view class="img">
  57. <p>{{isType?'半身照':'品牌logo'}}:</p>
  58. <view class="photo" @click='pic'>
  59. <img :src="list.img" v-if="list.img" />
  60. <img src="@/static/img/k.png" v-else>
  61. </view>
  62. </view>
  63. <view class="button" @click="eject">
  64. 提交申请
  65. </view>
  66. <view class="gradeList" v-if="isEject">
  67. <view class="title">
  68. 选择会员
  69. </view>
  70. <view class="grade" v-for="( g,index ) in gradeList" @click="chooseGradeList(g,index)">
  71. <view style="width: 230rpx;">{{ g.name }}</view>
  72. <view class="right">
  73. {{ g.price == 0 ? '': g.price }}
  74. <view class="border">
  75. <view v-if="chooseGrade == index" class="xzTip"></view>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="gradeButton" @click="type == 1?submit1():submit2()">
  80. 确定提交
  81. </view>
  82. </view>
  83. <view class="bg" v-if="isEject" @click="isEject = false"></view>
  84. </view>
  85. </template>
  86. <script>
  87. import {
  88. apply,
  89. getPrice,
  90. uploads
  91. } from '../../api/apply.js'
  92. import {
  93. getUserInfo
  94. } from '../../api/login.js'
  95. import {
  96. mapMutations,
  97. mapState
  98. } from 'vuex';
  99. import {
  100. saveUrl,
  101. interceptor
  102. } from '@/utils/loginUtils.js';
  103. import pickerAddress from '@/components/wangding-pickerAddress/wangding-pickerAddress.vue';
  104. import weixinObj from '@/plugin/jweixin-module/index.js';
  105. export default {
  106. components: {
  107. pickerAddress
  108. },
  109. data() {
  110. return {
  111. list: {
  112. name: '', // 姓名/企业单位
  113. id: '', // 身份证号/企业统一代码
  114. phone: '', // 联系方式
  115. location: '', // 所在地区
  116. address: '', // 详细地址
  117. occupation: '', // 职业/主营领域
  118. careerYears: '', // 职业年限/公司年限
  119. sponsor: '', // 保荐人
  120. img: '', // 半身照/品牌logo
  121. pay_type: 'weixin', //weixin:微信支付,yue:余额支付
  122. grade: '' // 等级
  123. },
  124. province: '', // 省
  125. city: '', // 市
  126. district: '', // 区
  127. type: '', // 1代表个人会员2代表企业会员
  128. isEject: false, //会员价格弹窗
  129. gradeList: [],
  130. chooseGrade: 0,
  131. money: 0.0, //订单金额
  132. // // #ifdef H5
  133. // froms: '', //保存h5中数据来源对象
  134. // // #endif
  135. // orderKey: '',
  136. // orderId: '', //保存订单id
  137. payLoding: false, //判断是否在支付中
  138. }
  139. },
  140. computed: {
  141. // #ifdef H5
  142. ...mapState(['weichatObj']),
  143. // #endif
  144. isType() {
  145. return this.type == 1
  146. },
  147. // 所在地区
  148. location() {
  149. return this.province + this.city + this.district
  150. },
  151. ...mapState('user', ['hasLogin'])
  152. },
  153. mounted() {
  154. this.price()
  155. },
  156. watch: {
  157. location() {
  158. this.list.location = this.location
  159. }
  160. },
  161. onLoad(options) {
  162. this.type = options.type;
  163. getUserInfo()
  164. },
  165. methods: {
  166. ...mapMutations('user', ['setInformation']),
  167. // 选择会员价格
  168. chooseGradeList(data, index) {
  169. this.chooseGrade = index
  170. this.list.grade = data.grade
  171. this.money = data.price
  172. console.log(this.list)
  173. },
  174. // 会员价格
  175. price() {
  176. getPrice({}, this.type).then(res => {
  177. this.gradeList = res.data
  178. this.list.grade = res.data[0].grade
  179. console.log(this.list)
  180. })
  181. },
  182. //会员价格选择
  183. eject() {
  184. this.isEject = true
  185. },
  186. // 个人申请提交
  187. submit1() {
  188. console.log('1')
  189. const obj = this;
  190. if (obj.payLoding) {
  191. return;
  192. }
  193. obj.payLoding = true;
  194. apply(obj.list, obj.type).then(res => {
  195. let da = res.data.result.jsConfig;
  196. let data = {
  197. timestamp: da.timestamp,
  198. nonceStr: da.nonceStr,
  199. package: da.package,
  200. signType: da.signType,
  201. paySign: da.paySign,
  202. success: function(res) {
  203. console.log(res)
  204. obj.paySuccessToP();
  205. obj.payLoding = false;
  206. },
  207. fail: () => {
  208. obj.payLoding = false;
  209. }
  210. };
  211. weixinObj.chooseWXPay(data);
  212. }).catch(res => {
  213. obj.payLoding = false;
  214. console.log(res)
  215. })
  216. },
  217. //企业申请
  218. submit2() {
  219. const obj = this;
  220. console.log('2')
  221. apply(obj.list, obj.type).then(res => {
  222. console.log(res)
  223. obj.paySuccessTo();
  224. }).catch(res => {
  225. console.log(res)
  226. })
  227. },
  228. // 上传图片
  229. pic() {
  230. console.log(this.hasLogin, '当前状态');
  231. if (this.hasLogin) {
  232. uploads().then(res => {
  233. console.log(res, '返回图片');
  234. this.list.img = res[0].url
  235. })
  236. } else {
  237. uni.showModal({
  238. title: "登陆",
  239. content: '您未登录!是否马上登录?',
  240. success: (e) => {
  241. // 判断是否点击确认按钮
  242. if (e.confirm) {
  243. // 保存当前页面地址
  244. saveUrl()
  245. // 跳转页面
  246. interceptor()
  247. }
  248. }
  249. })
  250. }
  251. },
  252. // 选中城市切换
  253. onCityClick({ data }) {
  254. this.province = data[0] + '/';
  255. this.city = data[1] + '/';
  256. this.district = data[2];
  257. },
  258. //提交申请成功
  259. paySuccessTo() {
  260. const that = this
  261. uni.showToast({
  262. title: '申请成功,请等待三个工作日审核',
  263. duration: 2000,
  264. position: 'top'
  265. });
  266. this.isEject = !this.isEject
  267. },
  268. // 个人申请提交申请成功
  269. paySuccessToP() {
  270. this.paySuccessTo()
  271. setTimeout(() => {
  272. uni.navigateTo({
  273. url: '/pages/apply/verification'
  274. })
  275. },500)
  276. }
  277. }
  278. }
  279. </script>
  280. <style lang="scss" scoped>
  281. page {
  282. height: 100%;
  283. }
  284. body {
  285. background-color: #f3f3f3;
  286. }
  287. .information {
  288. background-color: #fff;
  289. margin: 0 10rpx;
  290. padding: 0 40rpx;
  291. border-radius: 20rpx 20rpx 0 0;
  292. font-size: 30rpx;
  293. }
  294. .list {
  295. display: flex;
  296. border-bottom: solid 1rpx #f3f3f3;
  297. .lable {
  298. padding: 20rpx;
  299. width: 270rpx;
  300. }
  301. img {
  302. padding-top: 26rpx;
  303. width: 0rpx;
  304. float: right;
  305. }
  306. .input {
  307. input {
  308. border: 0;
  309. width: calc(100% - 20rpx);
  310. font-size: 30rpx;
  311. padding: 20rpx;
  312. }
  313. }
  314. }
  315. .img {
  316. font-size: 30rpx;
  317. background-color: #fff;
  318. border-radius: 0 0 20rpx 20rpx;
  319. height: 340rpx;
  320. position: relative;
  321. margin: 0 10rpx;
  322. padding: 0 40rpx;
  323. p {
  324. padding: 20rpx;
  325. }
  326. img {
  327. width: 160rpx;
  328. }
  329. }
  330. .photo {
  331. width: 160rpx;
  332. height: 160rpx;
  333. margin: auto auto;
  334. }
  335. .button {
  336. position: fixed;
  337. bottom: 0;
  338. left: 0;
  339. width: 100%;
  340. text-align: center;
  341. color: #fff;
  342. background-color: #3b66f5;
  343. font-size: 30rpx;
  344. height: 100rpx;
  345. line-height: 100rpx;
  346. }
  347. .pickerAddress {}
  348. .pickerColor {
  349. color: #808080;
  350. }
  351. .gradeList {
  352. padding: 40rpx;
  353. width: 600rpx;
  354. left: calc(50% - 300rpx);
  355. position: absolute;
  356. top: 30%;
  357. border-radius: 20rpx;
  358. z-index: 99;
  359. background-color: #fff;
  360. .title {
  361. text-align: center;
  362. font-size: 36rpx;
  363. font-weight: bold;
  364. color: #333333;
  365. }
  366. .grade {
  367. text-align: center;
  368. display: flex;
  369. justify-content: space-between;
  370. padding: 40rpx 20rpx;
  371. }
  372. .right {
  373. display: flex;
  374. margin: auto 0;
  375. }
  376. .border {
  377. margin: auto 15rpx;
  378. width: 20rpx;
  379. height: 20rpx;
  380. border-radius: 50%;
  381. border: solid 1rpx #3b66f5;
  382. .xzTip {
  383. width: 12rpx;
  384. height: 12rpx;
  385. margin-top: 2rpx;
  386. margin-left: 2rpx;
  387. border-radius: 50%;
  388. background-color: #3b66f5;
  389. }
  390. }
  391. }
  392. .bg {
  393. position: absolute;
  394. top: 0;
  395. left: 0;
  396. background-color: rgba(0, 0, 0, 0.5);
  397. width: 100%;
  398. height: 100%;
  399. z-index: 98;
  400. }
  401. .gradeButton {
  402. padding: 10rpx;
  403. background-color: #3b66f5;
  404. color: #fff;
  405. width: 80%;
  406. margin: 0 auto;
  407. border-radius: 10rpx;
  408. font-size: 32rpx;
  409. text-align: center;
  410. }
  411. </style>