| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434 |
- <template>
- <view class="">
- <view class="information">
- <view class="list">
- <view class="lable">{{isType?'姓名':'企业单位'}}:</view>
- <view class="input">
- <input type="text" v-model="list.name" :placeholder="isType?'请输入姓名':'请输入企业单位'" />
- </view>
- </view>
- <view class="list">
- <view class="lable">{{isType?'身份证号':'企业统一代码'}}:</view>
- <view class="input">
- <input type="text" v-model="list.id" :placeholder="isType?'请输入身份证号':'请输入企业统一代码'" />
- </view>
- </view>
- <view class="list">
- <view class="lable">联系方式:</view>
- <view class="input">
- <input type="text" v-model="list.phone" placeholder="请输入联系方式" />
- </view>
- </view>
- <view class="list">
- <view class="lable" style="">所在地区:</view>
- <view class="input" style="width: calc(100% - 240rpx);padding: 20rpx;">
- <pickerAddress class="pickerAddress" :class="{pickerColor: !location}" @change="onCityClick">
- {{location||'请选择地址'}}
- </pickerAddress>
- </view>
- <view><img src="@/static/img/jt.png" v-show="!location"></view>
- </view>
- <view class="list">
- <view class="lable">详细地址:</view>
- <view class="input">
- <input type="text" v-model="list.address" placeholder="请输入详细地址" />
- </view>
- </view>
- <view class="list">
- <view class="lable">{{isType?'职业':'主营领域'}}:</view>
- <view class="input">
- <input type="text" v-model="list.occupation" :placeholder="isType?'请输入职业':'请输入主营领域'" />
- </view>
- </view>
- <view class="list">
- <view class="lable">{{isType?'职业年限':'公司年限'}}:</view>
- <view class="input">
- <input type="text" v-model="list.careerYears" :placeholder="isType?'请输入职业年限':'请输入公司年限'" />
- </view>
- </view>
- <view class="list">
- <view class="lable">保荐人:</view>
- <view class="input">
- <input type="text" v-model="list.sponsor" placeholder="请输入保荐人" />
- </view>
- </view>
- </view>
- <view class="img">
- <p>{{isType?'半身照':'品牌logo'}}:</p>
- <view class="photo" @click='pic'>
- <img :src="list.img" v-if="list.img" />
- <img src="@/static/img/k.png" v-else>
- </view>
- </view>
- <view class="button" @click="eject">
- 提交申请
- </view>
- <view class="gradeList" v-if="isEject">
- <view class="title">
- 选择会员
- </view>
- <view class="grade" v-for="( g,index ) in gradeList" @click="chooseGradeList(g,index)">
- <view style="width: 230rpx;">{{ g.name }}</view>
- <view class="right">
- {{ g.price == 0 ? '': g.price }}
- <view class="border">
- <view v-if="chooseGrade == index" class="xzTip"></view>
- </view>
- </view>
- </view>
- <view class="gradeButton" @click="type == 1?submit1():submit2()">
- 确定提交
- </view>
- </view>
- <view class="bg" v-if="isEject" @click="isEject = false"></view>
- </view>
- </template>
- <script>
- import {
- apply,
- getPrice,
- uploads
- } from '../../api/apply.js'
- import {
- getUserInfo
- } from '../../api/login.js'
- import {
- mapMutations,
- mapState
- } from 'vuex';
- import {
- saveUrl,
- interceptor
- } from '@/utils/loginUtils.js';
- import pickerAddress from '@/components/wangding-pickerAddress/wangding-pickerAddress.vue';
- import weixinObj from '@/plugin/jweixin-module/index.js';
- export default {
- components: {
- pickerAddress
- },
- data() {
- return {
- list: {
- name: '', // 姓名/企业单位
- id: '', // 身份证号/企业统一代码
- phone: '', // 联系方式
- location: '', // 所在地区
- address: '', // 详细地址
- occupation: '', // 职业/主营领域
- careerYears: '', // 职业年限/公司年限
- sponsor: '', // 保荐人
- img: '', // 半身照/品牌logo
- pay_type: 'weixin', //weixin:微信支付,yue:余额支付
- grade: '' // 等级
- },
- province: '', // 省
- city: '', // 市
- district: '', // 区
- type: '', // 1代表个人会员2代表企业会员
- isEject: false, //会员价格弹窗
- gradeList: [],
- chooseGrade: 0,
- money: 0.0, //订单金额
- // // #ifdef H5
- // froms: '', //保存h5中数据来源对象
- // // #endif
- // orderKey: '',
- // orderId: '', //保存订单id
- payLoding: false, //判断是否在支付中
- }
- },
- computed: {
- // #ifdef H5
- ...mapState(['weichatObj']),
- // #endif
- isType() {
- return this.type == 1
- },
- // 所在地区
- location() {
- return this.province + this.city + this.district
- },
- ...mapState('user', ['hasLogin'])
- },
- mounted() {
- this.price()
- },
- watch: {
- location() {
- this.list.location = this.location
- }
- },
- onLoad(options) {
- this.type = options.type;
- getUserInfo()
- },
- methods: {
- ...mapMutations('user', ['setInformation']),
- // 选择会员价格
- chooseGradeList(data, index) {
- this.chooseGrade = index
- this.list.grade = data.grade
- this.money = data.price
- console.log(this.list)
- },
- // 会员价格
- price() {
- getPrice({}, this.type).then(res => {
- this.gradeList = res.data
- this.list.grade = res.data[0].grade
- console.log(this.list)
- })
- },
- //会员价格选择
- eject() {
- this.isEject = true
- },
- // 个人申请提交
- submit1() {
- console.log('1')
- const obj = this;
- if (obj.payLoding) {
- return;
- }
- obj.payLoding = true;
- apply(obj.list, obj.type).then(res => {
- let da = res.data.result.jsConfig;
- let data = {
- timestamp: da.timestamp,
- nonceStr: da.nonceStr,
- package: da.package,
- signType: da.signType,
- paySign: da.paySign,
- success: function(res) {
- console.log(res)
- obj.paySuccessToP();
- obj.payLoding = false;
- },
- fail: () => {
- obj.payLoding = false;
- }
- };
- weixinObj.chooseWXPay(data);
- }).catch(res => {
- obj.payLoding = false;
- console.log(res)
- })
- },
- //企业申请
- submit2() {
- const obj = this;
- console.log('2')
- apply(obj.list, obj.type).then(res => {
- console.log(res)
- obj.paySuccessTo();
- }).catch(res => {
- console.log(res)
- })
- },
- // 上传图片
- pic() {
- console.log(this.hasLogin, '当前状态');
- if (this.hasLogin) {
- uploads().then(res => {
- console.log(res, '返回图片');
- this.list.img = res[0].url
- })
- } else {
- uni.showModal({
- title: "登陆",
- content: '您未登录!是否马上登录?',
- success: (e) => {
- // 判断是否点击确认按钮
- if (e.confirm) {
- // 保存当前页面地址
- saveUrl()
- // 跳转页面
- interceptor()
- }
- }
- })
- }
- },
- // 选中城市切换
- onCityClick({ data }) {
- this.province = data[0] + '/';
- this.city = data[1] + '/';
- this.district = data[2];
- },
- //提交申请成功
- paySuccessTo() {
- const that = this
- uni.showToast({
- title: '申请成功,请等待三个工作日审核',
- duration: 2000,
- position: 'top'
- });
- this.isEject = !this.isEject
- },
- // 个人申请提交申请成功
- paySuccessToP() {
- this.paySuccessTo()
- setTimeout(() => {
- uni.navigateTo({
- url: '/pages/apply/verification'
- })
- },500)
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- page {
- height: 100%;
- }
- body {
- background-color: #f3f3f3;
- }
- .information {
- background-color: #fff;
- margin: 0 10rpx;
- padding: 0 40rpx;
- border-radius: 20rpx 20rpx 0 0;
- font-size: 30rpx;
- }
- .list {
- display: flex;
- border-bottom: solid 1rpx #f3f3f3;
- .lable {
- padding: 20rpx;
- width: 270rpx;
- }
- img {
- padding-top: 26rpx;
- width: 0rpx;
- float: right;
- }
- .input {
- input {
- border: 0;
- width: calc(100% - 20rpx);
- font-size: 30rpx;
- padding: 20rpx;
- }
- }
- }
- .img {
- font-size: 30rpx;
- background-color: #fff;
- border-radius: 0 0 20rpx 20rpx;
- height: 340rpx;
- position: relative;
- margin: 0 10rpx;
- padding: 0 40rpx;
- p {
- padding: 20rpx;
- }
- img {
- width: 160rpx;
- }
- }
- .photo {
- width: 160rpx;
- height: 160rpx;
- margin: auto auto;
- }
- .button {
- position: fixed;
- bottom: 0;
- left: 0;
- width: 100%;
- text-align: center;
- color: #fff;
- background-color: #3b66f5;
- font-size: 30rpx;
- height: 100rpx;
- line-height: 100rpx;
- }
- .pickerAddress {}
- .pickerColor {
- color: #808080;
- }
- .gradeList {
- padding: 40rpx;
- width: 600rpx;
- left: calc(50% - 300rpx);
- position: absolute;
- top: 30%;
- border-radius: 20rpx;
- z-index: 99;
- background-color: #fff;
- .title {
- text-align: center;
- font-size: 36rpx;
- font-weight: bold;
- color: #333333;
- }
- .grade {
- text-align: center;
- display: flex;
- justify-content: space-between;
- padding: 40rpx 20rpx;
- }
- .right {
- display: flex;
- margin: auto 0;
- }
- .border {
- margin: auto 15rpx;
- width: 20rpx;
- height: 20rpx;
- border-radius: 50%;
- border: solid 1rpx #3b66f5;
- .xzTip {
- width: 12rpx;
- height: 12rpx;
- margin-top: 2rpx;
- margin-left: 2rpx;
- border-radius: 50%;
- background-color: #3b66f5;
- }
- }
- }
- .bg {
- position: absolute;
- top: 0;
- left: 0;
- background-color: rgba(0, 0, 0, 0.5);
- width: 100%;
- height: 100%;
- z-index: 98;
- }
- .gradeButton {
- padding: 10rpx;
- background-color: #3b66f5;
- color: #fff;
- width: 80%;
- margin: 0 auto;
- border-radius: 10rpx;
- font-size: 32rpx;
- text-align: center;
- }
- </style>
|