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

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

@@ -23,8 +23,8 @@ const errInfo = (obj) =>{
//转跳到登录页面 //转跳到登录页面
}else if(res.cancel){ }else if(res.cancel){
//考虑是否增加一个跳转首页的操作 //考虑是否增加一个跳转首页的操作
wx.redirectTo({ wx.switchTab({
url: "/pages/index/index", url: "/pages/news/index",
}) })
} }
} }

View File

@@ -3,12 +3,28 @@
* 接口路由 * 接口路由
*/ */
import file from "./interfaces/file" import publics from "./interfaces/public"
import auth from "./interfaces/auth" import auth from "./interfaces/auth"
import file from "./interfaces/file"
import user from "./interfaces/user"
import video from "./interfaces/video" import video from "./interfaces/video"
import card from "./interfaces/card"
import mall from "./interfaces/mall"
import order from "./interfaces/order"
import company from "./interfaces/company"
import home from "./interfaces/home"
import ticket from "./interfaces/ticket"
export default{ export default{
file, publics,
auth, auth,
video file,
user,
video,
card,
mall,
order,
company,
home,
ticket
} }

View File

@@ -2,10 +2,19 @@
/* /*
* 授权 * 授权
*/ */
import {req} from "../request" import {req} from "../request"
const authPhone = data => req({url: "auth/mini", method: "POST", data: data}) //登录 const authPhone = data => req({url: "auth/mini", method: "POST", data: data}) //登录
const authInfo = data => req({url: "auth/mini/info", method: "POST", data: data}) //完善用户信息
const getImgCode = () => req({url: "auth/captcha"}) // 获取图形验证码
const phoneCode = data => req({url: "auth/sms", method: "POST", data: data}) //用户获取短信验证码
const phoneLogin = data => req({url: "auth/mini/mobile", method: "POST", data: data}) //手机号码登录
export default({ export default({
authPhone authPhone,
authInfo,
getImgCode,
phoneCode,
phoneLogin
}) })

11
apis/interfaces/card.js Normal file
View File

@@ -0,0 +1,11 @@
/*
* 电子名片
*/
import {req} from "../request"
const card = data => req({url: "cardpersonal" , data: data}) //名片信息
export default({
card
})

View File

@@ -0,0 +1,9 @@
/*
* 企业广场
*/
import {req} from "../request"
export default({
})

View File

@@ -5,7 +5,7 @@
import {upload} from "../request" import {upload} from "../request"
const uploadImg = (imgPaht, data) => upload({url: "storage", key: "image", path: imgPaht, data: data}) //上传图片 const uploadImg = (imgPaht, data) => upload({url: "storage", key: "file", path: imgPaht, data: data}) //上传图片
export default({ export default({
uploadImg uploadImg

9
apis/interfaces/home.js Normal file
View File

@@ -0,0 +1,9 @@
/*
* 企业主页
*/
import {req} from "../request"
export default({
})

11
apis/interfaces/live.js Normal file
View File

@@ -0,0 +1,11 @@
/*
* 电子名片
*/
import {req} from "../request"
const card = data => req({url: "cardpersonal" , data: data}) //名片信息
export default({
card
})

9
apis/interfaces/mall.js Normal file
View File

@@ -0,0 +1,9 @@
/*
* 商城
*/
import {req} from "../request"
export default({
})

9
apis/interfaces/order.js Normal file
View File

@@ -0,0 +1,9 @@
/*
* 订单
*/
import {req} from "../request"
export default({
})

13
apis/interfaces/public.js Normal file
View File

@@ -0,0 +1,13 @@
/*
* 全局通用接口
*/
import {req} from "../request"
const richText = (key) => req({url: "single/" + key, data: {key: "string"}}) //富文本
const getStatus = (key) => req({url: "ajax/status/" + key}) //状态查询
export default({
richText,
getStatus
})

View File

@@ -0,0 +1,9 @@
/*
* 优惠券
*/
import {req} from "../request"
export default({
})

9
apis/interfaces/user.js Normal file
View File

@@ -0,0 +1,9 @@
/*
* 用户
*/
import {req} from "../request"
export default({
})

View File

@@ -3,8 +3,8 @@ import {errInfo} from './err'
import {updToken} from './updateToken' import {updToken} from './updateToken'
// 请求方式配置 // 请求方式配置
// const api = "https://mi-org.cnskl.com/api/"
const api = "https://new-web-test.cnskl.com/api/" const api = "https://new-web-test.cnskl.com/api/"
// const api = "https://mi-org.cnskl.com/api/"
const header = { const header = {
"Accept": "application/json" "Accept": "application/json"
} }
@@ -36,11 +36,13 @@ const req = (obj) => {
if (res.data.status_code == 200) { if (res.data.status_code == 200) {
resolve(res.data.data) resolve(res.data.data)
} else { } else {
if (res.data.status_code == 401 || res.data.status_code == 400) { if (res.data.status_code == 401) {
reject({ reject({
login : false, login : false,
codeBeen: false codeBeen: false
}) })
} else{
reject(res.data)
} }
errInfo(res.data) errInfo(res.data)
} }
@@ -70,7 +72,6 @@ const upload = (obj) => {
title: "上传中..", title: "上传中..",
mask: true mask: true
}) })
wx.uploadFile({ wx.uploadFile({
url : api + obj.url, url : api + obj.url,
header : header, header : header,
@@ -87,10 +88,9 @@ const upload = (obj) => {
if (jsonData.status_code == 200) { if (jsonData.status_code == 200) {
resolve(jsonData.data) resolve(jsonData.data)
} else { } else {
if (res.data.status_code == 401 || res.data.status_code == 400) { if (jsonData.status_code == 401) {
reject({ reject({
login : false, login: false
codeBeen: false
}) })
} }
errInfo(jsonData) errInfo(jsonData)

20
app.js
View File

@@ -1,12 +1,30 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
*/
import apis from "./apis/index" import apis from "./apis/index"
const QQMapWX = require("./lib/qqmap-wx-jssdk.min.js");
App({ App({
onLaunch() { onLaunch() {
// 挂载腾讯地图
wx.$qqMap = new QQMapWX({
key: "3TBBZ-O42LU-HXCVQ-2M66A-NCFTT-LMBHU"
})
//挂载api方法 //挂载api方法
wx.$api = apis wx.$api = apis
}, },
globalData: { globalData: {
navAppInfo : {
appId : "wxd931d03dfe955254",
envVersion : "trial",
goodUrl : "/pages/goods/show?goodsId=",
cardUrl : "/pages/card/index?cardid="
}
} }
}) })

View File

@@ -1,9 +1,15 @@
{ {
"pages": [ "pages": [
"pages/shortVideo/shortVideo", "pages/shortVideo/index",
"pages/businessCard/index", "pages/richText/richText",
"pages/login/login", "pages/login/login",
"pages/businessCard/cards/cards" "pages/card/index",
"pages/company/index",
"pages/user/index",
"pages/home/index",
"pages/mall/index",
"pages/live/index",
"pages/ticket/index"
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",

View File

@@ -1,10 +1,77 @@
.container { /**
height: 100%; * Web唐明明
display: flex; * 匆匆数载恍如梦,岁月迢迢华发增。
flex-direction: column; * 碌碌无为枉半生,一朝惊醒万事空。
align-items: center; */
justify-content: space-between;
padding: 200rpx 0; page{
box-sizing: border-box; background-color: #f8f8f8;
font-size: 30rpx;
}
/*
* 文字截取
*/
.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;
}
/*
* 水平居中
*/
.pack-center {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: -1;
}
/*
* 页面信息提醒
*/
.pages-hint,
.pages-loding{
text-align: center;
color: #afafaf;
font-size: 28rpx;
background: white;
}
.pages-hint image {
width: 188rpx;
height: 188rpx;
margin-bottom: 30rpx;
}
.pages-loding image {
width: 38rpx;
height: 38rpx;
}
/*
* iphoneX footer
*/
.iphoneX{
padding-bottom: 68rpx;
} }

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

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

1
lib/qqmap-wx-jssdk.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1,17 +0,0 @@
// pages/businessCard/cards/cards.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
}
})

View File

@@ -1,4 +0,0 @@
{
"usingComponents": {},
"navigationBarTitleText": "名片夹"
}

View File

@@ -1,2 +0,0 @@
名片夹

View File

@@ -1 +0,0 @@
/* pages/businessCard/cards/cards.wxss */

View File

@@ -1,23 +0,0 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
*/
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
}
})

View File

@@ -1,4 +0,0 @@
{
"usingComponents": {},
"navigationBarTitleText": "智能名片"
}

View File

@@ -1 +0,0 @@
/* pages/businessCard/index.wxss */

309
pages/card/index.js Normal file
View File

@@ -0,0 +1,309 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
*/
Page({
/**
* 页面的初始数据
*/
data: {
loding : true, //名片加载状态
cardNull : true, //是否找到了名片
isLogin : false, //登录状态
cardBase : {}, //名片基础信息
cardInfo : {}, //名片模版信息
models : [], //名片模块
cardId : "", //名片id
isOwner : false, //是否为当前管理员
isFavorite : false, //收藏状态
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(e){
this.setData({
cardId : e.cardid || ""
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// 检查登录状态
wx.getStorage({
key : "token",
success : () =>{
this.setData({
isLogin: true
})
},
fail : ()=>{
this.setData({
isLogin: false
})
}
})
this.cardInfo()
},
/**
* 获取名片信息
*/
cardInfo(){
wx.$api.card.card({
cardId: this.data.cardId
}).then(res=>{
this.setData({
loding : false,
cardInfo : {
name : res.base.name,
mobileNo: res.base.mobile,
job : res.base.job,
email : res.base.email,
address : res.base.address
},
cardBase : res.base,
models : res.models,
isOwner : res.is_owner,
isFavorite : res.is_favorite
})
this.cutCard()
}).catch(err=>{
if(err.message == "暂未查到名片信息"){
this.setData({
loding : false,
cardNull: false
})
}
})
},
/**
* 名片二维码
*/
codeNav(){
wx.navigateTo({
url: "./code/code?cardid=" + this.data.cardBase.card_personal_id
})
},
/**
* 名片操作
*/
cardScroolNav(e) {
let bindType = e.currentTarget.dataset.type,
infoData = e.currentTarget.dataset.info
switch (bindType) {
case "phone":
wx.makePhoneCall({
phoneNumber: infoData,
fail : ()=>{}
})
break;
case "wechat":
wx.setClipboardData({
data : infoData
})
break;
case "email":
wx.setClipboardData({
data : infoData
})
break;
case "address":
wx.showLoading({
title: '加载中',
})
wx.$qqMap.search({
keyword: infoData,
success: res=>{
if(res.status == 0){
wx.openLocation({
latitude : res.data[0].location.lat,
longitude : res.data[0].location.lng,
name : res.data[0].title,
address : res.data[0].address
})
wx.hideLoading()
}else{
wx.showToast({
title: res.message,
icon : "none"
})
}
},
fail : ()=>{
wx.hideLoading()
}
})
break;
}
},
/**
* 收藏名片夹
*/
cardLike(){
if(!this.data.isLogin){
wx.navigateTo({
url: "/pages/login/login"
})
return
}
if(!this.data.isFavorite){
wx.$api.card.cardlike(
this.data.cardBase.card_personal_id
).then(res=>{
if(res == "操作成功"){
wx.showModal({
title : "提示",
content : "收藏成功,名片已加入您的电子名片夹,可在个人中心我的名片夹查看",
showCancel : false,
confirmText : "我知道了",
confirmColor: "#0b0041",
success : res=>{
if(res.confirm){
this.setData({
isFavorite: true
})
}
}
})
}
})
}
},
/**
* 名片设置
*/
cardSte(){
let itemLists = ["模块设置", "编辑名片", "产品管理"]
// 当前用户是否为企业管理员
if(this.data.cardBase.is_company_manage) itemLists.push("编辑企业")
wx.showActionSheet({
itemList: itemLists,
success : res=>{
let tapIndex = res.tapIndex
switch (tapIndex) {
case 0:
wx.navigateTo({
url: "./module/module"
})
break;
case 1:
wx.navigateTo({
url: "./editor/editor"
})
break;
case 2:
wx.navigateTo({
url: "./product/product"
})
break;
case 3:
this.data.models.find(val => {
if(val.name == "enterprise"){
wx.navigateTo({
url: "./company/company?id=" + val.data.id
})
return
}
})
break;
}
}
})
},
/**
* 分享名片
*/
onShareAppMessage(){
return{
title : "您好我是" + this.data.cardBase.company + "的" + this.data.cardBase.name + ",这是我的电子名片~",
path : "/pages/card/index?cardid=" + this.data.cardBase.card_personal_id,
imageUrl: this.data.cardBase.cover.showpath
}
},
/**
* 商品详情
*/
changeGood(e){
let goodsId = e.detail.goods_id
wx.showLoading({
title: "打开中...",
})
wx.navigateToMiniProgram({
appId : getApp().globalData.navAppInfo.appId,
envVersion : getApp().globalData.navAppInfo.envVersion,
path : getApp().globalData.navAppInfo.goodUrl + goodsId,
success : ()=>{
wx.hideLoading()
},
fail : err=>{
wx.showToast({
title: err.errMsg,
icon : "none"
})
}
})
},
/**
* 点击同事名片
*/
changeCard(e){
let cardId = this.data.cardBase.card_personal_id,
onCardId = e.detail.card_id
if(onCardId != cardId){
this.setData({
loding : true,
cardNull : true,
cardId : onCardId
})
this.cardInfo()
}
},
/**
* 点击动态
*/
changedynamics(e){
if(e.detail.dynamic_id){
wx.navigateTo({
url: "./dynamics/dynamics?id=" + e.detail.dynamic_id,
})
}else{
wx.showToast({
title: "系统错误,缺少参数:dynamic_id",
icon : "none"
})
}
},
/**
* 存入通讯录
*/
addPhoneBook(){
let cardInfo = this.data.cardBase
wx.addPhoneContact({
firstName : cardInfo.name || "",
mobilePhoneNumber : cardInfo.mobile || "",
weChatNumber : cardInfo.wechat || "",
organization : cardInfo.company || "",
title : cardInfo.job || "",
email : cardInfo.email || "",
remark : "通过数促会小程序智能名片添加"
})
}
})

13
pages/card/index.json Normal file
View File

@@ -0,0 +1,13 @@
{
"usingComponents": {
"card": "/components/cardDie/cardDie",
"individual": "/components/cardIndividual/cardIndividual",
"enterprise": "/components/cardEnterprise/cardEnterprise",
"colleagues": "/components/cardColleagues/cardColleagues",
"photo": "/components/cardPhoto/cardPhoto",
"dynamics": "/components/cardDynamic/cardDynamic",
"goods": "/components/cardGood/cardGood"
},
"navigationBarTitleText": "智能名片",
"backgroundColorTop": "#ffffff"
}

81
pages/card/index.wxml Normal file
View File

@@ -0,0 +1,81 @@
<block wx:if="{{loding}}">
<view class="pack-center pages-loding">
<image src="/static/icons/loding.gif" mode="widthFix"></image>
<view>名片加载中...</view>
</view>
</block>
<block wx:else>
<!-- 没找到名片 -->
<view class="pack-center pages-hint" wx:if="{{!cardNull}}">
<image src="/static/images/card-null.png" mode="widthFix"></image>
<view>暂时还没有找到TA的名片</view>
<navigator class="null-hint-nav" open-type="switchTab" url="/pages/news/index">首页</navigator>
</view>
<!-- 展示名片 -->
<view wx:else>
<!-- 编辑按钮 -->
<block wx:if="{{isOwner}}">
<view class="card-ste" bindtap="cardSte">
<image class="card-ste-icon" src="/static/icons/card_set.png"></image>
<view class="card-ste-text">设置</view>
</view>
</block>
<block wx:else>
<view class="card-ste" bindtap="cardLike" wx:if="{{!isFavorite}}">
<image class="card-ste-icon" src="/static/icons/favorite_icon.png"></image>
<view class="card-ste-text">收藏</view>
</view>
</block>
<!-- 名片信息 -->
<view class="card">
<card
card-info="{{cardInfo}}"
card-cover="{{cardBase.cover.showpath}}"
></card>
<!-- 名片工具栏 -->
<view class="card-tool" wx:if="{{!isOwner}}">
<button class="card-tool-item" size="mini" open-type="share">分享名片</button>
<button class="card-tool-item" size="mini" bindtap="addPhoneBook">存入通讯录</button>
</view>
<view class="card-tool" wx:else>
<button class="card-tool-item" size="mini" open-type="share">分享名片</button>
</view>
<!-- 名片信息 -->
<view class="card-scrool-info">
<image class="card-scrool-code" bindtap="codeNav" src="/static/images/card_code.png" mode="heightFix"></image>
<scroll-view class="card-scrool" scroll-x>
<view class="card-scrool-item" wx:if="{{cardBase.mobile != ''}}" bindtap="cardScroolNav" data-type="phone" data-info="{{cardBase.mobile}}">
<view class="card-scrool-title"><image src="/static/icons/card_scrool_icon_00.png"></image>拨打电话</view>
<view class="card-scrool-text">{{cardBase.mobile}}</view>
</view>
<view class="card-scrool-item" wx:if="{{cardBase.wechat != ''}}" bindtap="cardScroolNav" data-type="wechat" data-info="{{cardBase.wechat}}">
<view class="card-scrool-title"><image src="/static/icons/card_scrool_icon_01.png"></image>微信号</view>
<view class="card-scrool-text">{{cardBase.wechat}}</view>
</view>
<view class="card-scrool-item" wx:if="{{cardBase.email != ''}}" bindtap="cardScroolNav" data-type="email" data-info="{{cardBase.email}}">
<view class="card-scrool-title"><image src="/static/icons/card_scrool_icon_02.png"></image>电子邮箱</view>
<view class="card-scrool-text">{{cardBase.email}}</view>
</view>
<view class="card-scrool-item" wx:if="{{cardBase.address != ''}}" bindtap="cardScroolNav" data-type="address" data-info="{{cardBase.address}}">
<view class="card-scrool-title"><image src="/static/icons/card_scrool_icon_03.png"></image>联系地址</view>
<view class="card-scrool-text">{{cardBase.address}}</view>
</view>
</scroll-view>
</view>
</view>
<!-- 展示模块 -->
<view class="models" wx:for="{{models}}" wx:key="models" wx:for-item="models" wx:if="{{models.is_show}}">
<view class="models-title">{{models.title}}</view>
<individual wx:if="{{models.name == 'individual'}}" individual-text="{{models.data}}"></individual>
<enterprise wx:elif="{{models.name == 'enterprise'}}" enterprise-info="{{models.data}}"></enterprise>
<colleagues wx:elif="{{models.name == 'colleagues'}}" colleagues-list="{{models.data}}" bindchangecard="changeCard"></colleagues>
<dynamics wx:elif="{{models.name == 'dynamics'}}" dynamic-list="{{models.dynamics}}" bindchangedynamics="changedynamics"></dynamics>
<photo wx:elif="{{models.name == 'photos'}}" photos="{{models.photos}}"></photo>
<goods wx:elif="{{models.name == 'goods'}}" goods="{{models.goods}}" bindchangegood="changeGood"></goods>
</view>
</view>
</block>

147
pages/card/index.wxss Normal file
View File

@@ -0,0 +1,147 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
*/
.card{
background: white;
}
.null-hint-nav{
background: #0b0041;
color: white;
width: 60vw;
margin: 60rpx 20vw;
line-height: 90rpx;
border-radius: 10rpx;
font-weight: bold;
font-size: 32rpx;
}
/* 名片工具 */
.card-tool{
display: flex;
padding: 0 15rpx;
}
.card-tool-item[size="mini"]{
margin: 0 15rpx;
flex: 1;
height: 90rpx;
line-height: 90rpx;
padding: 0;
font-size: 32rpx;
background: white;
color: #0b0041;
border-radius: 10rpx;
border:solid 1rpx #0b0041;
box-sizing: border-box;
}
.card-tool-item[size="mini"]:last-child{
background: #0b0041;
color: white;
border-radius: 10rpx;
}
/* 名片信息 */
.card-scrool-info{
position: relative;
height: 170rpx;
}
.card-scrool-code{
height: 116rpx;
width: 76rpx;
position: absolute;
top: 27rpx;
left: 0;
z-index: 9;
}
.card-scrool{
box-sizing: border-box;
white-space: nowrap;
}
.card-scrool-item{
padding: 15rpx 30rpx;
box-shadow: 0 0 2rpx 2rpx rgba(0, 0, 0, .05);
border-radius: 8rpx;
display: inline-block;
margin: 30rpx 20rpx 30rpx 0;
height: 110rpx;
box-sizing: border-box;
}
.card-scrool-item:last-child{
margin-right: 30rpx;
}
.card-scrool-item:first-child{
margin-left: 96rpx;
}
.card-scrool-title,
.card-scrool-text{
line-height: 40rpx;
}
.card-scrool-title{
font-size: 26rpx;
font-weight: bold;
}
.card-scrool-text{
color: gray;
font-size: 28rpx;
}
.card-scrool-title image{
width: 32rpx;
height: 32rpx;
vertical-align: middle;
margin-bottom: 4rpx;
margin-right: 8rpx;
}
/* 模块标题 */
.models-title{
font-weight: bold;
padding: 50rpx 30rpx 20rpx 30rpx;
}
.models:last-child{
padding-bottom: 30rpx;
}
/* 名片编辑 */
.card-ste{
width: 98rpx;
height: 98rpx;
background: white;
position: fixed;
bottom: 20vh;
right: 30rpx;
z-index: 9999;
box-shadow: 0 0 4rpx 4rpx rgba(0, 0, 0, .05);
border-radius: 50%;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
.card-ste-icon{
width: 42rpx;
height: 42rpx;
vertical-align: top;
}
.card-ste-text{
font-size: 20rpx;
color: #0b0041;
}

66
pages/company/index.js Normal file
View File

@@ -0,0 +1,66 @@
// pages/company/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

4
pages/company/index.json Normal file
View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "企业广场"
}

2
pages/company/index.wxml Normal file
View File

@@ -0,0 +1,2 @@
 企业广场

1
pages/company/index.wxss Normal file
View File

@@ -0,0 +1 @@
/* pages/company/index.wxss */

66
pages/home/index.js Normal file
View File

@@ -0,0 +1,66 @@
// pages/home/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

3
pages/home/index.json Normal file
View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

2
pages/home/index.wxml Normal file
View File

@@ -0,0 +1,2 @@
<!--pages/home/index.wxml-->
<text>pages/home/index.wxml</text>

1
pages/home/index.wxss Normal file
View File

@@ -0,0 +1 @@
/* pages/home/index.wxss */

66
pages/live/index.js Normal file
View File

@@ -0,0 +1,66 @@
// pages/live/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

3
pages/live/index.json Normal file
View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

2
pages/live/index.wxml Normal file
View File

@@ -0,0 +1,2 @@
<!--pages/live/index.wxml-->
<text>pages/live/index.wxml</text>

1
pages/live/index.wxss Normal file
View File

@@ -0,0 +1 @@
/* pages/live/index.wxss */

View File

@@ -4,13 +4,24 @@
* 一个梦想做木雕手艺人的程序员 * 一个梦想做木雕手艺人的程序员
*/ */
var phoneOutTime
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
code : "" code : "", //解密code
userInfo : false, //处理页面弹窗状态
parent_id : 0, //分享人用户id
loginWechat : true, //登录方式
codeTime : 60, //短信重新获取倒计时
codeBtnStat : false, //获取验证码按钮
getCodeLay : false, //获取短信验证层
codeImg : "", //图形验证码
codeImgKey : "", //图形验证码key
phone : "", //用户输入的手机号码
}, },
/** /**
@@ -20,6 +31,141 @@ Page({
this.wxLogin() this.wxLogin()
}, },
/**
* 图形验证码
*/
showImgCode(){
if(this.data.phone == ""){
wx.showToast({
title: "请输入手机号码",
icon : "none"
})
return
}
this.setData({
getCodeLay: !this.data.getCodeLay
})
if(this.data.getCodeLay) this.getCodeImg()
},
/**
* 验证码
*/
getCodeImg(){
wx.$api.auth.getImgCode().then(res=>{
this.setData({
codeImg : res.img,
codeImgKey : res.key
})
})
},
/**
* 获取短信验证码
*/
getPhoneCode(e){
if(e.detail.value.imgcode == ""){
wx.showToast({
title: "请输入验证码",
icon : "none"
})
return
}
wx.$api.auth.phoneCode({
mobileNo : this.data.phone,
captcha_key : this.data.codeImgKey,
captcha : e.detail.value.imgcode
}).then(res=>{
wx.showToast({
title: res,
icon : "none"
})
// 移出弹出层
this.showImgCode()
// 更新按钮状态
this.outTime()
this.setData({
codeBtnStat: true
})
})
},
/**
* 获取短信倒计时
*/
outTime(){
let outTime = this.data.codeTime
phoneOutTime = setInterval(()=>{
if(outTime <= 60 && outTime > 0){
outTime--
this.setData({
codeTime: outTime
})
}else{
clearInterval(phoneOutTime)
this.setData({
codeTime : 60,
codeBtnStat : false
})
}
},1000)
},
/**
* 手机号码登录
*/
loginForm(e){
wx.$api.auth.phoneLogin({
mobileNo : e.detail.value.mobileNo,
code : e.detail.value.code,
parent_id : this.data.parent_id
}).then(token=>{
// 存储登录信息
wx.setStorageSync('token', token.access_token)
if(token.has_nickname){
// 返回上一页
wx.navigateBack()
}else{
this.setData({
userInfo: !token.has_nickname
})
}
})
},
/**
* 获取用户code
*/
wxLogin(){
wx.login({
success: res=>{
this.setData({
code: res.code
})
}
})
},
/**
* 用户输入手机号码
*/
userPhone(e){
this.setData({
phone: e.detail.value
})
},
/**
* 切换登录方式
*/
loginWayTab(){
this.setData({
loginWechat: !this.data.loginWechat
})
},
/** /**
* 手机号码授权 * 手机号码授权
*/ */
@@ -32,27 +178,55 @@ Page({
code : this.data.code, code : this.data.code,
iv : e.detail.iv, iv : e.detail.iv,
encryptedData : e.detail.encryptedData, encryptedData : e.detail.encryptedData,
parent_id : "" parent_id : this.data.parent_id
}).then(res=>{ }).then(token=>{
// 存储登录信息 // 存储登录信息
wx.setStorageSync('token', res.access_token) wx.setStorageSync('token', token.access_token)
// 返回首页 if(token.has_nickname){
// 返回上一页
wx.navigateBack() wx.navigateBack()
}else{
this.setData({
userInfo: !token.has_nickname
})
}
}).catch(()=>{ }).catch(()=>{
this.wxLogin() this.wxLogin()
}) })
}, },
/** /**
* 更新code * 完善用户信息
*/ */
wxLogin(){ userInfo(e){
wx.login({ if(e.detail.auth){
success: res=>{ wx.$api.auth.authInfo({
nickname : e.detail.userInfo.nickName,
avatar : e.detail.userInfo.avatarUrl
}).then(res=>{
// 返回上一页
wx.navigateBack()
})
}else{
wx.removeStorage({
key : token,
success : ()=>{
this.setData({ this.setData({
code: res.code userInfo: false
}) })
} }
}) })
} }
},
/**
* 页面被卸载了
*/
onUnload(){
clearInterval(phoneOutTime)
this.setData({
codeTime : 60,
codeBtnStat : false
})
}
}) })

View File

@@ -1,7 +1,7 @@
{ {
"usingComponents": { "usingComponents": {
"userinfo-layer" : "/components/loginLayer/loginLayer" "userinfo-layer": "/components/userInfoLayer/userInfoLayer"
}, },
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }

View File

@@ -1,11 +1,47 @@
<!-- 验证码接口验证 -->
<view class="pack-center get-code-lay" wx:if="{{getCodeLay}}">
<form class="get-code-lay-form" bindsubmit="getPhoneCode">
<image class="get-code-lay-remove" bindtap="showImgCode" src="/static/icons/remove_icon.png" mode="widthFix"></image>
<view class="get-code-lay-title">获取验证码</view>
<view class="get-code-lay-input">
<input type="text" name="imgcode" placeholder="输入验证码"></input>
<image class="get-code-lay-img" src="{{codeImg}}" mode="heightFix" bindtap="getCodeImg"></image>
</view>
<button size="default" class="get-code-lay-btn" form-type="submit">提交</button>
</form>
</view>
<view class="login"> <!-- 登录区域 -->
<form class="login" bindsubmit="loginForm">
<view class="login-header"> <view class="login-header">
<image class="login-logo" src="/static/img/logo.jpeg" mode="aspectFill"></image> <image class="login-logo" src="/static/images/logo.png" mode="aspectFill"></image>
<view class="login-title">微信授权,体验更多服务</view> <view class="login-title">登录体验更多服务</view>
<view class="login-subhead">请使用您本人的手机号码登录/注册平台账户</view> <view class="login-subhead">{{loginWechat ? '请使用您本人的手机号码登录/注册平台账户' : '使用手机号码登录/注册平台账号'}}</view>
</view> </view>
<button class="login-btn" size="default" open-type="getPhoneNumber" bindgetphonenumber="PhoneNumber">授权手机号</button> <block wx:if="{{loginWechat}}">
<view class="login-agree">点击授权登录表示您已阅读并同意 <text>用户隐私规则</text><text>用户服务协议</text></view> <button class="login-btn" size="default" open-type="getPhoneNumber" bindgetphonenumber="PhoneNumber">微信授权</button>
</block>
<block wx:else>
<view class="phone-inputs">
<input type="number" placeholder="输入手机号码" name="mobileNo" bindblur="userPhone"></input>
</view> </view>
<view class="phone-inputs">
<input type="number" placeholder="验证码" name="code"></input>
<button class="phone-code-btn" size="mini" disabled="{{codeBtnStat}}" bindtap="showImgCode" data-type="imgcode">{{codeBtnStat ? '重新获取' + codeTime + 's' : "获取验证码"}}</button>
</view>
<button class="login-btn" size="default" form-type="submit">登录</button>
</block>
<view class="login-way" bindtap="loginWayTab">{{loginWechat ? '手机号码登录' : '微信快捷登录'}}</view>
<view class="login-agree">登录表示您已阅读并同意
<navigator hover-class="none" url="/pages/richText/richText?key=user_servies_licence">用户服务协议</navigator>
<navigator hover-class="none" url="/pages/richText/richText?key=user_private_licence">隐私声明</navigator>
</view>
</form>
<!-- -->
<userinfo-layer
show-layer="{{userInfo}}"
bind:updateinfo="userInfo"
></userinfo-layer>

View File

@@ -20,6 +20,43 @@ page{
box-sizing: border-box; box-sizing: border-box;
} }
.login-way{
color: #0b0041;
line-height: 90rpx;
}
/* input */
.phone-inputs{
border-bottom: solid 1rpx #eee;
margin-bottom: 30rpx;
display: flex;
}
.phone-inputs input{
height: 90rpx;
font-size: 32rpx;
justify-content: space-between;
flex: 1;
text-align: left;
}
.phone-code-btn[size="mini"]{
margin-left: 30rpx;
height: 90rpx;
line-height: 90rpx;
padding: 0 30rpx;
font-size: 32rpx;
font-weight: normal;
border-radius: 0;
background: transparent;
color: #ff8d37;
}
.phone-code-btn[size="mini"][disabled]{
background: transparent;
color: #afafaf;
}
/* btn */ /* btn */
.login-btn[size="default"]{ .login-btn[size="default"]{
width: 100%; width: 100%;
@@ -28,8 +65,9 @@ page{
padding: 0; padding: 0;
font-size: 34rpx; font-size: 34rpx;
border-radius: 0; border-radius: 0;
background: #2d6af6; background: #0b0041;
color: white; color: white;
margin-bottom: 40rpx;
} }
/* header */ /* header */
@@ -41,7 +79,6 @@ page{
.login-logo{ .login-logo{
width: 128rpx; width: 128rpx;
height: 128rpx; height: 128rpx;
background: #eee;
vertical-align: top; vertical-align: top;
} }
@@ -58,14 +95,80 @@ page{
/* 用户协议 */ /* 用户协议 */
.login-agree{ .login-agree{
margin-top: 20vh; margin-top: 10vh;
color: #afafaf; color: #afafaf;
font-size: 26rpx; font-size: 26rpx;
text-align: center; text-align: center;
line-height: 50rpx; line-height: 50rpx;
} }
.login-agree text{ .login-agree navigator{
color: #ff8d37; color: #ff8d37;
padding: 0 5rpx; padding: 0 5rpx;
display: inline-block;
} }
/* 验证码弹出层 */
.get-code-lay{
background: rgba(0, 0, 0, .4);
position: fixed;
z-index: 99;
text-align: center;
}
.get-code-lay-form{
position: relative;
background: white;
padding: 20rpx 30rpx;
display: inline-block;
width: 70vw;
border-radius: 10rpx;
}
.get-code-lay-remove{
position: absolute;
width: 28rpx;
right: 30rpx;
top: 30rpx;
}
.get-code-lay-title{
font-weight: bold;
font-size: 34rpx;
line-height: 90rpx;
}
.get-code-lay-input{
background: #eee;
border-radius: 10rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.get-code-lay-input input{
height: 90rpx;
flex: 1;
text-align: left;
padding: 0 30rpx;
}
.get-code-lay-img{
height: 56rpx;
background: white;
margin-right: 30rpx;
}
.get-code-lay-btn[size="default"]{
margin-top: 30rpx;
margin-bottom: 10rpx;
width: 100%;
height: 80rpx;
line-height: 80rpx;
border-radius: 10rpx;
padding: 0;
font-size: 32rpx;
background: #0b0041;
color: white;
}

66
pages/mall/index.js Normal file
View File

@@ -0,0 +1,66 @@
// pages/mall/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

3
pages/mall/index.json Normal file
View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

2
pages/mall/index.wxml Normal file
View File

@@ -0,0 +1,2 @@
<!--pages/mall/index.wxml-->
<text>pages/mall/index.wxml</text>

1
pages/mall/index.wxss Normal file
View File

@@ -0,0 +1 @@
/* pages/mall/index.wxss */

View File

@@ -0,0 +1,31 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
*/
Page({
/**
* 页面的初始数据
*/
data: {
title : "", //文章标题
content : "", //富文本信息
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(e) {
wx.$api.publics.richText(e.key).then(res=>{
wx.setNavigationBarTitle({
title: res.title
})
this.setData({
content: res.content.replace(/\<img/gi, '<img style="max-width:100%; height:auto; display:block;"')
})
})
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "说明"
}

View File

@@ -0,0 +1,2 @@
<rich-text nodes="{{content}}"></rich-text>

View File

@@ -0,0 +1,10 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
*/
page{
background: white;
}

View File

@@ -1,4 +1,10 @@
/**
* Web唐明明
* 匆匆数载恍如梦岁月迢迢华发增
* 碌碌无为枉半生一朝惊醒万事空
*/
Page({ Page({
/** /**

View File

@@ -10,7 +10,7 @@
> >
</swiperViode> </swiperViode>
<!-- 视频播放按钮 --> <!-- 视频播放按钮 -->
<view class="videoLayer-play {{!isPlay ? 'show': ''}}" src="/static/icon/play_icon.png"></view> <view class="videoLayer-play {{!isPlay ? 'show': ''}}" src="/static/icons/play_icon.png"></view>
<!-- 视频信息 --> <!-- 视频信息 -->
<view class="video-info"> <view class="video-info">
<view class="video-user">@ {{videoList[videoIndex].company.name || "-"}}</view> <view class="video-user">@ {{videoList[videoIndex].company.name || "-"}}</view>
@@ -22,20 +22,20 @@
<image class="video-tool-cover" src="{{videoList[videoIndex].company.cover || ''}}" mode="aspectFill"></image> <image class="video-tool-cover" src="{{videoList[videoIndex].company.cover || ''}}" mode="aspectFill"></image>
</view> </view>
<view class="video-tool-item" bindtap="binLike"> <view class="video-tool-item" bindtap="binLike">
<image class="video-tool-icon" src="/static/icon/video_tool_00.png" mode="widthFix"></image> <image class="video-tool-icon" src="/static/icons/video_tool_00.png" mode="widthFix"></image>
<view class="video-tool-number">{{videoList[videoIndex].likes || "0"}}</view> <view class="video-tool-number">{{videoList[videoIndex].likes || "0"}}</view>
</view> </view>
<view class="video-tool-item"> <view class="video-tool-item">
<image class="video-tool-icon" src="/static/icon/video_tool_01.png" mode="widthFix"></image> <image class="video-tool-icon" src="/static/icons/video_tool_01.png" mode="widthFix"></image>
<view class="video-tool-number">1000</view> <view class="video-tool-number">1000</view>
</view> </view>
<view class="video-tool-item"> <view class="video-tool-item">
<image class="video-tool-icon" src="/static/icon/video_tool_02.png" mode="widthFix"></image> <image class="video-tool-icon" src="/static/icons/video_tool_02.png" mode="widthFix"></image>
<view class="video-tool-number">{{videoList[videoIndex].shares || "0"}}</view> <view class="video-tool-number">{{videoList[videoIndex].shares || "0"}}</view>
</view> </view>
<view class="video-tool-item"> <view class="video-tool-item">
<view class="video-tool-vinyl {{playState ? 'rotate': ''}}"> <view class="video-tool-vinyl {{playState ? 'rotate': ''}}">
<image class="video-tool-vinyl-back" src="/static/img/vinyl_back.png" mode="widthFix"></image> <image class="video-tool-vinyl-back" src="/static/images/vinyl_back.png" mode="widthFix"></image>
<image class="video-tool-vinyl-cover" src="{{videoList[videoIndex].company.cover || ''}}" mode="aspectFill"></image> <image class="video-tool-vinyl-cover" src="{{videoList[videoIndex].company.cover || ''}}" mode="aspectFill"></image>
</view> </view>
</view> </view>

View File

@@ -1,9 +1,11 @@
/** /**
* Web唐明明 * Web唐明明
* 一个梦想做木雕手艺人的程序员 * 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
*/ */
page{ page{
/* background: #0e0c1a; */ /* background: #0e0c1a; */
} }

66
pages/ticket/index.js Normal file
View File

@@ -0,0 +1,66 @@
// pages/ticket/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

3
pages/ticket/index.json Normal file
View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

2
pages/ticket/index.wxml Normal file
View File

@@ -0,0 +1,2 @@
<!--pages/ticket/index.wxml-->
<text>pages/ticket/index.wxml</text>

1
pages/ticket/index.wxss Normal file
View File

@@ -0,0 +1 @@
/* pages/ticket/index.wxss */

66
pages/user/index.js Normal file
View File

@@ -0,0 +1,66 @@
// pages/user/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

3
pages/user/index.json Normal file
View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

2
pages/user/index.wxml Normal file
View File

@@ -0,0 +1,2 @@
<!--pages/user/index.wxml-->
<text>pages/user/index.wxml</text>

1
pages/user/index.wxss Normal file
View File

@@ -0,0 +1 @@
/* pages/user/index.wxss */

Some files were not shown because too many files have changed in this diff Show More