[更新]基础框架,登录流程

This commit is contained in:
唐明明
2020-12-27 09:54:49 +08:00
parent 286f8111bd
commit 49275bc648
125 changed files with 2611 additions and 167 deletions

View File

@@ -0,0 +1,30 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
* explain: cardColleagues
*/
Component({
/**
* 组件的属性列表
*/
properties: {
// 我的同事列表
colleaguesList: {
type : Array,
value : []
}
},
/**
* 组件的方法列表
*/
methods: {
onCard(e){
let cardObj = e.currentTarget.dataset.card
this.triggerEvent("changecard", cardObj)
}
}
})

View File

@@ -0,0 +1,10 @@
<scroll-view class="colleagues" scroll-x>
<view class="colleagues-item" wx:for="{{colleaguesList}}" wx:key="colleagues" bindtap="onCard" data-card="{{item}}">
<image class="colleagues-cover" src="{{item.cover}}" mode="aspectFill"></image>
<view class="colleagues-info">
<view class="colleagues-info-name nowrap">{{item.name}}</view>
<view class="colleagues-info-job nowrap">{{item.job}}</view>
</view>
</view>
</scroll-view>

View File

@@ -0,0 +1,53 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
*/
.colleagues{
box-sizing: border-box;
white-space: nowrap;
}
.colleagues-item{
border-radius: 10rpx;
background: white;
box-shadow: 0 0 4rpx 4rpx rgba(0, 0, 0, .05);
overflow: hidden;
display: inline-block;
width: 260rpx;
margin: 6rpx 20rpx 6rpx 0;
}
.colleagues-item:first-child{
margin-left: 30rpx;
}
.colleagues-item:last-child{
margin-right: 30rpx;
}
.colleagues-cover{
width: 100%;
height: 280rpx;
vertical-align: top;
background: #eee;
}
.colleagues-info{
padding: 15rpx 20rpx;
text-align: center;
}
.colleagues-info-name{
font-weight: bold;
font-size: 32rpx;
line-height: 50rpx;
}
.colleagues-info-job{
font-size: 28rpx;
color: gray;
line-height: 40rpx;
}

View File

@@ -0,0 +1,44 @@
/**
* Web唐明明
* 一个梦想做木雕手艺人的程序员
* explain: cardDie
*/
Component({
/**
* 组件的属性列表
*/
properties: {
// 名片展示信息
cardInfo: {
type : Object,
value : {
name : "",
job : "",
mobileNo: "",
email : "",
address : ""
}
},
// 名片照片
cardCover : {
type : String,
value : ""
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1,25 @@
<view class="card-content">
<view class="card-default">
<view class="card-default-cover">
<image class="card-default-cover-src" src="{{cardCover || ''}}" mode="aspectFill"></image>
</view>
<view class="card-default-center">
<view class="card-default-gray">
<view class="card-default-gray-name nowrap">{{cardInfo.name == '' ? '姓名' : cardInfo.name}}</view>
<view class="card-default-gray-job nowrap">{{cardInfo.job == '' ? '职业' : cardInfo.job}}</view>
</view>
<view class="card-default-info">
<view class="card-default-info-text nowrap" wx:if="{{cardInfo.mobileNo != ''}}">
<image class="card-default-info-icon" src="/static/icons/card_phone_icon.png"></image>{{cardInfo.mobileNo}}
</view>
<view class="card-default-info-text nowrap" wx:if="{{cardInfo.email != ''}}">
<image class="card-default-info-icon" src="/static/icons/card_email_icon.png"></image>{{cardInfo.email}}
</view>
<view class="card-default-info-text nowrap-multi" wx:if="{{cardInfo.address != ''}}">
<image class="card-default-info-icon" src="/static/icons/card_address_icon.png"></image>{{cardInfo.address}}
</view>
</view>
</view>
</view>
</view>

View File

@@ -0,0 +1,105 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
*/
.card-content{
padding: 15px;
}
.nowrap {
max-width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.nowrap-multi {
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
/* 默认模版 */
.card-default{
position: relative;
box-shadow: 0 0 4rpx 4rpx rgba(0, 0, 0, .05);
background: white;
border-radius: 15rpx;
height: 180px;
overflow: hidden;
}
.card-default-cover{
position: absolute;
top: 0;
left: 0;
background: #eee;
width: 150px;
height: 180px;
overflow: hidden;
-webkit-clip-path: polygon(0 0, 0 100%, 80% 100%, 100% 0);
}
.card-default-cover-src{
position: absolute;
top: 0;
left: 0;
width: 150px;
height: 180px;
}
.card-default-gray{
background: #eee;
font-weight: bold;
height: 60px;
margin-top: 10px;
padding: 8px 10px 8px 160px;
box-sizing: border-box;
}
.card-default-gray-name{
font-size: 36rpx;
line-height: 25px;
}
.card-default-gray-job{
font-size: 26rpx;
line-height: 20px;
font-weight: normal;
}
.card-default-info{
padding: 0 10px 0 140px;
height: 200rpx;
box-sizing: border-box;
}
.card-default-info-text{
position: relative;
margin-top: 10px;
line-height: 18px;
text-align: right;
font-size: 28rpx;
color: gray;
padding-right: 22px;
}
.card-default-info-text:first-child{
font-weight: bold;
color: black;
}
.card-default-info-icon{
position: absolute;
right: 0;
top: 3rpx;
width: 28rpx;
height: 28rpx;
}

View File

@@ -0,0 +1,29 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
* explain: cardDynamic
*/
Component({
/**
* 组件的属性列表
*/
properties: {
dynamicList: {
type : Array,
value : []
}
},
/**
* 组件的方法列表
*/
methods: {
onDynamics(e){
let dynamics = e.currentTarget.dataset.dynamics
this.triggerEvent("changedynamics", dynamics)
}
}
})

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1,31 @@
<view class="dynamic">
<block wx:if="{{dynamicList.length > 0}}">
<view class="dynamic-item" wx:for="{{dynamicList}}" wx:key="dynamic" bindtap="onDynamics" data-dynamics="{{item}}">
<view class="dynamic-cover">
<image class="dynamic-src" src="{{item.cover}}" mode="aspectFill"></image>
<view class="dynamic-title">{{item.title}}</view>
</view>
<!-- <view class="dynamic-content">
<view class="dynamic-tool">
<view class="dynamic-tool">111</view>
<view class="dynamic-tool">点赞</view>
</view>
<view class="dynamic-remark">
<view class="dynamic-remark-item">
<text class="dynamic-remark-name">爱笑的小悦哥:</text>喜欢
</view>
<view class="dynamic-remark-item">
<text class="dynamic-remark-name">二呵呵的周阿喵:</text>什么鬼东西这是。。。涂在🐱上能不能好看~
</view>
<view class="dynamic-remark-tool">查看全部70条</view>
</view>
</view> -->
</view>
</block>
<block wx:else>
<view class="dynamic-null">
<image class="dynamic-null-icon" src="/static/images/null_icon.png" mode="widthFix"></image>
<view class="dynamic-null-title">暂未发布任何企业动态</view>
</view>
</block>
</view>

View File

@@ -0,0 +1,87 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
*/
.dynamic-item{
margin: 0 30rpx 30rpx 30rpx;
background: white;
border-radius: 10rpx;
box-shadow: 0 0 4rpx 4rpx rgba(0, 0, 0, .05);
overflow: hidden;
}
.dynamic-item:last-child{
margin-bottom: 0;
}
.dynamic-cover{
position: relative;
padding-top: 50%;
background: #eee;
}
.dynamic-src{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.dynamic-title{
position: absolute;
bottom: 0;
left: 0;
width: 100%;
box-sizing: border-box;
padding: 20rpx 30rpx;
background: rgba(0, 0, 0, .4);
color: white;
font-size: 34rpx;
font-weight: bold;
}
.dynamic-content{
padding: 20rpx;
}
.dynamic-tool{
padding-bottom: 20rpx;
display: flex;
}
.dynamic-remark{
background: #eee;
padding: 20rpx;
}
.dynamic-remark-item{
font-size: 26rpx;
padding-bottom: 8rpx;
}
.dynamic-remark-name{
font-weight: bold;
color: #0b0041;
}
.dynamic-remark-tool{
color: gray;
font-size: 28rpx;
}
/* 空 */
.dynamic-null{
text-align: center;
padding: 80rpx 30rpx;
font-size: 26rpx;
color: gray;
}
.dynamic-null-icon{
width: 168rpx;
margin-bottom: 20rpx;
}

View File

@@ -0,0 +1,40 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
* explain: cardEnterprise
*/
Component({
/**
* 组件的属性列表
*/
properties: {
enterpriseInfo: {
type : Object,
value : {}
}
},
/**
* 组件的初始数据
*/
data: {
enterpriseIntrShow: false, //企业文字展开状态
},
/**
* 组件的方法列表
*/
methods: {
/**
* 我的企业展开隐藏
*/
enterpriseIntrShow(){
this.setData({
enterpriseIntrShow: !this.data.enterpriseIntrShow
})
}
}
})

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1,23 @@
<view class="enterprise">
<view class="enterprise-header">
<image class="enterprise-logo" src="{{enterpriseInfo.logo || '/static/images/logo_null.png'}}" mode="aspectFill"></image>
<view class="enterprise-info">
<view class="enterprise-info-name nowrap">{{enterpriseInfo.name || '企业名称'}}</view>
<view class="enterprise-info-btn" wx:if="{{enterpriseInfo.web}}">进入官网</view>
</view>
</view>
<view class="enterprise-img" wx:if="{{enterpriseInfo.pictures.length > 0}}">
<swiper class="enterprise-swiper" indicator-dots="{{enterpriseInfo.pictures.length > 1}}" indicator-active-color="#0b0041">
<swiper-item wx:for="{{enterpriseInfo.pictures}}" wx:key="pictures">
<image class="enterprise-cover" src="{{item}}" mode="aspectFill"></image>
</swiper-item>
</swiper>
</view>
<view class="enterprise-intr {{enterpriseIntrShow ? '': 'hide'}}">
<text>{{enterpriseInfo.description}}</text>
</view>
<view class="enterprise-intr-more {{enterpriseIntrShow ? 'show': ''}}" bindtap="enterpriseIntrShow">
{{enterpriseIntrShow ? '收起': '展开'}}<image class="enterprise-intr-more-icon" src="/static/icons/arrow_dow.png" mode="widthFix"></image>
</view>
</view>

View File

@@ -0,0 +1,111 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
*/
.enterprise{
background: white;
margin: 0 30rpx;
padding: 30rpx;
border-radius: 10rpx;
box-shadow: 0 0 4rpx 4rpx rgba(0, 0, 0, .05);
}
.enterprise-header{
position: relative;
padding-left: 108rpx;
min-height: 88rpx;
}
.enterprise-logo{
position: absolute;
left: 0;
top: 0;
background: white;
width: 88rpx;
height: 88rpx;
vertical-align: top;
}
.enterprise-info{
display: flex;
justify-content: space-between;
align-items: center;
}
.enterprise-info-name{
flex: 1;
font-weight: bold;
line-height: 88rpx;
font-size: 32rpx;
}
.enterprise-info-btn{
margin-left: 20rpx;
line-height: 60rpx;
color: #0b0041;
border:solid 1rpx #0b0041;
padding: 0 20rpx;
font-size: 28rpx;
}
.enterprise-img{
position: relative;
padding-top: 75%;
background: #eee;
margin: 30rpx 0;
}
.enterprise-swiper{
position: absolute;
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
}
.enterprise-cover{
vertical-align: top;
width: 100%;
height: 100%;
}
.enterprise-intr{
margin-top: 30rpx;
font-size: 28rpx;
color: #4f4f4f;
line-height: 40rpx;
}
.enterprise-intr.hide{
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 5;
}
.enterprise-intr-more{
padding-top: 20rpx;
text-align: center;
font-size: 28rpx;
color: #afafaf;
line-height: 50rpx;
}
.enterprise-intr-more-icon{
width: 32rpx;
height: 32rpx;
vertical-align: middle;
margin-left: 10rpx;
margin-bottom: 3rpx;
transform:rotate(0deg);
transition: all .5s;
}
.enterprise-intr-more.show > .enterprise-intr-more-icon{
transform:rotate(180deg);
}

View File

@@ -0,0 +1,30 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
* explain: cardGood
*/
Component({
/**
* 组件的属性列表
*/
properties: {
// 我的产品列表
goods: {
type : Array,
value : []
}
},
/**
* 组件的方法列表
*/
methods: {
onGood(e){
let goodObj = e.currentTarget.dataset.good
this.triggerEvent("changegood", goodObj)
}
}
})

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1,19 @@
<scroll-view class="goods" scroll-x>
<view class="goods-item" wx:for="{{goods}}" wx:key="goods" bindtap="onGood" data-good="{{item}}">
<view class="goods-cover">
<image class="goods-cover-src" src="{{item.cover}}" mode="aspectFill"></image>
</view>
<view class="goods-info">
<view class="goods-info-name nowrap">{{item.title}}</view>
<view class="goods-info-price nowrap">
<text class="goods-info-price-price nowrap">¥{{item.prices.price}}</text>
<text class="goods-info-price-association nowrap">协会{{item.prices.association}}</text>
</view>
<view class="goods-info-vip-price nowrap">
<text class="goods-info-vip-price-left">VIP</text>
<text class="goods-info-vip-price-right nowrap">¥{{item.prices.vip}}</text>
</view>
</view>
</view>
</scroll-view>

View File

@@ -0,0 +1,109 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
*/
.nowrap {
max-width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
/* 商品 */
.goods{
box-sizing: border-box;
white-space: nowrap;
}
.goods-item{
border-radius: 10rpx;
background: white;
box-shadow: 0 0 4rpx 4rpx rgba(0, 0, 0, .05);
overflow: hidden;
display: inline-block;
width: 260rpx;
margin: 6rpx 20rpx 6rpx 0;
}
.goods-item:first-child{
margin-left: 30rpx;
}
.goods-item:last-child{
margin-right: 30rpx;
}
.goods-cover{
position: relative;
width: 100%;
padding-top: 100%;
vertical-align: top;
background: #eee;
}
.goods-cover-src{
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.goods-info{
padding: 15rpx 20rpx;
}
.goods-info-name{
font-weight: bold;
}
.goods-info-price{
font-size: 30rpx;
}
.goods-info-price-association,
.goods-info-price-price{
display: inline-block;
vertical-align: middle;
}
.goods-info-price-price{
color: #ea4e2f;
font-weight: bold;
margin-right: 14rpx;
}
.goods-info-price-association{
font-size: 26rpx;
color: #4f4f4f;
}
.goods-info-vip-price{
font-size: 22rpx;
padding-top: 10rpx;
}
.goods-info-vip-price-left,
.goods-info-vip-price-right{
line-height: 34rpx;
display: inline-block;
vertical-align: middle;
}
.goods-info-vip-price-left{
background: #333;
color: #f2e4c0;
padding: 0 10rpx;
border-radius: 6rpx 0 0 6rpx;
}
.goods-info-vip-price-right{
background: #f2e4c0;
color: #333;
border-radius: 0 6rpx 6rpx 0;
padding: 0 10rpx;
}

View File

@@ -0,0 +1,41 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
* explain: cardIndividual
*/
Component({
/**
* 组件的属性列表
*/
properties: {
individualText: {
type : String,
value : ""
}
},
/**
* 组件的初始数据
*/
data: {
// 展开状态
personalIntrShow: false
},
/**
* 组件的方法列表
*/
methods: {
/**
* 个人简介展开隐藏
*/
personalIntrShow(){
this.setData({
personalIntrShow: !this.data.personalIntrShow
})
}
}
})

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1,8 @@
<view class="individual">
<view class="individual-intr {{personalIntrShow ? '': 'hide'}}">
<text>{{individualText}}</text>
</view>
<view class="individual-more {{personalIntrShow ? 'show': ''}}" bindtap="personalIntrShow">
{{personalIntrShow ? '收起': '展开'}}<image class="individual-more-image" src="/static/icons/arrow_dow.png" mode="widthFix"></image>
</view>
</view>

View File

@@ -0,0 +1,50 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
*/
.individual{
background: white;
margin: 0 30rpx;
padding: 30rpx;
border-radius: 10rpx;
box-shadow: 0 0 4rpx 4rpx rgba(0, 0, 0, .05);
}
.individual-intr{
font-size: 28rpx;
color: #4f4f4f;
line-height: 40rpx;
}
.individual-intr.hide{
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 5;
}
.individual-more{
padding-top: 20rpx;
text-align: center;
font-size: 28rpx;
color: #afafaf;
line-height: 50rpx;
}
.individual-more-image{
width: 32rpx;
height: 32rpx;
vertical-align: middle;
margin-left: 10rpx;
margin-bottom: 3rpx;
transform:rotate(0deg);
transition: all .5s;
}
.individual-more.show > .individual-more-image{
transform:rotate(180deg);
}

View File

@@ -0,0 +1,36 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
* explain: cardPhoto
*/
Component({
/**
* 组件的属性列表
*/
properties: {
// 照片
photos: {
type : Array,
value : []
}
},
/**
* 组件的方法列表
*/
methods: {
// 查看照片
openPhotos(e){
let photoArr = this.data.photos,
photoIndex = e.currentTarget.dataset.index
wx.previewImage({
urls : photoArr,
current : photoArr[photoIndex]
})
}
}
})

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1,7 @@
<view class="photo" wx:if="{{photos.length > 0}}">
<image class="photo-src" wx:for="{{photos}}" wx:key="photo" bindtap="openPhotos" data-index="{{index}}" src="{{item}}" mode="widthFix"></image>
</view>
<view class="photo-null" wx:else>
<image class="photo-null-icon" src="/static/images/null_icon.png" mode="widthFix"></image>
<view class="photo-null-title">暂未上传照片</view>
</view>

View File

@@ -0,0 +1,27 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
*/
.photo{
background: #eee;
}
.photo-src{
width: 100%;
vertical-align: top;
}
.photo-null{
text-align: center;
padding: 80rpx 30rpx;
font-size: 26rpx;
color: gray;
}
.photo-null-icon{
width: 168rpx;
margin-bottom: 20rpx;
}

View File

@@ -1,43 +0,0 @@
/**
* Web唐明明
* 一个梦想做木雕手艺人的程序员
* explain: userInfoLayer
*/
Component({
/**
* 组件的属性列表
*/
properties: {
showLayer: {
type : Boolean,
value : false
}
},
/**
* 组件的方法列表
*/
methods: {
userInfo(info){
if(info.detail.errMsg == "getUserInfo:ok"){
wx.$api.auth.authInfo({
nickname: info.detail.userInfo.nickName,
avatar : info.detail.userInfo.avatarUrl
}).then(()=>{
this.triggerEvent("updateinfo", true)
this.setData({
showLayer: false
})
})
}else{
wx.showToast({
title: '拒绝了授权',
icon : 'none'
})
this.triggerEvent("updateinfo", false)
}
}
}
})

View File

@@ -0,0 +1,38 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
* explain: userInfoLayer
*/
Component({
/**
* 组件的属性列表
*/
properties: {
showLayer: {
type : Boolean,
value : false
}
},
/**
* 组件的方法列表
*/
methods: {
userInfo(info){
if(info.detail.errMsg == "getUserInfo:ok"){
this.triggerEvent("updateinfo", {
userInfo : info.detail.userInfo,
auth : true
})
}else{
this.triggerEvent("updateinfo", {
userInfo : {},
auth : false
})
}
}
}
})

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -1,7 +1,8 @@
/**
* Web唐明明
* 一个梦想做木雕手艺人的程序员
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
*/
.layer-back,

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB