报名工具小程序初始代码

This commit is contained in:
liupopo
2024-02-06 09:36:25 +08:00
commit d7420944ba
202 changed files with 41300 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,109 @@
<template>
<view>
<RefreshView ref="mescrollRef" :hasBack="true" text="编辑内容" :useDownScroll="false" :useUpScroll="false"
useTitleRightBtn="1" titleRightBtnSource="确定" @rightBtn='rightBtnClick'>
<RichTextEditor ref="rich" placeholder="请输入...." :html="htmlStr" :removeHeight="topBarHeight"
@insertPic="insert">
</RichTextEditor>
</RefreshView>
</view>
</template>
<script>
export default {
data() {
return {
topBarHeight: '0px',
htmlStr: "",
activityBaseInfo: {
disclaimer: "",
}
};
},
onLoad: function(option) {
// this.activityBaseInfo.introduction = option.introduction;
console.log("options>>>", option)
let t = option.disclaimer == "undefined" ?"":option.disclaimer;
this.htmlStr = t
},
created() {
this.topBarHeight = getApp().globalData.totalHeightPx
},
mounted() {
},
methods: {
insert(e) {
console.log("11111111》》》》"+e)
this.Upload({
url: 'activity/uploadGameImg',
filePath: e,
key: "file",
loading: true
}).then((res) => {
this.$refs.rich.insertUrlImage(res.data)
}, (err) => {
})
},
getHtml() {
return this.$refs.rich.getHtml();
},
rightBtnClick() {
let reg1 = new RegExp('<p>', 'g') //g代表全部
let reg2 = new RegExp('</p>', 'g') //g代表全部
let reg3 = new RegExp('<br>', 'g') //g代表全部
let reg4 = new RegExp('"', 'g') //g代表全部
let newMsg = JSON.stringify(this.getHtml()).replace(reg1, '').replace(reg2, '\n').replace(reg3, '').replace(reg4, '');
// let articleData = this.getHtml().replace('</p>*$<p>', /\n/g)
console.log(newMsg)
this.activityBaseInfo.disclaimer = newMsg
// this.data.activityBaseInfo.introduction = this.getHtml()
this.SetResult(this.activityBaseInfo)
},
}
};
</script>
<style lang="less">
.bottom {
display: flex;
height: 800rpx;
margin-top: 20rpx;
margin-left: 30rpx;
margin-right: 30rpx;
flex-direction: column;
border: 1rpx solid #C8C7CC;
padding: 30rpx 20rpx;
background: #FDFBFB;
border-radius: 8rpx;
.input {
margin-top: 10rpx;
white-space: pre-line;
font-size: 30rpx;
color: #898989;
height: 500rpx;
line-height: 50rpx;
}
}
.btn {
justify-content: center;
width: 100%;
margin-top: 100rpx;
padding: 30rpx;
font-size: 28rpx;
color: #FFFFFF;
background: #007AFF;
text-align: center;
flex: 1;
position: absolute;
bottom: 0;
}
</style>

View File

@@ -0,0 +1,73 @@
<template>
<view>
<RefreshView ref="mescrollRef" :hasBack="true" text="编辑内容" :useDownScroll="false" :useUpScroll="false"
useTitleRightBtn="1" titleRightBtnSource="确定" @rightBtn='rightBtnClick'>
<RichTextEditor ref="rich" placeholder="请输入...." :html="htmlStr" :removeHeight="topBarHeight"
@insertPic="insert">
</RichTextEditor>
</RefreshView>
</view>
</template>
<script>
export default {
data() {
return {
topBarHeight: '0px',
htmlStr: "",
data: {
introduction: "",
}
};
},
onLoad: function(option) {
// this.activityBaseInfo.introduction = option.introduction;
console.log("options>>>", option)
// let t = JSON.parse(decodeURIComponent(option.introduction));
// this.htmlStr = t.html
let t = option.introduction == "undefined" ?"":option.introduction;
this.htmlStr = t
},
created() {
this.topBarHeight = getApp().globalData.totalHeightPx
},
mounted() {
},
methods: {
insert(e) {
this.chooseUpload(9)
.then((res) => {
console.log("url>>>>", res);
this.$refs.rich.insertUrlImage(res.urls)
})
},
getHtml() {
return this.$refs.rich.getHtml();
},
rightBtnClick() {
console.log(this.getHtml())
let reg1 = new RegExp('<p>', 'g') //g代表全部
let reg2 = new RegExp('</p>', 'g') //g代表全部
let reg3 = new RegExp('<br>', 'g') //g代表全部
let reg4 = new RegExp('"', 'g') //g代表全部
let newMsg = JSON.stringify(this.getHtml()).replace(reg1, '').replace(reg2, '\n').replace(reg3, '')
.replace(reg4, '');
// let articleData = this.getHtml().replace('</p>*$<p>', /\n/g)
console.log(newMsg)
this.data.introduction = newMsg
// this.data.activityBaseInfo.introduction = this.getHtml()
this.SetResult(this.data)
},
}
};
</script>
<style>
</style>

View File

@@ -0,0 +1,95 @@
<template>
<RefreshView ref="mescrollRef" text="报名条件" :useDownScroll="false" :useUpScroll="false" :useTitleLeftBtn="1" titleLeftBtnSource="设置" @leftBtn='setup'>
<view class="row">
<text class="field">性别限制</text>
<radio-group @change="radioSexChange($event)">
<radio :checked="data.activityItemCondition.sex==0" :value="0" >不限</radio>
<radio :checked="data.activityItemCondition.sex==1" :value="1" style="margin-left: 80rpx;"></radio>
<radio :checked="data.activityItemCondition.sex==2" :value="2" style="margin-left: 80rpx;"></radio>
</radio-group>
</view>
<view class="line-thin"></view>
<picker mode="multiSelector" :range="page.age" @change="bindAgeChange($event,index)">
<view class="row">
<text class="field">年龄段</text>
<text class="explain">{{page.ageRangeText}}</text>
<image class = "more" src="../../static/img/public/more.png" ></image>
</view>
</picker>
</RefreshView>
</template>
<script>
export default {
data() {
return {
data:{
activityItemCondition:{
sex:0,
minAge:0,
maxAge:0
}
},
page:{
age:[
[],
[]
]
},
ageRangeText:""
}
},
onLoad(options){
let activityItemCondition = JSON.parse(options.activityItemCondition)
let _this = this
if (activityItemCondition != undefined){
_this.data.activityItemCondition.sex = activityItemCondition.sex == undefined ?0 :activityItemCondition.sex;
_this.data.activityItemCondition.minAge = activityItemCondition.minAge == undefined ?0:activityItemCondition.minAge;
_this.data.activityItemCondition.maxAge = activityItemCondition.maxAge == undefined ?0:activityItemCondition.maxAge;
}
// 设置10岁到100岁的数组
_this.page.age[0].push("不限")
_this.page.age[1].push("不限")
for(let i =10; i<=100; i++){
_this.page.age[0].push(i + "岁");
_this.page.age[1].push(i + "岁");
}
// 年龄段范围文字赋值
this.page.ageRangeText = this.convertAgeRangeText(this.data.activityItemCondition.minAge,this.data.activityItemCondition.maxAge)
},
methods:{
radioSexChange(e) {
let _this = this
_this.data.activityItemCondition.sex = e.detail.value
},
bindAgeChange(e,index){
console.log("--------------------------",JSON.stringify(e.detail.value[0]))
if (e.detail.value[0] == 0){this.data.activityItemCondition.minAge = 0}else{this.data.activityItemCondition.minAge = e.detail.value[0] + 9}
if (e.detail.value[1] == 0){this.data.activityItemCondition.maxAge = 0}else{this.data.activityItemCondition.maxAge = e.detail.value[1] + 9}
// this.page.ageRange = this.page.age[0][e.detail.value[0]] + " 到 " + this.page.age[1][e.detail.value[1]]
this.page.ageRangeText = this.convertAgeRangeText(this.data.activityItemCondition.minAge,this.data.activityItemCondition.maxAge)
},
setup(){
this.data.activityItemCondition = JSON.stringify(this.data.activityItemCondition)
this.SetResult(this.data)
},
convertAgeRangeText(minAge,maxAge){
if(minAge == 0 && maxAge == 0 ){
return "不限年龄"
}
if(minAge == 0 && maxAge > 0 ){
return maxAge + "岁以下"
}
if(minAge > 0 && maxAge == 0 ){
return minAge + "岁以上"
}
if(minAge > 0 && maxAge > 0 ){
return minAge + "岁 至 " + maxAge +"岁"
}
}
}
}
</script>
<style>
@import url("../../static/master.css");
</style>

View File

@@ -0,0 +1,89 @@
<template>
<RefreshView ref="mescrollRef" text="报名必填项" :useDownScroll="false" :useUpScroll="false" :useTitleLeftBtn="1" titleLeftBtnSource="保存" @leftBtn='save'>
<view class="row">
<text class="field">真实姓名</text>
<checkbox class="checkbox" :checked="data.onRealName" @click="checkboxChange('onRealName')"> </checkbox>
</view>
<view class="line-thin"></view>
<view class="row">
<text class="field">性别</text>
<checkbox-group class="item_check" >
<checkbox class="checkbox" :checked="data.onSex" @click="checkboxChange('onSex')"></checkbox>
</checkbox-group>
</view>
<view class="line-thin"></view>
<view class="row">
<text class="field">生日</text>
<checkbox class="checkbox" :checked="data.onBirthday" @click="checkboxChange('onBirthday')"></checkbox>
</view>
<view class="line-thin"></view>
<view class="row">
<text class="field">地区</text>
<checkbox class="checkbox" :checked="data.onAdCode" @click="checkboxChange('onAdCode')"></checkbox>
</view>
</RefreshView>
</template>
<script>
export default {
data() {
return {
data:{
onRealName:true,
onSex:true,
onBirthday:true,
onAdCode:false
}
}
},
onLoad(options){
this.data.onRealName = options.onRealName == 1?true:false
this.data.onSex = options.onSex == 1?true:false
this.data.onBirthday = options.onBirthday == 1?true:false
this.data.onAdCode = options.onAdCode == 1?true:false
},
methods: {
checkboxChange(index) {
let _this = this
if ( index == "onRealName" ){
this.data.onRealName = !this.data.onRealName
}
if ( index == "onSex"){
this.data.onSex = !this.data.onSex
}
if ( index == "onBirthday"){
this.data.onBirthday = !this.data.onBirthday
}
if ( index == "onAdCode"){
this.data.onAdCode = !this.data.onAdCode
}
},
save(){
console.log("报名必填项",this.data)
this.data.onRealName = this.data.onRealName == true?1:0
this.data.onSex = this.data.onSex == true?1:0
this.data.onBirthday = this.data.onBirthday == true?1:0
this.data.onAdCode = this.data.onAdCode == true?1:0
this.SetResult(this.data)
// let _this = this
// _this.HTTP({
// url: 'aos/v1/enrollRequired/saveEnrollRequired',
// method: 'POST',
// data: _this.data,
// paramsType: "JSON",
// loading: true
// })
// .then((res) => {
// uni.navigateBack({
// delta: 1
// })
// });
}
}
}
</script>
<style lang="scss">
@import url("../../static/master.css");
</style>

View File

@@ -0,0 +1,128 @@
<template>
<RefreshView ref="mescrollRef" :hasBack="true" text="人数限制" :useDownScroll="false" :useUpScroll="false"
useTitleRightBtn="1" titleRightBtnSource="保存" @rightBtn='rightBtnClick'>
<view style="display: flex;flex-direction: column;margin-top: 50rpx;margin-left: 30rpx;margin-right: 30rpx;">
<text>人数限制</text>
<view style="display: flex;flex-direction: row;align-items: center;margin-top: 20rpx;">
<view style="border: 2px #F1F1F1 solid;display: flex; ">
<input class="right" type="number" @input="enrollNumbersLimitText" placeholder="请输入人数限制"
:value="result.enrollNumbersLimit"></input>
</view>
<text
style="display: flex;flex: 1; justify-content: flex-end; font-size: 30rpx;color: #FF0000;">0为不限制</text>
</view>
</view>
<view style="display: flex;flex-direction: column;margin-top: 50rpx;margin-left: 30rpx;margin-right: 30rpx;">
<text>报名费用</text>
<view style="display: flex;flex-direction: row;align-items: center;margin-top: 20rpx;">
<view style="border: 2px #F1F1F1 solid;display: flex; ">
<input class="right" type="digit" @input="enrollMoneyText" placeholder="请输入报名费用"
:value="result.enrollMoney"></input>
</view>
<text
style="display: flex;flex: 1; justify-content: flex-end; font-size: 30rpx;color: #FF0000;">0为免费</text>
</view>
</view>
<!-- <radio-group v-if="!this.IsEmpty(result.enrollMoney)" style="margin-top: 50rpx; display: flex;flex-direction: row; " @change="radioChange">
<radio style="display: flex;flex: 1;justify-content: center;" :checked="result.checked1">线上收费</radio>
<radio style="display: flex;flex: 1;justify-content: center;" :checked="result.checked2">线下收费</radio>
</radio-group>
-->
</RefreshView>
</template>
<script>
export default {
data() {
return {
result: {
enrollNumbersLimit: "0",
enrollMoney: "0",
// type: "",
// checked1: "",
// checked2: "",
},
}
},
onLoad(options) {
this.result.enrollNumbersLimit = options.enrollNumbersLimit
this.result.enrollMoney = options.enrollMoney
// this.result.type = options.type
// if ("线上收费" == this.result.type) {
// this.result.checked1 = true
// this.result.checked2 = false
// } else {
// this.result.checked1 = false
// this.result.checked2 = true
// }
console.log("1===" + this.result.index)
console.log("2===" + this.result.enrollNumbersLimit)
console.log("3===" + this.result.enrollMoney)
// console.log("4===" + this.result.type)
},
methods: {
enrollNumbersLimitText(e) {
console.log("1===" + e.detail.value)
this.result.enrollNumbersLimit = e.detail.value
},
enrollMoneyText(e) {
console.log("2===" + e.detail.value)
this.result.enrollMoney = e.detail.value
},
// radioChange(e) {
// this.result.checked1 = !this.result.checked1
// this.result.checked2 = !this.result.checked2
// console.log('radio发生change事件携带value值为', this.result.checked1)
// console.log('radio发生change事件携带value值为', this.result.checked2)
// if (this.result.checked1) {
// this.result.type = "线上收费"
// } else {
// this.result.type = "线下收费"
// }
// console.log('type===》:', this.result.type)
// },
rightBtnClick() {
if (this.IsEmpty(this.result.enrollNumbersLimit)) {
this.result.enrollNumbersLimit = 0
}
let o = parseInt(this.result.enrollNumbersLimit)
if (isNaN(o)) {
this.Toast("输入的格式有误")
return
}
if (this.IsEmpty(this.result.enrollMoney)) {
this.result.enrollMoney = 0
}
let s = parseInt(this.result.enrollMoney)
if (isNaN(s)) {
this.Toast("输入的格式有误")
return
}
this.SetResult(this.result)
}
}
}
</script>
<style lang="scss">
.right {
padding: 20rpx;
flex: 1;
color: #555555;
font-size: 30rpx;
}
</style>

324
pages/publish/Publish.vue Normal file
View File

@@ -0,0 +1,324 @@
<template>
<view>
<RefreshView ref="mescrollRef" text="首页" :useDownScroll="false" :useUpScroll="false" pageBg="#F1F2F5">
<view style="display: flex;flex-direction: column;align-items: center;width: 100vw;">
<view style="display: flex;flex-direction: column;width: 100vw;align-items: center;background-color: #2fa1f0;padding-top: 80rpx;
border-bottom-right-radius: 30rpx;border-bottom-left-radius: 30rpx;">
<view style="width: 100vw;text-align: center;font-size: 40px;font-weight: 700;color: #fff;" >
体育活动
</view>
<view style="width: 100vw;text-align: center;font-size: 22px;font-weight: 600;color: #fff;margin-top: 10rpx;">
组织报名工具
</view>
<text style="margin-top: 80rpx;color:#fff;font-size: 16px;">一分钟创建 轻松组织活动</text>
<view style="display: flex;flex-direction: row;margin-top: 40rpx;justify-content: center;margin-bottom: 100rpx;align-items: center;">
<image src="../../static/img/public/visits.png" style="width: 35rpx;height: 35rpx;"></image>
<text style="margin-left: 20rpx;color: #fff;font-size: 12px;">访问量{{visits}}</text>
</view>
</view>
</view>
<view style="display: flex;flex-direction: row;margin-top: 60rpx;margin-left: 30rpx;align-items:baseline">
<text style="font-weight: 400; color: #E99D42 ;font-size: 36rpx;">发布活动类别</text>
<text style="margin-left: 20rpx;font-weight: 400; color: #E99D42;font-size: 28rpx;">(点击体育活动标签发布)</text>
</view>
<view style="display: flex; margin-left: 10rpx;margin-right: 30rpx;margin-top: 40rpx;justify-content: center;">
<grid>
<view style="display: flex; margin-bottom: 10rpx; margin-left: 10rpx;margin-right: 10rpx;" v-for="(item,index) in SportCategoryList">
<text class="labelLayout" @click="onClick(index)">{{item.sportCategoryName}}</text>
</view>
</grid>
</view>
<view class="line" style=" margin-top: 100rpx;margin-left: 30rpx;margin-right: 30rpx;"></view>
<view
style="display: flex;flex-direction: column;margin-top: 40rpx;margin-bottom: 20rpx;margin-left: 30rpx;margin-right: 30rpx;">
<text style="font-size: 32rpx;color: #666666;font-weight: 600">友情提示</text>
<text style="font-size: 30rpx;color: #666666;margin-top: 40rpx;font-weight: 500;">{{notices}}</text>
</view>
<view class="line" style=" margin-left: 30rpx;margin-right: 30rpx;margin-top: 40rpx;"></view>
<view style="margin-top: 30rpx;margin-left: 30rpx;margin-right: 30rpx;">
<text style="font-size: 40rpx;color: #4095E5;font-weight: 600" @click="jump()">{{page.city}}</text>
<text style="font-size: 32rpx;color: #666666;font-weight: 500;margin-left: 20rpx;">共有{{activityAmount}}场活动</text>
</view>
<view style="height: 150px;"></view>
</RefreshView>
</view>
</template>
<script>
// 必须
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
export default {
// 使用mixin (在main.js注册全局组件) 必须
mixins: [MescrollMixin],
data() {
return {
index: 0,
notices: "\u3000\u3000您注册的帐号可以在宇运动主体下的子平台一号通行同时您发布的活动将会按类别发布到各子平台。点击查看宇运动子平台",
list: [],
SportCategoryList: [],
page: {
city: "正在获取...",
code: ""
},
visits: "...",
activityAmount: "..."
}
},
onLoad(options) {
this.HTTP({
url: 'aos/v1/activity/add1PointOnVisits',
method: 'GET',
data: {},
paramsType: "FORM",
loading: false
}).then((res) => {
});
let that = this
let find_city_code = this.ReadPreference("find_city_code")
let find_city = this.ReadPreference("find_city")
if (this.IsEmpty(find_city_code)) {
// 首次进入
find_city_code = 0;
// 获取定位
let _this = this;
// 获取定位
uni.getLocation({
type: 'gcj02',
success: function(res) {
let locat = res
console.log("latitude", res.longitude);
console.log("longitude", res.latitude);
// 先写入定位
_this.location = {
latitude: locat.latitude,
longitude: locat.longitude
}
let url =
"https://restapi.amap.com/v3/geocode/regeo?key=59970402d1c3f7dc1efff17d4dfcff21&location=" +
res.longitude + "," + res.latitude +
"&poitype=&radius=1000&extensions=all&batch=false&roadlevel=0";
_this.HttpOtherUrl({
url: url
}).then((res) => {
let json = JSON.stringify(res);
let info = JSON.parse(json).regeocode.addressComponent;
// 城市
let city = info.city;
// 城市编码
let code = info.adcode;
// 获取到正确的城市编码
if (code > 0) {
console.log("find_city1", city);
console.log("find_city_code1", code);
// 保存本次定位
_this.WritePreference("find_city", city)
_this.WritePreference("find_city_code", code)
_this.page.code = code
_this.page.city = city
_this.getCode()
} else {
console.log("find_city2", city);
console.log("find_city_code2", code);
// 未获取到正确的城市编码
_this.WritePreference("find_city", "石家庄")
_this.WritePreference("find_city_code", "130104")
_this.page.code = "130104"
_this.page.city = "石家庄"
_this.getCode()
}
}, (err) => {
console.log("find_city3", "石家庄");
console.log("find_city_code3", "130104");
//获取当前城市失败
_this.WritePreference("find_city", "石家庄")
_this.WritePreference("find_city_code", "130104")
_this.page.code = "130104"
_this.page.city = "石家庄"
_this.getCode()
})
},
fail(err) {
console.log("find_city4", "石家庄");
console.log("find_city_code4", "130104");
// 定位失败
_this.WritePreference("find_city", "石家庄")
_this.WritePreference("find_city_code", "130104")
_this.page.code = "130104"
_this.page.city = "石家庄"
_this.getCode()
}
});
} else {
this.page.code = find_city_code
this.page.city = find_city
this.getCode()
}
},
onShow() {
let find_city_code = this.ReadPreference("find_city_code")
let find_city = this.ReadPreference("find_city")
if (!this.IsEmpty(find_city_code)) {
this.getCode()
}
},
methods: {
// wwww(){
// uni.navigateTo({
// url: "../team/CreateTeam"
// })
// },
getCode() {
let that = this
that.HTTP({
url: 'aos/v1/activity/getActivityCreatePageParameter',
method: 'GET',
data: {
"adcode": this.page.code
},
paramsType: "FORM",
loading: true
}).then((res) => {
that.SportCategoryList = res.data.listSportCategoryArea
that.activityAmount = res.data.activityAmount
that.visits = res.data.visits
});
},
onClick(index) {
this.WxSilentLogin()
uni.navigateTo({
url: "../publish/CreateActivity?sportCategoryName=" + this.SportCategoryList[index].sportCategoryName +
"&sportCategorySid=" + this.SportCategoryList[index].sid
})
},
jump() {
console.log('this.page.code', this.page.code)
uni.switchTab({
url: "../home/FindFragment"
})
}
}
}
</script>
<style lang="scss">
.line {
height: 5rpx;
background-color: #eee
}
.btn {
display: flex;
width: 80%;
height: 80rpx;
flex-direction: column;
background-color: $uni-base-color;
margin-left: auto;
margin-right: auto;
align-items: center;
justify-content: center;
border-radius: 10rpx;
}
.nav-bar {
height: 92rpx;
width: 100%;
display: flex;
justify-content: space-between;
.bar-text {
font-size: 32rpx;
height: 100%;
line-height: 92rpx;
padding-left: 28rpx;
}
.bar-img {
width: 90rpx;
height: 92rpx;
padding-right: 28rpx;
}
}
.top {
display: flex;
flex-direction: row;
height: 100rpx;
background: #FFFFFF;
opacity: 0.8;
align-items: center;
border-radius: 20rpx;
margin-top: 20rpx;
margin-left: 30rpx;
margin-right: 30rpx;
.unselected {
text-align: center;
font-size: 28rpx;
font-family: Adobe Heiti Std;
font-weight: normal;
color: #191919;
line-height: 40rpx;
}
.selected {
text-align: center;
font-size: 28rpx;
font-family: Adobe Heiti Std;
font-weight: normal;
color: #2CAB69;
line-height: 40rpx;
border-bottom: 2rpx #2CAB69 solid;
padding-bottom: 10rpx;
}
}
.btn1 {
background: #BBBBBB;
}
.btn2 {
background: #0081D5;
}
.labelLayout {
flex: 1;
width: 100%;
margin-left: 20rpx;
margin-right: 20rpx;
background-color: #F2BF5C;
color: #FFFFFF;
padding-top: 8rpx;
padding-bottom: 8rpx;
padding-left: 20rpx;
padding-right: 20rpx;
justify-content: center;
text-align: center;
font-size: 30rpx;
}
</style>

View File

@@ -0,0 +1,8 @@
<template>
</template>
<script>
</script>
<style>
</style>

View File

@@ -0,0 +1,89 @@
<template>
<RefreshView ref="mescrollRef" :hasBack="true" text="联系方式" :useDownScroll="false" :useUpScroll="false"
useTitleRightBtn="1" titleRightBtnSource="确定" @rightBtn='rightBtnClick'>
<view style="display: flex;flex-direction: column;">
<text style=" margin-top: 50rpx; margin-left: 65rpx;">联系人</text>
<view class="input" style="margin-top: 20rpx;">
<input class="input_text" v-model="activityBaseInfo.linkerName" @input="nameText" placeholder="请输入联系人" />
</view>
<text style=" margin-top: 50rpx; margin-left: 65rpx; margin-top: 30rpx;">联系电话</text>
<view class="input" style="margin-top: 20rpx;">
<input class="input_text" type="number" v-model="activityBaseInfo.linkerPhone" maxlength="11"
@input="phoneText" placeholder="请输入联系电话" />
</view>
</view>
</RefreshView>
</template>
<script>
export default {
data() {
return {
activityBaseInfo: {
linkerName: "",
linkerPhone: "",
}
};
},
onLoad: function(option) {
this.activityBaseInfo.linkerName =option.linkerName;
this.activityBaseInfo.linkerPhone = option.linkerPhone;
console.log(JSON.stringify(this.activityBaseInfo))
},
mounted() {
},
methods: {
nameText(e) {
this.activityBaseInfo.linkerName = e.detail.value;
},
phoneText(e) {
this.activityBaseInfo.linkerPhone = e.detail.value
},
rightBtnClick() {
if (this.IsEmpty(this.activityBaseInfo.linkerName)) {
this.Toast("请输入联系人姓名")
return
}
let o = parseInt(this.activityBaseInfo.linkerPhone)
if (isNaN(o) || !this.activityBaseInfo.linkerPhone.startsWith(1) || this.activityBaseInfo.linkerPhone.length !=
11) {
this.Toast("输入的电话格式有误")
} else {
this.SetResult(this.activityBaseInfo)
console.log(this.activityBaseInfo)
}
},
}
}
</script>
<style lang="scss">
.input {
margin-left: 65rpx;
margin-right: 65rpx;
height: 80rpx;
background: #F2F2F2;
border-radius: 42rpx;
padding-left: 30rpx;
padding-right: 30rpx;
display: flex;
align-items: center;
.input_text {
width: 100%;
}
}
</style>