Browse Source

抖音支付接入

zhangyujun 3 years ago
parent
commit
5fe9493b9d
100 changed files with 529 additions and 7075 deletions
  1. 32 6
      package-lock.json
  2. 4 1
      package.json
  3. 29 13
      src/api/modules/buy.js
  4. 0 1
      src/api/modules/open.js
  5. 9 1
      src/api/modules/user.js
  6. 1 1
      src/api/request.js
  7. 1 0
      src/main.js
  8. 6 2
      src/otherPages/beforeMockExam/index.vue
  9. 53 10
      src/otherPages/buyVip/index.vue
  10. 1 0
      src/otherPages/classifyChoose/index.vue
  11. 44 0
      src/otherPages/exercise/components/tabbar.vue
  12. 95 7
      src/otherPages/exercise/index.vue
  13. 1 1
      src/otherPages/mockExam/index.vue
  14. 9 0
      src/pages.json
  15. 1 1
      src/pages/carVideo/components/branchOne.vue
  16. 15 12
      src/pages/carVideo/components/branchTwo.vue
  17. 3 2
      src/pages/carVideo/components/videoListBox.vue
  18. 87 17
      src/pages/carVideo/index.vue
  19. 64 0
      src/pages/carVideo/videoList.vue
  20. 18 3
      src/pages/user/index.vue
  21. 50 0
      src/store/getters.js
  22. 6 4
      src/store/modules/user.js
  23. 0 71
      src/ttcomponents/common/README.md
  24. 0 7
      src/ttcomponents/common/color.js
  25. 0 59
      src/ttcomponents/common/component.js
  26. 0 40
      src/ttcomponents/common/demo.vue
  27. 0 27
      src/ttcomponents/common/index.less
  28. 0 12
      src/ttcomponents/common/main.ttss
  29. 0 5
      src/ttcomponents/common/style/clearfix.less
  30. 0 13
      src/ttcomponents/common/style/ellipsis.less
  31. 0 41
      src/ttcomponents/common/style/hairline.less
  32. 0 7
      src/ttcomponents/common/style/mixins/clearfix.less
  33. 0 15
      src/ttcomponents/common/style/mixins/ellipsis.less
  34. 0 40
      src/ttcomponents/common/style/mixins/hairline.less
  35. 0 6
      src/ttcomponents/common/style/theme.less
  36. 0 656
      src/ttcomponents/common/style/var.less
  37. 0 68
      src/ttcomponents/common/utils.js
  38. 0 39
      src/ttcomponents/common/validator.js
  39. 0 38
      src/ttcomponents/common/version.js
  40. 0 37
      src/ttcomponents/dashboard/index.vue
  41. 0 32
      src/ttcomponents/mixins/basic.js
  42. 0 16
      src/ttcomponents/mixins/button.js
  43. 0 18
      src/ttcomponents/mixins/link.js
  44. 0 31
      src/ttcomponents/mixins/open-type.js
  45. 0 39
      src/ttcomponents/mixins/page-scroll.js
  46. 0 96
      src/ttcomponents/mixins/relation.js
  47. 0 42
      src/ttcomponents/mixins/touch.js
  48. 0 188
      src/ttcomponents/mixins/transition.js
  49. 0 19
      src/ttcomponents/utils/index.js
  50. 0 201
      src/ttcomponents/van-action-sheet/README.md
  51. 0 134
      src/ttcomponents/van-action-sheet/demo.vue
  52. 0 74
      src/ttcomponents/van-action-sheet/index.less
  53. 0 155
      src/ttcomponents/van-action-sheet/van-action-sheet.vue
  54. 0 159
      src/ttcomponents/van-button/README.md
  55. 0 75
      src/ttcomponents/van-button/demo.vue
  56. 0 180
      src/ttcomponents/van-button/index.less
  57. 0 174
      src/ttcomponents/van-button/van-button.vue
  58. 0 11
      src/ttcomponents/van-cell-group/index.less
  59. 0 33
      src/ttcomponents/van-cell-group/van-cell-group.vue
  60. 0 156
      src/ttcomponents/van-cell/README.md
  61. 0 108
      src/ttcomponents/van-cell/demo.vue
  62. 0 113
      src/ttcomponents/van-cell/index.less
  63. 0 125
      src/ttcomponents/van-cell/van-cell.vue
  64. 0 1
      src/ttcomponents/van-checkbox-group/index.less
  65. 0 56
      src/ttcomponents/van-checkbox-group/van-checkbox-group.vue
  66. 0 265
      src/ttcomponents/van-checkbox/README.md
  67. 0 189
      src/ttcomponents/van-checkbox/demo.vue
  68. 0 73
      src/ttcomponents/van-checkbox/index.less
  69. 0 196
      src/ttcomponents/van-checkbox/van-checkbox.vue
  70. 0 105
      src/ttcomponents/van-circle/README.md
  71. 0 42
      src/ttcomponents/van-circle/canvas.js
  72. 0 61
      src/ttcomponents/van-circle/demo.vue
  73. 0 19
      src/ttcomponents/van-circle/index.less
  74. 0 266
      src/ttcomponents/van-circle/van-circle.vue
  75. 0 65
      src/ttcomponents/van-col/README.md
  76. 0 53
      src/ttcomponents/van-col/demo.vue
  77. 0 15
      src/ttcomponents/van-col/index.less
  78. 0 58
      src/ttcomponents/van-col/van-col.vue
  79. 0 169
      src/ttcomponents/van-count-down/README.md
  80. 0 93
      src/ttcomponents/van-count-down/demo.vue
  81. 0 8
      src/ttcomponents/van-count-down/index.less
  82. 0 65
      src/ttcomponents/van-count-down/utils.js
  83. 0 140
      src/ttcomponents/van-count-down/van-count-down.vue
  84. 0 260
      src/ttcomponents/van-dialog/README.md
  85. 0 140
      src/ttcomponents/van-dialog/demo.vue
  86. 0 132
      src/ttcomponents/van-dialog/dialog.js
  87. 0 86
      src/ttcomponents/van-dialog/index.less
  88. 0 408
      src/ttcomponents/van-dialog/van-dialog.vue
  89. 0 73
      src/ttcomponents/van-divider/README.md
  90. 0 32
      src/ttcomponents/van-divider/demo.vue
  91. 0 66
      src/ttcomponents/van-divider/index.less
  92. 0 51
      src/ttcomponents/van-divider/van-divider.vue
  93. 0 78
      src/ttcomponents/van-empty/README.md
  94. 0 64
      src/ttcomponents/van-empty/demo.vue
  95. 0 49
      src/ttcomponents/van-empty/index.less
  96. 0 51
      src/ttcomponents/van-empty/van-empty.vue
  97. 0 7
      src/ttcomponents/van-goods-action-button/host.less
  98. 0 64
      src/ttcomponents/van-goods-action-button/index.less
  99. 0 110
      src/ttcomponents/van-goods-action-button/van-goods-action-button.vue
  100. 0 23
      src/ttcomponents/van-goods-action-icon/index.less

+ 32 - 6
package-lock.json

@@ -1656,6 +1656,13 @@
         "moment": "^2.24.0",
         "qr-image": "^3.2.0",
         "webpack": "^4.29.5"
+      },
+      "dependencies": {
+        "jsrsasign": {
+          "version": "7.2.2",
+          "resolved": "https://registry.npmjs.org/jsrsasign/-/jsrsasign-7.2.2.tgz",
+          "integrity": "sha1-rlIwy1V0RRu5eanMaXQoxg9ZjSA="
+        }
       }
     },
     "@hap-toolkit/server": {
@@ -5592,9 +5599,9 @@
       }
     },
     "crypto-js": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npm.taobao.org/crypto-js/download/crypto-js-4.0.0.tgz",
-      "integrity": "sha1-KQSrJnep0EKFai6i74DekuSjbcw="
+      "version": "4.1.1",
+      "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.1.1.tgz",
+      "integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw=="
     },
     "css": {
       "version": "2.2.4",
@@ -10384,6 +10391,11 @@
         }
       }
     },
+    "jsencrypt": {
+      "version": "3.2.1",
+      "resolved": "https://registry.npmjs.org/jsencrypt/-/jsencrypt-3.2.1.tgz",
+      "integrity": "sha512-k1sD5QV0KPn+D8uG9AdGzTQuamt82QZ3A3l6f7TRwMU6Oi2Vg0BsL+wZIQBONcraO1pc78ExMdvmBBJ8WhNYUA=="
+    },
     "jsesc": {
       "version": "2.5.2",
       "resolved": "https://registry.npm.taobao.org/jsesc/download/jsesc-2.5.2.tgz?cache=0&sync_timestamp=1603891232110&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjsesc%2Fdownload%2Fjsesc-2.5.2.tgz",
@@ -10429,6 +10441,11 @@
         "minimist": "^1.2.0"
       }
     },
+    "jsonc-parser": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz",
+      "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA=="
+    },
     "jsonfile": {
       "version": "4.0.0",
       "resolved": "https://registry.npm.taobao.org/jsonfile/download/jsonfile-4.0.0.tgz?cache=0&sync_timestamp=1604161797011&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjsonfile%2Fdownload%2Fjsonfile-4.0.0.tgz",
@@ -10449,9 +10466,18 @@
       }
     },
     "jsrsasign": {
-      "version": "7.2.2",
-      "resolved": "https://registry.npm.taobao.org/jsrsasign/download/jsrsasign-7.2.2.tgz",
-      "integrity": "sha1-rlIwy1V0RRu5eanMaXQoxg9ZjSA="
+      "version": "10.5.20",
+      "resolved": "https://registry.npmjs.org/jsrsasign/-/jsrsasign-10.5.20.tgz",
+      "integrity": "sha512-YHL6y8o6cnRoxwUY0eGpfvwj0pm9o0NToD4KXVp2UJC19oXSR2RgnSdSMplIRRKFovLAJGrAHqdb5MMznnhQDQ=="
+    },
+    "jsrsasign-util": {
+      "version": "1.0.5",
+      "resolved": "https://registry.npmjs.org/jsrsasign-util/-/jsrsasign-util-1.0.5.tgz",
+      "integrity": "sha512-e5Kp8aaT5GH2c5X8j4uaJruYmT4GcnaGb47nw8m60YqPywtnOtTISZ9hZgtZ3a+jh7B27bU2LCf3Y32wZyfhtQ==",
+      "requires": {
+        "jsonc-parser": ">= 0.0.1",
+        "jsrsasign": ">= 4.8.2"
+      }
     },
     "jszip": {
       "version": "3.6.0",

+ 4 - 1
package.json

@@ -61,9 +61,12 @@
     "axios-miniprogram-adapter": "^0.3.2",
     "axios-mock-adapter": "^1.19.0",
     "core-js": "^3.6.5",
-    "crypto-js": "^4.0.0",
+    "crypto-js": "^4.1.1",
     "dayjs": "^1.10.5",
     "flyio": "^0.6.2",
+    "jsencrypt": "^3.2.1",
+    "jsrsasign": "^10.5.20",
+    "jsrsasign-util": "^1.0.5",
     "mockjs": "^1.1.0",
     "node-sass": "^4.14.1",
     "qrcode": "^1.4.4",

+ 29 - 13
src/api/modules/buy.js

@@ -1,6 +1,6 @@
 import request from '../request'
 
-const buy={
+const buy = {
 	/**
 	 * 逆地理编码
 	 * @param {
@@ -8,28 +8,44 @@ const buy={
 		 ...其他参数去高德官网看
 	 } params
 	 */
-    //微信支付的接口
-     studentXcxWxPrepareOrder(data) {
+	//微信支付的接口
+	studentXcxWxPrepareOrder(data) {
 		return request({
 			url: '/student/xcx/wx/prepareOrder',
 			method: 'POST',
 			data
 		})
 	},
-    //查询商品字典的接口
-    systemDictDataType(dictType){
-        return request({
-            url:'/system/dict/data/type/'+dictType,
-            method:'GET'
-        })
-    },
+	//查询商品字典的接口
+	systemDictDataType(dictType) {
+		return request({
+			url: '/system/dict/data/type/' + dictType,
+			method: 'GET'
+		})
+	},
 	//查询是否开启ios支付的接口
-	systemConfigConfigKeyIos_vip_open(){
+	systemConfigConfigKeyIos_vip_open() {
+		return request({
+			url: "system/config/configKey/ios_vip_open",
+			method: "GET"
+		})
+	},
+	//系统参数查询
+	systemConfigConfigKey(key) {
 		return request({
-			url:"system/config/configKey/ios_vip_open",
-			method:"GET"
+			url: "system/config/configKey/" + key,
+			method: "GET"
+		})
+	},
+	//头条支付
+	studentTtPrepareOrder() {
+		return request({
+			url: "student/tt/prepareOrder",
+			method: "post"
 		})
 	}
+
+
 }
 
 export default buy

+ 0 - 1
src/api/modules/open.js

@@ -1,6 +1,5 @@
 import request from '../request'
 //金牌车教的open api
-// const openBaseUrl1 = process.env.NODE_ENV==='development'?"https://jpcj-admin1.zzxcx.net/twzd-admin/open-api":"https://jpcj-admin.zzxcx.net/twzd-admin/open-api"
 const open = {
     //open-api/teachingVideo/info/treeList
     //获取视频列表

+ 9 - 1
src/api/modules/user.js

@@ -14,7 +14,6 @@ const user = {
 		let res = await wx.login()
 		//#endif
 
-		console.log(res)
 		return request({
 			//#ifdef MP-WEIXIN
 			url: `/login/jscode`,
@@ -91,6 +90,15 @@ const user = {
 			method:'GET'
 		})
 
+	},
+	//更新用户信息
+	userInfoUserInfo(params){
+		return request({
+			url:'/user/info/userInfo',
+			method:'PUT',
+			params
+		})
+
 	}
 }
 

+ 1 - 1
src/api/request.js

@@ -15,7 +15,7 @@ const service = axios.create({
 	baseURL: process.env.NODE_ENV === 'development' ? 'https://jpcj-admin1.zzxcx.net/stage-api' : 'https://jpcj-admin.zzxcx.net/prod-api',
 	//#endif
 	//#ifdef MP-TOUTIAO
-	baseURL: process.env.NODE_ENV === 'development' ? 'https://sdjk-admin1.zzxcx.net/stage-api' : 'https://sdjk-admin1.zzxcx.net/prod-api',
+	baseURL: process.env.NODE_ENV === 'development' ? 'https://sdjk-admin1.zzxcx.net/stage-api' : 'https://sdjk-admin1.zzxcx.net/stage-api',
 	//#endif
 })
 mock.init(service)

+ 1 - 0
src/main.js

@@ -10,6 +10,7 @@ import 'vant-weapp-convert-uniapp/components/common/index.less'
 Vue.config.productionTip = false
 App.mpType = 'app'
 
+
 //goPageGetData中存在this需要引用当前
 Vue.prototype.goPageGetData = utils.goPageGetData
 //挂载工具类

+ 6 - 2
src/otherPages/beforeMockExam/index.vue

@@ -25,6 +25,7 @@
         <span>合格标准</span>
         <span>90分及格</span>
       </div>
+      <!-- #ifdef MP-WEIXIN-->
       <div class="class">
         <span>学员姓名</span>
         <span>
@@ -37,6 +38,7 @@
           />
         </span>
       </div>
+      <!-- #endif -->
       <div class="remind">
         答题后不可修改,累计错题扣分导致分数不及格时,系统自动交卷,考试不通过。
       </div>
@@ -67,16 +69,18 @@ export default {
   methods: {
     goMockExam(e) {},
     gotoNextPage(e) {
-      let query = Object.assign({},this.query)
-      query.title = "模拟考试"
+      let query = Object.assign({}, this.query);
+      query.title = "模拟考试";
       uni.navigateTo({
         url: "/otherPages/mockExam/index?" + utils.mapToUrlQuery(query),
       });
+      //  #ifdef MP-WEIXIN
       api.user
         .studentUserRealname({
           realName: this.realName,
         })
         .then((res) => {});
+      //  #endif
     },
   },
 };

+ 53 - 10
src/otherPages/buyVip/index.vue

@@ -35,8 +35,10 @@
       </div>
       <div class="button-box">
         <div v-if="!isIos" class="button" @click="buy">立即开通</div>
-        <div v-if="isIos&&!ios_vip_open" class="button_gray">ios不支持</div>
-        <div v-if="isIos&&ios_vip_open" class="button" @click="buy">立即开通</div>
+        <div v-if="isIos && !ios_vip_open" class="button_gray">ios不支持</div>
+        <div v-if="isIos && ios_vip_open" class="button" @click="buy">
+          立即开通
+        </div>
       </div>
       <div style="height: 60px"></div>
     </div>
@@ -49,8 +51,8 @@ import api from "@/api/index";
 export default {
   data() {
     return {
-      isIos:false,
-      ios_vip_open:0,
+      isIos: false,
+      ios_vip_open: 0,
       goodsList: [
         {
           searchValue: null,
@@ -116,6 +118,9 @@ export default {
   },
   methods: {
     buy(e) {
+      //studentTtPrepareOrder
+
+      //#ifdef MP-WEIXIN
       api.buy
         .studentXcxWxPrepareOrder({
           dictCode: this.goodsList[this.goodsIndex].dictCode,
@@ -125,18 +130,56 @@ export default {
             ...res.data,
           });
         });
+      //#endif
+      //#ifdef MP-TOUTIAO
+      api.buy.studentTtPrepareOrder().then((res) => {
+        uni.pay({
+          orderInfo:res.data,
+          service:5
+        });
+      });
+
+      //#endif
     },
   },
   mounted() {
-    const systemInfo = wx.getSystemInfoSync()
-    console.log(systemInfo)
-    api.buy.systemConfigConfigKeyIos_vip_open().then(res=>{
-      this.ios_vip_open = Number(res.data)
-    })
-    this.isIos = systemInfo.platform=='ios'
+    const systemInfo = wx.getSystemInfoSync();
+    console.log(systemInfo);
+    api.buy.systemConfigConfigKeyIos_vip_open().then((res) => {
+      this.ios_vip_open = Number(res.data);
+    });
+    this.isIos = systemInfo.platform == "ios";
+    //#ifdef MP-WEIXIN
     api.buy.systemDictDataType("vip_type_price").then((res) => {
       this.goodsList = res.data;
     });
+    //#endif
+    //#ifdef MP-TOUTIAO
+    this.goodsIndex=0
+    api.buy.systemConfigConfigKey("vip_price").then((res) => {
+      this.goodsList = [
+        {
+          searchValue: null,
+          createBy: "admin",
+          createTime: "2021-11-18 18:01:26",
+          updateTime: null,
+          updateBy: null,
+          remark: null,
+          params: {},
+          dictCode: 29,
+          dictSort: 0,
+          dictLabel: "终身会员",
+          dictValue: res.data + "," + "0.2",
+          dictType: "vip_type_price",
+          cssClass: null,
+          listClass: null,
+          isDefault: "N",
+          status: "0",
+          default: false,
+        },
+      ];
+    });
+    //#endif
   },
 };
 // import { getVipPrice, prepareOrder } from "@/api";

+ 1 - 0
src/otherPages/classifyChoose/index.vue

@@ -21,6 +21,7 @@
           () => {
             goExercise({
               excellIssueName: item.excellIssueName,
+              sort:2
             });
           }
         "

+ 44 - 0
src/otherPages/exercise/components/tabbar.vue

@@ -0,0 +1,44 @@
+<template>
+  <view
+    class="box"
+    :style="{
+      height: height,
+      lineHeight:height
+    }"
+  >
+    <slot></slot>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {};
+  },
+  methods: {
+    name() {},
+  },
+  props: {
+    height: {
+      type: String,
+      default: "0rpx",
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.box{
+    width: 100%;
+    display:flex;
+    justify-content: space-between;
+    overflow: scroll;
+    position: fixed;
+    bottom: 0;
+    font-size: 14px;
+
+
+}
+
+
+</style>

+ 95 - 7
src/otherPages/exercise/index.vue

@@ -10,9 +10,11 @@
         problemList[problemListIndex].questionType | questionType
       }}</span>
       <!-- <text>{{ problemListIndex + 1 }}、</text> -->
-      <text class="problem-issue">{{
-        problemList[problemListIndex].issue
-      }}</text>
+      <text class="problem-issue"
+        >{{ problemListIndex + 1 }}.{{
+          problemList[problemListIndex].issue
+        }}</text
+      >
       <view v-if="problemList[problemListIndex].image" class="problem-img">
         <image
           mode="widthFix"
@@ -214,8 +216,8 @@
       :explainjsmp3="problemList[problemListIndex].explainjsmp3"
       :show="explainJsVisible"
     ></explainJs>
-
-    <van-tabbar>
+    <!-- #ifdef MP-WEIXIN -->
+    <van-tabbar height="20px">
       <van-tabbar-item @click="goBeforeTopics"
         ><van-icon
           slot="icon"
@@ -261,6 +263,61 @@
         />下一题
       </van-tabbar-item>
     </van-tabbar>
+    <!-- #endif -->
+    <!-- #ifdef MP-TOUTIAO -->
+    <tabbar height="35px">
+      <view @click="goBeforeTopics" class="flex-all-center h-full">
+        <van-icon
+          slot="icon"
+          custom-style="transform: rotate(90deg);"
+          custom-class="last-subject"
+          name="down"
+          size="18px"
+        /><text> 上一题 </text>
+      </view>
+      <view class="flex-all-center h-full">
+        <icon
+          class="icon-box-img"
+          color="#06c05f"
+          type="success"
+          size="18px"
+        ></icon
+        ><text style="margin-left: 5rpx">{{ trueNum }}</text>
+      </view>
+      <view class="flex-all-center h-full">
+        <icon class="icon-box-img" type="clear" size="18px"></icon>
+        <text style="margin-left: 5rpx">{{ falseNum }}</text>
+      </view>
+      <view class="flex-all-center h-full">
+        <van-icon size="18px" name="description" />{{ problemListIndex + 1 }}/{{
+          problemListTotal
+        }}
+      </view>
+
+      <view
+        @click="
+          () => {
+            explainJsVisible = true;
+          }
+        "
+        class="flex-all-center h-full"
+      >
+        <icon type="warn" size="18px" /><text style="margin-left: 5rpx"
+          >解释</text
+        >
+      </view>
+
+      <view @click="goNextTopics" class="flex-all-center h-full">
+        下一题
+        <van-icon
+          custom-style="transform: rotate(-90deg);"
+          custom-class="last-subject"
+          name="down"
+          size="18px"
+        />
+      </view>
+    </tabbar>
+    <!-- #endif -->
   </view>
 </template>
 <script>
@@ -268,6 +325,7 @@ import navBar from "./components/navBar.vue";
 import api from "@/api/index";
 import utils from "@/utils/index";
 import explainJs from "./components/explainJs.vue";
+import tabbar from "./components/tabbar.vue";
 export default {
   data() {
     return {
@@ -294,6 +352,7 @@ export default {
       touchy: 0,
       problemList: [
         {
+          questionType: 2,
           answer: "×",
           answerkeyword: "",
           answermp3:
@@ -530,7 +589,8 @@ export default {
       });
     },
     changeRadioGroup(e) {
-      console.log(e);
+      console.log(e, "changeRadioGroup");
+      // #ifdef MP-WEIXIN
       this.$set(this.problemList[this.problemListIndex], "isCompleted", true);
       this.$set(
         this.problemList[this.problemListIndex],
@@ -546,7 +606,25 @@ export default {
       e.detail.value === this.problemList[this.problemListIndex].answer
         ? (this.trueNum = this.trueNum + 1)
         : (this.falseNum = this.falseNum + 1);
-      // this.problemList[this.problemListIndex].optsArr
+      //#endif
+
+      // #ifdef MP-TOUTIAO
+      this.$set(this.problemList[this.problemListIndex], "isCompleted", true);
+      this.$set(
+        this.problemList[this.problemListIndex],
+        "userAnswer",
+        e.value
+      );
+      e.selected = true;
+      this.$set(
+        this.problemList[this.problemListIndex].optsArr,
+        e.index,
+        e
+      );
+      e.value === this.problemList[this.problemListIndex].answer
+        ? (this.trueNum = this.trueNum + 1)
+        : (this.falseNum = this.falseNum + 1);
+      //#endif
     },
     changeCheckbox(e) {
       // console.log(e);
@@ -612,6 +690,7 @@ export default {
   components: {
     navBar,
     explainJs,
+    tabbar,
   },
 };
 </script>
@@ -622,6 +701,15 @@ export default {
   height: 24rpx;
   background-color: #f2f3f5;
 }
+.h-full {
+  height: 100%;
+}
+.flex-all-center {
+  display: flex;
+  justify-content: center;
+  align-content: center;
+  align-items: center;
+}
 .flex-center {
   display: flex;
   justify-content: center;

+ 1 - 1
src/otherPages/mockExam/index.vue

@@ -414,7 +414,7 @@ export default {
     },
   },
   destroyed() {
-    clearInterval(examTimeUse);
+    clearInterval(this.examTimer);
   },
 
   components: {

+ 9 - 0
src/pages.json

@@ -15,6 +15,14 @@
         "navigationStyle": "custom"
       }
     },
+    {
+      "path": "pages/carVideo/videoList",
+      "style": {
+        "navigationBarTitleText": "学车视频",
+        "enablePullDownRefresh": false,
+        "navigationStyle": "custom"
+      }
+    },
     {
       "path": "pages/extraWeb/index",
       "style": {}
@@ -318,6 +326,7 @@
     // #endif
     // #ifdef MP-TOUTIAO
     "usingComponents": {
+    
 
     }
     // #endif

+ 1 - 1
src/pages/carVideo/components/branchOne.vue

@@ -40,7 +40,7 @@
 			// let {
 			// 	data: bannerListData
 			// } = await this.$api.home.getHomePageDataList(['carouselChart'])
-			// this.sidebarOnChange({detail:this.activeKey})
+			this.sidebarOnChange({detail:this.activeKey})
 			// this.bannerList = bannerListData.carouselChart
 			this.$nextTick(() => {
 				this.loading = false

+ 15 - 12
src/pages/carVideo/components/branchTwo.vue

@@ -3,14 +3,16 @@
   <view v-else class="vant-tab">
     <!-- <m-banner :bannerList="bannerList" height="150"></m-banner> -->
     <!-- <ShortVideo type="slide" class="top-margin"></ShortVideo> -->
-    <view v-for="(item, index) in carVideoList" :key="index">
-      <m-video-row2
-        :column="[2, 1, 3][index % 3]"
-        :type="[2, 1, 3][index % 3] == 1 ? 'left-right' : 'top-bottom'"
-        :carVideoList="item"
-        v-if="item.children.length == 0"
-      />
-      <VideoListBox :carVideoList="item" v-else />
+    <view>
+      <view v-for="(item, index) in carVideoList" :key="index">
+        <m-video-row2
+          :column="[2, 1, 3][index % 3]"
+          :type="[2, 1, 3][index % 3] == 1 ? 'left-right' : 'top-bottom'"
+          :carVideoList="item"
+          v-if="item.children.length == 0"
+        />
+        <VideoListBox :carVideoList="item" v-else />
+      </view>
     </view>
   </view>
 </template>
@@ -21,15 +23,14 @@ import VideoListBox from "./videoListBox.vue";
 export default {
   components: {
     ShortVideo,
-    VideoListBox
-
+    VideoListBox,
   },
   props: {
     carVideoList: {
       type: Array,
     },
   },
-  mounted () {
+  mounted() {
     console.log(this.carVideoList);
   },
   data: () => ({
@@ -49,7 +50,9 @@ export default {
 </script>
 
 <style lang="scss">
-
+.vant-tab{
+  width: 100%;
+}
 .top-margin {
   margin-top: 10px;
 }

+ 3 - 2
src/pages/carVideo/components/videoListBox.vue

@@ -5,7 +5,7 @@
 			<view class="video-item" @click="gotoPaly(currentItem.list[0])">
 				<view class="image-box">
 					<view class="img-box">
-						<image  class="image" :src="currentItem.list[0].cover" mode="aspectFill"></image>
+						<image  class="image"  :src="currentItem.list[0].cover" mode="aspectFill"></image>
 					</view>
 					<image v-if="currentItem.list[0].permission==1" class="img-tip" :src="shikan"></image>
 					<image v-if="currentItem.list[0].permission==2" class="img-tip" :src="vip"></image>
@@ -68,9 +68,10 @@ import vip from "@/assets/img/vip.png";
 		background-color: #FFFFFF;
 
 		.tabs-box {
-			margin: 5px 15px;
+			padding: 5px 15px;
 			border-radius: 10px;
 			overflow: hidden;
+			width: 100%;
 		}
 		
 		.tabs-bfc{

+ 87 - 17
src/pages/carVideo/index.vue

@@ -162,20 +162,41 @@
     <!-- #endif -->
     <!-- #ifdef MP-TOUTIAO -->
     <view class="tabTitle">
-      
-
+      <view
+        :style="{
+          left: active * 25 + '%',
+        }"
+        class="rect"
+      >
+        <view class="rect-color"> </view>
+      </view>
+      <view
+        @click="
+          () => {
+            active = index;
+          }
+        "
+        v-for="(item, index) in subjectMap"
+        :key="index"
+        class="tabTitle-row"
+      >
+        {{ item }}
+      </view>
     </view>
     <view class="tab">
       <swiper
+        scroll-x
+        id="tabs"
+        circular
         :current="active"
+        :scroll-left="50"
         @change="
           (e) => {
             active = e.detail.current;
           }
         "
-        style="height: 800rpx"
       >
-        <swiper-item id="tab1" style="display: inline-block">
+        <swiper-item id="tab1" style="display: inline-block; width: 100%">
           <view class="tab-container">
             <tab-left
               :subject="1"
@@ -195,7 +216,7 @@
           </view>
         </swiper-item>
 
-        <swiper-item id="tab2" style="display: inline-block">
+        <swiper-item id="tab2" style="display: inline-block; width: 100%">
           <view v-for="(item, index) in typeList" :key="index">
             <branch-two
               v-if="index == 1"
@@ -204,7 +225,7 @@
           </view>
         </swiper-item>
 
-        <swiper-item id="tab3" style="display: inline-block">
+        <swiper-item id="tab3" style="display: inline-block; width: 100%">
           <van-grid column-num="4">
             <van-grid-item
               @click="goLightMock"
@@ -220,7 +241,7 @@
             ></branch-two>
           </view>
         </swiper-item>
-        <swiper-item id="tab4" style="display: inline-block">
+        <swiper-item id="tab4" style="display: inline-block; width: 100%">
           <view class="tab-container">
             <tab-left
               :query="tabQuery"
@@ -256,6 +277,7 @@ import TabCenter from "./components/tabCenter.vue";
 import VideoListBox from "./components/videoListBox.vue";
 import userInfoHead from "./components/userInfoHead.vue";
 import utils from "@/utils/index";
+
 export default {
   components: {
     shortVideo,
@@ -268,6 +290,7 @@ export default {
     userInfoHead,
   },
   data: () => ({
+    subjectMap: ["科目一", "科目二", "科目三", "科目四"],
     tabQuery: {
       liceCar: 1,
       liceTruck: "",
@@ -471,25 +494,30 @@ export default {
       return this.$store.state.user.userInfo || {};
     },
   },
-  // onLoad() {
-  //   //获取code
-  //   wx.login({
-  //     success(res) {
-  //       console.log(res);
-  //     },
-  //   });
-  // },
+  onReady() {
+    const query = tt.createSelectorQuery();
+
+    // 选择 ttml 中的示例按钮,并添加一个对它布局信息的查询
+    query.select("#btn").boundingClientRect();
+
+    // 选择显示区域,并查询它的滚动位置信息
+    query.selectViewport().scrollOffset();
+  },
 
   async mounted() {
     let { data } = await this.$api.carVideo.getTreeList();
     this.typeList = data;
     this.loading = false;
     this.$store.dispatch("GetInfo");
+
     // this.$nextTick(() => {
     //   this.selectComponent("#tabs").resize();
     // });
   },
   methods: {
+    scrollTabs(e) {
+      console.log(e);
+    },
     changeVehicle(item) {
       this.tabQuery.vehicle = item.typeName;
       this.tabQuery.cert = item.title;
@@ -548,6 +576,38 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+.tabTitle {
+  width: 690rpx;
+  margin: 0 auto;
+  font-size: 28rpx;
+  display: flex;
+  justify-content: space-between;
+  text-align: center;
+  line-height: 66rpx;
+  height: 66rpx;
+  position: relative;
+  box-sizing: border-box;
+  .tabTitle-row {
+    width: 172rpx;
+  }
+  .rect {
+    width: 25%;
+    text-align: center;
+    position: absolute;
+    bottom: 0;
+    left: 0;
+    height: 4rpx;
+    .rect-color {
+      width: 60%;
+      height: 4rpx;
+      margin: 0 auto;
+      background: red;
+    }
+  }
+}
+swiper-item {
+  overflow-y: scroll;
+}
 .h6 {
   height: 6rpx;
 }
@@ -555,6 +615,7 @@ export default {
   position: relative;
   background: #fff;
   min-height: 100vh;
+  width: 100%;
 }
 .swiperBanner {
   width: 690rpx;
@@ -630,9 +691,17 @@ export default {
     position: absolute;
   }
 }
+
 .tab {
-  width: 690rpx;
+  width: 100%;
   margin: 0 auto;
+  display: inline-block;
+  padding: 0 30rpx;
+
+  #tabs {
+    overflow-y: scroll;
+    height: 800rpx;
+  }
   .custom-tabs {
     /deep/ .van-tabs__line {
       background: #498ef5;
@@ -640,9 +709,10 @@ export default {
   }
   .tab-container {
     width: 690rpx;
-    margin: 0 auto;
     display: flex;
     justify-content: space-between;
+    align-content: flex-start;
+    align-items: flex-start;
   }
 }
 .vant-tab {

+ 64 - 0
src/pages/carVideo/videoList.vue

@@ -0,0 +1,64 @@
+<template>
+	<loading v-if="loading"></loading>
+	<view v-else class="carVideo">
+		<topbar>
+			<van-search shape="round" placeholder="搜索学车视频" @search='search' />
+		</topbar>
+		<van-tabs id='tabs' :active="active" :sticky='true'>
+			<van-tab :title="item.chapterName" v-for="(item,index) in typeList" :key='index' class="vant-tab">
+				<branch-one v-if="index==0" :carVideoList="item.children"></branch-one>
+				<branch-two v-else-if="index==1" :carVideoList="item.children"></branch-two>
+				<branch-two v-else-if="index==2" :carVideoList="item.children"></branch-two>
+				<branch-one v-else-if="index==3" :carVideoList="item.children"></branch-one>
+				<get-cert v-else-if="index==4"></get-cert>
+				<branch-two v-else :carVideoList="item.children"></branch-two>
+			</van-tab>
+		</van-tabs>
+	</view>
+</template>
+
+<script>
+	import branchOne from './components/branchOne.vue'
+	import branchTwo from './components/branchTwo.vue'
+	export default {
+		components: {
+			branchOne,
+			branchTwo,
+		},
+		data: () => ({
+			active: 1,
+			typeList: [],
+			loading: true
+		}),
+		async mounted() {
+			let {
+				data
+			} = await this.$api.carVideo.getTreeList()
+			this.typeList = data
+			this.loading = false
+			this.$nextTick(() => {
+				this.selectComponent('#tabs').resize();
+			})
+		},
+		methods: {
+			async search(e) {
+				let {
+					data
+				} = await this.$api.carVideo.getSearchList(e.detail)
+				console.log(data)
+				this.$utils.route.goPage('/pages/carVideo/more', null, {
+					carVideoList: data
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.carVideo {
+		position: relative;
+	}
+	 .vant-tab{
+		height: 100px;
+	}
+</style>

+ 18 - 3
src/pages/user/index.vue

@@ -52,6 +52,7 @@
 </template>
 
 <script>
+import api from '@/api/index'
 export default {
   computed: {
     userInfo() {
@@ -66,11 +67,25 @@ export default {
     this.$store.dispatch("GetInfo");
   },
   methods: {
-    async getUserProfile(e) {
-      let userInfo = await uni.getUserProfile({
+     getUserProfile(e) {
+       uni.getUserProfile({
         desc: "业务需要",
+        success(res){
+          console.log(res)
+          api.user.userInfoUserInfo({
+            headImage:res.userInfo.avatarUrl,
+            nickName:res.userInfo.nickName
+          }).then(res=>{
+
+          })
+          
+     
+
+          
+
+        }
       });
-      console.log(userInfo)
+  
       // let updateRes = await this.$api.user.updateUserInfo({
       //   headImage: userInfo.userInfo.avatarUrl,
       //   nickName: userInfo.userInfo.nickName,

+ 50 - 0
src/store/getters.js

@@ -1,7 +1,10 @@
+
+const crypto = require("crypto");
 const getters = {
   token: state => state.user.token,
   userInfo: state => state.user.userInfo,
   isVip: state => {
+    //#ifdef MP-WEIXIN
     if (state.user.userInfo && state.user.userInfo.expireTime) {
       let expireTime = new Date(state.user.userInfo.expireTime).getTime()
       let nowTime = new Date().getTime()
@@ -15,6 +18,53 @@ const getters = {
     } else {
       return false
     }
+    //#endif
+
+    //#ifdef MP-TOUTIAO
+    if(uni.getStorageInfoSync("unionid")!==state.user.userInfo.unionid){
+      return false
+    }
+    let publicKey = "-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCzR04LMmDlwyVRfK+Kgsm/vFMOFyqvGk4QIVC" +
+      "Gj2CKKfhycRExm15N3tKOOouIjl/EU79It45oS+ltJkscvYrJn1zz+1bSoBLelZzJrn7K0NpHF8k" +
+      "bCprsFHd60x+YJ4l8C3SDxfFebo4kqveJzx6JNZKwzFm7LPEO5XB9pEBRwIDAQAB-----END PUBLIC KEY-----"
+    let verifyString = state.user.userInfo.unionid + state.user.userInfo.isVip
+    let sign = state.user.userInfo.sign
+    function verifySign(data, sign, publicKey) {
+      const verify = crypto.createVerify('RSA-SHA256');
+      verify.update(data);
+      verify.end();
+      return verify.verify(publicKey, Buffer.from(sign, 'base64'));
+    }
+    return verifySign(verifyString, sign, publicKey)
+    // console.log(verifySign(verifyString,sign,publicKey),'验证结果1')
+
+    // function verify(publicKey,verifyString,sign) {
+    //   console.log(publicKey,verifyString,sign)
+    //   // signData: 加签的数据
+    //   // data: 加签之后得到的签文
+    //   try {
+    //     // 公钥
+
+    //     let signatureVf = new KJUR.crypto.Signature({alg:"SHA256withRSA"});
+    //     signatureVf.init(publicKey)
+    //     signatureVf.updateString(verifyString)
+
+    //     // !接受的参数是16进制字符串!
+    //     let b = signatureVf.verify(b64tohex(sign));
+    //     return b
+
+
+    //   } catch (e) {
+    //     console.error(e);
+    //   }
+    // }
+    // console.log(verify(publicKey,verifyString,sign),"验证结果2")
+
+
+
+    //#endif
+
+
   },
   avatar: state => state.user.avatar,
   name: state => state.user.name,

+ 6 - 4
src/store/modules/user.js

@@ -1,5 +1,5 @@
 import userApi from '@/api/modules/user.js'
-
+const crypto = require("crypto");
 const user = {
 	state: {
 		tokenObj: {
@@ -76,6 +76,10 @@ const user = {
 
 			// store.commit('SET_JPCJUSERINFO',res.data.jpcjUserInfo)
 			wx.hideLoading()
+
+			//#ifdef MP-TOUTIAO
+			uni.setStorageSync('unionid',res.data.thirdResult.data.unionid)
+			//#endif
 			return res
 		},
 		async getToken(store) {
@@ -103,11 +107,9 @@ const user = {
 			//#ifdef MP-WEIXIN
 			res = await userApi.getInfo()
 			//#endif
-
 			//#ifdef MP-TOUTIAO
 			res = await userApi.userInfoVipInfo()
-			//#endif
-
+			//#endif			
 			uni.setStorageSync("userInfo", res.data);
 			store.commit('SET_USERINFO', res.data)
 			return res

+ 0 - 71
src/ttcomponents/common/README.md

@@ -1,71 +0,0 @@
-# 内置样式
-
-### 介绍
-
-Vant 中默认包含了一些常用样式,可以直接通过 className 的方式使用。
-
-### 引入
-
-在 app.wxss 中引入内置样式
-
-```css
-@import '@vant/weapp/common/index.wxss';
-```
-
-## 代码演示
-
-### 文字省略
-
-当文本内容长度超过容器最大宽度时,自动省略多余的文本。
-
-```xml
-<view class="van-ellipsis">
-  这是一段宽度限制 250px 的文字,后面的内容会省略
-</view>
-
-<!-- 最多显示两行 -->
-<view class="van-multi-ellipsis--l2">
-  这是一段最多显示两行的文字,后面的内容会省略
-</view>
-
-<!-- 最多显示三行 -->
-<view class="van-multi-ellipsis--l3">
-  这是一段最多显示三行的文字,后面的内容会省略
-</view>
-```
-
-### 1px 边框
-
-为元素添加 Retina 屏幕下的 1px 边框(即 hairline),基于伪类 transform 实现。
-
-```xml
-<!-- 上边框 -->
-<view class="van-hairline--top"></view>
-
-<!-- 下边框 -->
-<view class="van-hairline--bottom"></view>
-
-<!-- 左边框 -->
-<view class="van-hairline--left"></view>
-
-<!-- 右边框 -->
-<view class="van-hairline--right"></view>
-
-<!-- 上下边框 -->
-<view class="van-hairline--top-bottom"></view>
-
-<!-- 全边框 -->
-<view class="van-hairline--surround"></view>
-```
-
-### 全局字体
-
-推荐在 app.wxss 中设置以下全局字体,以保证在不同设备上提供最佳的视觉体验。
-
-```css
-page {
-  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica,
-    Segoe UI, Arial, Roboto, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft Yahei',
-    sans-serif;
-}
-```

+ 0 - 7
src/ttcomponents/common/color.js

@@ -1,7 +0,0 @@
-export const RED = '#ee0a24'
-export const BLUE = '#1989fa'
-export const WHITE = '#ffffff'
-export const GREEN = '#07c160'
-export const ORANGE = '#ff976a'
-export const GRAY = '#323233'
-export const GRAY_DARK = '#969799'

+ 0 - 59
src/ttcomponents/common/component.js

@@ -1,59 +0,0 @@
-import { basic } from '../mixins/basic'
-import { getCamelCase } from '../utils'
-
-function VantComponent(vantOptions = {}) {
-  vantOptions.externalClasses = vantOptions.classes
-  // add default externalClasses
-  vantOptions.externalClasses = vantOptions.externalClasses || []
-  vantOptions.externalClasses.push('custom-class')
-
-  vantOptions.externalStyles = vantOptions.externalStyles || []
-  vantOptions.externalStyles.push('custom-style')
-
-  const externalProps = {}
-  // 将 externalClasses 转化成 props
-  vantOptions.externalClasses.map(item => {
-    const classProp = getCamelCase(item)
-    externalProps[classProp] = {
-      type: String,
-      default: ''
-    }
-  })
-  // 将 externalStyles 转化成 props
-  vantOptions.externalStyles.map(item => {
-    const styleProp = getCamelCase(item)
-    externalProps[styleProp] = {
-      type: String,
-      default: ''
-    }
-  })
-  vantOptions.props = {
-    ...externalProps,
-    ...vantOptions.props
-  }
-
-  // add default mixins
-  const mixins = vantOptions.mixins || []
-  mixins.push(basic)
-  // #ifdef MP-ALIPAY
-  // 支付宝小程序中 vue 不支持 mixins 带 props 的对象
-  vantOptions.mixins = mixins.map(item => ({ ...item, props: {} }))
-  vantOptions.props = {
-    ...mixins.reduce((prev, curr) => ({ ...prev, ...(curr.props || {}) }), {}),
-    ...vantOptions.props
-  }
-  // #endif
-  // #ifndef MP-ALIPAY
-  vantOptions.mixins = mixins
-  // #endif
-
-  // add default options
-  vantOptions.options = {
-    multipleSlots: true,
-    addGlobalClass: true
-  }
-
-  return vantOptions
-}
-
-export { VantComponent }

+ 0 - 40
src/ttcomponents/common/demo.vue

@@ -1,40 +0,0 @@
-<template>
-  <div class="demo-style">
-    <demo-block title="文字省略">
-      <div class="van-ellipsis">这是一段最多显示一行的文字,后面的内容会省略</div>
-      <div class="van-multi-ellipsis--l2">这是一段最多显示两行的文字,后面的内容会省略。这是一段最多显示两行的文字,后面的内容会省略</div>
-    </demo-block>
-
-    <demo-block title="1px 边框">
-      <div class="van-hairline--top" />
-    </demo-block>
-  </div>
-</template>
-
-<script>
-export default {
-}
-</script>
-
-<style lang="less">
-@import './style/var';
-.demo-style {
-  .van-ellipsis,
-  .van-multi-ellipsis--l2 {
-    max-width: 300px;
-    margin-left: @padding-md;
-    font-size: 14px;
-    line-height: 18px;
-  }
-  .van-ellipsis {
-    margin-bottom: @padding-md;
-  }
-  .van-hairline--top {
-    height: 30px;
-    background-color: @white;
-    &::after {
-      top: 5px;
-    }
-  }
-}
-</style>

+ 0 - 27
src/ttcomponents/common/index.less

@@ -1,27 +0,0 @@
-/**
- * Entry of basic styles
- */
-
-@import './style/var.less';
-@import './style/ellipsis.less';
-@import './style/clearfix.less';
-@import './style/hairline.less';
-
-// 不引入会导致异常的
-// #ifdef MP-WEIXIN || MP-QQ || MP-BAIDU
-@import '../van-overlay/index.less';
-@import '../van-toast/index.less';
-// #endif
-// #ifndef MP-ALIPAY || MP-TOUTIAO || APP-PLUS
-@import '../van-dialog/index.less';
-// #endif
-
-// #ifdef MP-WEIXIN
-@import '../van-tabs/index.less';
-@import '../van-goods-action-button/index.less';
-@import '../van-goods-action-icon/index.less';
-// #endif
-
-// 相关组件的 host
-@import '../van-tab/host.less';
-@import '../van-goods-action-button/host.less';

File diff suppressed because it is too large
+ 0 - 12
src/ttcomponents/common/main.ttss


+ 0 - 5
src/ttcomponents/common/style/clearfix.less

@@ -1,5 +0,0 @@
-@import './mixins/clearfix.less';
-
-.van-clearfix {
-  .clearfix();
-}

+ 0 - 13
src/ttcomponents/common/style/ellipsis.less

@@ -1,13 +0,0 @@
-@import './mixins/ellipsis.less';
-
-.van-ellipsis {
-  .ellipsis();
-}
-
-.van-multi-ellipsis--l2 {
-  .multi-ellipsis(2);
-}
-
-.van-multi-ellipsis--l3 {
-  .multi-ellipsis(3);
-}

+ 0 - 41
src/ttcomponents/common/style/hairline.less

@@ -1,41 +0,0 @@
-@import './mixins/hairline.less';
-
-.van-hairline,
-.van-hairline--top,
-.van-hairline--left,
-.van-hairline--right,
-.van-hairline--bottom,
-.van-hairline--top-bottom,
-.van-hairline--surround {
-  position: relative;
-
-  &::after {
-    .hairline();
-  }
-}
-
-.van-hairline {
-  &--top::after {
-    border-top-width: 1px;
-  }
-
-  &--left::after {
-    border-left-width: 1px;
-  }
-
-  &--right::after {
-    border-right-width: 1px;
-  }
-
-  &--bottom::after {
-    border-bottom-width: 1px;
-  }
-
-  &--top-bottom::after {
-    border-width: 1px 0;
-  }
-
-  &--surround::after {
-    border-width: 1px;
-  }
-}

+ 0 - 7
src/ttcomponents/common/style/mixins/clearfix.less

@@ -1,7 +0,0 @@
-.clearfix() {
-  &::after {
-    display: table;
-    clear: both;
-    content: '';
-  }
-}

+ 0 - 15
src/ttcomponents/common/style/mixins/ellipsis.less

@@ -1,15 +0,0 @@
-.multi-ellipsis(@lines) {
-  display: -webkit-box;
-  overflow: hidden;
-  text-overflow: ellipsis;
-  -webkit-line-clamp: @lines;
-
-  /* autoprefixer: ignore next */
-  -webkit-box-orient: vertical;
-}
-
-.ellipsis() {
-  overflow: hidden;
-  white-space: nowrap;
-  text-overflow: ellipsis;
-}

+ 0 - 40
src/ttcomponents/common/style/mixins/hairline.less

@@ -1,40 +0,0 @@
-@import '../var.less';
-
-.hairline-common() {
-  position: absolute;
-  box-sizing: border-box;
-  transform-origin: center; /* cover wechat button:after default transforn-origin */
-  content: ' ';
-  pointer-events: none;
-}
-
-.hairline(@color: @border-color) {
-  .hairline-common();
-
-  top: -50%;
-  right: -50%;
-  bottom: -50%;
-  left: -50%;
-  border: 0 solid @color;
-  transform: scale(0.5);
-}
-
-.hairline-top(@color: @border-color, @left: 0, @right: 0) {
-  .hairline-common();
-
-  top: 0;
-  right: @right;
-  left: @left;
-  border-top: 1px solid @color;
-  transform: scaleY(0.5);
-}
-
-.hairline-bottom(@color: @border-color, @left: 0, @right: 0) {
-  .hairline-common();
-
-  right: @right;
-  bottom: 0;
-  left: @left;
-  border-bottom: 1px solid @color;
-  transform: scaleY(0.5);
-}

+ 0 - 6
src/ttcomponents/common/style/theme.less

@@ -1,6 +0,0 @@
-@import (reference) './var.less';
-
-.theme(@property, @imp) {
-  @{property}: e(replace(@imp, '@([^() ]+)', '@{$1}', 'ig'));
-  @{property}: e(replace(@imp, '@([^() ]+)', 'var(--$1, @{$1})', 'ig'));
-}

+ 0 - 656
src/ttcomponents/common/style/var.less

@@ -1,656 +0,0 @@
-// Color Palette
-@black: #000;
-@white: #fff;
-@gray-1: #f7f8fa;
-@gray-2: #f2f3f5;
-@gray-3: #ebedf0;
-@gray-4: #dcdee0;
-@gray-5: #c8c9cc;
-@gray-6: #969799;
-@gray-7: #646566;
-@gray-8: #323233;
-@red: #ee0a24;
-@blue: #1989fa;
-@orange: #ff976a;
-@orange-dark: #ed6a0c;
-@orange-light: #fffbe8;
-@green: #07c160;
-
-// Gradient Colors
-@gradient-red: linear-gradient(to right, #ff6034, #ee0a24);
-@gradient-orange: linear-gradient(to right, #ffd01e, #ff8917);
-
-// Component Colors
-@text-color: @gray-8;
-@active-color: @gray-2;
-@active-opacity: 0.7;
-@disabled-opacity: 0.5;
-@background-color: @gray-1;
-@background-color-light: #fafafa;
-@text-link-color: #576b95;
-
-// Padding
-@padding-base: 4px;
-@padding-xs: @padding-base * 2;
-@padding-sm: @padding-base * 3;
-@padding-md: @padding-base * 4;
-@padding-lg: @padding-base * 6;
-@padding-xl: @padding-base * 8;
-
-// Font
-@font-size-xs: 10px;
-@font-size-sm: 12px;
-@font-size-md: 14px;
-@font-size-lg: 16px;
-@font-weight-bold: 500;
-@line-height-xs: 14px;
-@line-height-sm: 18px;
-@line-height-md: 20px;
-@line-height-lg: 22px;
-@base-font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue',
-  Helvetica, Segoe UI, Arial, Roboto, 'PingFang SC', 'Hiragino Sans GB',
-  'Microsoft Yahei', sans-serif;
-@price-integer-font-family: Avenir-Heavy, PingFang SC, Helvetica Neue, Arial,
-  sans-serif;
-
-// Animation
-@animation-duration-base: 0.3s;
-@animation-duration-fast: 0.2s;
-
-// Border
-@border-color: @gray-3;
-@border-width-base: 1px;
-@border-radius-sm: 2px;
-@border-radius-md: 4px;
-@border-radius-lg: 8px;
-@border-radius-max: 999px;
-
-//ActionSheet
-@action-sheet-max-height: 90%;
-@action-sheet-header-height: 44px;
-@action-sheet-header-font-size: @font-size-lg;
-@action-sheet-description-color: @gray-7;
-@action-sheet-description-font-size: @font-size-md;
-@action-sheet-description-line-height: 20px;
-@action-sheet-item-height: 50px;
-@action-sheet-item-background: @white;
-@action-sheet-item-font-size: @font-size-lg;
-@action-sheet-item-text-color: @text-color;
-@action-sheet-item-disabled-text-color: @gray-5;
-@action-sheet-subname-color: @gray-7;
-@action-sheet-subname-font-size: @font-size-sm;
-@action-sheet-close-icon-size: 18px;
-@action-sheet-close-icon-color: @gray-6;
-@action-sheet-close-icon-padding: 0 @padding-sm;
-@action-sheet-cancel-padding-top: @padding-xs;
-@action-sheet-cancel-padding-color: @background-color;
-
-// Button
-@button-mini-height: 22px;
-@button-mini-min-width: 50px;
-@button-mini-font-size: @font-size-xs;
-@button-small-height: 30px;
-@button-small-font-size: @font-size-sm;
-@button-small-min-width: 60px;
-@button-normal-font-size: @font-size-md;
-@button-large-height: 50px;
-@button-default-color: @text-color;
-@button-default-height: 44px;
-@button-default-font-size: @font-size-lg;
-@button-default-background-color: @white;
-@button-default-border-color: @border-color;
-@button-primary-color: @white;
-@button-primary-background-color: @green;
-@button-primary-border-color: @green;
-@button-info-color: @white;
-@button-info-background-color: @blue;
-@button-info-border-color: @blue;
-@button-danger-color: @white;
-@button-danger-background-color: @red;
-@button-danger-border-color: @red;
-@button-warning-color: @white;
-@button-warning-background-color: @orange;
-@button-warning-border-color: @orange;
-@button-line-height: 20px;
-@button-border-width: 1px;
-@button-border-radius: @border-radius-sm;
-@button-round-border-radius: @border-radius-max;
-@button-plain-background-color: @white;
-@button-disabled-opacity: @disabled-opacity;
-
-// Calendar
-@calendar-height: 100%;
-@calendar-background-color: @white;
-@calendar-popup-height: 80%;
-@calendar-header-box-shadow: 0 2px 10px rgba(125, 126, 128, 0.16);
-@calendar-header-title-height: 44px;
-@calendar-header-title-font-size: @font-size-lg;
-@calendar-header-subtitle-font-size: @font-size-md;
-@calendar-weekdays-height: 30px;
-@calendar-weekdays-font-size: @font-size-sm;
-@calendar-month-title-font-size: @font-size-md;
-@calendar-month-mark-color: fade(@gray-2, 80%);
-@calendar-month-mark-font-size: 160px;
-@calendar-day-height: 64px;
-@calendar-day-font-size: @font-size-lg;
-@calendar-range-edge-color: @white;
-@calendar-range-edge-background-color: @red;
-@calendar-range-middle-color: @red;
-@calendar-range-middle-background-opacity: 0.1;
-@calendar-selected-day-size: 54px;
-@calendar-selected-day-color: @white;
-@calendar-info-font-size: @font-size-xs;
-@calendar-info-line-height: 14px;
-@calendar-selected-day-background-color: @red;
-@calendar-day-disabled-color: @gray-5;
-@calendar-confirm-button-height: 36px;
-@calendar-confirm-button-margin: 7px 0;
-@calendar-confirm-button-line-height: 34px;
-
-// Card
-@card-padding: @padding-xs @padding-md;
-@card-font-size: @font-size-sm;
-@card-text-color: @text-color;
-@card-background-color: @background-color-light;
-@card-thumb-size: 88px;
-@card-title-line-height: 16px;
-@card-desc-color: @gray-7;
-@card-desc-line-height: 20px;
-@card-price-color: @red;
-@card-origin-price-color: @gray-7;
-@card-origin-price-font-size: @font-size-xs;
-@card-price-font-size: @font-size-sm;
-@card-price-integer-font-size: @font-size-lg;
-@card-price-font-family: @price-integer-font-family;
-
-// Cell
-@cell-font-size: @font-size-md;
-@cell-line-height: 24px;
-@cell-vertical-padding: 10px;
-@cell-horizontal-padding: @padding-md;
-@cell-text-color: @text-color;
-@cell-background-color: @white;
-@cell-border-color: @border-color;
-@cell-active-color: @active-color;
-@cell-required-color: @red;
-@cell-label-color: @gray-6;
-@cell-label-font-size: @font-size-sm;
-@cell-label-line-height: 18px;
-@cell-label-margin-top: 3px;
-@cell-value-color: @gray-6;
-@cell-icon-size: 16px;
-@cell-right-icon-color: @gray-6;
-@cell-large-vertical-padding: @padding-sm;
-@cell-large-title-font-size: @font-size-lg;
-@cell-large-value-font-size: @font-size-lg;
-@cell-large-label-font-size: @font-size-md;
-
-// CellGroup
-@cell-group-background-color: @white;
-@cell-group-title-color: @gray-6;
-@cell-group-title-padding: @padding-md @padding-md @padding-xs;
-@cell-group-title-font-size: @font-size-md;
-@cell-group-title-line-height: 16px;
-
-// Checkbox
-@checkbox-size: 20px;
-@checkbox-border-color: @gray-5;
-@checkbox-transition-duration: 0.2s;
-@checkbox-label-margin: 10px;
-@checkbox-label-color: @text-color;
-@checkbox-checked-icon-color: @blue;
-@checkbox-disabled-icon-color: @gray-5;
-@checkbox-disabled-label-color: @gray-5;
-@checkbox-disabled-background-color: @border-color;
-
-// Circle
-@circle-text-color: @text-color;
-
-// Collapse
-@collapse-item-transition-duration: 0.3s;
-@collapse-item-content-padding: 15px;
-@collapse-item-content-font-size: 13px;
-@collapse-item-content-line-height: 1.5;
-@collapse-item-content-text-color: @gray-6;
-@collapse-item-content-background-color: @white;
-@collapse-item-title-disabled-color: @gray-5;
-
-// CountDown
-@count-down-text-color: @text-color;
-@count-down-font-size: @font-size-md;
-@count-down-line-height: 20px;
-
-// Dialog
-@dialog-width: 320px;
-@dialog-small-screen-width: 90%;
-@dialog-font-size: @font-size-lg;
-@dialog-border-radius: 16px;
-@dialog-background-color: @white;
-@dialog-header-font-weight: @font-weight-bold;
-@dialog-header-line-height: 24px;
-@dialog-header-padding-top: @padding-lg;
-@dialog-header-isolated-padding: @padding-lg 0;
-@dialog-message-padding: @padding-lg;
-@dialog-message-font-size: @font-size-md;
-@dialog-message-line-height: 20px;
-@dialog-message-max-height: 60vh;
-@dialog-has-title-message-text-color: @gray-7;
-@dialog-has-title-message-padding-top: @padding-xs;
-
-// Field
-@field-label-color: @gray-7;
-@field-input-text-color: @text-color;
-@field-input-error-text-color: @red;
-@field-input-disabled-text-color: @gray-5;
-@field-placeholder-text-color: @gray-5;
-@field-icon-size: 16px;
-@field-clear-icon-size: 16px;
-@field-clear-icon-color: @gray-5;
-@field-icon-container-color: @gray-6;
-@field-error-message-color: @red;
-@field-error-message-text-font-size: @font-size-sm;
-@field-text-area-min-height: 18px;
-@field-word-limit-color: @gray-7;
-@field-word-limit-font-size: @font-size-sm;
-@field-word-limit-line-height: 16px;
-@field-word-num-full-color: @red;
-@field-disabled-text-color: @gray-5;
-
-// GoodsAction
-@goods-action-background-color: @white;
-@goods-action-height: 50px;
-@goods-action-icon-width: 48px;
-@goods-action-icon-height: @goods-action-height;
-@goods-action-icon-color: @text-color;
-@goods-action-icon-size: 18px;
-@goods-action-icon-font-size: @font-size-xs;
-@goods-action-icon-text-color: @gray-7;
-@goods-action-button-height: 40px;
-@goods-action-button-line-height: @button-line-height;
-@goods-action-button-border-radius: @goods-action-button-height / 2;
-@goods-action-button-warning-color: @gradient-orange;
-@goods-action-button-danger-color: @gradient-red;
-@goods-action-button-plain-color: @white;
-
-// Image
-@image-placeholder-text-color: @gray-6;
-@image-placeholder-font-size: @font-size-md;
-@image-placeholder-background-color: @background-color;
-
-// Info
-@info-size: 16px;
-@info-color: @white;
-@info-padding: 0 3px;
-@info-font-size: 12px;
-@info-font-weight: 500;
-@info-border-width: 1px;
-@info-background-color: @red;
-@info-dot-color: @red;
-@info-dot-size: 8px;
-@info-font-family: -apple-system-font, Helvetica Neue, Arial, sans-serif;
-
-// Loading
-@loading-text-color: @gray-6;
-@loading-text-font-size: @font-size-md;
-@loading-text-line-height: 20px;
-@loading-spinner-color: @gray-5;
-@loading-spinner-size: 30px;
-@loading-spinner-animation-duration: 0.8s;
-
-// NavBar
-@nav-bar-height: 46px;
-@nav-bar-background-color: @white;
-@nav-bar-arrow-size: 16px;
-@nav-bar-icon-color: @blue;
-@nav-bar-text-color: @blue;
-@nav-bar-title-font-size: @font-size-lg;
-@nav-bar-title-text-color: @text-color;
-
-// NoticeBar
-@notice-bar-height: 40px;
-@notice-bar-padding: 0 @padding-md;
-@notice-bar-wrapable-padding: @padding-xs @padding-md;
-@notice-bar-font-size: @font-size-md;
-@notice-bar-text-color: @orange-dark;
-@notice-bar-line-height: 24px;
-@notice-bar-background-color: @orange-light;
-@notice-bar-icon-size: 16px;
-@notice-bar-icon-min-width: 22px;
-
-// Notify
-@notify-padding: 6px 15px;
-@notify-font-size: 14px;
-@notify-line-height: 20px;
-@notify-primary-background-color: @blue;
-@notify-success-background-color: @green;
-@notify-danger-background-color: @red;
-@notify-warning-background-color: @orange;
-
-// Overlay
-@overlay-background-color: rgba(0, 0, 0, 0.7);
-
-// Panel
-@panel-background-color: @white;
-@panel-header-value-color: @red;
-@panel-footer-padding: @padding-xs @padding-md;
-
-// Picker
-@picker-background-color: @white;
-@picker-toolbar-height: 44px;
-@picker-title-font-size: @font-size-lg;
-@picker-action-padding: 0 @padding-md;
-@picker-action-font-size: @font-size-md;
-@picker-confirm-action-color: @text-link-color;
-@picker-cancel-action-color: @gray-6;
-@picker-option-font-size: @font-size-lg;
-@picker-option-text-color: @black;
-@picker-loading-icon-color: @blue;
-@picker-loading-mask-color: rgba(255, 255, 255, 0.9);
-@picker-option-disabled-opacity: 0.3;
-@picker-option-selected-text-color: @text-color;
-
-// Popup
-@popup-background-color: @white;
-@popup-round-border-radius: 20px;
-@popup-close-icon-size: 18px;
-@popup-close-icon-color: @gray-6;
-@popup-close-icon-margin: 16px;
-@popup-close-icon-z-index: 1;
-
-// Progress
-@progress-height: 4px;
-@progress-background-color: @gray-3;
-@progress-pivot-padding: 0 5px;
-@progress-color: @blue;
-@progress-pivot-font-size: @font-size-xs;
-@progress-pivot-line-height: 1.6;
-@progress-pivot-background-color: @blue;
-@progress-pivot-text-color: @white;
-
-// Radio
-@radio-size: 20px;
-@radio-border-color: @gray-5;
-@radio-transition-duration: 0.2s;
-@radio-label-margin: 10px;
-@radio-label-color: @text-color;
-@radio-checked-icon-color: @blue;
-@radio-disabled-icon-color: @gray-5;
-@radio-disabled-label-color: @gray-5;
-@radio-disabled-background-color: @border-color;
-
-// Rate
-@rate-horizontal-padding: 2px;
-@rate-icon-size: 20px;
-
-// Switch
-@switch-width: 2em;
-@switch-height: 1em;
-@switch-node-size: 1em;
-@switch-node-z-index: 1;
-@switch-node-background-color: @white;
-@switch-node-box-shadow: 0 3px 1px 0 rgba(0, 0, 0, 0.05),
-  0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 3px 3px 0 rgba(0, 0, 0, 0.05);
-@switch-background-color: @white;
-@switch-on-background-color: @blue;
-@switch-transition-duration: 0.3s;
-@switch-disabled-opacity: 0.4;
-@switch-border: 1px solid rgba(0, 0, 0, 0.1);
-
-// ShareSheet
-@share-sheet-header-padding: @padding-sm @padding-md @padding-base;
-@share-sheet-title-color: @text-color;
-@share-sheet-title-font-size: @font-size-md;
-@share-sheet-title-line-height: @line-height-md;
-@share-sheet-description-color: @gray-6;
-@share-sheet-description-font-size: @font-size-sm;
-@share-sheet-description-line-height: 16px;
-@share-sheet-icon-size: 48px;
-@share-sheet-option-name-color: @gray-7;
-@share-sheet-option-name-font-size: @font-size-sm;
-@share-sheet-option-description-color: @gray-5;
-@share-sheet-option-description-font-size: @font-size-sm;
-@share-sheet-cancel-button-font-size: @font-size-lg;
-@share-sheet-cancel-button-height: 48px;
-@share-sheet-cancel-button-background: @white;
-
-// Search
-@search-background-color: @gray-1;
-@search-padding: 10px @padding-sm;
-@search-input-height: 34px;
-@search-label-padding: 0 5px;
-@search-label-color: @text-color;
-@search-label-font-size: @font-size-md;
-@search-left-icon-color: @gray-6;
-@search-action-padding: 0 @padding-xs;
-@search-action-text-color: @text-color;
-@search-action-font-size: @font-size-md;
-
-// Sidebar
-@sidebar-width: 85px;
-
-// SidebarItem
-@sidebar-font-size: @font-size-md;
-@sidebar-line-height: 20px;
-@sidebar-text-color: @text-color;
-@sidebar-disabled-text-color: @gray-5;
-@sidebar-padding: 20px @padding-sm 20px @padding-xs;
-@sidebar-active-color: @active-color;
-@sidebar-background-color: @background-color;
-@sidebar-selected-font-weight: @font-weight-bold;
-@sidebar-selected-text-color: @text-color;
-@sidebar-selected-border-color: @red;
-@sidebar-selected-background-color: @white;
-
-// Slider
-@slider-active-background-color: @blue;
-@slider-inactive-background-color: @gray-3;
-@slider-disabled-opacity: @disabled-opacity;
-@slider-button-width: 24px;
-@slider-button-height: 24px;
-@slider-button-border-radius: 50%;
-@slider-button-background-color: @white;
-@slider-button-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
-
-// Step
-@step-text-color: @gray-6;
-@step-process-text-color: @text-color;
-@step-font-size: @font-size-md;
-@step-line-color: @border-color;
-@step-finish-line-color: @green;
-@step-finish-text-color: @text-color;
-@step-icon-size: 12px;
-@step-circle-size: 5px;
-@step-circle-color: @gray-6;
-@step-horizontal-title-font-size: @font-size-sm;
-
-// Steps
-@steps-background-color: @white;
-
-// Stepper
-@stepper-active-color: #e8e8e8;
-@stepper-background-color: @gray-2;
-@stepper-button-icon-color: @text-color;
-@stepper-button-disabled-color: @gray-1;
-@stepper-button-disabled-icon-color: @gray-5;
-@stepper-input-width: 32px;
-@stepper-input-height: 28px;
-@stepper-input-font-size: @font-size-md;
-@stepper-input-text-color: @text-color;
-@stepper-input-disabled-text-color: @gray-5;
-@stepper-input-disabled-background-color: @gray-2;
-@stepper-border-radius: @border-radius-md;
-
-// SubmitBar
-@submit-bar-height: 50px;
-@submit-bar-z-index: 100;
-@submit-bar-background-color: @white;
-@submit-bar-button-width: 110px;
-@submit-bar-price-color: @red;
-@submit-bar-price-font-size: @font-size-sm;
-@submit-bar-currency-font-size: @font-size-sm;
-@submit-bar-text-color: @text-color;
-@submit-bar-text-font-size: 14px;
-@submit-bar-tip-padding: 10px;
-@submit-bar-tip-font-size: 12px;
-@submit-bar-tip-line-height: 1.5;
-@submit-bar-tip-color: #f56723;
-@submit-bar-tip-background-color: #fff7cc;
-@submit-bar-tip-icon-size: 12px;
-@submit-bar-button-height: 40px;
-@submit-bar-padding: 0 @padding-md;
-@submit-bar-price-integer-font-size: 20px;
-@submit-bar-price-font-family: @price-integer-font-family;
-
-// Tabbar
-@tabbar-height: 50px;
-@tabbar-background-color: @white;
-
-// TabbarItem
-@tabbar-item-font-size: @font-size-sm;
-@tabbar-item-text-color: @gray-7;
-@tabbar-item-active-color: @blue;
-@tabbar-item-line-height: 1;
-@tabbar-item-icon-size: 18px;
-@tabbar-item-margin-bottom: 5px;
-
-// Tab
-@tab-text-color: @gray-7;
-@tab-active-text-color: @text-color;
-@tab-disabled-text-color: @gray-5;
-@tab-font-size: @font-size-md;
-
-// Tabs
-@tabs-default-color: @red;
-@tabs-line-height: 44px;
-@tabs-card-height: 30px;
-@tabs-nav-background-color: @white;
-@tabs-bottom-bar-height: 3px;
-@tabs-bottom-bar-color: @tabs-default-color;
-
-// Tag
-@tag-padding: 0 @padding-base;
-@tag-text-color: @white;
-@tag-font-size: @font-size-sm;
-@tag-border-radius: 2px;
-@tag-line-height: 16px;
-@tag-medium-padding: 2px 6px;
-@tag-large-padding: @padding-base @padding-xs;
-@tag-large-border-radius: @border-radius-md;
-@tag-large-font-size: @font-size-md;
-@tag-round-border-radius: @border-radius-max;
-@tag-danger-color: @red;
-@tag-primary-color: @blue;
-@tag-success-color: @green;
-@tag-warning-color: @orange;
-@tag-default-color: @gray-6;
-@tag-plain-background-color: @white;
-
-// Toast
-@toast-max-width: 70%;
-@toast-font-size: 14px;
-@toast-text-color: @white;
-@toast-line-height: 20px;
-@toast-border-radius: @border-radius-lg;
-@toast-background-color: fade(@black, 70%);
-@toast-icon-size: 36px;
-@toast-text-min-width: 96px;
-@toast-text-padding: @padding-xs @padding-sm;
-@toast-default-padding: @padding-md;
-@toast-default-width: 88px;
-@toast-default-min-height: 88px;
-
-// GridItem
-@grid-item-content-padding: @padding-md @padding-xs;
-@grid-item-content-background-color: @white;
-@grid-item-content-active-color: @active-color;
-@grid-item-icon-size: 26px;
-@grid-item-text-color: @gray-7;
-@grid-item-text-font-size: @font-size-sm;
-
-// Divider
-@divider-margin: @padding-md 0;
-@divider-text-color: @gray-6;
-@divider-font-size: @font-size-md;
-@divider-line-height: 24px;
-@divider-border-color: @border-color;
-@divider-content-padding: @padding-md;
-@divider-content-left-width: 10%;
-@divider-content-right-width: 10%;
-
-// Empty
-@empty-padding: @padding-xl 0;
-@empty-image-size: 160px;
-@empty-description-margin-top: @padding-md;
-@empty-description-padding: 0 60px;
-@empty-description-color: @gray-6;
-@empty-description-font-size: 14px;
-@empty-description-line-height: 20px;
-@empty-bottom-margin-top: 24px;
-
-// TreeSelect
-@tree-select-font-size: @font-size-md;
-@tree-select-nav-background-color: @background-color;
-@tree-select-content-background-color: @white;
-@tree-select-nav-item-padding: @padding-sm @padding-xs @padding-sm @padding-sm;
-@tree-select-item-height: 44px;
-@tree-select-item-active-color: @red;
-@tree-select-item-disabled-color: @gray-5;
-
-// Uploader
-@uploader-size: 80px;
-@uploader-icon-size: 24px;
-@uploader-icon-color: @gray-4;
-@uploader-text-color: @gray-6;
-@uploader-text-font-size: @font-size-sm;
-@uploader-upload-background-color: @gray-1;
-@uploader-upload-active-color: @active-color;
-@uploader-delete-color: @white;
-@uploader-delete-icon-size: 14px;
-@uploader-delete-background-color: rgba(0, 0, 0, 0.7);
-@uploader-file-background-color: @background-color;
-@uploader-file-icon-size: 20px;
-@uploader-file-icon-color: @gray-7;
-@uploader-file-name-padding: 0 @padding-base;
-@uploader-file-name-margin-top: @padding-xs;
-@uploader-file-name-font-size: @font-size-sm;
-@uploader-file-name-text-color: @gray-7;
-@uploader-mask-background-color: fade(@gray-8, 88%);
-@uploader-mask-icon-size: 22px;
-@uploader-mask-message-font-size: @font-size-sm;
-@uploader-mask-message-line-height: 14px;
-@uploader-loading-icon-size: 22px;
-@uploader-loading-icon-color: @white;
-@uploader-disabled-opacity: @disabled-opacity;
-
-// DropdownMenu
-@dropdown-menu-height: 50px;
-@dropdown-menu-background-color: @white;
-@dropdown-menu-title-font-size: 15px;
-@dropdown-menu-title-text-color: @text-color;
-@dropdown-menu-title-active-text-color: @blue;
-@dropdown-menu-title-disabled-text-color: @gray-6;
-@dropdown-menu-title-padding: 0 @padding-xs;
-@dropdown-menu-title-line-height: 18px;
-@dropdown-menu-option-active-color: @blue;
-
-// IndexAnchor
-@index-anchor-padding: 0 @padding-md;
-@index-anchor-text-color: @text-color;
-@index-anchor-font-weight: 500;
-@index-anchor-font-size: @font-size-md;
-@index-anchor-line-height: 32px;
-@index-anchor-background-color: transparent;
-@index-anchor-active-background-color: @white;
-@index-anchor-active-text-color: @green;
-
-// IndexBar
-@index-bar-index-font-size: @font-size-xs;
-@index-bar-index-line-height: 14px;
-
-// skeleton
-@skeleton-padding: 0 @padding-md;
-@skeleton-row-height: 16px;
-@skeleton-row-background-color: @gray-2;
-@skeleton-row-margin-top: @padding-sm;
-@skeleton-avatar-background-color: @gray-2;
-@skeleton-animation-duration: 1.2s;

+ 0 - 68
src/ttcomponents/common/utils.js

@@ -1,68 +0,0 @@
-import { isNumber, isPlainObject } from './validator';
-
-export function isDef(value) {
-  return value !== undefined && value !== null;
-}
-
-export function isObj(x) {
-  const type = typeof x;
-  return x !== null && (type === 'object' || type === 'function');
-}
-
-export function range(num, min, max) {
-  return Math.min(Math.max(num, min), max);
-}
-
-export function nextTick(fn) {
-  setTimeout(() => {
-    fn();
-  }, 1000 / 30);
-}
-
-let systemInfo = null;
-export function getSystemInfoSync() {
-  if (systemInfo == null) {
-    systemInfo = uni.getSystemInfoSync();
-  }
-
-  return systemInfo;
-}
-
-export function addUnit(value) {
-  if (!isDef(value)) {
-    return undefined;
-  }
-
-  value = String(value);
-  return isNumber(value) ? `${value}px` : value;
-}
-
-export function requestAnimationFrame(cb) {
-  const systemInfo = getSystemInfoSync();
-
-  if (systemInfo.platform === 'devtools') {
-    return nextTick(cb);
-  }
-
-  return wx
-    .createSelectorQuery()
-    .selectViewport()
-    .boundingClientRect()
-    .exec(() => {
-      cb();
-    });
-}
-
-export function pickExclude(obj, keys) {
-  if (!isPlainObject(obj)) {
-    return {};
-  }
-
-  return Object.keys(obj).reduce((prev, key) => {
-    if (!keys.includes(key)) {
-      prev[key] = obj[key];
-    }
-
-    return prev;
-  }, {});
-}

+ 0 - 39
src/ttcomponents/common/validator.js

@@ -1,39 +0,0 @@
-export function isFunction(val) {
-  return typeof val === 'function';
-}
-
-export function isPlainObject(val) {
-  return val !== null && typeof val === 'object' && !Array.isArray(val);
-}
-
-export function isPromise(val) {
-  return isPlainObject(val) && isFunction(val.then) && isFunction(val.catch);
-}
-
-export function isDef(value) {
-  return value !== undefined && value !== null;
-}
-
-export function isObj(x) {
-  const type = typeof x;
-  return x !== null && (type === 'object' || type === 'function');
-}
-
-export function isNumber(value) {
-  return /^\d+(\.\d+)?$/.test(value);
-}
-
-export function isBoolean(value) {
-  return typeof value === 'boolean';
-}
-
-const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;
-const VIDEO_REGEXP = /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv)/i;
-
-export function isImageUrl(url) {
-  return IMAGE_REGEXP.test(url);
-}
-
-export function isVideoUrl(url) {
-  return VIDEO_REGEXP.test(url);
-}

+ 0 - 38
src/ttcomponents/common/version.js

@@ -1,38 +0,0 @@
-import { getSystemInfoSync } from './utils';
-
-function compareVersion(v1, v2) {
-  v1 = v1.split('.');
-  v2 = v2.split('.');
-  const len = Math.max(v1.length, v2.length);
-
-  while (v1.length < len) {
-    v1.push('0');
-  }
-  while (v2.length < len) {
-    v2.push('0');
-  }
-
-  for (let i = 0; i < len; i++) {
-    const num1 = parseInt(v1[i], 10);
-    const num2 = parseInt(v2[i], 10);
-
-    if (num1 > num2) {
-      return 1;
-    }
-    if (num1 < num2) {
-      return -1;
-    }
-  }
-
-  return 0;
-}
-
-export function canIUseModel() {
-  const system = getSystemInfoSync();
-  return compareVersion(system.SDKVersion, '2.9.3') >= 0;
-}
-
-export function canIUseFormFieldButton() {
-  const system = getSystemInfoSync();
-  return compareVersion(system.SDKVersion, '2.10.3') >= 0;
-}

+ 0 - 37
src/ttcomponents/dashboard/index.vue

@@ -1,37 +0,0 @@
-<template>
-  <demo-home :list="list" />
-</template>
-
-<script>
-import list from '@/config'
-const finishList = []
-list.map(item => {
-  const noEmpty = item.list.some(it => it.status === 'finish')
-  if (noEmpty) {
-    finishList.push({
-      ...item,
-      list: item.list.filter(it => it.status === 'finish')
-    })
-  }
-})
-export default {
-  data() {
-    return {
-      list: finishList
-    }
-  },
-  onLoad() {
-    // #ifdef MP-QQ
-    qq.showShareMenu({
-      showShareItems: ['qq', 'qzone', 'wechatFriends', 'wechatMoment']
-    })
-    // #endif
-  }
-}
-</script>
-
-<style>
-page {
-  background: #fff;
-}
-</style>

+ 0 - 32
src/ttcomponents/mixins/basic.js

@@ -1,32 +0,0 @@
-// eslint-disable-next-line no-undef
-export const basic = {
-  props: {
-    componentId: {
-      type: String,
-      default: 'vant-component'
-    }
-  },
-  methods: {
-    getRect(selector, all) {
-      return new Promise(resolve => {
-        let selectorQuery
-        // #ifndef MP-ALIPAY
-        selectorQuery = uni.createSelectorQuery().in(this)
-        // #endif
-        // #ifdef MP-ALIPAY
-        selectorQuery = uni.createSelectorQuery()
-        // #endif
-        selectorQuery[all ? 'selectAll' : 'select'](selector)
-        .boundingClientRect(rect => {
-          if (all && Array.isArray(rect) && rect.length) {
-            resolve(rect)
-          }
-          if (!all && rect) {
-            resolve(rect)
-          }
-        })
-        .exec()
-      })
-    }
-  }
-}

+ 0 - 16
src/ttcomponents/mixins/button.js

@@ -1,16 +0,0 @@
-export const button = {
-  externalClasses: ['hover-class'],
-
-  props: {
-    id: String,
-    lang: String,
-    businessId: Number,
-    sessionFrom: String,
-    sendMessageTitle: String,
-    sendMessagePath: String,
-    sendMessageImg: String,
-    showMessageCard: Boolean,
-    appParameter: String,
-    ariaLabel: String
-  }
-}

+ 0 - 18
src/ttcomponents/mixins/link.js

@@ -1,18 +0,0 @@
-export const link = {
-  props: {
-    url: String,
-    linkType: {
-      type: String,
-      default: 'navigateTo'
-    }
-  },
-
-  methods: {
-    jumpLink(urlKey = 'url') {
-      const url = this[urlKey]
-      if (url) {
-        uni[this.linkType]({ url })
-      }
-    }
-  }
-}

+ 0 - 31
src/ttcomponents/mixins/open-type.js

@@ -1,31 +0,0 @@
-export const openType = {
-  props: {
-    openType: String
-  },
-
-  methods: {
-    bindGetUserInfo(event) {
-      this.$emit('getuserinfo', event)
-    },
-
-    bindContact(event) {
-      this.$emit('contact', event.detail)
-    },
-
-    bindGetPhoneNumber(event) {
-      this.$emit('getphonenumber', event.detail)
-    },
-
-    bindError(event) {
-      this.$emit('error', event.detail)
-    },
-
-    bindLaunchApp(event) {
-      this.$emit('launchapp', event.detail)
-    },
-
-    bindOpenSetting(event) {
-      this.$emit('opensetting', event.detail)
-    }
-  }
-}

+ 0 - 39
src/ttcomponents/mixins/page-scroll.js

@@ -1,39 +0,0 @@
-function getCurrentPage() {
-  const pages = getCurrentPages()
-  return pages[pages.length - 1] || {}
-}
-
-function onPageScroll(event) {
-  console.log('页面滚动执行', event)
-  const { vanPageScroller = [] } = getCurrentPage()
-
-  vanPageScroller.forEach(scroller => {
-    if (typeof scroller === 'function') {
-      scroller(event)
-    }
-  })
-}
-
-export const pageScrollMixin = scroller => ({
-  created() {
-    const page = getCurrentPage()
-
-    if (Array.isArray(page.vanPageScroller)) {
-      page.vanPageScroller.push(scroller.bind(this))
-    } else {
-      page.vanPageScroller =
-        typeof page.onPageScroll === 'function'
-          ? [page.onPageScroll.bind(page), scroller.bind(this)]
-          : [scroller.bind(this)]
-    }
-
-    // page.onPageScroll = onPageScroll
-  },
-
-  destroyed() {
-    const page = getCurrentPage()
-    page.vanPageScroller = (page.vanPageScroller || []).filter(
-      item => item !== scroller
-    )
-  }
-})

+ 0 - 96
src/ttcomponents/mixins/relation.js

@@ -1,96 +0,0 @@
-import { sortChildren } from '../utils'
-
-export function ChildrenMixin(parent, options = {}) {
-  const indexKey = options.indexKey || 'index'
-
-  return {
-    inject: {
-      [parent]: {
-        default: null
-      }
-    },
-
-    computed: {
-      [indexKey]() {
-        this.bindRelation()
-        if (this[parent]) {
-          const children = JSON.parse(this[parent].children)
-          return children.map(item => item._uid).indexOf(this._uid)
-        }
-
-        return null
-      },
-
-      parentChildren() {
-        if (!this[parent]) {
-          return []
-        }
-        const children = JSON.parse(this[parent].children)
-        return children
-      }
-    },
-
-    created() {
-      this.bindRelation()
-    },
-
-    beforeDestroy() {
-      if (this[parent]) {
-        let children = JSON.parse(this[parent].children)
-        children = children.filter(
-          item => item._uid !== this._uid
-        )
-        this[parent].children = JSON.stringify(children)
-      }
-    },
-
-    methods: {
-      bindRelation() {
-        if (!this[parent]) {
-          return
-        }
-        const _children = JSON.parse(this[parent].children)
-        if (_children.map(item => item._uid).indexOf(this._uid) !== -1) {
-          return
-        }
-
-        const children = [..._children, { ...this.$data, ...this.$props, _uid: this._uid }]
-
-        sortChildren(children)
-
-        this[parent].children = JSON.stringify(children)
-      },
-      _getIndex() {
-        if (this[parent]) {
-          const children = JSON.parse(this[parent].children)
-          return children.map(item => item._uid).indexOf(this._uid)
-        }
-
-        return null
-      },
-      _getParentChildren() {
-        if (!this[parent]) {
-          return []
-        }
-        const children = JSON.parse(this[parent].children)
-        return children
-      }
-    }
-  }
-}
-
-export function ParentMixin(parent) {
-  return {
-    provide() {
-      return {
-        [parent]: this
-      }
-    },
-
-    data() {
-      return {
-        children: '[]'
-      }
-    }
-  }
-}

+ 0 - 42
src/ttcomponents/mixins/touch.js

@@ -1,42 +0,0 @@
-const MIN_DISTANCE = 10
-
-function getDirection(x, y) {
-  if (x > y && x > MIN_DISTANCE) {
-    return 'horizontal'
-  }
-
-  if (y > x && y > MIN_DISTANCE) {
-    return 'vertical'
-  }
-
-  return ''
-}
-
-export const touch = {
-  methods: {
-    resetTouchStatus() {
-      this.direction = ''
-      this.deltaX = 0
-      this.deltaY = 0
-      this.offsetX = 0
-      this.offsetY = 0
-    },
-
-    touchStart(event) {
-      this.resetTouchStatus()
-      const touch = event.touches[0]
-      this.startX = touch.clientX
-      this.startY = touch.clientY
-    },
-
-    touchMove(event) {
-      const touch = event.touches[0]
-      this.deltaX = touch.clientX - this.startX
-      this.deltaY = touch.clientY - this.startY
-      this.offsetX = Math.abs(this.deltaX)
-      this.offsetY = Math.abs(this.deltaY)
-      this.direction =
-        this.direction || getDirection(this.offsetX, this.offsetY)
-    }
-  }
-}

+ 0 - 188
src/ttcomponents/mixins/transition.js

@@ -1,188 +0,0 @@
-import { isObj, requestAnimationFrame } from '../common/utils'
-
-const nextTick = () => new Promise(resolve => setTimeout(resolve, 1000 / 30))
-
-export const transition = function(showDefaultValue) {
-  return {
-    props: {
-      customStyle: String,
-      show: {
-        type: Boolean,
-        default: showDefaultValue
-      },
-      duration: {
-        type: [String, Number, Object],
-        default: 300
-      },
-      name: {
-        type: String,
-        default: 'fade'
-      },
-      enterClass: String,
-      enterActiveClass: String,
-      enterToClass: String,
-      leaveActiveClass: String,
-      leaveClass: String,
-      leaveToClass: String
-    },
-
-    data() {
-      return {
-        type: '',
-        inited: false,
-        display: false,
-        classes: '',
-        currentName: ''
-      }
-    },
-
-    watch: {
-      show(value, old) {
-        this.observeShow(value, old)
-      },
-      duration() {
-        // this.observeDuration(value, old)
-      }
-    },
-
-    methods: {
-      observeShow(value, old) {
-        if (value === old) {
-          return
-        }
-        value ? this.enter() : this.leave()
-      },
-
-      getClassNames(name) {
-        return ({
-          enter: `van-${name}-enter van-${name}-enter-active ${this.enterClass} ${this.enterActiveClass}`,
-          'enter-to': `van-${name}-enter-to van-${name}-enter-active ${this.enterToClass} ${this.enterActiveClass}`,
-          leave: `van-${name}-leave van-${name}-leave-active ${this.leaveClass} ${this.leaveActiveClass}`,
-          'leave-to': `van-${name}-leave-to van-${name}-leave-active ${this.leaveToClass} ${this.leaveActiveClass}`
-        })
-      },
-
-      enter() {
-        const { duration, name, currentName } = this
-        const classNames = this.getClassNames(currentName || name)
-        const currentDuration = isObj(duration) ? duration.enter : duration
-
-        this.status = 'enter'
-        this.$emit('before-enter')
-
-        // #ifdef MP-WEIXIN
-        requestAnimationFrame(() => {
-          this.checkStatus('enter')
-          this.$emit('enter')
-
-          this.inited = true
-          this.display = true
-          this.classes = classNames.enter
-          this.currentDuration = currentDuration
-
-          requestAnimationFrame(() => {
-            this.checkStatus('enter')
-            this.transitionEnded = false
-
-            this.classes = classNames['enter-to']
-          })
-        })
-        // #endif
-
-        // #ifndef MP-WEIXIN
-        Promise.resolve()
-          .then(nextTick)
-          .then(() => {
-            this.checkStatus('enter')
-            this.$emit('enter')
-
-            this.inited = true
-            this.display = true
-            this.classes = classNames.enter
-            this.currentDuration = currentDuration
-          })
-          .then(nextTick)
-          .then(() => {
-            this.checkStatus('enter')
-            this.transitionEnded = false
-
-            this.classes = classNames['enter-to']
-          })
-          .catch(() => {})
-        // #endif
-      },
-
-      leave() {
-        if (!this.display) {
-          return
-        }
-
-        const { duration, name, currentName } = this
-        const classNames = this.getClassNames(currentName || name)
-        const currentDuration = isObj(duration) ? duration.leave : duration
-
-        this.status = 'leave'
-        this.$emit('before-leave')
-
-        // #ifdef MP-WEIXIN
-        requestAnimationFrame(() => {
-          this.checkStatus('leave')
-          this.$emit('leave')
-
-          this.classes = classNames.leave
-          this.currentDuration = currentDuration
-
-          requestAnimationFrame(() => {
-            this.checkStatus('leave')
-            this.transitionEnded = false
-            setTimeout(() => this.onTransitionEnd(), currentDuration)
-
-            this.classes = classNames['leave-to']
-          })
-        })
-        // #endif
-
-        // #ifndef MP-WEIXIN
-        Promise.resolve()
-          .then(nextTick)
-          .then(() => {
-            this.checkStatus('leave')
-            this.$emit('leave')
-
-            this.classes = classNames.leave
-            this.currentDuration = currentDuration
-          })
-          .then(nextTick)
-          .then(() => {
-            this.checkStatus('leave')
-            this.transitionEnded = false
-            setTimeout(() => this.onTransitionEnd(), currentDuration)
-
-            this.classes = classNames['leave-to']
-          })
-          .catch(() => {})
-        // #endif
-      },
-
-      checkStatus(status) {
-        if (status !== this.status) {
-          throw new Error(`incongruent status: ${status}`)
-        }
-      },
-
-      onTransitionEnd() {
-        if (this.transitionEnded) {
-          return
-        }
-
-        this.transitionEnded = true
-        this.$emit(`after-${this.status}`)
-
-        const { show, display } = this
-        if (!show && display) {
-          this.display = false
-        }
-      }
-    }
-  }
-}

+ 0 - 19
src/ttcomponents/utils/index.js

@@ -1,19 +0,0 @@
-// 驼峰转短横线
-// 来自:https://blog.csdn.net/Ttian6/article/details/100986106
-export function getKebabCase(str) {
-  return str.replace(/[A-Z]/g, function(item) {
-    return '-' + item.toLowerCase()
-  })
-}
-
-// 短横线转驼峰
-// 来自:https://blog.csdn.net/Ttian6/article/details/100986106
-export function getCamelCase(str) {
-  return str.replace(/-([a-z])/g, function(keb, item) {
-    return item.toUpperCase()
-  })
-}
-
-export function sortChildren(children) {
-  children.sort((a, b) => a._uid - b._uid)
-}

+ 0 - 201
src/ttcomponents/van-action-sheet/README.md

@@ -1,201 +0,0 @@
-# ActionSheet 上拉菜单
-
-### 引入
-
-推荐使用 `easycom` 的方式引入,详细介绍见[快速上手](#/quickstart#easycom-mo-shi-tui-jian)
-
-## 代码演示
-
-### 基础用法
-
-需要传入一个`actions`的数组,数组的每一项是一个对象,对象属性见文档下方表格。
-
-```html
-<van-action-sheet
-  :show="show"
-  :actions="actions"
-  @close="onClose"
-  @select="onSelect"
-/>
-```
-
-```javascript
-export default {
-  data() {
-    return{
-      show: false,
-      actions: [
-        {
-          name: '选项',
-        },
-        {
-          name: '选项',
-        },
-        {
-          name: '选项',
-          subname: '副文本',
-          openType: 'share',
-        },
-      ],
-    }
-  },
-
-  methods: {
-    onClose() {
-      this.show = false;
-    },
-
-    onSelect(event) {
-      console.log(event.detail);
-    },
-  }
-}
-```
-
-### 选项状态
-
-选项可以设置为加载状态或禁用状态。
-
-```html
-<van-action-sheet
-  :show="show"
-  :actions="actions"
-  cancel-text="取消"
-/>
-```
-
-```javascript
-export default {
-  data() {
-    return {
-      show: false,
-      actions: [
-        { name: '选项', color: '#07c160' },
-        { loading: true },
-        { name: '禁用选项', disabled: true },
-      ],
-    }
-  }
-}
-```
-
-### 展示取消按钮
-
-设置`cancel-text`属`性后,会在底部展示取消按钮,点击后关闭当前菜单
-
-```html
-<van-action-sheet
-  :show="show"
-  :actions="actions"
-  cancel-text="取消"
-/>
-```
-
-### 展示描述信息
-
-设置`description`属性后,会在选项上方显示描述信息
-
-```html
-<van-action-sheet
-  :show="show"
-  :actions="actions"
-  description="这是一段描述信息"
-/>
-```
-
-### 展示标题栏
-
-通过设置`title`属性展示标题栏,同时可以使用插槽自定义菜单内容
-
-```html
-<van-action-sheet :show="show" title="标题">
-  <view>内容</view>
-</van-action-sheet>
-```
-
-### 微信开放能力
-
-需要传入一个`actions`的数组,数组的每一项是一个对象,对象属性见文档下方表格。
-
-```html
-<van-action-sheet
-  :show="show"
-  :actions="actions"
-  @close="onClose"
-  @getuserinfo="onGetUserInfo"
-/>
-```
-
-```javascript
-export default {
-  data: {
-    show: false,
-    actions: [
-      { name: '获取用户信息', color: '#07c160', openType: 'getUserInfo' },
-    ],
-  },
-
-  methods: {
-    onClose() {
-      this.show = false;
-    },
-
-    onGetUserInfo(e) {
-      console.log(e.detail);
-    },
-  }
-}
-```
-
-## API
-
-### Props
-
-| 参数 | 说明 | 类型 | 默认值 | 版本 |
-| --- | --- | --- | --- | --- |
-| actions | 菜单选项 | _Array_ | `[]` | - |
-| title | 标题 | _string_ | - | - |
-| description | 选项上方的描述信息 | _string_ | - | 1.0.0 |
-| z-index | z-index 层级 | _number_ | `100` | - |
-| cancel-text | 取消按钮文字 | _string_ | - | - |
-| overlay | 是否显示遮罩层 | _boolean_ | - | - |
-| round | 是否显示圆角 | _boolean_ | `true` | 1.0.0 |
-| close-on-click-action | 是否在点击选项后关闭 | _boolean_ | `true` | - |
-| close-on-click-overlay | 点击遮罩是否关闭菜单 | _boolean_ | - | - |
-| safe-area-inset-bottom | 是否为 iPhoneX 留出底部安全距离 | _boolean_ | `true` | - |
-
-### Events
-
-| 事件名 | 说明 | 参数 |
-| --- | --- | --- |
-| @select | 选中选项时触发,禁用或加载状态下不会触发 | event.detail: 选项对应的对象 |
-| @close | 关闭时触发 | - |
-| @cancel | 取消按钮点击时触发 | - |
-| @click-overlay | 点击遮罩层时触发 | - |
-| @getuserinfo | 用户点击该按钮时,会返回获取到的用户信息,回调的 detail 数据与 wx.getUserInfo 返回的一致,<a href="#/action-sheet#actions">openType</a>="getUserInfo"时有效 | - |
-| @contact | 客服消息回调,<a href="#/action-sheet#actions">openType</a>="contact"时有效 | - |
-| @getphonenumber | 获取用户手机号回调,<a href="#/action-sheet#actions">openType</a>="getPhoneNumber"时有效 | - |
-| @error | 当使用开放能力时,发生错误的回调,<a href="#/action-sheet#actions">openType</a>="launchApp"时有效 | - |
-| @launchapp | 打开 APP 成功的回调,<a href="#/action-sheet#actions">openType</a>="launchApp"时有效 | - |
-| @opensetting | 在打开授权设置页后回调,<a href="#/action-sheet#actions">openType</a>="openSetting"时有效 | - |
-
-### actions
-
-`API`中的`actions`为一个对象数组,数组中的每一个对象配置每一列,每一列有以下`key`:
-
-| 键名 | 说明 | 类型 | 默认值 |
-| --- | --- | --- | --- |
-| name | 标题 | _string_ | - |
-| subname | 二级标题 | _string_ | - |
-| color | 选项文字颜色 | _string_ | - |
-| loading | 是否为加载状态 | _boolean_ | - |
-| disabled | 是否为禁用状态 | _boolean_ | - |
-| className | 为对应列添加额外的 class 类名 | _string_ | - |
-| openType | 微信开放能力,具体支持可参考 [微信官方文档](https://mp.weixin.qq.com/debug/wxadoc/dev/component/button.html) | _string_ | - |
-| lang | 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文 | _string_ | `en` |
-| sessionFrom | 会话来源,openType="contact"时有效 | _string_ | - |
-| sendMessageTitle | 会话内消息卡片标题,openType="contact"时有效 | _string_ | 当前标题 |
-| sendMessagePath | 会话内消息卡片点击跳转小程序路径,openType="contact"时有效 | _string_ | 当前分享路径 |
-| sendMessageImg | 会话内消息卡片图片,openType="contact"时有效 | _string_ | 截图 |
-| showMessageCard | 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,用户点击后可以快速发送小程序消息,openType="contact"时有效 | _string_ | `false` |
-| appParameter | 打开 APP 时,向 APP 传递的参数,openType=launchApp 时有效 | _string_ | - |

+ 0 - 134
src/ttcomponents/van-action-sheet/demo.vue

@@ -1,134 +0,0 @@
-<template>
-  <div>
-    <demo-block title="基础用法" padding>
-      <van-button type="primary" @click="toggleActionSheet1">弹出菜单</van-button>
-      <van-action-sheet
-        :show="show1"
-        :actions="action1"
-        @close="toggleActionSheet1"
-        @select="toggleActionSheet1"
-      />
-    </demo-block>
-
-    <demo-block title="选项状态" padding>
-      <van-button type="primary" @click="toggleActionSheet2">弹出菜单</van-button>
-      <van-action-sheet
-        :show="show2"
-        :actions="action2"
-        @close="toggleActionSheet2"
-        @cancel="toggleActionSheet2"
-        @select="toggleActionSheet2"
-      />
-    </demo-block>
-
-    <demo-block title="展示取消按钮" padding>
-      <van-button type="primary" @click="toggleActionSheet3">弹出菜单</van-button>
-      <van-action-sheet
-        :show="show3"
-        :actions="action1"
-        cancel-text="取消"
-        @close="toggleActionSheet3"
-      >
-      </van-action-sheet>
-    </demo-block>
-
-    <demo-block title="展示描述信息" padding>
-      <van-button type="primary" @click="toggleActionSheet4">弹出菜单</van-button>
-      <van-action-sheet
-        :show="show4"
-        :actions="action1"
-        description="这是一段描述信息"
-        @close="toggleActionSheet4"
-      >
-      </van-action-sheet>
-    </demo-block>
-
-    <demo-block title="展示标题栏" padding>
-      <van-button type="primary" @click="toggleActionSheet5">弹出菜单</van-button>
-      <van-action-sheet
-        :show="show5"
-        title="标题"
-        @close="toggleActionSheet5"
-      >
-        <view class="content">内容</view>
-      </van-action-sheet>
-    </demo-block>
-
-    <demo-block title="微信开发能力" padding>
-      <van-button type="primary" @click="toggleActionSheet6">弹出菜单</van-button>
-      <van-action-sheet
-        :show="show6"
-        title="标题"
-        @close="toggleActionSheet6"
-        :actions="action6"
-        @getuserinfo="onGetUserInfo"
-      >
-      </van-action-sheet>
-    </demo-block>
-  </div>
-</template>
-
-<script>
-export default {
-  data() {
-    return {
-      show1: false,
-      show2: false,
-      show3: false,
-      show4: false,
-      show5: false,
-      show6: false,
-      action1: [
-        { name: '选项' },
-        { name: '选项' },
-        { name: '选项', subname: '副文本' }
-      ],
-      action2: [
-        { name: '选项', color: '#07c160' },
-        { loading: true },
-        { name: '禁用选项', disabled: true }
-      ],
-      action6: [
-        { name: '获取用户信息', color: '#07c160', openType: 'getUserInfo' }
-      ]
-    }
-  },
-  methods: {
-    toggle(type) {
-      this[type] = !this[type]
-    },
-
-    toggleActionSheet1() {
-      this.toggle('show1')
-    },
-
-    toggleActionSheet2() {
-      this.toggle('show2')
-    },
-
-    toggleActionSheet3() {
-      this.toggle('show3')
-    },
-
-    toggleActionSheet4() {
-      this.toggle('show4')
-    },
-
-    toggleActionSheet5() {
-      this.toggle('show5')
-    },
-    toggleActionSheet6() {
-      this.toggle('show6')
-    },
-    onGetUserInfo(e) {
-      console.log(e)
-    }
-  }
-}
-</script>
-
-<style>
-.content {
-  padding: 20px;
-}
-</style>

+ 0 - 74
src/ttcomponents/van-action-sheet/index.less

@@ -1,74 +0,0 @@
-@import '../common/style/var.less';
-@import '../common/style/theme.less';
-@import '../common/style/hairline.less';
-
-.van-action-sheet {
-  .theme(max-height, '@action-sheet-max-height') !important;
-  .theme(color, '@action-sheet-item-text-color');
-
-  &__item,
-  &__cancel {
-    text-align: center;
-    border: none;
-    .theme(font-size, '@action-sheet-item-font-size');
-    .theme(line-height, '@action-sheet-item-height');
-    .theme(background-color, '@action-sheet-item-background');
-
-    &--hover {
-      .theme(background-color, '@active-color');
-    }
-  }
-
-  &__cancel {
-    &::before {
-      display: block;
-      content: ' ';
-      .theme(height, '@action-sheet-cancel-padding-top');
-      .theme(background-color, '@action-sheet-cancel-padding-color');
-    }
-  }
-
-  &__item--disabled {
-    .theme(color, '@action-sheet-item-disabled-text-color');
-  }
-
-  &__item--disabled&__item--hover {
-    .theme(background-color, '@action-sheet-item-background');
-  }
-
-  &__subname {
-    .theme(margin-left, '@padding-base');
-    .theme(font-size, '@action-sheet-subname-font-size');
-    .theme(color, '@action-sheet-subname-color');
-  }
-
-  &__header {
-    text-align: center;
-    .theme(font-weight, '@font-weight-bold');
-    .theme(font-size, '@action-sheet-header-font-size');
-    .theme(line-height, '@action-sheet-header-height');
-  }
-
-  &__description {
-    text-align: center;
-    .theme(padding, '@padding-md');
-    .theme(color, '@action-sheet-description-color');
-    .theme(font-size, '@action-sheet-description-font-size');
-    .theme(line-height, '@action-sheet-description-line-height');
-  }
-
-  &__close {
-    position: absolute !important;
-    top: 0;
-    right: 0;
-    line-height: inherit !important;
-    .theme(padding, '@action-sheet-close-icon-padding');
-    .theme(font-size, '@action-sheet-close-icon-size') !important;
-    .theme(color, '@action-sheet-close-icon-color');
-  }
-
-  &__loading {
-    display: flex !important;
-    .theme(height, '@action-sheet-item-height');
-  }
-}

+ 0 - 155
src/ttcomponents/van-action-sheet/van-action-sheet.vue

@@ -1,155 +0,0 @@
-<template>
-  <van-popup
-    :show="show"
-    position="bottom"
-    :round="round"
-    :z-index="zIndex"
-    :overlay="overlay"
-    custom-class="van-action-sheet"
-    :safe-area-inset-bottom="safeAreaInsetBottom"
-    :close-on-click-overlay="closeOnClickOverlay"
-    @close="onClickOverlay"
-  >
-    <view v-if="title" class="van-hairline--bottom van-action-sheet__header">
-      {{ title }}
-      <van-icon
-        name="close"
-        custom-class="van-action-sheet__close"
-        class="van-action-sheet__close"
-        @click="onClose"
-      />
-    </view>
-    <view v-if="description" class="van-action-sheet__description">
-      {{ description }}
-    </view>
-    <view v-if="actions && actions.length">
-      <!-- button外包一层view,防止actions动态变化,导致渲染时button被打散 -->
-      <button
-        v-for="(item, index) in currentActions"
-        :key="index"
-        :open-type="item.openType"
-        :style="[item.color ? { color: item.color } : {}]"
-        :class="item.buttonClass"
-        hover-class="van-action-sheet__item--hover"
-        @click="onSelect(index)"
-        @getuserinfo="bindGetUserInfo"
-        @contact="bindContact"
-        @getphonenumber="bindGetPhoneNumber"
-        @error="bindError"
-        @launchapp="bindLaunchApp"
-        @opensetting="bindOpenSetting"
-        :lang="lang"
-        :session-from="sessionFrom"
-        :send-message-title="sendMessageTitle"
-        :send-message-path="sendMessagePath"
-        :send-message-img="sendMessageImg"
-        :show-message-card="showMessageCard"
-        :app-parameter="appParameter"
-      >
-        <block v-if="!item.loading">
-          {{ item.name }}
-          <text v-if="item.subname" class="van-action-sheet__subname" >{{ item.subname }}</text>
-        </block>
-        <van-loading v-else custom-class="van-action-sheet__loading" size="20px" />
-      </button>
-    </view>
-    <slot />
-    <view
-      v-if="cancelText"
-      class="van-action-sheet__cancel"
-      hover-class="van-action-sheet__cancel--hover"
-      hover-stay-time="70"
-      @click="onCancel"
-    >
-      {{ cancelText }}
-    </view>
-  </van-popup>
-</template>
-
-<script>
-import utils from '../wxs/utils'
-import VanIcon from '../van-icon/van-icon'
-import VanPopup from '../van-popup/van-popup'
-import VanLoading from '../van-loading/van-loading'
-import { VantComponent } from '../common/component'
-import { button } from '../mixins/button'
-import { openType } from '../mixins/open-type'
-export default {
-  components: {
-    VanIcon,
-    VanPopup,
-    VanLoading
-  },
-  ...VantComponent({
-    mixins: [button, openType],
-    props: {
-      show: Boolean,
-      title: String,
-      cancelText: String,
-      description: String,
-      round: {
-        type: Boolean,
-        default: true,
-      },
-      zIndex: {
-        type: Number,
-        default: 100,
-      },
-      actions: {
-        type: Array,
-        default: () => [],
-      },
-      overlay: {
-        type: Boolean,
-        default: true,
-      },
-      closeOnClickOverlay: {
-        type: Boolean,
-        default: true,
-      },
-      closeOnClickAction: {
-        type: Boolean,
-        default: true,
-      },
-      safeAreaInsetBottom: {
-        type: Boolean,
-        default: true,
-      },
-    },
-    computed: {
-      currentActions() {
-        return this.actions.map(item => ({ ...item, buttonClass: `${ utils.bem('action-sheet__item', { disabled: item.disabled || item.loading }) } van-hairline--top ${ item.className || '' }` }))
-      }
-    },
-    methods: {
-      onSelect(index) {
-        const item = this.actions[index]
-        if (item && !item.disabled && !item.loading) {
-          this.$emit('select', item)
-
-          if (this.closeOnClickAction) {
-            this.onClose()
-          }
-        }
-      },
-
-      onCancel() {
-        this.$emit('cancel')
-      },
-
-      onClose() {
-        this.$emit('close')
-      },
-
-      onClickOverlay() {
-        this.$emit('click-overlay')
-        this.onClose()
-      },
-    }
-  })
-}
-</script>
-
-<style lang="less">
-@import './index.less';
-</style>

+ 0 - 159
src/ttcomponents/van-button/README.md

@@ -1,159 +0,0 @@
-# Button 按钮
-
-### 引入
-
-推荐使用 `easycom` 的方式引入,详细介绍见[快速上手](#/quickstart#easycom-mo-shi-tui-jian)
-
-## 代码演示
-
-### 按钮类型
-
-支持`default`、`primary`、`info`、`warning`、`danger`五种类型,默认为`default`
-
-```html
-<van-button type="default">默认按钮</van-button>
-<van-button type="primary">主要按钮</van-button>
-<van-button type="info">信息按钮</van-button>
-<van-button type="warning">警告按钮</van-button>
-<van-button type="danger">危险按钮</van-button>
-```
-
-### 朴素按钮
-
-通过`plain`属性将按钮设置为朴素按钮,朴素按钮的文字为按钮颜色,背景为白色
-
-```html
-<van-button plain type="primary">朴素按钮</van-button>
-<van-button plain type="info">朴素按钮</van-button>
-```
-
-### 细边框
-
-设置`hairline`属性可以开启 0.5px 边框,基于伪类实现
-
-```html
-<van-button plain hairline type="primary">细边框按钮</van-button>
-<van-button plain hairline type="info">细边框按钮</van-button>
-```
-
-### 禁用状态
-
-通过`disabled`属性来禁用按钮,此时按钮的`bind:click`事件不会触发
-
-```html
-<van-button disabled type="primary">禁用状态</van-button>
-<van-button disabled type="info">禁用状态</van-button>
-```
-
-### 加载状态
-
-```html
-<van-button loading type="primary" />
-<van-button loading type="primary" loading-type="spinner" />
-<van-button loading type="info" loading-text="加载中..." />
-```
-
-### 按钮形状
-
-```html
-<van-button square type="primary">方形按钮</van-button>
-<van-button round type="info">圆形按钮</van-button>
-```
-
-### 图标按钮
-
-通过`icon`属性设置按钮图标,支持 Icon 组件里的所有图标,也可以传入图标 URL
-
-```html
-<van-button icon="star-o" type="primary" />
-<van-button icon="star-o" type="primary">按钮</van-button>
-<van-button icon="https://img.yzcdn.cn/vant/logo.png" type="info">
-  按钮
-</van-button>
-```
-
-### 按钮尺寸
-
-支持`large`、`normal`、`small`、`mini`四种尺寸,默认为`normal`
-
-```html
-<van-button type="primary" size="large">大号按钮</van-button>
-<van-button type="primary" size="normal">普通按钮</van-button>
-<van-button type="primary" size="small">小型按钮</van-button>
-<van-button type="primary" size="mini">迷你按钮</van-button>
-```
-
-### 块级元素
-
-通过`block`属性可以将按钮的元素类型设置为块级元素
-
-```html
-<van-button type="primary" block>块级元素</van-button>
-```
-
-### 自定义颜色
-
-通过`color`属性可以自定义按钮的颜色
-
-```html
-<van-button color="#7232dd">单色按钮</van-button>
-<van-button color="#7232dd" plain>单色按钮</van-button>
-<van-button color="linear-gradient(to right, #4bb0ff, #6149f6)">
-  渐变色按钮
-</van-button>
-```
-
-## API
-
-### Props
-
-| 参数 | 说明 | 类型 | 默认值 | 版本 |
-| --- | --- | --- | --- | --- |
-| id | 标识符 | _string_ | - | - |
-| type | 按钮类型,可选值为 `primary` `info` `warning` `danger` | _string_ | `default` | - |
-| size | 按钮尺寸,可选值为 `normal` `large` `small` `mini` | _string_ | `normal` | - |
-| color | 按钮颜色,支持传入`linear-gradient`渐变色 | _string_ | - | 1.0.0 |
-| icon | 左侧图标名称或图片链接,可选值见 [Icon 组件](#/icon) | _string_ | - | - |
-| class-prefix | 图标类名前缀,同 Icon 组件的 [class-prefix 属性](#/icon) | _string_ | `van-icon` | - |
-| plain | 是否为朴素按钮 | _boolean_ | `false` | - |
-| block | 是否为块级元素 | _boolean_ | `false` | - |
-| round | 是否为圆形按钮 | _boolean_ | `false` | - |
-| square | 是否为方形按钮 | _boolean_ | `false` | - |
-| disabled | 是否禁用按钮 | _boolean_ | `false` | - |
-| hairline | 是否使用 0.5px 边框 | _boolean_ | `false` | - |
-| loading | 是否显示为加载状态 | _boolean_ | `false` | - |
-| loading-text | 加载状态提示文字 | _string_ | - | - |
-| loading-type | 加载状态图标类型,可选值为 `spinner` | _string_ | `circular` | - |
-| loading-size | 加载图标大小 | _string_ | `20px` | - |
-| custom-style | 自定义样式 | _string_ | - | - |
-| open-type | 微信开放能力,具体支持可参考 [微信官方文档](https://mp.weixin.qq.com/debug/wxadoc/dev/component/button.html) | _string_ | - | - |
-| app-parameter | 打开 APP 时,向 APP 传递的参数 | _string_ | - | - |
-| lang | 指定返回用户信息的语言,zh_CN 简体中文,<br>zh_TW 繁体中文,en 英文 | _string_ | `en` | - | - |
-| session-from | 会话来源 | _string_ | - | - |
-| business-id | 客服消息子商户 id | _number_ | - | - |
-| send-message-title | 会话内消息卡片标题 | _string_ | 当前标题 | - |
-| send-message-path | 会话内消息卡片点击跳转小程序路径 | _string_ | 当前分享路径 | - |
-| send-message-img | sendMessageImg | _string_ | 截图 | - |
-| show-message-card | 显示会话内消息卡片 | _string_ | `false` | - |
-| dataset | 按钮 dataset,open-type 为 `share` 时,可在 onShareAppMessage 事件的 `event.target.dataset.detail` 中看到传入的值 | _any_ | - | - |
-| form-type | 用于 form 组件,可选值为`submit` `reset`,点击分别会触发 form 组件的 submit/reset 事件 | _string_ | - | - |
-
-### Events
-
-| 事件名 | 说明 | 参数 |
-| --- | --- | --- |
-| @click | 点击按钮,且按钮状态不为加载或禁用时触发 | - |
-| @getuserinfo | 用户点击该按钮时,会返回获取到的用户信息,<br>从返回参数的 detail 中获取到的值同 wx.getUserInfo | - |
-| @contact | 客服消息回调 | - |
-| @getphonenumber | 获取用户手机号回调 | - |
-| @error | 当使用开放能力时,发生错误的回调 | - |
-| @opensetting | 在打开授权设置页后回调 | - |
-
-> Button 提供的是 click 事件而不是原生 tap 事件,按钮禁用时,click 事件不会触发,tap 事件依然会触发。
-
-### 外部样式类
-
-| 类名          | 说明           |
-| ------------- | -------------- |
-| custom-class  | 根节点样式类   |
-| loading-class | 加载图标样式类 |

+ 0 - 75
src/ttcomponents/van-button/demo.vue

@@ -1,75 +0,0 @@
-<template>
-  <div>
-    <demo-block title="按钮类型" padding>
-      <view class="row">
-        <van-button id="im-id" custom-class="demo-margin-right">默认按钮</van-button>
-        <van-button type="primary" custom-class="demo-margin-right">主要按钮</van-button>
-        <van-button type="info" custom-class="demo-margin-right">信息按钮</van-button>
-      </view>
-      <van-button type="danger" custom-class="demo-margin-right">危险按钮</van-button>
-      <van-button type="warning">警告按钮</van-button>
-    </demo-block>
-
-    <demo-block title="朴素按钮" padding>
-      <van-button type="primary" plain custom-class="demo-margin-right">朴素按钮</van-button>
-      <van-button type="info" plain>朴素按钮</van-button>
-    </demo-block>
-
-    <demo-block title="细边框" padding>
-      <van-button type="primary" plain hairline custom-class="demo-margin-right">细边框按钮</van-button>
-      <van-button type="info" plain hairline>细边框按钮</van-button>
-    </demo-block>
-
-    <demo-block title="禁用状态" padding>
-      <van-button type="primary" disabled custom-class="demo-margin-right">禁用状态</van-button>
-      <van-button type="info" disabled>禁用状态</van-button>
-    </demo-block>
-
-    <demo-block title="加载状态" padding>
-      <van-button loading type="primary" custom-class="demo-margin-right" />
-      <van-button loading type="primary" loading-type="spinner" custom-class="demo-margin-right" />
-      <van-button loading type="info" loading-text="加载中..." />
-    </demo-block>
-
-    <demo-block title="按钮形状" padding>
-      <van-button type="primary" square custom-class="demo-margin-right">方形按钮</van-button>
-      <van-button type="info" round>圆形按钮</van-button>
-    </demo-block>
-
-    <demo-block title="图标按钮" padding>
-      <van-button type="primary" icon="star-o" custom-class="demo-margin-right" />
-      <van-button type="primary" icon="star-o" custom-class="demo-margin-right">按钮</van-button>
-      <van-button plain type="primary" icon="https://img.yzcdn.cn/vant/logo.png">按钮</van-button>
-    </demo-block>
-
-    <demo-block title="按钮尺寸" padding>
-      <van-button type="primary" size="large" block custom-class="demo-margin-bottom">大号按钮</van-button>
-      <van-button type="primary" custom-class="demo-margin-right">普通按钮</van-button>
-      <van-button type="primary" size="small" custom-class="demo-margin-right">小型按钮</van-button>
-      <van-button type="primary" size="mini">迷你按钮</van-button>
-    </demo-block>
-
-    <demo-block title="块级元素" padding>
-      <van-button type="primary" custom-class="demo-margin-bottom">普通按钮</van-button>
-      <van-button type="primary" block>块级元素</van-button>
-    </demo-block>
-
-    <demo-block title="自定义颜色" padding>
-      <van-button color="#7232dd" custom-class="demo-margin-right">单色按钮</van-button>
-      <van-button color="#7232dd" custom-class="demo-margin-right" plain>单色按钮</van-button>
-      <van-button color="linear-gradient(to right, #4bb0ff, #6149f6)">渐变色按钮</van-button>
-    </demo-block>
-  </div>
-</template>
-
-<script>
-export default {
-}
-</script>
-
-<style>
-.row {
-  height: 44px;
-  margin-bottom: 15px;
-}
-</style>

+ 0 - 180
src/ttcomponents/van-button/index.less

@@ -1,180 +0,0 @@
-@import '../common/style/var.less';
-@import '../common/style/theme.less';
-
-.van-button {
-  position: relative;
-  display: inline-flex;
-  align-items: center;
-  justify-content: center;
-  box-sizing: border-box;
-  padding: 0;
-  text-align: center;
-  vertical-align: middle;
-  -webkit-appearance: none;
-  -webkit-text-size-adjust: 100%;
-
-  .theme(height, '@button-default-height');
-  .theme(line-height, '@button-line-height');
-  .theme(font-size, '@button-default-font-size');
-  .theme(transition, 'opacity @animation-duration-fast');
-  .theme(border-radius, '@button-border-radius');
-
-  &::before {
-    position: absolute;
-    top: 50%;
-    left: 50%;
-    width: 100%;
-    height: 100%;
-    border: inherit;
-    border-radius: inherit; /* inherit parent's border radius */
-    transform: translate(-50%, -50%);
-    opacity: 0;
-    content: ' ';
-
-    .theme(background-color, '@black');
-    .theme(border-color, '@black');
-  }
-
-  // reset weapp default border
-  &::after {
-    border-width: 0;
-  }
-
-  &--active::before {
-    opacity: 0.15;
-  }
-
-  &--unclickable::after {
-    display: none;
-  }
-
-  &--default {
-    .theme(color, '@button-default-color');
-    .theme(background, '@button-default-background-color');
-    .theme(border, '@button-border-width solid @button-default-border-color');
-  }
-
-  &--primary {
-    .theme(color, '@button-primary-color');
-    .theme(background, '@button-primary-background-color');
-    .theme(border, '@button-border-width solid @button-primary-border-color');
-  }
-
-  &--info {
-    .theme(color, '@button-info-color');
-    .theme(background, '@button-info-background-color');
-    .theme(border, '@button-border-width solid @button-info-border-color');
-  }
-
-  &--danger {
-    .theme(color, '@button-danger-color');
-    .theme(background, '@button-danger-background-color');
-    .theme(border, '@button-border-width solid @button-danger-border-color');
-  }
-
-  &--warning {
-    .theme(color, '@button-warning-color');
-    .theme(background, '@button-warning-background-color');
-    .theme(border, '@button-border-width solid @button-warning-border-color');
-  }
-
-  &--plain {
-    .theme(background, '@button-plain-background-color');
-
-    &.van-button--primary {
-      .theme(color, '@button-primary-background-color');
-    }
-
-    &.van-button--info {
-      .theme(color, '@button-info-background-color');
-    }
-
-    &.van-button--danger {
-      .theme(color, '@button-danger-background-color');
-    }
-
-    &.van-button--warning {
-      .theme(color, '@button-warning-background-color');
-    }
-  }
-
-  &--large {
-    width: 100%;
-    .theme(height, '@button-large-height');
-  }
-
-  &--normal {
-    padding: 0 15px;
-    .theme(font-size, '@button-normal-font-size');
-  }
-
-  &--small {
-    .theme(min-width, '@button-small-min-width');
-    .theme(height, '@button-small-height');
-    .theme(padding, '0 @padding-xs');
-    .theme(font-size, '@button-small-font-size');
-  }
-
-  // mini图标默认宽度50px,文字不能超过4个
-  &--mini {
-    display: inline-block;
-    .theme(min-width, '@button-mini-min-width');
-    .theme(height, '@button-mini-height');
-    .theme(font-size, '@button-mini-font-size');
-
-    & + .van-button--mini {
-      margin-left: 5px;
-    }
-  }
-
-  &--block {
-    display: flex;
-    width: 100%;
-  }
-
-  &--round {
-    .theme(border-radius, '@button-round-border-radius');
-  }
-
-  &--square {
-    border-radius: 0;
-  }
-
-  &--disabled {
-    .theme(opacity, '@button-disabled-opacity');
-  }
-
-  &__text {
-    display: inline;
-  }
-
-  &__loading-text,
-  &__icon + &__text:not(:empty) {
-    margin-left: @padding-base;
-  }
-
-  &__icon {
-    min-width: 1em;
-    line-height: inherit !important;
-    vertical-align: top;
-  }
-
-  &--hairline {
-    padding-top: 1px; // add 1px padding for text vertical align middle
-    border-width: 0;
-
-    &::after {
-      border-color: inherit;
-      border-width: 1px;
-      .theme(border-radius, 'calc(@button-border-radius * 2)');
-    }
-
-    &.van-button--round::after {
-      .theme(border-radius, '@button-round-border-radius');
-    }
-
-    &.van-button--square::after {
-      border-radius: 0;
-    }
-  }
-}

+ 0 - 174
src/ttcomponents/van-button/van-button.vue

@@ -1,174 +0,0 @@
-<template>
-  <button
-    :id="id"
-    :data-detail="dataset"
-    :class="buttonClass"
-    :hover-class="btnHoverClass"
-    :lang="lang"
-    :form-type="formType"
-    :style="buttonStyle"
-    :open-type="disabled ? '' : openType"
-    :business-id="businessId"
-    :session-from="sessionFrom"
-    :send-message-title="sendMessageTitle"
-    :send-message-path="sendMessagePath"
-    :send-message-img="sendMessageImg"
-    :show-message-card="showMessageCard"
-    :app-parameter="appParameter"
-    :aria-label="ariaLabel"
-    @click="onClick"
-    @getuserinfo="bindGetUserInfo"
-    @contact="bindContact"
-    @getphonenumber="bindGetPhoneNumber"
-    @error="bindError"
-    @launchapp="bindLaunchApp"
-    @opensetting="bindOpenSetting"
-  >
-    <block v-if="loading">
-      <van-loading
-        :custom-class="loadingCustomClass"
-        :size="loadingSize"
-        :type="loadingType"
-        :color="loadingColor(type, color, plain)"
-      />
-      <view v-if="loadingText" class="van-button__loading-text">
-        {{ loadingText }}
-      </view>
-    </block>
-    <block v-else>
-      <van-icon
-        v-if="icon"
-        size="1.2em"
-        :name="icon"
-        :class-prefix="classPrefix"
-        custom-class="van-button__icon"
-        class="van-button__icon"
-        custom-style="line-height: inherit;"
-      />
-      <view class="van-button__text">
-        <slot />
-      </view>
-    </block>
-  </button>
-</template>
-
-<script>
-import { VantComponent } from '../common/component'
-import { button } from '../mixins/button'
-import { openType } from '../mixins/open-type'
-import VanIcon from '../van-icon/van-icon'
-import VanLoading from '../van-loading/van-loading'
-const utils = require('../wxs/utils')
-export default {
-  // 组件必须这样子引入,不能放在 VantComponent 里面
-  components: {
-    VanIcon,
-    VanLoading
-  },
-  ...VantComponent({
-    classes: ['hover-class', 'loading-class'],
-    mixins: [button, openType],
-    props: {
-      formType: String,
-      icon: String,
-      classPrefix: {
-        type: String,
-        default: 'van-icon'
-      },
-      plain: Boolean,
-      block: Boolean,
-      round: Boolean,
-      square: Boolean,
-      loading: Boolean,
-      hairline: Boolean,
-      disabled: Boolean,
-      loadingText: String,
-      loadingType: {
-        type: String,
-        default: 'circular'
-      },
-      type: {
-        type: String,
-        default: 'default'
-      },
-      dataset: null,
-      size: {
-        type: String,
-        default: 'normal'
-      },
-      loadingSize: {
-        type: String,
-        default: '20px'
-      },
-      color: {
-        type: String
-      }
-    },
-    computed: {
-      baseStyle() {
-        let style = ''
-
-        const { color, plain } = this
-
-        if (color) {
-          style += `color: ${plain ? color : 'white'};`
-
-          if (!plain) {
-            // Use background instead of backgroundColor to make linear-gradient work
-            style += `background: ${color};`
-          }
-
-          // hide border when color is linear-gradient
-          if (color.indexOf('gradient') !== -1) {
-            style += 'border: 0;'
-          } else {
-            style += `border-color: ${color};`
-          }
-        }
-
-        return style
-      },
-      buttonClass() {
-        const { customClass, type, size, block, round, plain, square, loading, disabled, hairline } = this
-        const bemClass = utils.bem('button', [type, size, { block, round, plain, square, loading, disabled, hairline, unclickable: disabled || loading }])
-        return `custom-class ${ customClass } ${ bemClass } ${ hairline ? 'van-hairline--surround' : '' }`
-      },
-      buttonStyle() {
-        const { baseStyle, customStyle } = this
-        return `${ baseStyle } ${ customStyle }`
-      },
-      btnHoverClass() {
-        return `van-button--active hover-class ${this.hoverClass}`
-      },
-      loadingCustomClass() {
-        return `loading-class ${this.loadingClass}`
-      }
-    },
-
-    methods: {
-      loadingColor(type, color, plain) {
-        if (plain) {
-          return color ? color : '#c9c9c9'
-        }
-
-        if (type === 'default') {
-          return '#c9c9c9'
-        }
-        return 'white'
-      },
-      onClick(e) {
-        if (this.disabled) {
-          return
-        }
-        if (!this.loading) {
-          this.$emit('click', e)
-        }
-      }
-    }
-  })
-}
-</script>
-
-<style lang="less">
-@import './index.less';
-</style>

+ 0 - 11
src/ttcomponents/van-cell-group/index.less

@@ -1,11 +0,0 @@
-@import '../common/style/var.less';
-@import '../common/style/theme.less';
-
-.van-cell-group {
-  &__title {
-    .theme(padding, '@cell-group-title-padding');
-    .theme(font-size, '@cell-group-title-font-size');
-    .theme(line-height, '@cell-group-title-line-height');
-    .theme(color, '@cell-group-title-color');
-  }
-}

+ 0 - 33
src/ttcomponents/van-cell-group/van-cell-group.vue

@@ -1,33 +0,0 @@
-<template>
-  <view>
-    <view v-if="title" class="van-cell-group__title">
-      {{ title }}
-    </view>
-    <view :class="groupClass">
-      <slot />
-    </view>
-  </view>
-</template>
-
-<script>
-import { VantComponent } from '../common/component'
-export default VantComponent({
-  props: {
-    title: String,
-    border: {
-      type: Boolean,
-      default: true
-    }
-  },
-  computed: {
-    groupClass() {
-      const { customClass, border } = this
-      return `custom-class ${customClass} van-cell-group ${ border ? 'van-hairline--top-bottom' : '' }`
-    }
-  }
-})
-</script>
-
-<style lang="less">
-@import './index.less';
-</style>

+ 0 - 156
src/ttcomponents/van-cell/README.md

@@ -1,156 +0,0 @@
-# Cell 单元格
-
-### 引入
-
-推荐使用 `easycom` 的方式引入,详细介绍见[快速上手](#/quickstart#easycom-mo-shi-tui-jian)
-
-## 代码演示
-
-### 基础用法
-
-`Cell`可以单独使用,也可以与`CellGroup`搭配使用。`CellGroup`可以为`Cell`提供上下外边框。
-
-```html
-<van-cell-group>
-  <van-cell title="单元格" value="内容" />
-  <van-cell title="单元格" value="内容" label="描述信息" :border="false" />
-</van-cell-group>
-```
-
-### 单元格大小
-
-通过`size`属性可以控制单元格的大小
-
-```html
-<van-cell title="单元格" value="内容" size="large" />
-<van-cell title="单元格" value="内容" size="large" label="描述信息" />
-```
-
-### 展示图标
-
-通过`icon`属性在标题左侧展示图标
-
-```html
-<van-cell title="单元格" icon="location-o" />
-```
-
-### 展示箭头
-
-设置`is-link`属性后会在单元格右侧显示箭头,并且可以通过`arrow-direction`属性控制箭头方向
-
-```html
-<van-cell title="单元格" is-link />
-<van-cell title="单元格" is-link value="内容" />
-<van-cell title="单元格" is-link value="内容" arrow-direction="down" />
-```
-
-### 页面跳转
-
-可以通过`url`属性进行页面跳转,通过`link-type`属性控制跳转类型
-
-```html
-<van-cell
-  is-link
-  title="单元格"
-  link-type="navigateTo"
-  url="/pages/dashboard/index"
-/>
-```
-
-### 分组标题
-
-通过`CellGroup`的`title`属性可以指定分组标题
-
-```html
-<van-cell-group title="分组1">
-  <van-cell title="单元格" value="内容" />
-</van-cell-group>
-<van-cell-group title="分组2">
-  <van-cell title="单元格" value="内容" />
-</van-cell-group>
-```
-
-### 使用插槽
-
-如以上用法不能满足你的需求,可以使用插槽来自定义内容
-
-```html
-<van-cell value="内容" icon="shop-o" is-link>
-  <view slot="title">
-    <view class="van-cell-text">单元格</view>
-    <van-tag type="danger">标签</van-tag>
-  </view>
-</van-cell>
-<van-cell title="单元格">
-  <van-icon slot="right-icon" name="search" class="custom-icon" />
-</van-cell>
-```
-
-### 垂直居中
-
-通过`center`属性可以让`Cell`的左右内容都垂直居中
-
-```html
-<van-cell center title="单元格" value="内容" label="描述信息" />
-```
-
-## API
-
-### CellGroup Props
-
-| 参数   | 说明           | 类型      | 默认值 | 版本 |
-| ------ | -------------- | --------- | ------ | ---- |
-| title  | 分组标题       | _string_  | `-`    | -    |
-| border | 是否显示外边框 | _boolean_ | `true` | -    |
-
-### CellGroup 外部样式类
-
-| 类名         | 说明         |
-| ------------ | ------------ |
-| custom-class | 根节点样式类 |
-
-### Cell Props
-
-| 参数 | 说明 | 类型 | 默认值 | 版本 |
-| --- | --- | --- | --- | --- |
-| icon | 左侧图标名称或图片链接,可选值见 [Icon 组件](#/icon) | _string_ | - | - |
-| title | 左侧标题 | _string \| number_ | - |
-| title-width | 标题宽度,须包含单位 | _string_ | - | - |
-| value | 右侧内容 | _string \| number_ | - | - |
-| label | 标题下方的描述信息 | _string_ | - | - |
-| size | 单元格大小,可选值为 `large` | _string_ | - | - |
-| border | 是否显示下边框 | _boolean_ | `true` | - |
-| center | 是否使内容垂直居中 | _boolean_ | `false` | - |
-| url | 点击后跳转的链接地址 | _string_ | - | - |
-| link-type | 链接跳转类型,可选值为 `redirectTo` `switchTab` `reLaunch` | _string_ | `navigateTo` | - |
-| clickable | 是否开启点击反馈 | _boolean_ | `false` | - |
-| is-link | 是否展示右侧箭头并开启点击反馈 | _boolean_ | `false` | - |
-| required | 是否显示表单必填星号 | _boolean_ | `false` | - |
-| arrow-direction | 箭头方向,可选值为 `left` `up` `down` | _string_ | - | - |
-| use-label-slot | 是否使用 label slot | _boolean_ | `false` | - |
-| title-style | 标题样式 | _string_ | - | 1.4.0 |
-
-### Cell Event
-
-| 事件名     | 说明             | 参数 |
-| ---------- | ---------------- | ---- |
-| @click | 点击单元格时触发 | -    |
-
-### Cell Slot
-
-| 名称       | 说明                                                           |
-| ---------- | -------------------------------------------------------------- |
-| -          | 自定义`value`显示内容,如果设置了`value`属性则不生效           |
-| title      | 自定义`title`显示内容,如果设置了`title`属性则不生效           |
-| label      | 自定义`label`显示内容,需要设置 `use-label-slot`属性           |
-| icon       | 自定义`icon`显示内容,如果设置了`icon`属性则不生效             |
-| right-icon | 自定义右侧按钮,默认是`arrow`,如果设置了`is-link`属性则不生效 |
-
-### Cell 外部样式类
-
-| 类名         | 说明           |
-| ------------ | -------------- |
-| custom-class | 根节点样式类   |
-| title-class  | 标题样式类     |
-| label-class  | 描述信息样式类 |
-| value-class  | 右侧内容样式类 |

+ 0 - 108
src/ttcomponents/van-cell/demo.vue

@@ -1,108 +0,0 @@
-<template>
-  <div>
-    <demo-block title="基础用法">
-      <van-cell-group>
-        <van-cell title="单元格" value="内容" title-style="color: red" />
-        <van-cell
-          title="单元格"
-          value="内容"
-          label="描述信息"
-          :border="false"
-        />
-      </van-cell-group>
-    </demo-block>
-
-    <demo-block title="单元格大小">
-      <van-cell-group>
-        <van-cell
-          title="单元格"
-          value="内容"
-          size="large"
-        />
-        <van-cell
-          title="单元格"
-          value="内容"
-          size="large"
-          use-label-slot
-          :border="false"
-        >
-          <view slot="label">描述信息</view>
-        </van-cell>
-      </van-cell-group>
-    </demo-block>
-
-    <demo-block title="展示图标">
-      <van-cell
-        title="单元格"
-        value="内容"
-        icon="location-o"
-        :border="false"
-      />
-    </demo-block>
-
-    <demo-block title="展示箭头">
-      <van-cell title="单元格" is-link />
-      <van-cell
-        title="单元格"
-        value="内容"
-        is-link
-      />
-      <van-cell
-        title="单元格"
-        is-link
-        arrow-direction="down"
-        value="内容"
-        :border="false"
-      />
-    </demo-block>
-
-    <demo-block title="页面跳转">
-      <van-cell title="单元格" is-link url="/packages/dashboard/index" />
-      <van-cell title="单元格" is-link url="/packages/dashboard/index" link-type="redirectTo" />
-    </demo-block>
-
-    <demo-block title="分组标题">
-      <van-cell-group title="分组 1">
-        <van-cell title="单元格" value="内容" />
-      </van-cell-group>
-      <van-cell-group title="分组 2">
-        <van-cell title="单元格" value="内容" />
-      </van-cell-group>
-    </demo-block>
-
-    <demo-block title="使用插槽">
-      <van-cell value="内容" icon="shop-o" is-link>
-        <view slot="title">
-          <view class="title">单元格</view>
-          <van-tag type="danger">标签</van-tag>
-        </view>
-      </van-cell>
-      <van-cell title="单元格" :border="false">
-        <van-icon slot="right-icon" name="search" />
-      </van-cell>
-    </demo-block>
-
-    <demo-block title="垂直居中">
-      <van-cell
-        center
-        title="单元格"
-        value="内容"
-        label="描述信息"
-      />
-    </demo-block>
-
-  </div>
-</template>
-
-<script>
-export default {
-}
-</script>
-
-<style>
-.title {
-  margin-right: 5px;
-  display: inline-block;
-  vertical-align: middle;
-}
-</style>

+ 0 - 113
src/ttcomponents/van-cell/index.less

@@ -1,113 +0,0 @@
-@import '../common/style/var.less';
-@import '../common/style/theme.less';
-@import '../common/style/mixins/hairline.less';
-
-.van-cell {
-  position: relative;
-  display: flex;
-  box-sizing: border-box;
-  width: 100%;
-  .theme(padding, '@cell-vertical-padding @cell-horizontal-padding');
-  .theme(font-size, '@cell-font-size');
-  .theme(line-height, '@cell-line-height');
-  .theme(color, '@cell-text-color');
-  .theme(background-color, '@cell-background-color');
-
-  &::after {
-    .hairline-bottom(@border-color, @padding-md, @padding-md);
-  }
-
-  &--borderless::after {
-    display: none;
-  }
-
-  &-group {
-    .theme(background-color, '@cell-background-color');
-  }
-
-  &__label {
-    .theme(margin-top, '@cell-label-margin-top');
-    .theme(font-size, '@cell-label-font-size');
-    .theme(line-height, '@cell-label-line-height');
-    .theme(color, '@cell-label-color');
-  }
-
-  &__value {
-    overflow: hidden;
-    text-align: right;
-    vertical-align: middle;
-    .theme(color, '@cell-value-color');
-  }
-
-  &__title,
-  &__value {
-    flex: 1;
-
-    &:empty {
-      display: none;
-    }
-  }
-
-  &__left-icon-wrap,
-  &__right-icon-wrap {
-    display: flex;
-    align-items: center;
-    .theme(height, '@cell-line-height');
-    .theme(font-size, '@cell-icon-size');
-  }
-
-  &__left-icon-wrap {
-    margin-right: 5px;
-  }
-
-  &__right-icon-wrap {
-    margin-left: 5px;
-    .theme(color, '@cell-right-icon-color');
-  }
-
-  &__left-icon {
-    vertical-align: middle;
-    .theme(line-height, '@cell-line-height');
-  }
-
-  &__right-icon {
-    .theme(line-height, '@cell-line-height');
-  }
-
-  &--clickable&--hover {
-    .theme(background-color, '@cell-active-color');
-  }
-
-  &--required {
-    overflow: visible;
-
-    &::before {
-      position: absolute;
-      content: '*';
-      .theme(left, '@padding-xs');
-      .theme(font-size, '@cell-font-size');
-      .theme(color, '@cell-required-color');
-    }
-  }
-
-  &--center {
-    align-items: center;
-  }
-
-  &--large {
-    .theme(padding-top, '@cell-large-vertical-padding');
-    .theme(padding-bottom, '@cell-large-vertical-padding');
-
-    .van-cell__title {
-      .theme(font-size, '@cell-large-title-font-size');
-    }
-
-    .van-cell__value {
-      .theme(font-size, '@cell-large-value-font-size');
-    }
-
-    .van-cell__label {
-      .theme(font-size, '@cell-large-label-font-size');
-    }
-  }
-}

+ 0 - 125
src/ttcomponents/van-cell/van-cell.vue

@@ -1,125 +0,0 @@
-<template>
-  <view
-    class="custom-class"
-    :class="cellClass"
-    :hover-class="selfHoverClass"
-    hover-stay-time="70"
-    :style="customStyle"
-    @tap="onClick"
-  >
-    <van-icon
-      v-if="icon"
-      :name="icon"
-      class="van-cell__left-icon-wrap"
-      custom-class="van-cell__left-icon-wrap van-cell__left-icon"
-    />
-    <slot v-else name="icon" />
-
-    <view
-      :style="
-        (titleWidth ? 'max-width:' + titleWidth + ';min-width:' + titleWidth + ';' : '') + titleStyle
-      "
-      class="van-cell__title title-class"
-      :class="titleClass"
-    >
-      <block v-if="title">{{ title }}</block>
-      <slot v-else name="title" />
-
-      <view v-if="label || useLabelSlot" class="van-cell__label label-class" :class="labelClass">
-        <slot v-if="useLabelSlot" name="label" />
-        <block v-else-if="label">{{ label }}</block>
-      </view>
-    </view>
-
-    <view class="van-cell__value value-class" :class="valueClass">
-      <block v-if="value || value === 0">{{ value }}</block>
-      <slot v-else />
-    </view>
-
-    <van-icon
-      v-if="isLink"
-      :name="arrowDirection ? 'arrow' + '-' + arrowDirection : 'arrow'"
-      :class="selfRightIconClass"
-      :custom-class="selfRightIconClass"
-    />
-    <slot v-else name="right-icon" />
-
-    <slot name="extra" />
-  </view>
-</template>
-
-<script>
-import { VantComponent } from '../common/component'
-import { link } from '../mixins/link'
-import VanIcon from '../van-icon/van-icon'
-const utils = require('../wxs/utils')
-export default {
-  components: {
-    VanIcon
-  },
-  ...VantComponent({
-    classes: [
-      'title-class',
-      'label-class',
-      'value-class',
-      'right-icon-class',
-      'hover-class',
-    ],
-    externalStyles: [
-      'title-style'
-    ],
-
-    mixins: [link],
-
-    props: {
-      title: null,
-      value: null,
-      icon: String,
-      size: String,
-      label: String,
-      center: Boolean,
-      isLink: Boolean,
-      required: Boolean,
-      clickable: Boolean,
-      titleWidth: String,
-      arrowDirection: String,
-      useLabelSlot: Boolean,
-      border: {
-        type: Boolean,
-        default: true
-      }
-    },
-    computed: {
-      cellClass() {
-        const { customClass, size, center, border, isLink, clickable, required } = this
-        const cellClass = utils.bem('cell', [
-          size,
-          {
-            center,
-            required,
-            borderless: !border,
-            clickable: isLink || clickable
-          }
-        ])
-        return `${customClass} ${cellClass}`
-      },
-      selfRightIconClass() {
-        return `van-cell__right-icon-wrap right-icon-class van-cell__right-icon ${this.rightIconClass}`
-      },
-      selfHoverClass() {
-        return `van-cell--hover hover-class ${this.hoverClass}`
-      }
-    },
-    methods: {
-      onClick(event) {
-        this.$emit('click', event.detail)
-        this.jumpLink()
-      }
-    }
-  })
-}
-</script>
-
-<style lang="less">
-@import './index.less';
-</style>

+ 0 - 1
src/ttcomponents/van-checkbox-group/index.less

@@ -1 +0,0 @@
-// empty

+ 0 - 56
src/ttcomponents/van-checkbox-group/van-checkbox-group.vue

@@ -1,56 +0,0 @@
-<template>
-  <div><slot /></div>
-</template>
-
-<script>
-import { VantComponent } from '../common/component'
-import { getComponentByOptionsName } from '../wxs/get-component'
-import { ParentMixin } from '../mixins/relation'
-export default VantComponent({
-  mixins: [ParentMixin('vanCheckboxGroup')],
-  props: {
-    max: [Number, String],
-    value: {
-      type: Array,
-      default: () => []
-    },
-    disabled: {
-      type: Boolean,
-      default: false
-    }
-  },
-
-  watch: {
-    // #ifdef MP-TOUTIAO
-    value() {
-      this.updateChildren()
-    },
-    disabled() {
-      this.updateChildren()
-    }
-    // #endif
-  },
-
-  methods: {
-    // #ifdef MP-TOUTIAO
-    updateChildren() {
-      this.$nextTick(() => {
-        const $children = getComponentByOptionsName(this, 'VanCheckbox')
-        $children.forEach(child => {
-          this.updateChild(child)
-        })
-      })
-    },
-    updateChild(child) {
-      const { value, disabled } = this
-      child.currentValue = value.indexOf(child.name) !== -1
-      child.parentDisabled = disabled
-    }
-    // #endif
-  }
-})
-</script>
-
-<style lang="less">
-@import './index.less';
-</style>

+ 0 - 265
src/ttcomponents/van-checkbox/README.md

@@ -1,265 +0,0 @@
-# Checkbox 复选框
-
-### 引入
-
-推荐使用 `easycom` 的方式引入,详细介绍见[快速上手](#/quickstart#easycom-mo-shi-tui-jian)
-
-## 代码演示
-
-### 基础用法
-
-通过`v-model/value`绑定复选框的勾选状态
-
-```html
-<template>
-  <van-checkbox v-model="checked" @change="onChange">复选框</van-checkbox>
-</template>
-
-<script>
-export default {
-  data() {
-    return {
-      checked: true
-    }
-  },
-
-  methods: {
-    onChange() {
-      console.log(this.checked)
-    }
-  }
-}
-</script>
-```
-
-### 禁用状态
-
-通过设置`disabled`属性可以禁用复选框
-
-```html
-<van-checkbox disabled v-model="checked" @change="onChange">
-  复选框
-</van-checkbox>
-```
-
-### 自定义形状
-
-将`shape`属性设置为`square`,复选框的形状会变成方形
-
-```html
-<van-checkbox v-model="checked" shape="square" @change="onChange">
-  复选框
-</van-checkbox>
-```
-
-### 自定义颜色
-
-通过`checked-color`属性可以自定义选中状态下的图标颜色
-
-```html
-<van-checkbox
-  v-model="checked"
-  checked-color="#07c160"
-  @change="onChange"
->
-  复选框
-</van-checkbox>
-```
-
-### 自定义大小
-
-通过`icon-size`属性可以自定义图标的大小
-
-```html
-<van-checkbox v-model="checked" icon-size="25px">复选框</van-checkbox>
-```
-
-### 自定义图标
-
-通过 icon 插槽自定义图标
-
-```html
-<template>
-  <van-checkbox use-icon-slot v-model="checked" @change="onChange">
-    自定义图标
-    <image slot="icon" :src="checked ? activeIcon : inactiveIcon" />
-  </van-checkbox>
-</template>
-
-<script>
-export default {
-  data() {
-    return {
-      checked: true,
-      activeIcon: '//img.yzcdn.cn/icon-active.png',
-      inactiveIcon: '//img.yzcdn.cn/icon-normal.png',
-    }
-  },
-
-  methods: {
-    onChange() {
-      console.log(this.checked)
-    }
-  }
-}
-</script>
-```
-
-### 禁用文本点击
-
-通过设置`label-disabled`属性可以禁用复选框文本点击
-
-```html
-<van-checkbox v-model="checked" label-disabled>复选框</van-checkbox>
-```
-
-### 复选框组
-
-需要与`van-checkbox-group`一起使用,选中值是一个数组,通过`value`绑定在`van-checkbox-group`上,数组中的项即为选中的`Checkbox`的`name`属性设置的值
-
-```html
-<template>
-  <van-checkbox-group v-model="result" @change="onChange">
-    <van-checkbox name="a">复选框 a</van-checkbox>
-    <van-checkbox name="b">复选框 b</van-checkbox>
-    <van-checkbox name="c">复选框 c</van-checkbox>
-  </van-checkbox-group>
-</template>
-
-<script>
-export default {
-  data() {
-    return {
-      result: ['a', 'b']
-    }
-  },
-
-  methods: {
-    onChange() {
-      console.log(this.result)
-    }
-  }
-}
-</script>
-```
-
-### 限制最大可选数
-
-```html
-<van-checkbox-group v-model="result" @change="onChange" max="2">
-  <van-checkbox name="a">复选框 a</van-checkbox>
-  <van-checkbox name="b">复选框 b</van-checkbox>
-  <van-checkbox name="c">复选框 c</van-checkbox>
-</van-checkbox-group>
-```
-
-### 搭配单元格组件使用
-
-此时你需要再引入`Cell`和`CellGroup`组件,并通过 checkbox 的 toggle 方法手动触发切换
-
-```html
-<template>
-  <van-checkbox-group v-model="result" @change="onChange">
-    <van-cell-group>
-      <van-cell
-        v-for="(item, index) in list"
-        :key="item"
-        :title="`复选框 ${ item }`"
-        value-class="value-class"
-        clickable
-        @click="toggle(index)"
-      >
-        <van-checkbox ref="checkboxes" readonly :name="item" />
-      </van-cell>
-    </van-cell-group>
-  </van-checkbox-group>
-</template>
-
-<script>
-export default {
-  data() {
-    return {
-      list: ['a', 'b', 'c'],
-      result: ['a', 'b']
-    }
-  },
-
-  methods: {
-    onChange() {
-      console.log(this.result)
-    }
-
-    toggle(index) {
-      this.$refs.checkboxes[index].toggle()
-    }
-  }
-}
-</script>
-
-<style>
-.value-class {
-  flex: none !important;
-}
-</style>
-```
-
-## API
-
-### Checkbox Props
-
-| 参数 | 说明 | 类型 | 默认值 | 版本 |
-| --- | --- | --- | --- | --- |
-| name | 标识 Checkbox 名称 | _string_ | - | - |
-| shape | 形状,可选值为 `round` `square` | _string_ | `round` | - |
-| value | 是否为选中状态 | _boolean_ | `false` | - |
-| disabled | 是否禁用单选框 | _boolean_ | `false` | - |
-| readonly | 是否为只读状态 | _boolean_ | `false` | - |
-| label-disabled | 是否禁用单选框内容点击 | _boolean_ | `false` | - |
-| label-position | 文本位置,可选值为 `left` | _string_ | `right` | - |
-| use-icon-slot | 是否使用 icon slot | _boolean_ | `false` | - |
-| checked-color | 选中状态颜色 | _string_ | `#1989fa` | - |
-| icon-size | icon 大小 | _string \| number_ | `20px` |
-
-### CheckboxGroup Props
-
-| 参数     | 说明                   | 类型      | 默认值        | 版本 |
-| -------- | ---------------------- | --------- | ------------- | ---- |
-| name     | 在表单内提交时的标识符 | _string_  | -             | -    |
-| value    | 所有选中项的 name      | _Array_   | -             | -    |
-| disabled | 是否禁用所有单选框     | _boolean_ | `false`       | -    |
-| max      | 设置最大可选数         | _number_  | `0`(无限制) | -    |
-
-### Checkbox Event
-
-| 事件名      | 说明                     | 回调参数     |
-| ----------- | ------------------------ | ------------ |
-| @change | 当绑定值变化时触发的事件 | 当前组件的值 |
-
-### Checkbox 外部样式类
-
-| 类名         | 说明           |
-| ------------ | -------------- |
-| custom-class | 根节点样式类   |
-| icon-class   | 图标样式类     |
-| label-class  | 描述信息样式类 |
-
-### CheckboxGroup Event
-
-| 事件名      | 说明                     | 回调参数     |
-| ----------- | ------------------------ | ------------ |
-| @change | 当绑定值变化时触发的事件 | 当前组件的值 |
-
-### Checkbox Slot
-
-| 名称 | 说明       |
-| ---- | ---------- |
-| -    | 自定义文本 |
-| icon | 自定义图标 |
-
-### Checkbox 方法
-
-通过 selectComponent 可以获取到 checkbox 实例并调用实例方法
-
-| 方法名 | 参数 | 返回值 | 介绍         |
-| ------ | ---- | ------ | ------------ |
-| toggle | -    | -      | 切换选中状态 |

+ 0 - 189
src/ttcomponents/van-checkbox/demo.vue

@@ -1,189 +0,0 @@
-<template>
-  <div>
-    <demo-block title="基本用法">
-      <van-checkbox
-        v-model="checkbox1"
-        custom-class="demo-checkbox"
-        @change="onChange"
-      >
-        复选框
-      </van-checkbox>
-    </demo-block>
-
-    <demo-block title="禁用状态">
-      <van-checkbox
-        disabled
-        :value="false"
-        custom-class="demo-checkbox"
-      >
-        复选框
-      </van-checkbox>
-      <van-checkbox
-        disabled
-        :value="true"
-        custom-class="demo-checkbox"
-      >
-        复选框
-      </van-checkbox>
-    </demo-block>
-
-    <demo-block title="自定义形状">
-      <van-checkbox
-        v-model="checkboxShape"
-        shape="square"
-        custom-class="demo-checkbox"
-        @change="onChange"
-      >
-        复选框
-      </van-checkbox>
-    </demo-block>
-
-    <demo-block title="自定义颜色">
-      <van-checkbox
-        v-model="checkbox2"
-        checked-color="#07c160"
-        custom-class="demo-checkbox"
-        @change="onChange"
-      >
-        复选框
-      </van-checkbox>
-    </demo-block>
-
-    <demo-block title="自定义大小">
-      <van-checkbox
-        icon-size="25px"
-        v-model="checkboxSize"
-        custom-class="demo-checkbox"
-        @change="onChange"
-      >
-        复选框
-      </van-checkbox>
-    </demo-block>
-
-    <demo-block title="自定义图标">
-      <van-checkbox
-        use-icon-slot
-        v-model="checkbox3"
-        custom-class="demo-checkbox"
-        @change="onChange"
-      >
-        自定义图标
-        <image
-          slot="icon"
-          class="icon"
-          mode="widthFix"
-          :src="checkbox3 ? activeIcon : inactiveIcon"
-        />
-      </van-checkbox>
-    </demo-block>
-
-    <demo-block title="禁用文本点击">
-      <van-checkbox
-        label-disabled
-        v-model="checkboxLabel"
-        custom-class="demo-checkbox"
-        @change="onChange"
-      >
-        复选框
-      </van-checkbox>
-    </demo-block>
-
-    <demo-block title="复选框组">
-      <van-checkbox-group v-model="result" @change="onChange">
-        <van-checkbox
-          v-for="item in list"
-          :key="item"
-          :name="item"
-          custom-class="demo-checkbox"
-        >
-          复选框 {{ item }}
-        </van-checkbox>
-      </van-checkbox-group>
-    </demo-block>
-
-    <demo-block title="限制最大可选数">
-      <van-checkbox-group v-model="result2" max="2" @change="onChange">
-        <van-checkbox
-          v-for="item in list"
-          :key="item"
-          :name="item"
-          custom-class="demo-checkbox"
-        >
-          复选框 {{ item }}
-        </van-checkbox>
-      </van-checkbox-group>
-    </demo-block>
-
-    <demo-block title="搭配单元格组件使用">
-      <van-checkbox-group v-model="result3" @change="onChange">
-        <van-cell-group >
-          <van-cell
-            v-for="(item, index) in list"
-            :key="item"
-            :title="`复选框 ${ item }`"
-            value-class="value-class"
-            clickable
-            @click="toggle(index)"
-          >
-            <van-checkbox slot="right-icon" ref="checkboxes" readonly :name="item" />
-          </van-cell>
-        </van-cell-group>
-      </van-checkbox-group>
-    </demo-block>
-
-  </div>
-</template>
-
-<script>
-export default {
-  data() {
-    return {
-      checkbox1: true,
-      checkbox2: true,
-      checkbox3: true,
-      checkboxLabel: true,
-      checkboxSize: true,
-      checkboxShape: true,
-      list: ['a', 'b', 'c'],
-      result: ['a', 'b'],
-      result2: [],
-      result3: [],
-      activeIcon: 'https://img.yzcdn.cn/vant/user-active.png',
-      inactiveIcon: 'https://img.yzcdn.cn/vant/user-inactive.png'
-    }
-  },
-  methods: {
-    onChange() {
-      console.log('值改变了')
-    },
-
-    toggle(index) {
-      this.$refs.checkboxes[index].toggle()
-    },
-
-    noop() {}
-  }
-}
-</script>
-
-<style>
-.demo-checkbox-group {
-  margin: 10px 0 0 20px;
-}
-
-.demo-checkbox {
-  margin: 10px 0 0 20px;
-}
-
-.value-class {
-  flex: none !important;
-}
-
-.van-cell__value {
-  flex: none !important;
-}
-
-.icon {
-  width: 20px;
-}
-</style>

+ 0 - 73
src/ttcomponents/van-checkbox/index.less

@@ -1,73 +0,0 @@
-@import '../common/style/var.less';
-@import '../common/style/theme.less';
-
-.van-checkbox {
-  display: flex;
-  align-items: center;
-  overflow: hidden;
-  user-select: none;
-
-  &__icon-wrap,
-  &__label {
-    .theme(line-height, '@checkbox-size');
-  }
-
-  &__icon-wrap {
-    flex: none;
-  }
-
-  &__icon {
-    display: flex;
-    align-items: center;
-    justify-content: center;
-    box-sizing: border-box;
-    width: 1em;
-    height: 1em;
-    color: transparent;
-    text-align: center;
-    transition-property: color, border-color, background-color;
-
-    .theme(font-size, '@checkbox-size');
-    .theme(border, '1px solid @checkbox-border-color');
-    .theme(transition-duration, '@checkbox-transition-duration');
-
-    &--round {
-      border-radius: 100%;
-    }
-
-    &--checked {
-      .theme(color, '@white');
-      .theme(background-color, '@checkbox-checked-icon-color');
-      .theme(border-color, '@checkbox-checked-icon-color');
-    }
-
-    &--disabled {
-      .theme(background-color, '@checkbox-disabled-background-color');
-      .theme(border-color, '@checkbox-disabled-icon-color');
-    }
-
-    &--disabled&--checked {
-      .theme(color, '@checkbox-disabled-icon-color');
-    }
-  }
-
-  &__label {
-    word-wrap: break-word;
-
-    .theme(margin-left, '@checkbox-label-margin');
-    .theme(color, '@checkbox-label-color');
-
-    &--left {
-      float: left;
-      .theme(margin, '0 @checkbox-label-margin 0 0');
-    }
-
-    &--disabled {
-      .theme(color, '@checkbox-disabled-label-color');
-    }
-
-    &:empty {
-      margin: 0;
-    }
-  }
-}

+ 0 - 196
src/ttcomponents/van-checkbox/van-checkbox.vue

@@ -1,196 +0,0 @@
-<template>
-  <view :class="checkboxClass">
-    <view class="van-checkbox__icon-wrap" @click="onIconClick">
-      <slot v-if="useIconSlot" name="icon" />
-      <van-icon
-        v-else
-        name="success"
-        size="0.8em"
-        :class="currentIconClass"
-        :style="iconStyle"
-        :custom-class="currentIconClass"
-        :custom-style="iconStyle"
-      />
-    </view>
-    <view :class="currentLabelClass" @click="onClickLabel">
-      <slot />
-    </view>
-  </view>
-</template>
-
-<script>
-import utils from '../wxs/utils'
-import VanIcon from '../van-icon/van-icon'
-import { VantComponent } from '../common/component'
-import { ChildrenMixin } from '../mixins/relation'
-function emit(target, value) {
-  target.$emit('input', value)
-  target.$emit('change', value)
-}
-export default {
-  name: 'VanCheckbox',
-  components: {
-    VanIcon
-  },
-
-  ...VantComponent({
-    mixins: [ChildrenMixin('vanCheckboxGroup')],
-    classes: ['icon-class', 'label-class'],
-
-    props: {
-      value: Boolean,
-      name: String,
-      disabled: Boolean,
-      useIconSlot: Boolean,
-      checkedColor: String,
-      labelPosition: String,
-      labelDisabled: Boolean,
-      shape: {
-        type: String,
-        default: 'round'
-      },
-      iconSize: {
-        type: null,
-        default: 20
-      },
-      readonly: {
-        type: Boolean,
-        default: false
-      }
-    },
-
-    data() {
-      return {
-        currentValue: false,
-        parentDisabled: false
-      }
-    },
-
-    computed: {
-      checkboxClass() {
-        return `van-checkbox custom-class ${this.customClass}`
-      },
-      currentIconClass() {
-        return `icon-class ${this.iconClass} ${utils.bem('checkbox__icon', [
-          this.shape,
-          {
-            disabled: this.disabled || this.parentDisabled,
-            checked: this.currentValue
-          }
-        ])}`
-      },
-      iconStyle() {
-        const { checkedColor, currentValue, disabled, parentDisabled, iconSize } = this
-        var styles = [
-          ['font-size', utils.addUnit(iconSize)],
-          ['line-height', '1.25em']
-        ]
-        if (checkedColor && currentValue && !disabled && !parentDisabled) {
-          styles.push(['border-color', checkedColor])
-          styles.push(['background-color', checkedColor])
-        }
-
-        return styles.map(item => item.join(':')).join(';')
-      },
-      currentLabelClass() {
-        return `label-class ${this.labelClass} ${utils.bem('checkbox__label', [
-          this.labelPosition,
-          { disabled: this.disabled || this.parentDisabled }
-        ])}`
-      },
-
-      groupValue() {
-        return this.vanCheckboxGroup ? this.vanCheckboxGroup.value : null
-      },
-      groupDisabled() {
-        return this.vanCheckboxGroup ? this.vanCheckboxGroup.disabled : null
-      }
-    },
-
-    watch: {
-      groupValue() {
-        this.updateChild()
-      },
-      groupDisabled() {
-        this.updateChild()
-      }
-    },
-
-    created() {
-      if (this.vanCheckboxGroup) {
-        this.updateChild()
-        return
-      }
-      this.currentValue = this.value
-    },
-
-    methods: {
-      emitChange(value) {
-        if (this.vanCheckboxGroup) {
-          this.setParentValue(value)
-        } else {
-          emit(this, value)
-          this.currentValue = value
-        }
-      },
-
-      onIconClick() {
-        if (this.readonly) {
-          return
-        }
-        this.toggle()
-      },
-
-      toggle() {
-        const { parentDisabled, disabled, currentValue } = this
-        if (!disabled && !parentDisabled) {
-          this.emitChange(!currentValue)
-        }
-      },
-
-      onClickLabel() {
-        const { readonly, labelDisabled, parentDisabled, disabled, currentValue } = this
-        if (!readonly && !disabled && !labelDisabled && !parentDisabled) {
-          this.emitChange(!currentValue)
-        }
-      },
-
-      setParentValue(value) {
-        const parentValue = this.vanCheckboxGroup.value.slice()
-        const { name } = this
-        const { max } = this.vanCheckboxGroup
-
-        if (value) {
-          if (max && parentValue.length >= max) {
-            return
-          }
-          if (parentValue.indexOf(name) === -1) {
-            parentValue.push(name)
-            emit(this.vanCheckboxGroup, parentValue)
-          }
-        } else {
-          const index = parentValue.indexOf(name)
-          if (index !== -1) {
-            parentValue.splice(index, 1)
-            emit(this.vanCheckboxGroup, parentValue)
-          }
-        }
-      },
-
-      updateChild() {
-        if (this.vanCheckboxGroup) {
-          const { value, disabled } = this.vanCheckboxGroup
-          const { name } = this
-          this.currentValue = value.indexOf(name) !== -1
-          emit(this, value.indexOf(name) !== -1)
-          this.parentDisabled = disabled
-        }
-      }
-    }
-  })
-}
-</script>
-
-<style lang="less">
-@import './index.less';
-</style>

+ 0 - 105
src/ttcomponents/van-circle/README.md

@@ -1,105 +0,0 @@
-# Circle 环形进度条
-
-### 引入
-
-推荐使用 `easycom` 的方式引入,详细介绍见[快速上手](#/quickstart#easycom-mo-shi-tui-jian)
-
-## 代码演示
-
-### 基础用法
-
-`value/v-model`属性表示进度条的目标进度。
-
-```html
-<van-circle v-model="30" text="text" />
-```
-
-### 宽度定制
-
-通过`stroke-width`属性来控制进度条宽度
-
-```html
-<van-circle v-model="value" stroke-width="6" text="宽度定制" />
-```
-
-### 颜色定制
-
-通过`color`属性来控制进度条颜色,`layer-color`属性来控制轨道颜色
-
-```html
-<van-circle
-  v-model="value"
-  layer-color="#eeeeee"
-  color="#ee0a24"
-  text="颜色定制"
-/>
-```
-
-### 渐变色
-
-`color`属性支持传入对象格式来定义渐变色
-
-```html
-<van-circle v-model="value" :color="gradientColor" text="渐变色" />
-```
-
-```javascript
-export default {
-  data() {
-    return {
-      value: 25,
-      gradientColor: {
-        '0%': '#ffd01e',
-        '100%': '#ee0a24',
-      },
-    }
-  },
-}
-```
-
-### 逆时针方向
-
-将`clockwise`设置为`false`,进度会从逆时针方向开始
-
-```html
-<van-circle
-  v-model="value"
-  color="#07c160"
-  :clockwise="false"
-  text="逆时针"
-/>
-```
-
-### 大小定制
-
-通过`size`属性设置圆环直径
-
-```html
-<van-circle v-model="value" size="120" text="大小定制" />
-```
-
-## API
-
-### Props
-
-| 参数 | 说明 | 类型 | 默认值 | 版本 |
-| --- | --- | --- | --- | --- |
-| circle-id | canvas 唯一 id | _string_ | `van-circle` | --- |
-| value/v-model | 目标进度 | _number_ | `0` | - |
-| type | 指定 canvas 类型,可选值为 `2d` | _string_ | - | - |
-| size | 圆环直径,默认单位为 `px` | _number_ | `100` | - |
-| color | 进度条颜色,传入对象格式可以定义渐变色 | _string \| object_ | `#1989fa` | - |
-| layer-color | 轨道颜色 | _string_ | `#fff` | - |
-| fill | 填充颜色 | _string_ | - | - |
-| speed | 动画速度(单位为 value/s) | _number_ | `50` | - |
-| text | 文字 | _string_ | - | - |
-| stroke-width | 进度条宽度 | _number_ | `4` | - |
-| clockwise | 是否顺时针增加 | _boolean_ | `true` | - |
-
-> 注意:当同一个页面中存在多个 `van-circle` 时,必须指定不同的 `circle-id` ,不然数据会串线。
-
-### Slots
-
-| 名称 | 说明                                                       |
-| ---- | ---------------------------------------------------------- |
-| -    | 自定义文字内容,如果设置了`fill`,插槽内容会被原生组件覆盖 |

+ 0 - 42
src/ttcomponents/van-circle/canvas.js

@@ -1,42 +0,0 @@
-export function adaptor(ctx) {
-  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() {}
-  })
-}

+ 0 - 61
src/ttcomponents/van-circle/demo.vue

@@ -1,61 +0,0 @@
-<template>
-  <div>
-    <demo-block title="基础用法">
-      <van-circle circle-id="circle1" type="2d" v-model="value" :text="`${value}%`" />
-    </demo-block>
-
-    <demo-block title="样式定制">
-      <van-circle circle-id="circle2" v-model="value" :stroke-width="6" text="宽度定制" />
-      <van-circle circle-id="circle3" v-model="value" layer-color="#eeeeee" color="#ee0a24" text="颜色定制" />
-      <van-circle circle-id="circle4" v-model="value" :color="gradientColor" text="渐变色" />
-      <van-circle circle-id="circle5" v-model="value" color="#07c160" :clockwise="false" text="逆时针" />
-      <van-circle circle-id="circle6" v-model="value" size="120" text="大小定制" />
-    </demo-block>
-
-    <van-button type="primary" size="small" @click="run(10)">增加</van-button>
-    <van-button type="danger" size="small" @click="run(-10)">减少</van-button>
-
-    <demo-block title="修改颜色">
-      <van-circle circle-id="circle7" type="2d" v-model="value" :text="`${value}%`" :color="color" />
-      <van-circle circle-id="circle8" v-model="value" :text="`${value}%`" :color="color" />
-    </demo-block>
-
-    <van-button v-for="(item, index) in colorList" :key="index" :color="item" @click="changeColor(item)">{{ item }}</van-button>
-
-  </div>
-</template>
-
-<script>
-const format = rate => Math.min(Math.max(rate, 0), 100);
-export default {
-  data() {
-    return {
-      value: 25,
-      gradientColor: {
-        '0%': '#ffd01e',
-        '100%': '#ee0a24'
-      },
-      color: '#fa541c',
-      colorList: ['#fa541c', '#13c2c2', '#722ed1', '#eb2f96']
-    }
-  },
-  methods: {
-    run(step) {
-      this.value = format((this.value += step))
-    },
-    changeColor(color) {
-      console.log('修改颜色', color)
-      this.color = color
-    }
-  }
-}
-</script>
-
-<style>
-.van-circle {
-  margin: 5px 10px 20px;
-}
-.van-button{
-  margin-left: 10px;
-}
-</style>

+ 0 - 19
src/ttcomponents/van-circle/index.less

@@ -1,19 +0,0 @@
-@import '../common/style/var.less';
-@import '../common/style/theme.less';
-
-.van-circle {
-  position: relative;
-  display: inline-block;
-  text-align: center;
-
-  &__text {
-    position: absolute;
-    top: 50%;
-    left: 0;
-    width: 100%;
-    transform: translateY(-50%);
-    background-color: transparent;
-
-    .theme(color, '@circle-text-color');
-  }
-}

+ 0 - 266
src/ttcomponents/van-circle/van-circle.vue

@@ -1,266 +0,0 @@
-<template>
-  <view class="van-circle">
-    <!-- 头条小程序 canvas-id 会相互污染 -->
-    <!-- #ifdef MP-TOUTIAO -->
-    <canvas
-      class="van-circle__canvas"
-      :style="{ width: size + 'px', height: size + 'px' }"
-      :canvas-id="circleId"
-    ></canvas>
-    <!-- #endif -->
-    <!-- #ifndef MP-TOUTIAO -->
-    <canvas
-      class="van-circle__canvas"
-      :type="type"
-      :style="{ width: size + 'px', height: size + 'px' }"
-      :id="circleId"
-      :canvas-id="circleId"
-    ></canvas>
-    <!-- #endif -->
-    <view v-if="!text" class="van-circle__text">
-      <slot></slot>
-    </view>
-    <cover-view v-else class="van-circle__text">{{ text }}</cover-view>
-  </view>
-</template>
-
-<script>
-import { VantComponent } from '../common/component'
-import { isObj } from '../common/utils'
-import { BLUE, WHITE } from '../common/color'
-import { adaptor } from './canvas'
-function format(rate) {
-  return Math.min(Math.max(rate, 0), 100)
-}
-const PERIMETER = 2 * Math.PI
-const BEGIN_ANGLE = -Math.PI / 2
-const STEP = 1
-export default VantComponent({
-  props: {
-    circleId: {
-      type: String,
-      default: 'van-circle'
-    },
-    text: String,
-    lineCap: {
-      type: String,
-      default: 'round'
-    },
-    value: {
-      type: [String, Number],
-      default: 0
-    },
-    speed: {
-      type: Number,
-      default: 50
-    },
-    size: {
-      type: [String, Number],
-      default: 100
-    },
-    fill: String,
-    layerColor: {
-      type: String,
-      default: WHITE
-    },
-    color: {
-      type: [String, Object],
-      default: BLUE
-    },
-    type: {
-      type: String,
-      default: ''
-    },
-    strokeWidth: {
-      type: Number,
-      default: 4
-    },
-    clockwise: {
-      type: Boolean,
-      default: true
-    }
-  },
-
-  data() {
-    return {
-      uid: 0
-    }
-  },
-
-  watch: {
-    value() {
-      this.reRender()
-    },
-    size() {
-      this.drawCircle(this.currentValue)
-    },
-    color() {
-      this.setHoverColor().then(() => {
-        this.drawCircle(this.currentValue)
-      })
-    }
-  },
-
-  created() {
-    this.uid = this._uid
-    const { value } = this
-    this.currentValue = value
-  },
-
-  mounted() {
-    this.setHoverColor().then(() => {
-      this.drawCircle(this.currentValue)
-    })
-  },
-
-  destroyed() {
-    this.clearInterval()
-  },
-
-  methods: {
-    getContext() {
-      const { type, size } = this
-      const defaultContext = () => {
-        const ctx = uni.createCanvasContext(this.circleId, this)
-        return Promise.resolve(ctx)
-      }
-      if (type !== '2d') {
-        return defaultContext()
-      }
-
-      // #ifdef MP-WEIXIN
-      // 微信下支持 2d 模式
-      return new Promise(resolve => {
-        uni
-          .createSelectorQuery()
-          .in(this)
-          .select(`#${this.circleId}`)
-          .node()
-          .exec(res => {
-            const canvas = res[0].node
-            const ctx = canvas.getContext(type)
-
-            if (!this.inited) {
-              const dpr = uni.getSystemInfoSync().pixelRatio
-              this.inited = true
-              canvas.width = size * dpr
-              canvas.height = size * dpr
-              ctx.scale(dpr, dpr)
-            }
-
-            resolve(adaptor(ctx))
-          })
-      })
-      // #endif
-      // #ifndef MP-WEIXIN
-      // eslint-disable-next-line no-unreachable
-      return defaultContext()
-      // #endif
-    },
-
-    setHoverColor() {
-      const { color, size } = this
-
-      if (isObj(color)) {
-        return this.getContext().then((context) => {
-          const LinearColor = context.createLinearGradient(size, 0, 0, 0)
-          Object.keys(color)
-            .sort((a, b) => parseFloat(a) - parseFloat(b))
-            .map((key) =>
-              LinearColor.addColorStop(parseFloat(key) / 100, color[key])
-            )
-          this.hoverColor = LinearColor
-        })
-      }
-
-      this.hoverColor = color
-      return Promise.resolve()
-    },
-    presetCanvas(context, strokeStyle, beginAngle, endAngle, fill) {
-      const { strokeWidth, lineCap, clockwise, size } = this
-      const position = size / 2
-      const radius = position - strokeWidth / 2
-
-      context.setStrokeStyle(strokeStyle)
-      context.setLineWidth(strokeWidth)
-      context.setLineCap(lineCap)
-      context.beginPath()
-      context.arc(position, position, radius, beginAngle, endAngle, !clockwise)
-      context.stroke()
-
-      if (fill) {
-        context.setFillStyle(fill)
-        context.fill()
-      }
-    },
-
-    renderLayerCircle(context) {
-      const { layerColor, fill } = this
-      this.presetCanvas(context, layerColor, 0, PERIMETER, fill)
-    },
-
-    renderHoverCircle(context, formatValue) {
-      const { clockwise, hoverColor } = this
-      // 结束角度
-      const progress = PERIMETER * (formatValue / 100)
-      const endAngle = clockwise
-        ? BEGIN_ANGLE + progress
-        : 3 * Math.PI - (BEGIN_ANGLE + progress)
-
-      this.presetCanvas(context, hoverColor, BEGIN_ANGLE, endAngle)
-    },
-
-    drawCircle(currentValue) {
-      const { size } = this
-
-      this.getContext().then(context => {
-        context.clearRect(0, 0, size, size)
-        this.renderLayerCircle(context)
-
-        const formatValue = format(currentValue)
-        if (formatValue !== 0) {
-          this.renderHoverCircle(context, formatValue)
-        }
-
-        context.draw()
-      })
-    },
-
-    reRender() {
-      // tofector 动画暂时没有想到好的解决方案
-      const { value, speed } = this
-
-      if (speed <= 0 || speed > 1000) {
-        this.drawCircle(value)
-        return
-      }
-
-      this.clearInterval()
-      this.currentValue = this.currentValue || 0
-      this.interval = setInterval(() => {
-        if (this.currentValue !== value) {
-          if (this.currentValue < value) {
-            this.currentValue += STEP
-          } else {
-            this.currentValue -= STEP
-          }
-          this.drawCircle(this.currentValue)
-        } else {
-          this.clearInterval()
-        }
-      }, 1000 / speed)
-    },
-
-    clearInterval() {
-      if (this.interval) {
-        clearInterval(this.interval)
-        this.interval = null
-      }
-    }
-  }
-})
-</script>
-
-<style lang="less">
-@import './index.less';
-</style>

+ 0 - 65
src/ttcomponents/van-col/README.md

@@ -1,65 +0,0 @@
-# Layout 布局
-
-### 介绍
-
-Layout 提供了`van-row`和`van-col`两个组件来进行行列布局
-
-### 引入
-
-推荐使用 `easycom` 的方式引入,详细介绍见[快速上手](#/quickstart#easycom-mo-shi-tui-jian)
-
-## 代码演示
-
-### 基本用法
-
-Layout 组件提供了`24列栅格`,通过在`Col`上添加`span`属性设置列所占的宽度百分比。此外,添加`offset`属性可以设置列的偏移宽度,计算方式与 span 相同
-
-```html
-<van-row>
-  <van-col span="8">span: 8</van-col>
-  <van-col span="8">span: 8</van-col>
-  <van-col span="8">span: 8</van-col>
-</van-row>
-
-<van-row>
-  <van-col span="4">span: 4</van-col>
-  <van-col span="10" offset="4">offset: 4, span: 10</van-col>
-</van-row>
-
-<van-row>
-  <van-col offset="12" span="12">offset: 12, span: 12</van-col>
-</van-row>
-```
-
-### 设置列元素间距
-
-通过`gutter`属性可以设置列元素之间的间距,默认间距为 0
-
-```html
-<van-row gutter="20">
-  <van-col span="8">span: 8</van-col>
-  <van-col span="8">span: 8</van-col>
-  <van-col span="8">span: 8</van-col>
-</van-row>
-```
-
-## API
-
-### Row Props
-
-| 参数   | 说明                          | 类型               | 默认值 | 版本 |
-| ------ | ----------------------------- | ------------------ | ------ | ---- |
-| gutter | 列元素之间的间距(单位为 px) | _string \| number_ | -      | -    |
-
-### Col Props
-
-| 参数   | 说明           | 类型               | 默认值 | 版本 |
-| ------ | -------------- | ------------------ | ------ | ---- |
-| span   | 列元素宽度     | _string \| number_ | -      | -    |
-| offset | 列元素偏移距离 | _string \| number_ | -      | -    |
-
-### 外部样式类
-
-| 类名         | 说明         |
-| ------------ | ------------ |
-| custom-class | 根节点样式类 |

+ 0 - 53
src/ttcomponents/van-col/demo.vue

@@ -1,53 +0,0 @@
-<template>
-  <div>
-    <demo-block title="基础用法" padding>
-      <van-row>
-        <van-col span="8" custom-class="dark">span: 8</van-col>
-        <van-col span="8" custom-class="light">span: 8</van-col>
-        <van-col span="8" custom-class="dark">span: 8</van-col>
-      </van-row>
-
-      <van-row>
-        <van-col span="4" custom-class="dark">span: 4</van-col>
-        <van-col span="10" offset="4" custom-class="light">offset: 4, span: 10</van-col>
-      </van-row>
-
-      <van-row>
-        <van-col offset="12" span="12" custom-class="dark">offset: 12, span: 12</van-col>
-      </van-row>
-    </demo-block>
-
-    <demo-block title="在列元素之间增加间距" padding>
-      <van-row gutter="20">
-        <van-col span="8" custom-class="dark">span: 8</van-col>
-        <van-col span="8" custom-class="light">span: 8</van-col>
-        <van-col span="8" custom-class="dark">span: 8</van-col>
-      </van-row>
-    </demo-block>
-  </div>
-</template>
-
-<script>
-export default {
-}
-</script>
-
-<style>
-.dark,
-.light {
-  color: #fff;
-  font-size: 13px;
-  line-height: 30px;
-  text-align: center;
-  margin-bottom: 10px;
-  background-clip: content-box;
-}
-
-.dark {
-  background-color: #39a9ed;
-}
-
-.light {
-  background-color: #66c6f2;
-}
-</style>

+ 0 - 15
src/ttcomponents/van-col/index.less

@@ -1,15 +0,0 @@
-.van-col {
-  float: left;
-  box-sizing: border-box;
-}
-
-.generate(24);
-.generate(@n, @i: 1) when (@i =< @n) {
-  .van-col--@{i} {
-    width: @i * 100% / 24;
-  }
-  .van-col--offset-@{i} {
-    margin-left: @i * 100% / 24;
-  }
-  .generate(@n, (@i + 1));
-}

+ 0 - 58
src/ttcomponents/van-col/van-col.vue

@@ -1,58 +0,0 @@
-<template>
-  <view
-    :class="wrapClass"
-    :style="viewStyle"
-  >
-    <slot />
-  </view>
-</template>
-
-<script>
-import { VantComponent } from '../common/component'
-import { ChildrenMixin } from '../mixins/relation'
-const utils = require('../wxs/utils')
-export default VantComponent({
-  name: 'VanCol',
-  props: {
-    span: [Number, String],
-    offset: [Number, String]
-  },
-  mixins: [ChildrenMixin('vanRow')],
-
-  data() {
-    return {
-      viewStyle: ''
-    }
-  },
-
-  computed: {
-    wrapClass() {
-      const { customClass, span, offset } = this
-      return `custom-class ${customClass} ${ utils.bem('col', [span]) } ${ offset ? 'van-col--offset-' + offset : '' }`
-    }
-  },
-
-  created() {
-    this.setGutter()
-  },
-
-  methods: {
-    setGutter() {
-      if (this.vanRow && this.vanRow.gutter) {
-        const padding = `${this.vanRow.gutter / 2}px`
-        const viewStyle = this.vanRow.gutter
-          ? `padding-left: ${padding}; padding-right: ${padding};`
-          : ''
-
-        if (viewStyle !== this.viewStyle) {
-          this.viewStyle = viewStyle
-        }
-      }
-    }
-  }
-})
-</script>
-
-<style lang="less">
-@import './index.less';
-</style>

+ 0 - 169
src/ttcomponents/van-count-down/README.md

@@ -1,169 +0,0 @@
-# CountDown 倒计时
-
-### 引入
-
-推荐使用 `easycom` 的方式引入,详细介绍见[快速上手](#/quickstart#easycom-mo-shi-tui-jian)
-
-## 代码演示
-
-### 基本用法
-
-`time`属性表示倒计时总时长,单位为毫秒
-
-```html
-<van-count-down :time="time" />
-```
-
-```js
-export default {
-  data() {
-    return {
-      time: 30 * 60 * 60 * 1000,
-    }
-  },
-}
-```
-
-### 自定义格式
-
-通过`format`属性设置倒计时文本的内容
-
-```html
-<van-count-down :time="time" format="DD 天 HH 时 mm 分 ss 秒" />
-```
-
-### 毫秒级渲染
-
-倒计时默认每秒渲染一次,设置`millisecond`属性可以开启毫秒级渲染
-
-```html
-<van-count-down millisecond :time="time" format="HH:mm:ss:SSS" />
-```
-
-### 自定义样式
-
-设置`use-slot`属性后可以自定义倒计时样式,需要通过`@change`事件获取`timeData`对象并自行渲染,格式见下方表格
-
-```html
-<van-count-down use-slot :time="time" @change="onChange">
-  <text class="item">{{ timeData.hours }}</text>
-  <text class="item">{{ timeData.minutes }}</text>
-  <text class="item">{{ timeData.seconds }}</text>
-</van-count-down>
-```
-
-```js
-export default {
-  data() {
-    return {
-      time: 30 * 60 * 60 * 1000,
-      timeData: {},
-    }
-  },
-
-  methods: {
-    onChange(timeData) {
-      this.timeData = timeData
-    },
-  }
-}
-```
-
-```css
-.item {
-  display: inline-block;
-  width: 22px;
-  margin-right: 5px;
-  color: #fff;
-  font-size: 12px;
-  text-align: center;
-  background-color: #1989fa;
-  border-radius: 2px;
-}
-```
-
-### 手动控制
-
-通过设置 `ref="countDown"` 获取到组件实例后,可以调用`start`、`pause`、`reset`方法
-
-```html
-<van-count-down
-  class="control-count-down"
-  ref="countDown"
-  millisecond
-  :time="3000"
-  :auto-start="false"
-  format="ss:SSS"
-  @finish="finished"
-/>
-
-<van-grid clickable column-num="3">
-  <van-grid-item text="开始" icon="play-circle-o" @click="start" />
-  <van-grid-item text="暂停" icon="pause-circle-o" @click="pause" />
-  <van-grid-item text="重置" icon="replay" @click="reset" />
-</van-grid>
-```
-
-```js
-export default {
-  methods: {
-    start() {
-      this.$refs.countDown.start()
-    },
-
-    pause() {
-      this.$refs.countDown.pause()
-    },
-
-    reset() {
-      this.$refs.countDown.reset()
-    },
-
-    finished() {
-      uni.showToast({
-        title: '倒计时结束',
-        duration: 2000
-      })
-    }
-  }
-}
-```
-
-## API
-
-### Props
-
-| 参数 | 说明 | 类型 | 默认值 | 版本 |
-| --- | --- | --- | --- | --- |
-| time | 倒计时时长,单位毫秒 | _number_ | - | - |
-| format | 时间格式,DD-日,HH-时,mm-分,ss-秒,SSS-毫秒 | _string_ | `HH:mm:ss` | - |
-| auto-start | 是否自动开始倒计时 | _boolean_ | `true` | - |
-| millisecond | 是否开启毫秒级渲染 | _boolean_ | `false` | - |
-| use-slot | 是否使用自定义样式插槽 | _boolean_ | `false` | - |
-
-### Events
-
-| 事件名 | 说明                                         | 回调参数 |
-| ------ | -------------------------------------------- | -------- |
-| finish | 倒计时结束时触发                             | -        |
-| change | 时间变化时触发,仅在开启`use-slot`后才会触发 | timeData |
-
-### timeData 格式
-
-| 名称         | 说明     | 类型     |
-| ------------ | -------- | -------- |
-| days         | 剩余天数 | _number_ |
-| hours        | 剩余小时 | _number_ |
-| minutes      | 剩余分钟 | _number_ |
-| seconds      | 剩余秒数 | _number_ |
-| milliseconds | 剩余毫秒 | _number_ |
-
-### 方法
-
-通过 selectComponent 可以获取到 CountDown 实例并调用实例方法
-
-| 方法名 | 参数 | 返回值 | 介绍 |
-| --- | --- | --- | --- |
-| start | - | - | 开始倒计时 |
-| pause | - | - | 暂停倒计时 |
-| reset | - | - | 重设倒计时,若`auto-start`为`true`,重设后会自动开始倒计时 |

+ 0 - 93
src/ttcomponents/van-count-down/demo.vue

@@ -1,93 +0,0 @@
-<template>
-  <div>
-    <demo-block title="基础用法">
-      <van-count-down :time="time" />
-    </demo-block>
-
-    <demo-block title="自定义格式">
-      <van-count-down :time="time" format="DD 天 HH 时 mm 分 ss 秒" />
-    </demo-block>
-
-    <demo-block title="毫秒级渲染">
-      <van-count-down millisecond :time="time" format="HH:mm:ss:SSS" />
-    </demo-block>
-
-    <demo-block title="自定义样式">
-      <van-count-down use-slot :time="time" @change="onChange">
-        <text class="item">{{ timeData.hours }}</text>
-        <text class="item">{{ timeData.minutes }}</text>
-        <text class="item">{{ timeData.seconds }}</text>
-      </van-count-down>
-    </demo-block>
-
-    <demo-block title="手动控制">
-      <van-count-down
-        class="control-count-down"
-        ref="countDown"
-        millisecond
-        :time="3000"
-        :auto-start="false"
-        format="ss:SSS"
-        @finish="finished"
-      />
-
-      <van-grid clickable column-num="3">
-        <van-grid-item text="开始" icon="play-circle-o" @click="start" />
-        <van-grid-item text="暂停" icon="pause-circle-o" @click="pause" />
-        <van-grid-item text="重置" icon="replay" @click="reset" />
-      </van-grid>
-    </demo-block>
-  </div>
-</template>
-
-<script>
-export default {
-  data() {
-    return {
-      time: 30 * 60 * 60 * 1000,
-      timeData: {}
-    }
-  },
-  methods: {
-    onChange(timeData) {
-      this.timeData = timeData
-    },
-
-    start() {
-      this.$refs.countDown.start()
-    },
-
-    pause() {
-      this.$refs.countDown.pause()
-    },
-
-    reset() {
-      this.$refs.countDown.reset()
-    },
-
-    finished() {
-      uni.showToast({
-        title: '倒计时结束',
-        duration: 2000
-      })
-    }
-  }
-}
-</script>
-
-<style>
-.van-count-down {
-  margin: 0 16px 10px;
-}
-
-.item {
-  display: inline-block;
-  width: 22px;
-  margin-right: 5px;
-  color: #fff;
-  font-size: 12px;
-  text-align: center;
-  background-color: #1989fa;
-  border-radius: 2px;
-}
-</style>

+ 0 - 8
src/ttcomponents/van-count-down/index.less

@@ -1,8 +0,0 @@
-@import '../common/style/var.less';
-@import '../common/style/theme.less';
-
-.van-count-down {
-  .theme(color, '@count-down-text-color');
-  .theme(font-size, '@count-down-font-size');
-  .theme(line-height, '@count-down-line-height');
-}

+ 0 - 65
src/ttcomponents/van-count-down/utils.js

@@ -1,65 +0,0 @@
-function padZero(num, targetLength = 2) {
-  let str = num + ''
-
-  while (str.length < targetLength) {
-    str = '0' + str
-  }
-
-  return str
-}
-
-const SECOND = 1000
-const MINUTE = 60 * SECOND
-const HOUR = 60 * MINUTE
-const DAY = 24 * HOUR
-
-export function parseTimeData(time) {
-  const days = Math.floor(time / DAY)
-  const hours = Math.floor((time % DAY) / HOUR)
-  const minutes = Math.floor((time % HOUR) / MINUTE)
-  const seconds = Math.floor((time % MINUTE) / SECOND)
-  const milliseconds = Math.floor(time % SECOND)
-
-  return {
-    days,
-    hours,
-    minutes,
-    seconds,
-    milliseconds
-  }
-}
-
-export function parseFormat(format, timeData) {
-  const { days } = timeData
-  let { hours, minutes, seconds, milliseconds } = timeData
-
-  if (format.indexOf('DD') === -1) {
-    hours += days * 24
-  } else {
-    format = format.replace('DD', padZero(days))
-  }
-
-  if (format.indexOf('HH') === -1) {
-    minutes += hours * 60
-  } else {
-    format = format.replace('HH', padZero(hours))
-  }
-
-  if (format.indexOf('mm') === -1) {
-    seconds += minutes * 60
-  } else {
-    format = format.replace('mm', padZero(minutes))
-  }
-
-  if (format.indexOf('ss') === -1) {
-    milliseconds += seconds * 1000
-  } else {
-    format = format.replace('ss', padZero(seconds))
-  }
-
-  return format.replace('SSS', padZero(milliseconds, 3))
-}
-
-export function isSameSecond(time1, time2) {
-  return Math.floor(time1 / 1000) === Math.floor(time2 / 1000)
-}

+ 0 - 140
src/ttcomponents/van-count-down/van-count-down.vue

@@ -1,140 +0,0 @@
-<template>
-  <view class="van-count-down">
-    <slot v-if="useSlot" />
-    <block v-else>{{ formattedTime }}</block>
-  </view>
-</template>
-
-<script>
-import { VantComponent } from '../common/component'
-import { isSameSecond, parseFormat, parseTimeData } from './utils'
-
-function simpleTick(fn) {
-  return setTimeout(fn, 30)
-}
-
-export default VantComponent({
-  props: {
-    useSlot: Boolean,
-    millisecond: Boolean,
-    time: {
-      type: Number
-    },
-    format: {
-      type: String,
-      default: 'HH:mm:ss'
-    },
-    autoStart: {
-      type: Boolean,
-      default: true
-    }
-  },
-
-  data() {
-    return {
-      timeData: parseTimeData(0),
-      formattedTime: '0'
-    }
-  },
-
-  watch: {
-    time: {
-      handler() {
-        this.reset()
-      },
-      immediate: true
-    }
-  },
-
-  destroyed() {
-    clearTimeout(this.tid)
-    this.tid = null
-  },
-
-  methods: {
-    // 开始
-    start() {
-      if (this.counting) {
-        return
-      }
-
-      this.counting = true
-      this.endTime = Date.now() + this.remain
-      this.tick()
-    },
-
-    // 暂停
-    pause() {
-      this.counting = false
-      clearTimeout(this.tid)
-    },
-
-    // 重置
-    reset() {
-      this.pause()
-      this.remain = this.time
-      this.setRemain(this.remain)
-
-      if (this.autoStart) {
-        this.start()
-      }
-    },
-
-    tick() {
-      if (this.millisecond) {
-        this.microTick()
-      } else {
-        this.macroTick()
-      }
-    },
-
-    microTick() {
-      this.tid = simpleTick(() => {
-        this.setRemain(this.getRemain())
-
-        if (this.remain !== 0) {
-          this.microTick()
-        }
-      })
-    },
-
-    macroTick() {
-      this.tid = simpleTick(() => {
-        const remain = this.getRemain()
-
-        if (!isSameSecond(remain, this.remain) || remain === 0) {
-          this.setRemain(remain)
-        }
-
-        if (this.remain !== 0) {
-          this.macroTick()
-        }
-      })
-    },
-
-    getRemain() {
-      return Math.max(this.endTime - Date.now(), 0)
-    },
-
-    setRemain(remain) {
-      this.remain = remain
-      const timeData = parseTimeData(remain)
-
-      if (this.useSlot) {
-        this.$emit('change', timeData)
-      }
-
-      this.formattedTime = parseFormat(this.format, timeData)
-
-      if (remain === 0) {
-        this.pause()
-        this.$emit('finish')
-      }
-    }
-  }
-})
-</script>
-
-<style lang="less">
-@import './index.less';
-</style>

+ 0 - 260
src/ttcomponents/van-dialog/README.md

@@ -1,260 +0,0 @@
-# Dialog 弹出框
-
-### 介绍
-
-弹出模态框,常用于消息提示、消息确认、在当前页面内完成特定的交互操作
-
-弹出框组件支持函数调用和组件调用两种方式
-
-### 引入
-
-推荐使用 `easycom` 的方式引入,详细介绍见[快速上手](#/quickstart#easycom-mo-shi-tui-jian)
-
-## 代码演示
-
-### 消息提示
-
-用于提示一些消息,只包含一个确认按钮。需要在页面中配置 `van-dialog` 元素,并指定 `ref` 和 `id` 。
-
-```html
-<van-dialog ref="van-dialog" id="van-dialog" />
-```
-
-```javascript
-import Dialog from 'path/to/@vant/weapp/dist/dialog/dialog';
-
-Dialog.alert({
-  title: '标题',
-  message: '弹窗内容',
-}).then(() => {
-  // on close
-});
-
-Dialog.alert({
-  message: '弹窗内容',
-}).then(() => {
-  // on close
-});
-```
-
-### 圆角样式
-
-样式为圆角风格。
-
-```html
-<van-dialog ref="van-dialog" id="van-dialog" />
-```
-
-```javascript
-import Dialog from 'path/to/@vant/weapp/dist/dialog/dialog';
-
-Dialog.alert({
-  title: '标题',
-  message: '弹窗内容',
-  theme: 'round-button',
-}).then(() => {
-  // on close
-});
-
-Dialog.alert({
-  message: '弹窗内容',
-  theme: 'round-button',
-}).then(() => {
-  // on close
-});
-```
-
-### 消息确认
-
-用于确认消息,包含取消和确认按钮
-
-```javascript
-Dialog.confirm({
-  title: '标题',
-  message: '弹窗内容',
-})
-  .then(() => {
-    // on confirm
-  })
-  .catch(() => {
-    // on cancel
-  });
-```
-
-### 异步关闭
-
-设置`asyncClose`属性开启异步关闭,开启后可以手动调用`Dialog.close`方法关闭弹窗
-
-```javascript
-Dialog.confirm({
-  title: '标题',
-  message: '弹窗内容'
-  asyncClose: true
-})
-  .then(() => {
-    setTimeout(() => {
-      Dialog.close();
-    }, 1000);
-  })
-  .catch(() => {
-    Dialog.close();
-  });
-```
-
-### 组件调用
-
-通过组件调用 Dialog 时,可以实现自定义弹窗内容、监听微信开放能力回调事件等功能,具体参考下例
-
-```html
-<van-dialog
-  use-slot
-  title="标题"
-  :show.sync="show"
-  show-cancel-button
-  confirm-button-open-type="getUserInfo"
-  @close="onClose"
-  @getuserinfo="getUserInfo"
->
-  <image src="https://img.yzcdn.cn/1.jpg" />
-</van-dialog>
-```
-
-```js
-export default {
-  data() {
-    return {
-      show: true,
-    }
-  },
-
-  methods: {
-    getUserInfo(event) {
-      console.log(event.detail)
-    },
-
-    onClose() {
-      this.show = false
-    },
-  }
-}
-```
-
-## API
-
-### 方法
-
-| 方法名 | 参数 | 返回值 | 介绍 |
-| --- | --- | --- | --- |
-| Dialog | `options` | `Promise` | 展示弹窗 |
-| Dialog.alert | `options` | `Promise` | 展示消息提示弹窗 |
-| Dialog.confirm | `options` | `Promise` | 展示消息确认弹窗 |
-| Dialog.setDefaultOptions | `options` | `void` | 修改默认配置,对所有 Dialog 生效 |
-| Dialog.resetDefaultOptions | - | `void` | 重置默认配置,对所有 Dialog 生效 |
-| Dialog.close | - | `void` | 关闭弹窗 |
-| Dialog.stopLoading | - | `void` | 停止按钮的加载状态 |
-
-### Options
-
-通过函数调用 Dialog 时,支持传入以下选项:
-
-| 参数 | 说明 | 类型 | 默认值 | 版本 |
-| --- | --- | --- | --- | --- |
-| title | 标题 | _string_ | - | - |
-| width | 弹窗宽度,默认单位为`px` | _string \| number_ | `320px` | 1.0.0 |
-| message | 文本内容,支持通过`\n`换行 | _string_ | - | 1.0.0 |
-| theme | 样式风格,可选值为`round-button` | _string_ | `default` |
-| messageAlign | 内容对齐方式,可选值为`left` `right` | _string_ | `center` | - |
-| zIndex | z-index 层级 | _number_ | `100` | - |
-| className | 自定义类名,dialog 在自定义组件内时无效 | _string_ | '' | - |
-| customStyle | 自定义样式 | _string_ | '' | - |
-| selector | 自定义选择器 | _string_ | `van-dialog` | - |
-| showConfirmButton | 是否展示确认按钮 | _boolean_ | `true` | - |
-| showCancelButton | 是否展示取消按钮 | _boolean_ | `false` | - |
-| confirmButtonText | 确认按钮的文案 | _string_ | `确认` | - |
-| cancelButtonText | 取消按钮的文案 | _string_ | `取消` | - |
-| overlay | 是否展示遮罩层 | _boolean_ | `true` | - |
-| overlayStyle | 自定义遮罩层样式 | _object_ | - | 1.0.0 |
-| closeOnClickOverlay | 点击遮罩层时是否关闭弹窗 | _boolean_ | `false` | - |
-| asyncClose | 是否异步关闭弹窗,开启后需要手动控制弹窗的关闭 | _boolean_ | `false` | - |
-| context | 选择器的选择范围,可以传入自定义组件的 this 作为上下文 | _object_ | 当前页面 | - |
-| transition | 动画名称,可选值为`fade` `none` | _string_ | `scale` | - |
-| confirmButtonOpenType | 确认按钮的微信开放能力,具体支持可参考 [微信官方文档](https://mp.weixin.qq.com/debug/wxadoc/dev/component/button.html) | _string_ | - | - |
-
-### OpenType Options
-
-使用`confirmButtonOpenType`后,支持以下选项:
-
-| 参数 | 说明 | 类型 | 默认值 | open-type |
-| --- | --- | --- | --- | --- |
-| appParameter | 打开 APP 时,向 APP 传递的参数 | _string_ | - | `launchApp` |
-| lang | 指定返回用户信息的语言,zh_CN 简体中文,<br>zh_TW 繁体中文,en 英文 | _string_ | `en` | `getUserInfo` |
-| sessionFrom | 会话来源 | _string_ | - | `contact` |
-| businessId | 客服消息子商户 id | _number_ | - | `contact` |
-| sendMessageTitle | 会话内消息卡片标题 | _string_ | 当前标题 | `contact` |
-| sendMessagePath | 会话内消息卡片点击跳转小程序路径 | _string_ | 当前分享路径 | `contact` |
-| sendMessageImg | sendMessageImg | _string_ | 截图 | `contact` |
-| showMessageCard | 显示会话内消息卡片 | _string_ | `false` | `contact` |
-
-### Props
-
-通过组件调用 Dialog 时,支持以下 Props:
-
-| 参数 | 说明 | 类型 | 默认值 |
-| --- | --- | --- | --- |
-| show | 是否显示弹窗 | _boolean_ | - |
-| title | 标题 | _string_ | - |
-| width | 弹窗宽度,默认单位为`px` | _string \| number_ | `320px` | 1.0.0 |
-| message | 文本内容,支持通过`\n`换行 | _string_ | - |
-| theme | 样式风格,可选值为`round-button` | _string_ | `default` |
-| message-align | 内容对齐方式,可选值为`left` `right` | _string_ | `center` |
-| z-index | z-index 层级 | _number_ | `100` |
-| class-name | 自定义类名,dialog 在自定义组件内时无效 | _string_ | '' |
-| custom-style | 自定义样式 | _string_ | '' |
-| show-confirm-button | 是否展示确认按钮 | _boolean_ | `true` |
-| show-cancel-button | 是否展示取消按钮 | _boolean_ | `false` |
-| confirm-button-text | 确认按钮的文案 | _string_ | `确认` |
-| cancel-button-text | 取消按钮的文案 | _string_ | `取消` |
-| confirm-button-color | 确认按钮的字体颜色 | _string_ | `#1989fa` |
-| cancel-button-color | 取消按钮的字体颜色 | _string_ | `#333` |
-| overlay | 是否展示遮罩层 | _boolean_ | `true` |
-| overlay-style | 自定义遮罩层样式 | _object_ | - | 1.0.0 |
-| close-on-click-overlay | 点击遮罩层时是否关闭弹窗 | _boolean_ | `false` |
-| use-slot | 是否使用自定义内容的插槽 | _boolean_ | `false` |
-| use-title-slot | 是否使用自定义标题的插槽 | _boolean_ | `false` |
-| async-close | 是否异步关闭弹窗,开启后需要手动控制弹窗的关闭 | _boolean_ | `false` |
-| transition | 动画名称,可选值为`fade` | _string_ | `scale` |
-| confirm-button-open-type | 确认按钮的微信开放能力,具体支持可参考 [微信官方文档](https://mp.weixin.qq.com/debug/wxadoc/dev/component/button.html) | _string_ | - |
-
-### OpenType Props
-
-使用`confirm-button-open-type`后,支持以下 Props:
-
-| 参数 | 说明 | 类型 | 默认值 | open-type |
-| --- | --- | --- | --- | --- |
-| app-parameter | 打开 APP 时,向 APP 传递的参数 | _string_ | - | `launchApp` |
-| lang | 指定返回用户信息的语言,zh_CN 简体中文,<br>zh_TW 繁体中文,en 英文 | _string_ | `en` | `getUserInfo` |
-| session-from | 会话来源 | _string_ | - | `contact` |
-| business-id | 客服消息子商户 id | _number_ | - | `contact` |
-| send-message-title | 会话内消息卡片标题 | _string_ | 当前标题 | `contact` |
-| send-message-path | 会话内消息卡片点击跳转小程序路径 | _string_ | 当前分享路径 | `contact` |
-| send-message-img | sendMessageImg | _string_ | 截图 | `contact` |
-| show-message-card | 显示会话内消息卡片 | _string_ | `false` | `contact` |
-
-### Events
-
-| 事件 | 说明 | 回调参数 |
-| --- | --- | --- |
-| @close | 弹窗关闭时触发 | event.detail: 触发关闭事件的来源,<br>枚举为`confirm`,`cancel`,`overlay` |
-| @confirm | 点击确认按钮时触发 | - |
-| @cancel | 点击取消按钮时触发 | - |
-| @getuserinfo | 点击确认按钮时,会返回获取到的用户信息,<br>从返回参数的 detail 中获取到的值同 wx.getUserInfo | - |
-| @contact | 客服消息回调 | - |
-| @getphonenumber | 获取用户手机号回调 | - |
-| @error | 当使用开放能力时,发生错误的回调 | - |
-| @opensetting | 在打开授权设置页后回调 | - |
-
-### Slot
-
-| 名称  | 说明                                                 |
-| ----- | ---------------------------------------------------- |
-| title | 自定义`title`显示内容,如果设置了`title`属性则不生效 |

+ 0 - 140
src/ttcomponents/van-dialog/demo.vue

@@ -1,140 +0,0 @@
-<template>
-  <div>
-    <demo-block title="提示弹窗" padding>
-      <van-button type="primary" custom-class="demo-margin-right" @click="onClickAlert">
-        提示弹窗
-      </van-button>
-      <van-button type="primary" @click="onClickAlert2">
-        提示弹窗(无标题)
-      </van-button>
-    </demo-block>
-
-    <demo-block title="圆角样式" padding>
-      <van-button type="primary" class="demo-margin-right" @click="onClickThemeAlert">
-        提示弹窗
-      </van-button>
-      <van-button type="primary" @click="onClickThemeAlert2">
-        提示弹窗(无标题)
-      </van-button>
-    </demo-block>
-
-    <demo-block title="确认弹窗" padding>
-      <van-button type="primary" @click="onClickConfirm">
-        确认弹窗
-      </van-button>
-    </demo-block>
-
-    <demo-block title="异步关闭" padding>
-      <van-button type="primary" @click="onClickAsyncClose">
-        异步关闭
-      </van-button>
-    </demo-block>
-
-    <demo-block title="组件调用" padding>
-      <van-button type="primary" class="demo-margin-right" @click="showCustomDialog">
-        组件调用
-      </van-button>
-      <van-dialog
-        use-slot
-        title="标题"
-        :show.sync="show"
-        show-cancel-button
-        @close="onClose"
-        confirm-button-open-type="getUserInfo"
-        @getuserinfo="getUserInfo"
-      >
-        <image
-          class="demo-image"
-          src="https://img.yzcdn.cn/public_files/2017/09/05/4e3ea0898b1c2c416eec8c11c5360833.jpg"
-        />
-      </van-dialog>
-    </demo-block>
-    <van-dialog ref="van-dialog" id="van-dialog" />
-  </div>
-</template>
-
-<script>
-import Dialog from './dialog'
-const message = '代码是写出来给人看的,附带能在机器上运行'
-export default {
-  components: {
-  },
-  data() {
-    return {
-      show: false
-    }
-  },
-  methods: {
-    showCustomDialog() {
-      this.show = true
-    },
-
-    onClickAlert() {
-      Dialog.alert({
-        title: '标题',
-        message
-      });
-    },
-
-    onClickThemeAlert() {
-      Dialog.alert({
-        title: '标题',
-        theme: 'round-button',
-        message
-      });
-    },
-
-    onClickThemeAlert2() {
-      Dialog.alert({
-        theme: 'round-button',
-        message
-      });
-    },
-
-    getUserInfo(event) {
-      console.log('getUserInfo', event)
-    },
-
-    onClickAlert2() {
-      Dialog.alert({
-        message
-      });
-    },
-
-    onClickConfirm() {
-      Dialog.confirm({
-        title: '标题',
-        message
-      });
-    },
-
-    onClickAsyncClose() {
-      Dialog.confirm({
-        title: '标题',
-        message,
-        asyncClose: true
-      })
-        .then(() => {
-          setTimeout(() => {
-            Dialog.close();
-          }, 1000);
-        })
-        .catch(() => {
-          Dialog.close();
-        });
-    },
-
-    onClose() {
-      this.show = false
-    }
-  }
-}
-</script>
-
-<style>
-.demo-image {
-  box-sizing: border-box;
-  width: 100%;
-  padding: 25px 20px 0;
-}
-</style>

+ 0 - 132
src/ttcomponents/van-dialog/dialog.js

@@ -1,132 +0,0 @@
-let queue = []
-
-function getContext() {
-  const pages = getCurrentPages()
-  return pages[pages.length - 1]
-}
-
-function mapKeys(source, target, map) {
-  Object.keys(map).forEach((key) => {
-    if (source[key]) {
-      target[map[key]] = source[key]
-    } else {
-      target[map[key]] = null
-    }
-  })
-}
-
-const Dialog = options => {
-  options = {
-    ...Dialog.currentOptions,
-    ...options
-  }
-
-  const _options = {}
-
-  mapKeys(options, _options, {
-    show: 'optionsShow',
-    title: 'optionsTitle',
-    width: 'optionsWidth',
-    theme: 'optionsTheme',
-    message: 'optionsMessage',
-    zIndex: 'optionsZIndex',
-    overlay: 'optionsOverlay',
-    selector: 'selector',
-    className: 'optionsClassName',
-    asyncClose: 'optionsAsyncClose',
-    transition: 'optionsTransition',
-    customStyle: 'optionsCustomStyle',
-    messageAlign: 'optionsMessageAlign',
-    overlayStyle: 'optionsOverlayStyle',
-    confirmButtonText: 'optionsConfirmButtonText',
-    cancelButtonText: 'optionsCancelButtonText',
-    showConfirmButton: 'optionsShowConfirmButton',
-    showCancelButton: 'optionsShowCancelButton',
-    closeOnClickOverlay: 'optionsCloseOnClickOverlay',
-    confirmButtonOpenType: 'optionsConfirmButtonOpenType'
-  })
-
-  return new Promise((resolve, reject) => {
-    const context = options.context || getContext()
-    let dialog
-    // #ifdef H5
-    dialog = context.$refs[options.selector]
-    // #endif
-    // #ifndef H5
-    dialog = context.$vm.$refs[options.selector]
-    // #endif
-
-    delete options.context
-    delete options.selector
-
-    if (dialog) {
-      dialog.onCancelReject = reject
-      dialog.onConfirmResolve = resolve
-      Object.keys(_options).map(key => {
-        dialog[key] = _options[key]
-      })
-      dialog.optionsShow = true
-      queue.push(dialog)
-    } else {
-      console.warn(
-        '未找到 van-dialog 节点,请确认 selector 及 context 是否正确'
-      )
-    }
-  })
-}
-
-Dialog.defaultOptions = {
-  show: false,
-  title: '',
-  width: null,
-  theme: 'default',
-  message: '',
-  zIndex: 100,
-  overlay: true,
-  selector: 'van-dialog',
-  className: '',
-  asyncClose: false,
-  transition: 'scale',
-  customStyle: '',
-  messageAlign: '',
-  overlayStyle: '',
-  confirmButtonText: '确认',
-  cancelButtonText: '取消',
-  showConfirmButton: true,
-  showCancelButton: false,
-  closeOnClickOverlay: false,
-  confirmButtonOpenType: ''
-}
-
-Dialog.alert = Dialog
-
-Dialog.confirm = options =>
-  Dialog({
-    showCancelButton: true,
-    ...options
-  })
-
-Dialog.close = () => {
-  queue.forEach(dialog => {
-    dialog.close()
-  })
-  queue = []
-}
-
-Dialog.stopLoading = () => {
-  queue.forEach(dialog => {
-    dialog.stopLoading()
-  })
-}
-
-Dialog.setDefaultOptions = options => {
-  Object.assign(Dialog.currentOptions, options)
-}
-
-Dialog.resetDefaultOptions = () => {
-  Dialog.currentOptions = { ...Dialog.defaultOptions }
-}
-
-Dialog.resetDefaultOptions()
-
-export default Dialog

+ 0 - 86
src/ttcomponents/van-dialog/index.less

@@ -1,86 +0,0 @@
-@import '../common/style/var.less';
-@import '../common/style/theme.less';
-@import '../common/style/hairline.less';
-
-.van-dialog {
-  top: 45% !important;
-  overflow: hidden;
-  .theme(width, '@dialog-width');
-  .theme(font-size, '@dialog-font-size');
-  .theme(border-radius, '@dialog-border-radius');
-  .theme(background-color, '@dialog-background-color');
-
-  @media (max-width: 321px) {
-    .theme(width, '@dialog-small-screen-width');
-  }
-
-  &__header {
-    text-align: center;
-    .theme(padding-top, '@dialog-header-padding-top');
-    .theme(font-weight, '@dialog-header-font-weight');
-    .theme(line-height, '@dialog-header-line-height');
-
-    &--isolated {
-      .theme(padding, '@dialog-header-isolated-padding');
-    }
-  }
-
-  &__message {
-    overflow-y: auto;
-    text-align: center;
-    -webkit-overflow-scrolling: touch;
-    .theme(font-size, '@dialog-message-font-size');
-    .theme(line-height, '@dialog-message-line-height');
-    .theme(max-height, '@dialog-message-max-height');
-    .theme(padding, '@dialog-message-padding');
-
-    &-text {
-      word-wrap: break-word;
-    }
-
-    &--hasTitle {
-      .theme(padding-top, '@dialog-has-title-message-padding-top');
-      .theme(color, '@dialog-has-title-message-text-color');
-    }
-
-    &--round-button {
-      padding-bottom: @padding-md;
-      color: @text-color;
-    }
-
-    &--left {
-      text-align: left;
-    }
-
-    &--right {
-      text-align: right;
-    }
-  }
-
-  &__footer {
-    display: flex;
-    &--round-button {
-      position: relative !important;
-      padding: @padding-xs @padding-lg @padding-md !important;
-    }
-  }
-
-  &__button {
-    flex: 1;
-  }
-
-  &__confirm,
-  &__cancel {
-    border: 0 !important;
-  }
-
-  &-bounce-enter {
-    transform: translate3d(-50%, -50%, 0) scale(0.7);
-    opacity: 0;
-  }
-
-  &-bounce-leave-active {
-    transform: translate3d(-50%, -50%, 0) scale(0.9);
-    opacity: 0;
-  }
-}

+ 0 - 408
src/ttcomponents/van-dialog/van-dialog.vue

@@ -1,408 +0,0 @@
-<template>
-  <van-popup
-    :show="optionsShow"
-    :z-index="optionsZIndex"
-    :overlay="optionsOverlay"
-    :transition="optionsTransition"
-    :custom-class="`van-dialog ${ optionsClassName } van-dialog--${ optionsTheme }`"
-    :custom-style="popupCustomStyle"
-    :overlay-style="optionsOverlayStyle"
-    :close-on-click-overlay="optionsCloseOnClickOverlay"
-    @close="onClickOverlay"
-  >
-    <view
-      v-if="optionsTitle || useTitleSlot"
-      :class="headerClass"
-    >
-      <slot v-if="useTitleSlot" name="title" />
-      <block v-else-if="optionsTitle">{{ optionsTitle }}</block>
-    </view>
-
-    <slot v-if="useSlot" />
-    <view
-      v-else-if="optionsMessage"
-      :class="messageClass"
-    >
-      <text class="van-dialog__message-text">{{ optionsMessage }}</text>
-    </view>
-
-    <van-goods-action v-if="optionsTheme === 'round-button'" custom-class="van-dialog__footer--round-button">
-      <van-goods-action-button
-        v-if="optionsShowCancelButton"
-        size="large"
-        :loading="loading.cancel"
-        class="van-dialog__button van-hairline--right"
-        custom-class="van-dialog__cancel"
-        :custom-style="`color: ${ cancelButtonColor }`"
-        @click="onCancel"
-      >
-        {{ cancelButtonText }}
-      </van-goods-action-button>
-      <van-goods-action-button
-        v-if="optionsShowConfirmButton"
-        size="large"
-        class="van-dialog__button"
-        :loading="loading.confirm"
-        custom-class="van-dialog__confirm"
-        :custom-style="`color: ${ confirmButtonColor }`"
-
-        :open-type="optionsConfirmButtonOpenType"
-        :lang="lang"
-        :business-id="businessId"
-        :session-from="sessionFrom"
-        :send-message-title="sendMessageTitle"
-        :send-message-path="sendMessagePath"
-        :send-message-img="sendMessageImg"
-        :show-message-card="showMessageCard"
-        :app-parameter="appParameter"
-
-        @click="onConfirm"
-        @getuserinfo="bindGetUserInfo"
-        @contact="bindContact"
-        @getphonenumber="bindGetPhoneNumber"
-        @error="bindError"
-        @launchapp="bindLaunchApp"
-        @opensetting="bindOpenSetting"
-      >
-        {{ confirmButtonText }}
-      </van-goods-action-button>
-    </van-goods-action>
-
-    <view v-else class="van-hairline--top van-dialog__footer">
-      <van-button
-        v-if="optionsShowCancelButton"
-        size="large"
-        :loading="loading.cancel"
-        class="van-dialog__button van-hairline--right"
-        custom-class="van-dialog__cancel van-dialog__button van-hairline--right"
-        :custom-style="` color: ${ cancelButtonColor }`"
-        @click="onCancel"
-      >
-        {{ optionsCancelButtonText }}
-      </van-button>
-      <van-button
-        v-if="optionsShowConfirmButton"
-        size="large"
-        class="van-dialog__button"
-        :loading="loading.confirm"
-        custom-class="van-dialog__confirm van-dialog__button"
-        :custom-style="`color: ${ confirmButtonColor }`"
-        :open-type="optionsConfirmButtonOpenType"
-        :lang="lang"
-        :business-id="businessId"
-        :session-from="sessionFrom"
-        :send-message-title="sendMessageTitle"
-        :send-message-path="sendMessagePath"
-        :send-message-img="sendMessageImg"
-        :show-message-card="showMessageCard"
-        :app-parameter="appParameter"
-        @click="onConfirm"
-        @getuserinfo="bindGetUserInfo"
-        @contact="bindContact"
-        @getphonenumber="bindGetPhoneNumber"
-        @error="bindError"
-        @launchapp="bindLaunchApp"
-        @opensetting="bindOpenSetting"
-      >
-        {{ optionsConfirmButtonText }}
-      </van-button>
-    </view>
-  </van-popup>
-</template>
-
-<script>
-import utils from '../wxs/utils'
-import VanPopup from '../van-popup/van-popup'
-import VanButton from '../van-button/van-button'
-import VanGoodsAction from '../van-goods-action/van-goods-action'
-import VanGoodsActionButton from '../van-goods-action-button/van-goods-action-button'
-import { VantComponent } from '../common/component'
-import { button } from '../mixins/button'
-import { openType } from '../mixins/open-type'
-import { GRAY, RED } from '../common/color'
-export default {
-  components: {
-    VanPopup,
-    VanButton,
-    VanGoodsAction,
-    VanGoodsActionButton
-  },
-  ...VantComponent({
-    mixins: [button, openType],
-    props: {
-      show: {
-        type: Boolean,
-        default: false
-      },
-      title: String,
-      message: String,
-      theme: {
-        type: String,
-        default: 'default'
-      },
-      useSlot: Boolean,
-      className: String,
-      customStyle: String,
-      asyncClose: Boolean,
-      messageAlign: String,
-      overlayStyle: String,
-      useTitleSlot: Boolean,
-      showCancelButton: Boolean,
-      closeOnClickOverlay: Boolean,
-      confirmButtonOpenType: String,
-      width: null,
-      zIndex: {
-        type: Number,
-        default: 2000
-      },
-      confirmButtonText: {
-        type: String,
-        default: '确认'
-      },
-      cancelButtonText: {
-        type: String,
-        default: '取消'
-      },
-      confirmButtonColor: {
-        type: String,
-        default: RED
-      },
-      cancelButtonColor: {
-        type: String,
-        default: GRAY
-      },
-      showConfirmButton: {
-        type: Boolean,
-        default: true
-      },
-      overlay: {
-        type: Boolean,
-        default: true
-      },
-      transition: {
-        type: String,
-        default: 'scale'
-      }
-    },
-    data() {
-      return {
-        loading: {
-          confirm: false,
-          cancel: false
-        },
-
-        optionsShow: null,
-        optionsTitle: null,
-        optionsWidth: null,
-        optionsTheme: null,
-        optionsMessage: null,
-        optionsZIndex: null,
-        optionsOverlay: null,
-        optionsClassName: null,
-        optionsAsyncClose: null,
-        optionsTransition: null,
-        optionsCustomStyle: null,
-        optionsMessageAlign: null,
-        optionsOverlayStyle: null,
-        optionsConfirmButtonText: null,
-        optionsCancelButtonText: null,
-        optionsShowConfirmButton: null,
-        optionsShowCancelButton: null,
-        optionsCloseOnClickOverlay: null,
-        optionsConfirmButtonOpenType: null
-      }
-    },
-    computed: {
-      popupCustomStyle() {
-        return `width: ${ utils.addUnit(this.optionsWidth) };${ this.optionsCustomStyle }`
-      },
-      headerClass() {
-        return utils.bem('dialog__header', { isolated: !(this.optionsMessage || this.useSlot) })
-      },
-      messageClass() {
-        return utils.bem('dialog__message', [this.optionsTheme, this.optionsMessageAlign, { hasTitle: this.optionsTitle }])
-      }
-    },
-    watch: {
-      show: {
-        handler(val) {
-          this.optionsShow = val
-        },
-        immediate: true
-      },
-      optionsShow: {
-        handler(val) {
-          !val && this.stopLoading()
-        },
-        immediate: true
-      },
-      title: {
-        handler(val) {
-          this.optionsTitle = val
-        },
-        immediate: true
-      },
-      width: {
-        handler(val) {
-          this.optionsWidth = val
-        },
-        immediate: true
-      },
-      theme: {
-        handler(val) {
-          this.optionsTheme = val
-        },
-        immediate: true
-      },
-      message: {
-        handler(val) {
-          this.optionsMessage = val
-        },
-        immediate: true
-      },
-      zIndex: {
-        handler(val) {
-          this.optionsZIndex = val
-        },
-        immediate: true
-      },
-      overlay: {
-        handler(val) {
-          this.optionsOverlay = val
-        },
-        immediate: true
-      },
-      className: {
-        handler(val) {
-          this.optionsClassName = val
-        },
-        immediate: true
-      },
-      asyncClose: {
-        handler(val) {
-          this.optionsAsyncClose = val
-        },
-        immediate: true
-      },
-      transition: {
-        handler(val) {
-          this.optionsTransition = val
-        },
-        immediate: true
-      },
-      customStyle: {
-        handler(val) {
-          this.optionsCustomStyle = val
-        },
-        immediate: true
-      },
-      messageAlign: {
-        handler(val) {
-          this.optionsMessageAlign = val
-        },
-        immediate: true
-      },
-      overlayStyle: {
-        handler(val) {
-          this.optionsOverlayStyle = val
-        },
-        immediate: true
-      },
-      confirmButtonText: {
-        handler(val) {
-          this.optionsConfirmButtonText = val
-        },
-        immediate: true
-      },
-      cancelButtonText: {
-        handler(val) {
-          this.optionsCancelButtonText = val
-        },
-        immediate: true
-      },
-      showConfirmButton: {
-        handler(val) {
-          this.optionsShowConfirmButton = val
-        },
-        immediate: true
-      },
-      showCancelButton: {
-        handler(val) {
-          this.optionsShowCancelButton = val
-        },
-        immediate: true
-      },
-      closeOnClickOverlay: {
-        handler(val) {
-          this.optionsCloseOnClickOverlay = val
-        },
-        immediate: true
-      },
-      confirmButtonOpenType: {
-        handler(val) {
-          this.optionsConfirmButtonOpenType = val
-        },
-        immediate: true
-      }
-    },
-    methods: {
-      onConfirm() {
-        this.handleAction('confirm')
-      },
-
-      onCancel() {
-        this.handleAction('cancel')
-      },
-
-      onClickOverlay() {
-        this.onClose('overlay')
-      },
-
-      handleAction(action) {
-        if (this.optionsAsyncClose) {
-          this.loading[action] = true
-        }
-
-        this.onClose(action)
-      },
-
-      close() {
-        this.optionsShow = false
-        // this.show = false
-        this.$emit('update:show', false)
-      },
-
-      stopLoading() {
-        this.loading = {
-          confirm: false,
-          cancel: false
-        }
-      },
-
-      onClose(action) {
-        if (!this.optionsAsyncClose) {
-          this.close()
-        }
-        this.$emit('close', action)
-
-        // 把 dialog 实例传递出去,可以通过 stopLoading() 在外部关闭按钮的 loading
-        // #ifndef MP-TOUTIAO || MP-ALIPAY
-        this.$emit(action, { dialog: this })
-        // #endif
-        // #ifdef MP-TOUTIAO || MP-ALIPAY
-        this.$emit(action)
-        // #endif
-
-        const callback = this[action === 'confirm' ? 'onConfirmResolve' : 'onCancelReject']
-        if (callback) {
-          callback(this)
-        }
-      }
-    }
-  })
-}
-</script>
-
-<style lang="less">
-@import './index.less';
-</style>

+ 0 - 73
src/ttcomponents/van-divider/README.md

@@ -1,73 +0,0 @@
-# Divider 分割线
-
-### 引入
-
-推荐使用 `easycom` 的方式引入,详细介绍见[快速上手](#/quickstart#easycom-mo-shi-tui-jian)
-
-## 代码演示
-
-### 基础用法
-
-```html
-<van-divider />
-```
-
-### 使用 hairline
-
-```html
-<van-divider hairline />
-```
-
-### 虚线
-
-```html
-<van-divider dashed />
-```
-
-### 文本位置
-
-```html
-<van-divider contentPosition="center">文本</van-divider>
-<van-divider contentPosition="left">文本</van-divider>
-<van-divider contentPosition="right">文本</van-divider>
-```
-
-### 自定义属性
-
-```html
-<van-divider contentPosition="center" textColor="#1989fa">文本颜色</van-divider>
-<van-divider contentPosition="center" borderColor="#1989fa">
-  border 颜色
-</van-divider>
-<van-divider contentPosition="center" fontSize="18">
-  字体大小
-</van-divider>
-```
-
-### 自定义样式
-
-```html
-<van-divider
-  contentPosition="center"
-  customStyle="color: #1989fa; border-color: #1989fa; font-size: 18px;"
->
-  文本
-</van-divider>
-```
-
-## API
-
-### Props
-
-| 参数 | 说明 | 类型 | 默认值 | 版本 |
-| --- | --- | --- | --- | --- |
-| dashed | 虚线 | _boolean_ | false | - |
-| hairline | 细线 | _boolean_ | false | - |
-| content-position | 文本位置,`left` `center` `right` | _string_ | - | - |
-| custom-style | 自定义样式 | _string_ | - | - |
-
-### Slot
-
-| 名称 | 说明           |
-| ---- | -------------- |
-| 默认 | 自定义文本内容 |

+ 0 - 32
src/ttcomponents/van-divider/demo.vue

@@ -1,32 +0,0 @@
-<template>
-  <div>
-    <demo-block custom-class="white" title="基础用法" padding>
-      <van-divider />
-    </demo-block>
-
-    <demo-block custom-class="white" title="内容位置" padding>
-      <van-divider content-position="center">文本</van-divider>
-      <van-divider content-position="left">文本</van-divider>
-      <van-divider content-position="right">文本</van-divider>
-    </demo-block>
-
-    <demo-block custom-class="white" title="虚线" padding>
-      <van-divider dashed />
-    </demo-block>
-
-    <demo-block custom-class="white" title="自定义样式" padding>
-      <van-divider content-position="center" custom-style="color: #1989fa;border-color: #1989fa;font-size: 18px;">文本</van-divider>
-    </demo-block>
-  </div>
-</template>
-
-<script>
-export default {
-}
-</script>
-
-<style>
-page {
-  background-color: white;
-}
-</style>

+ 0 - 66
src/ttcomponents/van-divider/index.less

@@ -1,66 +0,0 @@
-@import '../common/style/var.less';
-@import '../common/style/theme.less';
-
-.van-divider {
-  display: flex;
-  align-items: center;
-  border-style: solid;
-  border-width: 0;
-
-  .theme(margin, '@divider-margin');
-  .theme(color, '@divider-text-color');
-  .theme(font-size, '@divider-font-size');
-  .theme(line-height, '@divider-line-height');
-  .theme(border-color, '@divider-border-color');
-
-  &::before,
-  &::after {
-    display: block;
-    flex: 1;
-    box-sizing: border-box;
-    height: 1px;
-    border-color: inherit;
-    border-style: inherit;
-    border-width: 1px 0 0;
-  }
-
-  &::before {
-    content: '';
-  }
-
-  &--hairline {
-    &::before,
-    &::after {
-      transform: scaleY(0.5);
-    }
-  }
-
-  &--dashed {
-    border-style: dashed;
-  }
-
-  &--center,
-  &--left,
-  &--right {
-    &::before {
-      .theme(margin-right, '@divider-content-padding');
-    }
-
-    &::after {
-      content: '';
-      .theme(margin-left, '@divider-content-padding');
-    }
-  }
-
-  &--left {
-    &::before {
-      .theme(max-width, '@divider-content-left-width');
-    }
-  }
-
-  &--right {
-    &::after {
-      .theme(max-width, '@divider-content-right-width');
-    }
-  }
-}

+ 0 - 51
src/ttcomponents/van-divider/van-divider.vue

@@ -1,51 +0,0 @@
-<template>
-  <view :class="mainClass" :style="mainStyle">
-    <slot />
-  </view>
-</template>
-
-<script>
-import utils from '../wxs/utils'
-import { VantComponent } from '../common/component'
-export default VantComponent({
-  props: {
-    dashed: {
-      type: Boolean,
-      default: false
-    },
-    hairline: {
-      type: Boolean,
-      default: false
-    },
-    contentPosition: {
-      type: String,
-      default: ''
-    },
-    fontSize: {
-      type: [Number, String],
-      default: ''
-    },
-    borderColor: {
-      type: String,
-      default: ''
-    },
-    textColor: {
-      type: String,
-      default: ''
-    }
-  },
-  computed: {
-    mainClass() {
-      const { customClass, dashed, hairline, contentPosition } = this
-      return `custom-class ${customClass} ${ utils.bem('divider', [{dashed, hairline}, contentPosition]) }`
-    },
-    mainStyle() {
-      return `${ this.borderColor  ? 'border-color: ' + this.borderColor + ';' : '' }${ this.textColor ? 'color: ' + this.textColor + ';' : '' }${ this.fontSize ? 'font-size: ' + this.fontSize + 'px;' : '' }${ this.customStyle }`
-    }
-  }
-})
-</script>
-
-<style lang="less">
-@import './index.less';
-</style>

+ 0 - 78
src/ttcomponents/van-empty/README.md

@@ -1,78 +0,0 @@
-# Empty 空状态
-
-### 介绍
-
-空状态时的占位提示
-
-### 引入
-
-推荐使用 `easycom` 的方式引入,详细介绍见[快速上手](#/quickstart#easycom-mo-shi-tui-jian)
-
-## 代码演示
-
-### 基础用法
-
-```html
-<van-empty description="描述文字" />
-```
-
-### 图片类型
-
-Empty 组件内置了多种占位图片类型,可以在不同业务场景下使用
-
-```html
-<!-- 通用错误 -->
-<van-empty image="error" description="描述文字" />
-<!-- 网络错误 -->
-<van-empty image="network" description="描述文字" />
-<!-- 搜索提示 -->
-<van-empty image="search" description="描述文字" />
-```
-
-### 自定义图片
-
-需要自定义图片时,可以在 image 属性中传入任意图片 URL
-
-```html
-<van-empty
-  class="custom-image"
-  image="https://img.yzcdn.cn/vant/custom-empty-image.png"
-  description="描述文字"
-/>
-```
-
-### 底部内容
-
-通过默认插槽可以在 Empty 组件的下方插入内容
-
-```html
-<van-empty description="描述文字">
-  <van-button round type="danger" class="bottom-button">
-    按钮
-  </van-button>
-</van-empty>
-
-<style>
-.bottom-button {
-  width: 160px;
-  height: 40px;
-}
-</style>
-```
-
-## API
-
-### Props
-
-| 参数 | 说明 | 类型 | 默认值 |
-| --- | --- | --- | --- |
-| image | 图片类型,可选值为 `error` `network` `search`,支持传入图片 URL | _string_ | `default` |
-| description | 图片下方的描述文字 | _string_ | - |
-
-### Slots
-
-| 名称        | 说明           |
-| ----------- | -------------- |
-| -           | 自定义底部内容 |
-| image       | 自定义图标     |
-| description | 自定义描述文字 |

+ 0 - 64
src/ttcomponents/van-empty/demo.vue

@@ -1,64 +0,0 @@
-<template>
-  <div>
-    <demo-block title="基础用法" padding>
-      <van-empty description="描述文字" />
-    </demo-block>
-
-    <demo-block title="图片类型">
-      <van-tabs :active="activeTab" @change="onChange">
-        <van-tab title="通用错误">
-          <van-empty image="error" description="描述文字" />
-        </van-tab>
-        <van-tab title="网络错误">
-          <van-empty image="network" description="描述文字" />
-        </van-tab>
-        <van-tab title="搜索提示">
-          <van-empty image="search" description="描述文字" />
-        </van-tab>
-      </van-tabs>
-    </demo-block>
-
-    <demo-block title="自定义图片" padding>
-      <van-empty
-        custom-class="custom-image"
-        image="https://img.yzcdn.cn/vant/custom-empty-image.png"
-        description="描述文字"
-      />
-    </demo-block>
-
-    <demo-block title="底部内容" padding>
-      <van-empty description="描述文字">
-        <van-button round type="danger" custom-class="bottom-button">
-          按钮
-        </van-button>
-      </van-empty>
-    </demo-block>
-  </div>
-</template>
-
-<script>
-export default {
-  data() {
-    return {
-      activeTab: 0
-    }
-  },
-  methods: {
-    onChange(detail) {
-      this.activeTab = detail.index
-    }
-  }
-}
-</script>
-
-<style>
-.custom-image .van-empty__image {
-  width: 90px;
-  height: 90px;
-}
-
-.bottom-button {
-  width: 160px;
-  height: 40px;
-}
-</style>

+ 0 - 49
src/ttcomponents/van-empty/index.less

@@ -1,49 +0,0 @@
-@import '../common/style/var.less';
-@import '../common/style/theme.less';
-
-.van-empty {
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  justify-content: center;
-  box-sizing: border-box;
-  padding: @empty-padding;
-
-  &__image {
-    width: @empty-image-size;
-    height: @empty-image-size;
-
-    &:empty {
-      display: none;
-    }
-
-    &__img {
-      width: 100%;
-      height: 100%;
-    }
-  }
-
-  &__image:not(:empty) + &__image {
-    display: none;
-  }
-
-  &__description {
-    margin-top: @empty-description-margin-top;
-    padding: @empty-description-padding;
-    color: @empty-description-color;
-    font-size: @empty-description-font-size;
-    line-height: @empty-description-line-height;
-
-    &:empty {
-      display: none;
-    }
-  }
-
-  &__description:not(:empty) + &__description {
-    display: none;
-  }
-
-  &__bottom {
-    margin-top: @empty-bottom-margin-top;
-  }
-}

+ 0 - 51
src/ttcomponents/van-empty/van-empty.vue

@@ -1,51 +0,0 @@
-<template>
-  <view class="custom-class van-empty" :class="customClass">
-    <view class="van-empty__image">
-      <slot name="image"></slot>
-    </view>
-    <view class="van-empty__image">
-      <image v-if="imageUrl"
-        class="van-empty__image__img"
-        :src="imageUrl" />
-    </view>
-    <view class="van-empty__description">
-      <slot name="description"></slot>
-    </view>
-    <view class="van-empty__description">
-      {{ description }}
-    </view>
-    <view class="van-empty__bottom">
-      <slot></slot>
-    </view>
-  </view>
-</template>
-
-<script>
-import { VantComponent } from '../common/component'
-const PRESETS = ['error', 'search', 'default', 'network']
-export default VantComponent({
-  props: {
-    description: String,
-    image: {
-      type: String,
-      default: 'default',
-    },
-  },
-  data() {
-    return {
-      imageUrl: ''
-    }
-  },
-  created() {
-    if (PRESETS.indexOf(this.image) !== -1) {
-      this.imageUrl = `https://img.yzcdn.cn/vant/empty-image-${this.image}.png`
-    } else {
-      this.imageUrl = this.image
-    }
-  }
-})
-</script>
-
-<style lang="less">
-@import './index.less';
-</style>

+ 0 - 7
src/ttcomponents/van-goods-action-button/host.less

@@ -1,7 +0,0 @@
-.van-goods-action-button-host() {
-  flex: 1;
-}
-
-.van-goods-action-button-host {
-  .van-goods-action-button-host()
-}

+ 0 - 64
src/ttcomponents/van-goods-action-button/index.less

@@ -1,64 +0,0 @@
-@import '../common/style/var.less';
-@import '../common/style/theme.less';
-@import './host.less';
-
-:host {
-  .van-goods-action-button-host()
-}
-
-.van-goods-action-button {
-  flex: 1;
-  .theme(
-    --button-warning-background-color,
-    '@goods-action-button-warning-color'
-  );
-  .theme(--button-danger-background-color, '@goods-action-button-danger-color');
-  .theme(--button-default-height, '@goods-action-button-height');
-  .theme(--button-line-height, '@goods-action-button-line-height');
-  .theme(--button-plain-background-color, '@goods-action-button-plain-color');
-
-  --button-border-width: 0;
-
-  &--first {
-    margin-left: 5px;
-    // #ifdef MP-WEIXIN
-    button {
-      width: calc(100% - 5px);
-    }
-    // #endif
-    .theme(
-      --button-border-radius,
-      '@goods-action-button-border-radius 0 0 @goods-action-button-border-radius'
-    );
-  }
-
-  &--last {
-    margin-right: 5px;
-    // #ifdef MP-WEIXIN
-    button {
-      width: calc(100% - 5px);
-    }
-    // #endif
-    .theme(
-      --button-border-radius,
-      '0 @goods-action-button-border-radius @goods-action-button-border-radius 0'
-    );
-  }
-
-  &--first&--last {
-    .theme(--button-border-radius, '@goods-action-button-border-radius');
-  }
-
-  &--plain {
-    --button-border-width: @button-border-width;
-  }
-
-  &__inner {
-    width: 100%;
-    .theme(font-weight, '@font-weight-bold') !important;
-  }
-
-  @media (max-width: 321px) {
-    font-size: 13px;
-  }
-}

+ 0 - 110
src/ttcomponents/van-goods-action-button/van-goods-action-button.vue

@@ -1,110 +0,0 @@
-<template>
-  <van-button
-    :id="id"
-    :lang="lang"
-    :type="type"
-    :color="color"
-    :plain="plain"
-    :loading="loading"
-    :disabled="disabled"
-    :open-type="openType"
-    :class="mainClass"
-    :custom-class="`van-goods-action-button__inner ${mainClass}`"
-    :business-id="businessId"
-    :session-from="sessionFrom"
-    :app-parameter="appParameter"
-    :send-message-img="sendMessageImg"
-    :send-message-path="sendMessagePath"
-    :show-message-card="showMessageCard"
-    :send-message-title="sendMessageTitle"
-    @click="onClick"
-    @error="bindError"
-    @contact="bindContact"
-    @opensetting="bindOpenSetting"
-    @getuserinfo="bindGetUserInfo"
-    @getphonenumber="bindGetPhoneNumber"
-    @launchapp="bindLaunchApp"
-  >
-    {{ text }}
-    <slot></slot>
-  </van-button>
-</template>
-
-<script>
-import VanButton from '../van-button/van-button'
-import { VantComponent } from '../common/component'
-import { ChildrenMixin } from '../mixins/relation'
-import { link } from '../mixins/link'
-import { button } from '../mixins/button'
-import { openType } from '../mixins/open-type'
-const utils = require('../wxs/utils')
-export default {
-  name: 'VanGoodsActionButton',
-  components: {
-    VanButton
-  },
-  ...VantComponent({
-    mixins: [link, button, openType, ChildrenMixin('vanGoodsAction')],
-    props: {
-      text: String,
-      color: String,
-      loading: Boolean,
-      disabled: Boolean,
-      plain: Boolean,
-      type: {
-        type: String,
-        default: 'danger'
-      }
-    },
-    data() {
-      return {
-        isFirst: false,
-        isLast: false
-      }
-    },
-    computed: {
-      mainClass() {
-        return utils.bem('goods-action-button', [this.type, { first: this.isFirst, last: this.isLast, plain: this.plain }])
-      },
-    },
-    mounted() {
-      // #ifndef MP-TOUTIAO
-      this.updateStyle()
-      // #endif
-      // #ifdef MP-TOUTIAO
-      this.vanGoodsAction.updateChildren()
-      // #endif
-    },
-    methods: {
-      onClick(event) {
-        this.$emit('click', event)
-        this.jumpLink()
-      },
-
-      updateStyle() {
-        const parent = this.vanGoodsAction
-        if (parent == null) {
-          return
-        }
-
-        let length
-        let index
-        // #ifndef MP-TOUTIAO
-        length = this.parentChildren.length
-        index = this.index
-        // #endif
-        // #ifdef MP-TOUTIAO
-        length = this._getParentChildren().length
-        index = this._getIndex()
-        // #endif
-        this.isFirst = index === 0
-        this.isLast = index === length - 1
-      }
-    }
-  })
-}
-</script>
-
-<style lang="less">
-@import './index.less';
-</style>

+ 0 - 23
src/ttcomponents/van-goods-action-icon/index.less

@@ -1,23 +0,0 @@
-@import '../common/style/var.less';
-@import '../common/style/theme.less';
-
-.van-goods-action-icon {
-  display: flex !important;
-  flex-direction: column;
-  justify-content: center !important;
-  line-height: 1 !important;
-  border: none !important;
-
-  .theme(width, '@goods-action-icon-height') !important;
-  .theme(font-size, '@goods-action-icon-font-size') !important;
-  .theme(color, '@goods-action-icon-text-color') !important;
-  .theme(min-width, '@goods-action-icon-width');
-  .theme(height, '@goods-action-icon-height') !important;
-
-  &__icon {
-    display: flex;
-    margin: 0 auto 5px;
-    .theme(color, '@goods-action-icon-color');
-    .theme(font-size, '@goods-action-icon-size');
-  }
-}

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