123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445 |
- <template>
- <view class="join">
- <view class="banner">
- <image src="../../static/other/banner.png" mode=""></image>
- </view>
- <view class="top">
- <view class="content">
- <view class="page-section">
- <view class="name">您的姓名</view>
- <view class="inp">
- <!-- <input class="weui-input" v-model="form.cName" placeholder="请输入姓名,最多四个字" /> -->
- <u-input v-model="form.cName" :type="type" placeholder="输入您的姓名" maxlength='4' />
- </view>
- </view>
- <view class="page-section">
- <view class="name">您的性别</view>
- <u-radio-group v-model="changeSex" @change="radioGroupChange">
- <u-radio @change="radioChange" v-for="(item, index) in sex" :key="index" :name="item.label"
- :disabled="item.disabled">
- {{item.label}}
- </u-radio>
- </u-radio-group>
- <!-- <view class="sex" @click="isShow = true">
- {{changeSex}}
- <u-select v-model="isShow" :list="sex" @confirm="confirm"></u-select>
- </view> -->
- </view>
- <view class="page-section">
- <view class="name">手机号:</view>
- <view class="inp">
- <!-- <input class="weui-input" v-model="form.cPhone" placeholder="请输入手机号" /> -->
- <u-input v-model="form.cPhone" placeholder="请输入手机号" maxlength='11' />
- </view>
- </view>
- <view class="page-section">
- <view class="name">入驻城市</view>
- <view class="inp select" @click="show = true">
- <text>{{form.city}}</text>
- <img src="../../static/identify/down.png" alt="" />
- <!-- <view class="city" @click="selectCity" v-if="form.city == ''">
- 入驻城市
- </view>
- <view class="city" @click="selectCity" v-else>
- {{form.city}}
- </view> -->
- <!-- <view class="city" v-if="form.city == ''">
- 选择所在城市(自动定位)
- </view> -->
- <!-- <view class="city" v-else @click="goCity"> -->
- <!-- <view class="city" v-else>
- {{form.city}}市
- </view> -->
- <!-- <input class="weui-input" v-model="form.cNickName" placeholder="请输入昵称" /> -->
- <!-- <u-input v-model="form.cNickName" :type="type" placeholder="请输入昵称" maxlength = '4'/> -->
- </view>
- <u-select v-model="show" :list="citylist" @confirm="select"></u-select>
- </view>
- <!-- <view class="page-section">
- <view class="name">您所在的位置:</view>
- <view class="weui-cells weui-cells_after-title location" @click="getAddress">
- <text class="point" v-if="!form.address">请选择</text>
- <text class="point active" v-else>{{form.address}}{{form.name}}</text>
- </view>
- </view> -->
- <view class="updata" style="border:0;">
- <view class="name">工作形象照</view>
- <view class="title">
- 请上传本人近期照片,图片大小不超过10M (建议清晰正脸照)
- </view>
- <view class="images">
- <u-upload :action="uploadUrl" :header="header" :max-count="2" :file-list="LifeList"
- @on-success="handleUploadSuccess" @on-remove="handleUploadRemove"></u-upload>
- </view>
- </view>
-
- </view>
- <view class="submits">
- <text>平台不会通过任何渠道泄漏你的个人信息,请放心输入</text>
- <view class="btn" @click="submit">
- 申请成为商户
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- addEngineer,
- project,
- UpdateEngine,
- engineDetail,
- getInfo,
- imgUpload,
- getCityList
- } from '../.././api/index.js'
- import uUpload from 'uview-ui/components/u-upload/u-upload.vue';
- export default {
- data() {
- return {
- citylist: [],
- show: false,
- isLogin: false,
- type: 'text',
- LifeList: [],
- // uploadUrl: 'https://test.baoxianzhanggui.com/nightFragrance/common/upload',
- uploadUrl:'https://city.baoxianzhanggui.com/nightFragrance/common/upload',
- isShow: false,
- sex: [{
- value: '1',
- label: '男'
- },
- {
- value: '0',
- label: '女'
- }
- ],
- changeSex: '女',
- form: {
- id: '',
- cName: '',
- cNickName: '',
- cPortrait: '',
- cPhone: '',
- cJianjie: '',
- nSex: 0,
- cSfzImg: [],
- cImgList: [],
- latitude: '',
- longitude: '',
- name: '0',
- address: '',
- cOpenId: '',
- cBhList: '',
- city: '请选择'
- },
- token: '',
- }
- },
- onLoad() {
- uni.getStorage({
- key: 'access-token',
- success() {
- this.isLogin = true
- }
- })
- },
- onShow() {
- this.getinfo()
- this.getCity()
- // let city = uni.getStorageSync('selectCity')
- // let lastCity = city.charAt(city.length - 1)
- // lastCity == '市' ? this.form.city = city.slice(0, -1) : this.form.city = city
- // this.form.city = uni.getStorageSync('selectCity')
- },
- methods: {
- //选择性别
- radioChange(e) {
- this.changeSex = e[0].label
- this.form.nSex = e[0].value
- },
- //上传生活照
- handleUploadSuccess(response) {
- this.form.cImgList.push(response.fileName)
- },
- handleUploadRemove(index) {
- this.urlImg.splice(index, 1);
- this.form.cImgList.splice(index, 1)
- },
- goCity() {
- uni.navigateTo({
- url: '/pages/identify/city?type=' + 'indent'
- })
- },
- getAddress() {
- uni.chooseLocation({
- success: res => {
- this.form.name = res.name;
- this.form.latitude = res.latitude;
- this.form.longitude = res.longitude;
- // this.form.address = res.address
- }
- });
- },
- getinfo() {
- getInfo().then(res => {
- if (res.data.code == 200) {
- this.isLogin = true
- // this.info = res.data.data,
- // this.dBalance = res.data.data.dBalance.toFixed(2)
- } else if (res.data.code == 401) {
- uni.showModal({
- title: '请先登录!',
- success: (res) => {
- if (res.confirm) {
- uni.switchTab({
- url: '/pages/my/my'
- })
- } else if (res.cancel) {
- return
- }
- }
- })
- }
- })
- },
- //提交
- submit() {
- var that = this
- // var openids = uni.getStorageSync('wx_copenid')
- // this.form.cOpenId = openids
- // this.form.cAddress =this.form.cAddress
- // this.form.nSex = this.index
- // this.form.cImgList = this.urlImg
- // this.form.cSfzImg = this.idCard
- // that.data.form.cBhList = that.data.form.cBhList.join(", ")
- if (this.form.cName == '') {
- uni.showToast({
- title: '请输入您的姓名',
- icon: 'none'
- })
- return
- }
- if (!/^1[3456789]\d{9}$/.test(this.form.cPhone)) {
- uni.showToast({
- title: '请输入正确的手机号',
- icon: 'none'
- });
- return;
- }
- if (this.form.city == '') {
- uni.showToast({
- title: '请选择所在城市',
- icon: 'none'
- });
- return
- }
- if (this.form.cImgList.length < 1) {
- uni.showToast({
- title: '最少上传一张生活照片',
- icon: 'none'
- });
- return
- } else {
- addEngineer(this.form).then(res => {
- if (res.data.code == 200) {
- uni.showToast({
- title: "申请成功",
- })
- setTimeout(() => {
- uni.navigateBack()
- }, 1000)
- } else if (res.data.code == 401) {
- uni.showModal({
- title: '请先登录!',
- success: (res) => {
- if (res.confirm) {
- uni.switchTab({
- url: '/pages/my/my'
- })
- } else if (res.cancel) {
- return
- }
- }
- })
- } else {
- uni.showToast({
- title: res.data.msg,
- icon: 'none'
- })
- }
- })
- }
- },
- getCity() {
- getCityList().then(res => {
- this.citylist = res.data.data.map(({
- deptId,
- deptName
- }) => ({
- value: deptId,
- label: deptName
- }))
- });
- },
- selectCity() {
- this.show = true
- },
- select(e) {
- this.form.city = e[0].label
- this.form.deptId = e[0].value
- },
- },
- computed: {
- header() {
- return {
- Authorization: `tf: ${this.token}`, // 携带Token的请求头
- };
- },
- },
- mounted() {
- this.token = uni.getStorageSync('access-token'); // 假设token保存在本地缓存中
- }
- }
- </script>
- <style lang="scss" scoped>
- ::v-deep .uni-input-wrapper {
- width: 150px;
- text-align: right;
- }
- ::v-deep .u-input__input {
- min-height: 14px !important;
- }
- .join {
- width: 100%;
- .banner {
- width: 100%;
- height: 424rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .top {
- width: 100%;
- height: 100px;
- padding: 32rpx;
- box-sizing: border-box;
- margin-top: 44rpx;
- background-color: #FDFDFD;
- .content {
- width: 100%;
- height: auto;
- padding: 24rpx 32rpx;
- box-sizing: border-box;
- background: #FFFFFF;
- box-shadow: 0px 4px 12px 0px rgba(209, 168, 88, 0.1);
- border-radius: 24px 24px 24px 24px;
- .page-section {
- width: 100%;
- margin-bottom: 32rpx;
- // height: 80rpx;
- // padding: 20rpx 0px;
- // display: flex;
- // align-items: center;
- // justify-content: space-between;
- // border-bottom: 1px solid #ccc;
- font-size: 28rpx;
- .name {
- width: 31%;
- }
- .inp {
- width: 100%;
- height: 64rpx;
- border-radius: 8rpx 8rpx 8rpx 8rpx;
- border: 2rpx solid #EEEEEE;
- padding: 0px 24rpx;
- box-sizing: border-box;
- margin-top: 20rpx;
- //
- ::v-deep .u-input {
- width: 100% !important;
- height: 100% !important;
- .u-input__input {
- width: 100% !important;
- height: 100% !important;
- .uni-input-wrapper {
- width: 100% !important;
- height: 100% !important;
- text-align: left;
- }
- }
- }
- }
- .select{
- width: 100%;
- display: flex;
- justify-content: space-between;
- align-items: center;
- text{
- width: auto;
- color: #333333;
- }
- img{
- width: 28rpx;
- height: 28rpx;
- }
- }
- }
- .updata {
- margin-top: 20rpx;
- width: 100%;
- font-size: 28rpx;
- .images {
- margin-top: 20rpx;
- }
- .title{
- font-size: 22rpx;
- color: #999999;
- }
- }
- }
- .submits {
- width: 100%;
- margin-top: 28rpx;
- text{
- display: block;
- width: 100%;
- text-align: center;
- font-size: 22rpx;
- color: #999999;
- }
- .btn {
- width: 90%;
- height: 84rpx;
- text-align: center;
- background: linear-gradient( 90deg, #BFA061 0%, #BD9961 100%);
- border-radius: 14rpx 14rpx 14rpx 14rpx;
- margin: 16rpx auto;
- line-height: 84rpx;
- color: #ffffff;
- }
- }
- }
- }
- </style>
|