| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- <extend name="public/base"/>
- <block name="css">
- <style>
- .van-nav-bar--fixed {z-index:100;}
- .van-nav-bar .van-icon,.van-nav-bar__text {color:white;}
- .van-step--horizontal .van-step__title {font-size:16px;}
- .van-step--horizontal .van-step__icon {font-size:16px;}
- .van-step__circle {width:10px;height:10px;}
- .van-row {width:100%;}
- .btn_search_item{background:#f2f6ff;display:inline-block;border-radius:5px;line-height:35px;height:35px;text-align:center;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;position:relative;font-size:13px;width:100%;color:#666;margin-bottom:10px;}
- .btn_search_item.active{color:var(--pink);background:#fff7fa;}
- .btn_search_icon{position:absolute;bottom:-3px;right:-3px;font-size:30px;}
- .van-uploader__input-wrapper {width:100%;}
- </style>
- </block>
- <block name="body">
- <!--头部-->
- <van-nav-bar
- class="bg-pink"
- left-text="返回"
- left-arrow
- @click-left="onBack"
- fixed="true"
- >
- <template #title>
- <span style="color:white;">我的资料</span>
- </template>
- </van-nav-bar>
- <div style="width:100%;height:46px;"></div>
- <!--头图-->
- <van-uploader :max-count="1" :after-read="uploadHead" style="padding:20px 0;width:100%;">
- <van-image width="30%" style="display:block;margin:0 auto;" :src="head_image"></van-image>
- <div style="text-align:center;font-size:14px;color:#999;">点击上传头像</div>
- </van-uploader>
- <!--增空-->
- <van-field
- v-model="form.name"
- label="真实姓名"
- placeholder="请输入真实姓名"
- required
- ></van-field>
- <van-field
- v-model="form.mobile"
- label="电话"
- placeholder="请输入电话号码"
- required
- ></van-field>
- <div style="padding:16px;">
- <van-button block class="bg-pink" @click="onSubmit">提交</van-button>
- </div>
- </block>
- <block name="script">
- <script>
- new Vue({
- el: '#app',
- data() {
- return {
- form: {$matchmaker},
- };
- },
- methods: {
- onBack() {
- history.back();
- },
- onSubmit() {
- if (this.form.realname == '') {
- this.$toast('请输入真实姓名');
- return false;
- }
- if (this.form.mobile == '') {
- this.$toast('请选择性别');
- return false;
- }
- $.post("{:url('infoPost')}", this.form, function (json) {
- location.href = "{:url('index')}";
- }, 'json');
- },
- uploadHead(file) {
- let self = this;
- $.post("{:url('imageUpload')}",{file:file.content,name:file.file.name},function(json){
- if (json.code) {
- self.form.avatar = json.data.avatar;
- self.$forceUpdate();
- } else {
- self.$toast(json.msg);
- }
- },'json')
- },
- },
- computed: {
- head_image() {
- return this.form.avatar ? this.form.avatar : '__TMPL__/public/assets/images/matchmaker/avatar2.png';
- }
- },
- });
- </script>
- </block>
|