Browse Source

商城首页修改

lkg 1 year ago
parent
commit
6160732436
100 changed files with 3366 additions and 620 deletions
  1. 24 15
      components/CommercePart.vue
  2. 95 86
      components/tabbar/tabbar.vue
  3. 17 16
      components/uview-ui/components/u-tabbar-item/u-tabbar-item.vue
  4. 15 9
      main.js
  5. 30 10
      pages.json
  6. 196 238
      pages/home/index.vue
  7. 171 232
      pages/home/index2.vue
  8. 2 2
      pages/mine/index.vue
  9. 11 10
      pages/productCenter/productCenter.vue
  10. 272 0
      pages/productCenter2/filterBar.vue
  11. 161 0
      pages/productCenter2/productCenter.vue
  12. 2 2
      pages/shoppingCart/shoppingCart.vue
  13. BIN
      static/biaoti3.png
  14. BIN
      static/cart-a.png
  15. BIN
      static/cart-b.png
  16. BIN
      static/cart-c.png
  17. BIN
      static/hd-a.png
  18. BIN
      static/hd-b.png
  19. BIN
      static/hdlist1.png
  20. BIN
      static/hdlist2.png
  21. BIN
      static/hdlist3.png
  22. BIN
      static/index-a.png
  23. BIN
      static/index-b.png
  24. BIN
      static/mine-a.png
  25. BIN
      static/mine-b.png
  26. BIN
      static/pd-a.png
  27. BIN
      static/pd-b.png
  28. 1 0
      wxcomponents/vant/dist/action-sheet/index.d.ts
  29. 76 0
      wxcomponents/vant/dist/action-sheet/index.js
  30. 8 0
      wxcomponents/vant/dist/action-sheet/index.json
  31. 70 0
      wxcomponents/vant/dist/action-sheet/index.wxml
  32. 1 0
      wxcomponents/vant/dist/action-sheet/index.wxss
  33. 1 0
      wxcomponents/vant/dist/area/index.d.ts
  34. 224 0
      wxcomponents/vant/dist/area/index.js
  35. 6 0
      wxcomponents/vant/dist/area/index.json
  36. 20 0
      wxcomponents/vant/dist/area/index.wxml
  37. 8 0
      wxcomponents/vant/dist/area/index.wxs
  38. 1 0
      wxcomponents/vant/dist/area/index.wxss
  39. 1 0
      wxcomponents/vant/dist/button/index.d.ts
  40. 65 0
      wxcomponents/vant/dist/button/index.js
  41. 7 0
      wxcomponents/vant/dist/button/index.json
  42. 56 0
      wxcomponents/vant/dist/button/index.wxml
  43. 39 0
      wxcomponents/vant/dist/button/index.wxs
  44. 0 0
      wxcomponents/vant/dist/button/index.wxss
  45. 70 0
      wxcomponents/vant/dist/calendar/calendar.wxml
  46. 1 0
      wxcomponents/vant/dist/calendar/components/header/index.d.ts
  47. 38 0
      wxcomponents/vant/dist/calendar/components/header/index.js
  48. 3 0
      wxcomponents/vant/dist/calendar/components/header/index.json
  49. 18 0
      wxcomponents/vant/dist/calendar/components/header/index.wxml
  50. 1 0
      wxcomponents/vant/dist/calendar/components/header/index.wxss
  51. 6 0
      wxcomponents/vant/dist/calendar/components/month/index.d.ts
  52. 155 0
      wxcomponents/vant/dist/calendar/components/month/index.js
  53. 3 0
      wxcomponents/vant/dist/calendar/components/month/index.json
  54. 40 0
      wxcomponents/vant/dist/calendar/components/month/index.wxml
  55. 71 0
      wxcomponents/vant/dist/calendar/components/month/index.wxs
  56. 0 0
      wxcomponents/vant/dist/calendar/components/month/index.wxss
  57. 1 0
      wxcomponents/vant/dist/calendar/index.d.ts
  58. 366 0
      wxcomponents/vant/dist/calendar/index.js
  59. 10 0
      wxcomponents/vant/dist/calendar/index.json
  60. 27 0
      wxcomponents/vant/dist/calendar/index.wxml
  61. 37 0
      wxcomponents/vant/dist/calendar/index.wxs
  62. 1 0
      wxcomponents/vant/dist/calendar/index.wxss
  63. 23 0
      wxcomponents/vant/dist/calendar/utils.d.ts
  64. 94 0
      wxcomponents/vant/dist/calendar/utils.js
  65. 25 0
      wxcomponents/vant/dist/calendar/utils.wxs
  66. 1 0
      wxcomponents/vant/dist/card/index.d.ts
  67. 50 0
      wxcomponents/vant/dist/card/index.js
  68. 6 0
      wxcomponents/vant/dist/card/index.json
  69. 58 0
      wxcomponents/vant/dist/card/index.wxml
  70. 1 0
      wxcomponents/vant/dist/card/index.wxss
  71. 1 0
      wxcomponents/vant/dist/cascader/index.d.ts
  72. 214 0
      wxcomponents/vant/dist/cascader/index.js
  73. 8 0
      wxcomponents/vant/dist/cascader/index.json
  74. 55 0
      wxcomponents/vant/dist/cascader/index.wxml
  75. 24 0
      wxcomponents/vant/dist/cascader/index.wxs
  76. 1 0
      wxcomponents/vant/dist/cascader/index.wxss
  77. 1 0
      wxcomponents/vant/dist/cell-group/index.d.ts
  78. 12 0
      wxcomponents/vant/dist/cell-group/index.js
  79. 3 0
      wxcomponents/vant/dist/cell-group/index.json
  80. 11 0
      wxcomponents/vant/dist/cell-group/index.wxml
  81. 1 0
      wxcomponents/vant/dist/cell-group/index.wxss
  82. 1 0
      wxcomponents/vant/dist/cell/index.d.ts
  83. 39 0
      wxcomponents/vant/dist/cell/index.js
  84. 6 0
      wxcomponents/vant/dist/cell/index.json
  85. 47 0
      wxcomponents/vant/dist/cell/index.wxml
  86. 17 0
      wxcomponents/vant/dist/cell/index.wxs
  87. 0 0
      wxcomponents/vant/dist/cell/index.wxss
  88. 1 0
      wxcomponents/vant/dist/checkbox-group/index.d.ts
  89. 37 0
      wxcomponents/vant/dist/checkbox-group/index.js
  90. 3 0
      wxcomponents/vant/dist/checkbox-group/index.json
  91. 5 0
      wxcomponents/vant/dist/checkbox-group/index.wxml
  92. 6 0
      wxcomponents/vant/dist/checkbox-group/index.wxss
  93. 1 0
      wxcomponents/vant/dist/checkbox/index.d.ts
  94. 77 0
      wxcomponents/vant/dist/checkbox/index.js
  95. 6 0
      wxcomponents/vant/dist/checkbox/index.json
  96. 31 0
      wxcomponents/vant/dist/checkbox/index.wxml
  97. 20 0
      wxcomponents/vant/dist/checkbox/index.wxs
  98. 1 0
      wxcomponents/vant/dist/checkbox/index.wxss
  99. 6 0
      wxcomponents/vant/dist/circle/canvas.d.ts
  100. 45 0
      wxcomponents/vant/dist/circle/canvas.js

+ 24 - 15
components/CommercePart.vue

@@ -6,19 +6,23 @@
 			</view>
 			<view v-else class="activity-box">
 				<view class="activity-list" v-for="(item, index) in data" :key="index" @click="toDetail(item)">
-					<image style="width: 100%; height: 344rpx; border-radius: 20rpx 20rpx 0 0" :src="item.cover"
-						mode="aspectFill">
-					</image>
+					<image :src="item.cover" mode="aspectFill"
+                 style="width: 100%; height: 330rpx; border-radius: 20rpx 20rpx 0 0">
+          </image>
 					<view class="list-content text-overflow2">
-						<view class="text-overflow-single mb10">{{item.goods_name}}</view>
-						<view class="display-flex-between">
-							<text class="fs13 fw600 color-red">¥{{item.price_selling}}</text>
-							<text class="text-through fs12 color-ca">¥{{item.price_market}}</text>
-						</view>
+            <view class="text-overflow-single mb5 mt10">{{ item.goods_name }}</view>
+            <view class="display-flex-between">
+              <text class="fs13 fw600 list-content-text2" style="color: #C29556;">¥{{ item.price_selling }}</text>
+              <!--							<text class="text-through fs12 color-ca">¥{{item.price_market}}</text>-->
+              <van-image
+                  height="60rpx"
+                  src="/static/cart-c.png"
+                  width="60rpx"
+              />
+            </view>
 					</view>
 				</view>
 				<view style="width: 100%">
-					<!-- <u-loadmore :status="status" @loadmore="loadmoreClick" :load-text="loadText" /> -->
 				</view>
 			</view>
 		</view>
@@ -161,12 +165,17 @@
 				}
 
 				.list-content {
-					color: #2c2c2c;
-					padding: 10rpx 16rpx 0;
-					// display: flex;
-
-				}
+          color: #2c2c2c;
+          padding: 10 rpx 16 rpx 0;
+          // display: flex;
+          .list-content-text2 {
+            font-family: D-DIN, D-DIN;
+            color: #C29556;
+            font-style: normal;
+            text-transform: none;
+          }
+        }
 			}
 		}
 	}
-</style>
+</style>

+ 95 - 86
components/tabbar/tabbar.vue

@@ -1,98 +1,107 @@
 <template>
-	<view>
+  <view>
 
-		<u-tabbar :value="current?current:1" @change="changeTab" :fixed="true" :safeAreaInsetBottom="true"
-			:border="true" :placeholder="true" activeColor="#0BC3AA" inactiveColor="#AAAFC4">
-			<u-tabbar-item v-for="(item,index) in list" :key="index" :name="item.id" :text="item.text">
-				<image class="u-page__item__slot-icon" slot="active-icon" :src="item.selectedIconPath"></image>
-				<image class="u-page__item__slot-icon-index" slot="inactive-icon" :src="item.iconPath"></image>
-			</u-tabbar-item>
-		</u-tabbar>
+    <u-tabbar :border="true" :fixed="true" :placeholder="true" :safeAreaInsetBottom="true"
+              :value="current?current:0" activeColor="#C29556" inactiveColor="#AAAFC4" @change="changeTab">
+      <u-tabbar-item v-for="(item,index) in list" :key="index" :name="item.id" :text="item.text" style="width: 20%">
+        <image slot="active-icon" :src="item.selectedIconPath" class="u-page__item__slot-icon"></image>
+        <image slot="inactive-icon" :src="item.iconPath" class="u-page__item__slot-icon-index"></image>
+      </u-tabbar-item>
+    </u-tabbar>
 
-	</view>
+  </view>
 </template>
 
 <script>
-	export default {
-		name: "tabbar",
-		data() {
-			return {
-				list: [{
-						id: 1,
-						// 图片更换成自己的哈
-						selectedIconPath: "../../static/index-b.png",
-						iconPath: "../../static/index-a.png",
-						text: '首页',
-						pagePath: "pages/home/index"
-					},
-					{
-						id: 2,
-						selectedIconPath: "../../static/pd-b.png",
-						iconPath: "../../static/pd-a.png",
-						text: '产品',
-						pagePath: "pages/productCenter/productCenter"
-					},
-					{
-						id: 3,
-						selectedIconPath: "../../static/cart-b.png",
-						iconPath: "../../static/cart-a.png",
-						text: '购物车',
-						pagePath: "pages/shoppingCart/shoppingCart"
-					},
-					{
-						id: 4,
-						selectedIconPath: "../../static/mine-b.png",
-						iconPath: "../../static/mine-a.png",
-						text: '我的',
-						pagePath: "pages/mine/index"
-					}
-				],
-			};
-		},
-		props: {
-			current: {
-				type: Number,
-				default: 1
-			}
-		},
-		mounted() {
+export default {
+  name: "tabbar",
+  data() {
+    return {
+      list: [{
+        id: 0,
+        // 图片更换成自己的哈
+        selectedIconPath: "../../static/index-b.png",
+        iconPath: "../../static/index-a.png",
+        text: '首页',
+        pagePath: "pages/home/index"
+      },
+        {
+          id: 1,
+          selectedIconPath: "../../static/pd-b.png",
+          iconPath: "../../static/pd-a.png",
+          text: '好物',
+          pagePath: "pages/productCenter/productCenter"
+        },
+        {
+          id: 2,
+          pagePath: "pages/productCenter2/productCenter",
+          text: "活动",
+          iconPath: "../../static/hd-a.png",
+          selectedIconPath: "../../static/hd-b.png"
+        },
+        {
+          id: 3,
+          selectedIconPath: "../../static/cart-b.png",
+          iconPath: "../../static/cart-a.png",
+          text: '购物车',
+          pagePath: "pages/shoppingCart/shoppingCart"
+        },
+        {
+          id: 4,
+          selectedIconPath: "../../static/mine-b.png",
+          iconPath: "../../static/mine-a.png",
+          text: '我的',
+          pagePath: "pages/mine/index"
+        }
+      ],
+    };
+  },
+  props: {
+    current: {
+      type: Number,
+      default: 0
+    }
+  },
+  mounted() {
+    console.log("current==================》", this.current)
 
-			const configs = uni.getStorageSync("configs");
-			console.log("getConfigzj=>", configs);
-			if (configs) {
-				this.list[0].selectedIconPath = configs.menu1_on
-				this.list[0].iconPath = configs.menu1_off
+    // const configs = uni.getStorageSync("configs");
+    // console.log("getConfigzj=>", configs);
+    // if (configs) {
+    //   this.list[0].selectedIconPath = configs.menu1_on
+    //   this.list[0].iconPath = configs.menu1_off
+    //
+    //   this.list[1].selectedIconPath = configs.menu2_on
+    //   this.list[1].iconPath = configs.menu2_off
+    //
+    //   this.list[2].selectedIconPath = configs.menu3_on
+    //   this.list[2].iconPath = configs.menu3_off
+    //
+    //   this.list[3].selectedIconPath = configs.menu4_on
+    //   this.list[3].iconPath = configs.menu4_off
+    // }
+  },
+  methods: {
+    changeTab(e) {
 
-				this.list[1].selectedIconPath = configs.menu2_on
-				this.list[1].iconPath = configs.menu2_off
-
-				this.list[2].selectedIconPath = configs.menu3_on
-				this.list[2].iconPath = configs.menu3_off
-
-				this.list[3].selectedIconPath = configs.menu4_on
-				this.list[3].iconPath = configs.menu4_off
-			}
-		},
-		methods: {
-			changeTab(e) {
-				// 用 switchTab 的前提要在 pages.json中 注册好 tabBar
-				//  可以把 switchTab换成其他的跳转(比如:navigateTo) 不过好像页面会闪一下,建议switchTab  
-				uni.switchTab({
-					url: '/' + this.list[e - 1].pagePath,
-				})
-			}
-		}
-	}
+      // 用 switchTab 的前提要在 pages.json中 注册好 tabBar
+      //  可以把 switchTab换成其他的跳转(比如:navigateTo) 不过好像页面会闪一下,建议switchTab
+      uni.switchTab({
+        url: '/' + this.list[e].pagePath,
+      })
+    }
+  }
+}
 </script>
 
 <style scoped>
-	.u-page__item__slot-icon {
-		width: 21px !important;
-		height: 21px !important;
-	}
+.u-page__item__slot-icon {
+  width: 60 rpx !important;
+  height: 60 rpx !important;
+}
 
-	.u-page__item__slot-icon-index {
-		width: 20px !important;
-		height: 20px !important;
-	}
-</style>
+.u-page__item__slot-icon-index {
+  width: 60 rpx !important;
+  height: 60 rpx !important;
+}
+</style>

+ 17 - 16
components/uview-ui/components/u-tabbar-item/u-tabbar-item.vue

@@ -32,8 +32,8 @@
 	 * @property {String}			text		描述文本
 	 * @property {Object | String}	badgeStyle	控制徽标的位置,对象或者字符串形式,可以设置top和right属性(默认 'top: 6px;right:2px;' )
 	 * @property {Object}			customStyle	定义需要用到的外部样式
-	 * 
-	 * @example <u-tabbar :value="value2" :placeholder="false" @change="name => value2 = name" :fixed="false" :safeAreaInsetBottom="false"><u-tabbar-item text="首页" icon="home" dot ></u-tabbar-item></u-tabbar>
+	 *
+   * @example <u-tabbar :value="value2" :placeholder="false" @change="name => value2 = name" :fixed="false" :safeAreaInsetBottom="false"><u-tabbar-item text="首页" icon="home" dot ></u-tabbar-item></u-tabbar>
 	 */
 	export default {
 		name: 'u-tabbar-item',
@@ -91,21 +91,22 @@
 	@import "../../libs/css/components.scss";
 
 	.u-tabbar-item {
-		@include flex(column);
-		align-items: center;
-		justify-content: center;
-		flex: 1;
+    @include flex(column);
+    align-items: center;
+    justify-content: center;
+    flex: 1;
+    width: 20%;
 
-		&__icon {
-			@include flex;
-			position: relative;
-			width: 192rpx;
-			justify-content: center;
-		}
+    &__icon {
+      @include flex;
+      position: relative;
+      width: 192 rpx;
+      justify-content: center;
+    }
 
-		&__text {
-			margin-top: 2px;
-			font-size: 26rpx;
+    &__text {
+      margin-top: 2px;
+      font-size: 26 rpx;
 			color: $u-content-color;
 		}
 	}
@@ -117,4 +118,4 @@
 	}
 
 	/* #endif */
-</style>
+</style>

+ 15 - 9
main.js

@@ -7,11 +7,6 @@ import $U from 'common/utils/util.js'
 import $C from 'common/utils/config.js'
 import * as api from 'common/api/index.js'
 import moment from 'moment'
-// #ifndef VUE3
-// #ifdef VUE3
-import Vue, {createSSRApp} from 'vue'
-// 解决百度地图跨域问题
-import {VueJsonp} from 'vue-jsonp'
 
 
 Vue.use(uView1)
@@ -26,14 +21,17 @@ Vue.prototype.$U = $U
 Vue.prototype.$C = $C
 Vue.prototype.$moment = moment
 
+// #ifndef VUE3
+import Vue from 'vue'
+
 Vue.config.productionTip = false
 // 工具函数
 Object.keys(tools).forEach(key => {
-	Vue.prototype[`$${key}`] = tools[key]
+    Vue.prototype[`$${key}`] = tools[key]
 })
 
 App.mpType = 'app'
-const app = new Vue({ ...App })
+const app = new Vue({...App})
 app.$mount()
 
 // import BaiduMap from 'vue-baidu-map'
@@ -44,11 +42,19 @@ app.$mount()
 // })
 
 // #endif
+
+// 解决百度地图跨域问题
+import {VueJsonp} from 'vue-jsonp'
+
 Vue.use(VueJsonp)
 
 
+// #ifdef VUE3
+import {createSSRApp} from 'vue'
+
 export function createApp() {
-	const app = createSSRApp(App)
-	return { app }
+    const app = createSSRApp(App)
+    return {app}
 }
+
 // #endif

+ 30 - 10
pages.json

@@ -33,12 +33,14 @@
 			"path": "pages/productCenter/productCenter",
 			"style": {
 				"navigationBarTitleText": "产品中心",
+				"enablePullDownRefresh": false,
+				"navigationStyle": "custom",
 				"app-plus": {
-					// 将回弹属性关掉
 					"bounce": "none"
 				}
 			}
 		},
+
 		{
 			"path": "pages/shoppingCart/shoppingCart",
 			"style": {
@@ -46,11 +48,10 @@
 				"enablePullDownRefresh": false
 			}
 		},
-
 		{
-			"path": "pages/searchList/index",
+			"path": "pages/mine/index",
 			"style": {
-				"navigationBarTitleText": "搜索",
+				"navigationBarTitleText": "我的",
 				"enablePullDownRefresh": false,
 				"navigationStyle": "custom",
 				"app-plus": {
@@ -60,9 +61,21 @@
 			}
 		},
 		{
-			"path": "pages/mine/index",
+			"path": "pages/productCenter2/productCenter",
 			"style": {
-				"navigationBarTitleText": "我的",
+				"navigationBarTitleText": "活动",
+				"enablePullDownRefresh": false,
+				"navigationStyle": "custom",
+				"app-plus": {
+					// 将回弹属性关掉
+					"bounce": "none"
+				}
+			}
+		},
+		{
+			"path": "pages/searchList/index",
+			"style": {
+				"navigationBarTitleText": "搜索",
 				"enablePullDownRefresh": false,
 				"navigationStyle": "custom",
 				"app-plus": {
@@ -71,7 +84,6 @@
 				}
 			}
 		},
-
 		{
 			"path": "pages/singlePage/index",
 			"style": {
@@ -417,14 +429,15 @@
 	"tabBar": {
 		"custom": true,
 		"color": "#AAAFC4",
-		"selectedColor": "#0BC3AA",
+		"selectedColor": "#C29556",
 		"borderStyle": "white",
 		"backgroundColor": "#ffffff",
 		"height": "64px",
 		"fontSize": "13px",
 		"iconWidth": "48rpx",
 		"spacing": "2px",
-		"list": [{
+		"list": [
+			{
 				"pagePath": "pages/home/index",
 				"text": "首页",
 				"iconPath": "static/index-a.png",
@@ -432,10 +445,16 @@
 			},
 			{
 				"pagePath": "pages/productCenter/productCenter",
-				"text": "产品",
+				"text": "好物",
 				"iconPath": "static/pd-a.png",
 				"selectedIconPath": "static/pd-b.png"
 			},
+			{
+				"pagePath": "pages/productCenter2/productCenter",
+				"text": "活动",
+				"iconPath": "static/hd-a.png",
+				"selectedIconPath": "static/hd-b.png"
+			},
 			{
 				"pagePath": "pages/shoppingCart/shoppingCart",
 				"text": "购物车",
@@ -462,6 +481,7 @@
 			"van-row": "/wxcomponents/vant/dist/row/index",
 			"van-col": "/wxcomponents/vant/dist/col/index",
 			"van-tabs": "/wxcomponents/vant/dist/tabs/index",
+			"van-toast": "/wxcomponents/vant/dist/toast/index",
 			"van-image": "/wxcomponents/vant/dist/image/index"
 			// 其他需要全局引入的组件
 		}

+ 196 - 238
pages/home/index.vue

@@ -7,7 +7,6 @@
       }" class="header-box">
       <view>
         <view :height=" '1225rpx'" class="banner-container">
-          <!-- <u-swiper height="340" border-radius="0" :list="bannerList"></u-swiper> mpCommonClass=='mp-common3' ? '46vw':-->
           <u-swiper :autoplay="true" :current="current" :height=" '1225rpx'" :list="bannerList" circular
                     duration="1000" interval="5000" @change="(data) => (current = data.current)" @click="bannerClick">
             <template #indicator>
@@ -22,12 +21,12 @@
               <van-image
                   :src="logoImg"
                   fit="contain"
-                  height="16px"
+                  height="20px"
                   width="83px"
               />
             </view>
             <view :style="{
-                width: '100%',
+                width: '75%',
                 height: '100%',
              }" class="search-box" @click="toSearchList">
               <u-icon name="search" size="20"></u-icon>
@@ -37,7 +36,7 @@
         </view>
         <!-- 商品分类 -->
         <view class="goods-list">
-          <view class="goods-list-item" @click="">
+          <view class="goods-list-item" @click="jumpPage('haowu')">
             <van-image
                 height="136rpx"
                 src="/static/hd1.png"
@@ -45,7 +44,7 @@
             />
             <view style=" margin-top: 14rpx">芳香好物</view>
           </view>
-          <view class="goods-list-item" @click="">
+          <view class="goods-list-item" @click="jumpPage()">
             <van-image
                 height="136rpx"
                 src="/static/hd2.png"
@@ -54,7 +53,7 @@
             <view style=" margin-top: 14rpx"> 芳香学院</view>
           </view>
 
-          <view class="goods-list-item" @click="">
+          <view class="goods-list-item" @click="jumpPage()">
             <van-image
                 height="136rpx"
                 src="/static/hd3.png"
@@ -63,7 +62,7 @@
             <view style=" margin-top: 14rpx"> 芳香活动</view>
           </view>
 
-          <view class="goods-list-item" @click="">
+          <view class="goods-list-item" @click="jumpPage()">
             <van-image
                 height="136rpx"
                 src="/static/hd5.png"
@@ -73,7 +72,7 @@
             </view>
           </view>
 
-          <view class="goods-list-item" @click="">
+          <view class="goods-list-item" @click="jumpPage()">
             <van-image
                 height="136rpx"
                 src="/static/hd4.png"
@@ -83,46 +82,116 @@
             <view style=" margin-top: 14rpx">陪伴营</view>
           </view>
         </view>
-        <view :style=" {width: '100%',
-    height: '180rpx',
-    display: 'flex',
-    justifyContent: 'center',
-    alignItems: 'center' }">
+        <view class="biaoti">
           <van-image
               height="85.94rpx"
               src="/static/biaoti1.png"
               width="171.3rpx"
           />
         </view>
-        <view
-            :style="{width: '100%', height: '378rpx' ,borderRadius: '24rpx 24rpx 0rpx 0rpx',backgroundColor: '#F2FAF2'}">
-        </view>
         <view class="content-box">
+          <view :style="{width: '95%', margin: '0rpx auto', height: '378rpx' ,borderRadius: '24rpx 24rpx 24rpx 24rpx',backgroundColor: '#F2FAF2'}"
+                @click="toHuodong()">
+            <van-image
+                height="280rpx"
+                src="/static/hdlist1.png"
+                width="100%"
+            />
+            <view>
+              <van-row>
+                <van-col span="16">
+                  <view class="huodongText">
+                    芬芳小溪-健康生活态游园会
+                  </view>
+                </van-col>
+                <van-col span="8">
+                  <van-row>
+                    <van-col span="12">
+                      <view class="huodongText2">
+                        <van-image
+                            class="huodongText2-img"
+                            height="28rpx"
+                            src="/static/hdlist2.png" width="28rpx"
+                        />
+                        500
+                      </view>
+                    </van-col>
+                    <van-col span="12">
+                      <view class="huodongText2">
+                        <van-image
+                            class="huodongText2-img"
+                            height="28rpx"
+                            src="/static/hdlist3.png" width="28rpx"
+                        />
+                        160
+                      </view>
+                    </van-col>
+                  </van-row>
+                </van-col>
+              </van-row>
 
-          <!-- 爆款推荐 -->
-          <view class="mb10 mt10">
-            <image :src="`${imageUrl}/zx_icon.png`" mode="heightFix" style="width: 133rpx; height: 48rpx">
+            </view>
+          </view>
+          <view class="biaoti">
+            <van-image
+                height="85.94rpx"
+                src="/static/biaoti2.png"
+                width="171.3rpx"
+            />
+          </view>
+          <view
+              :style="{width: '95%', margin: '0rpx auto'}">
+            <view style="width: 100%;">
+
+              <view v-for="(item, index) in goods_class" :key="index">
+                <view style="margin-bottom: 24rpx" @click="toKecheng(item)">
+                  <van-image
+                      :src="item.cover"
+                      height="200rpx"
+                      width="100%"
+                  />
+                </view>
+              </view>
+            </view>
+          </view>
+          <view class="biaoti">
+            <van-image
+                height="85.94rpx"
+                src="/static/biaoti3.png"
+                width="171.3rpx"
+            />
+          </view>
+          <view
+              :style="{width: '95%', margin: '0rpx auto'}">
+            <CommercePart :data="commonDataList"></CommercePart>
+            <!-- 赠品专区 -->
+            <image v-if="giftBanner.pic" :src="giftBanner.pic" mode="aspectFill"
+                   style="width: 100%; height: 206rpx" @click="toSubpages('giftZone')">
             </image>
           </view>
-          <CommercePart :data="commonDataList"></CommercePart>
-          <!-- 赠品专区 -->
-          <image v-if="giftBanner.pic" :src="giftBanner.pic" mode="aspectFill"
-                 style="width: 100%; height: 206rpx" @click="toSubpages('giftZone')">
-          </image>
         </view>
       </view>
     </view>
-    <tabbarCom :current="1"></tabbarCom>
+    <tabbarCom current="0"></tabbarCom>
+    <van-toast id="van-toast"/>
   </view>
+
 </template>
 
 <script>
 import tabbarCom from "@/components/tabbar/tabbar.vue"
 import CommercePart from "@/components/CommercePart.vue";
 // import FlowPart from "@/components/FlowPart.vue";
-import {goodsList} from "./config";
-import {getBanner} from "@/common/api/home.js";
-import {getNewsList} from "@/common/api/news.js";
+import {
+  goodsList
+} from "./config";
+import {
+  getBanner
+} from "@/common/api/home.js";
+import {
+  getNewsList
+} from "@/common/api/news.js";
+import Toast from "wxcomponents/vant/dist/toast/toast";
 // 获取系统状态栏的高度
 let systemInfo = uni.getSystemInfoSync();
 let menuButtonInfo = {};
@@ -190,7 +259,7 @@ export default {
       },
       prevData: [],
       advList: [],
-      goods_hot: [],
+      goods_class: [],
       sourceBanner: []
     };
   },
@@ -330,6 +399,23 @@ export default {
         });
       }
     },
+
+    jumpPage(type) {
+      if (type == "haowu") {
+        uni.switchTab({
+          url: '/pages/productCenter/productCenter',
+        })
+      } else {
+        Toast('敬请期待');
+      }
+    },
+
+    toHuodong(type) {
+      Toast('敬请期待');
+    },
+    toKecheng(type) {
+      Toast('敬请期待');
+    },
     bannerClick(index) {
       const currentUrl = this.sourceBanner[index].pic_url
       if (currentUrl != '#') {
@@ -342,9 +428,9 @@ export default {
       getBanner().then((res) => {
         const {
           slider = [],
-          goods_hot = [],
+          goods_class = [],
           goods_cate = [],
-          goods_new = [],
+          goods_online = [],
           seckill_goods = [],
           integral_page = [],
           gifts_page = [],
@@ -353,8 +439,8 @@ export default {
           shop_share_img,
           shop_bgimg
         } = res.data;
+
         const configs = uni.getStorageSync("configs");
-        console.log("getConfigzj=>", configs);
         if (configs) {
           this.logoImg = configs.shop_logo
           this.bgImg = configs.shop_bgimg
@@ -368,11 +454,10 @@ export default {
         }
         this.bannerList = slider.map(item => item.pic);
         this.sourceBanner = slider
-        console.log(23333, this.bannerList)
         this.goodsList = goods_cate;
-        this.commonDataList = goods_new;
+        this.commonDataList = goods_online;
         this.msGoodsList = seckill_goods;
-        this.goods_hot = goods_hot;
+        this.goods_class = goods_class;
         this.ponitsBanner = integral_page.length && integral_page[0];
         this.giftBanner = gifts_page.length && gifts_page[0];
         uni.setStorageSync('mpInfo', {
@@ -558,38 +643,14 @@ export default {
     }
   }
 
-  .banner-container {
-    position: relative;
-    width: 100%;
-  }
-
-  .logo-search-container {
-    position: absolute;
-    top: 59px;
-    left: 0;
-    width: 100%;
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    padding: 0 20 rpx;
-    box-sizing: border-box;
-  }
-
-  .centered-image {
-    display: flex;
-    justify-content: center;
-    align-items: center;
-    height: 61 rpx;
-  }
-
   .custom-indicator {
     position: absolute;
     left: 0 rpx;
     right: 0 rpx;
     bottom: 29 rpx;
     width: 712 rpx;
-    // margin-right: 24rpx;
     display: flex;
+    margin: 0 20 rpx 0 20 rpx;
     flex-direction: row;
     justify-content: center;
     transform: translateX(-48rpx);
@@ -599,15 +660,16 @@ export default {
       height: 16 rpx;
       margin: 0 6 rpx;
       border-radius: 12 rpx;
-      background: #666666;
+      background-color: #666666;
     }
 
     .banner-active {
       width: 48 rpx;
-      background: #222222;
+      background-color: #222222;
     }
   }
 
+
   .slot-wrap {
     background-color: red;
   }
@@ -639,180 +701,55 @@ export default {
         }
       }
     }
+  }
 
-    .newset-box {
-      background: transparent;
-    }
+  .header-box {
+    width: 100%;
 
-    .rmsp {
+    .banner-container {
+      position: relative;
       width: 100%;
-      display: flex;
-      flex-direction: column;
-      border-radius: 16 rpx;
-      background: #FFFFFF;
 
-      .rmsp-title-box {
-        display: flex;
+      .logo-search-container {
+        position: absolute;
+        top: 12%;
+        left: 0;
         width: 100%;
-        margin-top: 20 rpx;
-        flex-direction: row;
+        display: flex;
+        justify-content: space-between;
         align-items: center;
-
-        .red-tag {
-          margin-left: 16 rpx;
-          background: linear-gradient(285deg, #FF424F -1%, #FF6973 100%);
-          color: #FFFFFF;
-          padding: 2 rpx 6 rpx;
-          font-size: 20 rpx;
-          white-space: nowrap;
-          border-radius: 4 rpx;
-          overflow: hidden;
-        }
-
-        .more-btn {
-          padding-right: 32 rpx;
-          font-size: 24 rpx;
-          color: #6C6970;
-        }
-      }
-
-      .rm-sv {
-        white-space: nowrap;
-        margin-top: 22 rpx;
-        width: calc(100% - 50rpx);
-        margin-left: 15 rpx;
-
-        .sp-box {
-          display: inline-block;
+        padding: 0 20 rpx;
+        box-sizing: border-box;
+
+        .search-box {
+          margin: 0 auto 0 rpx;
+          height: 61 rpx;
+          background: rgba(255, 255, 255, 0.3);
+          border-radius: 30 rpx;
+          opacity: 1;
           display: flex;
+          align-items: center;
           flex-direction: row;
-          flex-wrap: nowrap;
-
-          .rm-sp-item {
-            margin-left: 25 rpx;
-            width: 196 rpx;
-            display: flex;
-            flex-direction: column;
 
-            &:active {
-              opacity: 0.7;
-            }
-
-            .rm-title {
-              margin-top: 16 rpx;
-              font-size: 24 rpx;
-              display: -webkit-box;
-              -webkit-box-orient: vertical;
-              overflow: hidden;
-              white-space: pre-wrap;
-              text-overflow: ellipsis;
-              -webkit-line-clamp: 2;
-              /* 这里的数字表示你想显示的行数 */
-              // line-height: 1.2;
-              /* 调整行高以匹配你的字体和设计 */
-              height: calc(1.2em * 2);
-              /* 行高乘以行数 */
-            }
-
-
-            .rm-price {
-              margin-top: 10 rpx;
-              margin-bottom: 30 rpx;
-              width: 196 rpx;
-              font-size: 32 rpx;
-              color: #FF424F;
-            }
+          text {
+            font-size: 24 rpx;
+            font-family: PingFang SC-Regular, PingFang SC;
+            font-weight: 400;
+            color: #9D9D9D;
+            line-height: 61 rpx;
+            margin-left: 11 rpx;
           }
         }
       }
 
-    }
-
-    .tjsp {
-      width: 100%;
-      display: flex;
-      flex-direction: column;
-
-      .tjsp-item {
-        width: 100%;
-        border-radius: 16 rpx;
-        background: #FFFFFF;
-        margin-top: 20 rpx;
-        position: relative;
-        display: flex;
-        flex-direction: row;
-
-        &:active {
-          opacity: 0.7;
-        }
-      }
-
-      .tjsp-item-content {
+      .centered-image {
         display: flex;
-        margin-right: 20 rpx;
-        flex: 1;
-        flex-direction: column;
-
-        .tjsp-title {
-          margin-top: 20 rpx;
-          font-size: 28 rpx;
-          color: #3E3D44;
-          display: -webkit-box;
-          -webkit-box-orient: vertical;
-          overflow: hidden;
-          white-space: pre-wrap;
-          text-overflow: ellipsis;
-          -webkit-line-clamp: 1;
-        }
-
-        .tjsp-remark {
-          width: fit-content;
-          margin-top: 20 rpx;
-          font-size: 20 rpx;
-          display: -webkit-box;
-          -webkit-box-orient: vertical;
-          border-radius: 8 rpx;
-          overflow: hidden;
-          white-space: pre-wrap;
-          padding: 0 10 rpx;
-          text-overflow: ellipsis;
-          -webkit-line-clamp: 1;
-        }
-
-        .tjsp-remark1 {
-          color: #1AC77F;
-          background: #E7FCF3;
-        }
-
-        .tjsp-remark2 {
-          color: #D18D3F;
-          background: #FFF8EF;
-        }
-      }
-
-      .tjsp-price {
-        font-size: 32 rpx;
-        position: absolute;
-        left: 200 rpx;
-        bottom: 20 rpx;
+        justify-content: center;
+        align-items: center;
+        height: 61 rpx;
       }
     }
 
-  }
-
-  .header-box {
-    width: 100%;
-
-    .qr-code {
-      padding: 0 20 rpx;
-      font-size: 34 rpx;
-      font-weight: 700;
-      display: flex;
-      justify-content: space-between;
-      align-items: center;
-      font-style: italic;
-    }
-
     .content {
       width: 100%;
       z-index: 50;
@@ -836,8 +773,6 @@ export default {
     }
   }
 
-  .mp-common3 {
-  }
 
   .goods-list {
     display: flex;
@@ -856,26 +791,49 @@ export default {
       font-size: 26 rpx;
     }
   }
-}
 
-.search-box {
-  margin: 0 auto 0 rpx;
-  height: 61 rpx;
-  background: rgba(255, 255, 255, 0.3);
-  border-radius: 30 rpx;
-  opacity: 1;
-  display: flex;
-  align-items: center;
-  flex-direction: row;
-
-  text {
-    font-size: 24 rpx;
-    font-family: PingFang SC-Regular, PingFang SC;
+  .biaoti {
+    width: 100%;
+    height: 180 rpx;
+    display: flex;
+    justify-content: center;
+    align-items: center
+  }
+
+  .huodongText {
+    font-family: PingFang SC, PingFang SC;
+    font-weight: 400;
+    font-size: 26 rpx;
+    color: #333333;
+    line-height: 36 rpx; // 修正拼写错误
+    text-align: left; // 如果需要水平居中,可以改为 'center'
+    font-style: normal;
+    text-transform: none;
+    height: 98 rpx;
+    display: flex; // 添加 flex 布局
+    align-items: center; // 垂直居中
+    margin-left: 30 rpx; // 添加左边距
+  }
+
+  .huodongText2 {
+    font-family: PingFang SC, PingFang SC;
     font-weight: 400;
-    color: #9D9D9D;
-    line-height: 61 rpx;
-    margin-left: 11 rpx;
+    font-size: 20 rpx;
+    color: #666666;
+    height: 98 rpx;
+    line-height: 28 rpx;
+    text-align: left;
+    font-style: normal;
+    display: flex; // 添加 flex 布局
+    align-items: center; // 垂直居中
+    text-transform: none;
+
+    .huodongText2-img {
+      margin-right: 15 rpx;
+      margin-left: 15 rpx
+    }
   }
+
 }
 </style>
 

+ 171 - 232
pages/home/index2.vue

@@ -7,7 +7,6 @@
       }" class="header-box">
       <view>
         <view :height=" '1225rpx'" class="banner-container">
-          <!-- <u-swiper height="340" border-radius="0" :list="bannerList"></u-swiper> mpCommonClass=='mp-common3' ? '46vw':-->
           <u-swiper :autoplay="true" :current="current" :height=" '1225rpx'" :list="bannerList" circular
                     duration="1000" interval="5000" @change="(data) => (current = data.current)" @click="bannerClick">
             <template #indicator>
@@ -79,49 +78,124 @@
                 src="/static/hd4.png"
                 width="84rpx"
             />
+
             <view style=" margin-top: 14rpx">陪伴营</view>
           </view>
         </view>
+        <view class="biaoti">
+          <van-image
+              height="85.94rpx"
+              src="/static/biaoti1.png"
+              width="171.3rpx"
+          />
+        </view>
+
+
         <view class="content-box">
-          <view :style=" {width: '100%',
-    height: '180rpx',
-    display: 'flex',
-    justifyContent: 'center',
-    alignItems: 'center' }" class="biaoti">
+          <view
+              :style="{width: '95%', margin: '0rpx auto', height: '378rpx' ,borderRadius: '24rpx 24rpx 24rpx 24rpx',backgroundColor: '#F2FAF2'}">
+            <van-image
+                height="280rpx"
+                src="/static/hdlist1.png"
+                width="100%"
+            />
+            <view>
+              <van-row>
+                <van-col span="16">
+                  <view class="huodongText">
+                    芬芳小溪-健康生活态游园会
+                  </view>
+                </van-col>
+                <van-col span="8">
+                  <van-row>
+                    <van-col span="12">
+                      <view class="huodongText2">
+                        <van-image
+                            class="huodongText2-img"
+                            height="28rpx"
+                            src="/static/hdlist2.png" width="28rpx"
+                        />
+                        500
+                      </view>
+                    </van-col>
+                    <van-col span="12">
+                      <view class="huodongText2">
+                        <van-image
+                            class="huodongText2-img"
+                            height="28rpx"
+                            src="/static/hdlist3.png" width="28rpx"
+                        />
+                        160
+                      </view>
+                    </van-col>
+                  </van-row>
+                </van-col>
+              </van-row>
+
+            </view>
+          </view>
+          <view class="biaoti">
             <van-image
                 height="85.94rpx"
-                src="/static/biaoti1.png"
+                src="/static/biaoti2.png"
                 width="171.3rpx"
             />
           </view>
           <view
-              :style="{width: '100%', height: '378rpx' ,borderRadius: '24rpx 24rpx 0rpx 0rpx',backgroundColor: '#F2FAF2'}">
+              :style="{width: '95%', margin: '0rpx auto'}">
+            <view style="width: 100%;">
+              <view style="margin-bottom: 24rpx">
+                <van-image
+                    height="200rpx"
+                    src="/static/kecheng1.png"
+                    width="100%"
+                />
+              </view>
+              <view style="margin-bottom: 24rpx">
+                <van-image
+                    height="200rpx"
+                    src="/static/kecheng2.png"
+                    width="100%"
+                />
+              </view>
+            </view>
           </view>
-
-          <!-- 爆款推荐 -->
-          <view class="mb10 mt10">
-            <image :src="`${imageUrl}/zx_icon.png`" mode="heightFix" style="width: 133rpx; height: 48rpx">
+          <view class="biaoti">
+            <van-image
+                height="85.94rpx"
+                src="/static/biaoti3.png"
+                width="171.3rpx"
+            />
+          </view>
+          <view
+              :style="{width: '95%', margin: '0rpx auto'}">
+            <CommercePart :data="commonDataList"></CommercePart>
+            <!-- 赠品专区 -->
+            <image v-if="giftBanner.pic" :src="giftBanner.pic" mode="aspectFill"
+                   style="width: 100%; height: 206rpx" @click="toSubpages('giftZone')">
             </image>
           </view>
-          <CommercePart :data="commonDataList"></CommercePart>
-          <!-- 赠品专区 -->
-          <image v-if="giftBanner.pic" :src="giftBanner.pic" mode="aspectFill"
-                 style="width: 100%; height: 206rpx" @click="toSubpages('giftZone')">
-          </image>
         </view>
       </view>
     </view>
-    <tabbarCom :current="1"></tabbarCom>
+    <tabbarCom current="0"></tabbarCom>
   </view>
+
 </template>
 
 <script>
 import tabbarCom from "@/components/tabbar/tabbar.vue"
 import CommercePart from "@/components/CommercePart.vue";
 // import FlowPart from "@/components/FlowPart.vue";
-import {goodsList} from "./config";
-import {getBanner} from "@/common/api/home.js";
-import {getNewsList} from "@/common/api/news.js";
+import {
+  goodsList
+} from "./config";
+import {
+  getBanner
+} from "@/common/api/home.js";
+import {
+  getNewsList
+} from "@/common/api/news.js";
 // 获取系统状态栏的高度
 let systemInfo = uni.getSystemInfoSync();
 let menuButtonInfo = {};
@@ -557,38 +631,14 @@ export default {
     }
   }
 
-  .banner-container {
-    position: relative;
-    width: 100%;
-  }
-
-  .logo-search-container {
-    position: absolute;
-    top: 59px;
-    left: 0;
-    width: 100%;
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    padding: 0 20 rpx;
-    box-sizing: border-box;
-  }
-
-  .centered-image {
-    display: flex;
-    justify-content: center;
-    align-items: center;
-    height: 61 rpx;
-  }
-
   .custom-indicator {
     position: absolute;
     left: 0 rpx;
     right: 0 rpx;
     bottom: 29 rpx;
     width: 712 rpx;
-    // margin-right: 24rpx;
     display: flex;
+    margin: 0 20 rpx 0 20 rpx;
     flex-direction: row;
     justify-content: center;
     transform: translateX(-48rpx);
@@ -598,15 +648,16 @@ export default {
       height: 16 rpx;
       margin: 0 6 rpx;
       border-radius: 12 rpx;
-      background: #666666;
+      background-color: #666666;
     }
 
     .banner-active {
       width: 48 rpx;
-      background: #222222;
+      background-color: #222222;
     }
   }
 
+
   .slot-wrap {
     background-color: red;
   }
@@ -638,188 +689,55 @@ export default {
         }
       }
     }
+  }
 
-    .newset-box {
-      background: transparent;
-    }
-
-    .biaoti {
-      width: 100%;
-      height: 180 rpx;
-      display: flex;
-      justifyContent: 'center';
-      alignItems: 'center'
-    }
+  .header-box {
+    width: 100%;
 
-    .rmsp {
+    .banner-container {
+      position: relative;
       width: 100%;
-      display: flex;
-      flex-direction: column;
-      border-radius: 16 rpx;
-      background: #FFFFFF;
 
-      .rmsp-title-box {
-        display: flex;
+      .logo-search-container {
+        position: absolute;
+        top: 59px;
+        left: 0;
         width: 100%;
-        margin-top: 20 rpx;
-        flex-direction: row;
+        display: flex;
+        justify-content: space-between;
         align-items: center;
-
-        .red-tag {
-          margin-left: 16 rpx;
-          background: linear-gradient(285deg, #FF424F -1%, #FF6973 100%);
-          color: #FFFFFF;
-          padding: 2 rpx 6 rpx;
-          font-size: 20 rpx;
-          white-space: nowrap;
-          border-radius: 4 rpx;
-          overflow: hidden;
-        }
-
-        .more-btn {
-          padding-right: 32 rpx;
-          font-size: 24 rpx;
-          color: #6C6970;
-        }
-      }
-
-      .rm-sv {
-        white-space: nowrap;
-        margin-top: 22 rpx;
-        width: calc(100% - 50rpx);
-        margin-left: 15 rpx;
-
-        .sp-box {
-          display: inline-block;
+        padding: 0 20 rpx;
+        box-sizing: border-box;
+
+        .search-box {
+          margin: 0 auto 0 rpx;
+          height: 61 rpx;
+          background: rgba(255, 255, 255, 0.3);
+          border-radius: 30 rpx;
+          opacity: 1;
           display: flex;
+          align-items: center;
           flex-direction: row;
-          flex-wrap: nowrap;
-
-          .rm-sp-item {
-            margin-left: 25 rpx;
-            width: 196 rpx;
-            display: flex;
-            flex-direction: column;
 
-            &:active {
-              opacity: 0.7;
-            }
-
-            .rm-title {
-              margin-top: 16 rpx;
-              font-size: 24 rpx;
-              display: -webkit-box;
-              -webkit-box-orient: vertical;
-              overflow: hidden;
-              white-space: pre-wrap;
-              text-overflow: ellipsis;
-              -webkit-line-clamp: 2;
-              /* 这里的数字表示你想显示的行数 */
-              // line-height: 1.2;
-              /* 调整行高以匹配你的字体和设计 */
-              height: calc(1.2em * 2);
-              /* 行高乘以行数 */
-            }
-
-
-            .rm-price {
-              margin-top: 10 rpx;
-              margin-bottom: 30 rpx;
-              width: 196 rpx;
-              font-size: 32 rpx;
-              color: #FF424F;
-            }
+          text {
+            font-size: 24 rpx;
+            font-family: PingFang SC-Regular, PingFang SC;
+            font-weight: 400;
+            color: #9D9D9D;
+            line-height: 61 rpx;
+            margin-left: 11 rpx;
           }
         }
       }
 
-    }
-
-    .tjsp {
-      width: 100%;
-      display: flex;
-      flex-direction: column;
-
-      .tjsp-item {
-        width: 100%;
-        border-radius: 16 rpx;
-        background: #FFFFFF;
-        margin-top: 20 rpx;
-        position: relative;
-        display: flex;
-        flex-direction: row;
-
-        &:active {
-          opacity: 0.7;
-        }
-      }
-
-      .tjsp-item-content {
+      .centered-image {
         display: flex;
-        margin-right: 20 rpx;
-        flex: 1;
-        flex-direction: column;
-
-        .tjsp-title {
-          margin-top: 20 rpx;
-          font-size: 28 rpx;
-          color: #3E3D44;
-          display: -webkit-box;
-          -webkit-box-orient: vertical;
-          overflow: hidden;
-          white-space: pre-wrap;
-          text-overflow: ellipsis;
-          -webkit-line-clamp: 1;
-        }
-
-        .tjsp-remark {
-          width: fit-content;
-          margin-top: 20 rpx;
-          font-size: 20 rpx;
-          display: -webkit-box;
-          -webkit-box-orient: vertical;
-          border-radius: 8 rpx;
-          overflow: hidden;
-          white-space: pre-wrap;
-          padding: 0 10 rpx;
-          text-overflow: ellipsis;
-          -webkit-line-clamp: 1;
-        }
-
-        .tjsp-remark1 {
-          color: #1AC77F;
-          background: #E7FCF3;
-        }
-
-        .tjsp-remark2 {
-          color: #D18D3F;
-          background: #FFF8EF;
-        }
-      }
-
-      .tjsp-price {
-        font-size: 32 rpx;
-        position: absolute;
-        left: 200 rpx;
-        bottom: 20 rpx;
+        justify-content: center;
+        align-items: center;
+        height: 61 rpx;
       }
     }
 
-  }
-
-  .header-box {
-    width: 100%;
-
-    .qr-code {
-      padding: 0 20 rpx;
-      font-size: 34 rpx;
-      font-weight: 700;
-      display: flex;
-      justify-content: space-between;
-      align-items: center;
-      font-style: italic;
-    }
-
     .content {
       width: 100%;
       z-index: 50;
@@ -843,8 +761,6 @@ export default {
     }
   }
 
-  .mp-common3 {
-  }
 
   .goods-list {
     display: flex;
@@ -863,26 +779,49 @@ export default {
       font-size: 26 rpx;
     }
   }
-}
 
-.search-box {
-  margin: 0 auto 0 rpx;
-  height: 61 rpx;
-  background: rgba(255, 255, 255, 0.3);
-  border-radius: 30 rpx;
-  opacity: 1;
-  display: flex;
-  align-items: center;
-  flex-direction: row;
-
-  text {
-    font-size: 24 rpx;
-    font-family: PingFang SC-Regular, PingFang SC;
+  .biaoti {
+    width: 100%;
+    height: 180 rpx;
+    display: flex;
+    justify-content: center;
+    align-items: center
+  }
+
+  .huodongText {
+    font-family: PingFang SC, PingFang SC;
+    font-weight: 400;
+    font-size: 26 rpx;
+    color: #333333;
+    line-height: 36 rpx; // 修正拼写错误
+    text-align: left; // 如果需要水平居中,可以改为 'center'
+    font-style: normal;
+    text-transform: none;
+    height: 98 rpx;
+    display: flex; // 添加 flex 布局
+    align-items: center; // 垂直居中
+    margin-left: 30 rpx; // 添加左边距
+  }
+
+  .huodongText2 {
+    font-family: PingFang SC, PingFang SC;
     font-weight: 400;
-    color: #9D9D9D;
-    line-height: 61 rpx;
-    margin-left: 11 rpx;
+    font-size: 20 rpx;
+    color: #666666;
+    height: 98 rpx;
+    line-height: 28 rpx;
+    text-align: left;
+    font-style: normal;
+    display: flex; // 添加 flex 布局
+    align-items: center; // 垂直居中
+    text-transform: none;
+
+    .huodongText2-img {
+      margin-right: 15 rpx;
+      margin-left: 15 rpx
+    }
   }
+
 }
 </style>
 

+ 2 - 2
pages/mine/index.vue

@@ -128,7 +128,7 @@
 			</form>
 		</u-popup>
 
-		<tabbarCom :current="4"></tabbarCom>
+		<tabbarCom current="4"></tabbarCom>
 	</view>
 </template>
 
@@ -1112,4 +1112,4 @@
 			}
 		}
 	}
-</style>
+</style>

+ 11 - 10
pages/productCenter/productCenter.vue

@@ -1,14 +1,14 @@
 <template>
 	<view class="common-page">
 		<!-- <view class="search-box" @click="toSearchList">
-			
+
     </view> -->
 		<u-search v-model="search" bgColor="#fff" placeholder="请输入关键词"></u-search>
 		<FilterBar :currentCateId="cateid" @change="handleFilter" />
 		<view class="list-box">
 			<CommercePart :data="data"></CommercePart>
 		</view>
-		<tabbarCom :current="2"></tabbarCom>
+		<tabbarCom current="1"></tabbarCom>
 	</view>
 </template>
 
@@ -120,13 +120,14 @@
 					this.data = []
 				}
 				let params = {
-					cateid: this.cateid && this.subCateId ? this.subCateId : this.cateid,
-					sort: this.sort,
-					sortType: this.sortType,
-					page: this.page,
-					pageSize: this.pageSize,
-					name: this.search,
-				}
+          cateid: this.cateid && this.subCateId ? this.subCateId : this.cateid,
+          sort: this.sort,
+          sortType: this.sortType,
+          goods_kind: "线上商品",
+          page: this.page,
+          pageSize: this.pageSize,
+          name: this.search,
+        }
 				getGoodList(params).then(({
 					data = {}
 				}) => {
@@ -156,4 +157,4 @@
 		height: 100vh;
 		background-color: $primary-bg-color;
 	}
-</style>
+</style>

+ 272 - 0
pages/productCenter2/filterBar.vue

@@ -0,0 +1,272 @@
+<template>
+  <view class="filterbar-box">
+    <view class="filterbar">
+      <view v-for="item in filterList" :key="item.type" :class="[
+		      'item',
+		      item.type,
+		      {
+		        active:
+		          selectType === item.type || (item.type === 'classify' && cateValue),
+		      },
+		    ]" @click="handleFilter(item)">
+        <view class="name">
+          {{ item.name }}
+        </view>
+        <u-icon v-if="item.type === 'classify'" color="#767676" name="grid"></u-icon>
+        <view v-if="item.type === 'price'" class="price-icon">
+          <u-icon :color="
+		          selectType === 'price' && priceType === 'asc' ? '#000' : '#767676'
+		        " :size="7" name="arrow-up-fill"></u-icon>
+          <u-icon :color="
+		          selectType === 'price' && priceType === 'desc' ? '#000' : '#767676'
+		        " :size="7" name="arrow-down-fill"></u-icon>
+        </view>
+      </view>
+      <view v-show="showCatePop" class="mark-pop" @click="onClose"></view>
+      <view v-show="showCatePop" ref="catePopRef" class="cate-popup">
+        <view class="cate-select-wrap">
+          <view v-for="item in cateList" :key="item.id"
+                :class="['cate-item', { active: cateValue === item.id }]" @click="onSelectCate(item)">
+            {{ item.name }}
+          </view>
+        </view>
+      </view>
+    </view>
+    <!-- 二级分类 -->
+    <view class="sub-cate">
+      <view v-for="(item, index) in subCateList" v-if="item.name"
+            :class="[subCateId === item.id ? 'sub-cate-active' : '']"
+            :style="{background:`${btn_color && subCateId === item.id ? btn_color : null}`}" class="sub-cate-list" @click="subCateHandler(item)">
+        <text>{{ item.name }}</text>
+      </view>
+    </view>
+  </view>
+
+</template>
+
+<script>
+import {
+  getGoodCate
+} from "@/common/api/good.js";
+
+export default {
+  name: 'FilterBar',
+  props: {
+    currentCateId: {
+      type: [String, Number]
+    }
+  },
+  data() {
+    return {
+      cateValue: "",
+      subCateId: '',
+      btn_color: "",
+      cateList: [],
+      showCatePop: false,
+      selectType: "synthesis",
+      priceType: "asc",
+      data: [],
+      filterList: [{
+        name: "综合",
+        type: "synthesis",
+      },
+        {
+          name: "销量",
+          type: "sales_num",
+        },
+        {
+          name: "价格",
+          type: "price",
+        },
+        {
+          name: "分类",
+          type: "classify",
+        },
+      ],
+    };
+  },
+  computed: {
+    subCateList() {
+      const data = this.cateList.find(item => item.id == this.currentCateId)
+      return data ? [{
+        id: '',
+        name: '全部'
+      }].concat(data.sub) : []
+    }
+  },
+  created() {
+    this._getGoodCate();
+
+    const configs = uni.getStorageSync('configs')
+    if (configs) {
+      this.btn_color = configs.btn_color
+    }
+  },
+  mounted() {
+    this.cateValue = this.currentCateId
+  },
+  methods: {
+    subCateHandler(item) {
+      this.subCateId = item.id
+      this.$emit("change", {
+        sort: this.selectType === "synthesis" ? "" : this.selectType,
+        sortType: this.selectType === "price" ? this.priceType : "",
+        cateid: this.cateValue,
+        subCateId: this.subCateId
+      });
+    },
+    _getGoodCate() {
+      getGoodCate().then(({
+                            data = []
+                          }) => {
+        this.cateList = data;
+        console.log(99999, data)
+      });
+    },
+    handleFilter(item) {
+      if (item.type === "classify") {
+        console.log(8999, this.currentCateId)
+        this.showCatePop = !this.showCatePop;
+        if (this.showCatePop) {
+          this.cateValue = this.currentCateId
+        }
+        return;
+      }
+      if (this.showCatePop) {
+        this.onClose();
+      }
+      this.selectType = item.type;
+      if (item.type === "price") {
+        this.priceType = this.priceType === "asc" ? "desc" : "asc";
+      } else {
+        this.priceType = "asc";
+      }
+      this.$emit("change", {
+        sort: this.selectType === "synthesis" ? "" : this.selectType,
+        sortType: this.selectType === "price" ? this.priceType : "",
+        cateid: this.cateValue,
+      });
+    },
+    onSelectCate(item) {
+      this.cateValue = this.cateValue === item.id ? "" : item.id;
+      this.subCateId = ''
+      this.$emit("change", {
+        sort: this.selectType === "synthesis" ? "" : this.selectType,
+        sortType: this.selectType === "price" ? this.priceType : "",
+        cateid: this.cateValue,
+        subCateId: this.subCateId
+      });
+      this.onClose();
+    },
+    onClose() {
+      this.showCatePop = false;
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.filterbar {
+  position: relative;
+  display: flex;
+  align-items: center;
+  padding: 33 rpx 0 30 rpx 0;
+
+  .item {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    font-size: 24 rpx;
+    font-weight: 500;
+    color: #767676;
+    line-height: 34 rpx;
+
+    &.sales_num {
+      flex: 1;
+      margin-left: 20 rpx;
+    }
+
+    &.price {
+      flex: 1;
+      margin-right: 20 rpx;
+    }
+
+    &.synthesis,
+    &.classify {
+      padding: 0 24 rpx;
+      flex-shrink: 0;
+    }
+
+    &.active {
+      font-weight: 600;
+      color: #000000;
+    }
+
+    .price-icon {
+      margin-left: 4 rpx;
+    }
+  }
+
+  .mark-pop {
+    position: absolute;
+    left: 0;
+    right: 0;
+    top: 100%;
+    height: 100vh;
+    background-color: rgba(0, 0, 0, 0.6);
+  }
+
+  .cate-popup {
+    position: absolute;
+    left: 0;
+    right: 0;
+    top: 100%;
+    background-color: #fff;
+  }
+
+  .cate-select-wrap {
+    padding: 20 rpx 10 rpx 40 rpx;
+    display: flex;
+    flex-wrap: wrap;
+
+    .cate-item {
+      font-size: 24 rpx;
+      border: 2 rpx solid #2979ff;
+      color: #2979ff;
+      padding: 4 rpx 28 rpx;
+      margin: 10 rpx;
+      border-radius: 72 rpx;
+
+      &.active {
+        color: #fff;
+        background-color: #2979ff;
+      }
+    }
+  }
+}
+
+.sub-cate {
+  display: flex;
+  flex-wrap: wrap;
+
+  &-list {
+    width: 166 rpx;
+    height: 55 rpx;
+    font-size: 24 rpx;
+    border-radius: 12 rpx;
+    background-color: #fff;
+    color: #626262;
+    overflow: hidden;
+    line-height: 55 rpx;
+    text-overflow: ellipsis;
+    text-align: center;
+    margin-right: 15 rpx;
+    margin-bottom: 23 rpx;
+  }
+
+  &-active {
+    background-color: #F39800;
+    color: #fff;
+  }
+}
+</style>

+ 161 - 0
pages/productCenter2/productCenter.vue

@@ -0,0 +1,161 @@
+<template>
+  <view class="common-page">
+    <!-- <view class="search-box" @click="toSearchList">
+
+    </view> -->
+    <u-search v-model="search" bgColor="#fff" placeholder="请输入关键词"></u-search>
+    <FilterBar :currentCateId="cateid" @change="handleFilter"/>
+    <view class="list-box">
+      <CommercePart :data="data"></CommercePart>
+    </view>
+    <tabbarCom current="2"></tabbarCom>
+  </view>
+</template>
+
+<script>
+import tabbarCom from "@/components/tabbar/tabbar.vue"
+import CommercePart from "@/components/CommercePart.vue";
+import FilterBar from "./filterBar.vue";
+import {
+  getGoodList
+} from "@/common/api/good.js";
+
+export default {
+  components: {
+    tabbarCom,
+    CommercePart,
+    FilterBar
+  },
+  data() {
+    return {
+      page: 1,
+      pageSize: 10,
+      total: 0,
+      search: "",
+      sort: "",
+      cateid: "",
+      subCateId: '',
+      sortType: "",
+      data: [],
+    };
+  },
+  onShow() {
+    const currentCateid = uni.getStorageSync('currentCateid')
+    if (currentCateid) {
+      this.cateid = currentCateid
+    } else {
+      this.cateid = ""
+      this.$nextTick(() => {
+        this._getGoodList(true);
+      })
+    }
+  },
+  onReachBottom() {
+    this._getGoodList();
+  },
+  onShareAppMessage(res) {
+    if (res.from === 'button') { // 来自页面内分享按钮
+      console.log(res.target)
+    }
+    let userInfo = uni.getStorageSync('userInfo')
+    userInfo = userInfo && JSON.parse(userInfo) || {}
+    let params = {}
+    if (userInfo.id) {
+      params = {
+        id: userInfo.id
+      }
+    }
+    let configs = uni.getStorageSync('configs') || {}
+    return {
+      title: configs.shop_share_title,
+      imageUrl: configs.shop_share_img,
+      path: `/pages/productCenter/productCenter${this.$stringPageOptions(params)}`
+    }
+  },
+  onShareTimeline(res) {
+    if (res.from === 'button') { // 来自页面内分享按钮
+      console.log(res.target)
+    }
+    let userInfo = uni.getStorageSync('userInfo')
+    userInfo = userInfo && JSON.parse(userInfo) || {}
+    let params = {}
+    if (userInfo.id) {
+      params = {
+        id: userInfo.id
+      }
+    }
+    let configs = uni.getStorageSync('configs') || {}
+    return {
+      title: configs.shop_share_title,
+      imageUrl: configs.shop_share_img,
+      path: `/pages/productCenter/productCenter${this.$stringPageOptions(params)}`
+    }
+  },
+  computed: {
+    getGoodListParam() {
+      return {
+        cateid: this.cateid,
+        subCateId: this.subCateId,
+        sort: this.sort,
+        sortType: this.sortType,
+        name: this.search,
+      }
+    }
+  },
+  watch: {
+    getGoodListParam() {
+      this._getGoodList(true);
+    },
+  },
+  methods: {
+    _getGoodList(initFlag) {
+      if (!initFlag) {
+        if (this.page * this.pageSize < this.total) {
+          this.page++
+        } else {
+          return
+        }
+      } else {
+        this.page = 1
+        this.total = 0
+        this.data = []
+      }
+      let params = {
+        cateid: this.cateid && this.subCateId ? this.subCateId : this.cateid,
+        sort: this.sort,
+        sortType: this.sortType,
+        page: this.page,
+        pageSize: this.pageSize,
+        goods_kind: "线上商品",
+        name: this.search,
+      }
+      getGoodList(params).then(({
+                                  data = {}
+                                }) => {
+        this.data = this.data.concat(data.list)
+        this.total = data.page.total
+      });
+    },
+    handleFilter({
+                   sort,
+                   sortType,
+                   cateid,
+                   subCateId
+                 }) {
+      console.log(cateid, subCateId)
+      this.sort = sort;
+      this.sortType = sortType;
+      this.cateid = cateid || "";
+      this.subCateId = subCateId || ''
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.common-page {
+  padding: 25 rpx 20 rpx;
+  height: 100vh;
+  background-color: $primary-bg-color;
+}
+</style>

+ 2 - 2
pages/shoppingCart/shoppingCart.vue

@@ -36,7 +36,7 @@
 			</view>
 
 		</view>
-		<tabbarCom :current="3" :zIndex="100"></tabbarCom>
+		<tabbarCom :zIndex="100" current="3"></tabbarCom>
 	</view>
 </template>
 
@@ -233,4 +233,4 @@
 			}
 		}
 	}
-</style>
+</style>

BIN
static/biaoti3.png


BIN
static/cart-a.png


BIN
static/cart-b.png


BIN
static/cart-c.png


BIN
static/hd-a.png


BIN
static/hd-b.png


BIN
static/hdlist1.png


BIN
static/hdlist2.png


BIN
static/hdlist3.png


BIN
static/index-a.png


BIN
static/index-b.png


BIN
static/mine-a.png


BIN
static/mine-b.png


BIN
static/pd-a.png


BIN
static/pd-b.png


+ 1 - 0
wxcomponents/vant/dist/action-sheet/index.d.ts

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

+ 76 - 0
wxcomponents/vant/dist/action-sheet/index.js

@@ -0,0 +1,76 @@
+import {VantComponent} from '../common/component';
+import {button} from '../mixins/button';
+
+VantComponent({
+    classes: ['list-class'],
+    mixins: [button],
+    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,
+        },
+        rootPortal: {
+            type: Boolean,
+            value: false,
+        },
+    },
+    methods: {
+        onSelect(event) {
+            const {index} = event.currentTarget.dataset;
+            const {actions, closeOnClickAction, canIUseGetUserProfile} = this.data;
+            const item = actions[index];
+            if (item) {
+                this.$emit('select', item);
+                if (closeOnClickAction) {
+                    this.onClose();
+                }
+                if (item.openType === 'getUserInfo' && canIUseGetUserProfile) {
+                    wx.getUserProfile({
+                        desc: item.getUserProfileDesc || '  ',
+                        complete: (userProfile) => {
+                            this.$emit('getuserinfo', userProfile);
+                        },
+                    });
+                }
+            }
+        },
+        onCancel() {
+            this.$emit('cancel');
+        },
+        onClose() {
+            this.$emit('close');
+        },
+        onClickOverlay() {
+            this.$emit('click-overlay');
+            this.onClose();
+        },
+    },
+});

+ 8 - 0
wxcomponents/vant/dist/action-sheet/index.json

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

+ 70 - 0
wxcomponents/vant/dist/action-sheet/index.wxml

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

+ 1 - 0
wxcomponents/vant/dist/action-sheet/index.wxss

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

+ 1 - 0
wxcomponents/vant/dist/area/index.d.ts

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

+ 224 - 0
wxcomponents/vant/dist/area/index.js

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

+ 6 - 0
wxcomponents/vant/dist/area/index.json

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

+ 20 - 0
wxcomponents/vant/dist/area/index.wxml

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

+ 8 - 0
wxcomponents/vant/dist/area/index.wxs

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

+ 1 - 0
wxcomponents/vant/dist/area/index.wxss

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

+ 1 - 0
wxcomponents/vant/dist/button/index.d.ts

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

+ 65 - 0
wxcomponents/vant/dist/button/index.js

@@ -0,0 +1,65 @@
+import {VantComponent} from '../common/component';
+import {button} from '../mixins/button';
+import {canIUseFormFieldButton} from '../common/version';
+
+const mixins = [button];
+if (canIUseFormFieldButton()) {
+    mixins.push('wx://form-field-button');
+}
+VantComponent({
+    mixins,
+    classes: ['hover-class', 'loading-class'],
+    data: {
+        baseStyle: '',
+    },
+    props: {
+        formType: String,
+        icon: String,
+        classPrefix: {
+            type: String,
+            value: 'van-icon',
+        },
+        plain: Boolean,
+        block: Boolean,
+        round: Boolean,
+        square: Boolean,
+        loading: Boolean,
+        hairline: Boolean,
+        disabled: Boolean,
+        loadingText: String,
+        customStyle: String,
+        loadingType: {
+            type: String,
+            value: 'circular',
+        },
+        type: {
+            type: String,
+            value: 'default',
+        },
+        dataset: null,
+        size: {
+            type: String,
+            value: 'normal',
+        },
+        loadingSize: {
+            type: String,
+            value: '20px',
+        },
+        color: String,
+    },
+    methods: {
+        onClick(event) {
+            this.$emit('click', event);
+            const {canIUseGetUserProfile, openType, getUserProfileDesc, lang,} = this.data;
+            if (openType === 'getUserInfo' && canIUseGetUserProfile) {
+                wx.getUserProfile({
+                    desc: getUserProfileDesc || '  ',
+                    lang: lang || 'en',
+                    complete: (userProfile) => {
+                        this.$emit('getuserinfo', userProfile);
+                    },
+                });
+            }
+        },
+    },
+});

+ 7 - 0
wxcomponents/vant/dist/button/index.json

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

+ 56 - 0
wxcomponents/vant/dist/button/index.wxml

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

+ 39 - 0
wxcomponents/vant/dist/button/index.wxs

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

File diff suppressed because it is too large
+ 0 - 0
wxcomponents/vant/dist/button/index.wxss


+ 70 - 0
wxcomponents/vant/dist/calendar/calendar.wxml

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

+ 1 - 0
wxcomponents/vant/dist/calendar/components/header/index.d.ts

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

+ 38 - 0
wxcomponents/vant/dist/calendar/components/header/index.js

@@ -0,0 +1,38 @@
+import {VantComponent} from '../../../common/component';
+
+VantComponent({
+    props: {
+        title: {
+            type: String,
+            value: '日期选择',
+        },
+        subtitle: String,
+        showTitle: Boolean,
+        showSubtitle: Boolean,
+        firstDayOfWeek: {
+            type: Number,
+            observer: 'initWeekDay',
+        },
+    },
+    data: {
+        weekdays: [],
+    },
+    created() {
+        this.initWeekDay();
+    },
+    methods: {
+        initWeekDay() {
+            const defaultWeeks = ['日', '一', '二', '三', '四', '五', '六'];
+            const firstDayOfWeek = this.data.firstDayOfWeek || 0;
+            this.setData({
+                weekdays: [
+                    ...defaultWeeks.slice(firstDayOfWeek, 7),
+                    ...defaultWeeks.slice(0, firstDayOfWeek),
+                ],
+            });
+        },
+        onClickSubtitle(event) {
+            this.$emit('click-subtitle', event);
+        },
+    },
+});

+ 3 - 0
wxcomponents/vant/dist/calendar/components/header/index.json

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

+ 18 - 0
wxcomponents/vant/dist/calendar/components/header/index.wxml

@@ -0,0 +1,18 @@
+<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 bind:tap="onClickSubtitle" class="van-calendar__header-subtitle" wx:if="{{ showSubtitle }}">
+        {{ subtitle }}
+    </view>
+
+    <view class="van-calendar__weekdays">
+        <view class="van-calendar__weekday" wx:for="{{ weekdays }}" wx:key="index">
+            {{ item }}
+        </view>
+    </view>
+</view>

+ 1 - 0
wxcomponents/vant/dist/calendar/components/header/index.wxss

@@ -0,0 +1 @@
+@import '../../../common/index.wxss';.van-calendar__header{box-shadow:var(--calendar-header-box-shadow,0 2px 10px hsla(220,1%,50%,.16));flex-shrink:0}.van-calendar__header-subtitle,.van-calendar__header-title{font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.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:flex}.van-calendar__weekday{flex:1;font-size:var(--calendar-weekdays-font-size,12px);line-height:var(--calendar-weekdays-height,30px);text-align:center}

+ 6 - 0
wxcomponents/vant/dist/calendar/components/month/index.d.ts

@@ -0,0 +1,6 @@
+export interface Day {
+    date: Date;
+    type: string;
+    text: number;
+    bottomInfo?: string;
+}

+ 155 - 0
wxcomponents/vant/dist/calendar/components/month/index.js

@@ -0,0 +1,155 @@
+import {VantComponent} from '../../../common/component';
+import {getMonthEndDay, compareDay, getPrevDay, getNextDay,} from '../../utils';
+
+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: null,
+        formatter: {
+            type: null,
+            observer: 'setDays',
+        },
+        currentDate: {
+            type: null,
+            observer: 'setDays',
+        },
+        firstDayOfWeek: {
+            type: Number,
+            observer: 'setDays',
+        },
+        allowSameDay: Boolean,
+        showSubtitle: Boolean,
+        showMonthTitle: Boolean,
+    },
+    data: {
+        visible: true,
+        days: [],
+    },
+    methods: {
+        onClick(event) {
+            const {index} = event.currentTarget.dataset;
+            const item = this.data.days[index];
+            if (item.type !== 'disabled') {
+                this.$emit('click', item);
+            }
+        },
+        setDays() {
+            const days = [];
+            const startDate = new Date(this.data.date);
+            const year = startDate.getFullYear();
+            const month = startDate.getMonth();
+            const totalDay = getMonthEndDay(startDate.getFullYear(), startDate.getMonth() + 1);
+            for (let day = 1; day <= totalDay; day++) {
+                const date = new Date(year, month, day);
+                const type = this.getDayType(date);
+                let config = {
+                    date,
+                    type,
+                    text: day,
+                    bottomInfo: this.getBottomInfo(type),
+                };
+                if (this.data.formatter) {
+                    config = this.data.formatter(config);
+                }
+                days.push(config);
+            }
+            this.setData({days});
+        },
+        getMultipleDayType(day) {
+            const {currentDate} = this.data;
+            if (!Array.isArray(currentDate)) {
+                return '';
+            }
+            const isSelected = (date) => currentDate.some((item) => compareDay(item, date) === 0);
+            if (isSelected(day)) {
+                const prevDay = getPrevDay(day);
+                const nextDay = getNextDay(day);
+                const prevSelected = isSelected(prevDay);
+                const nextSelected = isSelected(nextDay);
+                if (prevSelected && nextSelected) {
+                    return 'multiple-middle';
+                }
+                if (prevSelected) {
+                    return 'end';
+                }
+                return nextSelected ? 'start' : 'multiple-selected';
+            }
+            return '';
+        },
+        getRangeDayType(day) {
+            const {currentDate, allowSameDay} = this.data;
+            if (!Array.isArray(currentDate)) {
+                return '';
+            }
+            const [startDay, endDay] = currentDate;
+            if (!startDay) {
+                return '';
+            }
+            const compareToStart = compareDay(day, startDay);
+            if (!endDay) {
+                return compareToStart === 0 ? 'start' : '';
+            }
+            const compareToEnd = 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';
+            }
+            return '';
+        },
+        getDayType(day) {
+            const {type, minDate, maxDate, currentDate} = this.data;
+            if (compareDay(day, minDate) < 0 || compareDay(day, maxDate) > 0) {
+                return 'disabled';
+            }
+            if (type === 'single') {
+                return compareDay(day, currentDate) === 0 ? 'selected' : '';
+            }
+            if (type === 'multiple') {
+                return this.getMultipleDayType(day);
+            }
+            /* istanbul ignore else */
+            if (type === 'range') {
+                return this.getRangeDayType(day);
+            }
+            return '';
+        },
+        getBottomInfo(type) {
+            if (this.data.type === 'range') {
+                if (type === 'start') {
+                    return '开始';
+                }
+                if (type === 'end') {
+                    return '结束';
+                }
+                if (type === 'start-end') {
+                    return '开始/结束';
+                }
+            }
+        },
+    },
+});

+ 3 - 0
wxcomponents/vant/dist/calendar/components/month/index.json

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

+ 40 - 0
wxcomponents/vant/dist/calendar/components/month/index.wxml

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

+ 71 - 0
wxcomponents/vant/dist/calendar/components/month/index.wxs

@@ -0,0 +1,71 @@
+/* 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, firstDayOfWeek) {
+  var style = [];
+  var current = getDate(date).getDay() || 7;
+  var offset = current < firstDayOfWeek ? (7 - firstDayOfWeek + current) :
+               current === 7 && firstDayOfWeek === 0 ? 0 :
+               (current - firstDayOfWeek);
+
+  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 === 'start-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
+};

File diff suppressed because it is too large
+ 0 - 0
wxcomponents/vant/dist/calendar/components/month/index.wxss


+ 1 - 0
wxcomponents/vant/dist/calendar/index.d.ts

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

+ 366 - 0
wxcomponents/vant/dist/calendar/index.js

@@ -0,0 +1,366 @@
+import {VantComponent} from '../common/component';
+import {
+    ROW_HEIGHT,
+    getPrevDay,
+    getNextDay,
+    getToday,
+    compareDay,
+    copyDates,
+    calcDateNum,
+    formatMonthTitle,
+    compareMonth,
+    getMonths,
+    getDayByOffset,
+} from './utils';
+import Toast from '../toast/toast';
+import {requestAnimationFrame} from '../common/utils';
+
+const initialMinDate = getToday().getTime();
+const initialMaxDate = (() => {
+    const now = getToday();
+    return new Date(now.getFullYear(), now.getMonth() + 6, now.getDate()).getTime();
+})();
+const getTime = (date) => date instanceof Date ? date.getTime() : date;
+VantComponent({
+    props: {
+        title: {
+            type: String,
+            value: '日期选择',
+        },
+        color: String,
+        show: {
+            type: Boolean,
+            observer(val) {
+                if (val) {
+                    this.initRect();
+                    this.scrollIntoView();
+                }
+            },
+        },
+        formatter: null,
+        confirmText: {
+            type: String,
+            value: '确定',
+        },
+        confirmDisabledText: {
+            type: String,
+            value: '确定',
+        },
+        rangePrompt: String,
+        showRangePrompt: {
+            type: Boolean,
+            value: true,
+        },
+        defaultDate: {
+            type: null,
+            value: getToday().getTime(),
+            observer(val) {
+                this.setData({currentDate: val});
+                this.scrollIntoView();
+            },
+        },
+        allowSameDay: Boolean,
+        type: {
+            type: String,
+            value: 'single',
+            observer: 'reset',
+        },
+        minDate: {
+            type: Number,
+            value: initialMinDate,
+        },
+        maxDate: {
+            type: Number,
+            value: initialMaxDate,
+        },
+        position: {
+            type: String,
+            value: 'bottom',
+        },
+        rowHeight: {
+            type: null,
+            value: 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: null,
+            value: null,
+        },
+        minRange: {
+            type: Number,
+            value: 1,
+        },
+        firstDayOfWeek: {
+            type: Number,
+            value: 0,
+        },
+        readonly: Boolean,
+        rootPortal: {
+            type: Boolean,
+            value: false,
+        },
+    },
+    data: {
+        subtitle: '',
+        currentDate: null,
+        scrollIntoView: '',
+    },
+    watch: {
+        minDate() {
+            this.initRect();
+        },
+        maxDate() {
+            this.initRect();
+        },
+    },
+    created() {
+        this.setData({
+            currentDate: this.getInitialDate(this.data.defaultDate),
+        });
+    },
+    mounted() {
+        if (this.data.show || !this.data.poppable) {
+            this.initRect();
+            this.scrollIntoView();
+        }
+    },
+    methods: {
+        reset() {
+            this.setData({currentDate: this.getInitialDate(this.data.defaultDate)});
+            this.scrollIntoView();
+        },
+        initRect() {
+            if (this.contentObserver != null) {
+                this.contentObserver.disconnect();
+            }
+            const contentObserver = this.createIntersectionObserver({
+                thresholds: [0, 0.1, 0.9, 1],
+                observeAll: true,
+            });
+            this.contentObserver = contentObserver;
+            contentObserver.relativeTo('.van-calendar__body');
+            contentObserver.observe('.month', (res) => {
+                if (res.boundingClientRect.top <= res.relativeRect.top) {
+                    // @ts-ignore
+                    this.setData({subtitle: formatMonthTitle(res.dataset.date)});
+                }
+            });
+        },
+        limitDateRange(date, minDate = null, maxDate = null) {
+            minDate = minDate || this.data.minDate;
+            maxDate = maxDate || this.data.maxDate;
+            if (compareDay(date, minDate) === -1) {
+                return minDate;
+            }
+            if (compareDay(date, maxDate) === 1) {
+                return maxDate;
+            }
+            return date;
+        },
+        getInitialDate(defaultDate = null) {
+            const {type, minDate, maxDate, allowSameDay} = this.data;
+            if (!defaultDate)
+                return [];
+            const now = getToday().getTime();
+            if (type === 'range') {
+                if (!Array.isArray(defaultDate)) {
+                    defaultDate = [];
+                }
+                const [startDay, endDay] = defaultDate || [];
+                const startDate = getTime(startDay || now);
+                const start = this.limitDateRange(startDate, minDate, allowSameDay ? startDate : getPrevDay(new Date(maxDate)).getTime());
+                const date = getTime(endDay || now);
+                const end = this.limitDateRange(date, allowSameDay ? date : getNextDay(new Date(minDate)).getTime());
+                return [start, end];
+            }
+            if (type === 'multiple') {
+                if (Array.isArray(defaultDate)) {
+                    return defaultDate.map((date) => this.limitDateRange(date));
+                }
+                return [this.limitDateRange(now)];
+            }
+            if (!defaultDate || Array.isArray(defaultDate)) {
+                defaultDate = now;
+            }
+            return this.limitDateRange(defaultDate);
+        },
+        scrollIntoView() {
+            requestAnimationFrame(() => {
+                const {currentDate, type, show, poppable, minDate, maxDate} = this.data;
+                if (!currentDate)
+                    return;
+                // @ts-ignore
+                const targetDate = type === 'single' ? currentDate : currentDate[0];
+                const displayed = show || !poppable;
+                if (!targetDate || !displayed) {
+                    return;
+                }
+                const months = getMonths(minDate, maxDate);
+                months.some((month, index) => {
+                    if (compareMonth(month, targetDate) === 0) {
+                        this.setData({scrollIntoView: `month${index}`});
+                        return true;
+                    }
+                    return false;
+                });
+            });
+        },
+        onOpen() {
+            this.$emit('open');
+        },
+        onOpened() {
+            this.$emit('opened');
+        },
+        onClose() {
+            this.$emit('close');
+        },
+        onClosed() {
+            this.$emit('closed');
+        },
+        onClickDay(event) {
+            if (this.data.readonly) {
+                return;
+            }
+            let {date} = event.detail;
+            const {type, currentDate, allowSameDay} = this.data;
+            if (type === 'range') {
+                // @ts-ignore
+                const [startDay, endDay] = currentDate;
+                if (startDay && !endDay) {
+                    const compareToStart = compareDay(date, startDay);
+                    if (compareToStart === 1) {
+                        const {days} = this.selectComponent('.month').data;
+                        days.some((day, index) => {
+                            const isDisabled = day.type === 'disabled' &&
+                                getTime(startDay) < getTime(day.date) &&
+                                getTime(day.date) < getTime(date);
+                            if (isDisabled) {
+                                ({date} = days[index - 1]);
+                            }
+                            return isDisabled;
+                        });
+                        this.select([startDay, date], true);
+                    } else if (compareToStart === -1) {
+                        this.select([date, null]);
+                    } else if (allowSameDay) {
+                        this.select([date, date], true);
+                    }
+                } else {
+                    this.select([date, null]);
+                }
+            } else if (type === 'multiple') {
+                let selectedIndex;
+                // @ts-ignore
+                const selected = currentDate.some((dateItem, index) => {
+                    const equal = compareDay(dateItem, date) === 0;
+                    if (equal) {
+                        selectedIndex = index;
+                    }
+                    return equal;
+                });
+                if (selected) {
+                    // @ts-ignore
+                    const cancelDate = currentDate.splice(selectedIndex, 1);
+                    this.setData({currentDate});
+                    this.unselect(cancelDate);
+                } else {
+                    // @ts-ignore
+                    this.select([...currentDate, date]);
+                }
+            } else {
+                this.select(date, true);
+            }
+        },
+        unselect(dateArray) {
+            const date = dateArray[0];
+            if (date) {
+                this.$emit('unselect', copyDates(date));
+            }
+        },
+        select(date, complete) {
+            if (complete && this.data.type === 'range') {
+                const valid = this.checkRange(date);
+                if (!valid) {
+                    // auto selected to max range if showConfirm
+                    if (this.data.showConfirm) {
+                        this.emit([
+                            date[0],
+                            getDayByOffset(date[0], this.data.maxRange - 1),
+                        ]);
+                    } else {
+                        this.emit(date);
+                    }
+                    return;
+                }
+            }
+            this.emit(date);
+            if (complete && !this.data.showConfirm) {
+                this.onConfirm();
+            }
+        },
+        emit(date) {
+            this.setData({
+                currentDate: Array.isArray(date) ? date.map(getTime) : getTime(date),
+            });
+            this.$emit('select', copyDates(date));
+        },
+        checkRange(date) {
+            const {maxRange, rangePrompt, showRangePrompt} = this.data;
+            if (maxRange && calcDateNum(date) > maxRange) {
+                if (showRangePrompt) {
+                    Toast({
+                        context: this,
+                        message: rangePrompt || `选择天数不能超过 ${maxRange} 天`,
+                    });
+                }
+                this.$emit('over-range');
+                return false;
+            }
+            return true;
+        },
+        onConfirm() {
+            if (this.data.type === 'range' &&
+                !this.checkRange(this.data.currentDate)) {
+                return;
+            }
+            wx.nextTick(() => {
+                // @ts-ignore
+                this.$emit('confirm', copyDates(this.data.currentDate));
+            });
+        },
+        onClickSubtitle(event) {
+            this.$emit('click-subtitle', event);
+        },
+    },
+});

+ 10 - 0
wxcomponents/vant/dist/calendar/index.json

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

+ 27 - 0
wxcomponents/vant/dist/calendar/index.wxml

@@ -0,0 +1,27 @@
+<wxs module="computed" src="./index.wxs"/>
+<wxs module="utils" src="../wxs/utils.wxs"/>
+
+<import src="./calendar.wxml"/>
+
+<van-popup
+        bind:after-enter="onOpened"
+        bind:after-leave="onClosed"
+        bind:close="onClose"
+        bind:enter="onOpen"
+        close-icon-class="van-calendar__close-icon"
+        close-on-click-overlay="{{ closeOnClickOverlay }}"
+        closeable="{{ showTitle || showSubtitle }}"
+        custom-class="van-calendar__popup--{{ position }}"
+        position="{{ position }}"
+        root-portal="{{ rootPortal }}"
+        round="{{ round }}"
+        safe-area-inset-bottom="{{ safeAreaInsetBottom }}"
+        show="{{ show }}"
+        wx:if="{{ poppable }}"
+>
+    <include src="./calendar.wxml"/>
+</van-popup>
+
+<include src="./calendar.wxml" wx:else/>
+
+<van-toast id="van-toast"/>

+ 37 - 0
wxcomponents/vant/dist/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, minRange) {
+  if (currentDate == null) {
+    return true;
+  }
+
+  if (type === 'range') {
+    return !currentDate[0] || !currentDate[1];
+  }
+
+  if (type === 'multiple') {
+    return currentDate.length < minRange;
+  }
+
+  return !currentDate;
+}
+
+module.exports = {
+  getMonths: getMonths,
+  getButtonDisabled: getButtonDisabled
+};

+ 1 - 0
wxcomponents/vant/dist/calendar/index.wxss

@@ -0,0 +1 @@
+@import '../common/index.wxss';.van-calendar{background-color:var(--calendar-background-color,#fff);display:flex;flex-direction:column;height:var(--calendar-height,100%)}.van-calendar__close-icon{top:11px}.van-calendar__popup--bottom,.van-calendar__popup--top{height:var(--calendar-popup-height,90%)}.van-calendar__popup--left,.van-calendar__popup--right{height:100%}.van-calendar__body{-webkit-overflow-scrolling:touch;flex:1;overflow:auto}.van-calendar__footer{flex-shrink:0;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:var(--calendar-confirm-button-height,36px)!important;line-height:var(--calendar-confirm-button-line-height,34px)!important;margin:var(--calendar-confirm-button-margin,7px 0)!important}

+ 23 - 0
wxcomponents/vant/dist/calendar/utils.d.ts

@@ -0,0 +1,23 @@
+export declare const ROW_HEIGHT = 64;
+
+export declare function formatMonthTitle(date: Date): string;
+
+export declare function compareMonth(date1: Date | number, date2: Date | number): 0 | 1 | -1;
+
+export declare function compareDay(day1: Date | number, day2: Date | number): 0 | 1 | -1;
+
+export declare function getDayByOffset(date: Date, offset: number): Date;
+
+export declare function getPrevDay(date: Date): Date;
+
+export declare function getNextDay(date: Date): Date;
+
+export declare function getToday(): Date;
+
+export declare function calcDateNum(date: [Date, Date]): number;
+
+export declare function copyDates(dates: Date | Date[]): Date | Date[];
+
+export declare function getMonthEndDay(year: number, month: number): number;
+
+export declare function getMonths(minDate: number, maxDate: number): number[];

+ 94 - 0
wxcomponents/vant/dist/calendar/utils.js

@@ -0,0 +1,94 @@
+export const ROW_HEIGHT = 64;
+
+export function formatMonthTitle(date) {
+    if (!(date instanceof Date)) {
+        date = new Date(date);
+    }
+    return `${date.getFullYear()}年${date.getMonth() + 1}月`;
+}
+
+export function compareMonth(date1, date2) {
+    if (!(date1 instanceof Date)) {
+        date1 = new Date(date1);
+    }
+    if (!(date2 instanceof Date)) {
+        date2 = new Date(date2);
+    }
+    const year1 = date1.getFullYear();
+    const year2 = date2.getFullYear();
+    const month1 = date1.getMonth();
+    const month2 = date2.getMonth();
+    if (year1 === year2) {
+        return month1 === month2 ? 0 : month1 > month2 ? 1 : -1;
+    }
+    return year1 > year2 ? 1 : -1;
+}
+
+export function compareDay(day1, day2) {
+    if (!(day1 instanceof Date)) {
+        day1 = new Date(day1);
+    }
+    if (!(day2 instanceof Date)) {
+        day2 = new Date(day2);
+    }
+    const compareMonthResult = compareMonth(day1, day2);
+    if (compareMonthResult === 0) {
+        const date1 = day1.getDate();
+        const date2 = day2.getDate();
+        return date1 === date2 ? 0 : date1 > date2 ? 1 : -1;
+    }
+    return compareMonthResult;
+}
+
+export function getDayByOffset(date, offset) {
+    date = new Date(date);
+    date.setDate(date.getDate() + offset);
+    return date;
+}
+
+export function getPrevDay(date) {
+    return getDayByOffset(date, -1);
+}
+
+export function getNextDay(date) {
+    return getDayByOffset(date, 1);
+}
+
+export function getToday() {
+    const today = new Date();
+    today.setHours(0, 0, 0, 0);
+    return today;
+}
+
+export function calcDateNum(date) {
+    const day1 = new Date(date[0]).getTime();
+    const day2 = new Date(date[1]).getTime();
+    return (day2 - day1) / (1000 * 60 * 60 * 24) + 1;
+}
+
+export function copyDates(dates) {
+    if (Array.isArray(dates)) {
+        return dates.map((date) => {
+            if (date === null) {
+                return date;
+            }
+            return new Date(date);
+        });
+    }
+    return new Date(dates);
+}
+
+export function getMonthEndDay(year, month) {
+    return 32 - new Date(year, month - 1, 32).getDate();
+}
+
+export function getMonths(minDate, maxDate) {
+    const months = [];
+    const cursor = new Date(minDate);
+    cursor.setDate(1);
+    do {
+        months.push(cursor.getTime());
+        cursor.setMonth(cursor.getMonth() + 1);
+    } while (compareMonth(cursor, maxDate) !== 1);
+    return months;
+}

+ 25 - 0
wxcomponents/vant/dist/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
+};

+ 1 - 0
wxcomponents/vant/dist/card/index.d.ts

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

+ 50 - 0
wxcomponents/vant/dist/card/index.js

@@ -0,0 +1,50 @@
+import {link} from '../mixins/link';
+import {VantComponent} from '../common/component';
+
+VantComponent({
+    classes: [
+        'num-class',
+        'desc-class',
+        'thumb-class',
+        'title-class',
+        'price-class',
+        'origin-price-class',
+    ],
+    mixins: [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() {
+            const {price} = this.data;
+            const priceArr = price.toString().split('.');
+            this.setData({
+                integerStr: priceArr[0],
+                decimalStr: priceArr[1] ? `.${priceArr[1]}` : '',
+            });
+        },
+        onClickThumb() {
+            this.jumpLink('thumbLink');
+        },
+    },
+});

+ 6 - 0
wxcomponents/vant/dist/card/index.json

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

+ 58 - 0
wxcomponents/vant/dist/card/index.wxml

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

+ 1 - 0
wxcomponents/vant/dist/card/index.wxss

@@ -0,0 +1 @@
+@import '../common/index.wxss';.van-card{background-color:var(--card-background-color,#fafafa);box-sizing:border-box;color:var(--card-text-color,#323233);font-size:var(--card-font-size,12px);padding:var(--card-padding,8px 16px);position:relative}.van-card__header{display:flex}.van-card__header--center{align-items:center;justify-content:center}.van-card__thumb{flex:none;height:var(--card-thumb-size,88px);margin-right:var(--padding-xs,8px);position:relative;width:var(--card-thumb-size,88px)}.van-card__thumb:empty{display:none}.van-card__img{border-radius:8px;height:100%;width:100%}.van-card__content{display:flex;flex:1;flex-direction:column;justify-content:space-between;min-height:var(--card-thumb-size,88px);min-width:0;position:relative}.van-card__content--center{justify-content:center}.van-card__desc,.van-card__title{word-wrap:break-word}.van-card__title{font-weight:700;line-height:var(--card-title-line-height,16px)}.van-card__desc{color:var(--card-desc-color,#646566);line-height:var(--card-desc-line-height,20px)}.van-card__bottom{line-height:20px}.van-card__price{color:var(--card-price-color,#ee0a24);display:inline-block;font-size:var(--card-price-font-size,12px);font-weight:700}.van-card__price-integer{font-size:var(--card-price-integer-font-size,16px)}.van-card__price-decimal,.van-card__price-integer{font-family:var(--card-price-font-family,Avenir-Heavy,PingFang SC,Helvetica Neue,Arial,sans-serif)}.van-card__origin-price{color:var(--card-origin-price-color,#646566);display:inline-block;font-size:var(--card-origin-price-font-size,10px);margin-left:5px;text-decoration:line-through}.van-card__num{float:right}.van-card__tag{left:0;position:absolute!important;top:2px}.van-card__footer{flex:none;text-align:right;width:100%}

+ 1 - 0
wxcomponents/vant/dist/cascader/index.d.ts

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

+ 214 - 0
wxcomponents/vant/dist/cascader/index.js

@@ -0,0 +1,214 @@
+import {VantComponent} from '../common/component';
+
+var FieldName;
+(function (FieldName) {
+    FieldName["TEXT"] = "text";
+    FieldName["VALUE"] = "value";
+    FieldName["CHILDREN"] = "children";
+})(FieldName || (FieldName = {}));
+const defaultFieldNames = {
+    text: FieldName.TEXT,
+    value: FieldName.VALUE,
+    children: FieldName.CHILDREN,
+};
+VantComponent({
+    props: {
+        title: String,
+        value: {
+            type: String,
+        },
+        placeholder: {
+            type: String,
+            value: '请选择',
+        },
+        activeColor: {
+            type: String,
+            value: '#1989fa',
+        },
+        options: {
+            type: Array,
+            value: [],
+        },
+        swipeable: {
+            type: Boolean,
+            value: false,
+        },
+        closeable: {
+            type: Boolean,
+            value: true,
+        },
+        ellipsis: {
+            type: Boolean,
+            value: true,
+        },
+        showHeader: {
+            type: Boolean,
+            value: true,
+        },
+        closeIcon: {
+            type: String,
+            value: 'cross',
+        },
+        fieldNames: {
+            type: Object,
+            value: defaultFieldNames,
+            observer: 'updateFieldNames',
+        },
+        useTitleSlot: Boolean,
+    },
+    data: {
+        tabs: [],
+        activeTab: 0,
+        textKey: FieldName.TEXT,
+        valueKey: FieldName.VALUE,
+        childrenKey: FieldName.CHILDREN,
+        innerValue: '',
+    },
+    watch: {
+        options() {
+            this.updateTabs();
+        },
+        value(newVal) {
+            this.updateValue(newVal);
+        },
+    },
+    created() {
+        this.updateTabs();
+    },
+    methods: {
+        updateValue(val) {
+            if (val !== undefined) {
+                const values = this.data.tabs.map((tab) => tab.selected && tab.selected[this.data.valueKey]);
+                if (values.indexOf(val) > -1) {
+                    return;
+                }
+            }
+            this.innerValue = val;
+            this.updateTabs();
+        },
+        updateFieldNames() {
+            const {text = 'text', value = 'value', children = 'children',} = this.data.fieldNames || defaultFieldNames;
+            this.setData({
+                textKey: text,
+                valueKey: value,
+                childrenKey: children,
+            });
+        },
+        getSelectedOptionsByValue(options, value) {
+            for (let i = 0; i < options.length; i++) {
+                const option = options[i];
+                if (option[this.data.valueKey] === value) {
+                    return [option];
+                }
+                if (option[this.data.childrenKey]) {
+                    const selectedOptions = this.getSelectedOptionsByValue(option[this.data.childrenKey], value);
+                    if (selectedOptions) {
+                        return [option, ...selectedOptions];
+                    }
+                }
+            }
+        },
+        updateTabs() {
+            const {options} = this.data;
+            const {innerValue} = this;
+            if (!options.length) {
+                return;
+            }
+            if (innerValue !== undefined) {
+                const selectedOptions = this.getSelectedOptionsByValue(options, innerValue);
+                if (selectedOptions) {
+                    let optionsCursor = options;
+                    const tabs = selectedOptions.map((option) => {
+                        const tab = {
+                            options: optionsCursor,
+                            selected: option,
+                        };
+                        const next = optionsCursor.find((item) => item[this.data.valueKey] === option[this.data.valueKey]);
+                        if (next) {
+                            optionsCursor = next[this.data.childrenKey];
+                        }
+                        return tab;
+                    });
+                    if (optionsCursor) {
+                        tabs.push({
+                            options: optionsCursor,
+                            selected: null,
+                        });
+                    }
+                    this.setData({
+                        tabs,
+                    });
+                    wx.nextTick(() => {
+                        this.setData({
+                            activeTab: tabs.length - 1,
+                        });
+                    });
+                    return;
+                }
+            }
+            this.setData({
+                tabs: [
+                    {
+                        options,
+                        selected: null,
+                    },
+                ],
+                activeTab: 0,
+            });
+        },
+        onClose() {
+            this.$emit('close');
+        },
+        onClickTab(e) {
+            const {index: tabIndex, title} = e.detail;
+            this.$emit('click-tab', {title, tabIndex});
+            this.setData({
+                activeTab: tabIndex,
+            });
+        },
+        // 选中
+        onSelect(e) {
+            const {option, tabIndex} = e.currentTarget.dataset;
+            if (option && option.disabled) {
+                return;
+            }
+            const {valueKey, childrenKey} = this.data;
+            let {tabs} = this.data;
+            tabs[tabIndex].selected = option;
+            if (tabs.length > tabIndex + 1) {
+                tabs = tabs.slice(0, tabIndex + 1);
+            }
+            if (option[childrenKey]) {
+                const nextTab = {
+                    options: option[childrenKey],
+                    selected: null,
+                };
+                if (tabs[tabIndex + 1]) {
+                    tabs[tabIndex + 1] = nextTab;
+                } else {
+                    tabs.push(nextTab);
+                }
+                wx.nextTick(() => {
+                    this.setData({
+                        activeTab: tabIndex + 1,
+                    });
+                });
+            }
+            this.setData({
+                tabs,
+            });
+            const selectedOptions = tabs.map((tab) => tab.selected).filter(Boolean);
+            const value = option[valueKey];
+            const params = {
+                value,
+                tabIndex,
+                selectedOptions,
+            };
+            this.innerValue = value;
+            this.$emit('change', params);
+            if (!option[childrenKey]) {
+                this.$emit('finish', params);
+            }
+        },
+    },
+});

+ 8 - 0
wxcomponents/vant/dist/cascader/index.json

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

+ 55 - 0
wxcomponents/vant/dist/cascader/index.wxml

@@ -0,0 +1,55 @@
+<wxs module="utils" src="./index.wxs"/>
+
+<view class="van-cascader__header" wx:if="{{ showHeader }}">
+    <slot name="title" wx:if="{{ useTitleSlot }}"></slot>
+    <text class="van-cascader__title" wx:else>{{ title }}</text>
+    <van-icon
+            bind:tap="onClose"
+            class="van-cascader__close-icon"
+            name="{{ closeIcon }}"
+            wx:if="{{ closeable }}"
+    />
+</view>
+
+<van-tabs
+        active="{{ activeTab }}"
+        bind:click="onClickTab"
+        border="{{ false }}"
+        color="{{ activeColor }}"
+        custom-class="van-cascader__tabs"
+        ellipsis="{{ ellipsis }}"
+        swipeable="{{ swipeable }}"
+        tab-class="van-cascader__tab"
+        wrap-class="van-cascader__tabs-wrap"
+>
+    <van-tab
+            style="width: 100%;"
+            title="{{ tab.selected ? tab.selected[textKey] : placeholder }}"
+            title-style="{{ !tab.selected ? 'color: #969799;font-weight:normal;' : '' }}"
+            wx:for="{{ tabs }}"
+            wx:for-index="tabIndex"
+            wx:for-item="tab"
+            wx:key="tabIndex"
+    >
+        <!-- 暂不支持 -->
+        <!-- <slot name="options-top"></slot> -->
+
+        <view class="van-cascader__options">
+            <view
+                    bind:tap="onSelect"
+                    class="{{ option.className }} {{ utils.optionClass(tab, valueKey, option) }}"
+                    data-option="{{ option }}"
+                    data-tab-index="{{ tabIndex }}"
+                    style="{{ utils.optionStyle({ tab, valueKey, option, activeColor }) }}"
+                    wx:for="{{ tab.options }}"
+                    wx:for-item="option"
+                    wx:key="index"
+            >
+                <text>{{ option[textKey] }}</text>
+                <van-icon name="success" size="18" wx:if="{{ utils.isSelected(tab, valueKey, option) }}"/>
+            </view>
+        </view>
+        <!-- 暂不支持 -->
+        <!-- <slot name="options-bottom"></slot> -->
+    </van-tab>
+</van-tabs>

+ 24 - 0
wxcomponents/vant/dist/cascader/index.wxs

@@ -0,0 +1,24 @@
+var utils = require('../wxs/utils.wxs');
+var style = require('../wxs/style.wxs');
+
+function isSelected(tab, valueKey, option) {
+  return tab.selected && tab.selected[valueKey] === option[valueKey]
+}
+
+function optionClass(tab, valueKey, option) {
+  return utils.bem('cascader__option', { selected: isSelected(tab, valueKey, option), disabled: option.disabled })
+}
+
+function optionStyle(data) {
+  var color = data.option.color || (isSelected(data.tab, data.valueKey, data.option) ? data.activeColor : undefined);
+  return style({
+    color
+  });
+}
+
+
+module.exports = {
+  isSelected: isSelected,
+  optionClass: optionClass,
+  optionStyle: optionStyle,
+};

+ 1 - 0
wxcomponents/vant/dist/cascader/index.wxss

@@ -0,0 +1 @@
+@import '../common/index.wxss';.van-cascader__header{align-items:center;display:flex;height:48px;justify-content:space-between;padding:0 16px}.van-cascader__title{font-size:16px;font-weight:600;line-height:20px}.van-cascader__close-icon{color:#c8c9cc;font-size:22px;height:22px}.van-cascader__tabs-wrap{height:48px!important;padding:0 8px}.van-cascader__tab{color:#323233!important;flex:none!important;font-weight:600!important;padding:0 8px!important}.van-cascader__tab--unselected{color:#969799!important;font-weight:400!important}.van-cascader__option{align-items:center;cursor:pointer;display:flex;font-size:14px;justify-content:space-between;line-height:20px;padding:10px 16px}.van-cascader__option:active{background-color:#f2f3f5}.van-cascader__option--selected{color:#1989fa;font-weight:600}.van-cascader__option--disabled{color:#c8c9cc;cursor:not-allowed}.van-cascader__option--disabled:active{background-color:initial}.van-cascader__options{-webkit-overflow-scrolling:touch;box-sizing:border-box;height:384px;overflow-y:auto;padding-top:6px}

+ 1 - 0
wxcomponents/vant/dist/cell-group/index.d.ts

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

+ 12 - 0
wxcomponents/vant/dist/cell-group/index.js

@@ -0,0 +1,12 @@
+import {VantComponent} from '../common/component';
+
+VantComponent({
+    props: {
+        title: String,
+        border: {
+            type: Boolean,
+            value: true,
+        },
+        inset: Boolean,
+    },
+});

+ 3 - 0
wxcomponents/vant/dist/cell-group/index.json

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

+ 11 - 0
wxcomponents/vant/dist/cell-group/index.wxml

@@ -0,0 +1,11 @@
+<wxs module="utils" src="../wxs/utils.wxs"/>
+
+<view
+        class="{{ utils.bem('cell-group__title', { inset }) }}"
+        wx:if="{{ title }}"
+>
+    {{ title }}
+</view>
+<view class="custom-class {{ utils.bem('cell-group', { inset }) }} {{ border ? 'van-hairline--top-bottom' : '' }}">
+    <slot/>
+</view>

+ 1 - 0
wxcomponents/vant/dist/cell-group/index.wxss

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

+ 1 - 0
wxcomponents/vant/dist/cell/index.d.ts

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

+ 39 - 0
wxcomponents/vant/dist/cell/index.js

@@ -0,0 +1,39 @@
+import {link} from '../mixins/link';
+import {VantComponent} from '../common/component';
+
+VantComponent({
+    classes: [
+        'title-class',
+        'label-class',
+        'value-class',
+        'right-icon-class',
+        'hover-class',
+    ],
+    mixins: [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,
+        },
+        titleStyle: String,
+    },
+    methods: {
+        onClick(event) {
+            this.$emit('click', event.detail);
+            this.jumpLink();
+        },
+    },
+});

+ 6 - 0
wxcomponents/vant/dist/cell/index.json

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

+ 47 - 0
wxcomponents/vant/dist/cell/index.wxml

@@ -0,0 +1,47 @@
+<wxs module="utils" src="../wxs/utils.wxs"/>
+<wxs module="computed" src="./index.wxs"/>
+
+<view
+        bind:tap="onClick"
+        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 }}"
+>
+    <van-icon
+            class="van-cell__left-icon-wrap"
+            custom-class="van-cell__left-icon"
+            name="{{ icon }}"
+            wx:if="{{ icon }}"
+    />
+    <slot name="icon" wx:else/>
+
+    <view
+            class="van-cell__title title-class"
+            style="{{ computed.titleStyle({ titleWidth, titleStyle }) }}"
+    >
+
+        <block wx:if="{{ title }}">{{ title }}</block>
+        <slot name="title" wx:else/>
+
+        <view class="van-cell__label label-class" wx:if="{{ label || useLabelSlot }}">
+            <slot name="label" wx:if="{{ useLabelSlot }}"/>
+            <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
+            class="van-cell__right-icon-wrap right-icon-class"
+            custom-class="van-cell__right-icon"
+            name="{{ arrowDirection ? 'arrow' + '-' + arrowDirection : 'arrow' }}"
+            wx:if="{{ isLink }}"
+    />
+    <slot name="right-icon" wx:else/>
+
+    <slot name="extra"/>
+</view>

+ 17 - 0
wxcomponents/vant/dist/cell/index.wxs

@@ -0,0 +1,17 @@
+/* eslint-disable */
+var style = require('../wxs/style.wxs');
+var addUnit = require('../wxs/add-unit.wxs');
+
+function titleStyle(data) {
+  return style([
+    {
+      'max-width': addUnit(data.titleWidth),
+      'min-width': addUnit(data.titleWidth),
+    },
+    data.titleStyle,
+  ]);
+}
+
+module.exports = {
+  titleStyle: titleStyle,
+};

File diff suppressed because it is too large
+ 0 - 0
wxcomponents/vant/dist/cell/index.wxss


+ 1 - 0
wxcomponents/vant/dist/checkbox-group/index.d.ts

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

+ 37 - 0
wxcomponents/vant/dist/checkbox-group/index.js

@@ -0,0 +1,37 @@
+import {useChildren} from '../common/relation';
+import {VantComponent} from '../common/component';
+
+VantComponent({
+    field: true,
+    relation: useChildren('checkbox', function (target) {
+        this.updateChild(target);
+    }),
+    props: {
+        max: Number,
+        value: {
+            type: Array,
+            observer: 'updateChildren',
+        },
+        disabled: {
+            type: Boolean,
+            observer: 'updateChildren',
+        },
+        direction: {
+            type: String,
+            value: 'vertical',
+        },
+    },
+    methods: {
+        updateChildren() {
+            this.children.forEach((child) => this.updateChild(child));
+        },
+        updateChild(child) {
+            const {value, disabled, direction} = this.data;
+            child.setData({
+                value: value.indexOf(child.data.name) !== -1,
+                parentDisabled: disabled,
+                direction,
+            });
+        },
+    },
+});

+ 3 - 0
wxcomponents/vant/dist/checkbox-group/index.json

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

+ 5 - 0
wxcomponents/vant/dist/checkbox-group/index.wxml

@@ -0,0 +1,5 @@
+<wxs module="utils" src="../wxs/utils.wxs"/>
+
+<view class="{{ utils.bem('checkbox-group', [{ horizontal: direction === 'horizontal' }]) }}">
+    <slot/>
+</view>

+ 6 - 0
wxcomponents/vant/dist/checkbox-group/index.wxss

@@ -0,0 +1,6 @@
+@import '../common/index.wxss';
+
+.van-checkbox-group--horizontal {
+    display: flex;
+    flex-wrap: wrap
+}

+ 1 - 0
wxcomponents/vant/dist/checkbox/index.d.ts

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

+ 77 - 0
wxcomponents/vant/dist/checkbox/index.js

@@ -0,0 +1,77 @@
+import {useParent} from '../common/relation';
+import {VantComponent} from '../common/component';
+
+function emit(target, value) {
+    target.$emit('input', value);
+    target.$emit('change', value);
+}
+
+VantComponent({
+    field: true,
+    relation: useParent('checkbox-group'),
+    classes: ['icon-class', 'label-class'],
+    props: {
+        value: Boolean,
+        disabled: Boolean,
+        useIconSlot: Boolean,
+        checkedColor: String,
+        labelPosition: {
+            type: String,
+            value: 'right',
+        },
+        labelDisabled: Boolean,
+        shape: {
+            type: String,
+            value: 'round',
+        },
+        iconSize: {
+            type: null,
+            value: 20,
+        },
+    },
+    data: {
+        parentDisabled: false,
+        direction: 'vertical',
+    },
+    methods: {
+        emitChange(value) {
+            if (this.parent) {
+                this.setParentValue(this.parent, value);
+            } else {
+                emit(this, value);
+            }
+        },
+        toggle() {
+            const {parentDisabled, disabled, value} = this.data;
+            if (!disabled && !parentDisabled) {
+                this.emitChange(!value);
+            }
+        },
+        onClickLabel() {
+            const {labelDisabled, parentDisabled, disabled, value} = this.data;
+            if (!disabled && !labelDisabled && !parentDisabled) {
+                this.emitChange(!value);
+            }
+        },
+        setParentValue(parent, value) {
+            const parentValue = parent.data.value.slice();
+            const {name} = this.data;
+            const {max} = parent.data;
+            if (value) {
+                if (max && parentValue.length >= max) {
+                    return;
+                }
+                if (parentValue.indexOf(name) === -1) {
+                    parentValue.push(name);
+                    emit(parent, parentValue);
+                }
+            } else {
+                const index = parentValue.indexOf(name);
+                if (index !== -1) {
+                    parentValue.splice(index, 1);
+                    emit(parent, parentValue);
+                }
+            }
+        },
+    },
+});

+ 6 - 0
wxcomponents/vant/dist/checkbox/index.json

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

+ 31 - 0
wxcomponents/vant/dist/checkbox/index.wxml

@@ -0,0 +1,31 @@
+<wxs module="utils" src="../wxs/utils.wxs"/>
+<wxs module="computed" src="./index.wxs"/>
+
+<view class="{{ utils.bem('checkbox', [{ horizontal: direction === 'horizontal' }]) }} custom-class">
+    <view
+            bindtap="onClickLabel"
+            class="label-class {{ utils.bem('checkbox__label', [labelPosition, { disabled: disabled || parentDisabled }]) }}"
+            wx:if="{{ labelPosition === 'left' }}"
+    >
+        <slot/>
+    </view>
+    <view bindtap="toggle" class="van-checkbox__icon-wrap">
+        <slot name="icon" wx:if="{{ useIconSlot }}"/>
+        <van-icon
+                class="{{ utils.bem('checkbox__icon', [shape, { disabled: disabled || parentDisabled, checked: value }]) }}"
+                custom-class="icon-class"
+                custom-style="line-height: 1.25em;"
+                name="success"
+                size="0.8em"
+                style="{{ computed.iconStyle(checkedColor, value, disabled, parentDisabled, iconSize) }}"
+                wx:else
+        />
+    </view>
+    <view
+            bindtap="onClickLabel"
+            class="label-class {{ utils.bem('checkbox__label', [labelPosition, { disabled: disabled || parentDisabled }]) }}"
+            wx:if="{{ labelPosition === 'right' }}"
+    >
+        <slot/>
+    </view>
+</view>

+ 20 - 0
wxcomponents/vant/dist/checkbox/index.wxs

@@ -0,0 +1,20 @@
+/* eslint-disable */
+var style = require('../wxs/style.wxs');
+var addUnit = require('../wxs/add-unit.wxs');
+
+function iconStyle(checkedColor, value, disabled, parentDisabled, iconSize) {
+  var styles = {
+    'font-size': addUnit(iconSize),
+  };
+
+  if (checkedColor && value && !disabled && !parentDisabled) {
+    styles['border-color'] = checkedColor;
+    styles['background-color'] = checkedColor;
+  }
+
+  return style(styles);
+}
+
+module.exports = {
+  iconStyle: iconStyle,
+};

+ 1 - 0
wxcomponents/vant/dist/checkbox/index.wxss

@@ -0,0 +1 @@
+@import '../common/index.wxss';.van-checkbox{align-items:center;display:flex;overflow:hidden;-webkit-user-select:none;user-select:none}.van-checkbox--horizontal{margin-right:12px}.van-checkbox__icon-wrap,.van-checkbox__label{line-height:var(--checkbox-size,20px)}.van-checkbox__icon-wrap{flex:none}.van-checkbox__icon{align-items:center;border:1px solid var(--checkbox-border-color,#c8c9cc);box-sizing:border-box;color:transparent;display:flex;font-size:var(--checkbox-size,20px);height:1em;justify-content:center;text-align:center;transition-duration:var(--checkbox-transition-duration,.2s);transition-property:color,border-color,background-color;width:1em}.van-checkbox__icon--round{border-radius:100%}.van-checkbox__icon--checked{background-color:var(--checkbox-checked-icon-color,#1989fa);border-color:var(--checkbox-checked-icon-color,#1989fa);color:#fff}.van-checkbox__icon--disabled{background-color:var(--checkbox-disabled-background-color,#ebedf0);border-color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__icon--disabled.van-checkbox__icon--checked{color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__label{word-wrap:break-word;color:var(--checkbox-label-color,#323233);padding-left:var(--checkbox-label-margin,10px)}.van-checkbox__label--left{float:left;margin:0 var(--checkbox-label-margin,10px) 0 0}.van-checkbox__label--disabled{color:var(--checkbox-disabled-label-color,#c8c9cc)}.van-checkbox__label:empty{margin:0}

+ 6 - 0
wxcomponents/vant/dist/circle/canvas.d.ts

@@ -0,0 +1,6 @@
+/// <reference types="miniprogram-api-typings" />
+type CanvasContext = WechatMiniprogram.CanvasContext;
+
+export declare function adaptor(ctx: CanvasContext & Record<string, unknown>): CanvasContext;
+
+export {};

+ 45 - 0
wxcomponents/vant/dist/circle/canvas.js

@@ -0,0 +1,45 @@
+export function adaptor(ctx) {
+    // @ts-ignore
+    return Object.assign(ctx, {
+        setStrokeStyle(val) {
+            ctx.strokeStyle = val;
+        },
+        setLineWidth(val) {
+            ctx.lineWidth = val;
+        },
+        setLineCap(val) {
+            ctx.lineCap = val;
+        },
+        setFillStyle(val) {
+            ctx.fillStyle = val;
+        },
+        setFontSize(val) {
+            ctx.font = String(val);
+        },
+        setGlobalAlpha(val) {
+            ctx.globalAlpha = val;
+        },
+        setLineJoin(val) {
+            ctx.lineJoin = val;
+        },
+        setTextAlign(val) {
+            ctx.textAlign = val;
+        },
+        setMiterLimit(val) {
+            ctx.miterLimit = val;
+        },
+        setShadow(offsetX, offsetY, blur, color) {
+            ctx.shadowOffsetX = offsetX;
+            ctx.shadowOffsetY = offsetY;
+            ctx.shadowBlur = blur;
+            ctx.shadowColor = color;
+        },
+        setTextBaseline(val) {
+            ctx.textBaseline = val;
+        },
+        createCircularGradient() {
+        },
+        draw() {
+        },
+    });
+}

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