123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695 |
- <template>
- <view class="container register" :style="{ paddingTop: CustomBar + 'px' }">
- <cu-custom :navbar-data="nvabarData" @navigateBack="modal = true"></cu-custom>
- <view class="register-main clearfix">
- <view class="register-row clearfix">
- <view class="register-from">
- <view class="label">联系人</view>
- <input
- class="row-input"
- type="text"
- v-model="params.linkMan"
- placeholder="请输入联系姓名"
- placeholder-class="placeholder"
- maxlength="6"
- />
- </view>
- </view>
- <view class="register-row clearfix">
- <view class="register-from">
- <view class="label">机构名称</view>
- <input
- class="row-input"
- type="text"
- v-model="params.name"
- placeholder="请输入您的机构名称"
- placeholder-class="placeholder"
- maxlength="30"
- />
- </view>
- </view>
- <view class="register-row clearfix">
- <view class="register-from" @click="showMulLinkageThreePicker">
- <view class="label"><text>*</text>机构地址</view>
- <text class="row-input" :class="handleAddress === '请选择机构所在地区' ? 'none' : ''">
- {{ handleAddress }}
- </text>
- <text class="iconfont icon-xiangyou"></text>
- </view>
- </view>
- <view class="register-row text-textarea clearfix">
- <view
- class="textarea"
- v-if="isShowInput"
- placeholder-class="placeholder"
- @click="showTextareaFocus"
- >{{
- params.address ? params.address : '详细地址:如道路、门牌号、小区等'
- }}</view
- >
- <textarea
- v-else
- style="height: 120rpx;"
- class="textarea"
- type="text"
- v-model="params.address"
- placeholder="详细地址:如道路、门牌号、小区等"
- placeholder-class="placeholder"
- maxlength="25"
- @input="onTextareaInput"
- @focus="textareaFocus"
- @blur="hideTextareaFocus"
- :class="isShowInput ? '' : ''"
- />
- </view>
- <view class="register-row clearfix">
- <view class="register-from">
- <view class="label"><text>*</text>营业执照编号</view>
- <input
- class="row-input"
- type="text"
- v-model="params.socialCreditCode"
- placeholder="请填写社会统一信用代码"
- placeholder-class="placeholder"
- maxlength="18"
- />
- </view>
- </view>
- <view class="register-row clearfix">
- <view class="register-picture">
- <view class="label"><text>*</text>营业执照</view>
- <view class="upload-picture">
- <view class="upload-none" v-if="!params.businessLicense" @click="uploadFileImage(1)">
- <text class="iconfont icon-shangchuantupian"></text> <text>选择图片</text>
- </view>
- <view class="upload-image" v-else>
- <image
- :src="params.businessLicense"
- mode=""
- @click="handleViewImage(params.businessLicense)"
- ></image>
- <view class="upload-del" @click="handleDelete(1)">
- <text class="iconfont icon-shanchu"></text>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="register-row clearfix">
- <view class="register-picture">
- <view class="label"><text>*</text>门头照</view>
- <view class="upload-picture">
- <view class="upload-none" v-if="!params.shopPhoto" @click="uploadFileImage(2)">
- <text class="iconfont icon-shangchuantupian"></text> <text>选择图片</text>
- </view>
- <view class="upload-image" v-else>
- <image :src="params.shopPhoto" mode="" @click="handleViewImage(params.shopPhoto)"></image>
- <view class="upload-del" @click="handleDelete(2)">
- <text class="iconfont icon-shanchu"></text>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="register-row clearfix">
- <view class="register-picture">
- <view class="label"><text>*</text>医疗执业许可证</view>
- <view class="upload-picture">
- <view class="upload-none" v-if="!params.medicalPracticeLicense" @click="uploadFileImage(3)">
- <text class="iconfont icon-shangchuantupian"></text> <text>选择图片</text>
- </view>
- <view class="upload-image" v-else>
- <image
- :src="params.medicalPracticeLicense"
- mode=""
- @click="handleViewImage(params.medicalPracticeLicense)"
- ></image>
- <view class="upload-del" @click="handleDelete(3)">
- <text class="iconfont icon-shanchu"></text>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="register-fiexd clearfix" :style="{ paddingBottom: isIphoneX ? '68rpx' : '36rpx' }">
- <view class="register-row">
- <view class="register-btn sub" @click.stop="handleConfirm">确定</view>
- </view>
- </view>
- <!-- 地址 -->
- <mpvue-city-picker
- :themeColor="themeColor"
- ref="mpvueCityPicker"
- :pickerValueDefault="cityPickerValueDefault"
- @onCancel="onCancel"
- @onConfirm="onConfirm"
- >
- </mpvue-city-picker>
- <!-- 弹窗提示 -->
- <tui-modal
- :show="modal"
- @click="handleClick"
- @cancel="modal = false"
- :content="'确定放弃本次修改吗?'"
- :button="modalButton"
- color="#333"
- :size="32"
- shape="circle"
- :maskClosable="false"
- >
- </tui-modal>
- </view>
- </template>
- <script>
- import { mapMutations } from 'vuex'
- import mpvueCityPicker from '@/components/mpvue-citypicker/mpvueCityPicker.vue'
- import { uploadFileImage } from '@/services/public.js'
- var self
- export default {
- components: {
- mpvueCityPicker
- },
- data() {
- return {
- nvabarData: {
- // 顶部自定义导航
- showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
- showSearch: 0,
- title: '修改资料', // 导航栏 中间的标题
- haveBack: true,
- textLeft: this.$store.state.isIphone
- },
- isIphoneX: this.$store.state.isIphoneX,
- CustomBar: this.CustomBar, // 顶部导航栏高度
- isPreviewImage: false, // 预览图片开关
- modal:false,
- modalButton: [
- {
- text: '取消',
- type: 'gray',
- plain: true //是否空心
- },
- {
- text: '确认',
- customStyle: {
- color: '#fff',
- bgColor: '#F3B574'
- },
- plain: false
- }
- ],
- params: {
- name:'',
- linkMan:'',
- provinceId: '',
- cityId: '',
- townId:'',
- address: '',
- organizeType:1, //外部商城机构类型 0内部机构 1外部机构
- shopPhoto:'',
- businessLicense:'',
- medicalPracticeLicense:'',
- },
- textareaFocus: false,
- handleAddress:'请选择机构所在地区',
- }
- },
- onLoad(option) {
- this.updateModifyInfo()
- },
- methods: {
- hanldNavigateBack() {
- this.$util.modal('', '确定放弃本次修改吗?', '确定', '取消', true, () => {
- uni.navigateBack({
- delta: 1
- })
- })
- },
- async updateModifyInfo() {
- const resolve =await this.$api.getStorage()
- this.params.userId = resolve.userId ? resolve.userId : 0
- if(resolve.clubStatus === 92){
- this.isUnderLogin = true
- }
- try{
- const res =await this.UserService.OrganizationUpdateModifyInfo({ userId: this.params.userId })
- let club = res.data.club
- let user = res.data.user
- this.params.clubId = user.clubId
- this.handleAddress = club.provincialAddress ? club.provincialAddress : '请选择机构所在地区'
- this.params.name = club.name
- this.params.linkMan = club.linkMan
- this.params.provinceId = club.provinceId
- this.params.cityId = club.cityId
- this.params.townId = club.townId
- this.params.address = club.address
- this.params.organizeType = club.organizeType
- this.params.socialCreditCode = club.socialCreditCode
- this.params.shopPhoto = club.shopPhoto
- this.params.businessLicense = club.businessLicense
- this.params.medicalPracticeLicense = club.medicalPracticeLicense
- }catch(error){
- this.$util.msg(error.msg, 2000)
- }
- },
- handleConfirm(){
- // 提交审核
- if (this.params.linkMan == '') {
- this.$util.msg('请输入联系人名称', 2000)
- return
- }
- if (this.params.name == '') {
- this.$util.msg('请输入机构名称', 2000)
- return
- }
- if (this.params.townId == '') {
- this.$util.msg('请选择机构地址', 2000)
- return
- }
- if (this.params.addressDetail == '') {
- this.$util.msg('请填写机构详细地址', 2000)
- return
- }
- if (this.params.businessLicense == '') {
- this.$util.msg('请上传营业执照', 2000)
- return
- }
- if (this.params.shopPhoto == '') {
- this.$util.msg('请上传门头照', 2000)
- return
- }
- if (this.params.medicalPracticeLicense == '') {
- this.$util.msg('请上传医疗执业许可证', 2000)
- return
- }
- this.clubUpdate(this.params)
- },
- async clubUpdate(params) {
- // 修改资料
- try{
- await this.UserService.updateOrganize(params)
- this.$util.msg('保存成功', 2000)
- setTimeout(()=>{
- this.$api.navigateBack(1)
- },2000)
- }catch(error){
- this.$util.msg(error.msg, 2000)
- }
- },
- // 三级联动选择
- showMulLinkageThreePicker() {
- this.isShowInput = true
- this.$refs.mpvueCityPicker.show()
- },
- onConfirm(e) {
- this.addressData.address = e.name
- this.addressData.townId = e.townCode
- this.addressData.cityId = e.cityCode
- this.addressData.provinceId = e.provinceCode
- },
- onTextareaInput(e) {
- //文本框获取焦点
- this.addressData.addressDetail = e.detail.value
- },
- showTextareaFocus() {
- //文本框获取焦点
- this.isShowInput = false
- this.textareaFocus = true
- },
- hideTextareaFocus() {
- //文本框失去焦点
- this.isShowInput = true
- this.textareaFocus = false
- },
- onTextareaInputInfo(e) {
- this.profile = e.detail.value
- },
- //上传
- async uploadFileImage(type) {
- try {
- const res = await uploadFileImage()
- const data = JSON.parse(res.data).data
- switch (type) {
- case 1:
- this.params.businessLicense = data
- break
- case 2:
- this.params.shopPhoto = data
- break
- case 3:
- this.params.medicalPracticeLicense = data
- break
- }
- } catch (error) {
- console.log('error', error)
- }
- },
- //预览
- handleViewImage(url) {
- this.isPreviewImage = true
- let mentuzArray = []
- mentuzArray.push(url)
- uni.previewImage({
- urls: mentuzArray,
- current: 0
- })
- },
- //删除
- handleDelete(type) {
- switch (type) {
- case 1:
- this.$util.modal('', '确定删除营业执照图片吗?', '确定', '取消', true, () => {
- this.params.businessLicense = ''
- })
- break
- case 2:
- this.$util.modal('', '确定删除门头照图片吗?', '确定', '取消', true, () => {
- this.params.shopPhoto = ''
- })
- break
- case 3:
- this.$util.modal('', '确定删除资质图片吗?', '确定', '取消', true, () => {
- this.params.medicalPracticeLicense = ''
- })
- break
- }
- },
- handleClick(e) {
- //确认删除
- if (e.index == 1) {
- uni.navigateBack()
- }
- this.modal = false
- }
- },
- onShow() {
- if (this.isPreviewImage) {
- this.isPreviewImage = false
- return
- }
- }
- }
- </script>
- <style lang="scss">
- .placeholder {
- color: #b2b2b2;
- }
- .register {
- width: 100%;
- height: auto;
- border-top: 1px solid #f7f7f7;
- .model-warp.none {
- display: none;
- }
- .model-warp.show {
- display: block;
- }
- .register-main {
- width: 100%;
- height: auto;
- position: relative;
- padding:40rpx 0 300rpx 0;
- .register-consult {
- width: 110rpx;
- height: 68rpx;
- background: linear-gradient(223deg, rgba(225, 86, 21, 0.6) 0%, rgba(225, 86, 10, 0.3) 100%);
- border-radius: 34rpx 0 0 34rpx;
- position: absolute;
- right: 0;
- bottom: 120rpx;
- text-align: left;
- line-height: 68rpx;
- padding-left: 20rpx;
- .icon-kefunv {
- font-size: 48rpx;
- color: #31313b;
- float: left;
- }
- .text {
- font-size: $font-size-24;
- display: block;
- float: left;
- width: 60rpx;
- line-height: 30rpx;
- color: #ffffff;
- margin-top: 6rpx;
- }
- }
- &.detailed {
- padding-bottom: 330rpx;
- }
- .register-row {
- width: 100%;
- height: auto;
- padding: 0 24rpx;
- margin-bottom: 30rpx;
- box-sizing: border-box;
- &.none {
- margin-bottom: 0;
- }
- .register-from {
- width: 100%;
- height: 80rpx;
- background: #ffffff;
- position: relative;
- border-bottom: 1px solid #e1e1e1;
- .label {
- text-align: left;
- font-size: $font-size-28;
- color: #666666;
- line-height: 80rpx;
- float: left;
- text{
- color: #F85050;
- }
- }
- .row-input {
- width: 440rpx;
- padding-left: 24rpx;
- font-size: $font-size-28;
- color: $text-color;
- line-height: 80rpx;
- float: left;
- height: 80rpx;
- box-sizing: border-box;
- &.none {
- color: #999999;
- }
- &.code {
- width: 264rpx;
- }
- }
- .row-btn {
- width: 180rpx;
- height: 64rpx;
- float: left;
- background: $btn-confirm;
- padding: 0;
- border-radius: 32rpx;
- .row-input {
- width: 180rpx;
- height: 64rpx;
- line-height: 64rpx;
- padding: 0;
- color: #ffffff;
- background: $btn-confirm;
- text-align: center;
- border-radius: 32rpx;
- &.none {
- background: #f7f7f7;
- }
- }
- &.disabled {
- background: #f7f7f7;
- .row-input {
- background: #f7f7f7;
- color: #999999;
- font-size: 24rpx;
- }
- }
- }
- &.btn {
- margin-top: 0;
- }
- }
- .icon-xiangyou {
- width: 88rpx;
- height: 88rpx;
- position: absolute;
- right: 0;
- top: 0;
- line-height: 88rpx;
- text-align: center;
- }
- &.text-textarea {
- background: #ffffff;
- .textarea {
- width: 100%;
- height: 120rpx;
- padding:24rpx 0 ;
- font-size: $font-size-28;
- color: $text-color;
- z-index: 1;
- border-bottom: 1px solid #e1e1e1;
- }
- .textarea.hide {
- opacity: 0;
- }
- .textarea.show {
- color: #999999;
- }
- }
- }
- .register-picture {
- width: 100%;
- height: auto;
- float: left;
- .label {
- float: left;
- font-size: $font-size-28;
- color: $text-color;
- line-height: 80rpx;
- width: 100%;
- text-align: left;
- text{
- color: #F85050;
- }
- }
- .upload-picture {
- float: left;
- height: auto;
- .upload-none {
- width: 210rpx;
- height: 210rpx;
- border: 1px dashed #B2B2B2;
- border-radius: 10rpx;
- display: flex;
- justify-content: center;
- flex-direction: column;
- align-items: center;
- font-size: $font-size-28;
- color: #B2B2B2;
- line-height: 50rpx;
- .iconfont {
- font-size: $font-size-28;
- }
- }
- .upload-image {
- width: 210rpx;
- height: 210rpx;
- border-radius: 10rpx;
- margin: 0 20rpx;
- position: relative;
- image {
- width: 210rpx;
- height: 210rpx;
- border-radius: 10rpx;
- }
- .upload-del {
- width: 40rpx;
- height: 40rpx;
- position: absolute;
- top: -20rpx;
- right: -20rpx;
- line-height: 40rpx;
- text-align: center;
- .iconfont {
- font-size: $font-size-40;
- color: #F85050;
- }
- }
- }
- }
- }
- .register-input {
- width: 654rpx;
- height: 40rpx;
- padding: 24rpx;
- margin: 0 auto;
- margin-bottom: 60rpx;
- background: #f7f7f7;
- border-radius: 14rpx;
- .input {
- width: 100%;
- height: 100%;
- background: #f7f7f7;
- font-size: $font-size-28;
- line-height: 40rpx;
- color: #333333;
- border-radius: 14rpx;
- }
- }
- .register-btn {
- width: 100%;
- height: 88rpx;
- border-radius: 44rpx;
- font-size: $font-size-28;
- line-height: 88rpx;
- color: #ffffff;
- margin: 40rpx auto;
- text-align: center;
- background: $btn-confirm;
- &.none {
- border: 1px solid $color-system;
- background: #ffffff;
- color: $color-system;
- margin-top: 0;
- }
- }
- }
- }
- .register-fiexd {
- width: 100%;
- height: auto;
- padding: 20rpx 0;
- position: fixed;
- bottom: 0;
- left: 0;
- z-index: 99;
- background: #ffffff;
- .register-btn {
- width: 600rpx;
- height: 88rpx;
- border-radius: 44rpx;
- font-size: $font-size-28;
- line-height: 88rpx;
- color: #ffffff;
- margin: 0 auto;
- text-align: center;
- background: $btn-confirm;
- margin-top: 96rpx;
- &.none {
- background: #ffffff;
- color: $text-color;
- margin-top: 0;
- }
- &.sub {
- margin-top: 0;
- }
- }
- }
- checkbox .wx-checkbox-input {
- border-radius: 50%;
- width: 36rpx;
- height: 36rpx;
- }
- /* 选中后的 背景样式 */
- checkbox .wx-checkbox-input.wx-checkbox-input-checked {
- background: #F3B574;
- border: 2rpx solid #F3B574;
- }
- checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
- border-radius: 50%;
- width: 36rpx;
- height: 36rpx;
- line-height: 36rpx;
- text-align: center;
- font-size: 20rpx;
- color: #fff;
- transform: scale(0.8);
- -webkit-transform: translate(-50%, -50%) scale(1);
- }
- </style>
|