bindinfo.vue 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351
  1. <template>
  2. <view style="position: relative;">
  3. <!-- 胶囊 -->
  4. <mvBar :mysNavConfig="mysNavConfig"></mvBar>
  5. <view :style="{marginTop:navH}"></view>
  6. <view class="home">
  7. <view style="margin: 0 20rpx;">
  8. <uni-forms :rules="rules" :value="formData" ref="form" validate-trigger="bind"
  9. err-show-type="undertext">
  10. <view class="title">
  11. <p>个人资料</p>
  12. </view>
  13. <uni-forms-item name="age" label="年龄区间">
  14. <picker @change="bindPickerChange" :value="index" :range="array"
  15. range-key="age_bracket_discribe">
  16. <view>{{ Xage }}</view>
  17. </picker>
  18. </uni-forms-item>
  19. <uni-forms-item name="skintype" label="国籍">
  20. <picker @change="bindPickerChange1" :value="index1" :range="array1" range-key="name">
  21. <view>{{ array1[index1].name }}</view>
  22. </picker>
  23. </uni-forms-item>
  24. <uni-forms-item name="vregion" label="探店地区">
  25. <picker class="picker" mode="multiSelector" :range="region" range-key="name"
  26. :value="regionIndex" @change="pickerChange" @columnchange="pickerColumnchange">
  27. <view class="pbox" :class="{'pbox_hover':regionStr != '请选择省市区'}">
  28. <view>{{regionStr}}</view>
  29. <text class="iconfont icon-you"></text>
  30. </view>
  31. </picker>
  32. </uni-forms-item>
  33. <uni-forms-item name="phone" required label="联系电话">
  34. <uni-easyinput type="number" maxlength="11" :inputBorder="true" v-model="formData.phone"
  35. placeholder="请输入联系电话">
  36. </uni-easyinput>
  37. </uni-forms-item>
  38. <view class="line"></view>
  39. <view class="title">
  40. <p>收货地址</p>
  41. </view>
  42. <uni-forms-item name="name" required label="收件人">
  43. <uni-easyinput type="text" :inputBorder="true" v-model="formData.name" placeholder="请输入收件人">
  44. </uni-easyinput>
  45. </uni-forms-item>
  46. <uni-forms-item name="tel" required label="联系电话">
  47. <uni-easyinput type="number" maxlength="11" :inputBorder="true" v-model="formData.tel"
  48. placeholder="请输入联系电话">
  49. </uni-easyinput>
  50. </uni-forms-item>
  51. <uni-forms-item name="fregion" required label="所在地区">
  52. <picker class="picker" mode="multiSelector" :range="region" range-key="name"
  53. :value="regionIndex1" @change="pickerChange1" @columnchange="pickerColumnchange1">
  54. <view class="pbox" :class="{'pbox_hover':regionStr1 != '请选择省市区'}">
  55. <view>{{regionStr1}}</view>
  56. <text class="iconfont icon-you"></text>
  57. </view>
  58. </picker>
  59. </uni-forms-item>
  60. <uni-forms-item name="detailregion" required label="详细地址">
  61. <uni-easyinput type="text" :inputBorder="true" v-model="formData.detailregion"
  62. placeholder="请输入详细地址(省/市/县/镇/)">
  63. </uni-easyinput>
  64. </uni-forms-item>
  65. <view class="setdeault">
  66. <view class="setdeault-text">设为默认收货地址</view>
  67. <switch style='zoom:.8;' @change="setDefault" />
  68. </view>
  69. <view class="line"></view>
  70. <view class="title">
  71. <p>{{platform.platform_name}}账号</p>
  72. </view>
  73. <uni-forms-item name="nickname" required label="昵称">
  74. <uni-easyinput type="text" v-model="formData.platform_nickname" placeholder="请填写账号昵称">
  75. </uni-easyinput>
  76. </uni-forms-item>
  77. <uni-forms-item name="numberfans" required label="粉丝数">
  78. <uni-easyinput type="number" v-model="formData.fans_count" placeholder="请填写粉丝数量">
  79. </uni-easyinput>
  80. </uni-forms-item>
  81. <uni-forms-item name="home_link" required label=" " label-width='10'>
  82. <uni-easyinput class="home-link" type="text" v-model="formData.home_page_url"
  83. placeholder="请填写个人主页链接">
  84. </uni-easyinput>
  85. </uni-forms-item>
  86. <view style="margin-top: 40rpx;">
  87. <uni-forms-item name="home_img" required label="主页截图">
  88. <htz-image-upload :max="1" mediaType="image" name="file" :chooseNum="1" v-model="imageData"
  89. @chooseSuccess="ceshiChooseSuccess">
  90. </htz-image-upload>
  91. </uni-forms-item>
  92. </view>
  93. </uni-forms>
  94. </view>
  95. </view>
  96. <button class="btn1" @click="submitForm('form')">保存</button>
  97. </view>
  98. </template>
  99. <script>
  100. import region from '@/components/pca-code.json';
  101. import mvBar from "@/components/mys_navBar/mysNavBar";
  102. import htzImageUpload from '@/components/htz-image-upload/htz-image-upload.vue';
  103. import getPolicyEncode from '@/components/obs/getPolicy.js';
  104. import getSignature from '@/components/obs/GetSignature.js';
  105. export default {
  106. components: {
  107. mvBar,
  108. htzImageUpload,
  109. },
  110. data() {
  111. return {
  112. navH: getApp().globalData.navHeight,
  113. address: [],
  114. accountId: '',
  115. platform: {
  116. platform_id: '',
  117. platform_name: '',
  118. platform_icon: '',
  119. },
  120. isBind: true,
  121. imageData: [],
  122. ismodify: '',
  123. // 原数组
  124. oldRegion: region,
  125. // 处理后的数组
  126. region: [
  127. [],
  128. [],
  129. []
  130. ],
  131. // 选择省市区的下标Index 传则默认选中传递的
  132. regionIndex: [0, 0, 0],
  133. regionIndex1: [0, 0, 0],
  134. // 省市区字符串
  135. regionStr: '请选择省市区',
  136. regionStr1: '请选择省市区',
  137. formData: {
  138. age: '',
  139. nationality: '',
  140. phone: '',
  141. visitStoreRegion: '',
  142. name: '',
  143. tel: '',
  144. detailregion: '',
  145. fregion: '',
  146. setdefault: false,
  147. platform_nickname: '',
  148. fans_count: '',
  149. home_page_url: '',
  150. },
  151. index: 0,
  152. index1: 0,
  153. Xage: '请选择',
  154. Xskintype: '请选择',
  155. array: [{
  156. age_bracket_discribe: '请选择',
  157. age_aid: 0
  158. }, {
  159. age_bracket_discribe: '0~18',
  160. age_aid: 1
  161. }, {
  162. age_bracket_discribe: '18~25',
  163. age_aid: 2
  164. }, {
  165. age_bracket_discribe: '26~30',
  166. age_aid: 3
  167. }, {
  168. age_bracket_discribe: '30~40',
  169. age_aid: 4
  170. }, {
  171. age_bracket_discribe: '40+',
  172. age_aid: 5
  173. }],
  174. array1: [{
  175. name: '请选择',
  176. id: 0
  177. }, {
  178. name: '中国',
  179. id: 1
  180. }, {
  181. name: '外国',
  182. id: 2
  183. }],
  184. data: {},
  185. show: false,
  186. rules: {
  187. phone: {
  188. rules: [{
  189. required: true,
  190. errorMessage: '请输入联系电话'
  191. }, ]
  192. },
  193. detailregion: {
  194. rules: [{
  195. required: true,
  196. errorMessage: '请输入详细地址'
  197. }, ]
  198. },
  199. name: {
  200. rules: [{
  201. required: true,
  202. errorMessage: '请输入收件人'
  203. }, ]
  204. },
  205. tel: {
  206. rules: [{
  207. required: true,
  208. errorMessage: '请输入联系电话',
  209. }, ]
  210. },
  211. fregion: {
  212. rules: [{
  213. required: true,
  214. errorMessage: '请选择所在地区'
  215. }, ]
  216. },
  217. nickname: {
  218. rules: [{
  219. required: true,
  220. errorMessage: '请输入昵称'
  221. }, ]
  222. },
  223. numberfans: {
  224. rules: [{
  225. required: true,
  226. errorMessage: '请输入粉丝数'
  227. }, ]
  228. },
  229. home_link: {
  230. rules: [{
  231. required: true,
  232. errorMessage: '请输入主页链接'
  233. }, ]
  234. },
  235. home_img: {
  236. rules: [{
  237. required: true,
  238. errorMessage: '请选择主页截图'
  239. }, ]
  240. },
  241. },
  242. mysNavConfig: {
  243. /* 开启单页显示首页图标 */
  244. isHome: true,
  245. /* 固定导航 */
  246. navFixed: true,
  247. /* 标题 (屏幕中心居中 两边图标中心居中使用slot center1) */
  248. navTitle: {
  249. text: "个人信息",
  250. color: "",
  251. fontSize: "32rpx", // px upx rpx
  252. fontWeight: "normal", // 100 - 700
  253. },
  254. btnType: "type2",
  255. onLeftClick: '',
  256. /* type2 按钮 */
  257. type2Config: {
  258. // 左图标
  259. leftPath: "/static/img/png2.png",
  260. // 右图标
  261. rightPath: "/static/img/png4.png",
  262. // 圆角
  263. radius: "40rpx",
  264. },
  265. },
  266. }
  267. },
  268. onReady() {
  269. this.$refs.form.setRules(this.rules)
  270. },
  271. onShow() {
  272. this.initRegion()
  273. this.getDefaultAddress()
  274. this.getlist()
  275. },
  276. onLoad(options) {
  277. this.platform.platform_id = parseInt(options.platform_id)
  278. if (options.account_id) {
  279. this.accountId = parseInt(options.account_id)
  280. this.isBind = false
  281. }
  282. },
  283. methods: {
  284. initRegion() {
  285. // 声明城市数组
  286. let cityArr = [];
  287. let countyArr = [];
  288. // 设置下标
  289. this.regionIndex = [0, 0, 0];
  290. // 改变城市列表
  291. this.region[1] = this.oldRegion[0].children.map(item => {
  292. cityArr.push({
  293. name: item.name,
  294. code: item.code
  295. });
  296. })
  297. this.$set(this.region, 1, cityArr);
  298. // 改变县区列表
  299. this.oldRegion[0].children[0].children.map(item => {
  300. countyArr.push({
  301. name: item.name,
  302. code: item.code
  303. });
  304. })
  305. this.$set(this.region, 2, countyArr);
  306. },
  307. // 信息表
  308. getlist() {
  309. this.$https.get('/youngee/c/g/get-info-tables')
  310. .then(res => {
  311. console.log(res)
  312. this.array = res.data.data.AgeBracket
  313. let list = res.data.data.ThirdPlatform
  314. for (var i = 0; i < list.length; ++i) {
  315. if (list[i].id == this.platform.platform_id) {
  316. this.platform.platform_icon = list[i].platform_icon
  317. this.platform.platform_name = list[i].platform_name
  318. }
  319. }
  320. this.getlist1()
  321. this.getaccount()
  322. })
  323. },
  324. // 达人详细信息表
  325. getlist1() {
  326. this.$https.get('/youngee/c/t/g/get-talent-info')
  327. .then(res => {
  328. console.log(res)
  329. if (res.data.data.talent_wx_number !== null) {
  330. if (res.data.data.talent_age_bracket !== 0) {
  331. for (var i = 0; i < this.array.length; i++) {
  332. if (this.array[i].age_aid == res.data.data.talent_age_bracket) {
  333. this.Xage = this.array[i].age_bracket_discribe
  334. }
  335. this.formData.age = res.data.data.talent_age_bracket
  336. }
  337. }
  338. if (res.data.data.talent_nationality !== 0) {
  339. this.index1 = res.data.data.talent_nationality
  340. this.formData.nationality = res.data.data.talent_nationality
  341. }
  342. if (res.data.data.visit_store_region !== 0) {
  343. let a = res.data.data.visit_store_region.toString().slice(0, 2)
  344. let b = res.data.data.visit_store_region.toString().slice(0, 4)
  345. let c = 0
  346. for (var i = 0; i < region.length; i++) {
  347. if (region[i].code == a) {
  348. a = region[i].name
  349. for (var j = 0; j < region[i].children.length; j++) {
  350. if (region[i].children[j].code == b) {
  351. b = region[i].children[j].name
  352. for (var o = 0; o < region[i].children[j].children
  353. .length; o++) {
  354. if (region[i].children[j].children[o].code == res.data.data
  355. .visit_store_region) {
  356. c = region[i].children[j].children[o].name
  357. }
  358. }
  359. }
  360. }
  361. }
  362. }
  363. this.regionStr = a + ' ' + b + ' ' + c
  364. this.formData.visitStoreRegion = res.data.data.visit_store_region
  365. }
  366. this.formData.phone = res.data.data.talent_phone_number
  367. }
  368. })
  369. },
  370. getaccount() {
  371. console.log(this.isBind)
  372. if (!this.isBind) {
  373. this.$https.get('/youngee/c/t/g/get-talent-account')
  374. .then(res => {
  375. console.log(res)
  376. if (res.data.code !== -3) {
  377. this.account = res.data.data
  378. for (var i = 0; i < this.account.length; i++) {
  379. if (this.platform.platform_id == this.account[i].platform_id) {
  380. this.formData.platform_nickname = this.account[i].platform_nickname
  381. this.formData.fans_count = this.account[i].fans_count
  382. this.formData.home_page_url = this.account[i].home_page_url
  383. this.imageData.push(this.account[i].home_page_capture_url);
  384. }
  385. }
  386. }
  387. })
  388. }
  389. },
  390. setDefault(e) {
  391. console.log(e.detail.value)
  392. if (e.detail.value)
  393. this.formData.setdefault = 1
  394. else
  395. this.formData.setdefault = 0
  396. },
  397. getDefaultAddress() {
  398. this.$https.get('/youngee/c/t/g/get-talent-default-address').then(res => {
  399. this.formData.name = res.data.data.receiver_name
  400. this.formData.tel = res.data.data.phone_number
  401. this.formData.detailregion = res.data.data.detail_addr
  402. this.formData.fregion = res.data.data.region_code
  403. console.log("111")
  404. console.log(this.formData)
  405. let a = res.data.data.region_code.toString().slice(0, 2)
  406. let b = res.data.data.region_code.toString().slice(0, 4)
  407. let c = 0
  408. for (var i = 0; i < region.length; i++) {
  409. if (region[i].code == a) {
  410. a = region[i].name
  411. for (var j = 0; j < region[i].children.length; j++) {
  412. if (region[i].children[j].code == b) {
  413. b = region[i].children[j].name
  414. for (var o = 0; o < region[i].children[j].children.length; o++) {
  415. if (region[i].children[j].children[o].code == res.data.data.region_code) {
  416. c = region[i].children[j].children[o].name
  417. }
  418. }
  419. }
  420. }
  421. }
  422. }
  423. this.regionStr1 = a + ' ' + b + ' ' + c
  424. })
  425. },
  426. /**
  427. * 手动提交
  428. * @param {Object} form
  429. */
  430. submitForm(form) {
  431. // console.log(this.formData);
  432. this.$refs.form.validate().then(res => {
  433. const iphoneReg1 = /^1[0-9]{10}$/
  434. const urlReg =
  435. /(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&amp;%$#_]*)?/
  436. if (!iphoneReg1.test(this.formData.phone)) {
  437. uni.showToast({
  438. title: '电话号码格式不正确',
  439. icon: 'none'
  440. })
  441. return
  442. }
  443. if (!urlReg.test(this.formData.home_page_url)) {
  444. uni.showToast({
  445. title: '主页链接格式不正确',
  446. icon: 'none'
  447. })
  448. return
  449. }
  450. uni.showToast({
  451. title: '提交成功'
  452. })
  453. this.$https.post('/youngee/c/t/p/talent-info', {
  454. talent_age_bracket: this.formData.age,
  455. talent_nationality: this.formData.nationality,
  456. visit_store_region: this.formData.visitStoreRegion,
  457. talent_phone_number: this.formData.phone,
  458. })
  459. .then(res => {
  460. console.log(res)
  461. })
  462. this.$https.post('/youngee/c/t/p/add-talent-address', {
  463. region_code: this.formData.fregion,
  464. detail_addr: this.formData.detailregion,
  465. phone_number: this.formData.phone,
  466. receiver_name: this.formData.name,
  467. default_tag: this.formData.setdefault
  468. })
  469. .then(res => {
  470. console.log(res)
  471. })
  472. this.formData.home_page_capture_url = this.imageData[0]
  473. if (this.isBind) {
  474. this.$https.post('/youngee/c/t/p/add-talent-account', {
  475. platform_id: this.platform.platform_id,
  476. platform_nickname: this.formData.platform_nickname,
  477. home_page_url: this.formData.home_page_url,
  478. fans_count: this.formData.fans_count,
  479. home_page_capture_url: this.formData
  480. .home_page_capture_url,
  481. })
  482. .then(res => {
  483. console.log(res)
  484. })
  485. } else {
  486. this.$https.post('/youngee/c/t/p/update-talent-account', {
  487. account_id: this.accountId,
  488. platform_id: this.platform.platform_id,
  489. platform_nickname: this.formData.platform_nickname,
  490. home_page_url: this.formData.home_page_url,
  491. fans_count: this.formData.fans_count,
  492. home_page_capture_url: this.formData
  493. .home_page_capture_url,
  494. })
  495. .then(res => {
  496. console.log(res)
  497. })
  498. }
  499. uni.showToast({
  500. title: '修改成功'
  501. })
  502. uni.navigateBack()
  503. }).catch(err => {
  504. console.error('验证失败:', err)
  505. uni.showToast({
  506. title: '请填写所有信息',
  507. icon: 'none'
  508. })
  509. })
  510. },
  511. ceshiChooseSuccess(tempFilePaths, e) { //选择图片返回
  512. console.log('ceshiChooseSuccess', tempFilePaths, e);
  513. if (e == 0) {
  514. this.store = 'talent_upload/' + this.guid() + '.png'
  515. } else if (e == 1) {
  516. this.store = 'talent_upload/' + this.guid() + '.mp4'
  517. }
  518. /****************
  519. 以下代码是自定义上传逻辑,仅供参考
  520. ***************/
  521. this.imgUpload(tempFilePaths);
  522. /*******************************/
  523. console.log("imgdata" + this.imageData)
  524. },
  525. imgUpload(tempFilePaths) {
  526. let that = this
  527. console.log('imgUpload', tempFilePaths)
  528. let config = {
  529. AccessKeyId: 'IVW21DTGIIUBBAGXKK0Y', //AK
  530. SecretKey: 'Y01nEQNcLOATMw7uJwrk3yOdQZ2fqLhSnXcOKVDE', //SK
  531. EndPoint: 'https://horastar.obs.cn-east-3.myhuaweicloud.com', //上传文件的路径
  532. };
  533. let fileName = this.store; //指定上传到OBS桶中的对象名
  534. // let fileName = "talent_upload/icon-arrow-right.png"
  535. let OBSPolicy = { //设定policy内容
  536. "expiration": "2089-12-31T12:00:00.000Z",
  537. "conditions": [{
  538. "bucket": "horastar"
  539. }, //Bucket name
  540. // {"bucket": "goin"},
  541. {
  542. 'key': fileName
  543. }
  544. ]
  545. }
  546. let policyEncoded = getPolicyEncode(OBSPolicy); //计算policy编码值
  547. let signature = getSignature(policyEncoded, config.SecretKey); //计算signature
  548. uni.uploadFile({
  549. //url: config.EndPoint,
  550. url: config.EndPoint,
  551. filePath: tempFilePaths[0],
  552. name: 'file',
  553. formData: {
  554. 'AccessKeyID': config.AccessKeyId,
  555. 'policy': policyEncoded,
  556. 'signature': signature,
  557. 'key': fileName,
  558. },
  559. success: function(res) {
  560. console.log(res.statusCode); //打印响应状态码
  561. if (res.statusCode == '204') {
  562. that.imageData.push(config.EndPoint + '/' + fileName);
  563. console.log('上传图片成功', res)
  564. let obs_url = config.EndPoint + '/' + fileName; //用你自己的 bucket 名替换星号
  565. console.log(obs_url)
  566. that.formData.home_img = obs_url
  567. uni.showToast({
  568. title: '上传成功',
  569. icon: '成功'
  570. });
  571. } else {
  572. console.log('上传图片失败', res)
  573. uni.showToast({
  574. title: '上传失败',
  575. icon: '失败'
  576. });
  577. }
  578. },
  579. fail: function(e) {
  580. console.log(e);
  581. }
  582. })
  583. },
  584. guid() {
  585. return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
  586. var r = Math.random() * 16 | 0,
  587. v = c == 'x' ? r : (r & 0x3 | 0x8);
  588. return v.toString(16);
  589. });
  590. },
  591. // 年龄选择的
  592. bindPickerChange: function(e) {
  593. this.index = e.detail.value;
  594. this.formData.age = this.array[this.index].age_aid
  595. this.Xage = this.array[this.index].age_bracket_discribe
  596. console.log(this.formData.age)
  597. },
  598. //国籍选择
  599. bindPickerChange1: function(e) {
  600. console.log(e)
  601. this.index1 = e.detail.value;
  602. this.formData.nationality = this.array1[this.index1].id
  603. console.log(this.formData.nationality)
  604. },
  605. //城市选择
  606. pickerChange(e) {
  607. // console.log(e, '1');
  608. this.regionIndex = e.detail.value;
  609. this.regionStr = this.region[0][this.regionIndex[0]].name + ' ' + this.region[1][this.regionIndex[
  610. 1]]
  611. .name + ' ' +
  612. this.region[2][this.regionIndex[2]].name;
  613. // 组件传值
  614. this.$emit('region', [this.region[0][this.regionIndex[0]].code, this.region[1][this.regionIndex[1]]
  615. .code,
  616. this.region[
  617. 2][this.regionIndex[2]].code
  618. ]);
  619. this.formData.visitStoreRegion = this.region[2][this.regionIndex[2]].code;
  620. },
  621. pickerColumnchange(e) {
  622. // console.log(e);
  623. // 第几列滑动
  624. // console.log(e.detail.column);
  625. // 第几列滑动的下标
  626. // console.log(e.detail.value)
  627. if (e.detail.column === 0) {
  628. // 声明城市数组
  629. let cityArr = [];
  630. let countyArr = [];
  631. // 设置下标
  632. this.regionIndex = [e.detail.value, 0, 0];
  633. // 改变城市列表
  634. this.region[1] = this.oldRegion[e.detail.value].children.map(item => {
  635. cityArr.push({
  636. name: item.name,
  637. code: item.code
  638. });
  639. })
  640. this.$set(this.region, 1, cityArr);
  641. // 改变县区列表
  642. this.oldRegion[e.detail.value].children[0].children.map(item => {
  643. countyArr.push({
  644. name: item.name,
  645. code: item.code
  646. });
  647. })
  648. this.$set(this.region, 2, countyArr);
  649. }
  650. if (e.detail.column === 1) {
  651. this.regionIndex[1] = e.detail.value;
  652. this.regionIndex[2] = 0;
  653. let countyArr = [];
  654. this.oldRegion[this.regionIndex[0]].children[this.regionIndex[1]].children.map(item => {
  655. countyArr.push({
  656. name: item.name,
  657. code: item.code
  658. });
  659. })
  660. this.$set(this.region, 2, countyArr);
  661. }
  662. if (e.detail.column === 2) {
  663. this.regionIndex[2] = e.detail.value;
  664. }
  665. },
  666. //城市选择
  667. pickerChange(e) {
  668. // console.log(e, '1');
  669. this.regionIndex = e.detail.value;
  670. this.regionStr = this.region[0][this.regionIndex[0]].name + ' ' + this.region[1][this.regionIndex[
  671. 1]]
  672. .name + ' ' +
  673. this.region[2][this.regionIndex[2]].name;
  674. // 组件传值
  675. this.$emit('region', [this.region[0][this.regionIndex[0]].code, this.region[1][this.regionIndex[1]]
  676. .code,
  677. this.region[
  678. 2][this.regionIndex[2]].code
  679. ]);
  680. this.formData.visitStoreRegion = this.region[2][this.regionIndex[2]].code;
  681. },
  682. pickerColumnchange(e) {
  683. // console.log(e);
  684. // 第几列滑动
  685. // console.log(e.detail.column);
  686. // 第几列滑动的下标
  687. // console.log(e.detail.value)
  688. if (e.detail.column === 0) {
  689. // 声明城市数组
  690. let cityArr = [];
  691. let countyArr = [];
  692. // 设置下标
  693. this.regionIndex = [e.detail.value, 0, 0];
  694. // 改变城市列表
  695. this.region[1] = this.oldRegion[e.detail.value].children.map(item => {
  696. cityArr.push({
  697. name: item.name,
  698. code: item.code
  699. });
  700. })
  701. this.$set(this.region, 1, cityArr);
  702. // 改变县区列表
  703. this.oldRegion[e.detail.value].children[0].children.map(item => {
  704. countyArr.push({
  705. name: item.name,
  706. code: item.code
  707. });
  708. })
  709. this.$set(this.region, 2, countyArr);
  710. }
  711. if (e.detail.column === 1) {
  712. this.regionIndex[1] = e.detail.value;
  713. this.regionIndex[2] = 0;
  714. let countyArr = [];
  715. this.oldRegion[this.regionIndex[0]].children[this.regionIndex[1]].children.map(item => {
  716. countyArr.push({
  717. name: item.name,
  718. code: item.code
  719. });
  720. })
  721. this.$set(this.region, 2, countyArr);
  722. }
  723. if (e.detail.column === 2) {
  724. this.regionIndex[2] = e.detail.value;
  725. }
  726. },
  727. //城市选择
  728. pickerChange1(e) {
  729. // console.log(e, '1');
  730. this.regionIndex1 = e.detail.value;
  731. this.regionStr1 = this.region[0][this.regionIndex1[0]].name + ' ' + this.region[1][this.regionIndex1[
  732. 1]]
  733. .name + ' ' +
  734. this.region[2][this.regionIndex1[2]].name;
  735. // 组件传值
  736. this.$emit('region', [this.region[0][this.regionIndex1[0]].code, this.region[1][this.regionIndex1[1]]
  737. .code,
  738. this.region[
  739. 2][this.regionIndex1[2]].code
  740. ]);
  741. this.formData.fregion = this.region[2][this.regionIndex1[2]].code;
  742. console.log(this.formData.fregion)
  743. },
  744. pickerColumnchange1(e) {
  745. if (e.detail.column === 0) {
  746. // 声明城市数组
  747. let cityArr = [];
  748. let countyArr = [];
  749. // 设置下标
  750. this.regionIndex1 = [e.detail.value, 0, 0];
  751. // 改变城市列表
  752. this.region[1] = this.oldRegion[e.detail.value].children.map(item => {
  753. cityArr.push({
  754. name: item.name,
  755. code: item.code
  756. });
  757. })
  758. this.$set(this.region, 1, cityArr);
  759. // 改变县区列表
  760. this.oldRegion[e.detail.value].children[0].children.map(item => {
  761. countyArr.push({
  762. name: item.name,
  763. code: item.code
  764. });
  765. })
  766. this.$set(this.region, 2, countyArr);
  767. }
  768. if (e.detail.column === 1) {
  769. this.regionIndex1[1] = e.detail.value;
  770. this.regionIndex1[2] = 0;
  771. let countyArr = [];
  772. this.oldRegion[this.regionIndex1[0]].children[this.regionIndex1[1]].children.map(item => {
  773. countyArr.push({
  774. name: item.name,
  775. code: item.code
  776. });
  777. })
  778. this.$set(this.region, 2, countyArr);
  779. }
  780. if (e.detail.column === 2) {
  781. this.regionIndex1[2] = e.detail.value;
  782. }
  783. },
  784. },
  785. created() {
  786. let provinceArr = [];
  787. let cityArr = [];
  788. this.oldRegion.map((item, index) => {
  789. this.region[0].push({
  790. name: item.name,
  791. code: item.code
  792. });
  793. })
  794. // console.log(provinceArr);
  795. provinceArr.map((item, index) => {
  796. this.region[1].push({
  797. name: item.name,
  798. code: item.code
  799. });
  800. })
  801. cityArr.map((item, index) => {
  802. this.region[2].push({
  803. name: item.name,
  804. code: item.code
  805. });
  806. })
  807. this.regionStr = '请选择省市区';
  808. }
  809. };
  810. </script>
  811. <style>
  812. picker {
  813. position: relative;
  814. display: block;
  815. cursor: pointer;
  816. padding-left: 20rpx !important;
  817. padding-top: 20rpx !important;
  818. color: grey !important;
  819. }
  820. /deep/.uni-forms-item__inner {
  821. border-bottom: none !important;
  822. margin-bottom: 0 !important;
  823. }
  824. </style>
  825. <style lang="scss" scoped>
  826. @charset "UTF-8";
  827. /* 头条小程序组件内不能引入字体 */
  828. /* #ifdef MP-TOUTIAO */
  829. @font-face {
  830. font-family: uniicons;
  831. font-weight: normal;
  832. font-style: normal;
  833. src: url("~@/static/uni.ttf") format("truetype");
  834. }
  835. /* #endif */
  836. /* #ifndef APP-NVUE */
  837. page {
  838. display: flex;
  839. flex-direction: column;
  840. box-sizing: border-box;
  841. background-color: #FFFFFF;
  842. min-height: 100%;
  843. height: auto;
  844. }
  845. view {
  846. font-size: 14px;
  847. // line-height: inherit;
  848. }
  849. .line {
  850. width: 96%;
  851. margin: 10rpx 2%;
  852. border-bottom: 1rpx solid #bbbbbb;
  853. }
  854. .title {
  855. height: 80rpx;
  856. display: flex;
  857. align-items: center;
  858. }
  859. .menu {
  860. position: fixed;
  861. top: 180rpx;
  862. background-color: #FFFFFF;
  863. justify-content: space-around;
  864. height: 80rpx;
  865. // height: 5%;
  866. width: 100%;
  867. display: flex;
  868. z-index: 10;
  869. margin-bottom: 10rpx;
  870. }
  871. .menu-item p {
  872. font-weight: 600;
  873. &.lor {
  874. border-bottom: 5rpx solid #F0D232;
  875. color: #F0D232;
  876. padding-bottom: 15rpx;
  877. }
  878. }
  879. .setdeault {
  880. display: flex;
  881. justify-content: space-between;
  882. }
  883. .btn1 {
  884. width: 100%;
  885. margin-top: 30rpx;
  886. font-size: 35rpx;
  887. color: #FFFFFF;
  888. background-color: #F0D232;
  889. border: none;
  890. border-radius: 0;
  891. }
  892. .uni-input-border,
  893. .uni-textarea-border {
  894. flex: 1;
  895. font-size: 14px;
  896. color: #666;
  897. border: 1px #FFFFFF solid;
  898. border-radius: 5px;
  899. /* #ifndef APP-NVUE */
  900. box-sizing: border-box;
  901. /* #endif */
  902. }
  903. .uni-input-border {
  904. padding: 0 10px;
  905. height: 35px;
  906. }
  907. .uni-textarea-border {
  908. padding: 10px;
  909. height: 80px;
  910. }
  911. .label-box {
  912. margin-right: 10px;
  913. }
  914. .transform-scale {
  915. transform: scale(0.7);
  916. }
  917. .butto {
  918. text-align: center;
  919. }
  920. .option {
  921. padding: 20rpx;
  922. }
  923. .uni-margin-wrap {
  924. width: 690rpx;
  925. width: 100%;
  926. ;
  927. }
  928. .swiper {
  929. height: 300rpx;
  930. }
  931. .swiper-item {
  932. display: block;
  933. height: 300rpx;
  934. line-height: 300rpx;
  935. text-align: center;
  936. }
  937. .swiper-list {
  938. margin-top: 40rpx;
  939. margin-bottom: 0;
  940. }
  941. .uni-common-mt {
  942. margin-top: 60rpx;
  943. position: relative;
  944. }
  945. .info {
  946. position: absolute;
  947. right: 20rpx;
  948. }
  949. .uni-padding-wrap {
  950. width: 550rpx;
  951. padding: 0 100rpx;
  952. }
  953. .signup {
  954. box-shadow: 0rpx 5rpx 40rpx #ccc;
  955. width: 100%;
  956. position: fixed;
  957. bottom: 0rpx;
  958. display: flex;
  959. height: 90rpx;
  960. padding-top: 2%;
  961. background-color: #FFFFFF;
  962. justify-content: space-around;
  963. }
  964. .signuptext {
  965. text-align: center;
  966. margin-top: 2%;
  967. }
  968. .signuptext p {
  969. font-size: 60%;
  970. color: #333333;
  971. }
  972. .signupbut {
  973. text-align: center;
  974. margin-top: 2%;
  975. }
  976. .but1 {
  977. width: 120%;
  978. text-align: center;
  979. background-color: #FCCF41;
  980. border-radius: 10rpx;
  981. color: #464100;
  982. font-size: 28rpx;
  983. line-height: 156%;
  984. font-weight: 500;
  985. height: 65%;
  986. }
  987. /deep/.uni-searchbar__box {
  988. border-color: #267CFF !important;
  989. border-width: 2rpx !important;
  990. }
  991. /deep/.uni-searchbar__box {
  992. background-color: #FFFFFF !important;
  993. }
  994. /deep/.uni-searchbar__text-placeholder {
  995. font-size: 30rpx !important;
  996. }
  997. /deep/.segmented-control__text {
  998. font-size: 34rpx !important;
  999. }
  1000. /deep/.uni-data-checklist {
  1001. padding-left: 20upx;
  1002. }
  1003. uni-picker {
  1004. position: relative;
  1005. display: block;
  1006. cursor: pointer;
  1007. padding-left: 20rpx !important;
  1008. padding-top: 14rpx !important;
  1009. color: grey !important;
  1010. }
  1011. /deep/.uni-date-x--border {
  1012. border: 0px solid #dcdfe6 !important;
  1013. }
  1014. /deep/.is-input-border {
  1015. border: 0px solid #c8c7cc !important;
  1016. }
  1017. /deep/.uni-progress-info {
  1018. font-size: 25rpx !important;
  1019. }
  1020. /deep/.uni-error-message {
  1021. position: absolute;
  1022. bottom: -20rpx !important;
  1023. left: 20rpx !important;
  1024. text-align: left;
  1025. }
  1026. /deep/.uni-forms-item__inner {
  1027. padding-bottom: 0rpx !important;
  1028. margin-bottom: 30rpx !important;
  1029. border-bottom: 0.5rpx solid #CCCCCC;
  1030. }
  1031. /deep/.uni-group__title {
  1032. background-color: #FFFFFF !important;
  1033. }
  1034. /deep/.uni-list-item__content-title {
  1035. font-size: 30rpx !important;
  1036. color: #111111 !important;
  1037. }
  1038. /deep/.uni-progress-bar {
  1039. border-radius: 10rpx !important;
  1040. }
  1041. /deep/.uni-progress-inner-bar {
  1042. border-radius: 10rpx !important;
  1043. }
  1044. /deep/.is-input-border {
  1045. border-radius: 20px !important;
  1046. background-color: #fff;
  1047. }
  1048. .uni-easyinput__content-input {
  1049. font-size: 30upx !important;
  1050. }
  1051. .content-clear-icon {
  1052. font-size: 40upx !important;
  1053. }
  1054. /deep/.input-box {
  1055. padding: 50upx;
  1056. font-size: 30upx;
  1057. .input-item {
  1058. display: flex;
  1059. border: 1upx solid #F8F8F8;
  1060. line-height: 90upx;
  1061. height: 90upx;
  1062. margin-top: 20upx;
  1063. background: #F8F8F8;
  1064. border-radius: 48upx;
  1065. .input-label {
  1066. width: 150upx;
  1067. text-align: center;
  1068. }
  1069. .input-body {
  1070. position: relative;
  1071. height: 100upx;
  1072. width: calc(100% - 150upx);
  1073. .input {
  1074. line-height: 90upx;
  1075. height: 90upx;
  1076. position: relative;
  1077. font-size: 28upx;
  1078. }
  1079. .eye {
  1080. position: absolute;
  1081. height: 50upx;
  1082. width: 50upx;
  1083. right: 20upx;
  1084. top: 50%;
  1085. transform: translateY(-50%);
  1086. }
  1087. .btn-code {
  1088. position: absolute;
  1089. right: 0upx;
  1090. top: 50%;
  1091. transform: translateY(-50%);
  1092. background: none;
  1093. color: #205592;
  1094. width: 160upx;
  1095. font-size: 24upx;
  1096. box-sizing: border-box;
  1097. text-align: center;
  1098. padding: 0;
  1099. height: 100upx;
  1100. line-height: 100upx;
  1101. }
  1102. }
  1103. }
  1104. .select {
  1105. // padding-top: 40upx;
  1106. display: flex;
  1107. justify-content: space-between;
  1108. color: #003B67;
  1109. }
  1110. }
  1111. /deep/.title-left {
  1112. width: 3px;
  1113. height: 16px;
  1114. background: #267CFF;
  1115. display: inline-block;
  1116. border-radius: 3px;
  1117. margin-top: 3px;
  1118. vertical-align: top;
  1119. margin-right: 10px;
  1120. }
  1121. .card {
  1122. padding: 24rpx;
  1123. margin-top: 30rpx;
  1124. border: 1rpx solid #F0D232;
  1125. background-color: #ffffff;
  1126. margin: 0 10rpx;
  1127. }
  1128. .head {
  1129. padding-top: 5%;
  1130. padding: 0 0 0 1%;
  1131. height: 80rpx;
  1132. margin-top: 2%;
  1133. }
  1134. .head span {
  1135. color: #333333;
  1136. font-size: 80%;
  1137. font-weight: 550;
  1138. text-indent: 2em;
  1139. }
  1140. .head image {
  1141. vertical-align: middle;
  1142. width: 50rpx;
  1143. height: 50rpx;
  1144. display: inline-block;
  1145. padding-right: 14rpx;
  1146. }
  1147. .home-link {
  1148. /deep/.uni-easyinput__content-input {
  1149. background-color: #EBEBEB;
  1150. border-radius: 15rpx;
  1151. }
  1152. }
  1153. .heng-line {
  1154. margin-top: 60rpx;
  1155. margin-bottom: 50rpx;
  1156. border: 1rpx solid #DCDCDC;
  1157. }
  1158. .signupbtn p {
  1159. font-size: 30rpx;
  1160. }
  1161. .exit-btn {
  1162. width: 120%;
  1163. text-align: center;
  1164. background-color: #C0C0C0;
  1165. border-radius: 10rpx;
  1166. color: #FFFFFF;
  1167. font-size: 30rpx;
  1168. line-height: 180%;
  1169. }
  1170. .main-btn {
  1171. width: 300rpx;
  1172. text-align: center;
  1173. background-color: #FCCF41;
  1174. border-radius: 10rpx;
  1175. color: #000000;
  1176. font-size: 30rpx;
  1177. line-height: 180%;
  1178. }
  1179. .uni-input-placeholder {
  1180. font-size: 24rpx !important;
  1181. }
  1182. /deep/.uni-date-x--border {
  1183. border: 0px solid #dcdfe6 !important;
  1184. }
  1185. /deep/.is-input-border {
  1186. border: 0px solid #c8c7cc !important;
  1187. }
  1188. .example {
  1189. padding: 0 15px 15px;
  1190. }
  1191. .example-info {
  1192. padding: 15px;
  1193. color: #3b4144;
  1194. background: #ffffff;
  1195. }
  1196. .example-body {
  1197. /* #ifndef APP-NVUE */
  1198. display: flex;
  1199. /* #endif */
  1200. flex-direction: row;
  1201. flex-wrap: wrap;
  1202. justify-content: center;
  1203. padding: 0;
  1204. font-size: 14px;
  1205. background-color: #ffffff;
  1206. }
  1207. /* #endif */
  1208. .example {
  1209. padding: 0 15px;
  1210. }
  1211. .example-info {
  1212. /* #ifndef APP-NVUE */
  1213. display: block;
  1214. /* #endif */
  1215. padding: 15px;
  1216. color: #3b4144;
  1217. background-color: #ffffff;
  1218. font-size: 14px;
  1219. line-height: 20px;
  1220. }
  1221. .example-info-text {
  1222. font-size: 14px;
  1223. line-height: 20px;
  1224. color: #3b4144;
  1225. }
  1226. .example-body {
  1227. flex-direction: column;
  1228. padding: 15px;
  1229. background-color: #ffffff;
  1230. }
  1231. </style>