teamwork.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. <template>
  2. <view class="team_work">
  3. <view class="banner">
  4. <image src="../../static/other/work.jpg" mode=""></image>
  5. </view>
  6. <view class="content">
  7. <view class="center">
  8. <view class="title">
  9. 欢迎申请城市合伙人,请填写申请信息
  10. </view>
  11. <view class="city">
  12. <view class="left">
  13. <span>*</span>
  14. 意向代理城市(中国)
  15. </view>
  16. <view class="right">
  17. <u-input v-model="form.city" :type="type" placeholder="请输入城市名" maxlength='4' />
  18. </view>
  19. </view>
  20. <view class="introduce">
  21. 城市资源介绍
  22. <view class="inp">
  23. <textarea v-model="form.resource" cols="30" rows="3" placeholder="请输入城市资源介绍"></textarea>
  24. </view>
  25. </view>
  26. <view class="city">
  27. <view class="left">
  28. <span>*</span>
  29. 合伙人姓名
  30. </view>
  31. <view class="right">
  32. <u-input v-model="form.name" :type="type" placeholder="请输入姓名" maxlength='4' />
  33. </view>
  34. </view>
  35. <view class="city">
  36. <view class="left">
  37. <span>*</span>
  38. 手机
  39. </view>
  40. <view class="right">
  41. <u-input v-model="form.phoneNum" type="number" placeholder="请输入手机号码" />
  42. </view>
  43. </view>
  44. <view class="city">
  45. <view class="left">
  46. 公司
  47. </view>
  48. <view class="right">
  49. <u-input v-model="form.company" :type="type" placeholder="请输入公司名称" />
  50. </view>
  51. </view>
  52. <view class="select">
  53. <view class="head">是否从事过按摩行业</view>
  54. <u-radio-group v-model="value1">
  55. <u-radio @change="selectIsWork" v-for="(item, index) in isWork" :key="index" :name="item.name">
  56. {{item.name}}
  57. </u-radio>
  58. </u-radio-group>
  59. </view>
  60. <view class="select">
  61. <view class="head">有几年按摩行业管理经验</view>
  62. <u-radio-group v-model="value2">
  63. <u-radio @change="selectIsYear" v-for="(item, index) in workYear" :key="index" :name="item.name">
  64. {{item.name}}
  65. </u-radio>
  66. </u-radio-group>
  67. </view>
  68. <view class="select">
  69. <view class="head">是否正在经营实体门店</view>
  70. <u-radio-group v-model="value3">
  71. <u-radio @change="selectIsEntity" v-for="(item, index) in isWork" :key="index" :name="item.name">
  72. {{item.name}}
  73. </u-radio>
  74. </u-radio-group>
  75. </view>
  76. <view class="btn_box">
  77. <view class="">
  78. 提交后,我们会尽快和您取得联系。
  79. </view>
  80. <view class="btn" @click="submit">
  81. {{title}}
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. </template>
  88. <script>
  89. import {
  90. add,
  91. businessDevelopment,
  92. businessupdate
  93. } from '../../api/index'
  94. export default {
  95. data() {
  96. return {
  97. type: '',
  98. // isWork:0,
  99. isWork: [{
  100. name: '是',
  101. value: '1'
  102. },
  103. {
  104. name: '否',
  105. value: '0'
  106. }
  107. ],
  108. workYear: [{
  109. name: '1-3年',
  110. value: '1'
  111. },
  112. {
  113. name: '4-10年',
  114. value: '2'
  115. },
  116. {
  117. name: '10年以上',
  118. value: '2'
  119. }
  120. ],
  121. // u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
  122. value1: '',
  123. value2: '',
  124. value3: '',
  125. form: {
  126. city: '',
  127. company: '',
  128. isEntity: null,
  129. name: '',
  130. phoneNum: '',
  131. resource: '',
  132. years: null,
  133. id:''
  134. },
  135. title: '提交',
  136. updateId:''
  137. }
  138. },
  139. methods: {
  140. selectIsWork(e) {
  141. e == '是' ? this.form.isMassage = 1 : this.form.isMassage = 0;
  142. },
  143. selectIsYear(e) {
  144. this.form.years = e
  145. },
  146. selectIsEntity(e) {
  147. e == '是' ? this.form.isEntity = 1 : this.form.isEntity = 0;
  148. },
  149. getData() {
  150. let data = {}
  151. data.openId = uni.getStorageSync('wx_copenid')
  152. businessDevelopment(data).then(res => {
  153. this.form = res.data.data
  154. this.form.id = res.data.data.id
  155. this.title = '修改'
  156. res.data.data.isMassage == 0 ? this.value1 = '否' : this.value1 = '是'
  157. this.value2 = res.data.data.years
  158. res.data.data.isEntity == 0 ? this.value3 = '否' : this.value3 = '是'
  159. })
  160. },
  161. submit() {
  162. if (this.form.city == '') {
  163. uni.showToast({
  164. title: '请填写意向代理城市',
  165. icon: 'none'
  166. })
  167. return
  168. } else if (this.form.name == '') {
  169. uni.showToast({
  170. title: '请填写姓名',
  171. icon: 'none'
  172. })
  173. return
  174. } else if (this.form.phoneNum == '') {
  175. uni.showToast({
  176. title: '请填写手机号码',
  177. icon: 'none'
  178. })
  179. return
  180. } else if (!/^1[3456789]\d{9}$/.test(this.form.phoneNum)) {
  181. uni.showToast({
  182. title: '请输入正确的手机号',
  183. icon: 'none'
  184. });
  185. return;
  186. } else {
  187. if (this.title == '提交') {
  188. add(this.form).then(res => {
  189. if (res.data.code == 200) {
  190. uni.showToast({
  191. title: '已提交',
  192. icon: 'none'
  193. })
  194. setTimeout(() => {
  195. uni.navigateBack()
  196. }, 1000)
  197. } else {
  198. uni.showToast({
  199. title: res.data.msg,
  200. icon: 'none'
  201. })
  202. }
  203. })
  204. }else{
  205. businessupdate(this.form).then(res =>{
  206. if (res.data.code == 200) {
  207. uni.showToast({
  208. title: '已修改',
  209. icon: 'none'
  210. })
  211. setTimeout(() => {
  212. uni.navigateBack()
  213. }, 1000)
  214. } else {
  215. uni.showToast({
  216. title: res.data.msg,
  217. icon: 'none'
  218. })
  219. }
  220. })
  221. }
  222. }
  223. }
  224. },
  225. onShow() {
  226. this.getData()
  227. // uni.setStorageSync('access-token', 'eyJhbGciOiJIUzUxMiJ9.eyJ0ZjoiOiIwOGExYmJiNi1kY2ExLTRlYzktOWZlMy1kM2M3MTY1MmI0MWUifQ.ovvnC3-KzZ-c5BHfzB_5AtU4OKjHoMmHyOY5Y-YRsoJ14zkoGfqHpdBHgln6jhnsdIHNebsNspNNq_7-Mrl3Dw')
  228. }
  229. }
  230. </script>
  231. <style lang="scss" scoped>
  232. ::v-deep .uni-input-wrapper {
  233. width: 150px;
  234. text-align: right;
  235. font-weight: 400;
  236. }
  237. .team_work {
  238. width: 100%;
  239. height: 100%;
  240. display: flex;
  241. flex-direction: column;
  242. overflow-y: auto;
  243. .banner {
  244. width: 100%;
  245. image {
  246. width: 100%;
  247. }
  248. }
  249. .content {
  250. width: 100%;
  251. flex: 1;
  252. padding: 0px 20rpx;
  253. box-sizing: border-box;
  254. background-color: #f7f7f7;
  255. position: relative;
  256. display: flex;
  257. justify-content: center;
  258. .center {
  259. width: 93%;
  260. padding: 30rpx;
  261. padding-bottom: 50px;
  262. box-sizing: border-box;
  263. background-color: #fff;
  264. border-radius: 10rpx;
  265. position: absolute;
  266. top: -30px;
  267. .title {
  268. border-bottom: 1px solid #ccc;
  269. padding: 20rpx 0px;
  270. font-size: 30rpx;
  271. font-weight: 700;
  272. }
  273. .city {
  274. padding: 16rpx 0px;
  275. font-size: 30rpx;
  276. font-weight: 700;
  277. border-bottom: 1px solid #ccc;
  278. display: flex;
  279. justify-content: space-between;
  280. align-items: center;
  281. box-sizing: border-box;
  282. .left {
  283. width: 60%;
  284. span {
  285. color: red;
  286. margin-right: 10rpx;
  287. }
  288. }
  289. .right {
  290. flex: 1;
  291. }
  292. }
  293. .introduce {
  294. font-size: 30rpx;
  295. font-weight: 700;
  296. padding-top: 10px;
  297. textarea {
  298. width: 100%;
  299. height: 80px;
  300. background-color: #f9f9f9;
  301. border-radius: 10px;
  302. padding: 15rpx;
  303. box-sizing: border-box;
  304. font-size: 26rpx;
  305. font-weight: 400;
  306. margin-top: 10px;
  307. }
  308. }
  309. .select {
  310. border-bottom: 1px solid #ccc;
  311. padding: 20rpx 0px;
  312. .head {
  313. margin-bottom: 10rpx;
  314. font-size: 30rpx;
  315. font-weight: 700;
  316. }
  317. }
  318. }
  319. .btn_box {
  320. margin-top: 20px;
  321. width: 100%;
  322. height: 50px;
  323. font-size: 26rpx;
  324. display: flex;
  325. flex-direction: column;
  326. align-items: center;
  327. .btn {
  328. width: 95%;
  329. height: 40px;
  330. text-align: center;
  331. background: linear-gradient(to right, #35c99d, #27aea7);
  332. margin: 10px auto;
  333. line-height: 40px;
  334. border-radius: 10px;
  335. color: #fcfdff;
  336. }
  337. }
  338. }
  339. }
  340. </style>