gxd-uni-library-editx 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/.editorconfig +14 -0
  2. package/README.md +447 -0
  3. package/index.js +3 -0
  4. package/package.json +104 -0
  5. package/postcss.config.js +22 -0
  6. package/settings.js.tpl +68 -0
  7. package/src/XdAppClass.1.0.js +257 -0
  8. package/src/XdAppClass.js +150 -0
  9. package/src/components/XdAddress/XdAddress.vue +579 -0
  10. package/src/components/XdAddressSelect/XdAddressSelect.vue +243 -0
  11. package/src/components/XdBaiduMap/XdBaiduMap.vue +204 -0
  12. package/src/components/XdBaiduOverlay/XdBaiduOverlay.vue +345 -0
  13. package/src/components/XdBaiduSearch/XdBaiduSearch.vue +354 -0
  14. package/src/components/XdBar/XdBar.vue +339 -0
  15. package/src/components/XdButton/XdButton.vue +288 -0
  16. package/src/components/XdCartList/XdCartList.vue +791 -0
  17. package/src/components/XdCartNoStoreList/XdCartNoStoreList.vue +747 -0
  18. package/src/components/XdCity/XdCity.vue +620 -0
  19. package/src/components/XdCity/city.js +93 -0
  20. package/src/components/XdCity/testData.js +124 -0
  21. package/src/components/XdCityLocation/XdCityLocation.vue +314 -0
  22. package/src/components/XdCityLocation/jweixin.js +72 -0
  23. package/src/components/XdCityShow/XdCityShow.vue +354 -0
  24. package/src/components/XdClipImage/XdClipImage.vue +879 -0
  25. package/src/components/XdCoins/XdCoins.vue +66 -0
  26. package/src/components/XdConfirm/XdConfirm.vue +240 -0
  27. package/src/components/XdContentXss/XdContentXss.vue +71 -0
  28. package/src/components/XdDailog/XdDailog.vue +258 -0
  29. package/src/components/XdDate/XdDataItemOne.vue +236 -0
  30. package/src/components/XdDate/XdDate.vue +1081 -0
  31. package/src/components/XdDate/XdDateItem.vue +316 -0
  32. package/src/components/XdDate/XdDateTime.vue +929 -0
  33. package/src/components/XdDate/i18n/en.json +19 -0
  34. package/src/components/XdDate/i18n/index.js +8 -0
  35. package/src/components/XdDate/i18n/zh-Hans.json +19 -0
  36. package/src/components/XdDate/i18n/zh-Hant.json +19 -0
  37. package/src/components/XdDate/keypress.js +45 -0
  38. package/src/components/XdDate/util.js +418 -0
  39. package/src/components/XdDownDrawer/XdDownDrawer.vue +176 -0
  40. package/src/components/XdEditPwd/XdEditPwd.vue +305 -0
  41. package/src/components/XdEnterOrderList/XdEnterOrderList.vue +413 -0
  42. package/src/components/XdExpressTimeLine/XdExpressTimeLine.vue +280 -0
  43. package/src/components/XdFilter/XdFilter.vue +541 -0
  44. package/src/components/XdFontIcon/XdFontIcon.vue +165 -0
  45. package/src/components/XdFontIcon/css/icon.less +498 -0
  46. package/src/components/XdFooterBar/XdFooterBar.vue +291 -0
  47. package/src/components/XdFooterTabbar/XdFooterTabbar.vue +284 -0
  48. package/src/components/XdForm/XdForm.vue +481 -0
  49. package/src/components/XdForm/validate.js +486 -0
  50. package/src/components/XdFormCheckbox/XdFormCheckbox.vue +858 -0
  51. package/src/components/XdFormDate.vue +187 -0
  52. package/src/components/XdFormInput/XdFormInput.vue +535 -0
  53. package/src/components/XdFormInput/common.js +56 -0
  54. package/src/components/XdFormItem/XdFormItem.vue +583 -0
  55. package/src/components/XdFormSelect/XdFormSelect.vue +119 -0
  56. package/src/components/XdImage/XdImage.vue +113 -0
  57. package/src/components/XdItemCardUser/XdItemCardUser.vue +232 -0
  58. package/src/components/XdItemFilmImage/XdItemFilmImage.vue +146 -0
  59. package/src/components/XdItemFilmText/XdItemFilmText.vue +83 -0
  60. package/src/components/XdItemPhysical/XdItemPhysical.vue +410 -0
  61. package/src/components/XdItemPhysicalPack/XdItemPhysicalPack.vue +240 -0
  62. package/src/components/XdItemStore/XdItemStore.vue +236 -0
  63. package/src/components/XdItemUserInfo/XdItemUserInfo.vue +175 -0
  64. package/src/components/XdJson/XdJson.vue +398 -0
  65. package/src/components/XdKeyValue/XdKeyValue.vue +150 -0
  66. package/src/components/XdLabelNew/XdLabelNew.vue +193 -0
  67. package/src/components/XdLayout/XdLayout.vue +634 -0
  68. package/src/components/XdLoading/XdLoading.vue +165 -0
  69. package/src/components/XdMore/XdMore.vue +66 -0
  70. package/src/components/XdMpHtml/XdMpHtml.vue +458 -0
  71. package/src/components/XdMpHtml/node/node.vue +536 -0
  72. package/src/components/XdMpHtml/parser.js +1260 -0
  73. package/src/components/XdMpHtml/static/js/handler.js +1 -0
  74. package/src/components/XdMpHtml/static/js/uni.webview.min.js +1 -0
  75. package/src/components/XdMpHtml/static/local.html +1 -0
  76. package/src/components/XdMy/XdMy.vue +294 -0
  77. package/src/components/XdMySuccess/XdMySuccess.vue +603 -0
  78. package/src/components/XdNavTab/XdNavTab.vue +147 -0
  79. package/src/components/XdNoData/XdNoData.vue +87 -0
  80. package/src/components/XdNoticeBar/XdNoticeBar.vue +501 -0
  81. package/src/components/XdNumber/XdNumber.vue +210 -0
  82. package/src/components/XdNumberUni/XdNumberUni.vue +270 -0
  83. package/src/components/XdNumberUni/readme.md +42 -0
  84. package/src/components/XdOnlineConfirm/XdOnlineConfirm.vue +385 -0
  85. package/src/components/XdOnlineDetail/XdOnlineDetail.vue +332 -0
  86. package/src/components/XdOnlinePay/XdOnlinePay.vue +349 -0
  87. package/src/components/XdOnlineSchedule/XdOnlineSchedule.vue +453 -0
  88. package/src/components/XdOnlineSeat/XdOnlineSeat.vue +796 -0
  89. package/src/components/XdOnlineSeatMove/XdOnlineSeatMove.vue +1012 -0
  90. package/src/components/XdPayCombo/XdPayCombo.vue +118 -0
  91. package/src/components/XdPreviewImage/XdPreviewImage.vue +372 -0
  92. package/src/components/XdPwPay/XdPwPay.vue +214 -0
  93. package/src/components/XdRadio/XdRadio.vue +151 -0
  94. package/src/components/XdRangeSlider/XdRangeSlider.vue +355 -0
  95. package/src/components/XdRedName/XdRedName.vue +35 -0
  96. package/src/components/XdSearchBar/XdSearchBar.vue +286 -0
  97. package/src/components/XdSelect/XdSelect.vue +382 -0
  98. package/src/components/XdSelectCity/XdSelectCity.vue +270 -0
  99. package/src/components/XdSelectTime/XdSelectTime.vue +342 -0
  100. package/src/components/XdStar/XdStar.vue +261 -0
  101. package/src/components/XdStoreCashier/XdStoreCashier.vue +526 -0
  102. package/src/components/XdStoreItem/XdStoreItem.vue +400 -0
  103. package/src/components/XdStoreOrderDetail/XdStoreOrderDetail.vue +1571 -0
  104. package/src/components/XdStoreOrderList/XdStoreOrderList.vue +450 -0
  105. package/src/components/XdStoreProductInfo/XdStoreProductInfo.vue +940 -0
  106. package/src/components/XdStoreProductType/XdStoreProductType.vue +307 -0
  107. package/src/components/XdSuccess/XdSuccess.vue +527 -0
  108. package/src/components/XdSwipeSelect/XdSwipeSelect.vue +99 -0
  109. package/src/components/XdSwiper/XdSwiper.vue +124 -0
  110. package/src/components/XdSwitch/XdSwitch.vue +204 -0
  111. package/src/components/XdTab/XdTab.vue +220 -0
  112. package/src/components/XdTabScroll/XdTabScroll.vue +212 -0
  113. package/src/components/XdTag/XdTag.vue +423 -0
  114. package/src/components/XdTimeLine/XdTimeLine.vue +121 -0
  115. package/src/components/XdTips/XdTips.vue +212 -0
  116. package/src/components/XdTipsBlock/XdTipsBlock.vue +141 -0
  117. package/src/components/XdTitleSection/XdTitleSection.vue +152 -0
  118. package/src/components/XdTitleTab/XdTitleTab.vue +227 -0
  119. package/src/components/XdUnit/XdUnit.vue +206 -0
  120. package/src/components/XdUpload/XdUpload.vue +197 -0
  121. package/src/components/XdUploadImage/XdUploadImage.vue +145 -0
  122. package/src/components/Xdlogs/XdLogs.vue +144 -0
  123. package/src/components/autoload.js +211 -0
  124. package/src/components/swipeAction/UniSwipeAction.vue +43 -0
  125. package/src/components/swipeActionItem/UniSwipeActionItem.vue +386 -0
  126. package/src/components/swipeActionItem/bindingx.js +298 -0
  127. package/src/components/swipeActionItem/index.wxs +321 -0
  128. package/src/components/swipeActionItem/isPC.js +18 -0
  129. package/src/components/swipeActionItem/mpalipay.js +210 -0
  130. package/src/components/swipeActionItem/mpother.js +252 -0
  131. package/src/components/swipeActionItem/mpwxs.js +140 -0
  132. package/src/dome/dome/address.vue +415 -0
  133. package/src/dome/dome/auth/login.vue +166 -0
  134. package/src/dome/dome/baidu_show.vue +20 -0
  135. package/src/dome/dome/cake.vue +186 -0
  136. package/src/dome/dome/cart.vue +205 -0
  137. package/src/dome/dome/cart_store.vue +149 -0
  138. package/src/dome/dome/cashier/cashier.vue +73 -0
  139. package/src/dome/dome/cashier/check_cashier.vue +469 -0
  140. package/src/dome/dome/cashier/success.vue +127 -0
  141. package/src/dome/dome/city.vue +148 -0
  142. package/src/dome/dome/cityData.js +9 -0
  143. package/src/dome/dome/clip.vue +82 -0
  144. package/src/dome/dome/date/date.vue +273 -0
  145. package/src/dome/dome/date/selected.js +315 -0
  146. package/src/dome/dome/dcom/app1.vue +13 -0
  147. package/src/dome/dome/dcom/app2.vue +13 -0
  148. package/src/dome/dome/dcom/app3.vue +13 -0
  149. package/src/dome/dome/dcom/app4.vue +13 -0
  150. package/src/dome/dome/dcom/app5.vue +13 -0
  151. package/src/dome/dome/dcom/index.vue +1 -0
  152. package/src/dome/dome/debug/debug.vue +95 -0
  153. package/src/dome/dome/docache/docache.vue +88 -0
  154. package/src/dome/dome/express.vue +269 -0
  155. package/src/dome/dome/form.vue +312 -0
  156. package/src/dome/dome/icon.js +125 -0
  157. package/src/dome/dome/icon.vue +93 -0
  158. package/src/dome/dome/index.vue +725 -0
  159. package/src/dome/dome/item.vue +236 -0
  160. package/src/dome/dome/json/json.vue +88 -0
  161. package/src/dome/dome/layout.vue +105 -0
  162. package/src/dome/dome/line.vue +113 -0
  163. package/src/dome/dome/map/search.vue +70 -0
  164. package/src/dome/dome/my.vue +171 -0
  165. package/src/dome/dome/notice.vue +93 -0
  166. package/src/dome/dome/online/confirm.vue +92 -0
  167. package/src/dome/dome/online/detail.vue +80 -0
  168. package/src/dome/dome/online/pay.vue +78 -0
  169. package/src/dome/dome/online/schedule.vue +73 -0
  170. package/src/dome/dome/online/seat.vue +98 -0
  171. package/src/dome/dome/order/detail.vue +166 -0
  172. package/src/dome/dome/order/enter_order.vue +294 -0
  173. package/src/dome/dome/order/list.vue +219 -0
  174. package/src/dome/dome/order/order.js +18 -0
  175. package/src/dome/dome/order/success.vue +68 -0
  176. package/src/dome/dome/product.vue +179 -0
  177. package/src/dome/dome/store_cashier.vue +67 -0
  178. package/src/dome/dome/swiper.vue +32 -0
  179. package/src/dome/dome/webview.vue +61 -0
  180. package/src/install.js +183 -0
  181. package/src/main/address/address.vue +251 -0
  182. package/src/main/cart/cart.vue +149 -0
  183. package/src/main/cashier/cashier.vue +72 -0
  184. package/src/main/cashier/check_cashier.vue +483 -0
  185. package/src/main/city/city.vue +149 -0
  186. package/src/main/date/date.vue +260 -0
  187. package/src/main/order/order.js +19 -0
  188. package/src/main/order/order.vue +222 -0
  189. package/src/main/product/detail.vue +121 -0
  190. package/src/main/product/type.vue +108 -0
  191. package/src/main/search/search.vue +501 -0
  192. package/src/pages.json +337 -0
  193. package/src/plugins/CreatedComponentsPlugin.js +19 -0
  194. package/src/plugins/JsonRename.js +72 -0
  195. package/src/plugins/SetAppParams.js +171 -0
  196. package/src/project.js +18 -0
  197. package/src/utils/Cookie.js +68 -0
  198. package/src/utils/Runtime.js +105 -0
  199. package/src/utils/Storage.js +104 -0
  200. package/src/utils/XdNetwork.js +133 -0
  201. package/src/utils/helper.js +1321 -0
  202. package/src/utils/nourl.js +95 -0
  203. package/src/utils/project.js +17 -0
  204. package/src/utils/xd.auth.js +61 -0
  205. package/src/utils/xd.base.js +474 -0
  206. package/src/utils/xd.common.js +240 -0
  207. package/src/utils/xd.event.js +99 -0
  208. package/src/utils/xd.frame.js +96 -0
  209. package/src/utils/xd.path.js +96 -0
  210. package/src/utils/xdAppLog.js +170 -0
  211. package/src/utils/xdWxLog.js +302 -0
  212. package/src/utils/xdh5log.js +307 -0
  213. package/src/websetting.js +64 -0
  214. package/tsconfig.json +9 -0
  215. package/xd.less +180 -0
@@ -0,0 +1,151 @@
1
+ <template>
2
+ <view class="xd-radio" @click="handleClick">
3
+ <view
4
+ :class="'xd-radio__' + size"
5
+ v-if="!$isIpad"
6
+ >
7
+ <radio
8
+ :checked="checked"
9
+ :disabled="disabled"
10
+ :color="uiColor"
11
+ :class="'xd-radio__' + size + '-body'"
12
+ ></radio>
13
+ </view>
14
+ <view class="xd-radio__ipad" v-else>
15
+ <radio
16
+ :checked="checked"
17
+ :disabled="disabled"
18
+ :color="uiColor"
19
+ ></radio>
20
+ </view>
21
+ </view>
22
+ </template>
23
+
24
+ <script>
25
+ import {
26
+ getParentsStyle, //获取页面风格单个键值值
27
+ getParentsStyles //获取页面风格列表
28
+ } from '@/utils/xd.base';
29
+ export default {
30
+ name: "XdRadio",
31
+ props: {
32
+ size: {
33
+ type: String,
34
+ default: 'default' , //small mini default
35
+ },
36
+ value: {
37
+ type: Boolean,
38
+ default: false
39
+ },
40
+ disabled: {
41
+ type: Boolean,
42
+ default: false
43
+ },
44
+ color: {
45
+ type: String,
46
+ default: ''
47
+ }
48
+ },
49
+ data(){
50
+ return {
51
+ uiColor: '',
52
+ checked: false,
53
+ }
54
+ },
55
+ watch:{
56
+ value(val){
57
+ this.checked = val;
58
+ },
59
+ },
60
+ async created() {
61
+ this.uiColor = await getParentsStyle(this.$parent, '$mainColor');
62
+ if(this.color) this.uiColor = this.color;
63
+ this.checked = this.value;
64
+ },
65
+ methods:{
66
+ handleClick(){
67
+ if(this.disabled) return;
68
+ this.checked = !this.checked;
69
+ this.$emit('input',this.checked);
70
+ this.$emit('change', this.checked);
71
+ }
72
+ }
73
+ }
74
+ </script>
75
+
76
+ <style scoped lang="less">
77
+ .xd-radio {
78
+ display: flex;
79
+ justify-content: center;
80
+ align-items: center;
81
+
82
+ &__default {
83
+ position: relative;
84
+ overflow: hidden;
85
+ height: unit(60, rpx);
86
+ width: unit(60, rpx);
87
+
88
+ &-body {
89
+ width: 100%;
90
+ height: 100%;
91
+ position: absolute;
92
+ transform: scale(1);
93
+ top: 0;
94
+ left: 0;
95
+ display: flex;
96
+ justify-content: center;
97
+ align-items: center;
98
+
99
+ /deep/ .uni-radio-input {
100
+ margin-right: 0;
101
+ }
102
+ }
103
+ }
104
+
105
+ &__small {
106
+ position: relative;
107
+ overflow: hidden;
108
+ height: unit(36, rpx);
109
+ width: unit(36, rpx);
110
+
111
+ &-body {
112
+ width: 100%;
113
+ height: 100%;
114
+ position: absolute;
115
+ transform: scale(0.6);
116
+ top: 0;
117
+ left: 0;
118
+ display: flex;
119
+ justify-content: center;
120
+ align-items: center;
121
+
122
+ /deep/ .uni-radio-input {
123
+ margin-right: 0;
124
+ }
125
+ }
126
+ }
127
+
128
+ &__mini {
129
+ position: relative;
130
+ overflow: hidden;
131
+ height: unit(50, rpx);
132
+ width: unit(50, rpx);
133
+
134
+ &-body {
135
+ width: 100%;
136
+ height: 100%;
137
+ position: absolute;
138
+ transform: scale(0.8);
139
+ top: 0;
140
+ left: 0;
141
+ display: flex;
142
+ justify-content: center;
143
+ align-items: center;
144
+
145
+ /deep/ .uni-radio-input {
146
+ margin-right: 0;
147
+ }
148
+ }
149
+ }
150
+ }
151
+ </style>
@@ -0,0 +1,355 @@
1
+ <template>
2
+ <view class="fj-slider-box" :style="{opacity:lading?1:0}">
3
+ <view class="fj-slider">
4
+ <view class="fj-value">
5
+ <view class="fj-v-l">{{sMinValue}}</view>
6
+ <view class="fj-v-r">{{sMaxValue}}</view>
7
+ </view>
8
+ <view
9
+ class="fj-touch-left"
10
+ @touchstart.stop="touchstart($event, 'min')"
11
+ @touchmove.stop="touchmove($event, 'min')"
12
+ @touchend.stop="touchend($event, 'min')"
13
+ :style="{
14
+ left:`${minLeft}px`,
15
+ background: $mainColor
16
+ }"
17
+ ></view>
18
+ <view
19
+ class="fj-touch-right"
20
+ @touchstart.stop="touchstart($event, 'max')"
21
+ @touchmove.stop="touchmove($event, 'max')"
22
+ @touchend.stop="touchend($event, 'max')"
23
+ :style="{
24
+ left:`${maxLeft}px`,
25
+ background: $mainColor
26
+ }"
27
+ ></view>
28
+ <view
29
+ class="tip"
30
+ :style="{
31
+ left:`${tipLeft}px`,
32
+ transform: `translateX(${(type === 'min'?'-': '')}24%)`,
33
+ display: tipShow ? 'block' : 'none'
34
+ }"
35
+ >{{curValue + fillMinValue}}
36
+ </view>
37
+ <view
38
+ class="fj-line-pull"
39
+ :style="{
40
+ left: `${minLeft + touchWidth}px`,
41
+ width:`${maxLeft - (minLeft + touchWidth)}px`,
42
+ background: $mainColor
43
+ }"
44
+ ></view>
45
+ <view class="fj-line" id="fj-line">
46
+ <view v-if="lading" class="fj-line-left-b" style="left: -30rpx"></view>
47
+ <view v-if="lading" class="fj-line-right-b" style="right: -30rpx"></view>
48
+ </view>
49
+ </view>
50
+ </view>
51
+ </template>
52
+
53
+
54
+ <script type="javascript">
55
+
56
+ /**
57
+ * XdRangeSlider 范围滑动选中值
58
+ * @description 带加减按钮的数字输入框
59
+ * @property {Number} fillValue 填充的值
60
+ * @property {Number} fillMaxValue 填充的最大值
61
+ * @property {Number} fillMinValue 填充的最小值
62
+ * @property {Number} minValue 选中最小值
63
+ * @property {Number} maxValue 选中最大值
64
+ * @property {Number} step 每次滑动1%对应的增加减少的间隔值
65
+ * @event {Function} start 触发touchstart方法 返回了原有的event信息, 并添加了custom对象
66
+ * @event {Function} move 触发touchmove方法 返回了原有的event信息, 并添加了custom对象
67
+ * @event {Function} end 触发touchend方法 返回了原有的event信息, 并添加了custom对象 获取值
68
+ */
69
+
70
+ export default {
71
+ name:'XdRangeSlider',
72
+ props: {
73
+ fillMaxValue: {
74
+ type: Number,
75
+ default: 1000,
76
+ },
77
+ fillMinValue: {
78
+ type: Number,
79
+ default: 18,
80
+ },
81
+ minValue: {
82
+ type: Number,
83
+ default: 30,
84
+ },
85
+ maxValue: {
86
+ type: Number,
87
+ default: 888,
88
+ },
89
+ step: {
90
+ type: Number,
91
+ default: 1,
92
+ },
93
+ },
94
+ watch: {
95
+ minValue(newVal){
96
+ this.sMinValue = (newVal < this.fillMinValue ? this.fillMinValue: newVal);
97
+ this.minLeft = this.sMinValue / this.percentage;
98
+ },
99
+ maxValue(newVal){
100
+ this.sMaxValue = (newVal > this.fillMaxValue ? this.fillMaxValue : newVal);
101
+ this.maxLeft = this.sMaxValue / this.percentage;
102
+ }
103
+ },
104
+ data() {
105
+ return {
106
+ type: null,
107
+ lading: false,
108
+ fillValue: null, //区间之间最大值
109
+ fillLeftMarginValue: null, //区间距离左边距占比
110
+ tipShow:false, //显示提示框
111
+ tipLeft:0, //提示框距离左侧距离
112
+
113
+ minLeft: 0, //左滑动块距离左侧距离
114
+ maxLeft: 0, //右滑动块距离左侧距离
115
+
116
+ touchWidth:50, //点击图表宽度
117
+
118
+ lineWidth:0, //线宽度
119
+ lineLeft:0, //线距离左边框的距离
120
+
121
+ curValue:0, //当前选中值
122
+ sMinValue:0, //对应范围最小值
123
+ sMaxValue:0, //对应范围最大值
124
+ percentage: 0, //百分百比重
125
+ movedisX: 0,
126
+
127
+ };
128
+ },
129
+
130
+
131
+ mounted(){
132
+ setTimeout(()=>{
133
+ this.fillValue = this.fillMaxValue - this.fillMinValue;
134
+ this.touchWidth = this.touchWidth * this.$rpxNum;
135
+ this.$xdUniHelper.getWindowHeight(['#fj-line'], this)
136
+ .then((res) => {
137
+ //fj-line
138
+ let line = res['#fj-line'];
139
+ this.lineWidth = line.width;
140
+ this.lineLeft = line.left;
141
+ this.maxLeft = this.lineWidth;
142
+ this.percentage = this.fillValue / this.lineWidth;
143
+
144
+ //输入选中值边界处理
145
+ this.sMinValue = this.minValue < this.fillMinValue ? this.fillMinValue : this.minValue;
146
+ this.sMaxValue = this.maxValue > this.fillMaxValue ? this.fillMaxValue : this.maxValue;
147
+
148
+ this.minLeft = (this.sMinValue - this.fillMinValue) / this.percentage;
149
+ this.maxLeft = (this.sMaxValue - this.fillMinValue) / this.percentage + this.touchWidth;
150
+ this.lading = true
151
+ }).catch()
152
+ }, 500)
153
+
154
+ },
155
+
156
+ methods: {
157
+ touchstart(e, type) {
158
+ this.type = type;
159
+ this.$emit('start', {
160
+ ...e,
161
+ custom:{
162
+ type,
163
+ minValue: this.sMinValue,
164
+ maxValue: this.sMaxValue
165
+ }
166
+ })
167
+ },
168
+ touchmove(e, type) {
169
+ const disX = this.movedisX = e.touches[0].clientX - this.lineLeft;
170
+
171
+ //左滑块
172
+ if(type === 'min'){
173
+ this.minLeft = Math.floor(disX);
174
+ //计算相关数值
175
+ if(this.minCount()) return;
176
+ }
177
+
178
+ //右滑块
179
+ if(type === 'max'){
180
+ this.maxLeft = Math.ceil(disX);
181
+ //计算相关数值
182
+ if(this.maxCount()) return;
183
+ }
184
+
185
+ this.tipShow = true;
186
+ this.tipLeft = Math[type === 'min' ? 'floor': 'ceil'](this.curValue / this.percentage);
187
+
188
+
189
+
190
+ this.$emit('move', {
191
+ ...e,
192
+ custom:{
193
+ type,
194
+ minValue: this.sMinValue,
195
+ maxValue: this.sMaxValue,
196
+ curValue: this.curValue,
197
+ }
198
+ })
199
+ },
200
+ touchend(e, type) {
201
+ console.log(e,'dadsadweweqw')
202
+ //const disX = e.changedTouches[0].clientX - this.lineLeft;
203
+ const disX = this.movedisX;
204
+ if(type === 'min') {
205
+ this.minCount(); //计算相关数值
206
+
207
+ /**
208
+ * @description 计算对应的最小值
209
+ */
210
+ const stepnum = Math.floor(((this.minLeft) * this.percentage) / this.step);
211
+ this.sMinValue = stepnum * this.step + this.fillMinValue;
212
+
213
+ }
214
+
215
+ //右滑块
216
+ if(type === 'max') {
217
+ this.maxLeft = Math.ceil(disX);
218
+ this.maxCount(); //计算相关数值
219
+ this.tipShow = true;
220
+ this.tipLeft = Math.ceil(this.curValue / this.percentage);
221
+
222
+ /**
223
+ * @description 计算对应的最大值
224
+ */
225
+ const stepnum = Math.ceil(((this.maxLeft - this.touchWidth) * this.percentage) / this.step);
226
+ let sMaxValue = stepnum * this.step;
227
+ if (this.fillValue - sMaxValue < this.step) {
228
+ sMaxValue = this.fillValue
229
+ }
230
+ this.sMaxValue = sMaxValue + this.fillMinValue;
231
+ }
232
+
233
+ this.tipShow = false;
234
+
235
+ let value = [this.sMinValue, this.sMaxValue];
236
+ this.$emit('end', {
237
+ ...e,
238
+ value: value,
239
+ custom:{
240
+ type,
241
+ minValue: this.sMinValue,
242
+ maxValue: this.sMaxValue
243
+ }
244
+ });
245
+
246
+ this.$emit('input', value);
247
+ },
248
+
249
+ /**
250
+ * @description 左滑块计算位置
251
+ */
252
+ minCount() {
253
+ if (this.minLeft < 0) {
254
+ this.minLeft = 0;
255
+ this.curValue = Math.floor(this.minLeft * this.percentage);
256
+ return true;
257
+ }
258
+ if (this.maxLeft - this.minLeft <= this.touchWidth) {
259
+ this.minLeft = this.maxLeft - this.touchWidth;
260
+ this.curValue = Math.floor(this.minLeft * this.percentage);
261
+ return true;
262
+ }
263
+ this.curValue = Math.floor(this.minLeft * this.percentage);
264
+ return false
265
+ },
266
+
267
+ /**
268
+ * @description 右滑块计算位置
269
+ */
270
+ maxCount(){
271
+ //右滑块滑到右边界
272
+ if (this.maxLeft > (this.lineWidth + this.touchWidth)) {
273
+ this.maxLeft = this.lineWidth + this.touchWidth;
274
+ this.curValue = Math.ceil((this.maxLeft - this.touchWidth) * this.percentage);
275
+ return true;
276
+ }
277
+
278
+ //右滑块滑到左边界
279
+ if (this.maxLeft - this.minLeft <= this.touchWidth) {
280
+ this.maxLeft = this.minLeft + this.touchWidth;
281
+ this.curValue = Math.ceil((this.maxLeft - this.touchWidth) * this.percentage);
282
+ return true;
283
+ }
284
+ this.curValue = Math.ceil((this.maxLeft - this.touchWidth) * this.percentage);
285
+ return false
286
+ }
287
+ },
288
+ };
289
+ </script>
290
+
291
+
292
+ <style lang="scss" scoped>
293
+ $touchWidth: 50rpx; /** circle的宽度 */
294
+ view {
295
+ box-sizing: border-box;
296
+ }
297
+ .fj-slider-box{
298
+ padding-top:40rpx;
299
+
300
+
301
+ .fj-v-l,.fj-v-r{position: absolute;font-size: 24rpx;top:-40rpx;}
302
+ .fj-v-l{left:0}
303
+ .fj-v-r{right:0}
304
+ }
305
+ .fj-slider {
306
+ position: relative;
307
+ height: $touchWidth;
308
+ .fj-touch-left,
309
+ .fj-touch-right {
310
+ opacity: 1;
311
+ position: absolute;
312
+ height: $touchWidth;
313
+ width: $touchWidth;
314
+ border-radius: 25rpx;
315
+ z-index: 201;
316
+ }
317
+ .tip{
318
+ display: block;
319
+ position: absolute;
320
+ padding:10rpx 20rpx;
321
+ background: rgba(0,0,0,0.6);
322
+ color:#fff;
323
+ top:-80rpx;
324
+ border-radius: 10rpx;
325
+ min-width:100rpx;
326
+ text-align: center;
327
+ }
328
+
329
+ .fj-line ,.fj-line-pull {
330
+ height: 6rpx;
331
+ background: #999;
332
+ margin-top: -5rpx;
333
+ position: absolute;
334
+ top: 50%;
335
+ left: $touchWidth;
336
+ right: $touchWidth;
337
+ z-index:200;
338
+ }
339
+ .fj-line-pull{
340
+ z-index: 202;
341
+ }
342
+
343
+ .fj-line-left-b, .fj-line-right-b {
344
+ height: 100%;
345
+ background: #999;
346
+ position: absolute;
347
+ top: 0;
348
+ width: 100rpx;
349
+ }
350
+ }
351
+ </style>
352
+
353
+
354
+
355
+
@@ -0,0 +1,35 @@
1
+ <template>
2
+ <view
3
+ class="user-red-name"
4
+ :style="{
5
+ fontSize: size + 'rpx',
6
+ fontWeight: weight,
7
+ color: isVip ? 'red': '#333'
8
+ }"
9
+ >
10
+ <slot>用户名称</slot>
11
+ </view>
12
+ </template>
13
+
14
+ <script>
15
+ export default {
16
+ name: "XdRedName",
17
+ props: {
18
+ size: {
19
+ type: String | Number, //rpx
20
+ default: 32
21
+ },
22
+ weight: {
23
+ type: String,
24
+ default: 'normal', //bold,normal, 1xx;
25
+ },
26
+ isVip: {
27
+ type: Boolean,
28
+ default: false
29
+ }
30
+ }
31
+ }
32
+ </script>
33
+
34
+ <style scoped lang="less">
35
+ </style>