
#Region " 返回农历 "
'返回农历
'cCalendar.MaxSupportedDateTime 返回支持的最大日期,即2101-1-28
'cCalendar.MinSupportedDateTime 返回支持的最小日期,即190-2-19
Private cCalendar As New System.Globalization.ChineseLunisolarCalendar
Public Function PubFunGet_CNDate(ByVal sDateTime As Date) As String
cCalendar = New System.Globalization.ChineseLunisolarCalendar
Dim lyear As Integer = cCalendar.GetYear(sDateTime)
Dim lmonth As Integer = cCalendar.GetMonth(sDateTime)
Dim lday As Integer = cCalendar.GetDayOfMonth(sDateTime)
Dim lweek As Integer = cCalendar.GetDayOfWeek(sDateTime)
'获取闰月, 0 则表示没有闰月
Dim leapMonth As Integer = cCalendar.GetLeapMonth(lyear)
Dim isleap As Boolean = False
If (leapMonth >0) Then
If (leapMonth = lmonth) Then
'闰月
isleap = True
lmonth = lmonth - 1
ElseIf (lmonth >leapMonth) Then
lmonth = lmonth - 1
End If
End If
Return String.Concat(GetLunisolarYear(lyear), IIf(isleap = True, "闰年", "年"), GetLunisolarMonth(lmonth), "月", GetLunisolarDay(lday))
End Function
'十天干
Private tiangan As String() = {"甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"}
'十二地支
Private dizhi As String() = {"子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"}
'十二生肖
Private shengxiao As String() = {"鼠", "牛", "虎", "免", "龙", "蛇", "马", "羊", "猴", "鸡", "狗", "猪"}
'农历月
Private months As String() = {"正", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二(腊)"}
'农历日
Private days1 As String() = {"初", "十", "廿", "三"}
Private days As String() = {"一", "二", "三", "四", "五", "六", "七", "八", "九", "十"}
'返回农历年(天干 地支 生肖)
Private Function GetLunisolarYear(ByVal year As Integer) As String
GetLunisolarYear = ""
If (year >3) Then
Dim tgIndex As Integer = (year - 4) Mod 10
Dim dzIndex As Integer = (year - 4) Mod 12
Return tiangan(tgIndex) &dizhi(dzIndex) &"[" &shengxiao(dzIndex) &"]"
End If
'无效的年份!
End Function
'返回生肖
Private Function GetShengXiao(ByVal sDateTime As Date) As String
Return shengxiao(cCalendar.GetTerrestrialBranch(cCalendar.GetSexagenaryYear(sDateTime)) - 1)
End Function
'返回农历月
Private Function GetLunisolarMonth(ByVal month As Integer) As String
GetLunisolarMonth = ""
If (month <13 AndAlso month >0) Then
Return months(month - 1)
End If
'无效的月份!
End Function
'返回农历日
Private Function GetLunisolarDay(ByVal day As Integer) As String
GetLunisolarDay = ""
If (day >0 AndAlso day <32) Then
If (day <>20 AndAlso day <>30) Then
Return String.Concat(days1((day - 1) \ 10), days((day - 1) Mod 10))
Else
Return String.Concat(days((day - 1) \ 10), days1(1))
End If
End If
'无效的日!
End Function
#End Region
话不多说,记录一下这个框架的使用~小程序使用轻量、可靠的小程序 UI 组件库 vant-weappGithub源码: https://github.com/youzan/vant-weapp
中文文档: https://youzan.github.io/vant-weapp/#/intro
1:打开微信开发者工具,填写自己的appid和项目名称,选择不使用云服务,新建一个项目。
2:右击在选择在终端打开
进入项目的根目录底下,注意,一定要进入根目录哦,使用cd ../返回上一级目录~
3:小程序已经支持使用 npm 安装第三方包,
这里通过 npm 安装
这里需要注意一下
npm i vant-weapp -S --production或者npm i @vant/weapp -S --production
引入的区别
使用npm i vant-weapp安装的时候,到时候在在app.json或index.json中引入组件,需要使用这样的路径
使用npm i @vant/weapp安装的时候,到时候在在app.json或index.json中引入组件,需要使用这样的路径(推荐,因为这个可以直接抄文档,不需要改变引入路径的~)
4:在微信开发工具执行npm 构建,点击工具里面,构建npm
构建过程需要等待一会儿,不要捉急
构建完会生成一个miniprogram_npm文件夹
如果构建完如果编译报错,再构建一次就好了
日历文档参照一下
5:使用vant-weapp日历组件
我这里对日期的处理,是需要这样的格式YYYY-MM-dd
所以在对选中的日期做了一些处理和判断~
wxml
js
json
您好,方法1、微信小程序是一个免除下载安装直接使用的应用,使用微信【扫一扫】或者是【搜一搜】就可以打开应用。
2、微信小程序如今存在线下扫码、公众号关注、消息通知等多种功能。
3、在微信小程序中,可以向有所了解的技术员寻求帮助。他们会为客户查找微信小程序源码,这样我们就可以看到微信小程序源码了。
4、现如今各大企业项目公司都会培养一些专业的工作人员。他们会运用现有的技术查看源码。
5、查找小程序源码很简单,并且该源码会跟销售产品量成正比关系。
6、如下图,给我们的信息可以告诉我们查看微信小程序源码很有必要且又很有重要性。
7、对于查看微信小程序源码以及它的价值,如下图给与了详细解释。跟客户需求量很有关系。
8、如今网络市场发展十分迅速,微信小程序就是其中一个热门市场点,查看源码就是微信小程序最重要的地方。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)