mushencc 2 rokov pred
commit
dcb2af9c94
100 zmenil súbory, kde vykonal 3357 pridanie a 0 odobranie
  1. 31 0
      .eslintrc.js
  2. 14 0
      .gitignore
  3. 107 0
      StepPage/pages/eighth/eighth.js
  4. 3 0
      StepPage/pages/eighth/eighth.json
  5. 22 0
      StepPage/pages/eighth/eighth.wxml
  6. 26 0
      StepPage/pages/eighth/eighth.wxss
  7. 125 0
      StepPage/pages/fifth/fifth.js
  8. 3 0
      StepPage/pages/fifth/fifth.json
  9. 19 0
      StepPage/pages/fifth/fifth.wxml
  10. 58 0
      StepPage/pages/fifth/fifth.wxss
  11. 81 0
      StepPage/pages/first/first.js
  12. 3 0
      StepPage/pages/first/first.json
  13. 8 0
      StepPage/pages/first/first.wxml
  14. 30 0
      StepPage/pages/first/first.wxss
  15. 132 0
      StepPage/pages/fourth/fourth.js
  16. 3 0
      StepPage/pages/fourth/fourth.json
  17. 19 0
      StepPage/pages/fourth/fourth.wxml
  18. 63 0
      StepPage/pages/fourth/fourth.wxss
  19. 18 0
      StepPage/pages/logs/logs.js
  20. 4 0
      StepPage/pages/logs/logs.json
  21. 6 0
      StepPage/pages/logs/logs.wxml
  22. 8 0
      StepPage/pages/logs/logs.wxss
  23. 125 0
      StepPage/pages/second/second.js
  24. 3 0
      StepPage/pages/second/second.json
  25. 20 0
      StepPage/pages/second/second.wxml
  26. 58 0
      StepPage/pages/second/second.wxss
  27. 75 0
      StepPage/pages/seventh/seventh.js
  28. 3 0
      StepPage/pages/seventh/seventh.json
  29. 26 0
      StepPage/pages/seventh/seventh.wxml
  30. 22 0
      StepPage/pages/seventh/seventh.wxss
  31. 108 0
      StepPage/pages/sixth/sixth.js
  32. 3 0
      StepPage/pages/sixth/sixth.json
  33. 22 0
      StepPage/pages/sixth/sixth.wxml
  34. 26 0
      StepPage/pages/sixth/sixth.wxss
  35. 107 0
      StepPage/pages/third/third.js
  36. 3 0
      StepPage/pages/third/third.json
  37. 22 0
      StepPage/pages/third/third.wxml
  38. 26 0
      StepPage/pages/third/third.wxss
  39. 25 0
      app.js
  40. 38 0
      app.json
  41. 9 0
      app.wxss
  42. 24 0
      behaviors/my-behaviors.js
  43. 81 0
      components/test/test.js
  44. 4 0
      components/test/test.json
  45. 14 0
      components/test/test.wxml
  46. 1 0
      components/test/test.wxss
  47. BIN
      images/head.png
  48. BIN
      images/head2.png
  49. BIN
      images/home-active.png
  50. BIN
      images/home.png
  51. BIN
      images/message-active.png
  52. BIN
      images/message.png
  53. BIN
      images/mine-active.png
  54. BIN
      images/mine.png
  55. BIN
      images/take.png
  56. 64 0
      miniprogram_npm/@vant/weapp/action-sheet/index.js
  57. 8 0
      miniprogram_npm/@vant/weapp/action-sheet/index.json
  58. 67 0
      miniprogram_npm/@vant/weapp/action-sheet/index.wxml
  59. 0 0
      miniprogram_npm/@vant/weapp/action-sheet/index.wxss
  60. 257 0
      miniprogram_npm/@vant/weapp/area/index.js
  61. 6 0
      miniprogram_npm/@vant/weapp/area/index.json
  62. 18 0
      miniprogram_npm/@vant/weapp/area/index.wxml
  63. 1 0
      miniprogram_npm/@vant/weapp/area/index.wxss
  64. 81 0
      miniprogram_npm/@vant/weapp/button/index.js
  65. 7 0
      miniprogram_npm/@vant/weapp/button/index.json
  66. 68 0
      miniprogram_npm/@vant/weapp/button/index.wxml
  67. 0 0
      miniprogram_npm/@vant/weapp/button/index.wxss
  68. 57 0
      miniprogram_npm/@vant/weapp/calendar/calendar.wxml
  69. 18 0
      miniprogram_npm/@vant/weapp/calendar/components/header/index.js
  70. 3 0
      miniprogram_npm/@vant/weapp/calendar/components/header/index.json
  71. 16 0
      miniprogram_npm/@vant/weapp/calendar/components/header/index.wxml
  72. 1 0
      miniprogram_npm/@vant/weapp/calendar/components/header/index.wxss
  73. 167 0
      miniprogram_npm/@vant/weapp/calendar/components/month/index.js
  74. 3 0
      miniprogram_npm/@vant/weapp/calendar/components/month/index.json
  75. 39 0
      miniprogram_npm/@vant/weapp/calendar/components/month/index.wxml
  76. 67 0
      miniprogram_npm/@vant/weapp/calendar/components/month/index.wxs
  77. 0 0
      miniprogram_npm/@vant/weapp/calendar/components/month/index.wxss
  78. 318 0
      miniprogram_npm/@vant/weapp/calendar/index.js
  79. 9 0
      miniprogram_npm/@vant/weapp/calendar/index.json
  80. 31 0
      miniprogram_npm/@vant/weapp/calendar/index.wxml
  81. 37 0
      miniprogram_npm/@vant/weapp/calendar/index.wxs
  82. 1 0
      miniprogram_npm/@vant/weapp/calendar/index.wxss
  83. 91 0
      miniprogram_npm/@vant/weapp/calendar/utils.js
  84. 25 0
      miniprogram_npm/@vant/weapp/calendar/utils.wxs
  85. 51 0
      miniprogram_npm/@vant/weapp/card/index.js
  86. 6 0
      miniprogram_npm/@vant/weapp/card/index.json
  87. 50 0
      miniprogram_npm/@vant/weapp/card/index.wxml
  88. 0 0
      miniprogram_npm/@vant/weapp/card/index.wxss
  89. 12 0
      miniprogram_npm/@vant/weapp/cell-group/index.js
  90. 3 0
      miniprogram_npm/@vant/weapp/cell-group/index.json
  91. 9 0
      miniprogram_npm/@vant/weapp/cell-group/index.wxml
  92. 1 0
      miniprogram_npm/@vant/weapp/cell-group/index.wxss
  93. 39 0
      miniprogram_npm/@vant/weapp/cell/index.js
  94. 6 0
      miniprogram_npm/@vant/weapp/cell/index.json
  95. 45 0
      miniprogram_npm/@vant/weapp/cell/index.wxml
  96. 0 0
      miniprogram_npm/@vant/weapp/cell/index.wxss
  97. 42 0
      miniprogram_npm/@vant/weapp/checkbox-group/index.js
  98. 3 0
      miniprogram_npm/@vant/weapp/checkbox-group/index.json
  99. 1 0
      miniprogram_npm/@vant/weapp/checkbox-group/index.wxml
  100. 1 0
      miniprogram_npm/@vant/weapp/checkbox-group/index.wxss

+ 31 - 0
.eslintrc.js

@@ -0,0 +1,31 @@
+/*
+ * Eslint config file
+ * Documentation: https://eslint.org/docs/user-guide/configuring/
+ * Install the Eslint extension before using this feature.
+ */
+module.exports = {
+  env: {
+    es6: true,
+    browser: true,
+    node: true,
+  },
+  ecmaFeatures: {
+    modules: true,
+  },
+  parserOptions: {
+    ecmaVersion: 2018,
+    sourceType: 'module',
+  },
+  globals: {
+    wx: true,
+    App: true,
+    Page: true,
+    getCurrentPages: true,
+    getApp: true,
+    Component: true,
+    requirePlugin: true,
+    requireMiniProgram: true,
+  },
+  // extends: 'eslint:recommended',
+  rules: {},
+}

+ 14 - 0
.gitignore

@@ -0,0 +1,14 @@
+# Windows
+[Dd]esktop.ini
+Thumbs.db
+$RECYCLE.BIN/
+
+# macOS
+.DS_Store
+.fseventsd
+.Spotlight-V100
+.TemporaryItems
+.Trashes
+
+# Node.js
+node_modules/

+ 107 - 0
StepPage/pages/eighth/eighth.js

@@ -0,0 +1,107 @@
+// StepPage/pages/third/third.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    phoneIndex:null,
+    showCamera:false,
+   imgList:[
+     {
+       src:''
+     },{
+       src:''
+     },{
+       src:''
+     }
+   ],
+  },
+  handleOpenCamera(row){
+      this.setData({
+        showCamera:true,
+        phoneIndex:row.currentTarget.dataset.index,
+      })
+  },
+  takePhoto() {
+    const ctx = wx.createCameraContext()
+    ctx.takePhoto({
+      quality: 'high',
+      success: (res) => {
+        this.data.imgList[this.data.phoneIndex].src = res.tempImagePath;
+        this.setData({
+          imgList:this.data.imgList,
+          showCamera:false
+        })
+      }
+    })
+  },
+  error(e) {
+    console.log(e.detail)
+  },
+  handleNext(){
+    wx.navigateTo({
+      url: '../first/first',
+    })
+},
+handleReturn(){
+  wx.navigateBack({
+    delta:1
+    })
+},
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 3 - 0
StepPage/pages/eighth/eighth.json

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

+ 22 - 0
StepPage/pages/eighth/eighth.wxml

@@ -0,0 +1,22 @@
+<view wx:if="{{showCamera?true:false}}" style="width: 100%; height: 100%;" class="cation">
+  <camera device-position="front" flash="auto" binderror="error" style="width: 80%; height: 40%;margin:90pt auto"></camera>
+  <view class="take_content">
+    <view class="take" bindtap="takePhoto">
+  <image src="../../../images/take.png" mode="widthFix" style="width: 40pt;"/>
+</view>
+  </view>
+
+</view>
+<view wx:else>
+  <cover-image src="../../../images/head.png"></cover-image>
+<view class="title">8.车辆施工标准拍照</view>
+<view class="img">
+<view wx:for="{{imgList}}" wx:key="index" class="image_item" bindtap="handleOpenCamera" data-index='{{index}}'>
+  <image style="width: 100%;height: 100%;" src="{{item.src}}"></image>
+</view>
+</view>
+</view>
+<view class="btn">
+  <van-button color="linear-gradient(to top, #626365, #ffffff)" class="btn_item" bindtap="handleReturn"><text class="font_item">上一步</text></van-button>
+<van-button color="linear-gradient(to top, #626365, #ffffff)" class="btn_item" bindtap="handleNext"> <text class="font_item">下一步</text></van-button>
+</view>

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 26 - 0
StepPage/pages/eighth/eighth.wxss


+ 125 - 0
StepPage/pages/fifth/fifth.js

@@ -0,0 +1,125 @@
+// StepPage/pages/second/second.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    allowNext:false,
+    itemList:[],
+   productList:[
+     {title:'漆面膜',is_choose:false,product:[
+       {title:'常规单',is_choose:false},{title:'售后单',is_choose:false},{title:'前装单',is_choose:false},{title:'赠送单',is_choose:false},{title:'待施工单',is_choose:false},{title:'第一单',is_choose:false}
+     ]},
+     {title:'改色膜',is_choose:false,product:[ {title:'常规单',is_choose:false},{title:'售后单',is_choose:false},{title:'前装单',is_choose:false},{title:'赠送单',is_choose:false},{title:'待施工单',is_choose:false},{title:'第二单',is_choose:false}]},
+     {title:'天窗冰甲',is_choose:false,product:[ {title:'常规单',is_choose:false},{title:'售后单',is_choose:false},{title:'前装单',is_choose:false},{title:'赠送单',is_choose:false},{title:'待施工单',is_choose:false},{title:'第三单',is_choose:false}]}
+   ],
+  },
+  handleChooseItem(item){
+   let data = this.data.itemList;
+   data.forEach((v,idx)=>{
+    if(idx===(item.target.dataset.index)*1){
+     v.is_choose = !v.is_choose;
+    }else{
+      v.is_choose = false;
+    }
+})
+if(data.every(v=>(!v.is_choose))){
+  this.setData({
+   allowNext:false
+    })
+}else{
+  this.setData({
+    allowNext:true
+    })
+}
+this.setData({
+  itemList:data
+  })
+  },
+  handleChoose(item){
+    let data = this.data.productList;
+    data.forEach((v,idx)=>{
+      v.product.forEach(el=>{
+        el.is_choose = false;
+      })
+        if(idx===(item.target.dataset.index)*1){
+         v.is_choose = !v.is_choose;
+        }else{
+          v.is_choose = false;
+        }
+    })
+     this.setData({
+       allowNext:false,
+          productList:data,
+          itemList:data[(item.target.dataset.index)*1].is_choose?data[(item.target.dataset.index)*1].product:[],
+          })
+  },
+  handleNext(){
+      wx.navigateTo({
+        url: '../sixth/sixth',
+      })
+  },
+  handleReturn(){
+    wx.navigateBack({
+      delta:1
+      })
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(option) {
+
+    
+    
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 3 - 0
StepPage/pages/fifth/fifth.json

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

+ 19 - 0
StepPage/pages/fifth/fifth.wxml

@@ -0,0 +1,19 @@
+
+<cover-image src="../../../images/head.png"></cover-image>
+<view class="title">4.选择产品套餐</view>
+<view class="item_content">
+<view style="width:48%">
+  <view wx:for="{{productList}}" wx:key="index" class="item_content_shop {{item.is_choose?'choose':'unchoose'}}" bindtap="handleChoose" data-item='{{item}}' data-index='{{index}}'>
+  {{item.title}}
+ </view>
+</view>
+<view style="width: 48%">
+  <view wx:for="{{itemList}}" wx:key="index" class="item_content_shop_child {{item.is_choose?'choose':'unchoose'}}" bindtap="handleChooseItem" data-item='{{item}}' data-index='{{index}}'>
+  {{item.title}}
+ </view>
+</view>
+</view>
+<view class="btn">
+  <van-button color="linear-gradient(to top, #626365, #ffffff)" class="btn_item" bindtap="handleReturn"><text class="font_item">上一步</text></van-button>
+<van-button disabled='{{allowNext?false:true}}' color="linear-gradient(to top, #626365, #ffffff)" class="btn_item" bindtap="handleNext"> <text class="font_item">下一步</text></van-button>
+</view>

+ 58 - 0
StepPage/pages/fifth/fifth.wxss

@@ -0,0 +1,58 @@
+/* StepPage/pages/second/second.wxss *//* StepPage/pages/first/first.wxss */
+.title{
+  border-radius: 8pt;
+height: 30pt;
+line-height: 30pt;
+letter-spacing: 3pt;
+  text-align: center;
+  width: 90%;
+  margin: 10pt auto;
+  background:-webkit-linear-gradient(top,rgb(255, 255, 255),rgb(231, 229, 229),rgb(192, 189, 189)); 
+}
+.item_content{
+ 
+  width: 90%;
+  margin:0 auto; 
+  display: flex;
+ justify-content: space-between;
+}
+.item_content_shop{
+  letter-spacing: 2pt;
+  background:-webkit-linear-gradient(top,rgb(255, 255, 255),rgb(231, 229, 229),rgb(192, 189, 189)); 
+   width: 100%;
+   text-align: center;
+   height: 30pt;
+   line-height: 30pt;
+   border-radius: 10pt;
+   margin: 5pt 0;
+}
+.item_content_shop:nth-child(2n+1){
+  margin-right: 20pt;
+}
+.item_content_shop_child{
+  letter-spacing: 2pt;
+  background:-webkit-linear-gradient(top,rgb(255, 255, 255),rgb(231, 229, 229),rgb(192, 189, 189)); 
+   width: 100%;
+   text-align: center;
+   height: 30pt;
+   line-height: 30pt;
+   border-radius: 10pt;
+   margin: 5pt 0;
+}
+.choose{
+  color: rgb(170, 165, 165);
+}
+.unchoose{
+  color: black;
+}
+.btn{
+  text-align: center;
+  margin-top: 20pt;
+}
+.btn_item{
+  width: 200pt;
+  margin: 10pt;
+}
+.font_item{
+  color: black;
+}

+ 81 - 0
StepPage/pages/first/first.js

@@ -0,0 +1,81 @@
+// StepPage/pages/first/first.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+shopList:[
+  {title:'运通嘉诚'},
+  {title:'运通嘉诚'},
+  {title:'运通嘉诚'},
+  {title:'运通嘉诚'},
+  {title:'运通嘉诚'},
+  {title:'运通嘉诚'},
+  {title:'运通嘉诚'},
+  {title:'运通嘉诚'},
+  {title:'运通嘉诚'},
+  {title:'运通嘉诚'},
+]
+  },
+handleChoose(item){
+  wx.navigateTo({
+    url: `../second/second?data=${item.target.dataset.item}`,
+  })
+}, 
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 3 - 0
StepPage/pages/first/first.json

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

+ 8 - 0
StepPage/pages/first/first.wxml

@@ -0,0 +1,8 @@
+<!--StepPage/pages/first/first.wxml-->
+<cover-image src="../../../images/head.png"></cover-image>
+<view class="title">选择门店</view>
+<view class="item_content">
+ <view wx:for="{{shopList}}" wx:key="index" class="item_content_shop" bindtap="handleChoose" data-item='{{item}}'>
+  {{item.title}}
+ </view>
+</view>

+ 30 - 0
StepPage/pages/first/first.wxss

@@ -0,0 +1,30 @@
+/* StepPage/pages/first/first.wxss */
+.title{
+  border-radius: 8pt;
+height: 30pt;
+line-height: 30pt;
+letter-spacing: 3pt;
+  text-align: center;
+  width: 90%;
+  margin: 10pt auto;
+  background:-webkit-linear-gradient(top,rgb(255, 255, 255),rgb(231, 229, 229),rgb(192, 189, 189)); 
+}
+.item_content{
+ 
+  width: 90%;
+  margin:0 auto; 
+  display: flex;
+  flex-wrap: wrap;
+}
+.item_content_shop{
+  background:-webkit-linear-gradient(top,rgb(255, 255, 255),rgb(231, 229, 229),rgb(192, 189, 189)); 
+   width: 46%;
+   text-align: center;
+   height: 30pt;
+   line-height: 30pt;
+   border-radius: 10pt;
+   margin: 5pt 0;
+}
+.item_content_shop:nth-child(2n+1){
+  margin-right: 20pt;
+}

+ 132 - 0
StepPage/pages/fourth/fourth.js

@@ -0,0 +1,132 @@
+
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    allowNext:false,
+    itemList:[],
+   productList:[
+     {title:'漆面膜',is_choose:false,product:[
+      {title:'待施工单',is_choose:false},{title:'第一单',is_choose:false}
+     ]},
+     {title:'漆面膜',is_choose:false,product:[
+      {title:'待施工单',is_choose:false},{title:'第一单',is_choose:false}
+     ]},
+     {title:'改色膜',is_choose:false,product:[ {title:'常规单',is_choose:false},{title:'售后单',is_choose:false},{title:'前装单',is_choose:false},{title:'赠送单',is_choose:false},{title:'待施工单',is_choose:false},{title:'第二单',is_choose:false}]},
+     {title:'天窗冰甲',is_choose:false,product:[ {title:'常规单',is_choose:false},{title:'售后单',is_choose:false},{title:'前装单',is_choose:false},{title:'赠送单',is_choose:false},{title:'待施工单',is_choose:false},{title:'第三单',is_choose:false}]}
+   ],
+  },
+  handleChooseItem(item){
+   let data = this.data.itemList;
+   data.forEach((v,idx)=>{
+    if(idx===(item.target.dataset.index)*1){
+     v.is_choose = !v.is_choose;
+    }else{
+      v.is_choose = false;
+    }
+})
+if(data.every(v=>(!v.is_choose))){
+  this.setData({
+   allowNext:false
+    })
+}else{
+  this.setData({
+    allowNext:true
+    })
+}
+this.setData({
+  itemList:data
+  })
+  },
+  handleChoose(item){
+    let data = this.data.productList;
+    data.forEach((v,idx)=>{
+      v.product.forEach(el=>{
+        el.is_choose = false;
+      })
+        if(idx===(item.target.dataset.index)*1){
+         v.is_choose = !v.is_choose;
+        }else{
+          v.is_choose = false;
+        }
+    })
+     this.setData({
+       allowNext:false,
+          productList:data,
+          itemList:data[(item.target.dataset.index)*1].is_choose?data[(item.target.dataset.index)*1].product:[],
+          })
+  },
+  handleNext(){
+      wx.navigateTo({
+        url: '../fifth/fifth',
+      })
+  },
+  handleReturn(){
+    wx.navigateBack({
+      delta:1
+      })
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(option) {
+
+      const eventChannel = this.getOpenerEventChannel()
+      // 监听 acceptDataFromOpenerPage 事件,获取上一页面通过 eventChannel 传送到当前页面的数据
+      eventChannel.on('acceptDataFromOpenerPage', function(data) {
+        console.log(data)
+      })
+    
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 3 - 0
StepPage/pages/fourth/fourth.json

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

+ 19 - 0
StepPage/pages/fourth/fourth.wxml

@@ -0,0 +1,19 @@
+<!--StepPage/pages/fourth/fourth.wxml-->
+<cover-image src="../../../images/head.png"></cover-image>
+<view class="title">3.选择汽车品牌</view>
+<view class="item_content">
+<view style="width:48%">
+  <view wx:for="{{productList}}" wx:key="index" class="item_content_shop {{item.is_choose?'choose':'unchoose'}}" bindtap="handleChoose" data-item='{{item}}' data-index='{{index}}'>
+  {{item.title}}
+ </view>
+</view>
+<view style="width: 48%" class="right">
+  <view wx:for="{{itemList}}" wx:key="index" class="item_content_shop_child {{item.is_choose?'choose':'unchoose'}}" bindtap="handleChooseItem" data-item='{{item}}' data-index='{{index}}'>
+  {{item.title}}
+ </view>
+</view>
+</view>
+<view class="btn">
+  <van-button color="linear-gradient(to top, #626365, #ffffff)" class="btn_item" bindtap="handleReturn"><text class="font_item">上一步</text></van-button>
+<van-button disabled='{{allowNext?false:true}}' color="linear-gradient(to top, #626365, #ffffff)" class="btn_item" bindtap="handleNext"> <text class="font_item">下一步</text></van-button>
+</view>

+ 63 - 0
StepPage/pages/fourth/fourth.wxss

@@ -0,0 +1,63 @@
+/* StepPage/pages/fourth/fourth.wxss */
+.title{
+  border-radius: 8pt;
+height: 30pt;
+line-height: 30pt;
+letter-spacing: 3pt;
+  text-align: center;
+  width: 90%;
+  margin: 10pt auto;
+  background:-webkit-linear-gradient(top,rgb(255, 255, 255),rgb(231, 229, 229),rgb(192, 189, 189)); 
+}
+.item_content{
+ 
+  width: 90%;
+  margin:0 auto; 
+  display: flex;
+ justify-content: space-between;
+}
+.item_content_shop{
+  letter-spacing: 2pt;
+  background:-webkit-linear-gradient(top,rgb(255, 255, 255),rgb(231, 229, 229),rgb(192, 189, 189)); 
+   width: 100%;
+   text-align: center;
+   height: 30pt;
+   line-height: 30pt;
+   border-radius: 10pt;
+   margin: 5pt 0;
+}
+.item_content_shop:nth-child(2n+1){
+  margin-right: 20pt;
+}
+.item_content_shop_child{
+  letter-spacing: 2pt;
+  background:-webkit-linear-gradient(top,rgb(255, 255, 255),rgb(231, 229, 229),rgb(192, 189, 189)); 
+   width: 100%;
+   text-align: center;
+   height: 30pt;
+   line-height: 30pt;
+   
+   margin: 5pt 0;
+}
+.choose{
+  color: rgb(170, 165, 165);
+}
+.unchoose{
+  color: black;
+}
+.btn{
+  text-align: center;
+  margin-top: 20pt;
+}
+.btn_item{
+  width: 200pt;
+  margin: 10pt;
+}
+.font_item{
+  color: black;
+}
+.right{
+  max-height: 300pt;
+  overflow: auto;
+ background-color: rgb(243, 243, 242);
+}

+ 18 - 0
StepPage/pages/logs/logs.js

@@ -0,0 +1,18 @@
+// logs.js
+const util = require('../../../utils/util.js')
+
+Page({
+  data: {
+    logs: []
+  },
+  onLoad() {
+    this.setData({
+      logs: (wx.getStorageSync('logs') || []).map(log => {
+        return {
+          date: util.formatTime(new Date(log)),
+          timeStamp: log
+        }
+      })
+    })
+  }
+})

+ 4 - 0
StepPage/pages/logs/logs.json

@@ -0,0 +1,4 @@
+{
+  "navigationBarTitleText": "查看启动日志",
+  "usingComponents": {}
+}

+ 6 - 0
StepPage/pages/logs/logs.wxml

@@ -0,0 +1,6 @@
+<!--logs.wxml-->
+<view class="container log-list">
+  <block wx:for="{{logs}}" wx:key="timeStamp" wx:for-item="log">
+    <text class="log-item">{{index + 1}}. {{log.date}}</text>
+  </block>
+</view>

+ 8 - 0
StepPage/pages/logs/logs.wxss

@@ -0,0 +1,8 @@
+.log-list {
+  display: flex;
+  flex-direction: column;
+  padding: 40rpx;
+}
+.log-item {
+  margin: 10rpx;
+}

+ 125 - 0
StepPage/pages/second/second.js

@@ -0,0 +1,125 @@
+// StepPage/pages/second/second.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    allowNext:false,
+    itemList:[],
+   productList:[
+     {title:'漆面膜',is_choose:false,product:[
+       {title:'常规单',is_choose:false},{title:'售后单',is_choose:false},{title:'前装单',is_choose:false},{title:'赠送单',is_choose:false},{title:'待施工单',is_choose:false},{title:'第一单',is_choose:false}
+     ]},
+     {title:'改色膜',is_choose:false,product:[ {title:'常规单',is_choose:false},{title:'售后单',is_choose:false},{title:'前装单',is_choose:false},{title:'赠送单',is_choose:false},{title:'待施工单',is_choose:false},{title:'第二单',is_choose:false}]},
+     {title:'天窗冰甲',is_choose:false,product:[ {title:'常规单',is_choose:false},{title:'售后单',is_choose:false},{title:'前装单',is_choose:false},{title:'赠送单',is_choose:false},{title:'待施工单',is_choose:false},{title:'第三单',is_choose:false}]}
+   ],
+  },
+  handleChooseItem(item){
+   let data = this.data.itemList;
+   data.forEach((v,idx)=>{
+    if(idx===(item.target.dataset.index)*1){
+     v.is_choose = !v.is_choose;
+    }else{
+      v.is_choose = false;
+    }
+})
+if(data.every(v=>(!v.is_choose))){
+  this.setData({
+   allowNext:false
+    })
+}else{
+  this.setData({
+    allowNext:true
+    })
+}
+this.setData({
+  itemList:data
+  })
+  },
+  handleChoose(item){
+    let data = this.data.productList;
+    data.forEach((v,idx)=>{
+      v.product.forEach(el=>{
+        el.is_choose = false;
+      })
+        if(idx===(item.target.dataset.index)*1){
+         v.is_choose = !v.is_choose;
+        }else{
+          v.is_choose = false;
+        }
+    })
+     this.setData({
+       allowNext:false,
+          productList:data,
+          itemList:data[(item.target.dataset.index)*1].is_choose?data[(item.target.dataset.index)*1].product:[],
+          })
+  },
+  handleNext(){
+      wx.navigateTo({
+        url: '../third/third',
+      })
+  },
+  handleReturn(){
+    wx.navigateBack({
+    delta:1
+    })
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+console.log(options);
+    
+    
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 3 - 0
StepPage/pages/second/second.json

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

+ 20 - 0
StepPage/pages/second/second.wxml

@@ -0,0 +1,20 @@
+<!--StepPage/pages/second/second.wxml-->
+<cover-image src="../../../images/head.png"></cover-image>
+<view class="title">1.选择产品类型</view>
+<view class="item_content">
+<view style="width:48%">
+  <view wx:for="{{productList}}" wx:key="index" class="item_content_shop {{item.is_choose?'choose':'unchoose'}}" bindtap="handleChoose" data-item='{{item}}' data-index='{{index}}'>
+  {{item.title}}
+ </view>
+</view>
+<view style="width: 48%">
+  <view wx:for="{{itemList}}" wx:key="index" class="item_content_shop_child {{item.is_choose?'choose':'unchoose'}}" bindtap="handleChooseItem" data-item='{{item}}' data-index='{{index}}'>
+  {{item.title}}
+ </view>
+</view>
+</view>
+<view class="btn">
+  <van-button color="linear-gradient(to top, #626365, #ffffff)" custom-class="btn_item" bindtap="handleReturn"><text class="font_item">上一步</text></van-button>
+<van-button disabled='{{allowNext?false:true}}' color="linear-gradient(to top, #626365, #ffffff)" 
+custom-class="btn_item" bindtap="handleNext"> <text class="font_item">下一步</text></van-button>
+</view>

+ 58 - 0
StepPage/pages/second/second.wxss

@@ -0,0 +1,58 @@
+/* StepPage/pages/second/second.wxss *//* StepPage/pages/first/first.wxss */
+.title{
+  border-radius: 8pt;
+height: 30pt;
+line-height: 30pt;
+letter-spacing: 3pt;
+  text-align: center;
+  width: 90%;
+  margin: 10pt auto;
+  background:-webkit-linear-gradient(top,rgb(255, 255, 255),rgb(231, 229, 229),rgb(192, 189, 189)); 
+}
+.item_content{
+ 
+  width: 90%;
+  margin:0 auto; 
+  display: flex;
+ justify-content: space-between;
+}
+.item_content_shop{
+  letter-spacing: 2pt;
+  background:-webkit-linear-gradient(top,rgb(255, 255, 255),rgb(231, 229, 229),rgb(192, 189, 189)); 
+   width: 100%;
+   text-align: center;
+   height: 30pt;
+   line-height: 30pt;
+   border-radius: 10pt;
+   margin: 5pt 0;
+}
+.item_content_shop:nth-child(2n+1){
+  margin-right: 20pt;
+}
+.item_content_shop_child{
+  letter-spacing: 2pt;
+  background:-webkit-linear-gradient(top,rgb(255, 255, 255),rgb(231, 229, 229),rgb(192, 189, 189)); 
+   width: 100%;
+   text-align: center;
+   height: 30pt;
+   line-height: 30pt;
+   border-radius: 10pt;
+   margin: 5pt 0;
+}
+.choose{
+  color: rgb(170, 165, 165);
+}
+.unchoose{
+  color: black;
+}
+.btn{
+  text-align: center;
+  margin-top: 20pt;
+}
+.btn_item{
+  margin: 20pt;
+  border-radius: 10pt !important;
+}
+.font_item{
+  color: black;
+}

+ 75 - 0
StepPage/pages/seventh/seventh.js

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

+ 3 - 0
StepPage/pages/seventh/seventh.json

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

+ 26 - 0
StepPage/pages/seventh/seventh.wxml

@@ -0,0 +1,26 @@
+<cover-image src="../../../images/head.png"></cover-image>
+<view class="title">6.车架号/卷膜号 扫码</view>
+<view class="top">
+  <view>
+    <text>卷膜号</text>
+  </view>
+  <view>
+    <text>车架号</text>
+  </view>
+</view>
+<view class="title">7.车辆内容填写</view>
+<view class="bottom">
+  <view>
+    <text>客户名称</text>
+  </view>
+  <view>
+    <text>客户手机</text>
+  </view>
+  <view>
+    <text>施工部位站全车比例</text>
+  </view>
+</view>
+<view class="btn">
+  <van-button color="linear-gradient(to top, #626365, #ffffff)" class="btn_item" bindtap="handleReturn"><text class="font_item">上一步</text></van-button>
+<van-button color="linear-gradient(to top, #626365, #ffffff)" class="btn_item" bindtap="handleNext"> <text class="font_item">下一步</text></van-button>
+</view>

+ 22 - 0
StepPage/pages/seventh/seventh.wxss

@@ -0,0 +1,22 @@
+/* StepPage/pages/seventh/seventh.wxss */
+.title{
+  border-radius: 8pt;
+height: 30pt;
+line-height: 30pt;
+letter-spacing: 3pt;
+  text-align: center;
+  width: 90%;
+  margin: 10pt auto;
+  background:-webkit-linear-gradient(top,rgb(255, 255, 255),rgb(231, 229, 229),rgb(192, 189, 189)); 
+}
+.btn{
+  text-align: center;
+  margin-top: 20pt;
+}
+.btn_item{
+  width: 200pt;
+  margin: 10pt;
+}
+.font_item{
+  color: black;
+}

+ 108 - 0
StepPage/pages/sixth/sixth.js

@@ -0,0 +1,108 @@
+// StepPage/pages/third/third.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    phoneIndex:null,
+    showCamera:false,
+   imgList:[
+     {
+       src:''
+     },{
+       src:''
+     },{
+       src:''
+     }
+   ],
+  },
+  handleOpenCamera(row){
+      this.setData({
+        showCamera:true,
+        phoneIndex:row.currentTarget.dataset.index,
+      })
+  },
+  takePhoto() {
+    const ctx = wx.createCameraContext()
+    ctx.takePhoto({
+      quality: 'high',
+      success: (res) => {
+        this.data.imgList[this.data.phoneIndex].src = res.tempImagePath;
+        this.setData({
+          imgList:this.data.imgList,
+          showCamera:false
+        })
+      }
+    })
+  },
+  error(e) {
+    console.log(e.detail)
+  },
+  handleNext(){
+    
+    wx.navigateTo({
+      url: '../seventh/seventh',
+    })
+},
+handleReturn(){
+  wx.navigateBack({
+    delta:1
+    })
+},
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 3 - 0
StepPage/pages/sixth/sixth.json

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

+ 22 - 0
StepPage/pages/sixth/sixth.wxml

@@ -0,0 +1,22 @@
+<view wx:if="{{showCamera?true:false}}" style="width: 100%; height: 100%;" class="cation">
+  <camera device-position="front" flash="auto" binderror="error" style="width: 80%; height: 40%;margin:90pt auto"></camera>
+  <view class="take_content">
+    <view class="take" bindtap="takePhoto">
+  <image src="../../../images/take.png" mode="widthFix" style="width: 40pt;"/>
+</view>
+  </view>
+
+</view>
+<view wx:else>
+  <cover-image src="../../../images/head.png"></cover-image>
+<view class="title">5.店方派工单、车架号、卷膜号照片</view>
+<view class="img">
+<view wx:for="{{imgList}}" wx:key="index" class="image_item" bindtap="handleOpenCamera" data-index='{{index}}'>
+  <image style="width: 100%;height: 100%;" src="{{item.src}}"></image>
+</view>
+</view>
+</view>
+<view class="btn">
+  <van-button color="linear-gradient(to top, #626365, #ffffff)" class="btn_item" bindtap="handleReturn"><text class="font_item">上一步</text></van-button>
+<van-button color="linear-gradient(to top, #626365, #ffffff)" class="btn_item" bindtap="handleNext"> <text class="font_item">下一步</text></van-button>
+</view>

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 26 - 0
StepPage/pages/sixth/sixth.wxss


+ 107 - 0
StepPage/pages/third/third.js

@@ -0,0 +1,107 @@
+// StepPage/pages/third/third.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    phoneIndex:null,
+    showCamera:false,
+   imgList:[
+     {
+       src:''
+     },{
+       src:''
+     },{
+       src:''
+     }
+   ],
+  },
+  handleOpenCamera(row){
+      this.setData({
+        showCamera:true,
+        phoneIndex:row.currentTarget.dataset.index,
+      })
+  },
+  takePhoto() {
+    const ctx = wx.createCameraContext()
+    ctx.takePhoto({
+      quality: 'high',
+      success: (res) => {
+        this.data.imgList[this.data.phoneIndex].src = res.tempImagePath;
+        this.setData({
+          imgList:this.data.imgList,
+          showCamera:false
+        })
+      }
+    })
+  },
+  error(e) {
+    console.log(e.detail)
+  },
+  handleNext(){
+    wx.navigateTo({
+      url: '../fourth/fourth',
+    })
+},
+handleReturn(){
+  wx.navigateBack({
+    delta:1
+    })
+},
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 3 - 0
StepPage/pages/third/third.json

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

+ 22 - 0
StepPage/pages/third/third.wxml

@@ -0,0 +1,22 @@
+<view wx:if="{{showCamera?true:false}}" style="width: 100%; height: 100%;" class="cation">
+  <camera device-position="front" flash="auto" binderror="error" style="width: 80%; height: 40%;margin:90pt auto"></camera>
+  <view class="take_content">
+    <view class="take" bindtap="takePhoto">
+  <image src="../../../images/take.png" mode="widthFix" style="width: 40pt;"/>
+</view>
+  </view>
+
+</view>
+<view wx:else>
+  <cover-image src="../../../images/head.png"></cover-image>
+<view class="title">2.车辆检查、车辆保护照片上传</view>
+<view class="img">
+<view wx:for="{{imgList}}" wx:key="index" class="image_item" bindtap="handleOpenCamera" data-index='{{index}}'>
+  <image style="width: 100%;height: 100%;" src="{{item.src}}"></image>
+</view>
+</view>
+</view>
+<view class="btn">
+  <van-button color="linear-gradient(to top, #626365, #ffffff)" class="btn_item" bindtap="handleReturn"><text class="font_item">上一步</text></van-button>
+<van-button color="linear-gradient(to top, #626365, #ffffff)" class="btn_item" bindtap="handleNext"> <text class="font_item">下一步</text></van-button>
+</view>

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 26 - 0
StepPage/pages/third/third.wxss


+ 25 - 0
app.js

@@ -0,0 +1,25 @@
+// app.js
+import {promisifyAll} from 'miniprogram-api-promise';
+const wxp = wx.p={}
+promisifyAll(wx,wxp);
+App({
+  onLaunch() {
+    // 展示本地存储能力
+    const logs = wx.getStorageSync('logs') || []
+    logs.unshift(Date.now())
+    wx.setStorageSync('logs', logs)
+
+    // 登录     
+    wx.login({
+      success: res => {
+        wx.navigateTo({
+          url: '/pages/login/login',
+        })
+        // 发送 res.code 到后台换取 openId, sessionKey, unionId
+      }
+    })
+  },
+  globalData: {
+    userInfo: null
+  }
+})

+ 38 - 0
app.json

@@ -0,0 +1,38 @@
+
+{
+  "pages":[
+     "pages/login/login"
+  ],
+  "subPackages": [
+    {
+      "root": "StepPage",
+      "name": "StepPage",
+      "pages": [
+        "pages/logs/logs",
+        "pages/first/first",
+        "pages/second/second",
+        "pages/third/third",
+        "pages/fourth/fourth",
+        "pages/fifth/fifth",
+        "pages/sixth/sixth",
+        "pages/seventh/seventh",
+        "pages/eighth/eighth"
+      ]
+    }
+  ],
+  "window":{
+    "backgroundTextStyle":"light",
+    "navigationBarBackgroundColor": "#1296db",
+    "navigationBarTitleText": "九方项目进度",
+    "navigationBarTextStyle":"black",
+    "navigationStyle": "custom"
+  },
+  "usingComponents": {
+    "van-button": "@vant/weapp/button/index",
+    "test":"/components/test/test",
+      "van-field": "@vant/weapp/field/index",
+      "van-notify": "@vant/weapp/notify/index"
+  }, 
+  "lazyCodeLoading": "requiredComponents",
+  "sitemapLocation": "sitemap.json"
+}

+ 9 - 0
app.wxss

@@ -0,0 +1,9 @@
+/**app.wxss**/
+page{
+  --button-danger-background-color:#c00000;
+  --button-danger-border-color:#D00000;
+}
+button{
+  background-color: rgb(72, 139, 255);
+  color: #ffffff;
+}

+ 24 - 0
behaviors/my-behaviors.js

@@ -0,0 +1,24 @@
+module.exports = Behavior({
+  data:{
+    username:'hw',
+    item:{a:1},
+  },
+  properties:{},
+  methods:{},
+  behaviors:[],//behaviors可以继续嵌套behavios
+  // created(){
+
+  // },
+  // attached(){
+
+  // },
+  // moved(){
+
+  // },
+  // detached(){
+
+  // },
+  // ready(){
+
+  // }
+})

+ 81 - 0
components/test/test.js

@@ -0,0 +1,81 @@
+// components/test/test.js
+const myBehaviors = require('../../behaviors/my-behaviors');
+import {storeBindingsBehavior} from 'mobx-miniprogram-bindings';
+import {store} from '../../store/store'
+Component({
+  behaviors:[myBehaviors,storeBindingsBehavior],
+  /**
+   * 组件的属性列表
+   */
+  options:{
+    //正则表达式定义纯数据字段
+    //前面有' _ '为纯数据字段
+     pureDataPattern:/^_/,
+     multipleSlots:true,
+  },
+  lifetimes:{
+    attached(){
+      console.log(this.data.item);
+    }
+  },
+  properties: {
+       max:Number,
+       min:{
+         type:Number,
+         value:0
+       }
+  },
+storeBindings:{
+store,
+fields:{
+  numA:()=>store.numA,
+  numB:(store)=>store.numB,
+  sum:'sum'
+},
+actions:{
+  updataNum2:'updataNum2'
+}
+},
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    item:{
+      b:2
+    },
+    _a:true,
+    num2:0,
+    num1:0,
+    sum:0,
+        count:0,
+  },
+observers:{
+     'num1,num2':function(num1,num2){
+            this.setData({sum:num1+num2});
+     }
+},
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    handleAdd(e){
+       this.updataNum2(e.target.dataset.step)
+    },
+    add1(){
+this.setData({
+  num1:this.data.num1+1
+})
+    },
+    add2(){
+this.setData({
+ num2:this.data.num2+1
+})
+    },
+         showInfo(){
+         this.setData({
+           count: this.data.count+this.properties.max,
+           max:this.properties.max+1
+         })
+         }
+  }
+})

+ 4 - 0
components/test/test.json

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

+ 14 - 0
components/test/test.wxml

@@ -0,0 +1,14 @@
+<!--components/test/test.wxml-->
+<view>
+<text>{{count}}</text>
+</view>
+<button bindtap="showInfo">show</button>
+<view>{{num1}}+{{num2}}={{sum}}</view>
+<button bindtap="add1">num+1</button>
+<slot name='second'></slot>
+<button bindtap="add2">num1+1</button>
+<slot name='first'></slot>
+<view>{{username}}</view>
+<view>{{numA}}+{{numB}}={{sum}}</view>
+<van-button bindtap='handleAdd' type='warning' data-step="{{1}}">numB组件+1</van-button>
+<van-button bindtap='handleAdd' type='normal' data-step="{{-1}}">numB组件-1</van-button>

+ 1 - 0
components/test/test.wxss

@@ -0,0 +1 @@
+/* components/test/test.wxss */

BIN
images/head.png


BIN
images/head2.png


BIN
images/home-active.png


BIN
images/home.png


BIN
images/message-active.png


BIN
images/message.png


BIN
images/mine-active.png


BIN
images/mine.png


BIN
images/take.png


+ 64 - 0
miniprogram_npm/@vant/weapp/action-sheet/index.js

@@ -0,0 +1,64 @@
+'use strict';
+Object.defineProperty(exports, '__esModule', { value: true });
+var component_1 = require('../common/component');
+var button_1 = require('../mixins/button');
+var open_type_1 = require('../mixins/open-type');
+component_1.VantComponent({
+  mixins: [button_1.button, open_type_1.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: function (event) {
+      var index = event.currentTarget.dataset.index;
+      var item = this.data.actions[index];
+      if (item && !item.disabled && !item.loading) {
+        this.$emit('select', item);
+        if (this.data.closeOnClickAction) {
+          this.onClose();
+        }
+      }
+    },
+    onCancel: function () {
+      this.$emit('cancel');
+    },
+    onClose: function () {
+      this.$emit('close');
+    },
+    onClickOverlay: function () {
+      this.$emit('click-overlay');
+      this.onClose();
+    },
+  },
+});

+ 8 - 0
miniprogram_npm/@vant/weapp/action-sheet/index.json

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

+ 67 - 0
miniprogram_npm/@vant/weapp/action-sheet/index.wxml

@@ -0,0 +1,67 @@
+<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-hairline--bottom van-action-sheet__header">
+    {{ title }}
+    <van-icon
+      name="close"
+      custom-class="van-action-sheet__close"
+      bind:click="onClose"
+    />
+  </view>
+  <view wx:if="{{ description }}" class="van-action-sheet__description">
+    {{ 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 }) }} van-hairline--top {{ 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 }}
+        <text wx:if="{{ item.subname }}" class="van-action-sheet__subname" >{{ item.subname }}</text>
+      </block>
+      <van-loading wx:else custom-class="van-action-sheet__loading" size="20px" />
+    </button>
+  </view>
+  <slot />
+  <view
+    wx:if="{{ cancelText }}"
+    class="van-action-sheet__cancel"
+    hover-class="van-action-sheet__cancel--hover"
+    hover-stay-time="70"
+    bind:tap="onCancel"
+  >
+    {{ cancelText }}
+  </view>
+</van-popup>

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
miniprogram_npm/@vant/weapp/action-sheet/index.wxss


+ 257 - 0
miniprogram_npm/@vant/weapp/area/index.js

@@ -0,0 +1,257 @@
+'use strict';
+var __assign =
+  (this && this.__assign) ||
+  function () {
+    __assign =
+      Object.assign ||
+      function (t) {
+        for (var s, i = 1, n = arguments.length; i < n; i++) {
+          s = arguments[i];
+          for (var p in s)
+            if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
+        }
+        return t;
+      };
+    return __assign.apply(this, arguments);
+  };
+Object.defineProperty(exports, '__esModule', { value: true });
+var component_1 = require('../common/component');
+var shared_1 = require('../picker/shared');
+var COLUMNSPLACEHOLDERCODE = '000000';
+component_1.VantComponent({
+  classes: ['active-class', 'toolbar-class', 'column-class'],
+  props: __assign(__assign({}, shared_1.pickerProps), {
+    value: {
+      type: String,
+      observer: function (value) {
+        this.code = value;
+        this.setValues();
+      },
+    },
+    areaList: {
+      type: Object,
+      value: {},
+      observer: 'setValues',
+    },
+    columnsNum: {
+      type: null,
+      value: 3,
+      observer: function (value) {
+        this.setData({
+          displayColumns: this.data.columns.slice(0, +value),
+        });
+      },
+    },
+    columnsPlaceholder: {
+      type: Array,
+      observer: function (val) {
+        this.setData({
+          typeToColumnsPlaceholder: {
+            province: val[0] || '',
+            city: val[1] || '',
+            county: val[2] || '',
+          },
+        });
+      },
+    },
+  }),
+  data: {
+    columns: [{ values: [] }, { values: [] }, { values: [] }],
+    displayColumns: [{ values: [] }, { values: [] }, { values: [] }],
+    typeToColumnsPlaceholder: {},
+  },
+  mounted: function () {
+    var _this = this;
+    setTimeout(function () {
+      _this.setValues();
+    }, 0);
+  },
+  methods: {
+    getPicker: function () {
+      if (this.picker == null) {
+        this.picker = this.selectComponent('.van-area__picker');
+      }
+      return this.picker;
+    },
+    onCancel: function (event) {
+      this.emit('cancel', event.detail);
+    },
+    onConfirm: function (event) {
+      var index = event.detail.index;
+      var value = event.detail.value;
+      value = this.parseOutputValues(value);
+      this.emit('confirm', { value: value, index: index });
+    },
+    emit: function (type, detail) {
+      detail.values = detail.value;
+      delete detail.value;
+      this.$emit(type, detail);
+    },
+    // parse output columns data
+    parseOutputValues: function (values) {
+      var columnsPlaceholder = this.data.columnsPlaceholder;
+      return values.map(function (value, index) {
+        // save undefined value
+        if (!value) return value;
+        value = JSON.parse(JSON.stringify(value));
+        if (!value.code || value.name === columnsPlaceholder[index]) {
+          value.code = '';
+          value.name = '';
+        }
+        return value;
+      });
+    },
+    onChange: function (event) {
+      var _this = this;
+      var _a = event.detail,
+        index = _a.index,
+        picker = _a.picker,
+        value = _a.value;
+      this.code = value[index].code;
+      this.setValues().then(function () {
+        _this.$emit('change', {
+          picker: picker,
+          values: _this.parseOutputValues(picker.getValues()),
+          index: index,
+        });
+      });
+    },
+    getConfig: function (type) {
+      var areaList = this.data.areaList;
+      return (areaList && areaList[type + '_list']) || {};
+    },
+    getList: function (type, code) {
+      var typeToColumnsPlaceholder = this.data.typeToColumnsPlaceholder;
+      var result = [];
+      if (type !== 'province' && !code) {
+        return result;
+      }
+      var list = this.getConfig(type);
+      result = Object.keys(list).map(function (code) {
+        return {
+          code: code,
+          name: list[code],
+        };
+      });
+      if (code) {
+        // oversea code
+        if (code[0] === '9' && type === 'city') {
+          code = '9';
+        }
+        result = result.filter(function (item) {
+          return item.code.indexOf(code) === 0;
+        });
+      }
+      if (typeToColumnsPlaceholder[type] && result.length) {
+        // set columns placeholder
+        var codeFill =
+          type === 'province'
+            ? ''
+            : type === 'city'
+            ? COLUMNSPLACEHOLDERCODE.slice(2, 4)
+            : COLUMNSPLACEHOLDERCODE.slice(4, 6);
+        result.unshift({
+          code: '' + code + codeFill,
+          name: typeToColumnsPlaceholder[type],
+        });
+      }
+      return result;
+    },
+    getIndex: function (type, code) {
+      var compareNum = type === 'province' ? 2 : type === 'city' ? 4 : 6;
+      var 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 (var i = 0; i < list.length; i++) {
+        if (list[i].code.slice(0, compareNum) === code) {
+          return i;
+        }
+      }
+      return 0;
+    },
+    setValues: function () {
+      var _this = this;
+      var county = this.getConfig('county');
+      var code = this.code;
+      if (!code) {
+        if (this.data.columnsPlaceholder.length) {
+          code = COLUMNSPLACEHOLDERCODE;
+        } else if (Object.keys(county)[0]) {
+          code = Object.keys(county)[0];
+        } else {
+          code = '';
+        }
+      }
+      var province = this.getList('province');
+      var city = this.getList('city', code.slice(0, 2));
+      var picker = this.getPicker();
+      if (!picker) {
+        return;
+      }
+      var stack = [];
+      stack.push(picker.setColumnValues(0, province, false));
+      stack.push(picker.setColumnValues(1, city, false));
+      if (city.length && code.slice(2, 4) === '00') {
+        code = city[0].code;
+      }
+      stack.push(
+        picker.setColumnValues(
+          2,
+          this.getList('county', code.slice(0, 4)),
+          false
+        )
+      );
+      return Promise.all(stack)
+        .catch(function () {})
+        .then(function () {
+          return picker.setIndexes([
+            _this.getIndex('province', code),
+            _this.getIndex('city', code),
+            _this.getIndex('county', code),
+          ]);
+        })
+        .catch(function () {});
+    },
+    getValues: function () {
+      var picker = this.getPicker();
+      return picker
+        ? picker.getValues().filter(function (value) {
+            return !!value;
+          })
+        : [];
+    },
+    getDetail: function () {
+      var values = this.getValues();
+      var area = {
+        code: '',
+        country: '',
+        province: '',
+        city: '',
+        county: '',
+      };
+      if (!values.length) {
+        return area;
+      }
+      var names = values.map(function (item) {
+        return 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: function (code) {
+      this.code = code || '';
+      return this.setValues();
+    },
+  },
+});

+ 6 - 0
miniprogram_npm/@vant/weapp/area/index.json

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

+ 18 - 0
miniprogram_npm/@vant/weapp/area/index.wxml

@@ -0,0 +1,18 @@
+<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="{{ displayColumns }}"
+  item-height="{{ itemHeight }}"
+  visible-item-count="{{ visibleItemCount }}"
+  cancel-button-text="{{ cancelButtonText }}"
+  confirm-button-text="{{ confirmButtonText }}"
+  bind:change="onChange"
+  bind:confirm="onConfirm"
+  bind:cancel="onCancel"
+/>

+ 1 - 0
miniprogram_npm/@vant/weapp/area/index.wxss

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

+ 81 - 0
miniprogram_npm/@vant/weapp/button/index.js

@@ -0,0 +1,81 @@
+'use strict';
+Object.defineProperty(exports, '__esModule', { value: true });
+var component_1 = require('../common/component');
+var button_1 = require('../mixins/button');
+var open_type_1 = require('../mixins/open-type');
+var version_1 = require('../common/version');
+var mixins = [button_1.button, open_type_1.openType];
+if (version_1.canIUseFormFieldButton()) {
+  mixins.push('wx://form-field-button');
+}
+component_1.VantComponent({
+  mixins: 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: {
+      type: String,
+      observer: function (color) {
+        var style = '';
+        if (color) {
+          style += 'color: ' + (this.data.plain ? color : 'white') + ';';
+          if (!this.data.plain) {
+            // Use background instead of backgroundColor to make linear-gradient work
+            style += 'background: ' + color + ';';
+          }
+          // hide border when color is linear-gradient
+          if (color.indexOf('gradient') !== -1) {
+            style += 'border: 0;';
+          } else {
+            style += 'border-color: ' + color + ';';
+          }
+        }
+        if (style !== this.data.baseStyle) {
+          this.setData({ baseStyle: style });
+        }
+      },
+    },
+  },
+  methods: {
+    onClick: function () {
+      if (!this.data.loading) {
+        this.$emit('click');
+      }
+    },
+    noop: function () {},
+  },
+});

+ 7 - 0
miniprogram_npm/@vant/weapp/button/index.json

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

+ 68 - 0
miniprogram_npm/@vant/weapp/button/index.wxml

@@ -0,0 +1,68 @@
+<wxs src="../wxs/utils.wxs" module="utils" />
+
+<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="{{ baseStyle }} {{ 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="{{ 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>
+
+
+<wxs module="loadingColor">
+function get(type, color,plain) {
+  if(plain) {
+    return color ? color: '#c9c9c9';
+  }
+
+  if(type === 'default') {
+    return '#c9c9c9';
+  }
+  return 'white';
+}
+
+module.exports = get;
+</wxs>

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
miniprogram_npm/@vant/weapp/button/index.wxss


+ 57 - 0
miniprogram_npm/@vant/weapp/calendar/calendar.wxml

@@ -0,0 +1,57 @@
+<wxs src="./index.wxs" module="computed"></wxs>
+
+<template name="calendar">
+  <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="van-calendar__footer {{ safeAreaInsetBottom ? 'van-calendar__footer--safe-area-inset-bottom' : '' }}">
+      <slot name="footer"></slot>
+    </view>
+
+    <view class="van-calendar__footer {{ safeAreaInsetBottom ? 'van-calendar__footer--safe-area-inset-bottom' : '' }}">
+      <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>
+</template>

+ 18 - 0
miniprogram_npm/@vant/weapp/calendar/components/header/index.js

@@ -0,0 +1,18 @@
+'use strict';
+Object.defineProperty(exports, '__esModule', { value: true });
+var component_1 = require('../../../common/component');
+component_1.VantComponent({
+  props: {
+    title: {
+      type: String,
+      value: '日期选择',
+    },
+    subtitle: String,
+    showTitle: Boolean,
+    showSubtitle: Boolean,
+  },
+  data: {
+    weekdays: ['日', '一', '二', '三', '四', '五', '六'],
+  },
+  methods: {},
+});

+ 3 - 0
miniprogram_npm/@vant/weapp/calendar/components/header/index.json

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

+ 16 - 0
miniprogram_npm/@vant/weapp/calendar/components/header/index.wxml

@@ -0,0 +1,16 @@
+<view class="van-calendar__header">
+  <block wx:if="{{ showTitle }}">
+    <view class="van-calendar__header-title"><slot name="title"></slot></view>
+    <view class="van-calendar__header-title">{{ title }}</view>
+  </block>
+
+  <view wx:if="{{ showSubtitle }}" class="van-calendar__header-subtitle">
+    {{ subtitle }}
+  </view>
+
+  <view class="van-calendar__weekdays">
+    <view wx:for="{{ weekdays }}" wx:key="index" class="van-calendar__weekday">
+      {{ item }}
+    </view>
+  </view>
+</view>

+ 1 - 0
miniprogram_npm/@vant/weapp/calendar/components/header/index.wxss

@@ -0,0 +1 @@
+@import '../../../common/index.wxss';.van-calendar__header{-webkit-flex-shrink:0;flex-shrink:0;box-shadow:0 2px 10px rgba(125,126,128,.16);box-shadow:var(--calendar-header-box-shadow,0 2px 10px rgba(125,126,128,.16))}.van-calendar__header-subtitle,.van-calendar__header-title{text-align:center;height:44px;height:var(--calendar-header-title-height,44px);font-weight:500;font-weight:var(--font-weight-bold,500);line-height:44px;line-height:var(--calendar-header-title-height,44px)}.van-calendar__header-title+.van-calendar__header-title,.van-calendar__header-title:empty{display:none}.van-calendar__header-title:empty+.van-calendar__header-title{display:block!important}.van-calendar__weekdays{display:-webkit-flex;display:flex}.van-calendar__weekday{-webkit-flex:1;flex:1;text-align:center;font-size:12px;font-size:var(--calendar-weekdays-font-size,12px);line-height:30px;line-height:var(--calendar-weekdays-height,30px)}

+ 167 - 0
miniprogram_npm/@vant/weapp/calendar/components/month/index.js

@@ -0,0 +1,167 @@
+'use strict';
+Object.defineProperty(exports, '__esModule', { value: true });
+var component_1 = require('../../../common/component');
+var utils_1 = require('../../utils');
+component_1.VantComponent({
+  props: {
+    date: {
+      type: null,
+      observer: 'setDays',
+    },
+    type: {
+      type: String,
+      observer: 'setDays',
+    },
+    color: String,
+    minDate: {
+      type: null,
+      observer: 'setDays',
+    },
+    maxDate: {
+      type: null,
+      observer: 'setDays',
+    },
+    showMark: Boolean,
+    rowHeight: [Number, String],
+    formatter: {
+      type: null,
+      observer: 'setDays',
+    },
+    currentDate: {
+      type: [null, Array],
+      observer: 'setDays',
+    },
+    allowSameDay: Boolean,
+    showSubtitle: Boolean,
+    showMonthTitle: Boolean,
+  },
+  data: {
+    visible: true,
+    days: [],
+  },
+  methods: {
+    onClick: function (event) {
+      var index = event.currentTarget.dataset.index;
+      var item = this.data.days[index];
+      if (item.type !== 'disabled') {
+        this.$emit('click', item);
+      }
+    },
+    setDays: function () {
+      var days = [];
+      var startDate = new Date(this.data.date);
+      var year = startDate.getFullYear();
+      var month = startDate.getMonth();
+      var totalDay = utils_1.getMonthEndDay(
+        startDate.getFullYear(),
+        startDate.getMonth() + 1
+      );
+      for (var day = 1; day <= totalDay; day++) {
+        var date = new Date(year, month, day);
+        var type = this.getDayType(date);
+        var config = {
+          date: date,
+          type: type,
+          text: day,
+          bottomInfo: this.getBottomInfo(type),
+        };
+        if (this.data.formatter) {
+          config = this.data.formatter(config);
+        }
+        days.push(config);
+      }
+      this.setData({ days: days });
+    },
+    getMultipleDayType: function (day) {
+      var currentDate = this.data.currentDate;
+      if (!Array.isArray(currentDate)) {
+        return '';
+      }
+      var isSelected = function (date) {
+        return currentDate.some(function (item) {
+          return utils_1.compareDay(item, date) === 0;
+        });
+      };
+      if (isSelected(day)) {
+        var prevDay = utils_1.getPrevDay(day);
+        var nextDay = utils_1.getNextDay(day);
+        var prevSelected = isSelected(prevDay);
+        var nextSelected = isSelected(nextDay);
+        if (prevSelected && nextSelected) {
+          return 'multiple-middle';
+        }
+        if (prevSelected) {
+          return 'end';
+        }
+        return nextSelected ? 'start' : 'multiple-selected';
+      }
+      return '';
+    },
+    getRangeDayType: function (day) {
+      var _a = this.data,
+        currentDate = _a.currentDate,
+        allowSameDay = _a.allowSameDay;
+      if (!Array.isArray(currentDate)) {
+        return;
+      }
+      var startDay = currentDate[0],
+        endDay = currentDate[1];
+      if (!startDay) {
+        return;
+      }
+      var compareToStart = utils_1.compareDay(day, startDay);
+      if (!endDay) {
+        return compareToStart === 0 ? 'start' : '';
+      }
+      var compareToEnd = utils_1.compareDay(day, endDay);
+      if (compareToStart === 0 && compareToEnd === 0 && allowSameDay) {
+        return 'start-end';
+      }
+      if (compareToStart === 0) {
+        return 'start';
+      }
+      if (compareToEnd === 0) {
+        return 'end';
+      }
+      if (compareToStart > 0 && compareToEnd < 0) {
+        return 'middle';
+      }
+    },
+    getDayType: function (day) {
+      var _a = this.data,
+        type = _a.type,
+        minDate = _a.minDate,
+        maxDate = _a.maxDate,
+        currentDate = _a.currentDate;
+      if (
+        utils_1.compareDay(day, minDate) < 0 ||
+        utils_1.compareDay(day, maxDate) > 0
+      ) {
+        return 'disabled';
+      }
+      if (type === 'single') {
+        return utils_1.compareDay(day, currentDate) === 0 ? 'selected' : '';
+      }
+      if (type === 'multiple') {
+        return this.getMultipleDayType(day);
+      }
+      /* istanbul ignore else */
+      if (type === 'range') {
+        return this.getRangeDayType(day);
+      }
+    },
+    getBottomInfo: function (type) {
+      if (this.data.type === 'range') {
+        if (type === 'start') {
+          return '开始';
+        }
+        if (type === 'end') {
+          return '结束';
+        }
+        if (type === 'start-end') {
+          return '开始/结束';
+        }
+      }
+    },
+  },
+});

+ 3 - 0
miniprogram_npm/@vant/weapp/calendar/components/month/index.json

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

+ 39 - 0
miniprogram_npm/@vant/weapp/calendar/components/month/index.wxml

@@ -0,0 +1,39 @@
+<wxs src="./index.wxs" module="computed"></wxs>
+<wxs src="../../../wxs/utils.wxs" module="utils" />
+
+<view class="van-calendar__month" style="{{ computed.getMonthStyle(visible, date, rowHeight) }}">
+  <view wx:if="{{ showMonthTitle }}" class="van-calendar__month-title">
+    {{ computed.formatMonthTitle(date) }}
+  </view>
+
+  <view wx:if="{{ visible }}" class="van-calendar__days">
+    <view wx:if="{{ showMark }}" class="van-calendar__month-mark">
+      {{ computed.getMark(date) }}
+    </view>
+
+    <view
+      wx:for="{{ days }}"
+      wx:key="index"
+      style="{{ computed.getDayStyle(item.type, index, date, rowHeight, color) }}"
+      class="{{ utils.bem('calendar__day', [item.type]) }} {{ item.className }}"
+      data-index="{{ index }}"
+      bindtap="onClick"
+    >
+      <view wx:if="{{ item.type === 'selected' }}" class="van-calendar__selected-day" style="background: {{ color }}">
+        <view wx:if="{{ item.topInfo }}" class="van-calendar__top-info">{{ item.topInfo }}</view>
+        {{ item.text }}
+        <view wx:if="{{ item.bottomInfo }}" class="van-calendar__bottom-info">
+          {{ item.bottomInfo }}
+        </view>
+      </view>
+
+      <view wx:else>
+        <view wx:if="{{ item.topInfo }}" class="van-calendar__top-info">{{ item.topInfo }}</view>
+        {{ item.text }}
+        <view wx:if="{{ item.bottomInfo }}" class="van-calendar__bottom-info">
+          {{ item.bottomInfo }}
+        </view>
+      </view>
+    </view>
+  </view>
+</view>

+ 67 - 0
miniprogram_npm/@vant/weapp/calendar/components/month/index.wxs

@@ -0,0 +1,67 @@
+/* eslint-disable */
+var utils = require('../../utils.wxs');
+
+function getMark(date) {
+  return getDate(date).getMonth() + 1;
+}
+
+var ROW_HEIGHT = 64;
+
+function getDayStyle(type, index, date, rowHeight, color) {
+  var style = [];
+  var offset = getDate(date).getDay();
+
+  if (index === 0) {
+    style.push(['margin-left', (100 * offset) / 7 + '%']);
+  }
+
+  if (rowHeight !== ROW_HEIGHT) {
+    style.push(['height', rowHeight + 'px']);
+  }
+
+  if (color) {
+    if (
+      type === 'start' ||
+      type === 'end' ||
+      type === 'multiple-selected' ||
+      type === 'multiple-middle'
+    ) {
+      style.push(['background', color]);
+    } else if (type === 'middle') {
+      style.push(['color', color]);
+    }
+  }
+
+  return style
+    .map(function(item) {
+      return item.join(':');
+    })
+    .join(';');
+}
+
+function formatMonthTitle(date) {
+  date = getDate(date);
+  return date.getFullYear() + '年' + (date.getMonth() + 1) + '月';
+}
+
+function getMonthStyle(visible, date, rowHeight) {
+  if (!visible) {
+    date = getDate(date);
+
+    var totalDay = utils.getMonthEndDay(
+      date.getFullYear(),
+      date.getMonth() + 1
+    );
+    var offset = getDate(date).getDay();
+    var padding = Math.ceil((totalDay + offset) / 7) * rowHeight;
+
+    return 'padding-bottom:' + padding + 'px';
+  }
+}
+
+module.exports = {
+  getMark: getMark,
+  getDayStyle: getDayStyle,
+  formatMonthTitle: formatMonthTitle,
+  getMonthStyle: getMonthStyle
+};

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
miniprogram_npm/@vant/weapp/calendar/components/month/index.wxss


+ 318 - 0
miniprogram_npm/@vant/weapp/calendar/index.js

@@ -0,0 +1,318 @@
+'use strict';
+var __spreadArrays =
+  (this && this.__spreadArrays) ||
+  function () {
+    for (var s = 0, i = 0, il = arguments.length; i < il; i++)
+      s += arguments[i].length;
+    for (var r = Array(s), k = 0, i = 0; i < il; i++)
+      for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
+        r[k] = a[j];
+    return r;
+  };
+var __importDefault =
+  (this && this.__importDefault) ||
+  function (mod) {
+    return mod && mod.__esModule ? mod : { default: mod };
+  };
+Object.defineProperty(exports, '__esModule', { value: true });
+var component_1 = require('../common/component');
+var utils_1 = require('./utils');
+var toast_1 = __importDefault(require('../toast/toast'));
+component_1.VantComponent({
+  props: {
+    title: {
+      type: String,
+      value: '日期选择',
+    },
+    color: String,
+    show: {
+      type: Boolean,
+      observer: function (val) {
+        if (val) {
+          this.initRect();
+          this.scrollIntoView();
+        }
+      },
+    },
+    formatter: null,
+    confirmText: {
+      type: String,
+      value: '确定',
+    },
+    rangePrompt: String,
+    defaultDate: {
+      type: [Number, Array],
+      observer: function (val) {
+        this.setData({ currentDate: val });
+        this.scrollIntoView();
+      },
+    },
+    allowSameDay: Boolean,
+    confirmDisabledText: String,
+    type: {
+      type: String,
+      value: 'single',
+      observer: 'reset',
+    },
+    minDate: {
+      type: null,
+      value: Date.now(),
+    },
+    maxDate: {
+      type: null,
+      value: new Date(
+        new Date().getFullYear(),
+        new Date().getMonth() + 6,
+        new Date().getDate()
+      ).getTime(),
+    },
+    position: {
+      type: String,
+      value: 'bottom',
+    },
+    rowHeight: {
+      type: [Number, String],
+      value: utils_1.ROW_HEIGHT,
+    },
+    round: {
+      type: Boolean,
+      value: true,
+    },
+    poppable: {
+      type: Boolean,
+      value: true,
+    },
+    showMark: {
+      type: Boolean,
+      value: true,
+    },
+    showTitle: {
+      type: Boolean,
+      value: true,
+    },
+    showConfirm: {
+      type: Boolean,
+      value: true,
+    },
+    showSubtitle: {
+      type: Boolean,
+      value: true,
+    },
+    safeAreaInsetBottom: {
+      type: Boolean,
+      value: true,
+    },
+    closeOnClickOverlay: {
+      type: Boolean,
+      value: true,
+    },
+    maxRange: {
+      type: [Number, String],
+      value: null,
+    },
+  },
+  data: {
+    subtitle: '',
+    currentDate: null,
+    scrollIntoView: '',
+  },
+  created: function () {
+    this.setData({
+      currentDate: this.getInitialDate(),
+    });
+  },
+  mounted: function () {
+    if (this.data.show || !this.data.poppable) {
+      this.initRect();
+      this.scrollIntoView();
+    }
+  },
+  methods: {
+    reset: function () {
+      this.setData({ currentDate: this.getInitialDate() });
+      this.scrollIntoView();
+    },
+    initRect: function () {
+      var _this = this;
+      if (this.contentObserver != null) {
+        this.contentObserver.disconnect();
+      }
+      var contentObserver = this.createIntersectionObserver({
+        thresholds: [0, 0.1, 0.9, 1],
+        observeAll: true,
+      });
+      this.contentObserver = contentObserver;
+      contentObserver.relativeTo('.van-calendar__body');
+      contentObserver.observe('.month', function (res) {
+        if (res.boundingClientRect.top <= res.relativeRect.top) {
+          // @ts-ignore
+          _this.setData({
+            subtitle: utils_1.formatMonthTitle(res.dataset.date),
+          });
+        }
+      });
+    },
+    getInitialDate: function () {
+      var _a = this.data,
+        type = _a.type,
+        defaultDate = _a.defaultDate,
+        minDate = _a.minDate;
+      if (type === 'range') {
+        var _b = defaultDate || [],
+          startDay = _b[0],
+          endDay = _b[1];
+        return [
+          startDay || minDate,
+          endDay || utils_1.getNextDay(new Date(minDate)).getTime(),
+        ];
+      }
+      if (type === 'multiple') {
+        return defaultDate || [minDate];
+      }
+      return defaultDate || minDate;
+    },
+    scrollIntoView: function () {
+      var _this = this;
+      setTimeout(function () {
+        var _a = _this.data,
+          currentDate = _a.currentDate,
+          type = _a.type,
+          show = _a.show,
+          poppable = _a.poppable,
+          minDate = _a.minDate,
+          maxDate = _a.maxDate;
+        var targetDate = type === 'single' ? currentDate : currentDate[0];
+        var displayed = show || !poppable;
+        if (!targetDate || !displayed) {
+          return;
+        }
+        var months = utils_1.getMonths(minDate, maxDate);
+        months.some(function (month, index) {
+          if (utils_1.compareMonth(month, targetDate) === 0) {
+            _this.setData({ scrollIntoView: 'month' + index });
+            return true;
+          }
+          return false;
+        });
+      }, 100);
+    },
+    onOpen: function () {
+      this.$emit('open');
+    },
+    onOpened: function () {
+      this.$emit('opened');
+    },
+    onClose: function () {
+      this.$emit('close');
+    },
+    onClosed: function () {
+      this.$emit('closed');
+    },
+    onClickDay: function (event) {
+      var date = event.detail.date;
+      var _a = this.data,
+        type = _a.type,
+        currentDate = _a.currentDate,
+        allowSameDay = _a.allowSameDay;
+      if (type === 'range') {
+        var startDay = currentDate[0],
+          endDay = currentDate[1];
+        if (startDay && !endDay) {
+          var compareToStart = utils_1.compareDay(date, startDay);
+          if (compareToStart === 1) {
+            this.select([startDay, date], true);
+          } else if (compareToStart === -1) {
+            this.select([date, null]);
+          } else if (allowSameDay) {
+            this.select([date, date]);
+          }
+        } else {
+          this.select([date, null]);
+        }
+      } else if (type === 'multiple') {
+        var selectedIndex_1;
+        var selected = currentDate.some(function (dateItem, index) {
+          var equal = utils_1.compareDay(dateItem, date) === 0;
+          if (equal) {
+            selectedIndex_1 = index;
+          }
+          return equal;
+        });
+        if (selected) {
+          var cancelDate = currentDate.splice(selectedIndex_1, 1);
+          this.setData({ currentDate: currentDate });
+          this.unselect(cancelDate);
+        } else {
+          this.select(__spreadArrays(currentDate, [date]));
+        }
+      } else {
+        this.select(date, true);
+      }
+    },
+    unselect: function (dateArray) {
+      var date = dateArray[0];
+      if (date) {
+        this.$emit('unselect', utils_1.copyDates(date));
+      }
+    },
+    select: function (date, complete) {
+      if (complete && this.data.type === 'range') {
+        var valid = this.checkRange(date);
+        if (!valid) {
+          // auto selected to max range if showConfirm
+          if (this.data.showConfirm) {
+            this.emit([
+              date[0],
+              utils_1.getDayByOffset(date[0], this.data.maxRange - 1),
+            ]);
+          } else {
+            this.emit(date);
+          }
+          return;
+        }
+      }
+      this.emit(date);
+      if (complete && !this.data.showConfirm) {
+        this.onConfirm();
+      }
+    },
+    emit: function (date) {
+      var getTime = function (date) {
+        return date instanceof Date ? date.getTime() : date;
+      };
+      this.setData({
+        currentDate: Array.isArray(date) ? date.map(getTime) : getTime(date),
+      });
+      this.$emit('select', utils_1.copyDates(date));
+    },
+    checkRange: function (date) {
+      var _a = this.data,
+        maxRange = _a.maxRange,
+        rangePrompt = _a.rangePrompt;
+      if (maxRange && utils_1.calcDateNum(date) > maxRange) {
+        toast_1.default({
+          context: this,
+          message:
+            rangePrompt ||
+            '\u9009\u62E9\u5929\u6570\u4E0D\u80FD\u8D85\u8FC7 ' +
+              maxRange +
+              ' \u5929',
+        });
+        return false;
+      }
+      return true;
+    },
+    onConfirm: function () {
+      var _this = this;
+      if (
+        this.data.type === 'range' &&
+        !this.checkRange(this.data.currentDate)
+      ) {
+        return;
+      }
+      wx.nextTick(function () {
+        _this.$emit('confirm', utils_1.copyDates(_this.data.currentDate));
+      });
+    },
+  },
+});

+ 9 - 0
miniprogram_npm/@vant/weapp/calendar/index.json

@@ -0,0 +1,9 @@
+{
+  "component": true,
+  "usingComponents": {
+    "header": "./components/header/index",
+    "month": "./components/month/index",
+    "van-button": "../button/index",
+    "van-popup": "../popup/index"
+  }
+}

+ 31 - 0
miniprogram_npm/@vant/weapp/calendar/index.wxml

@@ -0,0 +1,31 @@
+<wxs src="./index.wxs" module="computed" />
+
+<import src="./calendar.wxml" />
+
+<van-popup
+  wx:if="{{ poppable }}"
+  custom-class="van-calendar__popup--{{ position }}"
+  close-icon-class="van-calendar__close-icon"
+  show="{{ show }}"
+  round="{{ round }}"
+  position="{{ position }}"
+  closeable="{{ showTitle || showSubtitle }}"
+  close-on-click-overlay="{{ closeOnClickOverlay }}"
+  bind:enter="onOpen"
+  bind:close="onClose"
+  bind:after-enter="onOpened"
+  bind:after-leave="onClosed"
+>
+  <template
+    is="calendar"
+    data="{{ title, subtitle, showTitle, showSubtitle, minDate, maxDate, type, color, showMark, formatter, rowHeight, currentDate, safeAreaInsetBottom, showConfirm, confirmDisabledText, confirmText, scrollIntoView, allowSameDay }}"
+  />
+</van-popup>
+
+<template
+  wx:else
+  is="calendar"
+  data="{{ title, subtitle, showTitle, showSubtitle, minDate, maxDate, type, color, showMark, formatter, rowHeight, currentDate, safeAreaInsetBottom, showConfirm, confirmDisabledText, confirmText, scrollIntoView, allowSameDay }}"
+/>
+
+<van-toast id="van-toast" />

+ 37 - 0
miniprogram_npm/@vant/weapp/calendar/index.wxs

@@ -0,0 +1,37 @@
+/* eslint-disable */
+var utils = require('./utils.wxs');
+
+function getMonths(minDate, maxDate) {
+  var months = [];
+  var cursor = getDate(minDate);
+
+  cursor.setDate(1);
+
+  do {
+    months.push(cursor.getTime());
+    cursor.setMonth(cursor.getMonth() + 1);
+  } while (utils.compareMonth(cursor, getDate(maxDate)) !== 1);
+
+  return months;
+}
+
+function getButtonDisabled(type, currentDate) {
+  if (currentDate == null) {
+    return true;
+  }
+
+  if (type === 'range') {
+    return !currentDate[0] || !currentDate[1];
+  }
+
+  if (type === 'multiple') {
+    return !currentDate.length;
+  }
+
+  return !currentDate;
+}
+
+module.exports = {
+  getMonths: getMonths,
+  getButtonDisabled: getButtonDisabled
+};

+ 1 - 0
miniprogram_npm/@vant/weapp/calendar/index.wxss

@@ -0,0 +1 @@
+@import '../common/index.wxss';.van-calendar{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;height:100%;height:var(--calendar-height,100%);background-color:#fff;background-color:var(--calendar-background-color,#fff)}.van-calendar__close-icon{top:11px}.van-calendar__popup--bottom,.van-calendar__popup--top{height:80%;height:var(--calendar-popup-height,80%)}.van-calendar__popup--left,.van-calendar__popup--right{height:100%}.van-calendar__body{-webkit-flex:1;flex:1;overflow:auto;-webkit-overflow-scrolling:touch}.van-calendar__footer{-webkit-flex-shrink:0;flex-shrink:0;padding:0 16px;padding:0 var(--padding-md,16px)}.van-calendar__footer--safe-area-inset-bottom{padding-bottom:env(safe-area-inset-bottom)}.van-calendar__footer+.van-calendar__footer,.van-calendar__footer:empty{display:none}.van-calendar__footer:empty+.van-calendar__footer{display:block!important}.van-calendar__confirm{height:36px!important;height:var(--calendar-confirm-button-height,36px)!important;margin:7px 0!important;margin:var(--calendar-confirm-button-margin,7px 0)!important;line-height:34px!important;line-height:var(--calendar-confirm-button-line-height,34px)!important}

+ 91 - 0
miniprogram_npm/@vant/weapp/calendar/utils.js

@@ -0,0 +1,91 @@
+'use strict';
+Object.defineProperty(exports, '__esModule', { value: true });
+exports.getMonths = exports.getMonthEndDay = exports.copyDates = exports.calcDateNum = exports.getNextDay = exports.getPrevDay = exports.getDayByOffset = exports.compareDay = exports.compareMonth = exports.formatMonthTitle = exports.ROW_HEIGHT = void 0;
+exports.ROW_HEIGHT = 64;
+function formatMonthTitle(date) {
+  if (!(date instanceof Date)) {
+    date = new Date(date);
+  }
+  return date.getFullYear() + '\u5E74' + (date.getMonth() + 1) + '\u6708';
+}
+exports.formatMonthTitle = formatMonthTitle;
+function compareMonth(date1, date2) {
+  if (!(date1 instanceof Date)) {
+    date1 = new Date(date1);
+  }
+  if (!(date2 instanceof Date)) {
+    date2 = new Date(date2);
+  }
+  var year1 = date1.getFullYear();
+  var year2 = date2.getFullYear();
+  var month1 = date1.getMonth();
+  var month2 = date2.getMonth();
+  if (year1 === year2) {
+    return month1 === month2 ? 0 : month1 > month2 ? 1 : -1;
+  }
+  return year1 > year2 ? 1 : -1;
+}
+exports.compareMonth = compareMonth;
+function compareDay(day1, day2) {
+  if (!(day1 instanceof Date)) {
+    day1 = new Date(day1);
+  }
+  if (!(day2 instanceof Date)) {
+    day2 = new Date(day2);
+  }
+  var compareMonthResult = compareMonth(day1, day2);
+  if (compareMonthResult === 0) {
+    var date1 = day1.getDate();
+    var date2 = day2.getDate();
+    return date1 === date2 ? 0 : date1 > date2 ? 1 : -1;
+  }
+  return compareMonthResult;
+}
+exports.compareDay = compareDay;
+function getDayByOffset(date, offset) {
+  date = new Date(date);
+  date.setDate(date.getDate() + offset);
+  return date;
+}
+exports.getDayByOffset = getDayByOffset;
+function getPrevDay(date) {
+  return getDayByOffset(date, -1);
+}
+exports.getPrevDay = getPrevDay;
+function getNextDay(date) {
+  return getDayByOffset(date, 1);
+}
+exports.getNextDay = getNextDay;
+function calcDateNum(date) {
+  var day1 = new Date(date[0]).getTime();
+  var day2 = new Date(date[1]).getTime();
+  return (day2 - day1) / (1000 * 60 * 60 * 24) + 1;
+}
+exports.calcDateNum = calcDateNum;
+function copyDates(dates) {
+  if (Array.isArray(dates)) {
+    return dates.map(function (date) {
+      if (date === null) {
+        return date;
+      }
+      return new Date(date);
+    });
+  }
+  return new Date(dates);
+}
+exports.copyDates = copyDates;
+function getMonthEndDay(year, month) {
+  return 32 - new Date(year, month - 1, 32).getDate();
+}
+exports.getMonthEndDay = getMonthEndDay;
+function getMonths(minDate, maxDate) {
+  var months = [];
+  var cursor = new Date(minDate);
+  cursor.setDate(1);
+  do {
+    months.push(cursor.getTime());
+    cursor.setMonth(cursor.getMonth() + 1);
+  } while (compareMonth(cursor, maxDate) !== 1);
+  return months;
+}
+exports.getMonths = getMonths;

+ 25 - 0
miniprogram_npm/@vant/weapp/calendar/utils.wxs

@@ -0,0 +1,25 @@
+/* eslint-disable */
+function getMonthEndDay(year, month) {
+  return 32 -  getDate(year, month - 1, 32).getDate();
+}
+
+function compareMonth(date1, date2) {
+  date1 = getDate(date1);
+  date2 = getDate(date2);
+
+  var year1 = date1.getFullYear();
+  var year2 = date2.getFullYear();
+  var month1 = date1.getMonth();
+  var month2 = date2.getMonth();
+
+  if (year1 === year2) {
+    return month1 === month2 ? 0 : month1 > month2 ? 1 : -1;
+  }
+
+  return year1 > year2 ? 1 : -1;
+}
+
+module.exports = {
+  getMonthEndDay: getMonthEndDay,
+  compareMonth: compareMonth
+};

+ 51 - 0
miniprogram_npm/@vant/weapp/card/index.js

@@ -0,0 +1,51 @@
+'use strict';
+Object.defineProperty(exports, '__esModule', { value: true });
+var link_1 = require('../mixins/link');
+var component_1 = require('../common/component');
+component_1.VantComponent({
+  classes: [
+    'num-class',
+    'desc-class',
+    'thumb-class',
+    'title-class',
+    'price-class',
+    'origin-price-class',
+  ],
+  mixins: [link_1.link],
+  props: {
+    tag: String,
+    num: String,
+    desc: String,
+    thumb: String,
+    title: String,
+    price: {
+      type: String,
+      observer: 'updatePrice',
+    },
+    centered: Boolean,
+    lazyLoad: Boolean,
+    thumbLink: String,
+    originPrice: String,
+    thumbMode: {
+      type: String,
+      value: 'aspectFit',
+    },
+    currency: {
+      type: String,
+      value: '¥',
+    },
+  },
+  methods: {
+    updatePrice: function () {
+      var price = this.data.price;
+      var priceArr = price.toString().split('.');
+      this.setData({
+        integerStr: priceArr[0],
+        decimalStr: priceArr[1] ? '.' + priceArr[1] : '',
+      });
+    },
+    onClickThumb: function () {
+      this.jumpLink('thumbLink');
+    },
+  },
+});

+ 6 - 0
miniprogram_npm/@vant/weapp/card/index.json

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

+ 50 - 0
miniprogram_npm/@vant/weapp/card/index.wxml

@@ -0,0 +1,50 @@
+<wxs src="../wxs/utils.wxs" module="utils" />
+
+<view class="custom-class van-card">
+  <view class="{{ utils.bem('card__header', { center: centered }) }}">
+    <view class="van-card__thumb" bind:tap="onClickThumb">
+      <image
+        wx:if="{{ thumb }}"
+        src="{{ thumb }}"
+        mode="{{ thumbMode }}"
+        lazy-load="{{ lazyLoad }}"
+        class="van-card__img thumb-class"
+      />
+      <slot name="thumb" />
+      <van-tag
+        wx:if="{{ tag }}"
+        mark
+        type="danger"
+        custom-class="van-card__tag"
+      >
+        {{ tag }}
+      </van-tag>
+    </view>
+
+    <view class="van-card__content {{ utils.bem('card__content', { center: centered }) }}">
+      <view>
+        <view wx:if="{{ title }}" class="van-card__title title-class">{{ title }}</view>
+        <slot wx:else name="title" />
+
+        <view wx:if="{{ desc }}" class="van-card__desc desc-class">{{ desc }}</view>
+        <slot wx:else name="desc" />
+
+        <slot name="tags" />
+      </view>
+
+      <view class="van-card__bottom">
+        <slot name="price-top" />
+        <view wx:if="{{ price || price === 0 }}" class="van-card__price price-class">{{ currency }}<text class="van-card__price-integer">{{ integerStr }}</text><text class="van-card__price-decimal">{{ decimalStr }}</text></view>
+        <slot wx:else name="price" />
+        <view wx:if="{{ originPrice || originPrice === 0 }}" class="van-card__origin-price origin-price-class">{{ currency }} {{ originPrice }}</view>
+        <view wx:if="{{ num }}" class="van-card__num num-class">x {{ num }}</view>
+        <slot wx:else  name="num" />
+        <slot name="bottom" />
+      </view>
+    </view>
+  </view>
+
+  <view class="van-card__footer">
+    <slot name="footer" />
+  </view>
+</view>

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
miniprogram_npm/@vant/weapp/card/index.wxss


+ 12 - 0
miniprogram_npm/@vant/weapp/cell-group/index.js

@@ -0,0 +1,12 @@
+'use strict';
+Object.defineProperty(exports, '__esModule', { value: true });
+var component_1 = require('../common/component');
+component_1.VantComponent({
+  props: {
+    title: String,
+    border: {
+      type: Boolean,
+      value: true,
+    },
+  },
+});

+ 3 - 0
miniprogram_npm/@vant/weapp/cell-group/index.json

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

+ 9 - 0
miniprogram_npm/@vant/weapp/cell-group/index.wxml

@@ -0,0 +1,9 @@
+<view
+  wx:if="{{ title }}"
+  class="van-cell-group__title"
+>
+  {{ title }}
+</view>
+<view class="custom-class van-cell-group {{ border ? 'van-hairline--top-bottom' : '' }}">
+  <slot />
+</view>

+ 1 - 0
miniprogram_npm/@vant/weapp/cell-group/index.wxss

@@ -0,0 +1 @@
+@import '../common/index.wxss';.van-cell-group__title{padding:16px 16px 8px;padding:var(--cell-group-title-padding,16px 16px 8px);font-size:14px;font-size:var(--cell-group-title-font-size,14px);line-height:16px;line-height:var(--cell-group-title-line-height,16px);color:#969799;color:var(--cell-group-title-color,#969799)}

+ 39 - 0
miniprogram_npm/@vant/weapp/cell/index.js

@@ -0,0 +1,39 @@
+'use strict';
+Object.defineProperty(exports, '__esModule', { value: true });
+var link_1 = require('../mixins/link');
+var component_1 = require('../common/component');
+component_1.VantComponent({
+  classes: [
+    'title-class',
+    'label-class',
+    'value-class',
+    'right-icon-class',
+    'hover-class',
+  ],
+  mixins: [link_1.link],
+  props: {
+    title: null,
+    value: null,
+    icon: String,
+    size: String,
+    label: String,
+    center: Boolean,
+    isLink: Boolean,
+    required: Boolean,
+    clickable: Boolean,
+    titleWidth: String,
+    customStyle: String,
+    arrowDirection: String,
+    useLabelSlot: Boolean,
+    border: {
+      type: Boolean,
+      value: true,
+    },
+  },
+  methods: {
+    onClick: function (event) {
+      this.$emit('click', event.detail);
+      this.jumpLink();
+    },
+  },
+});

+ 6 - 0
miniprogram_npm/@vant/weapp/cell/index.json

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

+ 45 - 0
miniprogram_npm/@vant/weapp/cell/index.wxml

@@ -0,0 +1,45 @@
+<wxs src="../wxs/utils.wxs" module="utils" />
+
+<view
+  class="custom-class {{ utils.bem('cell', [size, { center, required, borderless: !border, clickable: isLink || clickable }]) }}"
+  hover-class="van-cell--hover hover-class"
+  hover-stay-time="70"
+  style="{{ customStyle }}"
+  bind:tap="onClick"
+>
+  <van-icon
+    wx:if="{{ icon }}"
+    name="{{ icon }}"
+    class="van-cell__left-icon-wrap"
+    custom-class="van-cell__left-icon"
+  />
+  <slot wx:else name="icon" />
+
+  <view
+    style="{{ titleWidth ? 'max-width:' + titleWidth + ';min-width:' + titleWidth : '' }}"
+    class="van-cell__title title-class"
+  >
+    <block wx:if="{{ title }}">{{ title }}</block>
+    <slot wx:else name="title" />
+
+    <view wx:if="{{ label || useLabelSlot }}" class="van-cell__label label-class">
+      <slot wx:if="{{ useLabelSlot }}" name="label" />
+      <block wx:elif="{{ label }}">{{ label }}</block>
+    </view>
+  </view>
+
+  <view class="van-cell__value value-class">
+    <block wx:if="{{ value || value === 0 }}">{{ value }}</block>
+    <slot wx:else />
+  </view>
+
+  <van-icon
+    wx:if="{{ isLink }}"
+    name="{{ arrowDirection ? 'arrow' + '-' + arrowDirection : 'arrow' }}"
+    class="van-cell__right-icon-wrap right-icon-class"
+    custom-class="van-cell__right-icon"
+  />
+  <slot wx:else name="right-icon" />
+
+  <slot name="extra" />
+</view>

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
miniprogram_npm/@vant/weapp/cell/index.wxss


+ 42 - 0
miniprogram_npm/@vant/weapp/checkbox-group/index.js

@@ -0,0 +1,42 @@
+'use strict';
+Object.defineProperty(exports, '__esModule', { value: true });
+var component_1 = require('../common/component');
+component_1.VantComponent({
+  field: true,
+  relation: {
+    name: 'checkbox',
+    type: 'descendant',
+    current: 'checkbox-group',
+    linked: function (target) {
+      this.updateChild(target);
+    },
+  },
+  props: {
+    max: Number,
+    value: {
+      type: Array,
+      observer: 'updateChildren',
+    },
+    disabled: {
+      type: Boolean,
+      observer: 'updateChildren',
+    },
+  },
+  methods: {
+    updateChildren: function () {
+      var _this = this;
+      (this.children || []).forEach(function (child) {
+        return _this.updateChild(child);
+      });
+    },
+    updateChild: function (child) {
+      var _a = this.data,
+        value = _a.value,
+        disabled = _a.disabled;
+      child.setData({
+        value: value.indexOf(child.data.name) !== -1,
+        parentDisabled: disabled,
+      });
+    },
+  },
+});

+ 3 - 0
miniprogram_npm/@vant/weapp/checkbox-group/index.json

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

+ 1 - 0
miniprogram_npm/@vant/weapp/checkbox-group/index.wxml

@@ -0,0 +1 @@
+<slot />

+ 1 - 0
miniprogram_npm/@vant/weapp/checkbox-group/index.wxss

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

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov