1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447 |
- <template>
- <view style="position: relative;">
- <!-- 胶囊 -->
- <mvBar :mysNavConfig="mysNavConfig"></mvBar>
- <view :style="{marginTop:navH}"></view>
- <view class="home">
- <view style="margin: 0 20rpx;">
- <uni-forms :value="formData" ref="form" :rules="rules" validate-trigger="bind"
- err-show-type="undertext">
- <view class="title">
- <p>个人资料</p>
- </view>
- <uni-forms-item name="age" label="年龄区间">
- <picker @change="bindPickerChange" :value="index" :range="array"
- range-key="age_bracket_discribe">
- <view>{{ Xage }}</view>
- </picker>
- </uni-forms-item>
- <uni-forms-item name="skintype" label="国籍">
- <picker @change="bindPickerChange1" :value="index1" :range="array1" range-key="name">
- <view>{{ array1[index1].name }}</view>
- </picker>
- </uni-forms-item>
- <uni-forms-item name="vregion" label="探店地区">
- <picker class="picker" mode="multiSelector" :range="region" range-key="name"
- :value="regionIndex" @change="pickerChange" @columnchange="pickerColumnchange">
- <view class="pbox" :class="{'pbox_hover':regionStr != '请选择省市区'}">
- <view>{{regionStr}}</view>
- <text class="iconfont icon-you"></text>
- </view>
- </picker>
- </uni-forms-item>
- <uni-forms-item name="phone" required label="联系电话">
- <uni-easyinput type="number" maxlength="11" :inputBorder="true" v-model="formData.phone"
- placeholder="请输入联系电话">
- </uni-easyinput>
- </uni-forms-item>
- <view class="line"></view>
- <view class="title">
- <p>收货地址</p>
- </view>
- <uni-forms-item name="name" required label="收件人">
- <uni-easyinput type="text" :inputBorder="true" v-model="formData.name" placeholder="请输入收件人">
- </uni-easyinput>
- </uni-forms-item>
- <uni-forms-item name="tel" required label="联系电话">
- <uni-easyinput type="number" maxlength="11" :inputBorder="true" v-model="formData.tel"
- placeholder="请输入联系电话">
- </uni-easyinput>
- </uni-forms-item>
- <uni-forms-item name="fregion" required label="所在地区">
- <picker class="picker" mode="multiSelector" :range="region" range-key="name"
- :value="regionIndex1" @change="pickerChange1" @columnchange="pickerColumnchange1">
- <view class="pbox" :class="{'pbox_hover':regionStr1 != '请选择省市区'}">
- <view>{{regionStr1}}</view>
- <text class="iconfont icon-you"></text>
- </view>
- </picker>
- </uni-forms-item>
- <uni-forms-item name="detailregion" required label="详细地址">
- <uni-easyinput type="text" :inputBorder="true" v-model="formData.detailregion"
- placeholder="请输入详细地址(省/市/县/镇/)">
- </uni-easyinput>
- </uni-forms-item>
- <view class="setdeault">
- <view class="setdeault-text">设为默认收货地址</view>
- <switch style='zoom:.8;' @change="setDefault" />
- </view>
- <view class="line"></view>
- <view class="title">
- <p>{{platform.platform_name}}账号</p>
- </view>
- <uni-forms-item name="nickname" required label="昵称">
- <uni-easyinput type="text" v-model="formData.platform_nickname" style="width:300rpx"
- placeholder="请填写账号昵称">
- </uni-easyinput>
- </uni-forms-item>
- <uni-forms-item name="numberfans" required label="粉丝数">
- <view class="number-inupt">
- <uni-easyinput type="number" v-model="fansCount" placeholder="请填写粉丝数量"
- v-if="fansCountInfo === 1" style="width:300rpx" @input="onInput1">
- </uni-easyinput>
- <uni-easyinput type="digit" v-model="fansCount" style="width:300rpx" placeholder="请填写粉丝数量"
- v-else @input="onInput">
- </uni-easyinput>
- <picker @change="bindPickerChange2" :value="index3" :range="fansRange" range-key="label"
- style="z-index: 999;background-color: #fcdf41;padding: 0 10rpx;border-radius: 5rpx;">
- <view>{{ fansLabel }}</view>
- </picker>
- </view>
- <!-- <view style="font-size: 24rpx;padding-left: 10px;" @click="hasClicked = true" v-else>
- <p>点选数字单位</p>
- </view> -->
- </uni-forms-item>
- <uni-forms-item name="home_link" required label=" " label-width='10'>
- <uni-easyinput class="home-link" type="text" v-model="formData.home_page_url"
- style="width:650rpx" placeholder="请填写个人主页链接">
- </uni-easyinput>
- </uni-forms-item>
- <view style="margin-top: 40rpx;">
- <uni-forms-item name="home_img" required label="主页截图">
- <htz-image-upload :max="1" mediaType="image" name="file" :chooseNum="1" v-model="imageData"
- @chooseSuccess="ceshiChooseSuccess">
- </htz-image-upload>
- </uni-forms-item>
- </view>
- </uni-forms>
- </view>
- </view>
- <button class="btn1" @click="submitForm('form')">保存</button>
- </view>
- </template>
- <script>
- import region from '@/components/pca-code.json';
- import mvBar from "@/components/mys_navBar/mysNavBar";
- import htzImageUpload from '@/components/htz-image-upload/htz-image-upload.vue';
- import getPolicyEncode from '@/components/obs/getPolicy.js';
- import getSignature from '@/components/obs/GetSignature.js';
- export default {
- components: {
- mvBar,
- htzImageUpload,
- },
- data() {
- return {
- navH: getApp().globalData.navHeight,
- hasClicked: false,
- address: [],
- accountId: '',
- platform: {
- platform_id: '',
- platform_name: '',
- platform_icon: '',
- },
- isBind: true,
- imageData: [],
- ismodify: '',
- // 原数组
- oldRegion: region,
- // 处理后的数组
- region: [
- [],
- [],
- []
- ],
- // 选择省市区的下标Index 传则默认选中传递的
- regionIndex: [0, 0, 0],
- regionIndex1: [0, 0, 0],
- // 省市区字符串
- regionStr: '请选择省市区',
- regionStr1: '请选择省市区',
- formData: {
- age: '',
- nationality: '',
- phone: '',
- visitStoreRegion: '',
- name: '',
- tel: '',
- detailregion: '',
- fregion: '',
- setdefault: false,
- platform_nickname: '',
- fans_count: '',
- home_page_url: '',
- },
- index3: 0,
- fansLabel: "选择单位",
- fansCount: null,
- fansCountInfo: 1,
- fansRange: [{
- value: 1,
- label: '个'
- },
- {
- value: 10000,
- label: '万'
- },
- {
- value: 100000000,
- label: '亿'
- }
- ],
- index: 0,
- index1: 0,
- Xage: '请选择',
- Xskintype: '请选择',
- array: [{
- age_bracket_discribe: '请选择',
- age_aid: 0
- }, {
- age_bracket_discribe: '0~18',
- age_aid: 1
- }, {
- age_bracket_discribe: '18~25',
- age_aid: 2
- }, {
- age_bracket_discribe: '26~30',
- age_aid: 3
- }, {
- age_bracket_discribe: '30~40',
- age_aid: 4
- }, {
- age_bracket_discribe: '40+',
- age_aid: 5
- }],
- array1: [{
- name: '请选择',
- id: 0
- }, {
- name: '中国',
- id: 1
- }, {
- name: '外国',
- id: 2
- }],
- data: {},
- show: false,
- mysNavConfig: {
- /* 开启单页显示首页图标 */
- isHome: true,
- /* 固定导航 */
- navFixed: true,
- /* 标题 (屏幕中心居中 两边图标中心居中使用slot center1) */
- navTitle: {
- text: "个人信息",
- color: "",
- fontSize: "32rpx", // px upx rpx
- fontWeight: "normal", // 100 - 700
- },
- btnType: "type2",
- onLeftClick: '',
- /* type2 按钮 */
- type2Config: {
- // 左图标
- leftPath: "/static/img/png2.png",
- // 右图标
- rightPath: "/static/img/png4.png",
- // 圆角
- radius: "40rpx",
- },
- },
- rules: {
- home_img: {
- rules: [{
- required: true,
- errorMessage: '请上传主页截图'
- }, ]
- },
- home_link: {
- rules: [{
- required: true,
- errorMessage: '请输入主页链接'
- }, ]
- },
- numberfans: {
- rules: [{
- required: true,
- errorMessage: '请输入粉丝量'
- }, ]
- },
- nickname: {
- rules: [{
- required: true,
- errorMessage: '请输入账号昵称'
- }, ]
- },
- detailregion: {
- rules: [{
- required: true,
- errorMessage: '请输入详细地址'
- }, ]
- },
- fregion: {
- rules: [{
- required: true,
- errorMessage: '请输入收货地址'
- }, ]
- },
- tel: {
- rules: [{
- required: true,
- errorMessage: '请输入联系方式'
- }, ]
- },
- name: {
- rules: [{
- required: true,
- errorMessage: '请输入姓名'
- }, ]
- },
- phone: {
- rules: [{
- required: true,
- errorMessage: '请输入联系方式'
- }, ]
- },
- vregion: {
- rules: [{
- required: false,
- errorMessage: '请输入探店地区'
- }, ]
- },
- skintype: {
- rules: [{
- required: false,
- errorMessage: '请输入国籍'
- }, ]
- },
- age: {
- rules: [{
- required: false,
- errorMessage: '请输入年龄'
- }, ]
- },
- },
- }
- },
- onReady() {},
- onShow() {},
- onLoad(options) {
- this.platform.platform_id = parseInt(options.platform_id)
- if (options.account_id) {
- this.accountId = parseInt(options.account_id)
- this.isBind = false
- }
- this.initRegion()
- this.getDefaultAddress()
- this.getlist()
- },
- methods: {
- initRegion() {
- // 声明城市数组
- let cityArr = [];
- let countyArr = [];
- // 设置下标
- this.regionIndex = [0, 0, 0];
- // 改变城市列表
- this.region[1] = this.oldRegion[0].children.map(item => {
- cityArr.push({
- name: item.name,
- code: item.code
- });
- })
- this.$set(this.region, 1, cityArr);
- // 改变县区列表
- this.oldRegion[0].children[0].children.map(item => {
- countyArr.push({
- name: item.name,
- code: item.code
- });
- })
- this.$set(this.region, 2, countyArr);
- },
- // 信息表
- getlist() {
- this.$https.get('/youngee/c/g/get-info-tables')
- .then(res => {
- this.array = res.data.data.AgeBracket
- let list = res.data.data.ThirdPlatform
- for (var i = 0; i < list.length; ++i) {
- if (list[i].id == this.platform.platform_id) {
- this.platform.platform_icon = list[i].platform_icon
- this.platform.platform_name = list[i].platform_name
- }
- }
- this.getlist1()
- this.getaccount()
- })
- },
- // 达人详细信息表
- getlist1() {
- this.$https.get('/youngee/c/t/g/get-talent-info')
- .then(res => {
- if (res.data.data.talent_wx_number !== null) {
- if (res.data.data.talent_age_bracket !== 0) {
- for (var i = 0; i < this.array.length; i++) {
- if (this.array[i].age_aid == res.data.data.talent_age_bracket) {
- this.Xage = this.array[i].age_bracket_discribe
- }
- this.formData.age = res.data.data.talent_age_bracket
- }
- }
- if (res.data.data.talent_nationality !== 0) {
- this.index1 = res.data.data.talent_nationality
- this.formData.nationality = res.data.data.talent_nationality
- }
- if (res.data.data.visit_store_region !== 0) {
- let a = res.data.data.visit_store_region.toString().slice(0, 2)
- let b = res.data.data.visit_store_region.toString().slice(0, 4)
- let c = 0
- for (var i = 0; i < region.length; i++) {
- if (region[i].code == a) {
- a = region[i].name
- for (var j = 0; j < region[i].children.length; j++) {
- if (region[i].children[j].code == b) {
- b = region[i].children[j].name
- for (var o = 0; o < region[i].children[j].children
- .length; o++) {
- if (region[i].children[j].children[o].code == res.data.data
- .visit_store_region) {
- c = region[i].children[j].children[o].name
- }
- }
- }
- }
- }
- }
- this.regionStr = a + ' ' + b + ' ' + c
- this.formData.visitStoreRegion = res.data.data.visit_store_region
- }
- this.formData.phone = res.data.data.is_bind_info === 1 ? res.data.data
- .talent_phone_number : this.formData.phone
- }
- })
- },
- getaccount() {
- if (!this.isBind) {
- this.$https.get('/youngee/c/t/g/get-talent-account')
- .then(res => {
- if (res.data.code !== -3) {
- this.account = res.data.data
- for (var i = 0; i < this.account.length; i++) {
- if (this.platform.platform_id == this.account[i].platform_id) {
- this.hasClicked = true
- this.formData.platform_nickname = this.account[i].platform_nickname
- this.formData.fans_count = this.account[i].fans_count
- this.formData.home_page_url = this.account[i].home_page_url
- this.imageData.push(this.account[i].home_page_capture_url);
- if (this.formData.fans_count >= 100000000) {
- this.index3 = 2
- this.fansCountInfo = this.fansRange[this.index3].value;
- this.fansLabel = this.fansRange[this.index3].label;
- this.fansCount = (this.formData.fans_count / 100000000).toFixed(1)
- } else if (this.formData.fans_count >= 10000) {
- this.index3 = 1
- this.fansCountInfo = this.fansRange[this.index3].value;
- this.fansLabel = this.fansRange[this.index3].label;
- this.fansCount = (this.formData.fans_count / 10000).toFixed(1)
- } else {
- this.index3 = 0
- this.fansCountInfo = this.fansRange[this.index3].value;
- this.fansLabel = this.fansRange[this.index3].label;
- this.fansCount = this.formData.fans_count
- }
- }
- }
- }
- })
- }
- },
- setDefault(e) {
- if (e.detail.value)
- this.formData.setdefault = 1
- else
- this.formData.setdefault = 0
- },
- getDefaultAddress() {
- this.$https.get('/youngee/c/t/g/get-talent-default-address').then(res => {
- this.formData.name = res.data.data.receiver_name
- this.formData.tel = res.data.data.phone_number
- this.formData.detailregion = res.data.data.detail_addr
- this.formData.fregion = res.data.data.region_code
- let a = res.data.data.region_code.toString().slice(0, 2)
- let b = res.data.data.region_code.toString().slice(0, 4)
- let c = 0
- for (var i = 0; i < region.length; i++) {
- if (region[i].code == a) {
- a = region[i].name
- for (var j = 0; j < region[i].children.length; j++) {
- if (region[i].children[j].code == b) {
- b = region[i].children[j].name
- for (var o = 0; o < region[i].children[j].children.length; o++) {
- if (region[i].children[j].children[o].code == res.data.data.region_code) {
- c = region[i].children[j].children[o].name
- }
- }
- }
- }
- }
- }
- this.regionStr1 = a + ' ' + b + ' ' + c
- })
- },
- /**
- * 手动提交
- * @param {Object} form
- */
- submitForm(form) {
- this.$refs.form.validate().then(res => {
- const iphoneReg1 = /^1[0-9]{10}$/
- const urlReg =
- /(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&%$#_]*)?/
- if (!iphoneReg1.test(this.formData.phone)) {
- uni.showToast({
- title: '请填写正确的联系方式',
- icon: 'none'
- })
- return
- }
- if (!iphoneReg1.test(this.formData.tel)) {
- uni.showToast({
- title: '请填写正确的电话号码',
- icon: 'none'
- })
- return
- }
- if (!urlReg.test(this.formData.home_page_url)) {
- uni.showToast({
- title: '主页链接格式不正确',
- icon: 'none'
- })
- return
- }
- if (this.fansCount == null || this.fansCount * this.fansCountInfo <= 0 || this.fansLabel == "选择单位") {
- uni.showToast({
- title: '请填写粉丝量数量',
- icon: 'none'
- })
- return
- }
- this.formData.fans_count = this.fansCount * this.fansCountInfo
- if (this.imageData.length === 0) {
- uni.showToast({
- title: '请上传主页截图',
- icon: 'none'
- })
- return
- }
- // uni.showToast({
- // title: '提交成功'
- // })
- let nickName = uni.getStorageSync('nickName');
- let avatarUrl = uni.getStorageSync('avatarUrl');
- this.$https.post('/youngee/c/t/p/talent-info', {
- talent_age_bracket: this.formData.age,
- talent_nationality: this.formData.nationality,
- visit_store_region: this.formData.visitStoreRegion,
- talent_phone_number: this.formData.phone,
- talent_wx_nickname: nickName,
- avatar: avatarUrl,
- })
- .then(res => {})
- this.$https.post('/youngee/c/t/p/add-talent-address', {
- region_code: this.formData.fregion,
- detail_addr: this.formData.detailregion,
- phone_number: this.formData.tel,
- receiver_name: this.formData.name,
- default_tag: this.formData.setdefault
- })
- .then(res => {})
- this.formData.home_page_capture_url = this.imageData[0]
- if (this.isBind) {
- this.$https.post('/youngee/c/t/p/add-talent-account', {
- platform_id: this.platform.platform_id,
- platform_nickname: this.formData.platform_nickname,
- home_page_url: this.formData.home_page_url,
- fans_count: this.formData.fans_count,
- home_page_capture_url: this.formData
- .home_page_capture_url,
- })
- .then(res => {})
- } else {
- this.$https.post('/youngee/c/t/p/update-talent-account', {
- account_id: this.accountId,
- platform_id: this.platform.platform_id,
- platform_nickname: this.formData.platform_nickname,
- home_page_url: this.formData.home_page_url,
- fans_count: this.formData.fans_count,
- home_page_capture_url: this.formData
- .home_page_capture_url,
- })
- .then(res => {})
- }
- uni.showToast({
- title: '修改成功'
- })
- uni.navigateBack()
- }).catch(err => {
- uni.showToast({
- title: '请填写所有信息',
- icon: 'none'
- })
- })
- },
- ceshiChooseSuccess(tempFilePaths, e) { //选择图片返回
- if (e == 0) {
- this.store = 'talent_upload/' + this.guid() + '.png'
- } else if (e == 1) {
- this.store = 'talent_upload/' + this.guid() + '.mp4'
- }
- /****************
- 以下代码是自定义上传逻辑,仅供参考
- ***************/
- this.imgUpload(tempFilePaths);
- /*******************************/
- },
- imgUpload(tempFilePaths) {
- let that = this
- let config = {
- AccessKeyId: 'IVW21DTGIIUBBAGXKK0Y', //AK
- SecretKey: 'Y01nEQNcLOATMw7uJwrk3yOdQZ2fqLhSnXcOKVDE', //SK
- EndPoint: 'https://horastar.obs.cn-east-3.myhuaweicloud.com', //上传文件的路径
- };
- let fileName = this.store; //指定上传到OBS桶中的对象名
- // let fileName = "talent_upload/icon-arrow-right.png"
- let OBSPolicy = { //设定policy内容
- "expiration": "2089-12-31T12:00:00.000Z",
- "conditions": [{
- "bucket": "horastar"
- }, //Bucket name
- // {"bucket": "goin"},
- {
- 'key': fileName
- }
- ]
- }
- let policyEncoded = getPolicyEncode(OBSPolicy); //计算policy编码值
- let signature = getSignature(policyEncoded, config.SecretKey); //计算signature
- uni.uploadFile({
- //url: config.EndPoint,
- url: config.EndPoint,
- filePath: tempFilePaths[0],
- name: 'file',
- formData: {
- 'AccessKeyID': config.AccessKeyId,
- 'policy': policyEncoded,
- 'signature': signature,
- 'key': fileName,
- },
- success: function(res) {
- if (res.statusCode == '204') {
- that.imageData.push(config.EndPoint + '/' + fileName);
- let obs_url = config.EndPoint + '/' + fileName; //用你自己的 bucket 名替换星号
- that.formData.home_img = obs_url
- uni.showToast({
- title: '上传成功',
- icon: '成功'
- });
- } else {
- uni.showToast({
- title: '上传失败',
- icon: '失败'
- });
- }
- },
- fail: function(e) {}
- })
- },
- guid() {
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
- var r = Math.random() * 16 | 0,
- v = c == 'x' ? r : (r & 0x3 | 0x8);
- return v.toString(16);
- });
- },
- // 年龄选择的
- bindPickerChange: function(e) {
- this.index = e.detail.value;
- this.formData.age = this.array[this.index].age_aid
- this.Xage = this.array[this.index].age_bracket_discribe
- },
- //国籍选择
- bindPickerChange1: function(e) {
- this.index1 = e.detail.value;
- this.formData.nationality = this.array1[this.index1].id
- },
- //城市选择
- pickerChange(e) {
- this.regionIndex = e.detail.value;
- this.regionStr = this.region[0][this.regionIndex[0]].name + ' ' + this.region[1][this.regionIndex[
- 1]]
- .name + ' ' +
- this.region[2][this.regionIndex[2]].name;
- // 组件传值
- this.$emit('region', [this.region[0][this.regionIndex[0]].code, this.region[1][this.regionIndex[1]]
- .code,
- this.region[
- 2][this.regionIndex[2]].code
- ]);
- this.formData.visitStoreRegion = this.region[2][this.regionIndex[2]].code;
- },
- pickerColumnchange(e) {
- if (e.detail.column === 0) {
- // 声明城市数组
- let cityArr = [];
- let countyArr = [];
- // 设置下标
- this.regionIndex = [e.detail.value, 0, 0];
- // 改变城市列表
- this.region[1] = this.oldRegion[e.detail.value].children.map(item => {
- cityArr.push({
- name: item.name,
- code: item.code
- });
- })
- this.$set(this.region, 1, cityArr);
- // 改变县区列表
- this.oldRegion[e.detail.value].children[0].children.map(item => {
- countyArr.push({
- name: item.name,
- code: item.code
- });
- })
- this.$set(this.region, 2, countyArr);
- }
- if (e.detail.column === 1) {
- this.regionIndex[1] = e.detail.value;
- this.regionIndex[2] = 0;
- let countyArr = [];
- this.oldRegion[this.regionIndex[0]].children[this.regionIndex[1]].children.map(item => {
- countyArr.push({
- name: item.name,
- code: item.code
- });
- })
- this.$set(this.region, 2, countyArr);
- }
- if (e.detail.column === 2) {
- this.regionIndex[2] = e.detail.value;
- }
- },
- //城市选择
- pickerChange(e) {
- this.regionIndex = e.detail.value;
- this.regionStr = this.region[0][this.regionIndex[0]].name + ' ' + this.region[1][this.regionIndex[
- 1]]
- .name + ' ' +
- this.region[2][this.regionIndex[2]].name;
- // 组件传值
- this.$emit('region', [this.region[0][this.regionIndex[0]].code, this.region[1][this.regionIndex[1]]
- .code,
- this.region[
- 2][this.regionIndex[2]].code
- ]);
- this.formData.visitStoreRegion = this.region[2][this.regionIndex[2]].code;
- },
- pickerColumnchange(e) {
- if (e.detail.column === 0) {
- // 声明城市数组
- let cityArr = [];
- let countyArr = [];
- // 设置下标
- this.regionIndex = [e.detail.value, 0, 0];
- // 改变城市列表
- this.region[1] = this.oldRegion[e.detail.value].children.map(item => {
- cityArr.push({
- name: item.name,
- code: item.code
- });
- })
- this.$set(this.region, 1, cityArr);
- // 改变县区列表
- this.oldRegion[e.detail.value].children[0].children.map(item => {
- countyArr.push({
- name: item.name,
- code: item.code
- });
- })
- this.$set(this.region, 2, countyArr);
- }
- if (e.detail.column === 1) {
- this.regionIndex[1] = e.detail.value;
- this.regionIndex[2] = 0;
- let countyArr = [];
- this.oldRegion[this.regionIndex[0]].children[this.regionIndex[1]].children.map(item => {
- countyArr.push({
- name: item.name,
- code: item.code
- });
- })
- this.$set(this.region, 2, countyArr);
- }
- if (e.detail.column === 2) {
- this.regionIndex[2] = e.detail.value;
- }
- },
- //城市选择
- pickerChange1(e) {
- this.regionIndex1 = e.detail.value;
- this.regionStr1 = this.region[0][this.regionIndex1[0]].name + ' ' + this.region[1][this.regionIndex1[
- 1]]
- .name + ' ' +
- this.region[2][this.regionIndex1[2]].name;
- // 组件传值
- this.$emit('region', [this.region[0][this.regionIndex1[0]].code, this.region[1][this.regionIndex1[1]]
- .code,
- this.region[
- 2][this.regionIndex1[2]].code
- ]);
- this.formData.fregion = this.region[2][this.regionIndex1[2]].code;
- },
- pickerColumnchange1(e) {
- if (e.detail.column === 0) {
- // 声明城市数组
- let cityArr = [];
- let countyArr = [];
- // 设置下标
- this.regionIndex1 = [e.detail.value, 0, 0];
- // 改变城市列表
- this.region[1] = this.oldRegion[e.detail.value].children.map(item => {
- cityArr.push({
- name: item.name,
- code: item.code
- });
- })
- this.$set(this.region, 1, cityArr);
- // 改变县区列表
- this.oldRegion[e.detail.value].children[0].children.map(item => {
- countyArr.push({
- name: item.name,
- code: item.code
- });
- })
- this.$set(this.region, 2, countyArr);
- }
- if (e.detail.column === 1) {
- this.regionIndex1[1] = e.detail.value;
- this.regionIndex1[2] = 0;
- let countyArr = [];
- this.oldRegion[this.regionIndex1[0]].children[this.regionIndex1[1]].children.map(item => {
- countyArr.push({
- name: item.name,
- code: item.code
- });
- })
- this.$set(this.region, 2, countyArr);
- }
- if (e.detail.column === 2) {
- this.regionIndex1[2] = e.detail.value;
- }
- },
- // 粉丝量量级选择
- bindPickerChange2: function(e) {
- if (this.index3 !== e.detail.value) {
- this.fansCount = null
- }
- this.index3 = e.detail.value;
- this.fansLabel = this.fansRange[this.index3].label
- this.fansCountInfo = this.fansRange[this.index3].value
- },
- onInput(e) {
- e = (e.match(/^\d*(\.?\d{0,1})/g)[0]) || null
- // //重新赋值给input
- if (e < 0 || e > 9999.9) {
- uni.showToast({
- title: '请输入[1,9999.9]区间内的数',
- icon: 'none'
- })
- }
- this.$nextTick(() => {
- this.fansCount = (e > 0 && e <= 9999.9) ? e : null
- })
- },
- onInput1(e) {
- // 验证是否是纯数字
- const isNumber = /^\d*$/.test(e)
- // 过滤非数字
- e = e.replace(/\D/g, '')
- if (!isNumber || e < 0 || e > 9999) {
- uni.showToast({
- title: '请输入[0,9999]区间的整数',
- icon: 'none'
- })
- }
- this.$nextTick(() => {
- this.fansCount = (e >= 0 && e <= 9999 && e.match(/^\d*/g)[0]) ? e : null
- })
- }
- },
- created() {
- let provinceArr = [];
- let cityArr = [];
- this.oldRegion.map((item, index) => {
- this.region[0].push({
- name: item.name,
- code: item.code
- });
- })
- provinceArr.map((item, index) => {
- this.region[1].push({
- name: item.name,
- code: item.code
- });
- })
- cityArr.map((item, index) => {
- this.region[2].push({
- name: item.name,
- code: item.code
- });
- })
- this.regionStr = '请选择省市区';
- }
- };
- </script>
- <style>
- picker {
- position: relative;
- display: block;
- cursor: pointer;
- padding-left: 20rpx !important;
- /* padding-top: 20rpx !important; */
- /* color: grey !important; */
- }
- /deep/.uni-forms-item__inner {
- border-bottom: none !important;
- margin-bottom: 0 !important;
- }
- /deep/ .uni-forms-item__content {
- display: flex !important;
- align-items: center !important;
- /* justify-content: space-between; */
- }
- </style>
- <style lang="scss" scoped>
- @charset "UTF-8";
- /* 头条小程序组件内不能引入字体 */
- /* #ifdef MP-TOUTIAO */
- @font-face {
- font-family: uniicons;
- font-weight: normal;
- font-style: normal;
- src: url("~@/static/uni.ttf") format("truetype");
- }
- /* #endif */
- /* #ifndef APP-NVUE */
- page {
- display: flex;
- flex-direction: column;
- box-sizing: border-box;
- background-color: #FFFFFF;
- min-height: 100%;
- height: auto;
- }
- view {
- font-size: 14px;
- // line-height: inherit;
- }
- .line {
- width: 96%;
- margin: 10rpx 2%;
- border-bottom: 1rpx solid #bbbbbb;
- }
- .title {
- height: 80rpx;
- display: flex;
- align-items: center;
- }
- .menu {
- position: fixed;
- top: 180rpx;
- background-color: #FFFFFF;
- justify-content: space-around;
- height: 80rpx;
- // height: 5%;
- width: 100%;
- display: flex;
- z-index: 10;
- margin-bottom: 10rpx;
- }
- .menu-item p {
- font-weight: 600;
- &.lor {
- border-bottom: 5rpx solid #F0D232;
- color: #F0D232;
- padding-bottom: 15rpx;
- }
- }
- .setdeault {
- display: flex;
- justify-content: space-between;
- }
- .btn1 {
- width: 100%;
- margin-top: 30rpx;
- font-size: 35rpx;
- color: #FFFFFF;
- background-color: #F0D232;
- border: none;
- border-radius: 0;
- }
- .uni-input-border,
- .uni-textarea-border {
- flex: 1;
- font-size: 14px;
- color: #666;
- border: 1px #FFFFFF solid;
- border-radius: 5px;
- /* #ifndef APP-NVUE */
- box-sizing: border-box;
- /* #endif */
- }
- .uni-input-border {
- padding: 0 10px;
- height: 35px;
- }
- .uni-textarea-border {
- padding: 10px;
- height: 80px;
- }
- .label-box {
- margin-right: 10px;
- }
- .transform-scale {
- transform: scale(0.7);
- }
- .butto {
- text-align: center;
- }
- .option {
- padding: 20rpx;
- }
- .uni-margin-wrap {
- width: 690rpx;
- width: 100%;
- ;
- }
- .swiper {
- height: 300rpx;
- }
- .swiper-item {
- display: block;
- height: 300rpx;
- line-height: 300rpx;
- text-align: center;
- }
- .swiper-list {
- margin-top: 40rpx;
- margin-bottom: 0;
- }
- .uni-common-mt {
- margin-top: 60rpx;
- position: relative;
- }
- .info {
- position: absolute;
- right: 20rpx;
- }
- .uni-padding-wrap {
- width: 550rpx;
- padding: 0 100rpx;
- }
- .signup {
- box-shadow: 0rpx 5rpx 40rpx #ccc;
- width: 100%;
- position: fixed;
- bottom: 0rpx;
- display: flex;
- height: 90rpx;
- padding-top: 2%;
- background-color: #FFFFFF;
- justify-content: space-around;
- }
- .signuptext {
- text-align: center;
- margin-top: 2%;
- }
- .signuptext p {
- font-size: 60%;
- color: #333333;
- }
- .signupbut {
- text-align: center;
- margin-top: 2%;
- }
- .but1 {
- width: 120%;
- text-align: center;
- background-color: #FCCF41;
- border-radius: 10rpx;
- color: #464100;
- font-size: 28rpx;
- line-height: 156%;
- font-weight: 500;
- height: 65%;
- }
- /deep/.uni-searchbar__box {
- border-color: #267CFF !important;
- border-width: 2rpx !important;
- }
- /deep/.uni-searchbar__box {
- background-color: #FFFFFF !important;
- }
- /deep/.uni-searchbar__text-placeholder {
- font-size: 30rpx !important;
- }
- /deep/.segmented-control__text {
- font-size: 34rpx !important;
- }
- /deep/.uni-data-checklist {
- padding-left: 20upx;
- }
- uni-picker {
- position: relative;
- display: block;
- cursor: pointer;
- padding-left: 20rpx !important;
- padding-top: 14rpx !important;
- color: grey !important;
- }
- /deep/.uni-date-x--border {
- border: 0px solid #dcdfe6 !important;
- }
- /deep/.is-input-border {
- border: 0px solid #c8c7cc !important;
- }
- /deep/.uni-progress-info {
- font-size: 25rpx !important;
- }
- /deep/.uni-error-message {
- position: absolute;
- bottom: -20rpx !important;
- left: 20rpx !important;
- text-align: left;
- }
- /deep/.uni-forms-item__inner {
- padding-bottom: 0rpx !important;
- margin-bottom: 30rpx !important;
- border-bottom: 0.5rpx solid #CCCCCC;
- }
- /deep/.uni-group__title {
- background-color: #FFFFFF !important;
- }
- /deep/.uni-list-item__content-title {
- font-size: 30rpx !important;
- color: #111111 !important;
- }
- /deep/.uni-progress-bar {
- border-radius: 10rpx !important;
- }
- /deep/.uni-progress-inner-bar {
- border-radius: 10rpx !important;
- }
- /deep/.is-input-border {
- border-radius: 20px !important;
- background-color: #fff;
- }
- .uni-easyinput__content-input {
- font-size: 30upx !important;
- }
- .content-clear-icon {
- font-size: 40upx !important;
- }
- /deep/.input-box {
- padding: 50upx;
- font-size: 30upx;
- .input-item {
- display: flex;
- border: 1upx solid #F8F8F8;
- line-height: 90upx;
- height: 90upx;
- margin-top: 20upx;
- background: #F8F8F8;
- border-radius: 48upx;
- .input-label {
- width: 150upx;
- text-align: center;
- }
- .input-body {
- position: relative;
- height: 100upx;
- width: calc(100% - 150upx);
- .input {
- line-height: 90upx;
- height: 90upx;
- position: relative;
- font-size: 28upx;
- }
- .eye {
- position: absolute;
- height: 50upx;
- width: 50upx;
- right: 20upx;
- top: 50%;
- transform: translateY(-50%);
- }
- .btn-code {
- position: absolute;
- right: 0upx;
- top: 50%;
- transform: translateY(-50%);
- background: none;
- color: #205592;
- width: 160upx;
- font-size: 24upx;
- box-sizing: border-box;
- text-align: center;
- padding: 0;
- height: 100upx;
- line-height: 100upx;
- }
- }
- }
- .select {
- // padding-top: 40upx;
- display: flex;
- justify-content: space-between;
- color: #003B67;
- }
- }
- /deep/.title-left {
- width: 3px;
- height: 16px;
- background: #267CFF;
- display: inline-block;
- border-radius: 3px;
- margin-top: 3px;
- vertical-align: top;
- margin-right: 10px;
- }
- .card {
- padding: 24rpx;
- margin-top: 30rpx;
- border: 1rpx solid #F0D232;
- background-color: #ffffff;
- margin: 0 10rpx;
- }
- .head {
- padding-top: 5%;
- padding: 0 0 0 1%;
- height: 80rpx;
- margin-top: 2%;
- }
- .head span {
- color: #333333;
- font-size: 80%;
- font-weight: 550;
- text-indent: 2em;
- }
- .head image {
- vertical-align: middle;
- width: 50rpx;
- height: 50rpx;
- display: inline-block;
- padding-right: 14rpx;
- }
- .home-link {
- /deep/.uni-easyinput__content-input {
- background-color: #EBEBEB;
- border-radius: 15rpx;
- }
- }
- .heng-line {
- margin-top: 60rpx;
- margin-bottom: 50rpx;
- border: 1rpx solid #DCDCDC;
- }
- .signupbtn p {
- font-size: 30rpx;
- }
- .exit-btn {
- width: 120%;
- text-align: center;
- background-color: #C0C0C0;
- border-radius: 10rpx;
- color: #FFFFFF;
- font-size: 30rpx;
- line-height: 180%;
- }
- .main-btn {
- width: 300rpx;
- text-align: center;
- background-color: #FCCF41;
- border-radius: 10rpx;
- color: #000000;
- font-size: 30rpx;
- line-height: 180%;
- }
- .uni-input-placeholder {
- font-size: 24rpx !important;
- }
- /deep/.uni-date-x--border {
- border: 0px solid #dcdfe6 !important;
- }
- /deep/.is-input-border {
- border: 0px solid #c8c7cc !important;
- }
- .example {
- padding: 0 15px 15px;
- }
- .example-info {
- padding: 15px;
- color: #3b4144;
- background: #ffffff;
- }
- .example-body {
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- flex-direction: row;
- flex-wrap: wrap;
- justify-content: center;
- padding: 0;
- font-size: 14px;
- background-color: #ffffff;
- }
- /* #endif */
- .example {
- padding: 0 15px;
- }
- .example-info {
- /* #ifndef APP-NVUE */
- display: block;
- /* #endif */
- padding: 15px;
- color: #3b4144;
- background-color: #ffffff;
- font-size: 14px;
- line-height: 20px;
- }
- .example-info-text {
- font-size: 14px;
- line-height: 20px;
- color: #3b4144;
- }
- .example-body {
- flex-direction: column;
- padding: 15px;
- background-color: #ffffff;
- }
- .number-inupt {
- display: flex !important;
- align-items: center !important;
- }
- </style>
|