註冊頁、首頁、會員編輯頁製作

dev
bruce68410 3 years ago
parent d374e3c57e
commit d1bf76329c

@ -541,20 +541,37 @@ h1, h2, h3, h4, h5, h6 {
} }
/* ========================================= vant ============================================= */ /* ========================================= vant ============================================= */
.van-field__label { .van-notice-bar {
position: relative; font-size: 18px;
font-weight: bold;
} }
.van-field__label:before {
position: absolute; .van-popup.van-toast {
left: -8px; display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
padding: 30px;
}
.van-popup.cropPopup {
display: block;
max-width: 400px;
width: 90%;
height: 430px;
top: 30%;
margin: auto;
padding: 0;
} }
.van-tabs { .van-tabs {
padding: 20px 0 0px; padding: 20px 0 0px;
} }
.van-tabs .van-tabs__wrap { .van-tabs .van-tabs__wrap {
height: initial; height: initial !important;
} }
.van-tabs .van-tabs__wrap .van-tabs__nav { .van-tabs .van-tabs__wrap .van-tabs__nav {
padding: 0; padding: 0;
@ -583,13 +600,45 @@ h1, h2, h3, h4, h5, h6 {
.van-cell-group { .van-cell-group {
border-radius: 5px; border-radius: 5px;
margin-bottom: 15px;
overflow: hidden; overflow: hidden;
} }
.van-cell-group .van-cell {
padding: 6px 16px;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.van-cell-group .van-cell::after { .van-cell-group .van-cell::after {
border-bottom: 1px #e3e3e3 solid; border-bottom: 1px #e3e3e3 solid;
-webkit-transform: none; -webkit-transform: none;
transform: none; transform: none;
} }
.van-cell-group .van-cell.longText .van-field__label {
width: 160px;
}
.van-cell-group .van-cell .van-field__label {
position: relative;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
padding: 4px 0;
font-weight: bold;
}
.van-cell-group .van-cell .van-field__label:before {
position: absolute;
left: -8px;
}
.van-cell-group .van-cell .van-field__label i, .van-cell-group .van-cell .van-field__label svg {
color: #5b7b94;
margin-top: 5px;
margin-right: 5px;
}
.van-cell-group .van-cell .van-field__label--top i, .van-cell-group .van-cell .van-field__label--top svg {
color: #5b7b94;
margin-top: 0px;
margin-right: 5px;
}
/* ========================================= stage ============================================= */ /* ========================================= stage ============================================= */
.content { .content {
@ -597,49 +646,45 @@ h1, h2, h3, h4, h5, h6 {
background-color: #b2c4ce; background-color: #b2c4ce;
} }
.card { .upload-main {
border: none;
margin-bottom: 15px;
}
.card .card-body {
padding: 5px 15px;
}
.card .card-body .item {
position: relative;
display: -webkit-box; display: -webkit-box;
display: -ms-flexbox; display: -ms-flexbox;
display: flex; display: flex;
-webkit-box-pack: justify; -webkit-box-pack: center;
-ms-flex-pack: justify; -ms-flex-pack: center;
justify-content: space-between; justify-content: center;
-webkit-box-align: center; -webkit-box-align: center;
-ms-flex-align: center; -ms-flex-align: center;
align-items: center; align-items: center;
width: 100%;
font-size: 15px;
} }
.card .card-body .item + .item { .upload-main .upload-img {
border-top: 1px solid #e3e3e3; width: 100px;
aspect-ratio: 1/1;
border-radius: 50%;
border: 1px #d8d8d8 solid;
} }
.card .card-body .item .left {
-webkit-box-flex: 0; .cropper {
-ms-flex: 0 0 auto; height: 300px;
flex: 0 0 auto; background: #DDD;
padding: 8px 0;
font-weight: bold;
} }
.card .card-body .item .right {
-webkit-box-flex: 1; .cropper-section {
-ms-flex: 1 0 0px; margin: 0 auto;
flex: 1 0 0; position: fixed;
color: #666; text-align: center;
top: 60px;
width: 100%;
max-width: 500px;
z-index: 8888;
} }
.card .card-body .item .right a { .cropper-section .crop-area {
color: #666; margin: 5 auto;
width: 100%;
} }
.card .card-body .item i, .card .card-body .item svg { .cropper-section .crop-btn {
color: #839eb6; background-color: #666;
margin-right: 6px; text-align: center;
} }
/* ========================================= other ============================================= */ /* ========================================= other ============================================= */

@ -4,20 +4,32 @@
/* ========================================= vant ============================================= */ /* ========================================= vant ============================================= */
.van-field__label{ .van-notice-bar{
position: relative; font-size: 18px;
font-weight: bold;
&:before{
position: absolute;
left:-8px;
}
} }
.van-popup{
&.van-toast{
display: flex;
justify-content: center;
align-items: center;
padding: 30px;
}
&.cropPopup{
display: block;
max-width: 400px;
width: 90%;
height: 430px;
top: 30%;
margin: auto;
padding: 0;
}
}
.van-tabs{ .van-tabs{
padding:20px 0 0px; padding:20px 0 0px;
.van-tabs__wrap{ .van-tabs__wrap{
height:initial; height:initial !important;
.van-tabs__nav{ .van-tabs__nav{
padding:0; padding:0;
background-color: transparent; background-color: transparent;
@ -44,12 +56,42 @@
.van-cell-group{ .van-cell-group{
border-radius: 5px; border-radius: 5px;
margin-bottom: 15px;
overflow: hidden; overflow: hidden;
.van-cell{ .van-cell{
padding: 6px 16px;
align-items: center;
&::after{ &::after{
border-bottom:1px #e3e3e3 solid; border-bottom:1px #e3e3e3 solid;
transform: none; transform: none;
} }
&.longText{
.van-field__label{
width:160px;
}
}
.van-field__label{
position: relative;
display: flex;
padding: 4px 0;
font-weight: bold;
&:before{
position: absolute;
left:-8px;
}
i,svg{
color: #5b7b94;
margin-top: 5px;
margin-right: 5px;
}
}
.van-field__label--top{
i,svg{
color: #5b7b94;
margin-top: 0px;
margin-right: 5px;
}
}
} }
} }
@ -60,41 +102,40 @@
background-color: #b2c4ce; background-color: #b2c4ce;
} }
.card { .upload-main{
border: none; display: flex;
// border-radius: 0; justify-content: center;
margin-bottom: 15px; align-items: center;
.card-body{ .upload-img{
padding: 5px 15px; width: 100px;
.item { aspect-ratio: 1/1;
position: relative; border-radius: 50%;
display: flex; border:1px #d8d8d8 solid;
justify-content: space-between;
align-items: center;
width:100%;
font-size: 15px;
&+.item{
border-top: 1px solid #e3e3e3;
}
.left{
flex: 0 0 auto;
padding: 8px 0;
font-weight: bold;
}
.right{
flex: 1 0 0;
color: #666;
a{
color: #666;
}
}
i,svg{
color: #839eb6;
margin-right: 6px;
}
}
} }
} }
.cropper {
height: 300px;
background: #DDD;
}
.cropper-section{
margin: 0 auto;
position: fixed;
text-align: center;
top: 60px;
width: 100%;
max-width: 500px;
z-index: 8888;
.crop-area{
margin: 5 auto;
width: 100%;
}
.crop-btn{
background-color: #666;
text-align: center;
}
}
/* ========================================= other ============================================= */ /* ========================================= other ============================================= */

@ -321,148 +321,81 @@ const handleLogout = () => {
></a> ></a>
</div> </div>
<div class="content"> <div class="content" v-if="userInfo">
<div class="card shadow" v-if="userInfo"> <van-cell-group inset>
<div class="card-body"> <van-field :model-value="userInfo.create_time" input-align="right" readonly>
<div class="item"> <template #label><i class="fa-regular fa-fw fa-calendar-days"></i> 建立日期</template>
<div class="left"> </van-field>
<i class="fa-regular fa-fw fa-calendar-days"></i> 建立日期 <van-field :model-value="userInfo.user_id" input-align="right" readonly>
</div> <template #label><i class="fa-solid fa-fw fa-fingerprint"></i> 會員編號</template>
<div class="right text-right"> <template #button>
{{ userInfo.create_time }} <van-button size="small" @click="doCopyUid">
</div> <i class="fa-regular fa-copy"></i>
</div> </van-button>
<div class="item"> </template>
<div class="left"> </van-field>
<i class="fa-solid fa-fw fa-fingerprint"></i> 會員編號 <van-field :model-value="userInfo.level_name" input-align="right" readonly>
</div> <template #label><i class="fa-solid fa-fw fa-layer-group"></i> 會員等級</template>
<div class="right text-right"> </van-field>
<a href="javascript:;" @click="doCopyUid">{{ <van-field :model-value="overdue" input-align="right" readonly>
userInfo.user_id <template #label><i class="fa-regular fa-fw fa-calendar-check"></i> 使用期限</template>
}}</a> </van-field>
<!-- <span class="btn btn-sm btn-tomatoRed" @click="doCopyUid"></span> --> <van-field input-align="right" readonly>
</div> <template #label><i class="fa-solid fa-fw fa-qrcode"></i> QRcode</template>
</div> <template #button><van-button size="small" class="bg-darkBlue text-white border-0" @click="handleShowNfc"></van-button></template>
<div class="item"> </van-field>
<div class="left"> <van-field input-align="right" readonly>
<i class="fa-solid fa-fw fa-layer-group"></i> 會員等級 <template #label><i class="fa-solid fa-fw fa-link"></i> 名片連結</template>
</div> <template #button><van-button size="small" class="bg-tomatoRed text-white border-0" @click="doCopy"></van-button></template>
<div class="right text-right"> </van-field>
{{ userInfo.level_name }} </van-cell-group>
</div>
</div> <van-cell-group inset>
<div class="item"> <van-field :model-value="userInfo.title" input-align="right" readonly>
<div class="left"> <template #label><i class="fa-regular fa-fw fa-building"></i> 職稱</template>
<i class="fa-regular fa-fw fa-calendar-check"></i> 使用期限 </van-field>
</div> <van-field :model-value="userInfo.phone" input-align="right" readonly>
<div class="right text-right"> <template #label><i class="fa-solid fa-fw fa-mobile-retro"></i> 手機</template>
{{ overdue }} </van-field>
</div> <van-field :model-value="userInfo.tel" input-align="right" readonly>
<template #label><i class="fa-solid fa-fw fa-phone"></i> 市話</template>
<!-- <div class="col text-right" @click="router.push('/shop/inputsn')" v-if="!is_due">{{overdue}}<br/>點此輸入購買序號</div> </van-field>
<div class="col text-right input-sn" @click="router.push('/shop/inputsn')" v-else>,<br/>點此輸入購買序號</div> --> <van-field :model-value="userInfo.email" input-align="right" readonly>
</div> <template #label><i class="fa-regular fa-fw fa-envelope"></i> Email</template>
<div class="item"> </van-field>
<div class="left"> <van-field :model-value="userInfo.address" input-align="right" readonly>
<i class="fa-solid fa-fw fa-qrcode"></i> 會員QRcode <template #label><i class="fa-solid fa-fw fa-location-dot"></i> 住址</template>
</div> </van-field>
<div class="right text-right"> </van-cell-group>
<div class="btn btn-sm btn-darkBlue" @click="handleShowNfc">
開啟掃描 <van-cell-group inset>
</div> <van-field input-align="right" class="longText" readonly>
</div> <template #label><i class="fa-solid fa-fw fa-user-tie"></i> 授權商務卡片編輯</template>
</div> <template #button>
<div class="item"> <van-button size="small" @click="$router.push('/auth/auth')">
<div class="left"> 授權
<i class="fa-solid fa-fw fa-link"></i> 名片連結 </van-button>
</div> </template>
<div class="right text-right"> </van-field>
<div class="btn btn-sm btn-tomatoRed" @click="doCopy"> <van-field input-align="right" class="longText" readonly>
複製連結 <template #label><i class="fa-regular fa-fw fa-handshake"></i> 代客編輯商務卡片</template>
</div> <template #button>
</div> <van-button size="small" @click="$router.push('/auth/getauth')">
</div> 編輯
</div> </van-button>
</div> </template>
</van-field>
<div class="card shadow" v-if="userInfo"> <van-field input-align="right" class="longText" readonly>
<div class="card-body"> <template #label><i class="fa-solid fa-fw fa-award"></i> 綁定UTel淘金購會員</template>
<div class="item"> <template #button>
<div class="left"> <van-button size="small" @click="bindTggo">
<i class="fa-regular fa-fw fa-building"></i> 職稱 點擊後前往綁定
</div> </van-button>
<div class="right text-right"> </template>
{{ userInfo.title }} </van-field>
</div> <van-field input-align="right" class="longText" readonly>
</div> <template #label><i class="fa-regular fa-fw fa-paper-plane"></i> 發送名片帶廣告</template>
<div class="item"> <template #input>
<div class="left">
<i class="fa-solid fa-fw fa-mobile-retro"></i> 手機
</div>
<div class="right text-right">
{{ userInfo.phone }}
</div>
</div>
<div class="item">
<div class="left"><i class="fa-solid fa-fw fa-phone"></i> 市話</div>
<div class="right text-right">
{{ userInfo.tel }}
</div>
</div>
<div class="item">
<div class="left">
<i class="fa-regular fa-fw fa-envelope"></i> Email
</div>
<div class="right text-right">
{{ userInfo.email }}
</div>
</div>
<div class="item">
<div class="left">
<i class="fa-solid fa-fw fa-location-dot"></i> 住址
</div>
<div class="right text-right">
{{ userInfo.address }}
</div>
</div>
</div>
</div>
<div class="card shadow" v-if="userInfo">
<div class="card-body">
<div class="item">
<div class="left">
<i class="fa-solid fa-fw fa-user-tie"></i> 授權商務卡片編輯
</div>
<div class="right text-right">
<a href="javascript:;" @click="$router.push('/auth/auth')"
>授權</a
>
</div>
</div>
<div class="item">
<div class="left">
<i class="fa-regular fa-fw fa-handshake"></i> 代客編輯商務卡片
</div>
<div class="right text-right">
<a href="javascript:;" @click="$router.push('/auth/getauth')"
>編輯</a
>
</div>
</div>
<div class="item" v-if="userInfo.uniqid">
<div class="left">
<i class="fa-solid fa-fw fa-award"></i> 綁定UTel淘金購會員
</div>
<div class="right text-right">
<a href="javascript:;" @click="bindTggo"></a>
</div>
</div>
<div class="item">
<div class="left">
<i class="fa-regular fa-fw fa-paper-plane"></i> 發送名片帶廣告
</div>
<div class="right text-right">
<van-switch <van-switch
v-model="adSwitchStatus" v-model="adSwitchStatus"
@update:model-value="onUpdateValue" @update:model-value="onUpdateValue"
@ -470,10 +403,9 @@ const handleLogout = () => {
active-color="#345068" active-color="#345068"
inactive-color="#888888" inactive-color="#888888"
/> />
</div> </template>
</div> </van-field>
</div> </van-cell-group>
</div>
</div> </div>
<!-- <Footer /> --> <!-- <Footer /> -->
@ -586,7 +518,7 @@ const handleLogout = () => {
.my-account { .my-account {
position: relative; position: relative;
width: 100%; width: 100%;
padding: 20px 15px; padding: 20px 25px;
.avatar{ .avatar{
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;

@ -22,6 +22,7 @@ const store = useStore()
const router = useRouter() const router = useRouter()
const form = ref({addon:[]}) const form = ref({addon:[]})
const activeName = ref(0)
const fileList = ref([]); const fileList = ref([]);
@ -62,6 +63,7 @@ const validatorTel = (val) => {
let userRes = await getUserInfo() let userRes = await getUserInfo()
if(userRes.code===200){ if(userRes.code===200){
form.value = userRes.data form.value = userRes.data
console.log(form);
}else{ }else{
} }
@ -177,7 +179,7 @@ const onSubmit = async () => {
</van-nav-bar> </van-nav-bar>
<van-tabs class="van-tabs" :lazy-render="true" v-model:active="tabActive"> <van-tabs class="van-tabs" :lazy-render="true" v-model:active="tabActive">
<van-tab v-for="(item, index) in tabItemObj"> <van-tab v-for="(item,index) in tabItemObj" :key="index">
<template #title> <template #title>
<div class="tab_item"> <div class="tab_item">
<i :class="`fa-solid ${item.icon} fa-2x mb-1`"></i> <i :class="`fa-solid ${item.icon} fa-2x mb-1`"></i>
@ -187,30 +189,40 @@ const onSubmit = async () => {
</van-tab> </van-tab>
</van-tabs> </van-tabs>
<div class="content"> <div class="content" v-show="tabActive === 0">
<van-cell-group inset>
<van-cell-group v-show="tabActive === 0">
<van-form @submit="onSubmit"> <van-form @submit="onSubmit">
<van-uploader :after-read="afterRead" :max-count="1" name="averter" class="my-4"> <div class="text-center p-4">
<div class="upload-main"> <van-uploader :after-read="afterRead" :max-count="1" name="averter" class="mb-4">
<img <div class="upload-main">
class="upload-img" <img
:src="form.avatar" class="upload-img"
alt="" :src="form.avatar"
v-if="form.avatar" alt=""
/> v-if="form.avatar"
<img />
class="upload-img" <img
src="@/assets/images/upload.jpg" class="upload-img"
alt="" src="@/assets/images/upload.jpg"
v-else alt=""
/> v-else
<div class="ml-3"> />
<p class="text-skyBlue mb-2">上傳圖片預設為Line頭像</p> <div class="ml-3">
<van-button class="btn-darkBlue" icon="plus" block type="primary" size="small">上傳檔案</van-button> <p class="text-skyBlue mb-2">上傳圖片預設為Line頭像</p>
</div> <van-button class="btn-darkBlue" icon="plus" block size="small">上傳檔案</van-button>
</div> </div>
</van-uploader> </div>
</van-uploader>
<van-field
v-model="form.mark"
rows="3"
type="textarea"
maxlength="100"
placeholder="請輸入100字以內的簡介"
show-word-limit
:style="{border:'1px #e3e3e3 solid',borderRadius:'6px'}"
/>
</div>
<van-field <van-field
v-model="form.real_name" v-model="form.real_name"
@ -263,53 +275,198 @@ const onSubmit = async () => {
/> />
<van-field <van-field
v-model="form.url" v-model="form.url"
label="網址" label="年齡"
name="" name=""
placeholder="請輸入您的網址" placeholder="請輸入您的年齡"
:rules="[{ validator: validatorUrl, message: '網址格式不正確,Ex. http://' }]" />
<van-field name="radio" label="性別">
<template #input>
<van-radio-group v-model="checked" direction="horizontal">
<van-radio name="1"></van-radio>
<van-radio name="2"></van-radio>
</van-radio-group>
</template>
</van-field>
<van-field
v-model="fieldValue"
is-link
readonly
label="區域"
placeholder="請選擇縣市區域"
@click="show = true"
/>
<van-popup v-model:show="show" round position="bottom">
<van-cascader
v-model="cascaderValue"
title="請選擇縣市區域"
:options="options"
@close="show = false"
@finish="onFinish"
/>
</van-popup>
<van-field
v-model="fieldValue"
is-link
readonly
label="工作性質"
placeholder="請選擇工作性質"
@click="show = true"
/>
<van-popup v-model:show="show" round position="bottom">
<van-cascader
v-model="cascaderValue"
title="請選擇工作性質"
:options="options"
@close="show = false"
@finish="onFinish"
/>
</van-popup>
<van-field readonly>
<template #label>是否公開<br/>資料搜尋</template>
<template #input>
<van-switch
v-model="adSwitchStatus"
@update:model-value="onUpdateValue"
size="18px"
active-color="#345068"
inactive-color="#888888"
/>
</template>
</van-field>
<div class="p-5">
<van-button block class="btn-darkBlue" native-type="submit">
確認修改
</van-button>
</div>
</van-form>
</van-cell-group>
<van-cell-group inset>
<van-form @submit="onSubmit12">
<van-nav-bar class="bg-lightPink">
<template #title>
<h6 class="text-darkBlue"><strong>人脈資訊</strong></h6>
</template>
</van-nav-bar>
<van-field
name="pattern"
placeholder="請輸入簡短的自我介紹"
label-align="top"
>
<template #label>
<h6><i class="fa-regular fa-gem text-darkBlue"></i> 一句話介紹自己</h6>
</template>
</van-field>
<van-collapse v-model="activeName" accordion>
<van-collapse-item name="1">
<template #title>
<h6><i class="fa-regular fa-gem text-darkBlue"></i> 我能分享的資源</h6>
</template>
<van-field
rows="3"
type="textarea"
maxlength="100"
placeholder="請填寫能分享的資源"
show-word-limit
>
</van-field>
<van-field
name="pattern"
placeholder="分享網址"
/>
</van-collapse-item>
<van-collapse-item title="标题2" name="2">
技术无非就是那些开发它的人的共同灵魂
</van-collapse-item>
<van-collapse-item title="标题3" name="3">
在代码阅读过程中人们说脏话的频率是衡量代码质量的唯一标准
</van-collapse-item>
</van-collapse>
</van-form>
</van-cell-group>
</div>
<!-- <div class="content" v-show="tabActive === 1" v-for="(v,idx) in form.addon" :key="idx"> -->
<div class="content" v-show="tabActive === 1">
<van-cell-group inset>
<van-form @submit="onSubmit2">
<van-field
v-model="form.real_name"
label="姓名"
name="pattern"
placeholder="請輸入您的姓名"
:rules="[{ required: true, message: '姓名為必填' }]"
/> />
<van-field <van-field
v-model="form.line" v-model="form.company"
label="Line" label="公司名稱"
name="" name=""
placeholder="請輸入您的Line ID" placeholder="請輸入您的公司名稱"
:rules="[{ required: true, message: '公司名稱必填' }]"
/> />
<van-field <van-field
v-model="form.facebook" v-model="form.title"
label="Facebook" label="職稱"
name="" name=""
placeholder="請輸入您的臉書連結" placeholder="請輸入您的職稱"
/> />
<van-field <van-field
v-model="form.ig" v-model="form.phone"
label="IG" label="手機"
name="" name=""
placeholder="請輸入您的IG ID" type="tel"
placeholder="Ex. 0900000001 不要有空格"
:rules="[{ required: true, message: '手機號必填' },{ pattern: /\d{10}/ , message: '手機號格式錯誤' }]"
/> />
<van-field <van-field
v-model="form.youtube" v-model="form.tel"
label="YouTube" label="市話"
name="" name=""
placeholder="請輸入您的Youtube連結" type="tel"
placeholder="請輸入您的市話"
:rules="[{ validator: validatorTel, message: '市話格式不正確,Ex. 02xxxx or 02-xxxx' }]"
/> />
<van-field <van-field
v-model="form.mark" v-model="form.email"
rows="3" label="Email"
autosize name=""
label="簡介" placeholder="請輸入您的Email"
type="textarea" :rules="[{ required: true, message: 'Email必填' },{ pattern: /^([\w\.\-]){1,64}\@([\w\.\-]){1,64}/ , message: 'Email格式錯誤' }]"
maxlength="100" />
placeholder="請輸入簡介" <van-field
show-word-limit v-model="form.address"
/> label="住址"
name=""
<van-button round block type="primary" native-type="submit"> placeholder="請輸入您的地址"
送出 />
</van-button> <van-field
v-model="form.url"
label="年齡"
name=""
placeholder="請輸入您的年齡"
/>
<div class="p-5">
<van-button block class="btn-darkBlue" native-type="submit">
確認修改
</van-button>
</div>
</van-form> </van-form>
</van-cell-group> </van-cell-group>
<van-cell-group v-show="tabActive === 1" v-for="(v,idx) in form.addon" :key="idx"> <!-- <van-cell-group inset>
<div class="text-center"> <div class="text-center">
<van-button type="primary" icon="arrow-up" plain hairline @click="onMoveBtn(0,idx)"></van-button> <van-button type="primary" icon="arrow-up" plain hairline @click="onMoveBtn(0,idx)"></van-button>
<van-button type="primary" icon="arrow-down" plain hairline @click="onMoveBtn(1,idx)"></van-button> <van-button type="primary" icon="arrow-down" plain hairline @click="onMoveBtn(1,idx)"></van-button>
@ -330,36 +487,56 @@ const onSubmit = async () => {
<div class="add-btn" @click="onAddBtn"> <div class="add-btn" @click="onAddBtn">
<van-button type="success" plain hairline>新增按鈕</van-button> <van-button type="success" plain hairline>新增按鈕</van-button>
</div> </div>
</van-cell-group> </van-cell-group> -->
</div>
<van-cell-group v-show="tabActive === 2"> <div class="content" v-show="tabActive === 2">
</van-cell-group> <van-cell-group inset>
<form action="/">
<van-cell-group v-show="tabActive === 3"> <van-search
</van-cell-group> v-model="value"
show-action
placeholder="请输入搜索关键词"
@search="onSearch"
@cancel="onCancel"
/>
<van-list
v-model:loading="loading"
:finished="finished"
finished-text="没有更多了"
@load="onLoad"
>
<van-cell v-for="item in list" :key="item" :title="item" />
</van-list>
</form>
</van-cell-group>
</div>
<div class="content" v-show="tabActive === 3">
<van-cell-group inset>
test3
</van-cell-group>
</div> </div>
<!-- <Footer/> --> <!-- <Footer/> -->
<van-overlay :show="crop.show" @click="crop.show = false" /> <van-popup class="cropPopup" v-model:show="crop.show" closeable>
<div class="cropper-section" v-if="crop.show"> <h5 class="text-center mt-3">檔案裁切上傳</h5>
<div class="crop-area"> <div class="cropper-section">
<cropper <div class="crop-area">
<cropper
class="cropper" class="cropper"
ref="myCrop" ref="myCrop"
:src="crop.img" :src="crop.img"
:stencil-props="{ :stencil-props="{
aspectRatio: 1/1 aspectRatio: 1 / 1,
}" }"
:auto-zoom="true" :auto-zoom="true"
/> />
</div> </div>
<div class="crop-btn"> <van-button round class="btn-tomatoRed rounded-pill w-50 mt-3" size="small" @click="onCrop">
<van-button type="primary" size="small" plain @click="onClose"></van-button> 裁切確認
<van-button type="success" size="small" plain @click="onCrop"></van-button> </van-button>
</div> </div>
</div> </van-popup>
</div> </div>
</template> </template>
@ -367,42 +544,5 @@ const onSubmit = async () => {
<style src="@/assets/css/main.css"></style> <style src="@/assets/css/main.css"></style>
<style lang="less" scoped> <style lang="less" scoped>
.upload-main{
display: flex;
justify-content: center;
align-items: center;
}
.upload-img{
width: 80px;
aspect-ratio: 1/1;
border-radius: 50%;
}
.cropper {
height: 300px;
// width: 300px;
background: #DDD;
}
.cropper-section{
margin: 0 auto;
position: fixed;
text-align: center;
top: 50px;
// left: 0;
height: 350px;
width: 100%;
max-width: 500px;
background: #DDD;
z-index: 8888;
.crop-area{
margin: 5 auto;
width: 100%;
height: 330px;
}
.crop-btn{
background-color: #666;
text-align: center;
}
}
</style> </style>

@ -153,31 +153,37 @@ const onSubmit = async () => {
<template> <template>
<div class="reg-container bg-lightPink"> <div class="reg-container bg-lightPink">
<van-nav-bar class="bg-skyBlue py-1" :title="title" /> <van-nav-bar class="bg-skyBlue py-2">
<template #title>
<h5 class="text-white mb-1"><strong>{{title}}</strong></h5>
</template>
</van-nav-bar>
<div class="content"> <div class="content">
<van-form @submit="onSubmit"> <van-form @submit="onSubmit">
<van-cell-group inset class="text-center"> <van-cell-group inset>
<van-uploader :after-read="afterRead" :max-count="1" name="averter" class="my-4"> <div class="text-center">
<div class="upload-main"> <van-uploader :after-read="afterRead" :max-count="1" name="averter" class="my-4">
<img <div class="upload-main">
class="upload-img" <img
:src="form.avatar" class="upload-img"
alt="" :src="form.avatar"
v-if="form.avatar" alt=""
/> v-if="form.avatar"
<img />
class="upload-img" <img
src="@/assets/images/upload.jpg" class="upload-img"
alt="" src="@/assets/images/upload.jpg"
v-else alt=""
/> v-else
<div class="ml-3"> />
<p class="text-skyBlue mb-2">上傳圖片預設為Line頭像</p> <div class="ml-3">
<van-button class="btn-darkBlue" icon="plus" block type="primary" size="small">上傳檔案</van-button> <p class="text-skyBlue mb-2">上傳圖片預設為Line頭像</p>
</div> <van-button class="btn-darkBlue" icon="plus" block type="primary" size="small">上傳檔案</van-button>
</div> </div>
</van-uploader> </div>
</van-uploader>
</div>
<van-field <van-field
v-model="form.real_name" v-model="form.real_name"
@ -274,80 +280,39 @@ const onSubmit = async () => {
</van-cell-group> </van-cell-group>
<div class="m-3 d-flex"> <div class="m-3 d-flex">
<van-button round block class="btn-skyBlue rounded-pill mx-1" @click="leaveReg"> <van-button round block class="btn-skyBlue rounded-pill mx-1" @click="leaveReg">
以後在說 <h6>以後在說</h6>
</van-button> </van-button>
<van-button round block class="btn-darkBlue rounded-pill mx-1" native-type="submit"> <van-button round block class="btn-darkBlue rounded-pill mx-1" native-type="submit">
送出註冊 <h6>送出註冊</h6>
</van-button> </van-button>
<br />
</div> </div>
</van-form> </van-form>
</div> </div>
<van-overlay :show="crop.show" @click="crop.show = false" /> <van-popup class="cropPopup" v-model:show="crop.show" round closeable>
<div class="cropper-section" v-if="crop.show"> <h5 class="text-center mt-3">檔案裁切上傳</h5>
<div class="crop-area"> <div class="cropper-section">
<cropper <div class="crop-area">
class="cropper" <cropper
ref="myCrop" class="cropper"
:src="crop.img" ref="myCrop"
:stencil-props="{ :src="crop.img"
aspectRatio: 1 / 1, :stencil-props="{
}" aspectRatio: 1 / 1,
:auto-zoom="true" }"
/> :auto-zoom="true"
</div> />
<div class="crop-btn"> </div>
<van-button type="primary" size="small" plain @click="onClose"> <van-button round class="btn-tomatoRed rounded-pill w-50 mt-3" size="small" @click="onCrop">
取消 <h6>裁切確認</h6>
</van-button>
<van-button type="success" size="small" plain @click="onCrop">
剪裁
</van-button> </van-button>
</div> </div>
</div> </van-popup>
</div> </div>
</template> </template>
<style src="@/assets/css/main.css"></style> <style src="@/assets/css/main.css"></style>
<style lang="less" scoped> <style lang="less" scoped>
.upload-main{
display: flex;
justify-content: center;
align-items: center;
}
.upload-img{
width: 80px;
aspect-ratio: 1/1;
border-radius: 50%;
}
.cropper {
height: 300px;
// width: 300px;
background: #DDD;
}
.cropper-section{
margin: 0 auto;
position: fixed;
text-align: center;
top: 50px;
// left: 0;
height: 350px;
width: 100%;
max-width: 500px;
background: #DDD;
z-index: 8888;
.crop-area{
margin: 5 auto;
width: 100%;
height: 330px;
}
.crop-btn{
background-color: #666;
text-align: center;
}
}
</style> </style>

Loading…
Cancel
Save