mechanism.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <template>
  2. <view class="content">
  3. <view class="content_box">
  4. <view class="row b-b">
  5. <text class="tit">机构名称</text>
  6. <input class="input" type="text" disabled="true" v-model="name" placeholder="请输入机构名称" placeholder-class="placeholder" />
  7. </view>
  8. <view class="row b-b">
  9. <text class="tit">联系电话</text>
  10. <input class="input" type="text" disabled="true" v-model="phone" placeholder="请输入联系电话" placeholder-class="placeholder" />
  11. </view>
  12. <view class="row b-b">
  13. <text class="tit">负责人</text>
  14. <input class="input" type="text" disabled="true" v-model="leader" placeholder="请输入负责人姓名" placeholder-class="placeholder" />
  15. </view>
  16. </view>
  17. <view class="content_box">
  18. <view class="row b-b"><!-- @tap="showPicker('region')" -->
  19. <text class="tit">省市区</text>
  20. <input class="input" disabled="disabled" v-model="addr" placeholder="请选择省市区"></input>
  21. </view>
  22. <w-picker mode="region" :value="defaultRegion" default-type="value" @confirm="onConfirm($event,'region')" @cancel="handleCancel" ref="region" ></w-picker>
  23. <view class="row b-b">
  24. <text class="tit">详细地址</text>
  25. <input class="input" type="text" v-model="address" disabled="true" placeholder="请输入商家地址" placeholder-class="placeholder" />
  26. </view>
  27. </view>
  28. <!-- <view class="content_box">
  29. <view class="examine_list">
  30. <view class="examine_name">营业执照</view>
  31. <view class="examine_img"><image :src="img" @click="scImg('img')"></image></view>
  32. </view>
  33. </view> -->
  34. <!-- <view class="add-btn" @click="confirm">提交申请</view> -->
  35. </view>
  36. </template>
  37. <script>
  38. import { mapState, mapMutations } from 'vuex';
  39. import uniList from '@/components/uni-list/uni-list.vue';
  40. import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
  41. import wPicker from "@/components/w-picker/w-picker.vue"
  42. import { setOrgan } from "@/api/index.js"
  43. import { getUserInfo } from '@/api/login.js';
  44. // import { upload } from '@/api/index.js';
  45. export default {
  46. components: {
  47. uniList,
  48. uniListItem,
  49. wPicker
  50. },
  51. data() {
  52. return {
  53. checked:false,
  54. name:'',//机构名称
  55. phone:"",
  56. region:'',
  57. defaultRegion:[],
  58. defaultRegion1:[],
  59. options:[],
  60. ext_info:'',
  61. leader :'',//负责人
  62. addr:'',//省市区
  63. address:'',//详细地址
  64. // img:'/static/img/add.png',
  65. };
  66. },
  67. onShow() {
  68. let obj = this;
  69. obj.ext_info = obj.userInfo.ext_info;
  70. console.log(obj.ext_info,88)
  71. obj.addr = obj.ext_info.province+ obj.ext_info.city + obj.ext_info.district;
  72. obj.address = obj.ext_info.detail_address;
  73. obj.name = obj.ext_info.name;
  74. obj.phone = obj.ext_info.mobile;
  75. obj.leader = obj.ext_info.leader
  76. obj.province = obj.ext_info.province;
  77. obj.city = obj.ext_info.city;
  78. obj.district = obj.ext_info.district;
  79. obj.province_id = obj.ext_info.province_id;
  80. obj.city_id = obj.ext_info.city_id;
  81. obj.district_id = obj.ext_info.district_id;
  82. },
  83. computed: {
  84. ...mapState(['userInfo'])
  85. },
  86. methods: {
  87. ...mapMutations(['setUserInfo']),
  88. //省市区弹窗
  89. showPicker(type){
  90. this.$refs[type].show();
  91. },
  92. // scImg(item) {
  93. // upload({
  94. // file: ''
  95. // }).then(e => {
  96. // }).catch((e) => {
  97. // });
  98. // },
  99. //阅读并同意
  100. //取消弹窗
  101. handleCancel(){
  102. },
  103. //省市区选择确定
  104. onConfirm(res,type){
  105. let obj = this;
  106. obj.result=res;
  107. obj.addr = res.result;
  108. if(res.name){
  109. obj.province = res.name[0];
  110. obj.city = res.name[1];
  111. obj.district = res.name[2];
  112. }
  113. obj.province_id = res.value[0];
  114. obj.city_id = res.value[1];
  115. obj.district_id = res.value[2];
  116. obj.hospital = '';//重置医院
  117. console.log(obj.addr)
  118. console.log(obj.province,obj.city,obj.district)
  119. console.log(obj.province_id,obj.city_id,obj.district_id)
  120. // obj.ListDate();
  121. },
  122. //提交
  123. confirm() {
  124. let obj = this;
  125. setOrgan({
  126. name: obj.name,
  127. mobile: obj.phone,
  128. province: obj.province,
  129. province_id: obj.province_id,
  130. city: obj.city,
  131. city_id: obj.city_id,
  132. district: obj.district,
  133. district_id: obj.district_id,
  134. leader:obj.leader,
  135. detail_address:obj.address,
  136. latitude:1,
  137. longitude:1
  138. })
  139. .then(function(e) {
  140. obj.$api.msg(e.msg);
  141. obj.GetUser();
  142. setTimeout(function() {
  143. uni.switchTab({
  144. url:'/pages/user/user'
  145. })
  146. }, 500);
  147. })
  148. .catch(e => {
  149. console.log(e)
  150. });
  151. },
  152. GetUser() {
  153. let obj = this;
  154. getUserInfo({})
  155. .then(function(e) {
  156. obj.setUserInfo(e.data);
  157. })
  158. .catch(function(e) {
  159. console.log(e);
  160. });
  161. },
  162. }
  163. };
  164. </script>
  165. <style lang="scss">
  166. page {
  167. background: $page-color-base;
  168. padding-top: 25rpx;
  169. }
  170. .content_box {
  171. background-color: #ffffff;
  172. width: 92%;
  173. margin: 0rpx auto;
  174. border-radius: 15rpx;
  175. margin-bottom: 25rpx;
  176. }
  177. .row {
  178. display: flex;
  179. align-items: center;
  180. // position: relative;
  181. padding: 0 30rpx;
  182. height: 110rpx;
  183. background: #fff;
  184. border-bottom: 1rpx solid #f8f6f6;
  185. .tit {
  186. flex-shrink: 0;
  187. width: 180rpx;
  188. font-size: 30rpx;
  189. color: $font-color-dark;
  190. }
  191. .input {
  192. flex: 1;
  193. font-size: 30rpx;
  194. color: $font-color-dark;
  195. }
  196. .iconlocation {
  197. font-size: 36rpx;
  198. color: $font-color-light;
  199. }
  200. }
  201. .examine_name {
  202. color: #171717;
  203. font-size: 28rpx;
  204. padding: 25rpx 25rpx;
  205. }
  206. .examine_img {
  207. width: 100%;
  208. text-align: center;
  209. padding-bottom: 25rpx;
  210. }
  211. .examine_img image {
  212. width: 200rpx;
  213. height: 200rpx;
  214. }
  215. .default-row {
  216. margin-top: 16rpx;
  217. .tit {
  218. flex: 1;
  219. }
  220. switch {
  221. transform: translateX(16rpx) scale(0.9);
  222. }
  223. }
  224. .add-btn {
  225. position: fixed;
  226. bottom: 0rpx;
  227. width: 100%;
  228. height: 100rpx;
  229. font-size: $font-lg;
  230. color: #fff;
  231. background-color: #6786FB;
  232. line-height: 100rpx;
  233. text-align: center;
  234. }
  235. .img_box {
  236. padding: 35rpx 35rpx;
  237. width: 250rpx;
  238. height: 250rpx;
  239. }
  240. .img_box image {
  241. width: 100%;
  242. height: 100%;
  243. }
  244. .alert-box {
  245. background-color: #ffffff;
  246. }
  247. .b-b:after {
  248. position: relative !important;
  249. }
  250. .check_box {
  251. padding: 25rpx 25rpx;
  252. font-size: 28rpx;
  253. text{
  254. color: #6786FB;
  255. }
  256. }
  257. </style>