初始化项目(页面完成)

This commit is contained in:
itgaojian 2021-04-29 10:08:41 +08:00
commit cce80cae33
532 changed files with 18672 additions and 0 deletions

27
app.js Normal file
View File

@ -0,0 +1,27 @@
// app.js
App({
onLaunch() {
//设置状态栏
wx.getSystemInfo({
success: e => {
this.globalData.StatusBar = e.statusBarHeight;
let capsule = wx.getMenuButtonBoundingClientRect();
if (capsule) {
this.globalData.Custom = capsule;
this.globalData.CustomBar = capsule.bottom + capsule.top - e.statusBarHeight;
} else {
this.globalData.CustomBar = e.statusBarHeight + 50;
}
}
})
// 登录
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
}
})
},
globalData: {
userInfo: null
}
})

35
app.json Normal file
View File

@ -0,0 +1,35 @@
{
"pages": [
"pages/index/index",
"pages/institutions/institutionslist",
"pages/results/resultslist",
"pages/card/cardlist",
"pages/branches/brancheslist",
"pages/notices/noticeslist",
"pages/answer/answerlist",
"pages/notices/noticedetail",
"pages/institutions/institutionsdetail",
"pages/results/resultsdetail",
"pages/card/carddetail",
"pages/index/mineinfo",
"pages/branches/branchesdetail"
],
"window": {
"backgroundTextStyle": "dark",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "名片",
"navigationBarTextStyle": "black",
"navigationStyle": "custom"
},
"style": "v2",
"sitemapLocation": "sitemap.json",
"usingComponents": {
"cu-custom": "/components/cuicustom/cu-custom",
"van-tabbar": "/vant/dist/tabbar/index",
"van-tabbar-item": "/vant/dist/tabbar-item/index",
"van-swipe-cell": "/vant/dist/swipe-cell/index",
"van-cell-group": "/vant/dist/cell-group/index",
"van-cell": "/vant/dist/cell/index",
"van-empty": "/vant/dist/empty/index"
}
}

253
app.wxss Normal file
View File

@ -0,0 +1,253 @@
/**app.wxss**/
@import "/class/main.wxss";
@import "/class/icon.wxss";
page {
background-color: #fafafa;
width: 100%;
}
.list {
width: 100%;
display: flex;
flex-direction: column;
margin-top: 30rpx;
}
.item {
display: flex;
flex-direction: row;
padding: 10rpx;
align-items: center;
flex-wrap: nowrap;
margin-top: 20rpx;
border-radius: 10rpx;
box-shadow: 1px 1px 1px #f7f5f5;
}
.content {
width: 80%;
display: flex;
flex-direction: column;
justify-content: space-around;
min-height: 64rpx;
margin-left: 10rpx;
}
.content.text-cut {
max-width: 300rpx;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.bottom-action {
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
padding-right: 10rpx;
}
.content-view {
width: 100%;
padding: 10rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
align-self: center;
}
.content-detail {
width: 98%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
align-self: center;
background-color: white;
border-radius: 10rpx;
padding: 10rpx;
}
.notice-title {
width: 100%;
text-align: center;
}
.table-list {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
flex-direction: column;
}
.table-title {
display: flex;
width: 96%;
flex-direction: row;
padding-top: 20rpx;
padding-bottom: 20rpx;
border-radius: 20rpx;
}
.table-title-border {
display: flex;
width: 96%;
flex-direction: row;
border-radius: 5rpx;
border: 1rpx solid blue;
}
.table-item {
display: flex;
width: 96%;
flex-direction: row;
border-radius: 5rpx;
min-height: 75rpx;
}
.table-notice {
display: flex;
width: 96%;
flex-direction: column;
align-items: center;
justify-content: center;
border-radius: 5rpx;
min-height: 75rpx;
padding: 5rpx;
}
.table-title-nor {
display: flex;
width: 96%;
flex-direction: row;
padding-top: 20rpx;
padding-bottom: 20rpx;
border-radius: 3rpx;
}
.table-title-item {
flex: 1.1;
text-align: center;
align-items: center;
font-size: 24rpx;
justify-content: center;
align-self: center;
}
.table-item-title-1 {
flex: 1.3;
text-align: center;
align-items: center;
font-size: 24rpx;
justify-content: center;
align-self: center;
}
.table-item-title-4 {
flex: 0.4;
text-align: center;
font-size: 24rpx;
align-items: center;
justify-content: center;
align-self: center;
}
.table-item-title-3 {
flex: 0.3;
text-align: center;
align-items: center;
font-size: 24rpx;
justify-content: center;
align-self: center;
}
.table-item-title-2 {
flex: 0.2;
text-align: center;
align-items: center;
font-size: 24rpx;
justify-content: center;
align-self: center;
}
.table-item-content-item {
width: 100%;
flex: 1;
display: flex;
flex-direction: row;
text-align: center;
align-items: center;
justify-content: center;
align-self: center;
min-height: 75rpx;
}
.border-top {
border-top-style: solid;
border-top-width: 1rpx;
border-top-color: blue;
}
.border-bottom {
border-bottom-style: solid;
border-bottom-width: 1rpx;
border-bottom-color: blue;
}
.border-left {
border-left-style: solid;
border-left-width: 1rpx;
border-left-color: blue;
}
.border-right {
border-right-style: solid;
border-right-width: 1rpx;
border-right-color: blue;
}
.table-item-content-item-title {
flex: 0.7;
text-align: center;
font-size: 24rpx;
align-items: center;
justify-content: center;
align-self: center;
}
.table-item-content-item-title-4 {
flex: 0.4;
text-align: center;
font-size: 24rpx;
align-items: center;
justify-content: center;
align-self: center;
}
.table-item-content-item-content {
flex: 1.7;
text-align: center;
align-items: center;
justify-content: center;
align-self: center;
border-left-width: 1rpx;
border-left-color: blue;
font-size: 24rpx;
border-left-style: solid;
}
.table-item-content {
display: flex;
flex: 1.8;
text-align: center;
flex-direction: column;
align-items: center;
justify-content: center;
align-self: center;
}

1226
class/icon.wxss Normal file

File diff suppressed because one or more lines are too long

4173
class/main.wxss Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,228 @@
const app = getApp();
Component({
options: {
addGlobalClass: true,
multipleSlots: true
},
lifetimes: {
attached() {
let shopCartData = app.globalData.shopCart
var amount = 0
if (shopCartData.length > 0) {
shopCartData.forEach(it => {
if (it.shopId == this.properties.shopId) {
this.data.shopCart = this.data.shopCart.concat(it)
amount += it.buyNum
}
})
}
this.setData({
shopId: this.properties.shopId,
shopCart: this.data.shopCart,
buyAmount: amount
})
}
},
/**
* 组件的对外属性
*/
properties: {
shopCart: {
type: Array,
default: []
},
goods: {
type: Object,
default: null
},
shopId: {
type: String,
default: '',
},
showBtn: {
type: Boolean,
default: true
}
},
/**
* 组件的初始数据
*/
data: {
shopCart: [],
show: false,
buyAmount: 0
},
/**
* 组件的方法列表
*/
methods: {
//添加商品
addCart(event) {
var _self = this
let goods = event.currentTarget.dataset.goods
goods.buyNum = 0
if (goods != null) {
//判断是否存在
var isExist = false
for (var i = 0; i < _self.data.shopCart.length; ++i) {
var it = _self.data.shopCart[i]
if (it.goodsId == goods.goodsId) {
//判断是否超出库存
if (it.buyNum < goods.goodsTotal) {
it.buyNum += 1
} else {
wx.showToast({
title: '超出库存范围',
icon: 'error'
})
}
isExist = true
break;
}
}
if (!isExist) {
//不存在
goods.buyNum = 1
_self.data.shopCart = _self.data.shopCart.concat(goods)
}
let amount = 0
_self.data.shopCart.forEach(it => {
amount += it.buyNum
})
_self.setData({
shopCart: _self.data.shopCart,
buyAmount: amount
})
app.globalData.shopCart = _self.data.shopCart
this.triggerEvent('refreshShopCart')
}
},
//显示购物车列表
showCart() {
let cart = {
shopId: this.data.shopId,
shopCart: this.data.shopCart
}
this.triggerEvent('showcart', cart)
},
//立即订购
nowOrder(event) {
if (this.data.shopCart.length > 0) {
wx.navigateTo({
url: '/pages/shop/product/affirmorder?shopId=' + this.data.shopId,
})
} else {
wx.showToast({
title: '购物车空空如也',
icon: 'error'
})
}
},
onClose() {
this.setData({
show: false
})
},
//外部添加商品
listAddToCart(goods) {
let _self = this
goods.buyNum = 0
if (goods != null) {
//判断是否存在
var isExist = false
for (var i = 0; i < _self.data.shopCart.length; ++i) {
var it = _self.data.shopCart[i]
if (it.goodsId == goods.goodsId) {
//判断是否超出库存
if (it.buyNum < goods.goodsTotal) {
it.buyNum += 1
} else {
wx.showToast({
title: '超出库存范围',
icon: 'error'
})
}
isExist = true
break;
}
}
if (!isExist) {
//不存在
goods.buyNum = 1
_self.data.shopCart = _self.data.shopCart.concat(goods)
}
let amount = 0
_self.data.shopCart.forEach(it => {
amount += it.buyNum
})
_self.setData({
shopCart: _self.data.shopCart,
buyAmount: amount
})
app.globalData.shopCart = _self.data.shopCart
}
},
//移除商品
listRemoveCart(goods) {
let _self = this
goods.buyNum = 0
if (goods != null) {
//判断是否存在
var isExist = false
for (var i = 0; i < _self.data.shopCart.length; ++i) {
var it = _self.data.shopCart[i]
if (it.goodsId == goods.goodsId) {
//判断是否超出库存
if (it.buyNum < goods.goodsTotal) {
it.buyNum -= 1
} else {
wx.showToast({
title: '超出库存范围',
icon: 'error'
})
}
isExist = true
break;
}
}
let amount = 0
_self.data.shopCart.forEach(it => {
amount += it.buyNum
})
_self.setData({
shopCart: _self.data.shopCart,
buyAmount: amount
})
if (amount == 0) {
app.globalData.shopCart = []
_self.setData({
shopCart: []
})
} else {
app.globalData.shopCart = _self.data.shopCart
}
}
},
//刷新
refreshCart() {
let shopCartData = app.globalData.shopCart
this.setData({
shopCart: []
})
var amount = 0
if (shopCartData.length > 0) {
shopCartData.forEach(it => {
if (it.shopId == this.properties.shopId) {
this.data.shopCart = this.data.shopCart.concat(it)
amount += it.buyNum
}
})
}
this.setData({
shopId: this.properties.shopId,
shopCart: this.data.shopCart,
buyAmount: amount
})
}
}
})

View File

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

View File

@ -0,0 +1,17 @@
<view class="cu-bar bg-white tabbar border shop foot">
<view class="action">
<view class="cuIcon-favor">
</view>
收藏
</view>
<view class="action" bindtap="showCart">
<view class="cuIcon-cart">
<view class="cu-tag badge">{{buyAmount}}</view>
</view>
购物车
</view>
<view class="cu-btn bg-orange round shadow-blur" bindtap="addCart" data-goods="{{goods}}" wx:if="{{showBtn}}">加入购物车
</view>
<view class="cu-btn bg-white round shadow-blur" wx:else></view>
<view class="cu-btn bg-red round shadow-blur" bindtap="nowOrder">立即订购</view>
</view>

View File

@ -0,0 +1 @@
/* components/cartfoot/cuscart.wxss */

View File

@ -0,0 +1,63 @@
const app = getApp();
Component({
/**
* 组件的一些选项
*/
options: {
addGlobalClass: true,
multipleSlots: true
},
/**
* 组件的对外属性
*/
properties: {
bgColor: {
type: String,
default: ''
},
isCustom: {
type: [Boolean, String],
default: false
},
isBack: {
type: [Boolean, String],
default: false
},
isRelaunch: {
type: [Boolean, String],
default: false
},
bgImage: {
type: String,
default: ''
},
},
/**
* 组件的初始数据
*/
data: {
StatusBar: app.globalData.StatusBar,
CustomBar: app.globalData.CustomBar,
Custom: app.globalData.Custom
},
/**
* 组件的方法列表
*/
methods: {
BackPage() {
wx.navigateBack({
delta: 1
});
},
GoHome() {
wx.navigateBack({
delta: 1,
})
},
toHome() {
wx.reLaunch({
url: '/pages/index/index',
})
}
}
})

View File

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

View File

@ -0,0 +1,22 @@
<view class="cu-custom" style="height:{{CustomBar}}px">
<view class="cu-bar fixed {{bgImage!=''?'none-bg text-white bg-img':''}} {{bgColor}}"
style="height:{{CustomBar}}px;padding-top:{{StatusBar}}px;{{bgImage?'background-image:url(' + bgImage+')':''}}">
<view class="action" bindtap="BackPage" wx:if="{{isBack}}">
<text class="cuIcon-back text-white" style="z-index:20;"></text>
<slot name="backText"></slot>
</view>
<view class="action" bindtap="GoHome" wx:if="{{isRelaunch}}">
<text class="cuIcon-back"></text>
<slot name="backText"></slot>
</view>
<view class="action border-custom" wx:if="{{isCustom}}"
style="width:{{Custom.width}}px;height:{{Custom.height}}px;margin-left:calc(750rpx - {{Custom.right}}px)">
<text class="cuIcon-back" bindtap="BackPage"></text>
<text class="cuIcon-homefill" bindtap="toHome"></text>
</view>
<view class="content" style="top:{{StatusBar}}px">
<slot name="content"></slot>
</view>
<slot name="right"></slot>
</view>
</view>

View File

@ -0,0 +1 @@
/* colorui/components/cu-custom.wxss */

View File

@ -0,0 +1,35 @@
Component({
properties: {
mtype:{
type:Number,
value:1,
observer: function (newVal, oldVal) {
this.setData({
mtype: newVal
})
}
},
nodata_str:{
type:String,
value:'暂无数据',
observer: function (newVal, oldVal) {
this.setData({
nodata_str: newVal
})
}
},
hidden:{
type:Boolean,
value:true,
observer: function (newVal, oldVal) {
this.setData({
hidden: newVal
})
}
},
tipcolor:{
type:String,
value:"#f9f9f9"
}
}
})

View File

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

View File

@ -0,0 +1,21 @@
<block wx:if="{{mtype==2}}">
<view class="zan-loadmore zan-loadmore--nomore" hidden="{{hidden}}">
<view class="zan-loadmore__tips" style="background-color:{{tipcolor}}">
<view class="zan-loadmore__dot"></view>
</view>
</view>
</block>
<block wx:elif="{{mtype==3}}">
<view class="zan-loadmore zan-loadmore--nodata" hidden="{{hidden}}">
<view class="zan-loadmore__tips" style="background-color:{{tipcolor}}">{{ nodata_str}}</view>
</view>
</block>
<block wx:elif="{{mtype==1}}" >
<view class="zan-loadmore" hidden="{{hidden}}">
<image class="zan-loading" src="../../assets/imgs/loadmore.png"></image>
<view class="zan-loadmore__tips" style="background-color:{{tipcolor}}">加载中...</view>
</view>
</block>

View File

@ -0,0 +1,57 @@
.zan-loadmore{
position:relative;
width:65%;
margin:0 auto;
line-height:20px;
font-size:14px;
text-align:center;
display: block;
vertical-align: middle
}
.zan-loading{
width:20px;
height:20px;
display:inline-block;
vertical-align:middle;
animation:weuiLoading 1s steps(12,end) infinite;
}
.zan-loadmore .zan-loading{
margin-right:4px
}
.zan-loadmore__tips{
display:inline-block;
vertical-align:middle;
height:20px;
line-height:20px;
color:#999
}
.zan-loadmore--nodata,.zan-loadmore--nomore{
border-top:1rpx solid #e5e5e5;
}
.zan-loadmore--nodata{
margin-top:20rpx
}
.zan-loadmore--nodata .zan-loadmore__tips{
position:relative;
top:-11px;
padding:0 6px
}
.zan-loadmore--nomore .zan-loadmore__tips{
position:relative;
top:-11px;
padding:0 6px
}
.zan-loadmore__dot{
position:absolute;
left:50%;
top:10px;
margin-left:-2px;
margin-top:-2px;
content:" ";
width:4px;
height:4px;
border-radius:50%;
background-color:#e5e5e5;
display:inline-block;
vertical-align:middle;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
images/icons/ic_success.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -0,0 +1,65 @@
// pages/answer/answerlist.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
answerList: [],
CustomBar: app.globalData.CustomBar,
countTime: 2000, //延迟搜索 时间
searchWaiting: false, //是否等待搜索倒计时中,
searchKey: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
doSearch(e) {
this.setData({
countTime: 2000,
searchKey: e.detail.value,
})
//是否处于搜索倒计时中
if (!this.data.searchWaiting) {
this.timer();
}
},
getResultsList(key) {
console.log('搜索中' + key)
},
/**
* 延迟搜索
*/
timer() {
var _self = this;
this.setData({
searchWaiting: true
})
let promise = new Promise((resolve, reject) => {
let setTimer = setInterval(
() => {
console.log('搜索倒计时: ' + _self.data.countTime);
_self.setData({
countTime: _self.data.countTime - 1000
})
if (_self.data.countTime <= 0) {
console.log('开始搜索: ' + _self.data.searchKey);
_self.setData({
countTime: 2000,
searchWaiting: false,
})
resolve(setTimer)
}
}, 1000)
})
promise.then((setTimer) => {
_self.getResultsList(_self.data.searchKey)
clearInterval(setTimer) //清除计时器
})
},
})

View File

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

View File

@ -0,0 +1,18 @@
<!--pages/branches/brancheslist.wxml-->
<cu-custom bgColor="bg-darkblue" isBack="{{true}}" isRelaunch="{{false}}">
<view slot="content" style="color:#FFFFFF;">报考问答</view>
</cu-custom>
<scroll-view>
<view class="list" wx:if="{{answerList.length>0}}">
<view class="item" wx:for="{{answerList}}" wx:key="index">
<view class="cu-avatar radius xl"
style="background-image:url(https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.czcaizhi.com%2FContent%2FUploadFiles%2Fimage%2F20180920%2F20180920133956_3429.jpg&refer=http%3A%2F%2Fwww.czcaizhi.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1622110389&t=4ae9d4f943c30ac6d43801515eec97e5);">
</view>
<view class="content">
<text class="text-cut text-black text-bold">2021年4-6月特种设备作业人员培训开班通知</text>
<text class="text-cut">新东方在线</text>
</view>
</view>
</view>
<van-empty description="暂无数据" wx:else />
</scroll-view>

View File

@ -0,0 +1 @@
/* pages/answer/answerlist.wxss */

View File

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

View File

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

View File

@ -0,0 +1,4 @@
<!--pages/branches/branchesdetail.wxml-->
<cu-custom bgColor="bg-darkblue" isBack="{{true}}" isRelaunch="{{false}}">
<view slot="content" style="color:#FFFFFF;">考试网点</view>
</cu-custom>

View File

@ -0,0 +1 @@
/* pages/branches/branchesdetail.wxss */

View File

@ -0,0 +1,64 @@
// pages/branches/brancheslist.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
branchesList: [],
CustomBar: app.globalData.CustomBar,
countTime: 2000, //延迟搜索 时间
searchWaiting: false, //是否等待搜索倒计时中,
searchKey: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
doSearch(e) {
this.setData({
countTime: 2000,
searchKey: e.detail.value,
})
//是否处于搜索倒计时中
if (!this.data.searchWaiting) {
this.timer();
}
},
getResultsList(key) {
console.log('搜索中' + key)
},
/**
* 延迟搜索
*/
timer() {
var _self = this;
this.setData({
searchWaiting: true
})
let promise = new Promise((resolve, reject) => {
let setTimer = setInterval(
() => {
console.log('搜索倒计时: ' + _self.data.countTime);
_self.setData({
countTime: _self.data.countTime - 1000
})
if (_self.data.countTime <= 0) {
console.log('开始搜索: ' + _self.data.searchKey);
_self.setData({
countTime: 2000,
searchWaiting: false,
})
resolve(setTimer)
}
}, 1000)
})
promise.then((setTimer) => {
_self.getResultsList(_self.data.searchKey)
clearInterval(setTimer) //清除计时器
})
},
})

View File

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

View File

@ -0,0 +1,24 @@
<!--pages/branches/brancheslist.wxml-->
<cu-custom bgColor="bg-darkblue" isBack="{{true}}" isRelaunch="{{false}}">
<view slot="content" style="color:#FFFFFF;">考试网点</view>
</cu-custom>
<view class="cu-bar bg-white search fixed" style="top:{{CustomBar}}px">
<view class="search-form round" style="margin-top:5rpx;margin-bottom:5rpx">
<text class="cuIcon-search"></text>
<input type="text" placeholder="请输入关键字" confirm-type="search" bindinput="doSearch"></input>
</view>
</view>
<scroll-view style="margin-top:70rpx;padding-left:10rpx;padding-right:10rpx;">
<view class="list" wx:if="{{branchesList.length>0}}">
<view class="item" wx:for="{{branchesList}}" wx:key="index">
<view class="cu-avatar radius xl"
style="background-image:url(https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.czcaizhi.com%2FContent%2FUploadFiles%2Fimage%2F20180920%2F20180920133956_3429.jpg&refer=http%3A%2F%2Fwww.czcaizhi.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1622110389&t=4ae9d4f943c30ac6d43801515eec97e5);">
</view>
<view class="content">
<text class="text-cut text-black text-bold">2021年4-6月特种设备作业人员培训开班通知</text>
<text class="text-cut">新东方在线</text>
</view>
</view>
</view>
<van-empty description="暂无数据" wx:else />
</scroll-view>

View File

@ -0,0 +1 @@
/* pages/branches/brancheslist.wxss */

66
pages/card/carddetail.js Normal file
View File

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

View File

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

View File

@ -0,0 +1,87 @@
<cu-custom bgColor="bg-darkblue" isBack="{{true}}" isRelaunch="{{false}}">
<view slot="content" style="color:#FFFFFF;">准考证</view>
</cu-custom>
<scroll-view style="width:100%;">
<view class="content-view">
<view class="content-detail">
<view class="text-black text-xl text-bold margin-top-sm text-center">
2019年注册安全工程师准考证
</view>
<view class="table-list margin-top-sm">
<!-- 图片和短 -->
<view class="table-title-border">
<view class="table-item-content">
<view class="table-item-content-item border-bottom border-right">
<view class="table-item-content-item-title">考生姓名</view>
<view class="table-item-content-item-content">张三</view>
</view>
<view class="table-item-content-item border-bottom border-right">
<view class="table-item-content-item-title">性别</view>
<view class="table-item-content-item-content">男</view>
</view>
<view class="table-item-content-item border-bottom border-right">
<view class="table-item-content-item-title">证件号码</view>
<view class="table-item-content-item-content">111111111111111116</view>
</view>
<view class="table-item-content-item border-right">
<view class="table-item-content-item-title">报名序号</view>
<view class="table-item-content-item-content">1123412341234</view>
</view>
</view>
<view class="table-title-item">
<image
src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.qiezichina.com%2FPublic%2Fueditor%2Fimages%2F2017%2F10%2F12%2FjT3Af1507783336.jpg&refer=http%3A%2F%2Fwww.qiezichina.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1622193850&t=5f7d149a157aac28dac15eb79f39a578"
mode="scaleToFill" style="width:230rpx;height:300rpx;border-radius:10rpx;"></image>
</view>
</view>
<!-- 长条 -->
<view class="table-item border-bottom border-left border-right">
<view class="table-item-content-item-title-4">档案号</view>
<view class="table-item-content-item-content">1234123412341234123412341234</view>
</view>
<view class="table-item border-bottom border-left border-right">
<view class="table-item-content-item-title-4">报考专业</view>
<view class="table-item-content-item-content">建筑施工安全</view>
</view>
<view class="table-item border-bottom border-left border-right">
<view class="table-item-content-item-title-4">工作单位</view>
<view class="table-item-content-item-content">内蒙古呼和浩特市</view>
</view>
<view class="table-item border-bottom border-left border-right">
<view class="table-item-content-item-title-4">考点地址</view>
<view class="table-item-content-item-content">内蒙古呼和浩特市</view>
</view>
<!-- 考试科目 -->
<view class="table-item border-left border-right border-bottom">
<view class="table-item-title-1 ">考试科目</view>
<view class="table-item-title-1 border-left ">考试时间</view>
<view class="table-item-title-4 border-left">考场</view>
<view class="table-item-title-4 border-left ">座位</view>
</view>
<view class="table-item border-left border-right border-bottom">
<view class="table-item-title-1">安全生产法律法规</view>
<view class="table-item-title-1 border-left">2021-11-11 09:00-11:20</view>
<view class="table-item-title-4 border-left">10</view>
<view class="table-item-title-4 border-left">99</view>
</view>
<view class="table-item border-left border-right border-bottom">
<view class="table-item-title-1">安全生产法律法规</view>
<view class="table-item-title-1 border-left">2021-11-11 09:00-11:20</view>
<view class="table-item-title-4 border-left">10</view>
<view class="table-item-title-4 border-left">99</view>
</view>
<view class="table-item border-left border-right border-bottom">
<view class="table-item-title-1">安全生产法律法规</view>
<view class="table-item-title-1 border-left">2021-11-11 09:00-11:20</view>
<view class="table-item-title-4 border-left">10</view>
<view class="table-item-title-4 border-left">99</view>
</view>
<view class="table-notice border-left border-right border-bottom">
<view class="text-blod text-lg">考试须知</view>
<view class="margin-top-smm">
考试须知考试须知考试须知考试须知考试须知考试须知考试须知考试须知考试须知考试须知考试须知考试须知考试须知考试须知考试须知考试须知考试须知考试须知考试须知考试须知考试须知</view>
</view>
</view>
</view>
</view>
</scroll-view>

View File

@ -0,0 +1 @@
/* pages/card/carddetail.wxss */

71
pages/card/cardlist.js Normal file
View File

@ -0,0 +1,71 @@
// pages/card/cardlist.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
cardList: [{}, {}, {}, {}],
CustomBar: app.globalData.CustomBar,
countTime: 2000, //延迟搜索 时间
searchWaiting: false, //是否等待搜索倒计时中,
searchKey: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
showDetail(e) {
var item = e.currentTarget.dataset.item
wx.navigateTo({
url: './carddetail',
})
},
doSearch(e) {
this.setData({
countTime: 2000,
searchKey: e.detail.value,
})
//是否处于搜索倒计时中
if (!this.data.searchWaiting) {
this.timer();
}
},
getResultsList(key) {
console.log('搜索中' + key)
},
/**
* 延迟搜索
*/
timer() {
var _self = this;
this.setData({
searchWaiting: true
})
let promise = new Promise((resolve, reject) => {
let setTimer = setInterval(
() => {
console.log('搜索倒计时: ' + _self.data.countTime);
_self.setData({
countTime: _self.data.countTime - 1000
})
if (_self.data.countTime <= 0) {
console.log('开始搜索: ' + _self.data.searchKey);
_self.setData({
countTime: 2000,
searchWaiting: false,
})
resolve(setTimer)
}
}, 1000)
})
promise.then((setTimer) => {
_self.getResultsList(_self.data.searchKey)
clearInterval(setTimer) //清除计时器
})
},
})

3
pages/card/cardlist.json Normal file
View File

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

24
pages/card/cardlist.wxml Normal file
View File

@ -0,0 +1,24 @@
<!--pages/branches/brancheslist.wxml-->
<cu-custom bgColor="bg-darkblue" isBack="{{true}}" isRelaunch="{{false}}">
<view slot="content" style="color:#FFFFFF;">准考证查询</view>
</cu-custom>
<view class="cu-bar bg-white search fixed" style="top:{{CustomBar}}px">
<view class="search-form round" style="margin-top:5rpx;margin-bottom:5rpx">
<text class="cuIcon-search"></text>
<input type="text" placeholder="请输入关键字" confirm-type="search" bindinput="doSearch"></input>
</view>
</view>
<scroll-view style="margin-top:70rpx;padding-left:10rpx;padding-right:10rpx;">
<view class="list" wx:if="{{cardList.length>0}}">
<view class="item" wx:for="{{cardList}}" wx:key="index" data-item="{{item}}" bindtap="showDetail">
<view class="cu-avatar radius xl"
style="background-image:url(https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.czcaizhi.com%2FContent%2FUploadFiles%2Fimage%2F20180920%2F20180920133956_3429.jpg&refer=http%3A%2F%2Fwww.czcaizhi.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1622110389&t=4ae9d4f943c30ac6d43801515eec97e5);">
</view>
<view class="content">
<text class="text-cut text-black text-bold">2021年4-6月特种设备作业人员培训开班通知</text>
<text class="text-cut">新东方在线</text>
</view>
</view>
</view>
<van-empty description="暂无数据" wx:else />
</scroll-view>

1
pages/card/cardlist.wxss Normal file
View File

@ -0,0 +1 @@
/* pages/card/cardlist.wxss */

121
pages/index/index.js Normal file
View File

@ -0,0 +1,121 @@
// index.js
// 获取应用实例
const app = getApp()
Page({
data: {
index: 1,
noticeList: [{}, {}, {}, {}, {}], //开班通告
answerList: [{}, {}, {}, {}, {}], //报考问答
userIcon: '../../images/icons/ic_user_default.png',
nickName: '点击授权',
},
onLoad() {
this.getUserInfo()
},
//获取个人信息
getUserInfo() {
let _self = this
try {
var name = wx.getStorageSync('nickName')
var icon = wx.getStorageSync('userIcon')
if (name) {
_self.setData({
nickName: name
})
}
if (icon) {
_self.setData({
userIcon: icon
})
} else {
wx.showModal({
title: '提示',
content: '小程序需要您微信头像以及昵称用于展示,请授权.',
showCancel: false,
success(res) {
if (res.confirm) {
_self.getUserProfile(3)
}
}
})
}
} catch (e) {
}
},
//显示更多数据
showMoreList() {
if (this.data.index == 1) {
wx.navigateTo({
url: '../notices/noticeslist',
})
} else {
wx.navigateTo({
url: '../answer/answerlist',
})
}
},
tabSelect(e) {
this.setData({
index: e.currentTarget.dataset.id
})
},
choosePage(e) {
var pagePath = ''
switch (e.currentTarget.dataset.page) {
case '1': //培训机构查询
pagePath = '../institutions/institutionslist'
break
case '2': //成绩查询
pagePath = '../results/resultslist'
break
case '3': //准考证查询
pagePath = '../card/cardlist'
break
case '4': //考试网点查询
pagePath = '../branches/brancheslist'
break
}
wx.navigateTo({
url: pagePath,
})
}, // 获取个人信息
getUserProfile(e) {
let _self = this
wx.getUserProfile({
desc: '获取微信头像以及昵称用于展示',
success: (res) => {
wx.setStorage({
data: res.userInfo.nickName,
key: 'nickName',
})
wx.setStorage({
data: res.userInfo.avatarUrl,
key: 'userIcon',
})
_self.setData({
nickName: res.userInfo.nickName,
userIcon: res.userInfo.avatarUrl
})
},
fail(err) {
console.log(err)
wx.showToast({
title: '获取个人信息失败',
icon: 'error'
})
}
})
},
showNoticeDetail(e) {
var item = e.currentTarget.dataset.item
wx.navigateTo({
url: '../notices/noticedetail',
})
},
showAnswerDetail(e) {
var item = e.currentTarget.dataset.item
}
})

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

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

96
pages/index/index.wxml Normal file
View File

@ -0,0 +1,96 @@
<!--index.wxml-->
<cu-custom bgColor="bg-darkblue" isBack="{{false}}" isRelaunch="{{false}}">
<view slot="content" style="color:#FFFFFF;">包头应急管理局</view>
</cu-custom>
<view style="display:flex;flex-direction:column;">
<!-- 姓名和头像 -->
<view style="width:100%;" bindtap="getUserProfile">
<image src="/images/icons/ic_user_center_bg.png" mode="scaleToFill" style="width:100%;height:300rpx;"></image>
<view class="userinfo-container">
<view class="userinfo-icon round lg" style="background-image:url({{userIcon}});">
</view>
<view class="userinfo-content">
<view class="text-white">
<text class="text-lg text-cut">{{nickName}}</text>
</view>
<view class="text-white text-df flex" style="width:300rpx">
<text class="text-cut">查看个人详细信息</text>
<text class="cuIcon-right text-white margin-left-smm"></text>
</view>
</view>
</view>
</view>
<!-- 内容 -->
<view class="page-content">
<!-- 功能按钮 -->
<view class="page-function">
<view class="funcation-item" bindtap="choosePage" data-page="1">
<image src="../../images/icons/ic_organ_icon.png" mode="scaleToFill"></image>
<text class="text-df margin-top-xs">培训机构查询</text>
</view>
<view class="funcation-item" bindtap="choosePage" data-page="2">
<image src="../../images/icons/ic_score_icon.png" mode="scaleToFill"></image>
<text class="text-df margin-top-xs">成绩查询</text>
</view>
<view class="funcation-item" bindtap="choosePage" data-page="3">
<image src="../../images/icons/ic_ticket_icon.png" mode="scaleToFill"></image>
<text class="text-df margin-top-xs">准考证查询</text>
</view>
<view class="funcation-item" bindtap="choosePage" data-page="4">
<image src="../../images/icons/ic_testsite_icon.png" mode="scaleToFill"></image>
<text class="text-df margin-top-xs">考试网点查询</text>
</view>
</view>
<view class="page-list-content">
<!-- 内容 -->
<view class="page-list">
<view class="nav">
<view class="cu-item text-bold {{index=='1' ? 'text-darkblue cur text-lg' : 'text-df'}}" bindtap="tabSelect"
data-id="{{1}}">
开班通告
</view>
<view class="cu-item text-bold {{index=='2' ? 'text-darkblue cur text-lg' : 'text-df'}}" bindtap="tabSelect"
data-id="{{2}}">
报考问答
</view>
</view>
<view class="showmore" bindtap="showMoreList">
<text class="text-sm text-darkblue">更多</text>
<text class="cuIcon-roundright text-darkblue margin-left-smm"></text>
</view>
</view>
<!-- 开班通告 -->
<view wx:if="{{index==1}}">
<view class="list" wx:if="{{noticeList.length>0}}">
<view class="item" wx:for="{{noticeList}}" wx:key="index" bindtap="showNoticeDetail" data-item="{{item}}">
<view class="cu-avatar radius xl"
style="background-image:url(https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.czcaizhi.com%2FContent%2FUploadFiles%2Fimage%2F20180920%2F20180920133956_3429.jpg&refer=http%3A%2F%2Fwww.czcaizhi.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1622110389&t=4ae9d4f943c30ac6d43801515eec97e5);">
</view>
<view class="content">
<text class="text-cut-two text-black text-bold">2021年4-6月特种设备作业人员培训开班通知</text>
<text class="text-cut">新东方在线</text>
</view>
</view>
</view>
<van-empty description="暂无数据" wx:else />
</view>
<!-- 报考问答 -->
<view wx:elif="{{index==2}}">
<view class="list" wx:if="{{answerList.length>0}}">
<view class="item" wx:for="{{answerList}}" wx:key="index" bindtap="showAnswerDetail" data-item="{{iteml}}">
<view class="cu-avatar radius xl"
style="background-image:url(https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.mp.itc.cn%2Fupload%2F20170329%2Fe43529bd3d4b458398baa070ba4fec28_th.jpeg&refer=http%3A%2F%2Fimg.mp.itc.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1622110898&t=032e76a88837738c204fa527c1df6643);">
</view>
<view class="content">
<text class="text-cut text-black text-bold">怎么注册?</text>
<text class="text-cut">新东方在线</text>
</view>
</view>
</view>
<van-empty description="暂无数据" wx:else />
</view>
</view>
</view>
</view>

115
pages/index/index.wxss Normal file
View File

@ -0,0 +1,115 @@
/**index.wxss**/
.userinfo-container {
position: absolute;
top: 130rpx;
z-index: 10;
display: flex;
min-height: 100rpx;
justify-content: space-between;
align-items: center;
padding: 30rpx 0rpx 30rpx 30rpx;
}
.page-content {
position: absolute;
top: 320rpx;
display: flex;
min-height: 100rpx;
align-items: center;
width: 100%;
flex-direction: column;
align-content: center;
align-self: center;
}
.page-function {
width: 95%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
padding: 20rpx;
background-color: white;
border: 10;
border-radius: 10rpx;
flex-wrap: nowrap;
}
.userinfo-icon {
font-variant: small-caps;
margin: 0;
padding: 0;
display: inline-flex;
text-align: center;
justify-content: center;
align-items: center;
background-color: #ccc;
color: var(--white);
white-space: nowrap;
position: relative;
width: 128rpx;
height: 128rpx;
background-size: cover;
background-position: center;
vertical-align: middle;
font-size: 1.5em;
border: 3rpx solid #177ee6;
}
.funcation-item {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.funcation-item image {
width: 110rpx;
height: 110rpx;
}
.userinfo-content {
position: absolute;
left: 146rpx;
width: calc(100% - 96rpx - 60rpx - 120rpx - 20rpx);
line-height: 1.6em;
margin-left: 10px;
}
.page-list {
display: flex;
width: 100%;
background-color: white;
margin-top: 20rpx;
justify-content: space-between;
}
.showmore {
display: flex;
align-items: center;
margin-right: 24rpx;
}
.page-list-content {
display: flex;
width: 95%;
flex-direction: column;
background-color: white;
margin-top: 20rpx;
padding: 10rpx;
min-height: 800rpx;
}
.page-list-tab {
color: black;
font-size: medium;
border-bottom-width: 5rpx;
border-bottom-style: solid;
border-bottom-color: blue;
}
.page-list-tab-sel {
color: blue;
font-size: medium;
}

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

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

View File

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

View File

@ -0,0 +1,4 @@
<!--pages/index/mineinfo.wxml-->
<cu-custom bgColor="bg-darkblue" isBack="{{true}}" isRelaunch="{{false}}">
<view slot="content" style="color:#FFFFFF;">个人信息</view>
</cu-custom>

View File

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

View File

@ -0,0 +1,32 @@
// pages/institutions/institutionsdetail.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
noticeContent: `<div class="div_class">
<p class="p">各有关单位:<br/>
为满足企业对特种设备作业人员专业素质的需求支持企业对特种设备作业人员进行专业知识操作技能和安全教育工作推进行业专业技术水平的提升广州市特种设备行业协会对国家市场监管总局已取消的特种设备作业项目组织行业相关特种设备作业人员进行继续教育培训考核欢迎各相关单位学员自愿参加对考核合格的特种设备作业人员由广州市特种设备行业协会发放广州市特种设备行业协会培训证书本协会定于2020年1-3月举办下列培训班现将有关事项通知如下<br/>
报名日期即日起至开班前两个工作日办理报名交费手续<br/>
报名交费地点广州市东风东路754号之八城迹酒店8咨询电话 020-34277197转分机号801~808或13342813020\\13500003204<br/>
报名须知<br/>
()年满18周岁且不超过60周岁<br/>
()申请人员身体健康能够适应所申请考核作业项目的需要<br/>
()具有初中及以上文化程度<br/>
()具备必要的安全技术知识与技能<br/>
()安全教育须提前1个月提交资料报名且年龄不超65周岁<br/>
广州市特种设备行业协会培训证书考证安全教育需提交资料<br/>
</p>
</div>`
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
})

View File

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

View File

@ -0,0 +1,17 @@
<!--pages/institutions/institutionsdetail.wxml-->
<cu-custom bgColor="bg-darkblue" isBack="{{true}}" isRelaunch="{{false}}">
<view slot="content" style="color:#FFFFFF;">培训机构详情</view>
</cu-custom>
<scroll-view style="width:100%;">
<view class="content-view">
<view class="content-detail">
<view class="notice-title text-xl text-bold">
<text>东方红培训机构</text>
</view>
<view class="line-gray" style="width:100%;height:20rpx;"></view>
<view class="text-lg text-black">
<rich-text nodes="{{noticeContent}}" space="nbsp"></rich-text>
</view>
</view>
</view>
</scroll-view>

View File

@ -0,0 +1 @@
/* pages/institutions/institutionsdetail.wxss */

View File

@ -0,0 +1,81 @@
// pages/institutions/institutionslist.js
const app = getApp()
var utils = require('../../utils/util.js')
Page({
/**
* 页面的初始数据
*/
data: {
CustomBar: app.globalData.CustomBar,
institutionsList: [{}, {}],
countTime: 2000, //延迟搜索 时间
searchWaiting: false, //是否等待搜索倒计时中,
searchKey: '',
mapLocs: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {},
doNavigation(e) {
var item = e.currentTarget.dataset.item
var locs = utils.bdMapToQQMap(116.34304, 39.948131)
var lng = locs[0]
var lat = locs[1]
wx.openLocation({
latitude: Number(lat),
longitude: Number(lng),
})
},
showDetail(e) {
var item = e.currentTarget.dataset.item
wx.navigateTo({
url: './institutionsdetail',
})
},
doSearch(e) {
this.setData({
countTime: 2000,
searchKey: e.detail.value,
})
//是否处于搜索倒计时中
if (!this.data.searchWaiting) {
this.timer();
}
},
getInstitutionsList(key) {
console.log('搜索中' + key)
},
/**
* 延迟搜索
*/
timer() {
var _self = this;
this.setData({
searchWaiting: true
})
let promise = new Promise((resolve, reject) => {
let setTimer = setInterval(
() => {
console.log('搜索倒计时: ' + _self.data.countTime);
_self.setData({
countTime: _self.data.countTime - 1000
})
if (_self.data.countTime <= 0) {
console.log('开始搜索: ' + _self.data.searchKey);
_self.setData({
countTime: 2000,
searchWaiting: false,
})
resolve(setTimer)
}
}, 1000)
})
promise.then((setTimer) => {
_self.getInstitutionsList(_self.data.searchKey)
clearInterval(setTimer) //清除计时器
})
},
})

View File

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

View File

@ -0,0 +1,41 @@
<!--pages/branches/brancheslist.wxml-->
<cu-custom bgColor="bg-darkblue" isBack="{{true}}" isRelaunch="{{false}}">
<view slot="content" style="color:#FFFFFF;">培训机构</view>
</cu-custom>
<view class="cu-bar bg-white search fixed" style="top:{{CustomBar}}px">
<view class="search-form round" style="margin-top:5rpx;margin-bottom:5rpx">
<text class="cuIcon-search"></text>
<input type="text" placeholder="请输入关键字" confirm-type="search" bindinput="doSearch"></input>
</view>
</view>
<scroll-view style="margin-top:70rpx;padding-left:10rpx;padding-right:10rpx;">
<view class="list" wx:if="{{institutionsList.length>0}}">
<view class="item bg-white" wx:for="{{institutionsList}}" wx:key="index">
<view class="cu-avatar radius xl" bindtap="showDetail" data-item="{{item}}"
style="background-image:url(https://gimg2.baidu.com/image_search/src=http%3A%2F%2F5b0988e595225.cdn.sohucs.com%2Fimages%2F20180322%2F838c068557384d70a2fc27e2fce74af2.jpeg&refer=http%3A%2F%2F5b0988e595225.cdn.sohucs.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1622183422&t=99df214728b454e7b725de7d6a3d85b9);">
</view>
<view class="content">
<text class="text-cut-two text-black text-bold" bindtap="showDetail"
data-item="{{item}}">包头市东方红培训机构</text>
<view class="text-cut text-gray" bindtap="showDetail" data-item="{{item}}">
<text class="cuIcon-mobile text-darkblue"></text><text class="margin-left-smm">0472-8888888</text>
</view>
<view class="text-cut text-gray" bindtap="showDetail" data-item="{{item}}">
<text class="cuIcon-location text-darkblue"></text><text
class="margin-left-smm">包头市昆区团结路88号包头市昆区团结路88号包头市昆区团结路88号包头市昆区团结路88号</text>
</view>
<view class="bottom-action">
<view>
<text class="cuIcon-time text-darkblue"></text>
<text class="margin-left-smm">2021-12-12</text>
</view>
<view bindtap="doNavigation" data-item="{{item}}">
<text class="cuIcon-taxi text-darkblue"></text>
<text class="text-darkblue margin-left-smm">去这里</text>
</view>
</view>
</view>
</view>
</view>
<van-empty description="暂无数据" wx:else />
</scroll-view>

View File

@ -0,0 +1 @@
/* pages/institutions/institutionslist.wxss */

View File

@ -0,0 +1,33 @@
// pages/notices/noticedetail.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
noticeContent: `<div class="div_class">
<p class="p">各有关单位:<br/>
为满足企业对特种设备作业人员专业素质的需求支持企业对特种设备作业人员进行专业知识操作技能和安全教育工作推进行业专业技术水平的提升广州市特种设备行业协会对国家市场监管总局已取消的特种设备作业项目组织行业相关特种设备作业人员进行继续教育培训考核欢迎各相关单位学员自愿参加对考核合格的特种设备作业人员由广州市特种设备行业协会发放广州市特种设备行业协会培训证书本协会定于2020年1-3月举办下列培训班现将有关事项通知如下<br/>
报名日期即日起至开班前两个工作日办理报名交费手续<br/>
报名交费地点广州市东风东路754号之八城迹酒店8咨询电话 020-34277197转分机号801~808或13342813020\\13500003204<br/>
报名须知<br/>
()年满18周岁且不超过60周岁<br/>
()申请人员身体健康能够适应所申请考核作业项目的需要<br/>
()具有初中及以上文化程度<br/>
()具备必要的安全技术知识与技能<br/>
()安全教育须提前1个月提交资料报名且年龄不超65周岁<br/>
广州市特种设备行业协会培训证书考证安全教育需提交资料<br/>
</p>
</div>`
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
})

View File

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

View File

@ -0,0 +1,17 @@
<!--pages/notices/noticedetail.wxml-->
<cu-custom bgColor="bg-darkblue" isBack="{{true}}" isRelaunch="{{false}}">
<view slot="content" style="color:#FFFFFF;">通告详情</view>
</cu-custom>
<scroll-view style="width:100%;">
<view class="content-view">
<view class="content-detail">
<view class="notice-title text-xl text-bold">
<text>2020年1-3月广州市特种设备行业协会培训证书开班通知</text>
</view>
<view class="line-gray" style="width:100%;height:20rpx;"></view>
<view class="text-lg text-black">
<rich-text nodes="{{noticeContent}}" space="nbsp"></rich-text>
</view>
</view>
</view>
</scroll-view>

View File

@ -0,0 +1,2 @@
/* pages/notices/noticedetail.wxss */

View File

@ -0,0 +1,71 @@
// pages/notices/noticeslist.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
noticeList: [],
CustomBar: app.globalData.CustomBar,
countTime: 2000, //延迟搜索 时间
searchWaiting: false, //是否等待搜索倒计时中,
searchKey: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
showDetail(e) {
var item = e.currentTarget.dataset.item
wx.navigateTo({
url: './noticedetail',
})
},
doSearch(e) {
this.setData({
countTime: 2000,
searchKey: e.detail.value,
})
//是否处于搜索倒计时中
if (!this.data.searchWaiting) {
this.timer();
}
},
getResultsList(key) {
console.log('搜索中' + key)
},
/**
* 延迟搜索
*/
timer() {
var _self = this;
this.setData({
searchWaiting: true
})
let promise = new Promise((resolve, reject) => {
let setTimer = setInterval(
() => {
console.log('搜索倒计时: ' + _self.data.countTime);
_self.setData({
countTime: _self.data.countTime - 1000
})
if (_self.data.countTime <= 0) {
console.log('开始搜索: ' + _self.data.searchKey);
_self.setData({
countTime: 2000,
searchWaiting: false,
})
resolve(setTimer)
}
}, 1000)
})
promise.then((setTimer) => {
_self.getResultsList(_self.data.searchKey)
clearInterval(setTimer) //清除计时器
})
},
})

View File

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

View File

@ -0,0 +1,24 @@
<!--pages/branches/brancheslist.wxml-->
<cu-custom bgColor="bg-darkblue" isBack="{{true}}" isRelaunch="{{false}}">
<view slot="content" style="color:#FFFFFF;">开班通告</view>
</cu-custom>
<view class="cu-bar bg-white search fixed" style="top:{{CustomBar}}px">
<view class="search-form round" style="margin-top:5rpx;margin-bottom:5rpx">
<text class="cuIcon-search"></text>
<input type="text" placeholder="请输入关键字" confirm-type="search" bindinput="doSearch"></input>
</view>
</view>
<scroll-view style="margin-top:70rpx;padding-left:10rpx;padding-right:10rpx;">
<view class="list" wx:if="{{noticeList.length>0}}">
<view class="item" wx:for="{{noticeList}}" wx:key="index" bindtap="showDetail" data-item="{{item}}">
<view class="cu-avatar radius xl"
style="background-image:url(https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.czcaizhi.com%2FContent%2FUploadFiles%2Fimage%2F20180920%2F20180920133956_3429.jpg&refer=http%3A%2F%2Fwww.czcaizhi.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1622110389&t=4ae9d4f943c30ac6d43801515eec97e5);">
</view>
<view class="content">
<text class="text-cut text-black text-bold">2021年4-6月特种设备作业人员培训开班通知</text>
<text class="text-cut">新东方在线</text>
</view>
</view>
</view>
<van-empty description="暂无数据" wx:else />
</scroll-view>

View File

@ -0,0 +1 @@
/* pages/notices/noticeslist.wxss */

View File

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

View File

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

View File

@ -0,0 +1,25 @@
<!--pages/results/resultsdetail.wxml-->
<cu-custom bgColor="bg-darkblue" isBack="{{true}}" isRelaunch="{{false}}">
<view slot="content" style="color:#FFFFFF;">成绩单</view>
</cu-custom>
<scroll-view style="width:100%;">
<view class="content-view">
<view class="content-detail">
<image src="../../images/icons/ic_success.png" mode="scaleToFill" style="width:300rpx;height:260rpx;">
</image>
<view class="text-orange text-xxl text-bold margin-top-sm text-center">
亲爱的同学,您的2021年12月安全考试成绩如下:
</view>
<view class="table-list margin-top-sm">
<view class="table-title bg-gradual-orange">
<view class="table-title-item text-xl">考试科目</view>
<view class="table-title-item text-xl">成绩</view>
</view>
<view class="table-title-nor {{(index % 2) == 0 ? '':'bg-tr' }}" wx:for="{{scoreList}}" wx:key="index">
<view class="table-title-item text-lg">安全生产法律法规</view>
<view class="table-title-item text-lg">100</view>
</view>
</view>
</view>
</view>
</scroll-view>

View File

@ -0,0 +1 @@
/* pages/results/resultsdetail.wxss */

View File

@ -0,0 +1,71 @@
// pages/results/resultslist.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
resultsList: [{}, {}],
CustomBar: app.globalData.CustomBar,
countTime: 2000, //延迟搜索 时间
searchWaiting: false, //是否等待搜索倒计时中,
searchKey: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
showDetail(e) {
var item = e.currentTarget.dataset.item
wx.navigateTo({
url: './resultsdetail',
})
},
doSearch(e) {
this.setData({
countTime: 2000,
searchKey: e.detail.value,
})
//是否处于搜索倒计时中
if (!this.data.searchWaiting) {
this.timer();
}
},
getResultsList(key) {
console.log('搜索中' + key)
},
/**
* 延迟搜索
*/
timer() {
var _self = this;
this.setData({
searchWaiting: true
})
let promise = new Promise((resolve, reject) => {
let setTimer = setInterval(
() => {
console.log('搜索倒计时: ' + _self.data.countTime);
_self.setData({
countTime: _self.data.countTime - 1000
})
if (_self.data.countTime <= 0) {
console.log('开始搜索: ' + _self.data.searchKey);
_self.setData({
countTime: 2000,
searchWaiting: false,
})
resolve(setTimer)
}
}, 1000)
})
promise.then((setTimer) => {
_self.getResultsList(_self.data.searchKey)
clearInterval(setTimer) //清除计时器
})
},
})

View File

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

View File

@ -0,0 +1,27 @@
<!--pages/branches/brancheslist.wxml-->
<cu-custom bgColor="bg-darkblue" isBack="{{true}}" isRelaunch="{{false}}">
<view slot="content" style="color:#FFFFFF;">成绩查询</view>
</cu-custom>
<view class="cu-bar bg-white search fixed" style="top:{{CustomBar}}px">
<view class="search-form round" style="margin-top:5rpx;margin-bottom:5rpx">
<text class="cuIcon-search"></text>
<input type="text" placeholder="请输入关键字" confirm-type="search" bindinput="doSearch"></input>
</view>
</view>
<scroll-view style="margin-top:70rpx;padding-left:10rpx;padding-right:10rpx;">
<view class="list" wx:if="{{resultsList.length>0}}">
<view class="item" wx:for="{{resultsList}}" wx:key="index" bindtap="showDetail" data-item="{{item}}">
<view class="cu-avatar radius xl"
style="background-image:url(https://img0.baidu.com/it/u=3328192120,981881484&fm=26&fmt=auto&gp=0.jpg);">
</view>
<view class="content">
<text class="text-cut-two text-black text-bold">2021年4月考试成绩</text>
<view class="text-cut">
<text class="cuIcon-time text-darkblue"></text>
<text class="text-darkblue margin-left-smm">考试日期:2021-12-12</text>
</view>
</view>
</view>
</view>
<van-empty description="暂无数据" wx:else />
</scroll-view>

View File

@ -0,0 +1 @@
/* pages/results/resultslist.wxss */

75
project.config.json Normal file
View File

@ -0,0 +1,75 @@
{
"description": "项目配置文件",
"packOptions": {
"ignore": []
},
"setting": {
"urlCheck": true,
"es6": true,
"enhance": false,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
"newFeature": false,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": false,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"enableEngineNative": false,
"bundle": false,
"useIsolateContext": true,
"useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true
},
"compileType": "miniprogram",
"libVersion": "2.16.1",
"appid": "wx501e9ce64f25c418",
"projectname": "teachingsystem",
"debugOptions": {
"hidedInDevtools": []
},
"scripts": {},
"staticServerOptions": {
"baseURL": "",
"servePath": ""
},
"isGameTourist": false,
"condition": {
"search": {
"list": []
},
"conversation": {
"list": []
},
"game": {
"list": []
},
"plugin": {
"list": []
},
"gamePlugin": {
"list": []
},
"miniprogram": {
"list": []
}
}
}

7
sitemap.json Normal file
View File

@ -0,0 +1,7 @@
{
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
"rules": [{
"action": "allow",
"page": "*"
}]
}

58
utils/util.js Normal file
View File

@ -0,0 +1,58 @@
const formatTime = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()
return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}`
}
const formatNumber = n => {
n = n.toString()
return n[1] ? n : `0${n}`
}
/**
* 坐标转换百度地图坐标转换成腾讯地图坐标
* lng 腾讯经度pointy
* lat 腾讯纬度pointx
* 经度>纬度
*/
function bdMapToQQMap(lng, lat) {
if (lng == null || lng == '' || lat == null || lat == '') {
return [lng, lat]
}
var x_pi = 3.14159265358979324;
var x = parseFloat(lng) - 0.0065;
var y = parseFloat(lat) - 0.006;
var z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi);
var theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi);
var lng = (z * Math.cos(theta)).toFixed(7);
var lat = (z * Math.sin(theta)).toFixed(7);
return [lng, lat];
}
/**
* 坐标转换腾讯地图转换成百度地图坐标
* lng 腾讯经度pointy
* lat 腾讯纬度pointx
* 经度>纬度
*/
function qqMapToBMap(lng, lat) {
if (lng == null || lng == '' || lat == null || lat == '')
return [lng, lat];
var x_pi = 3.14159265358979324;
var x = parseFloat(lng);
var y = parseFloat(lat);
var z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi);
var theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi);
var lng = (z * Math.cos(theta) + 0.0065).toFixed(5);
var lat = (z * Math.sin(theta) + 0.006).toFixed(5);
return [lng, lat];
}
module.exports = {
formatTime,
bdMapToQQMap,
qqMapToBMap
}

1
vant/dist/action-sheet/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

62
vant/dist/action-sheet/index.js vendored Normal file
View File

@ -0,0 +1,62 @@
import { VantComponent } from '../common/component';
import { button } from '../mixins/button';
import { openType } from '../mixins/open-type';
VantComponent({
mixins: [button, openType],
props: {
show: Boolean,
title: String,
cancelText: String,
description: String,
round: {
type: Boolean,
value: true,
},
zIndex: {
type: Number,
value: 100,
},
actions: {
type: Array,
value: [],
},
overlay: {
type: Boolean,
value: true,
},
closeOnClickOverlay: {
type: Boolean,
value: true,
},
closeOnClickAction: {
type: Boolean,
value: true,
},
safeAreaInsetBottom: {
type: Boolean,
value: true,
},
},
methods: {
onSelect(event) {
const { index } = event.currentTarget.dataset;
const item = this.data.actions[index];
if (item && !item.disabled && !item.loading) {
this.$emit('select', item);
if (this.data.closeOnClickAction) {
this.onClose();
}
}
},
onCancel() {
this.$emit('cancel');
},
onClose() {
this.$emit('close');
},
onClickOverlay() {
this.$emit('click-overlay');
this.onClose();
},
},
});

8
vant/dist/action-sheet/index.json vendored Normal file
View File

@ -0,0 +1,8 @@
{
"component": true,
"usingComponents": {
"van-icon": "../icon/index",
"van-popup": "../popup/index",
"van-loading": "../loading/index"
}
}

69
vant/dist/action-sheet/index.wxml vendored Normal file
View File

@ -0,0 +1,69 @@
<wxs src="../wxs/utils.wxs" module="utils" />
<van-popup
show="{{ show }}"
position="bottom"
round="{{ round }}"
z-index="{{ zIndex }}"
overlay="{{ overlay }}"
custom-class="van-action-sheet"
safe-area-inset-bottom="{{ safeAreaInsetBottom }}"
close-on-click-overlay="{{ closeOnClickOverlay }}"
bind:close="onClickOverlay"
>
<view wx:if="{{ title }}" class="van-action-sheet__header">
{{ title }}
<van-icon
name="cross"
custom-class="van-action-sheet__close"
bind:click="onClose"
/>
</view>
<view wx:if="{{ description }}" class="van-action-sheet__description van-hairline--bottom">
{{ description }}
</view>
<view wx:if="{{ actions && actions.length }}">
<!-- button外包一层view防止actions动态变化导致渲染时button被打散 -->
<button
wx:for="{{ actions }}"
wx:key="index"
open-type="{{ item.openType }}"
style="{{ item.color ? 'color: ' + item.color : '' }}"
class="{{ utils.bem('action-sheet__item', { disabled: item.disabled || item.loading }) }} {{ item.className || '' }}"
hover-class="van-action-sheet__item--hover"
data-index="{{ index }}"
bind:tap="onSelect"
bindgetuserinfo="bindGetUserInfo"
bindcontact="bindContact"
bindgetphonenumber="bindGetPhoneNumber"
binderror="bindError"
bindlaunchapp="bindLaunchApp"
bindopensetting="bindOpenSetting"
lang="{{ lang }}"
session-from="{{ sessionFrom }}"
send-message-title="{{ sendMessageTitle }}"
send-message-path="{{ sendMessagePath }}"
send-message-img="{{ sendMessageImg }}"
show-message-card="{{ showMessageCard }}"
app-parameter="{{ appParameter }}"
>
<block wx:if="{{ !item.loading }}">
{{ item.name }}
<view wx:if="{{ item.subname }}" class="van-action-sheet__subname" >{{ item.subname }}</view>
</block>
<van-loading wx:else custom-class="van-action-sheet__loading" size="22px" />
</button>
</view>
<slot />
<block wx:if="{{ cancelText }}">
<view class="van-action-sheet__gap" />
<view
class="van-action-sheet__cancel"
hover-class="van-action-sheet__cancel--hover"
hover-stay-time="70"
bind:tap="onCancel"
>
{{ cancelText }}
</view>
</block>
</van-popup>

111
vant/dist/action-sheet/index.wxss vendored Normal file
View File

@ -0,0 +1,111 @@
@import '../common/index.wxss';
.van-action-sheet {
max-height: 60% !important;
max-height: var(--action-sheet-max-height, 60%) !important;
color: #323233;
color: var(--action-sheet-item-text-color, #323233)
}
.van-action-sheet__cancel,
.van-action-sheet__item {
padding: 14px 16px;
text-align: center;
font-size: 16px;
font-size: var(--action-sheet-item-font-size, 16px);
line-height: 22px;
line-height: var(--action-sheet-item-line-height, 22px);
background-color: #fff;
background-color: var(--action-sheet-item-background, #fff)
}
.van-action-sheet__cancel--hover,
.van-action-sheet__item--hover {
background-color: #f2f3f5;
background-color: var(--active-color, #f2f3f5)
}
.van-action-sheet__cancel:after,
.van-action-sheet__item:after {
border-width: 0
}
.van-action-sheet__cancel {
color: #646566;
color: var(--action-sheet-cancel-text-color, #646566)
}
.van-action-sheet__gap {
display: block;
height: 8px;
height: var(--action-sheet-cancel-padding-top, 8px);
background-color: #f7f8fa;
background-color: var(--action-sheet-cancel-padding-color, #f7f8fa)
}
.van-action-sheet__item--disabled {
color: #c8c9cc;
color: var(--action-sheet-item-disabled-text-color, #c8c9cc)
}
.van-action-sheet__item--disabled.van-action-sheet__item--hover {
background-color: #fff;
background-color: var(--action-sheet-item-background, #fff)
}
.van-action-sheet__subname {
margin-top: 8px;
margin-top: var(--padding-xs, 8px);
font-size: 12px;
font-size: var(--action-sheet-subname-font-size, 12px);
color: #969799;
color: var(--action-sheet-subname-color, #969799);
line-height: 20px;
line-height: var(--action-sheet-subname-line-height, 20px)
}
.van-action-sheet__header {
text-align: center;
font-weight: 500;
font-weight: var(--font-weight-bold, 500);
font-size: 16px;
font-size: var(--action-sheet-header-font-size, 16px);
line-height: 48px;
line-height: var(--action-sheet-header-height, 48px);
position: fixed;
width: 100%;
background: #fff;
z-index: 100;
border-top-right-radius: 100rpx;
border-top-left-radius: 100rpx;
}
.van-action-sheet__description {
text-align: center;
padding: 20px 16px;
padding: 20px var(--padding-md, 16px);
color: #969799;
color: var(--action-sheet-description-color, #969799);
font-size: 14px;
font-size: var(--action-sheet-description-font-size, 14px);
line-height: 20px;
line-height: var(--action-sheet-description-line-height, 20px)
}
.van-action-sheet__close {
position: absolute !important;
top: 0;
right: 0;
line-height: inherit !important;
padding: 0 16px;
padding: var(--action-sheet-close-icon-padding, 0 16px);
font-size: 22px !important;
font-size: var(--action-sheet-close-icon-size, 22px) !important;
color: #c8c9cc;
color: var(--action-sheet-close-icon-color, #c8c9cc)
}
.van-action-sheet__loading {
display: -webkit-flex !important;
display: flex !important
}

1
vant/dist/area/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

232
vant/dist/area/index.js vendored Normal file
View File

@ -0,0 +1,232 @@
import { VantComponent } from '../common/component';
import { pickerProps } from '../picker/shared';
import { requestAnimationFrame } from '../common/utils';
const EMPTY_CODE = '000000';
VantComponent({
classes: ['active-class', 'toolbar-class', 'column-class'],
props: Object.assign(Object.assign({}, pickerProps), {
value: {
type: String,
observer(value) {
this.code = value;
this.setValues();
},
},
areaList: {
type: Object,
value: {},
observer: 'setValues',
},
columnsNum: {
type: null,
value: 3,
},
columnsPlaceholder: {
type: Array,
observer(val) {
this.setData({
typeToColumnsPlaceholder: {
province: val[0] || '',
city: val[1] || '',
county: val[2] || '',
},
});
},
},
}),
data: {
columns: [{ values: [] }, { values: [] }, { values: [] }],
typeToColumnsPlaceholder: {},
},
mounted() {
requestAnimationFrame(() => {
this.setValues();
});
},
methods: {
getPicker() {
if (this.picker == null) {
this.picker = this.selectComponent('.van-area__picker');
}
return this.picker;
},
onCancel(event) {
this.emit('cancel', event.detail);
},
onConfirm(event) {
const { index } = event.detail;
let { value } = event.detail;
value = this.parseValues(value);
this.emit('confirm', { value, index });
},
emit(type, detail) {
detail.values = detail.value;
delete detail.value;
this.$emit(type, detail);
},
parseValues(values) {
const { columnsPlaceholder } = this.data;
return values.map((value, index) => {
if (
value &&
(!value.code || value.name === columnsPlaceholder[index])
) {
return Object.assign(Object.assign({}, value), {
code: '',
name: '',
});
}
return value;
});
},
onChange(event) {
const { index, picker, value } = event.detail;
this.code = value[index].code;
this.setValues().then(() => {
this.$emit('change', {
picker,
values: this.parseValues(picker.getValues()),
index,
});
});
},
getConfig(type) {
const { areaList } = this.data;
return (areaList && areaList[`${type}_list`]) || {};
},
getList(type, code) {
if (type !== 'province' && !code) {
return [];
}
const { typeToColumnsPlaceholder } = this.data;
const list = this.getConfig(type);
let result = Object.keys(list).map((code) => ({
code,
name: list[code],
}));
if (code != null) {
// oversea code
if (code[0] === '9' && type === 'city') {
code = '9';
}
result = result.filter((item) => item.code.indexOf(code) === 0);
}
if (typeToColumnsPlaceholder[type] && result.length) {
// set columns placeholder
const codeFill =
type === 'province'
? ''
: type === 'city'
? EMPTY_CODE.slice(2, 4)
: EMPTY_CODE.slice(4, 6);
result.unshift({
code: `${code}${codeFill}`,
name: typeToColumnsPlaceholder[type],
});
}
return result;
},
getIndex(type, code) {
let compareNum = type === 'province' ? 2 : type === 'city' ? 4 : 6;
const list = this.getList(type, code.slice(0, compareNum - 2));
// oversea code
if (code[0] === '9' && type === 'province') {
compareNum = 1;
}
code = code.slice(0, compareNum);
for (let i = 0; i < list.length; i++) {
if (list[i].code.slice(0, compareNum) === code) {
return i;
}
}
return 0;
},
setValues() {
const picker = this.getPicker();
if (!picker) {
return;
}
let code = this.code || this.getDefaultCode();
const provinceList = this.getList('province');
const cityList = this.getList('city', code.slice(0, 2));
const stack = [];
const indexes = [];
const { columnsNum } = this.data;
if (columnsNum >= 1) {
stack.push(picker.setColumnValues(0, provinceList, false));
indexes.push(this.getIndex('province', code));
}
if (columnsNum >= 2) {
stack.push(picker.setColumnValues(1, cityList, false));
indexes.push(this.getIndex('city', code));
if (cityList.length && code.slice(2, 4) === '00') {
[{ code }] = cityList;
}
}
if (columnsNum === 3) {
stack.push(
picker.setColumnValues(
2,
this.getList('county', code.slice(0, 4)),
false
)
);
indexes.push(this.getIndex('county', code));
}
return Promise.all(stack)
.catch(() => {})
.then(() => picker.setIndexes(indexes))
.catch(() => {});
},
getDefaultCode() {
const { columnsPlaceholder } = this.data;
if (columnsPlaceholder.length) {
return EMPTY_CODE;
}
const countyCodes = Object.keys(this.getConfig('county'));
if (countyCodes[0]) {
return countyCodes[0];
}
const cityCodes = Object.keys(this.getConfig('city'));
if (cityCodes[0]) {
return cityCodes[0];
}
return '';
},
getValues() {
const picker = this.getPicker();
if (!picker) {
return [];
}
return this.parseValues(picker.getValues().filter((value) => !!value));
},
getDetail() {
const values = this.getValues();
const area = {
code: '',
country: '',
province: '',
city: '',
county: '',
};
if (!values.length) {
return area;
}
const names = values.map((item) => item.name);
area.code = values[values.length - 1].code;
if (area.code[0] === '9') {
area.country = names[1] || '';
area.province = names[2] || '';
} else {
area.province = names[0] || '';
area.city = names[1] || '';
area.county = names[2] || '';
}
return area;
},
reset(code) {
this.code = code || '';
return this.setValues();
},
},
});

6
vant/dist/area/index.json vendored Normal file
View File

@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"van-picker": "../picker/index"
}
}

20
vant/dist/area/index.wxml vendored Normal file
View File

@ -0,0 +1,20 @@
<wxs src="./index.wxs" module="computed" />
<van-picker
class="van-area__picker"
active-class="active-class"
toolbar-class="toolbar-class"
column-class="column-class"
show-toolbar
value-key="name"
title="{{ title }}"
loading="{{ loading }}"
columns="{{ computed.displayColumns(columns, columnsNum) }}"
item-height="{{ itemHeight }}"
visible-item-count="{{ visibleItemCount }}"
cancel-button-text="{{ cancelButtonText }}"
confirm-button-text="{{ confirmButtonText }}"
bind:change="onChange"
bind:confirm="onConfirm"
bind:cancel="onCancel"
/>

8
vant/dist/area/index.wxs vendored Normal file
View File

@ -0,0 +1,8 @@
/* eslint-disable */
function displayColumns(columns, columnsNum) {
return columns.slice(0, +columnsNum);
}
module.exports = {
displayColumns: displayColumns,
};

1
vant/dist/area/index.wxss vendored Normal file
View File

@ -0,0 +1 @@
@import '../common/index.wxss';

1
vant/dist/button/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

58
vant/dist/button/index.js vendored Normal file
View File

@ -0,0 +1,58 @@
import { VantComponent } from '../common/component';
import { button } from '../mixins/button';
import { openType } from '../mixins/open-type';
import { canIUseFormFieldButton } from '../common/version';
const mixins = [button, openType];
if (canIUseFormFieldButton()) {
mixins.push('wx://form-field-button');
}
VantComponent({
mixins,
classes: ['hover-class', 'loading-class'],
data: {
baseStyle: '',
},
props: {
formType: String,
icon: String,
classPrefix: {
type: String,
value: 'van-icon',
},
plain: Boolean,
block: Boolean,
round: Boolean,
square: Boolean,
loading: Boolean,
hairline: Boolean,
disabled: Boolean,
loadingText: String,
customStyle: String,
loadingType: {
type: String,
value: 'circular',
},
type: {
type: String,
value: 'default',
},
dataset: null,
size: {
type: String,
value: 'normal',
},
loadingSize: {
type: String,
value: '20px',
},
color: String,
},
methods: {
onClick() {
if (!this.data.loading) {
this.$emit('click');
}
},
noop() {},
},
});

7
vant/dist/button/index.json vendored Normal file
View File

@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"van-icon": "../icon/index",
"van-loading": "../loading/index"
}
}

53
vant/dist/button/index.wxml vendored Normal file
View File

@ -0,0 +1,53 @@
<wxs src="../wxs/utils.wxs" module="utils" />
<wxs src="./index.wxs" module="computed" />
<button
id="{{ id }}"
data-detail="{{ dataset }}"
class="custom-class {{ utils.bem('button', [type, size, { block, round, plain, square, loading, disabled, hairline, unclickable: disabled || loading }]) }} {{ hairline ? 'van-hairline--surround' : '' }}"
hover-class="van-button--active hover-class"
lang="{{ lang }}"
form-type="{{ formType }}"
style="{{ computed.rootStyle({ plain, color, customStyle }) }}"
open-type="{{ disabled ? '' : openType }}"
business-id="{{ businessId }}"
session-from="{{ sessionFrom }}"
send-message-title="{{ sendMessageTitle }}"
send-message-path="{{ sendMessagePath }}"
send-message-img="{{ sendMessageImg }}"
show-message-card="{{ showMessageCard }}"
app-parameter="{{ appParameter }}"
aria-label="{{ ariaLabel }}"
bindtap="{{ !disabled ? 'onClick' : 'noop' }}"
bindgetuserinfo="bindGetUserInfo"
bindcontact="bindContact"
bindgetphonenumber="bindGetPhoneNumber"
binderror="bindError"
bindlaunchapp="bindLaunchApp"
bindopensetting="bindOpenSetting"
>
<block wx:if="{{ loading }}">
<van-loading
custom-class="loading-class"
size="{{ loadingSize }}"
type="{{ loadingType }}"
color="{{ computed.loadingColor({ type, color, plain }) }}"
/>
<view wx:if="{{ loadingText }}" class="van-button__loading-text">
{{ loadingText }}
</view>
</block>
<block wx:else>
<van-icon
wx:if="{{ icon }}"
size="1.2em"
name="{{ icon }}"
class-prefix="{{ classPrefix }}"
class="van-button__icon"
custom-style="line-height: inherit;"
/>
<view class="van-button__text">
<slot />
</view>
</block>
</button>

39
vant/dist/button/index.wxs vendored Normal file
View File

@ -0,0 +1,39 @@
/* eslint-disable */
var style = require('../wxs/style.wxs');
function rootStyle(data) {
if (!data.color) {
return data.customStyle;
}
var properties = {
color: data.plain ? data.color : '#fff',
background: data.plain ? null : data.color,
};
// hide border when color is linear-gradient
if (data.color.indexOf('gradient') !== -1) {
properties.border = 0;
} else {
properties['border-color'] = data.color;
}
return style([properties, data.customStyle]);
}
function loadingColor(data) {
if (data.plain) {
return data.color ? data.color : '#c9c9c9';
}
if (data.type === 'default') {
return '#c9c9c9';
}
return '#fff';
}
module.exports = {
rootStyle: rootStyle,
loadingColor: loadingColor,
};

1
vant/dist/button/index.wxss vendored Normal file
View File

@ -0,0 +1 @@
@import '../common/index.wxss';.van-button{position:relative;display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;padding:0;text-align:center;vertical-align:middle;-webkit-appearance:none;-webkit-text-size-adjust:100%;height:44px;height:var(--button-default-height,44px);line-height:20px;line-height:var(--button-line-height,20px);font-size:16px;font-size:var(--button-default-font-size,16px);transition:opacity .2s;transition:opacity var(--animation-duration-fast,.2s);border-radius:2px;border-radius:var(--button-border-radius,2px)}.van-button:before{position:absolute;top:50%;left:50%;width:100%;height:100%;border:inherit;border-radius:inherit;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);opacity:0;content:" ";background-color:#000;background-color:var(--black,#000);border-color:#000;border-color:var(--black,#000)}.van-button:after{border-width:0}.van-button--active:before{opacity:.15}.van-button--unclickable:after{display:none}.van-button--default{color:#323233;color:var(--button-default-color,#323233);background:#fff;background:var(--button-default-background-color,#fff);border:1px solid #ebedf0;border:var(--button-border-width,1px) solid var(--button-default-border-color,#ebedf0)}.van-button--primary{color:#fff;color:var(--button-primary-color,#fff);background:#07c160;background:var(--button-primary-background-color,#07c160);border:1px solid #07c160;border:var(--button-border-width,1px) solid var(--button-primary-border-color,#07c160)}.van-button--info{color:#fff;color:var(--button-info-color,#fff);background:#1989fa;background:var(--button-info-background-color,#1989fa);border:1px solid #1989fa;border:var(--button-border-width,1px) solid var(--button-info-border-color,#1989fa)}.van-button--danger{color:#fff;color:var(--button-danger-color,#fff);background:#ee0a24;background:var(--button-danger-background-color,#ee0a24);border:1px solid #ee0a24;border:var(--button-border-width,1px) solid var(--button-danger-border-color,#ee0a24)}.van-button--warning{color:#fff;color:var(--button-warning-color,#fff);background:#ff976a;background:var(--button-warning-background-color,#ff976a);border:1px solid #ff976a;border:var(--button-border-width,1px) solid var(--button-warning-border-color,#ff976a)}.van-button--plain{background:#fff;background:var(--button-plain-background-color,#fff)}.van-button--plain.van-button--primary{color:#07c160;color:var(--button-primary-background-color,#07c160)}.van-button--plain.van-button--info{color:#1989fa;color:var(--button-info-background-color,#1989fa)}.van-button--plain.van-button--danger{color:#ee0a24;color:var(--button-danger-background-color,#ee0a24)}.van-button--plain.van-button--warning{color:#ff976a;color:var(--button-warning-background-color,#ff976a)}.van-button--large{width:100%;height:50px;height:var(--button-large-height,50px)}.van-button--normal{padding:0 15px;font-size:14px;font-size:var(--button-normal-font-size,14px)}.van-button--small{min-width:60px;min-width:var(--button-small-min-width,60px);height:30px;height:var(--button-small-height,30px);padding:0 8px;padding:0 var(--padding-xs,8px);font-size:12px;font-size:var(--button-small-font-size,12px)}.van-button--mini{display:inline-block;min-width:50px;min-width:var(--button-mini-min-width,50px);height:22px;height:var(--button-mini-height,22px);font-size:10px;font-size:var(--button-mini-font-size,10px)}.van-button--mini+.van-button--mini{margin-left:5px}.van-button--block{display:-webkit-flex;display:flex;width:100%}.van-button--round{border-radius:999px;border-radius:var(--button-round-border-radius,999px)}.van-button--square{border-radius:0}.van-button--disabled{opacity:.5;opacity:var(--button-disabled-opacity,.5)}.van-button__text{display:inline}.van-button__icon+.van-button__text:not(:empty),.van-button__loading-text{margin-left:4px}.van-button__icon{min-width:1em;line-height:inherit!important;vertical-align:top}.van-button--hairline{padding-top:1px;border-width:0}.van-button--hairline:after{border-color:inherit;border-width:1px;border-radius:4px;border-radius:calc(var(--button-border-radius, 2px)*2)}.van-button--hairline.van-button--round:after{border-radius:999px;border-radius:var(--button-round-border-radius,999px)}.van-button--hairline.van-button--square:after{border-radius:0}

65
vant/dist/calendar/calendar.wxml vendored Normal file
View File

@ -0,0 +1,65 @@
<view class="van-calendar">
<header
title="{{ title }}"
showTitle="{{ showTitle }}"
subtitle="{{ subtitle }}"
showSubtitle="{{ showSubtitle }}"
>
<slot name="title" slot="title"></slot>
</header>
<scroll-view
class="van-calendar__body"
scroll-y
scroll-into-view="{{ scrollIntoView }}"
>
<month
wx:for="{{ computed.getMonths(minDate, maxDate) }}"
wx:key="index"
id="month{{ index }}"
class="month"
data-date="{{ item }}"
date="{{ item }}"
type="{{ type }}"
color="{{ color }}"
minDate="{{ minDate }}"
maxDate="{{ maxDate }}"
showMark="{{ showMark }}"
formatter="{{ formatter }}"
rowHeight="{{ rowHeight }}"
currentDate="{{ currentDate }}"
showSubtitle="{{ showSubtitle }}"
allowSameDay="{{ allowSameDay }}"
showMonthTitle="{{ index !== 0 || !showSubtitle }}"
bind:click="onClickDay"
/>
</scroll-view>
<view
class="{{ utils.bem('calendar__footer', { safeAreaInsetBottom }) }}"
>
<slot name="footer"></slot>
</view>
<view
class="{{ utils.bem('calendar__footer', { safeAreaInsetBottom }) }}"
>
<van-button
wx:if="{{ showConfirm }}"
round
block
type="danger"
color="{{ color }}"
custom-class="van-calendar__confirm"
disabled="{{ computed.getButtonDisabled(type, currentDate) }}"
nativeType="text"
bind:click="onConfirm"
>
{{
computed.getButtonDisabled(type, currentDate)
? confirmDisabledText
: confirmText
}}
</van-button>
</view>
</view>

View File

@ -0,0 +1 @@
export {};

View File

@ -0,0 +1,16 @@
import { VantComponent } from '../../../common/component';
VantComponent({
props: {
title: {
type: String,
value: '日期选择',
},
subtitle: String,
showTitle: Boolean,
showSubtitle: Boolean,
},
data: {
weekdays: ['日', '一', '二', '三', '四', '五', '六'],
},
methods: {},
});

View File

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

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