12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166 |
- <template>
- <div>
- <div class="feature ">
-
- <ul >
- <li @click="slideshow = true">
- <span>
- <img :src="new1" alt="" style="width:40px;height:40px">
- <p>轮播图</p>
- </span>
- </li>
- <li @click="hospitaAddress()">
- <span>
- <img :src="new2" alt="" style="width:40px;height:40px">
- <p>医院地址</p>
- </span>
- </li>
- <li @click="contact = true">
- <span>
- <img :src="new3" alt="" style="width:40px;height:40px">
- <p>联系方式</p>
- </span>
- </li>
- <li @click="time = true">
- <span>
- <img :src="new4" alt="" style="width:40px;height:40px">
- <p>工作时间</p>
- </span>
- </li>
- <li @click="type = true">
- <span>
- <img :src="new5" alt="" style="width:40px;height:40px">
- <p>乘车方式</p>
- </span>
- </li>
- </ul>
- </div>
- <!-- 新增轮播图 -->
- <el-dialog
- title="新增轮播图"
- :visible.sync="slideshow"
- width="50%"
- center>
- <el-form ref="rotationform" :model="rotationform" label-width="90px" :rules="rules" >
- <el-form-item label="模块标题:" required prop="title">
- <el-input v-model="rotationform.title"></el-input>
- </el-form-item>
- <el-form-item label="排序值:" required prop="sort">
- <el-input v-model="rotationform.sort" type="number"></el-input>
- <p class="tips">请输入1-99的整数,数值越小,模块排序越靠前</p>
- </el-form-item>
- <el-form-item label="添加图片:">
- <div class="flex-img">
- <div class="el-upload-list el-upload-list--picture-card" >
- <div class="el-upload-list__item is-success" v-for="(item,index) in this.rotationdata" :key="item.id">
- <img class="flex-img__image" :src="item.images">
- <label class="el-upload-list__item-status-label">
- <i class="el-icon-upload-success el-icon-check"></i>
- </label>
- <span class="el-upload-list__item-actions">
- <span class="el-upload-list__item-delete">
- <i class="el-icon-edit-outline" @click="editcenterDialogVisible = true;editRotationEmages(item.id)"></i>
- <i class="el-icon-delete" @click="deleteImages(item.id,index)"></i>
- </span>
- </span>
- </div>
- </div>
- <div class="addrot" @click="addVisible = true;showpic = false" v-show="isNoEpity">
- <div class="docone">
- <li class="el-icon-plus"></li>
- <div class="doctwo">
- <span>新增图片</span>
- </div>
- </div>
- </div>
- </div>
- <p class="tips">图片已上传{{totalImages}}张,最多上传9张</p>
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="slideshow = false">取 消</el-button>
- <el-button type="primary" @click="addrotationImage('rotationform')">确 定</el-button>
- </span>
- </el-dialog>
-
-
- <!-- 医院地址 -->
- <el-dialog
- title="新增医院地址"
- :visible.sync="hostaddress"
- width="35%"
- center>
- <el-form ref="hospitalform" :model="hospitalform" label-width="90px" :rules="rules">
- <el-form-item label="模块标题:" required prop="title">
- <el-input v-model="hospitalform.title" ></el-input>
- </el-form-item>
- <el-form-item label="排序值:" required prop="sort">
- <el-input v-model="hospitalform.sort" type="number"></el-input>
- <!-- <p class="tips">请输入1-99的整数,数值越小,模块排序越靠前</p> -->
- </el-form-item>
- <el-form-item label="医院地址:" required prop="address">
- <el-input v-model="hospitalform.address"></el-input>
- </el-form-item>
- <!-- <el-form-item label="医院地图:">
- <baidu-map>
- <bm-overview-map anchor="BMAP_ANCHOR_BOTTOM_RIGHT" :isOpen="true"></bm-overview-map>
- <bm-local-search :keyword="hospitalform.address" :auto-viewport="true" style="display:none" :center="location" :zoom="zoom"></bm-local-search>
- <bm-view class="map"></bm-view>
- </baidu-map>
- </el-form-item> -->
-
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="hostaddress=false">取 消</el-button>
- <el-button type="primary" @click="addHospital('hospitalform');">确 定</el-button>
- </span>
- </el-dialog>
-
-
- <!-- 新增联系方式 -->
- <el-dialog
- title="新增联系方式"
- :visible.sync="contact"
- width="550px"
- center>
- <el-form ref="contractform" :model="contractform" label-width="90px" :rules="rules">
- <el-form-item label="模块标题:" required prop="title">
- <el-input v-model="contractform.title"></el-input>
- </el-form-item>
- <el-form-item label="排序值:" required prop="sort">
- <el-input v-model="contractform.sort" type="number"></el-input>
- <p class="tips">请输入1-99的整数,数值越小,模块排序越靠前</p>
- </el-form-item>
- <el-form-item label="联系方式:">
- <div class="used">
- <ul>
- <li v-for="(item,index) in this.connectionway" :key="item.id">
- <span class="name">{{item.title}}</span>
- <span class="icon">
- <i class="el-icon-edit-outline" @click="editLink=true;editConnecWay(item.id)"></i>
- <i class="el-icon-delete" @click="deleteConnecWay(item.id,index)"></i>
- </span>
- </li>
- </ul>
- </div>
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="addLink = true">添加联系方式</el-button>
- <el-button @click="contact = false">取 消</el-button>
- <el-button type="primary" @click="addContract('contractform');">确 定</el-button>
- </span>
- </el-dialog>
-
- <!-- 添加联系方式内容 -->
- <el-dialog
- title="新增联系方式"
- :visible.sync="addLink"
- width="550px"
- >
- <el-form ref="connecform" :model="connecform" label-width="90px" :rules="rules" >
- <el-row>
- <el-col :span="20">
- <el-form-item label="标题:" required prop="title">
- <el-input v-model="connecform.title" style="width:400px"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-form-item label="联系方式:" required prop="connecway">
- <el-row>
- <el-col :span="20">
- <el-radio-group v-model="connecform.connecway">
- <el-radio :label="way.id" :value="way.id" v-for="(way,index) in connections" :key="index">{{way.name}}</el-radio>
- </el-radio-group>
- </el-col>
- </el-row>
- </el-form-item>
-
- <el-form-item label="内容:" required prop="content">
- <el-row>
- <el-col :span="20">
- <el-input v-model="connecform.content" style="width:400px"></el-input>
- </el-col>
- </el-row>'
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="addLink = false">取 消</el-button>
- <el-button type="primary" @click="addconnection('connecform');addLink = false">确 定</el-button>
- </span>
- </el-dialog>
-
- <!-- 编辑联系方式 -->
- <el-dialog
- title="编辑联系方式"
- :visible.sync="editLink"
- width="550px"
- >
- <el-form ref="editconnecform" :model="editconnecform" label-width="90px" :rules="rules" >
- <el-row>
- <el-col :span="20">
- <el-form-item label="标题:" required prop="title">
- <el-input v-model="editconnecform.title" style="width:400px"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-form-item label="联系方式:" required prop="connecway">
- <el-row>
- <el-col :span="20">
- <el-radio-group v-model="editconnecform.connecway">
- <el-radio :label="way.id" :value="way.id" v-for="(way,index) in connections" :key="index">{{way.name}}</el-radio>
- </el-radio-group>
- </el-col>
- </el-row>
- </el-form-item>
-
- <el-form-item label="内容:" required prop="content">
- <el-row>
- <el-col :span="20">
- <el-input v-model="editconnecform.content" style="width:400px"></el-input>
- </el-col>
- </el-row>'
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="editLink = false">取 消</el-button>
- <el-button type="primary" @click="saveConnecform('editconnecform')">确 定</el-button>
- </span>
- </el-dialog>
-
- <!-- 工作时间 -->
- <el-dialog
- title="新增工作时间"
- :visible.sync="time"
- width="550px"
- center>
- <el-form ref="woketimeform" :model="woketimeform" label-width="90px" :rules="rules">
- <el-form-item label="模块标题:" required prop="title">
- <el-input v-model="woketimeform.title"></el-input>
- </el-form-item>
- <el-form-item label="排序值:" required prop="sort">
- <el-input v-model="woketimeform.sort" type="number"></el-input>
- <p class="tips">请输入1-99的整数,数值越小,模块排序越靠前</p>
- </el-form-item>
- <el-form-item label="工作时间:" required prop="worktime">
- <el-input
- type="textarea"
- :rows="6"
- placeholder="请输入内容"
- v-model="woketimeform.worktime">
- </el-input>
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="time = false">取 消</el-button>
- <el-button type="primary" @click="addWorkTime('woketimeform');">确 定</el-button>
- </span>
- </el-dialog>
-
- <!-- 新增乘车方式 -->
- <el-dialog
- title="新增乘车方式"
- :visible.sync="type"
- width="550px"
- center>
- <el-form ref="rideform" :model="rideform" label-width="90px" :rules="rules" :label-position="labelPosition">
- <template>
- <el-form-item label="模块标题:" required prop="title">
- <el-input v-model="rideform.title"></el-input>
- </el-form-item>
- <el-form-item label="排序值:" required prop="sort">
- <el-input v-model="rideform.sort" type="number"></el-input>
- <p class="tips">请输入1-99的整数,数值越小,模块排序越靠前</p>
- </el-form-item>
- <el-form-item label="乘车方式:" required prop="content">
- <el-input
- type="textarea"
- :rows="6"
- placeholder="请输入内容"
- v-model="rideform.content">
- </el-input>
- </el-form-item>
- </template>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="type = false">取 消</el-button>
- <el-button type="primary" @click="addRideWay('rideform');">确 定</el-button>
- </span>
- </el-dialog>
-
-
-
- <!-- 编辑图片 -->
- <el-dialog
- class="avatar-uploader"
- title="编辑图片"
- :visible.sync="addVisible"
- width="30%"
- center>
- <el-form ref="picform" :model="picform" label-width="90px" :rules="rules">
- <el-form-item label="图片编辑:" required prop="Images">
- <el-col :span="5">
- <el-upload
- :data="Data"
- class="avatar-uploader"
- action="https://upload.qiniup.com/"
- :show-file-list="false"
- :on-success="RotationSuccess"
- :before-upload="RotationUpload"
- :limit="9">
- <img v-if="picform.Images" :src="picform.Images" class="avatar" style="width:100px;height:98px">
- <i v-else class="el-icon-plus avatar-uploader-icon"></i>
- </el-upload>
- </el-col>
- <!-- <el-col :span="19">
- <div class="tpic" v-show="showpic">
- <img :src="picform.Images" style="width:200px;height:100px">
- </div>
- </el-col> -->
- </el-form-item>
- <el-form-item label="排序值:" required prop="sort">
- <el-col :span="15">
- <el-input v-model="picform.sort" type="number"></el-input>
- </el-col>
- </el-form-item>
- <el-form-item label="图片链接:">
- <el-radio-group v-model="picform.piclink">
- <el-radio :label="gender.id" :value="gender.id" v-for="(gender, index) in genderOptions" :key="index" @change="selectGender(gender.id)">{{gender.name}}</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item label="链接地址:" v-show="definetwo">
- <el-col :span="10">
- <el-input v-model="picform.linkaddress" :disabled="true"></el-input>
- </el-col>
- <el-col :span="5">
- <el-button size="medium" @click="addVisibleThree = true">设置链接</el-button>
- </el-col>
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="addVisible = false">取 消</el-button>
- <el-button type="primary" @click="addrotationpic('picform');">确 定</el-button>
- </span>
- </el-dialog>
-
- <el-dialog
- title="添加图片"
- :visible.sync="addVisibletwo"
- width="30%"
- center>
- <el-form>
- <el-form-item label="添加图片:">
- <el-upload
- :data="Data"
- class="avatar-uploader"
- action="https://upload.qiniup.com/"
- :show-file-list="false"
- :on-success="RotationSuccess"
- :before-upload="RotationUpload">
- <div class="addimage">
- <img v-if="picform.Images" :src="picform.Images" class="avatar" style="width:100px;height:98px">
- <i v-else class="el-icon-plus avatar-uploader-icon"></i>
- </div>
- </el-upload>
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="addVisibletwo = false">取 消</el-button>
- <el-button type="primary" @click="addVisibletwo = false">确 定</el-button>
- </span>
- </el-dialog>
-
- <el-dialog
- title="设置图片链接地址:"
- :visible.sync="addVisibleThree"
- width="30%"
- center>
- <el-form label-width="120px" :model="linkform" ref="linkform">
- <el-form-item label="站外链接:">
- <el-input v-model="linkform.defineaddress"></el-input>
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="addVisibleThree = false">取 消</el-button>
- <el-button type="primary" @click="AddPiCLink('linkform');addVisibleThree = false">确 定</el-button>
- </span>
- </el-dialog>
-
- <el-dialog
- title="编辑轮播图"
- :visible.sync="editcenterDialogVisible"
- width="35%"
- center>
- <el-form label-width="90px" :model="editrotationform" ref="editrotationform">
- <el-form-item label="图片编辑">
- <el-col :span="5">
- <el-upload
- :data="rotationData"
- class="avatar-uploader"
- action="https://upload.qiniup.com/"
- :show-file-list="false"
- :on-success="handleAvatarSuccess"
- :before-upload="beforeAvatarUpload">
- <img v-if="editrotationform.images" style="width:100%;height:100px" :src="editrotationform.images" class="avatar">
- <i v-else class="el-icon-plus avatar-uploader-icon"></i>
- </el-upload>
- </el-col>
- </el-form-item>
- <el-form-item label="排序值:" required prop="sort">
- <el-col :span="24">
- <el-input v-model="editrotationform.sort" style="width:410px" type="number"></el-input>
- </el-col>
- </el-form-item>
- <el-form-item label="图片链接:">
- <el-radio-group v-model="editrotationform.piclink">
- <el-radio :label="gender.id" :value="gender.id" v-for="(gender, index) in genderOptions" :key="index" @change="select(gender.id)">{{gender.name}}</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item label="链接地址:">
- <el-col :span="15">
- <el-input v-model="editrotationform.linkaddress" style="width:300px" :disabled="true"></el-input>
- </el-col>
- <el-col :span="4">
- <el-button size="medium" @click="linkVisible = true;getOutRotationlink(editrotationform.linkid)" >设置链接</el-button>
- </el-col>
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="editcenterDialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="UpdatedConrotation('editrotationform')">确 定</el-button>
- </span>
- </el-dialog>
-
- <el-dialog
- title="设置图片链接地址"
- :visible.sync="linkVisible"
- width="30%"
- center>
- <el-form label-width="90px" ref="rotationformTwo" :model="rotationformTwo" :rules="rules">
- <el-form-item label="站外链接" required prop="defineaddress">
- <el-input v-model="rotationformTwo.defineaddress"></el-input>
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="linkVisible = false">取 消</el-button>
- <el-button type="primary" @click="UpdatedRolinkAddress('rotationformTwo')">确 定</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
-
-
- <script>
- import { getToken } from '@/api/qiniu'
- import { getFileExtension} from '@/utils/tools'
- import { addRotationUpload,addHospital,addRideWay,addWorkTime,addconnection,queryConnetion,deleteConnecWay,editConnecWay,
- saveConnecform,addContract,addrotationpic,GetRotationImages,addrotationImage,deleteImages,getArticleType,GetArticleById,GetAllActivity,
- AddPiCLink,editRotationEmages,GetOutRotationlink,UpdatedRolinkAddress,UpdatedConrotation} from '@/api/site/site'
- import { truncateSync } from 'fs';
- import {checkNumber} from "@/utils/tools";
- export default {
- name: "addcontact",
- data() {
- var checkNumberRule = (rule, value, callback) => {
- if (!checkNumber(value)) {
- callback(new Error('请输入1-99的整数'));
- }else {
- callback();
- }
- };
-
- return {
- location: {
- lng: 116.404,
- lat: 39.915
- },
- zoom: 12.8,
- keyword:"",
- show:false,
- imageUrl:false,
- dialogshow:false,
- slideshow:false,
- address:false,
- hostaddress:false,
- contact:false,
- addLink:false,
- editLink:false,
- time:false,
- type:false,
- disabled: false,
- dialogFormVisibleAdd:true,
- editcenterDialogVisible:false,
- showone:false,
- showtwo:false,
- showthree:false,
- showFour:false,
- showFive:false,
- linkVisible:false,
- definetwo:true,
- labelPosition: 'left',
- qiniuDomain: 'https://images.shengws.com/',
- Data: { token:'',key: '' },
- rotationData: { token:'',key: '' },
- new1: require("../../../assets/preview/轮播图.png"),
- new2: require("../../../assets/preview/医院地址.png"),
- new3: require("../../../assets/preview/联系方式.png"),
- new4: require("../../../assets/preview/工作时间.png"),
- new5: require("../../../assets/preview/公交.png"),
- form: {
- name: "",
- sort:"",
- title:"",
- },
- userlocation: {lng: "", lat: ""},
- rotationform:{
- title:"",
- sort:"",
- rotationImages:[],
- ids:[],
- },
- rotationdata:[],
- rideform:{
- title:"",
- sort:"",
- content:"",
- },
- woketimeform:{
- title:"",
- sort:"",
- worktime:"",
- },
- hospitalform:{
- title:"",
- sort:"",
- address:"",
- },
- connecform:{
- title:"",
- connecway:"",
- content:"",
- },
- editconnecform:{
- title:"",
- connecway:"",
- content:"",
- },
- connections:[
- {id:1,name:'电话'},
- {id:2,name:'非电话'},
- ],
- connectionway:[],
- contractform:{
- title:"",
- sort:"",
- },
- linkform:{
- defineaddress:"",
- },
- linkType:[
- {id:1,name:'无'},
- {id:2,name:'站内链接:'},
- {id:3,name:'站外链接:'},
- ],
- options:[
- {id:1,name:'文章'},
- {id:2,name:'活动'},
- ],
- editrotationform:{
- images:"",
- sort:"",
- piclink:1,
- linkaddress:"",
- linkid:"",
- },
- rotationformTwo:{
- id:"",
- defineaddress:"",
- },
- rules: {
- title: [{required: true, message: "请填写模块标题",},],
- sort: [{required: true,message:"请填写排序值"},{validator:checkNumberRule}],
- rotationImages:[{required:true,message:"请填写添加图片"}],
- content:[{required:true,message:"请填写乘车方式"}],
- worktime:[{required:true,message:"请填写工作时间"}],
- connecway:[{required:true,message:"请选择联系方式"}],
- linkaddress:[{required:true,message:"请填写链接地址"}],
- address:[{required:true,message:"请填写医院地址"}],
- Images:[{required:true,message:"请上传图片"}],
- defineaddress:[{required:true,message:"请填写站外链接"}]
- },
- addVisible:false,
- addVisibletwo:false,
- addVisibleThree:false,
- picform:{
- sort:"",
- Images:"",
- piclink:2,
- linkaddress:"",
- linkid:"",
- },
- showpic:false,
- genderOptions:[
- {id:1, name:'无'},
- {id:2, name:'自定义'},
- ],
- genderPicLink:[
- {id:1,name:"自定义"},
- {id:2,name:"不跳转"},
- ],
- define:false,
- articeTypelist:[],
- articeNamelist:[],
- isNoEpity:true,
- totalImages:0,
- };
- },
- methods:{
- changeInput(e){
- this.$forceUpdate();
- },
- selectGender(id){
- if(id == 1){
- this.definetwo = false;
- }
- if(id == 2){
- this.definetwo = true;
- }
- },
- selectItem(id){
- if(id == 1){
- this.showone = false;
- this.showtwo = false;
- this.showthree = false;
- this.showFour = false;
- this.showFive = false;
- }
- if(id == 2){
- this.showone = true;
- this.showtwo = false;
- this.showthree = false;
- this.showFive = true;
- }
- if(id == 3){
- this.showone = false;
- this.showtwo = false;
- this.showthree = true;
- this.showFive = false;
- }
- },
- changeType(id){
- if(id == 1){
- this.showFour = true;
-
- }
- if(id == 2){
- this.showFour = false;
- GetAllActivity(this.articeNamelist).then(response=>{
- if(response.data.state == 1){
- var activtity = response.data.data.activtity;
- this.articeNamelist = response.data.data.activtity;
- }
- })
- }
- },
- GetArticleById(id){
- GetArticleById(id,this.linkform).then(response=>{
- if(response.data.state == 1){
- var articlelist = response.data.data.articlelist;
- this.articeNamelist = response.data.data.articlelist;
- }
- })
- },
- AddPiCLink(formName){
- this.$refs[formName].validate((valid)=>{
- if(valid){
- AddPiCLink(this.linkform).then(response=>{
- if(response.data.state == 1){
- var conlinkaddress = response.data.data.conlinkaddress;
- console.log("conlinkaddress是什么",conlinkaddress)
- this.picform.linkaddress = conlinkaddress.defineaddress;
- this.picform.linkid = conlinkaddress.id;
- }
- })
- }
- })
- },
- RotationSuccess(res,file,filelist){
- this.picform.Images =this.qiniuDomain + res.url;
- this.showpic = true;
- },
- RotationUpload(file){
- var fileType = file.type
- const isJPG = fileType.indexOf("image") > -1;
- const isLt2M = file.size / 1024 / 1024 < 2;
- if (!isJPG) {
- this.$message.error("只能上传图片");
- return false;
- }
- if (!isLt2M) {
- this.$message.error("图片大小不能超过 2MB!");
- return false;
- }
-
- var date = new Date()
- var ext = getFileExtension(file.name)
- var key = date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours() + date.getMinutes() + date.getSeconds() +'_o_' + file.uid + '.' + ext;
- const _self = this
- return new Promise((resolve, reject) => {
- getToken().then(response => {
- const token= response.data.data.uptoken
- console.log("联系我们轮播图token是什么?",token)
- _self._data.Data.token = token;
- _self._data.Data.key = key;
- resolve(true)
- }).catch(err => {
- reject(false)
- })
- })
- return isJPG && isLt2M;
- },
-
- handleAvatarSuccess(res,file){
- this.editrotationform.images = this.qiniuDomain +res.url;
- console.log("是什么",this.editrotationform.imageUrl)
- },
- beforeAvatarUpload(file){
- var fileType = file.type
- const isJPG = fileType.indexOf("image") > -1;
- const isLt2M = file.size / 1024 / 1024 < 2;
- if (!isJPG) {
- this.$message.error("只能上传图片");
- return false;
- }
- if (!isLt2M) {
- this.$message.error("图片大小不能超过 2MB!");
- return false;
- }
-
- var date = new Date()
- var ext = getFileExtension(file.name)
- var key = date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours() + date.getMinutes() + date.getSeconds() +'_o_' + file.uid + '.' + ext;
- const _self = this
- return new Promise((resolve, reject) => {
- getToken().then(response => {
- const token= response.data.data.uptoken
- console.log("联系我们轮播图token是什么?",token)
- _self._data.rotationData.token = token;
- _self._data.rotationData.key = key;
- resolve(true)
- }).catch(err => {
- reject(false)
- })
- })
- return isJPG && isLt2M;
- },
-
- //新增医院地址
- addHospital(formName){
- var sorts = this.hospitalform.sort
- var sort = parseInt(sorts)
- this.hospitalform.sort = sort
- this.$refs[formName].validate((valid)=>{
- if(valid){
- addHospital(this.hospitalform).then(response=>{
- if(response.data.state ==1){
- this.hostaddress = false;
- var hosaddress = response.data.data.hosaddress;
- console.log('新增医院地址数据',hosaddress);
- this.$emit('getOrderModel');
- }
- })
- }
- })
- },
-
- //新增联系方式
- addconnection(formName){
- this.$refs[formName].validate((valid)=>{
- if(valid){
- addconnection(this.connecform).then(response=>{
- if(response.data.state==1){
- var cooection = response.data.data.connection;
- // console.log("返回数据",cooection);
- this.queryConnetion();
- this.connecform.title = "";
- this.connecform.content = "";
- }
- })
- }
- })
- },
-
- //获取联系方式
- queryConnetion(){
- queryConnetion().then(response=>{
- if(response.data.state ==1){
- this.connectionway = response.data.data.conection;
- // console.log("联系方式返回数据",this.connectionway);
- }
- })
- },
-
- //删除联系方式
- deleteConnecWay(id,index){
- this.$confirm('确定要删除该信息么?,删除后将无法恢复!',{
- dangerouslyUseHTMLString:true,
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(()=>{
- deleteConnecWay(id).then(response=>{
- if(response.data.state==1){
- this.connectionway.splice(index,1);
- }
- }).catch(e=>{});
- }).catch(e=>{});
- },
-
- //编辑联系方式
- editConnecWay(id){
- console.log("id是啥",id);
- editConnecWay(id).then(response=>{
- if(response.data.state == 1){
- this.editconnecform = response.data.data.connection;
- // console.log("返回数据",this.connecform);
- }
- })
- },
-
- //编辑保存后的联系方式
- saveConnecform(formName){
- this.$refs[formName].validate((valid)=>{
- if(valid){
- saveConnecform(this.editconnecform.id,this.editconnecform).then(response=>{
- if(response.data.state == 1){
- var connection = response.data.data.connection;
- // console.log("返回数据",connection);
- this.editLink =false;
- this.queryConnetion();
- }
- })
- }
- })
- },
-
- //添加联系方式
- addContract(formName){
- var sorts = this.contractform.sort
- var sort = parseInt(sorts)
- this.contractform.sort = sort
- this.$refs[formName].validate((valid)=>{
- if(valid){
- addContract(this.contractform).then(response=>{
- if(response.data.state == 1){
- this.contact = false;
- var connectway = response.data.data.connectway;
- var ordmodel = response.data.data.ordmodel;
- this.$emit('getOrderModel');
- // console.log("返回数据",connectway);
- // console.log("返回数据",ordmodel)
- }
- })
- }
- })
- },
-
- //添加工作时间
- addWorkTime(formName){
- var sorts = this.woketimeform.sort
- var sort = parseInt(sorts)
- this.woketimeform.sort = sort
- this.$refs[formName].validate((valid)=>{
- if(valid){
- addWorkTime(this.woketimeform).then(response=>{
- if(response.data.state==1){
- this.time = false;
- var ordmodel = response.data.data.ordmodel;
- var patientWorktime = response.data.data.patientWorktime
- // console.log("返回数据",ordmodel);
- // console.log("返回数据",patientWorktime)
- this.time = false;
- this.$emit('getOrderModel');
- }
- })
- }
- })
- },
-
- //添加乘车方式
- addRideWay(formName){
- var sorts = this.rideform.sort
- var sort = parseInt(sorts)
- this.rideform.sort = sort
- this.$refs[formName].validate((valid)=>{
- if(valid){
- addRideWay(this.rideform).then(response=>{
- if(response.data.state==1){
- var rideway = response.data.data.rideway;
- // console.log("返回数据",rideway);
- var ordemodel = response.data.data.ordemodel;
- // console.log("返回数据",ordemodel)
- this.type = false;
- this.$emit('getOrderModel');
- }
- })
- }
- })
- },
- hospitaAddress(){
- this.hostaddress = true;
- },
- addrotationpic(formName){
- if(this.picform.linkid == ""){
- this.picform.linkid = 0;
- }
- var sorts = this.picform.sort
- var sort = parseInt(sorts)
- this.picform.sort = sort
- this.$refs[formName].validate((valid)=>{
- if(valid){
- addrotationpic(this.picform).then(response=>{
- if(response.data.state ==1){
- this.addVisible = false;
- var conrotation = response.data.data.conrotation;
- var total = response.data.data.total;
- this.totalImages = total;
- if(total >=9){
- this.isNoEpity = false;
- }
- this.picform.Images = "";
- this.picform.sort = "";
- this.picform.linkaddress = "";
- this.GetRotationImages();
- }
- })
- }
- })
- },
- GetRotationImages(){
- GetRotationImages(this.picform.id).then(response=>{
- if(response.data.state == 1){
- var conrotations = response.data.data.conrotations;
- console.log("获取轮播图片",conrotations)
- this.rotationdata = response.data.data.conrotations;
-
- }
- })
- },
- addrotationImage(formName){
- var sorts = this.rotationform.sort;
- var sort = parseInt(sorts);
- this.rotationform.sort = sort;
- for (let index = 0; index < this.rotationdata.length; index++) {
- this.rotationform.rotationImages.push(this.rotationdata[index].images);
- this.rotationform.ids.push(this.rotationdata[index].id);
- }
- console.log("this.rotationform.raotationimages",this.rotationform.rotationImages)
- this.$refs[formName].validate((valid)=>{
- if(valid){
- addrotationImage(this.rotationform).then(response=>{
- if(response.data.state == 1){
- var oldrotation = response.data.data.oldrotation;
- this.slideshow = false;
- this.$emit('getOrderModel');
- this.rotationform.title = "";
- this.rotationform.sort = "";
- this.rotationdata = [];
- this.rotationform.ids = [];
- this.totalImages = 0;
- }
- })
- }
- })
- },
- deleteImages(id,imgshow,index){
- deleteImages(id).then(response=>{
- if(response.data.state == 1){
- this.rotationdata.splice(index,1);
- var total = response.data.data.total;
- this.totalImages = total;
- this.isNoEpity = true;
- }
- })
- },
-
- getArticleType(){
- getArticleType(this.articeTypelist).then(response=>{
- if(response.data.state == 1){
- var category = response.data.data.category;
- this.articeTypelist = response.data.data.category;
- console.log("文章分类是什么",this.articeTypelist)
- }
- })
- },
- editRotationEmages(id){
- editRotationEmages(id).then(response=>{
- if(response.data.state == 1){
- var conrotation = response.data.data.conrotation;
- this.editrotationform = conrotation;
- // console.log("conrotation是什么",conrotation)
- }
- })
- },
- getOutRotationlink(linkid){
- GetOutRotationlink(linkid).then(response=>{
- if(response.data.state == 1){
- var conlinkaddress = response.data.data.conlinkaddress;
- console.log("conlinkaddress",conlinkaddress)
- this.rotationformTwo.defineaddress = conlinkaddress.defineaddress;
- this.rotationformTwo.id = conlinkaddress.id;
- console.log("hh",this.rotationformTwo.defineaddress)
- console.log(this.rotationformTwo.id)
- }
- })
- },
-
-
-
- UpdatedRolinkAddress(formName){
- this.$refs[formName].validate((valid)=>{
- if(valid){
- UpdatedRolinkAddress(this.rotationformTwo.id,this.rotationformTwo).then(response=>{
- if(response.data.state == 1){
- this.linkVisible = false;
- var conlinkaddress = response.data.data.conlinkaddress;
- this.editrotationform.linkaddress = conlinkaddress.defineaddress;
- }
- })
- }
- })
- },
-
- UpdatedConrotation(formName){
- var sort = this.editrotationform.sort;
- var sorts = parseInt(sort);
- this.editrotationform.sort = sorts;
- this.$refs[formName].validate((valid)=>{
- if(valid){
- UpdatedConrotation(this.editrotationform.id,this.editrotationform).then(response=>{
- if(response.data.state == 1){
- this.editcenterDialogVisible = false;
- var conrotation = response.data.data.conrotation;
- conrotation.log("conrotation",conrotation)
- }
- })
- }
- })
- }
- },
- created(){
- this.queryConnetion();
- this.GetRotationImages();
- this.getArticleType();
- },
- };
- </script>
-
- <style rel="stylesheet/scss" lang="scss" scoped>
- .tpic{
- margin-left: 50px;
- }
- .map {
- width: 100%;
- height: 400px;
- }
- .tips {
- font-size: 12px;
- line-height: 18px;
- }
-
- .addrot{
- width: 100px;
- height: 100px;
- border: dashed 1px #409EFF;
- }
-
- .docone{
- width: 30px;
- height: 30px;
- // border: solid 1px red;
- margin-top: 30px;
- margin-left: 30px;
- font-size: 30px;
- }
- .doctwo{
- width: 70px;
- height: 30px;
- font-size: 14px;
- // border: solid 1px red;
- margin-left: -8px;
- margin-top: -10px;
- }
-
-
- .el-upload-list--picture-card .el-upload-list__item {
- overflow: hidden;
- background-color: #fff;
- border: 1px solid #c0ccda;
- border-radius: 6px;
- -webkit-box-sizing: border-box;
- box-sizing: border-box;
- width: 100px;
- height: 100px;
- margin: 0 8px 8px 0;
- display: inline-block;
- }
-
- .flex-img__image{
- width: 100%;
- height: 100%;
- }
-
- .addimage{
- width: 100px;
- height: 100px;
- border: dashed 1px #409EFF;
- font-size: 30px;
- }
-
- .avatar-uploader-icon{
- margin-top: 30px;
- margin-left: 25px;
- }
- .avatar-uploader{
- border-color: #409EFF;
- border:dashed 1px #409eff;
- width: 100px;
- height: 100px;
- }
-
- .avatar-uploader-icon {
- font-size: 28px;
- color: #8c939d;
- width: 50px;
- height: 50px;
- line-height: 50px;
- margin-left: 25px;
- margin-top: 25px;
- text-align: center;
- }
-
-
- .used {
- ul {
- li {
- height: 44px;
- line-height: 44px;
- font-size: 14px;
- display: flex;
- color: #606266;
- align-items: center;
- justify-content: space-between;
- border: 1px solid #e4e7ed;
- padding: 0 10px;
- margin-bottom: 10px;
- border-radius: 4px;
- i {
- font-size: 19px;
- margin: 0 6px;
- cursor: pointer;
- }
- }
- }
- }
- </style>
|