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,66 @@
1
+ <template>
2
+ <view class="xd-coins" @click="handleClick" :style="getStyle">
3
+ <view class="xd-coins__bg"></view>
4
+ </view>
5
+ </template>
6
+
7
+ <script>
8
+
9
+ /**
10
+ * XdCoins 全局Ui
11
+ * @description 元宝ui
12
+ * @tutorial
13
+ * @property {Number} size 元宝被放大倍数,值为0.1 - 1.5 之间, 默认值为0.5
14
+ * @event {Function} click|tap 点击元宝事件
15
+ */
16
+
17
+ export default {
18
+ name: "XdCoins",
19
+ props:{
20
+ /**
21
+ * @description 放大倍数 0.1 - 2 直接
22
+ * @type number
23
+ */
24
+ size: {
25
+ type: Number|String,
26
+ default: 0.5,
27
+ }
28
+ },
29
+ data(){
30
+ return {
31
+ height: 92,
32
+ width: 120
33
+ }
34
+ },
35
+ computed:{
36
+ getStyle(){
37
+ let size = this.size;
38
+ if (this.$xdUniHelper.checkVarType(size) === 'string') {
39
+ try {
40
+ size = Number(size);
41
+ }catch (e) {
42
+ size = 1;
43
+ }
44
+ }
45
+ if (size < 0.1) size = 0.1;
46
+ if (size > 1.5) size = 1.5;
47
+ return `height:${this.height * size}rpx; width: ${this.width * size}rpx;`;
48
+ }
49
+ },
50
+ methods:{
51
+ handleClick(e){
52
+ this.$emit('click',e);
53
+ this.$emit('tap', e);
54
+ }
55
+ }
56
+ }
57
+ </script>
58
+
59
+ <style scoped lang="less">
60
+ .xd-coins__bg {
61
+ width: 100%;
62
+ height: 100%;
63
+ background: url(@xd-coins-unit) no-repeat top left;
64
+ background-size: 100% 100%;
65
+ }
66
+ </style>
@@ -0,0 +1,240 @@
1
+ <template>
2
+ <view class="xd-input-confirm" @touchmove.stop.prevent :style="{zIndex:confirm.zIndex}" v-if="show">
3
+ <view class="xd-input-confirm__mask"></view>
4
+ <view
5
+ class="xd-input-confirm__body"
6
+ :style="{
7
+ borderRadius: confirm.radius,
8
+ width: confirm.width
9
+ }"
10
+ >
11
+ <view class="xd-input-confirm__body-close" v-if="confirm.showClose">
12
+ <xd-font-icon @click="close" icon="icondanchuangguanbi_xian" size="32"></xd-font-icon>
13
+ </view>
14
+ <view class="xd-input-confirm__body-title" v-if="confirm.isTitle">{{confirm.title}}</view>
15
+ <view class="xd-input-confirm__body-title" v-else></view>
16
+ <view
17
+ class="xd-input-confirm__body-content"
18
+ v-if="confirm.isHtml"
19
+ :style="{color: confirm.contentColor}"
20
+ >
21
+ <xd-content-xss :html="confirm.content"></xd-content-xss>
22
+ </view>
23
+ <view
24
+ v-else
25
+ class="xd-input-confirm__body-content"
26
+ :style="{color: confirm.contentColor}"
27
+ >
28
+ <slot>{{confirm.content}}</slot>
29
+ </view>
30
+ <view class="xd-input-confirm__body-btn">
31
+ <view>
32
+ <xd-button
33
+ v-if="confirm.cancel"
34
+ @click="handleConfirm('cancel')"
35
+ :type="confirm.cancelColorType"
36
+ size="medium"
37
+ :radius="confirm.btnRadius"
38
+ >{{confirm.cancelText}}
39
+ </xd-button>
40
+ </view>
41
+ <view>
42
+ <xd-button
43
+ @click="handleConfirm('confirm')"
44
+ v-if="confirm.confirm"
45
+ :type="confirm.confirmColorType"
46
+ size="medium"
47
+ :radius="confirm.btnRadius"
48
+ >{{confirm.confirmText}}
49
+ </xd-button>
50
+ </view>
51
+ </view>
52
+ </view>
53
+ </view>
54
+ </template>
55
+
56
+ <script>
57
+ import XdButton from "@/components/XdButton/XdButton";
58
+ import {mapState, mapMutations} from 'vuex';
59
+ import XdContentXss from "@/components/XdContentXss/XdContentXss";
60
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
61
+
62
+ export default {
63
+ name: "XdConfirm",
64
+ components: {
65
+ XdFontIcon,
66
+ XdContentXss,
67
+ XdButton
68
+ },
69
+ computed: {
70
+ ...mapState([
71
+ 'xdInputConfirm'
72
+ ])
73
+ },
74
+ data() {
75
+ return {
76
+ show: false,
77
+
78
+ /**
79
+ * @description 确认框(confirm)
80
+ * @type {Object}
81
+ * @property confirm.width {string} 确认框宽度 默认:65%
82
+ * @property confirm.title {string} 标题 默认:标题
83
+ * @property confirm.showClose {string} 是否显示关闭按钮 默认:标题
84
+ * @property confirm.isTitle 是否启用标题 默认:不启用
85
+ * @property confirm.zIndex {number} 样式层级关系 默认:2000
86
+ * @property confirm.content {string|Element} html 只支持原生元素(请不要使用小程序相关元素组件,有兼容问题),例如:<div style="color: green">html test</div>
87
+ * @property confirm.contentColor {string} 文本颜色 默认:#333
88
+ * @property confirm.isHtml {boolean} 是否支持html 默认:false
89
+ * @property confirm.cancel {boolean} 是否显示取消按钮 默认:true
90
+ * @property confirm.cancelText {string} 取消文本 默认:取消
91
+ * @property confirm.cancelColorType {string} 按钮样式(primary,default,subPrimary,danger,info,warning,success) 默认:default
92
+ * @property confirm.confirm {boolean} 是否显示确认按钮 默认:true
93
+ * @property confirm.confirmText {string} 确认文本 默认:确认
94
+ * @property confirm.confirmColorType {string} 确认按钮样式(primary,default,subPrimary,danger,info,warning,success) 默认:primary
95
+ * @property confirm.radius {string} 边框圆角 默认:确认10rpx
96
+ * @property confirm.btnRadius {string} 按钮边框圆角 默认:确认10rpx
97
+ * @property confirm.success {function} 按钮回调事件
98
+ * @property confirm.onClose {function} 关闭事件
99
+ */
100
+ confirm: {},
101
+
102
+ defaultConfirm: {
103
+ width: '640rpx',
104
+ showClose: true,
105
+ onClose: null,
106
+ zIndex: 1400,
107
+ title: '温馨提示',
108
+ isTitle: true,
109
+ content: '',
110
+ contentColor: '#333',
111
+ isHtml: false,
112
+ cancel: true,
113
+ cancelText: '取消',
114
+ cancelColorType: 'info',
115
+ confirm: true,
116
+ confirmText: '确认',
117
+ confirmColorType: 'primary',
118
+ radius: '10rpx',
119
+ btnRadius: '',
120
+ }
121
+ }
122
+ },
123
+ watch: {
124
+ xdInputConfirm(value) {
125
+ this.init(value);
126
+ }
127
+ },
128
+ created() {
129
+ this.init(this.xdInputConfirm);
130
+ },
131
+ methods: {
132
+ ...mapMutations(['setXdInputConfirm']),
133
+
134
+ init(value){
135
+ //只有当前访问页面触发逻辑
136
+ if (this.$root.$isShow === false) {
137
+ return;
138
+ }
139
+ if (value === null) {
140
+ this.show = false;
141
+ this.confirm = {}
142
+ } else {
143
+ this.confirm= Object.assign({},
144
+ this.$xdUniHelper.cloneDeep(this.defaultConfirm),
145
+ value,
146
+ );
147
+ console.log('xdInputConfirm', this.confirm);
148
+ this.show = true;
149
+ }
150
+ },
151
+
152
+ handleConfirm(status) {
153
+ if (typeof this.confirm.success === 'function') {
154
+ let params = {};
155
+ params[status] = true;
156
+ this.confirm.success(params);
157
+ this.close();
158
+ } else {
159
+ this.close();
160
+ }
161
+ },
162
+
163
+ close() {
164
+ this.setXdInputConfirm(null);
165
+ if (typeof this.confirm.onClose === 'function') {
166
+ this.onClose()
167
+ }
168
+ },
169
+ }
170
+ }
171
+ </script>
172
+
173
+ <style scoped lang="less">
174
+ .xd-input-confirm {
175
+ position: fixed;
176
+ top: 0;
177
+ bottom: 0;
178
+ left: 0;
179
+ right: 0;
180
+
181
+ &__mask {
182
+ position: absolute;
183
+ top: 0;
184
+ bottom: 0;
185
+ left: 0;
186
+ right: 0;
187
+ background: rgba(0, 0, 0, .5);
188
+ }
189
+
190
+ &__body {
191
+ position: absolute;
192
+ top: 50%;
193
+ left: 50%;
194
+ transform: translate(-50%, -50%);
195
+ background: #fff;
196
+ overflow: hidden;
197
+ padding: unit(30,rpx);
198
+ box-sizing: border-box;
199
+
200
+ &-title {
201
+ padding: 0 unit(30, rpx);
202
+ font-size: unit(40, rpx);
203
+ line-height: unit(120, rpx);
204
+ text-align: center;
205
+ color: #000;
206
+ min-height: unit(50, rpx);
207
+ }
208
+
209
+ &-close {
210
+ position: absolute;
211
+ top: unit(30, rpx);
212
+ right: unit(30, rpx);
213
+ font-size: @xd-font-size-lg;
214
+ font-weight: normal;
215
+ width: unit(40, rpx);
216
+ height: unit(40, rpx);
217
+ color: #ccc;
218
+ }
219
+
220
+ &-content {
221
+ padding: unit(22, rpx) unit(30, rpx) unit(60, rpx);
222
+ text-align: center;
223
+ font-size: unit(34, rpx);
224
+ line-height: unit(52, rpx);
225
+ color: #595656;
226
+ }
227
+
228
+ &-btn {
229
+ display: flex;
230
+ justify-content: center;
231
+ align-items: center;
232
+ padding-bottom: unit(30, rpx);
233
+
234
+ & > view {
235
+ padding: 0 unit(20, rpx);
236
+ }
237
+ }
238
+ }
239
+ }
240
+ </style>
@@ -0,0 +1,71 @@
1
+ <template>
2
+ <!-- #ifdef MP-WEIXIN -->
3
+ <view class="xd-content-xss" v-if="vhtml" v-html="vhtml"></view>
4
+ <!-- #endif -->
5
+ <!-- #ifdef H5 -->
6
+ <view class="xd-content-xss" v-if="vhtml" v-html="vhtml"></view>
7
+ <!-- #endif -->
8
+ <!-- #ifndef MP-WEIXIN || H5 -->
9
+ <xd-mp-html v-if="vhtml" :content="vhtml"></xd-mp-html>
10
+ <!-- #endif -->
11
+ </template>
12
+
13
+ <script>
14
+ // #ifdef H5
15
+ import DOMPurify from 'dompurify';
16
+ // #endif
17
+ import XdMpHtml from "@/components/XdMpHtml/XdMpHtml";
18
+
19
+ export default {
20
+ name: "XdContentXss",
21
+ components: {
22
+ XdMpHtml
23
+ },
24
+ props: {
25
+ html: {
26
+ type: String | null,
27
+ default: null
28
+ }
29
+ },
30
+ data(){
31
+ return {
32
+ vhtml : null,
33
+ testHtml: '<math><mi//xlink:href="data:x,<\script>alert(4)<\/script>"><TABLE><tr><td>HELLO</tr></TABL><UL><li><A HREF=//google.com>click</UL><p><img src="http://www.jpg" onerror="console.log(\'onerror\',2222)"></p><svg><g/onload=console.log(\'onerror\',2)//<p><p>abc<iframe//src=jAva&Tab;script:console.log(\'onerror\',3)>def</p>'
34
+ }
35
+ },
36
+ created() {
37
+ if(this.html === null) {
38
+ // #ifdef H5
39
+ this.vhtml = DOMPurify.sanitize(this.testHtml);
40
+ // #endif
41
+
42
+ // #ifndef H5
43
+ this.vhtml = this.testHtml;
44
+ // #endif
45
+
46
+ }
47
+ else{
48
+ // #ifdef H5
49
+ this.vhtml = DOMPurify.sanitize(this.html);
50
+ // #endif
51
+
52
+ // #ifndef H5
53
+ this.vhtml = this.html;
54
+ // #endif
55
+ }
56
+ }
57
+ }
58
+ </script>
59
+
60
+ <style lang="less">
61
+ .xd-content-xss {
62
+ font-size: @xd-font-size-base;
63
+ line-height: @xd-font-size-base * 1.5;
64
+
65
+ /* #ifdef H5 */
66
+ & /deep/ img {
67
+ max-width: 100%;
68
+ }
69
+ /* #endif */
70
+ }
71
+ </style>
@@ -0,0 +1,258 @@
1
+ <template>
2
+ <view class="xd-dailog" :style="{zIndex:zIndex <= 4000? 4000:zIndex }" v-if="uiShow">
3
+ <view class="xd-dailog__mask" @click="bodyClose"></view>
4
+ <view
5
+ class="xd-dailog__body"
6
+ @click.stop
7
+ :style="{
8
+ borderRadius: (uiRadius + 'rpx'),
9
+ width: width,
10
+ background: background
11
+ }"
12
+ >
13
+ <view class="xd-dailog__body-title" v-if="title">
14
+ <slot name="title">
15
+ {{title}}
16
+ </slot>
17
+ </view>
18
+ <view class="xd-dailog__body-close" v-if="showClose" @click="close">
19
+ <xd-font-icon
20
+ icon="icondanchuangguanbi_xian"
21
+ width="52"
22
+ height="52"
23
+ size="26"
24
+ color="#fff"
25
+ ></xd-font-icon>
26
+ </view>
27
+ <view class="xd-dailog__body-content" >
28
+ <view class="xd-dailog__body-content-box">
29
+ <slot></slot>
30
+ </view>
31
+ <view class="xd-dailog__body-btn" v-if="cancel || confirm">
32
+ <slot name="btn">
33
+ <view>
34
+ <xd-button
35
+ v-if="cancel"
36
+ @click="handleConfirm('cancel')"
37
+ :type="cancelColorType"
38
+ size="medium"
39
+ :radius="btnRadius + 'rpx'"
40
+ >{{cancelText}}</xd-button>
41
+ </view>
42
+ <view>
43
+ <xd-button
44
+ @click="handleConfirm('confirm')"
45
+ v-if="confirm"
46
+ :type="confirmColorType"
47
+ size="medium"
48
+ :radius="btnRadius + 'rpx'"
49
+ >{{confirmText}}</xd-button>
50
+ </view>
51
+ </slot>
52
+ </view>
53
+ </view>
54
+ </view>
55
+ </view>
56
+ </template>
57
+
58
+ <script>
59
+ import XdButton from "@/components/XdButton/XdButton";
60
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
61
+
62
+ export default {
63
+ name: "XdDailog",
64
+ components: {
65
+ XdButton,
66
+ XdFontIcon
67
+ },
68
+ props:{
69
+ disabled:{
70
+ type: Boolean,
71
+ default: false,
72
+ },
73
+ width:{
74
+ type: Number | String,
75
+ default: '680rpx',
76
+ },
77
+ title:{
78
+ type: String,
79
+ default: '操作',
80
+ },
81
+
82
+ showClose: {
83
+ type: Boolean,
84
+ default: true,
85
+ },
86
+
87
+ background: {
88
+ type: String,
89
+ default: '#fff',
90
+ },
91
+
92
+ maskAutoClose:{
93
+ type: Boolean,
94
+ default: false,
95
+ },
96
+ show:{
97
+ type: Boolean,
98
+ default: true,
99
+ },
100
+ zIndex: {
101
+ type: Number,
102
+ default: 4000,
103
+ },
104
+ cancel: {
105
+ type: Boolean,
106
+ default: true,
107
+ },
108
+ cancelText: {
109
+ type: String,
110
+ default: '取消',
111
+ },
112
+ cancelColorType: {
113
+ type: String,
114
+ default: 'info',
115
+ },
116
+ confirm: {
117
+ type: Boolean,
118
+ default: true,
119
+ },
120
+ confirmText: {
121
+ type: String,
122
+ default: '打招呼',
123
+ },
124
+ confirmColorType: {
125
+ type: String,
126
+ default: 'primary',
127
+ },
128
+ radius:{
129
+ type: Number, //rpx
130
+ default: 10,
131
+ },
132
+ btnRadius:{
133
+ type: Number, //rpx
134
+ default: 10,
135
+ },
136
+
137
+ },
138
+
139
+ data(){
140
+ return {
141
+ uiShow: false,
142
+ uiRadius: 11.2,
143
+ uiDisabled: false,
144
+ }
145
+ },
146
+
147
+ watch:{
148
+ show(value){
149
+ this.uiShow = value;
150
+ },
151
+ disabled(value) {
152
+ this.uiDisabled = value;
153
+ },
154
+ },
155
+ created(){
156
+ this.uiShow = this.show;
157
+ this.uiDisabled = this.disabled;
158
+ this.uiRadius = this.radius;
159
+ },
160
+ methods: {
161
+
162
+ handleConfirm(status){
163
+ console.log(status)
164
+ let params = {};
165
+ params[status] = true;
166
+ this.$emit('onBtn', params);
167
+ if(status === 'cancel') {
168
+ this.close();
169
+ }
170
+ },
171
+
172
+ bodyClose(){
173
+ if(this.maskAutoClose) {
174
+ this.close();
175
+ }
176
+ },
177
+
178
+ close(){
179
+ if (this.uiDisabled) {
180
+ return
181
+ }
182
+ this.uiShow = false;
183
+ this.$emit('update:show', this.uiShow);
184
+ this.$emit('close');
185
+ },
186
+ }
187
+ }
188
+ </script>
189
+
190
+ <style scoped lang="less">
191
+ .xd-dailog {
192
+ position: fixed;
193
+ top: 0;
194
+ bottom: 0;
195
+ left: 0;
196
+ right: 0;
197
+ z-index: 2000;
198
+
199
+ &__mask {
200
+ position: absolute;
201
+ top: 0;
202
+ bottom: 0;
203
+ left: 0;
204
+ right: 0;
205
+ background: rgba(0,0,0,.5);
206
+ }
207
+
208
+ &__body {
209
+ position: absolute;
210
+ top: 50%;
211
+ left: 50%;
212
+ transform: translate(-50%, -50%);
213
+
214
+ &-close {
215
+ position: absolute;
216
+ width:unit(52/@scale, rpx);
217
+ height: unit(52/@scale, rpx);
218
+ left: 50%;
219
+ transform: translateX(-50%);
220
+ bottom: unit(-100/@scale, rpx);
221
+ border:unit(5, rpx) solid #fff;
222
+ border-radius: 50%;
223
+ overflow: hidden;
224
+ }
225
+
226
+ &-title{
227
+ height: unit(118/@scale, rpx);
228
+ line-height: unit(118/@scale, rpx);
229
+ font-size: unit(40, rpx);
230
+ text-align: center;
231
+ display: flex;
232
+ justify-content: center;
233
+ align-items: center;
234
+ }
235
+
236
+ &-content {
237
+ padding: unit(0/@scale,rpx) unit(40, rpx) unit(60/@scale, rpx);
238
+ text-align: center;
239
+ &-box {
240
+ max-height: 58vh;
241
+ overflow-y: auto;
242
+ padding: 0 unit(20, rpx);
243
+ overflow-x: hidden;
244
+ }
245
+ }
246
+
247
+ &-btn {
248
+ display: flex;
249
+ justify-content: center;
250
+ align-items: center;
251
+ padding-top: unit(30, rpx);
252
+ & > view {
253
+ padding: 0 unit(30/@scale,rpx);
254
+ }
255
+ }
256
+ }
257
+ }
258
+ </style>