DocRegisterIndex.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. <template>
  2. <view class="content">
  3. <view class="content_box">
  4. <view class="examine_list">
  5. <view class="examine_name">个人简介</view>
  6. <view class="textarea-box">
  7. <textarea class="textarea" v-model="introduction" maxlength="-1" placeholder-style="color:#999999" placeholder="如:学历、毕业学校、工作经验、学术兼职、荣誉称号"
  8. @blur="bindTextAreaBlur" auto-height />
  9. </view>
  10. </view>
  11. </view>
  12. <view class="content_box">
  13. <view class="examine_list">
  14. <view class="examine_name">擅长领域</view>
  15. <view class="textarea-box">
  16. <textarea class="textarea" v-model="good_at" maxlength="-1" placeholder-style="color:#999999" placeholder="如:擅长什么手术、擅长什么疾病的治疗、对某某领域有研究、擅长什么操作。"
  17. @blur="bindTextAreaBlur1" auto-height />
  18. </view>
  19. </view>
  20. </view>
  21. <view class="content_box">
  22. <view class="">
  23. <view class="examine_name" @click="uploadoss">头像(正面免冠证件照)</view>
  24. <view class="examine_img">
  25. <image class="image1" :src="image" @click="scImg()" mode="widthFix"></image>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="content_box">
  30. <view class="">
  31. <view class="examine_name">从业资格证(工作胸牌、执业证书、资格证书选填一个)</view>
  32. <view class="add-img-box flex_item">
  33. <view class="add-img-item" v-for="(item, index) in imgList" :key="index">
  34. <image class="add-img" @click.stop="imgInfo(index)" :src="item.url" mode="widthFix"></image>
  35. <image class="add-img-del" @click.stop="delImg(index)" src="/static/img/delete.png"></image>
  36. </view>
  37. <view v-if="imgCount > 0" class="add-img-item" @click.stop="scImg1()">
  38. <image class="add-img" src="/static/img/add.png"></image>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="add-btn flex">
  44. <view class="btn-submit re-to" @click="reto">一键跳过</view>
  45. <view class="btn-submit" @click="confirm">提交申请</view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. import { client, uuid ,uploadoss} from '@/utils/alioss'
  51. import { mapState, mapMutations } from 'vuex';
  52. import { upload,setDoctorExt } from '@/api/index.js';
  53. import { getUserInfo } from '@/api/login.js';
  54. export default {
  55. data() {
  56. return {
  57. introduction:'',//个人简介
  58. good_at:'',//擅长领域
  59. image:'/static/img/add.png',//一寸免冠照片
  60. imgList: [],
  61. cloudimgList: [],
  62. imgCount:6//最多支持6张上传,可以修改
  63. };
  64. },
  65. onLoad() {
  66. },
  67. methods: {
  68. ...mapMutations(['setUserInfo']),
  69. /*医院*/
  70. //单张上传图片
  71. scImg(type) {
  72. let obj = this;
  73. upload({
  74. file: ''
  75. }).then(e => {
  76. obj.image = e[0].url;
  77. }).catch((e) => {
  78. });
  79. // uploadoss()
  80. },
  81. uploadoss() {
  82. uploadoss()
  83. },
  84. //多张上传图片
  85. scImg1() {
  86. let obj = this;
  87. upload({
  88. file: ''
  89. })
  90. .then(e => {
  91. obj.imgList = [...obj.imgList, ...e];
  92. console.log(obj.imgList,'imgList')
  93. obj.imgCount = 6 - obj.imgList.length;
  94. })
  95. .catch(e => {});
  96. },
  97. //点击图片显示大图
  98. imgInfo(i) {
  99. let tempList = [];
  100. console.log(111);
  101. this.imgList.forEach(e => {
  102. tempList.push(e.url);
  103. });
  104. console.log(tempList);
  105. //显示图片
  106. uni.previewImage({
  107. current: i,
  108. loop: false,
  109. urls: tempList,
  110. indicator: 'default'
  111. });
  112. },
  113. //删除图片
  114. delImg(i) {
  115. uni.showModal({
  116. content: '确定删除这张吗',
  117. success: res => {
  118. if (res.confirm) {
  119. this.imgList.splice(i, 1);
  120. this.imgCount++;
  121. } else if (res.cancel) {
  122. }
  123. }
  124. });
  125. },
  126. //文本输入框
  127. bindTextAreaBlur: function (e) {
  128. this.introduction = e.detail.value
  129. },
  130. //文本输入框
  131. bindTextAreaBlur1: function (e) {
  132. this.good_at = e.detail.value
  133. },
  134. reto(){
  135. // uni.switchTab({
  136. // url: '/pages/index/home'
  137. // })
  138. uni.navigateTo({
  139. url: '/pages/public/erweima'
  140. })
  141. },
  142. //提交
  143. confirm() {
  144. let obj = this;
  145. if(obj.image == '/static/img/add.png'){
  146. this.$api.msg('请上传正面免冠证件照!');
  147. return;
  148. }
  149. if (obj.imgList.length < 1) {
  150. uni.showToast({
  151. title: '请上传从业资格证',
  152. icon: 'none'
  153. });
  154. return;
  155. }
  156. for (let i = 0; i < obj.imgList.length; i++) {
  157. obj.cloudimgList.push(obj.imgList[i].url);
  158. }
  159. let arr = obj.cloudimgList.join(',');
  160. setDoctorExt({
  161. introduction:obj.introduction,
  162. good_at:obj.good_at,
  163. work_imgs:arr,
  164. photo:obj.image
  165. }).then(function(e) {
  166. obj.$api.msg(e.msg);
  167. //注册医生完成后更新用户信息
  168. obj.userInfo();
  169. setTimeout(function() {
  170. // uni.switchTab({
  171. // url: '/pages/index/home'
  172. // })
  173. // document.addEventListener(
  174. // "WeixinJSBridgeReady",
  175. // function() {
  176. // WeixinJSBridge.call("closeWindow");
  177. // },
  178. // false
  179. // );
  180. // //ios手机
  181. // WeixinJSBridge.call("closeWindow");
  182. uni.navigateTo({
  183. url: '/pages/public/erweima'
  184. })
  185. }, 2000);
  186. })
  187. .catch(e => {
  188. console.log(e)
  189. });
  190. },
  191. //选择身份后更新用户信息
  192. userInfo() {
  193. let obj = this;
  194. getUserInfo({})
  195. .then(function(e) {
  196. uni.setStorageSync('userInfo', e.data);
  197. })
  198. .catch(function(e) {
  199. console.log(e);
  200. });
  201. },
  202. }
  203. };
  204. </script>
  205. <style lang="scss">
  206. page {
  207. background: $page-color-base;
  208. min-height: 100%;
  209. }
  210. .content_box {
  211. background-color: #ffffff;
  212. padding: 0rpx 25rpx;
  213. width: 92%;
  214. margin: 25rpx auto;
  215. border-radius: 15rpx;
  216. .examine_list{
  217. width: 100%;
  218. .textarea-box{
  219. width: 95%;
  220. margin: 25rpx auto;
  221. .textarea{
  222. width: 100%;
  223. font-size: 28rpx;
  224. min-height: 150rpx;
  225. }
  226. }
  227. }
  228. }
  229. .row {
  230. display: flex;
  231. align-items: center;
  232. // position: relative;
  233. padding: 0 30rpx;
  234. height: 110rpx;
  235. background: #fff;
  236. border-bottom: 1rpx solid #f8f6f6;
  237. .tit {
  238. flex-shrink: 0;
  239. width: 180rpx;
  240. font-size: 30rpx;
  241. color: $font-color-dark;
  242. }
  243. .input {
  244. flex: 1;
  245. font-size: 30rpx;
  246. color: $font-color-dark;
  247. }
  248. .iconlocation {
  249. font-size: 36rpx;
  250. color: $font-color-light;
  251. }
  252. }
  253. .examine_name {
  254. color: #171717;
  255. font-size: 28rpx;
  256. padding: 25rpx 25rpx;
  257. }
  258. .examine_img {
  259. width: 100%;
  260. text-align: center;
  261. padding-bottom: 25rpx;
  262. .image{
  263. width: 150rpx;
  264. height: 150rpx;
  265. }
  266. .image1{
  267. min-width: 150rpx;
  268. max-width: 100%;
  269. min-height: 150rpx;
  270. }
  271. }
  272. .add-img-box {
  273. width: 100%;
  274. flex-direction: row;
  275. flex-wrap: wrap;
  276. margin-top: 50rpx;
  277. }
  278. .add-img-item {
  279. border-radius: 24rpx;
  280. position: relative;
  281. margin-bottom: 25rpx;
  282. .add-img {
  283. min-width: 150rpx;
  284. max-width: 100%;
  285. min-height: 150rpx;
  286. }
  287. }
  288. .add-img-del {
  289. position: absolute;
  290. width: 40rpx;
  291. height: 40rpx;
  292. right: 20rpx;
  293. // bottom: 155rpx;
  294. //background-color: rgba(238, 0, 0, 1);
  295. border-radius: 20rpx;
  296. }
  297. .default-row {
  298. margin-top: 16rpx;
  299. .tit {
  300. flex: 1;
  301. }
  302. switch {
  303. transform: translateX(16rpx) scale(0.9);
  304. }
  305. }
  306. .add-btn {
  307. width: 100%;
  308. font-size: $font-lg;
  309. color: #fff;
  310. line-height: 100rpx;
  311. text-align: center;
  312. position: fixed;
  313. bottom: 0;
  314. .btn-submit{
  315. width: 50%;
  316. background-color: #6786FB;
  317. }
  318. .re-to{
  319. background-color: #6A7289;
  320. }
  321. }
  322. .img_box {
  323. padding: 35rpx 35rpx;
  324. width: 250rpx;
  325. height: 250rpx;
  326. }
  327. .img_box image {
  328. width: 100%;
  329. height: 100%;
  330. }
  331. .alert-box {
  332. background-color: #ffffff;
  333. }
  334. .b-b:after {
  335. position: relative !important;
  336. }
  337. .check_box {
  338. padding: 25rpx 25rpx;
  339. font-size: 20rpx;
  340. padding-bottom: 150rpx;
  341. text{
  342. color: #6786FB;
  343. }
  344. }
  345. </style>