小程序源码位置调整
4
sourcecode/.gitignore
vendored
Executable file
@ -0,0 +1,4 @@
|
||||
project.config.json
|
||||
project.swan.json
|
||||
.swan
|
||||
.DS_Store
|
||||
428
sourcecode/alipay/app.acss
Normal file
@ -0,0 +1,428 @@
|
||||
/* 框架样式覆盖 */
|
||||
.a-textarea-control textarea { font-size: 12px; }
|
||||
|
||||
/* 公共样式 */
|
||||
page {
|
||||
background: #f5f5f5;
|
||||
color: #4a4a4a;
|
||||
}
|
||||
page, textarea {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
input[type="text"],
|
||||
input[type="number"],
|
||||
input[type="idcard"],
|
||||
input[type="digit"],
|
||||
textarea {
|
||||
-webkit-appearance: none;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
/* 导航分割 */
|
||||
.spacing-nav-title {
|
||||
position: relative;
|
||||
color: #d2364c;
|
||||
text-align: center;
|
||||
background-color: #ffffff;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
.spacing-nav-title .line {
|
||||
display: inline-block;
|
||||
width: 50%;
|
||||
height: 1px;
|
||||
background: #d2364c;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
-webkit-transform: translate(-50%,-50%);
|
||||
-ms-transform: translate(-50%,-50%);
|
||||
transform: translate(-50%,-50%);
|
||||
}
|
||||
.spacing-nav-title .text-wrapper {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
padding: 0 8px;
|
||||
background-color: #ffffff;
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* 模块分割间距 */
|
||||
.spacing { padding-top: 20rpx; }
|
||||
.spacing-10 { padding-top: 10rpx; }
|
||||
.spacing-mb { margin-bottom: 20rpx; }
|
||||
.spacing-mt { margin-top: 20rpx; }
|
||||
|
||||
.drift { position: fixed; left: -1000px; }
|
||||
.nav-submit-fixed { background: #eee; height: 46px; position: fixed; bottom: 0; z-index: 10; }
|
||||
|
||||
.tips { background: #ffffeb url('/images/tips.png') no-repeat 5rpx 12rpx; background-size: 35rpx 35rpx; color: #f7b240; border: 1px solid #faebd2; line-height: 38rpx; padding: 10rpx 10rpx 10rpx 45rpx; font-size: 26rpx; border-radius: 2px; display: block; }
|
||||
|
||||
.data-loding image { width: 60px; height: 60px; background-size: 80% 80% !important; }
|
||||
|
||||
|
||||
/* 边框 */
|
||||
.br { border: solid 1px #efefef; }
|
||||
.br-b { border-bottom: solid 1px #efefef; }
|
||||
.br-t { border-top: solid 1px #efefef; }
|
||||
.br-l { border-left: solid 1px #efefef; }
|
||||
.br-r { border-right: solid 1px #efefef; }
|
||||
|
||||
/* 虚线边框 */
|
||||
.br-dashed { border: dashed 1px #efefef; }
|
||||
.br-b-dashed { border-bottom: dashed 1px #efefef; }
|
||||
.br-t-dashed { border-top: dashed 1px #efefef; }
|
||||
.br-l-dashed { border-left: dashed 1px #efefef; }
|
||||
.br-r-dashed { border-right: dashed 1px #efefef; }
|
||||
|
||||
/* 箭头符号 */
|
||||
.arrow-right { background-image: url('data:image/svg+xml;charset=utf-8,<svg width="16" height="26" viewBox="0 0 16 26" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="UI-KIT_基础元件" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="9.9基础元件" transform="translate(-5809.000000, -8482.000000)" fill="#C7C7CC"><polygon id="Disclosure-Indicator" points="5811 8482 5809 8484 5820.5 8495 5809 8506 5811 8508 5825 8495"></polygon></g></g></svg>'); background-size: 15px 10px; background-repeat: no-repeat; background-position: center right; }
|
||||
|
||||
|
||||
/* 常用样式 */
|
||||
.fl { float: left; }
|
||||
.fr { float: right; }
|
||||
.bg-white { background-color: #fff; }
|
||||
.wh-auto { width: 100%; }
|
||||
.ht-auto { height: 100%; }
|
||||
.tc { text-align: center; }
|
||||
.tl { text-align: left; }
|
||||
.tr { text-align: right; }
|
||||
.oh { overflow: hidden; }
|
||||
.dis-none { display: none; }
|
||||
.dis-block { display: block; }
|
||||
|
||||
.cr-main { color: #d2364c; }
|
||||
.cr-666 { color: #666; }
|
||||
.cr-888 { color: #888; }
|
||||
.cr-ccc { color: #ccc; }
|
||||
.cr-fff { color: #fff; }
|
||||
|
||||
.my-btn-default{
|
||||
font-size: 38rpx;
|
||||
color: #fff;
|
||||
border: none;
|
||||
background-color:#d2364c;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.my-btn-default.btn-disabled{
|
||||
background-color: #a6a6a6;
|
||||
color: #fff;
|
||||
}
|
||||
.my-btn-gray{
|
||||
font-size: 30rpx;
|
||||
color: #fff;
|
||||
border: none;
|
||||
background-color:#a6a6a6;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
/* 文字超出部分使用省略号 */
|
||||
.single-text {
|
||||
-o-text-overflow: ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
max-width: 100%;
|
||||
}
|
||||
.multi-text {
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
|
||||
/* 没有数据状态/处理错误/加载中 */
|
||||
.no-data-box {
|
||||
padding: 80rpx 0;
|
||||
}
|
||||
.no-data-box image {
|
||||
width: 160rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.no-data-box .no-data-tips {
|
||||
font-size: 28rpx;
|
||||
color: #a6a6a6;
|
||||
}
|
||||
.no-data-loding {
|
||||
padding-top: 15%;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
/* 底线 */
|
||||
.data-bottom-line{
|
||||
padding: 40rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.data-bottom-line view {
|
||||
width: 33.3%;
|
||||
}
|
||||
.data-bottom-line .left, .data-bottom-line .right{
|
||||
margin-top: 5px;
|
||||
border-bottom: 1px solid #e1e1e1;
|
||||
}
|
||||
.data-bottom-line .msg{
|
||||
color: #999;
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
/* 业务公共 */
|
||||
.copyright {
|
||||
color: #a5a5a5;
|
||||
text-align: center;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
.copyright .text {
|
||||
font-size: 26rpx;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.sales-price {
|
||||
color: #f40;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
.original-price {
|
||||
color: #888;
|
||||
font-size: 26rpx;
|
||||
text-decoration: line-through;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
.submit-fixed {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
background: #d2364c;
|
||||
color: #fff;
|
||||
border: none;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.bg-main, .bg-primary, .bg-warning {
|
||||
color: #fff;
|
||||
border: 0;
|
||||
font-size: 34rpx;
|
||||
}
|
||||
.bg-main {
|
||||
background: #d2364c;
|
||||
}
|
||||
.bg-primary {
|
||||
background: #ed6977;
|
||||
}
|
||||
.bg-warning {
|
||||
background: #F37B1D;
|
||||
}
|
||||
.bg-active-main {
|
||||
background: #d2364c !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.submit-bottom {
|
||||
height: 85rpx;
|
||||
line-height: 85rpx;
|
||||
font-size: 32rpx;
|
||||
border-radius: 0;
|
||||
}
|
||||
.bg-main.a-button-disabled {
|
||||
background: #fbe0e5;
|
||||
color: #f7b6c2;
|
||||
}
|
||||
.bg-warning.a-button-disabled {
|
||||
background: #ffcda6;
|
||||
color: #fdae70;
|
||||
}
|
||||
.bg-primary.a-button-disabled {
|
||||
background: #ffd2d7;
|
||||
color: #ffa0ab;
|
||||
}
|
||||
|
||||
.nav-back {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 10%;
|
||||
}
|
||||
|
||||
/*
|
||||
滚动标签高度
|
||||
*/
|
||||
.scroll-box {
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
/**
|
||||
* 表单
|
||||
*/
|
||||
.form-container .form-gorup {
|
||||
padding: 20rpx 10rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.form-container .form-gorup-title {
|
||||
margin-bottom: 5rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
.form-container .form-group-tips,
|
||||
.form-container .form-group-tips-must {
|
||||
margin-left: 20rpx;
|
||||
font-size: 24rpx;
|
||||
color: #ccc;
|
||||
}
|
||||
.form-container .form-group-tips-must {
|
||||
color: #f00;
|
||||
}
|
||||
.form-container .form-gorup input,
|
||||
.form-container .form-gorup textarea,
|
||||
.form-container .form-gorup .picker {
|
||||
border-radius: 0;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 0 10rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.form-container .form-gorup input,
|
||||
.form-container .form-gorup .picker {
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
}
|
||||
.form-container .form-gorup textarea {
|
||||
padding: 10rpx;
|
||||
min-height: 70rpx;
|
||||
}
|
||||
.form-container .form-gorup-text {
|
||||
padding: 20rpx 10rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 表单图片上传
|
||||
*/
|
||||
.form-container-upload .form-upload-data .item {
|
||||
padding: 10rpx;
|
||||
position: relative;
|
||||
}
|
||||
.form-container-upload .form-upload-data .delete-icon {
|
||||
position: absolute;
|
||||
top: 12rpx;
|
||||
right: 12rpx;
|
||||
color: #e5e5e5;
|
||||
background-color: #d9534f;
|
||||
padding: 5rpx 18rpx;
|
||||
font-size: 30rpx;
|
||||
border-style: solid;
|
||||
border-width: 0 0 1px 1px;
|
||||
border-color: #eee;
|
||||
}
|
||||
.form-container-upload .form-upload-data image {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
padding: 5rpx;
|
||||
border: 1px solid #eee;
|
||||
display: block;
|
||||
}
|
||||
.form-container-upload .upload-icon {
|
||||
margin: 10rpx 0 0 10rpx;
|
||||
width: 210rpx;
|
||||
height: 210rpx;
|
||||
border: 1px dashed #e9e9e9;
|
||||
}
|
||||
|
||||
/*
|
||||
* 优惠劵 - 插件
|
||||
*/
|
||||
.coupon-container {
|
||||
padding: 0 10rpx;
|
||||
}
|
||||
.coupon-container .item {
|
||||
overflow: hidden;
|
||||
height: 180rpx;
|
||||
border: 1px solid #D2364C;
|
||||
}
|
||||
.coupon-container .v-left {
|
||||
width: calc(100% - 140rpx);
|
||||
padding: 30rpx 0 30rpx 20rpx;
|
||||
box-sizing:border-box;
|
||||
-moz-box-sizing:border-box;
|
||||
-webkit-box-sizing:border-box;
|
||||
}
|
||||
.coupon-container .v-left .base {
|
||||
color: #D2364C;
|
||||
}
|
||||
.coupon-container .v-left .base .symbol {
|
||||
font-family: Verdana, Tahoma;
|
||||
font-size: 48rpx;
|
||||
font-weight: 400;
|
||||
}
|
||||
.coupon-container .v-left .base .price {
|
||||
font-weight: 700;
|
||||
font-family: arial;
|
||||
font-size: 76rpx;
|
||||
}
|
||||
.coupon-container .v-left .base .desc {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.coupon-container .v-left base-tips, .coupon-container .v-left .base-time {
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.coupon-container .v-right {
|
||||
background: #d2364c;
|
||||
width: 140rpx;
|
||||
height: 180rpx;
|
||||
color: #fff;
|
||||
font-weight: 500;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
}
|
||||
.coupon-container .v-right:before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.coupon-container .v-right .circle {
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: -1px;
|
||||
top: -3px;
|
||||
width: 3px;
|
||||
height: 180rpx;
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAACpCAYAAADur4c3AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3NpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo3MjUzYzIwOS04ZWNlLTRlNTctODQ4OC01ZDExOTkwOGNkYmMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MTM1QzgxREZGRDI5MTFFNTg3QjhGRUQ1MDY5OURERUQiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MTM1QzgxREVGRDI5MTFFNTg3QjhGRUQ1MDY5OURERUQiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NTJiNzVkOGUtZDc2Yi00MzEzLWFmNmYtYTJkNTRlYTI4YTY1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjcyNTNjMjA5LThlY2UtNGU1Ny04NDg4LTVkMTE5OTA4Y2RiYyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pvy+vnQAAAEqSURBVHjaYvz//z8DDDAxIAFyOVeBOAHEYfyPMDsLmXMfmfMT2YADDP8h4CEQq4A4aUDMA1LNSKZDXwJxGcg1yJaWIXOeInO+IxuwA+acK0AsA+IEADEbic7hhPOAer4DcQcQMyNb2oLMeYVsADcyZwPMObuBWBTEsQFpI9E54sjO+QvEc0F+YoHKJgHxJ2TnvEM2gBmZswrmnA1AzAXiaJPhHC1k58BNQ3bBTGTOR2QD/iJzFsH8Mw/kHxBHggzn2KA7BxzWyC5Yisz5imwACmc2LLY7QbEN4nCS4ZwAIGZFds5lUEpEdsF6nKn3PTJnAsiAV0BcBsSM5GamFCDmQXYOOJ8iu2Anzrz9HKU8ABlwDYgTKcnbo0XNaFEzWtQgipqOYVLUAAQYAKPWa4c8cIHnAAAAAElFTkSuQmCC) no-repeat;
|
||||
}
|
||||
.coupon-container .item-disabled .v-right {
|
||||
background: #dfdfdf !important;
|
||||
color: #c0c0c0 !important;
|
||||
cursor: no-drop !important;
|
||||
}
|
||||
.coupon-container .item-disabled {
|
||||
border: 1px solid #dfdfdf !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* 快捷导航
|
||||
*/
|
||||
.common-quick-nav {
|
||||
border: 0;
|
||||
padding: 15rpx;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
position: fixed;
|
||||
right: 10rpx;
|
||||
border-radius: 50%;
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
z-index: 1;
|
||||
}
|
||||
.common-quick-nav image {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 在线客服
|
||||
*/
|
||||
.common-online-service {
|
||||
bottom: 35%;
|
||||
}
|
||||
743
sourcecode/alipay/app.js
Normal file
@ -0,0 +1,743 @@
|
||||
App({
|
||||
data: {
|
||||
// 用户登录缓存key
|
||||
cache_user_login_key: "cache_user_login_key",
|
||||
|
||||
// 用户信息缓存key
|
||||
cache_user_info_key: "cache_shop_user_info_key",
|
||||
|
||||
// 用户站点信息缓存key
|
||||
cache_user_merchant_key: "cache_shop_user_merchant_key",
|
||||
|
||||
// 设备信息缓存key
|
||||
cache_system_info_key: "cache_shop_system_info_key",
|
||||
|
||||
// 用户地址选择缓存key
|
||||
cache_buy_user_address_select_key: "cache_buy_user_address_select_key",
|
||||
|
||||
// 用户传入信息缓存key
|
||||
cache_launch_info_key: "cache_shop_launch_info_key",
|
||||
|
||||
// 默认用户头像
|
||||
default_user_head_src: "/images/default-user.png",
|
||||
|
||||
// 成功圆形提示图片
|
||||
default_round_success_icon: "/images/default-round-success-icon.png",
|
||||
|
||||
// 错误圆形提示图片
|
||||
default_round_error_icon: "/images/default-round-error-icon.png",
|
||||
|
||||
// tabbar页面
|
||||
tabbar_pages: [
|
||||
"/pages/index/index",
|
||||
"/pages/goods-category/goods-category",
|
||||
"/pages/cart/cart",
|
||||
"/pages/user/user",
|
||||
],
|
||||
|
||||
// 页面标题
|
||||
common_pages_title: {
|
||||
"goods_search": "商品搜索",
|
||||
"goods_detail": "商品详情",
|
||||
"goods_attribute": "属性",
|
||||
"user_address": "我的地址",
|
||||
"user_address_save_add": "新增地址",
|
||||
"user_address_save_edit": "编辑地址",
|
||||
"buy": "订单确认",
|
||||
"user_order": "我的订单",
|
||||
"user_order_detail": "订单详情",
|
||||
"user_favor": "我的收藏",
|
||||
"answer_form": "留言",
|
||||
"answer_list": "问答",
|
||||
"user_answer_list": "我的留言",
|
||||
"user": "用户中心",
|
||||
"goods_category": "分类",
|
||||
"cart": "购物车",
|
||||
"message": "消息",
|
||||
"user_integral": "我的积分",
|
||||
"user_goods_browse": "我的足迹",
|
||||
"goods_comment": "商品评论",
|
||||
"user_orderaftersale": "退款/售后",
|
||||
"user_orderaftersale_detail": "订单售后",
|
||||
"user_order_comments": "订单评论",
|
||||
"coupon": "领劵中心",
|
||||
"user_coupon": "优惠劵",
|
||||
"extraction_address": "自提地址",
|
||||
},
|
||||
|
||||
// 请求地址
|
||||
request_url: "{{request_url}}",
|
||||
// request_url: 'http://shopxo.com/',
|
||||
// request_url: 'http://dev.shopxo.net/',
|
||||
|
||||
// 基础信息
|
||||
application_title: "{{application_title}}",
|
||||
application_describe: "{{application_describe}}",
|
||||
|
||||
// 价格符号
|
||||
price_symbol: "{{price_symbol}}"
|
||||
},
|
||||
|
||||
/**
|
||||
* 小程序初始化
|
||||
*/
|
||||
onLaunch(options) {
|
||||
// 设置设备信息
|
||||
this.set_system_info();
|
||||
|
||||
// 参数缓存
|
||||
my.setStorage({
|
||||
key: this.data.cache_launch_info_key,
|
||||
data: options.query || null
|
||||
});
|
||||
// 启动query参数处理
|
||||
this.startup_query(options.query);
|
||||
},
|
||||
|
||||
/**
|
||||
* 启动query参数处理
|
||||
*/
|
||||
startup_query(params) {
|
||||
// 没有启动参数则返回
|
||||
if ((params || null) == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 启动处理类型
|
||||
var type = params.type || null;
|
||||
switch (type) {
|
||||
// type=page
|
||||
case "page":
|
||||
// 页面
|
||||
var page = params.page || null;
|
||||
|
||||
// 参数名
|
||||
var params_field = params.params_field || null;
|
||||
|
||||
// 参数值
|
||||
var params_value = params.params_value || null;
|
||||
|
||||
// 页面跳转
|
||||
if(page != null)
|
||||
{
|
||||
my.navigateTo({
|
||||
url: "/pages/" + page + "/" + page + "?" + params_field + "=" + params_value
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
// type=view
|
||||
case "view" :
|
||||
var url = params.url || null;
|
||||
|
||||
// 页面跳转
|
||||
if(url != null)
|
||||
{
|
||||
my.navigateTo({
|
||||
url: '/pages/web-view/web-view?url='+url
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
// 默认
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取设备信息
|
||||
*/
|
||||
get_system_info() {
|
||||
let system_info = my.getStorageSync({
|
||||
key: this.data.cache_system_info_key
|
||||
});
|
||||
if ((system_info.data || null) == null) {
|
||||
return this.set_system_info();
|
||||
}
|
||||
return system_info.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* 设置设备信息
|
||||
*/
|
||||
set_system_info() {
|
||||
var system_info = my.getSystemInfoSync();
|
||||
my.setStorage({
|
||||
key: this.data.cache_system_info_key,
|
||||
data: system_info
|
||||
});
|
||||
return system_info;
|
||||
},
|
||||
|
||||
/**
|
||||
* 请求地址生成
|
||||
* a 方法
|
||||
* c 控制器
|
||||
* plugins 插件标记(传参则表示为插件请求)
|
||||
* params url请求参数
|
||||
*/
|
||||
get_request_url(a, c, plugins, params) {
|
||||
a = a || "index";
|
||||
c = c || "index";
|
||||
|
||||
// 是否插件请求
|
||||
var plugins_params = "";
|
||||
if ((plugins || null) != null)
|
||||
{
|
||||
plugins_params = "&pluginsname=" + plugins + "&pluginscontrol=" + c + "&pluginsaction=" + a;
|
||||
|
||||
// 走api统一插件调用控制器
|
||||
c = "plugins"
|
||||
a = "index"
|
||||
}
|
||||
|
||||
// 参数处理
|
||||
params = params || "";
|
||||
if (params != "" && params.substr(0, 1) != "&") {
|
||||
params = "&" + params;
|
||||
}
|
||||
|
||||
// 用户信息
|
||||
var user = this.get_user_cache_info();
|
||||
var token = (user == false) ? '' : user.token || '';
|
||||
return this.data.request_url +
|
||||
"index.php?s=/api/" + c + "/" + a + plugins_params+
|
||||
"&application=app&application_client_type=alipay" +
|
||||
"&token=" +
|
||||
token +
|
||||
"&ajax=ajax" +
|
||||
params;
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取用户信息,信息不存在则唤醒授权
|
||||
* object 回调操作对象
|
||||
* method 回调操作对象的函数
|
||||
* return 有用户数据直接返回, 则回调调用者
|
||||
*/
|
||||
get_user_info(object, method) {
|
||||
var user = this.get_user_cache_info();
|
||||
if (user == false) {
|
||||
// 唤醒用户授权
|
||||
this.user_login(object, method);
|
||||
|
||||
return false;
|
||||
} else {
|
||||
return user;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 从缓存获取用户信息
|
||||
*/
|
||||
get_user_cache_info() {
|
||||
var user = my.getStorageSync({ key: this.data.cache_user_info_key });
|
||||
if ((user.data || null) == null) {
|
||||
return false;
|
||||
}
|
||||
return user.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户登录
|
||||
* object 回调操作对象
|
||||
* method 回调操作对象的函数
|
||||
* auth_data 授权数据
|
||||
*/
|
||||
user_auth_login(object, method, auth_data) {
|
||||
var openid = my.getStorageSync({key: this.data.cache_user_login_key});
|
||||
if ((openid.data || null) == null)
|
||||
{
|
||||
this.user_login(object, method);
|
||||
} else {
|
||||
this.get_user_login_info(object, method, openid.data, auth_data);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户授权
|
||||
* object 回调操作对象
|
||||
* method 回调操作对象的函数
|
||||
*/
|
||||
user_login(object, method) {
|
||||
var openid = my.getStorageSync({key: this.data.cache_user_login_key});
|
||||
if ((openid.data || null) == null)
|
||||
{
|
||||
var self = this;
|
||||
// 加载loding
|
||||
my.showLoading({ content: "授权中..." });
|
||||
|
||||
// 请求授权接口
|
||||
my.getAuthCode({
|
||||
scopes: "auth_base",
|
||||
success: res => {
|
||||
if (res.authCode) {
|
||||
my.request({
|
||||
url: self.get_request_url("alipayuserauth", "user"),
|
||||
method: "POST",
|
||||
data: {authcode: res.authCode},
|
||||
dataType: "json",
|
||||
headers: { 'content-type': 'application/x-www-form-urlencoded' },
|
||||
success: res => {
|
||||
my.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
if((data.is_alipay_user_exist || 0) == 1)
|
||||
{
|
||||
my.setStorage({
|
||||
key: self.data.cache_user_info_key,
|
||||
data: data,
|
||||
success: (res) => {
|
||||
if (typeof object === 'object' && (method || null) != null) {
|
||||
object[method]();
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
self.showToast('用户信息缓存失败');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
my.setStorageSync({
|
||||
key: self.data.cache_user_login_key,
|
||||
data: data.openid
|
||||
});
|
||||
self.login_to_auth();
|
||||
}
|
||||
} else {
|
||||
self.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
my.hideLoading();
|
||||
self.showToast('服务器请求出错');
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: e => {
|
||||
my.hideLoading();
|
||||
self.showToast('授权失败');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.login_to_auth();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 跳转到登录页面授权
|
||||
*/
|
||||
login_to_auth() {
|
||||
my.confirm({
|
||||
title: '温馨提示',
|
||||
content: '授权用户信息',
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '暂不',
|
||||
success: (result) => {
|
||||
if (result.confirm) {
|
||||
my.navigateTo({
|
||||
url: "/pages/login/login"
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取用户授权信息
|
||||
* object 回调操作对象
|
||||
* method 回调操作对象的函数
|
||||
* openid 用户openid
|
||||
* auth_data 授权数据
|
||||
*/
|
||||
get_user_login_info(object, method, openid, userinfo) {
|
||||
// 邀请人参数
|
||||
var params = my.getStorageSync({key: this.data.cache_launch_info_key});
|
||||
|
||||
// 请求数据
|
||||
my.showLoading({ content: "授权中..." });
|
||||
var self = this;
|
||||
userinfo['openid'] = openid;
|
||||
userinfo['referrer'] = (params.data == null) ? 0 : (params.data.referrer || 0);
|
||||
my.request({
|
||||
url: self.get_request_url('alipayuserinfo', 'user'),
|
||||
method: 'POST',
|
||||
data: userinfo,
|
||||
dataType: 'json',
|
||||
headers: { 'content-type': 'application/x-www-form-urlencoded' },
|
||||
success: (res) => {
|
||||
my.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
my.setStorage({
|
||||
key: self.data.cache_user_info_key,
|
||||
data: res.data.data,
|
||||
success: (res) => {
|
||||
if (typeof object === 'object' && (method || null) != null) {
|
||||
object[method]();
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
self.showToast('用户信息缓存失败');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
self.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
my.hideLoading();
|
||||
self.showToast('服务器请求出错');
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取位置权限
|
||||
* object 回调操作对象
|
||||
* method 回调操作对象的函数
|
||||
*/
|
||||
use_location(object, method) {
|
||||
my.showLoading({ content: "定位中..." });
|
||||
var self = this;
|
||||
my.getLocation({
|
||||
success(res) {
|
||||
my.hideLoading();
|
||||
|
||||
// 回调
|
||||
if (typeof object === "object" && (method || null) != null) {
|
||||
object[method]({ lng: res.longitude, lat: res.latitude, status: 1000 });
|
||||
}
|
||||
},
|
||||
fail(e) {
|
||||
my.hideLoading();
|
||||
switch (e.error) {
|
||||
case 11:
|
||||
case 2001:
|
||||
my.alert({
|
||||
title: "温馨提示",
|
||||
content: "点击右上角->关于->右上角->设置->打开地理位置权限",
|
||||
buttonText: "我知道了",
|
||||
success: () => {
|
||||
if (typeof object === "object" && (method || null) != null) {
|
||||
object[method]({ status: 400 });
|
||||
}
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
case 12:
|
||||
self.showToast("网络异常,请重试[" + e.error + "]");
|
||||
break;
|
||||
|
||||
case 13:
|
||||
self.showToast("定位失败,请重试[" + e.error + "]");
|
||||
break;
|
||||
|
||||
default:
|
||||
self.showToast("定位超时,请重试[" + e.error + "]");
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 字段数据校验
|
||||
* data 待校验的数据, 一维json对象
|
||||
* validation 待校验的字段, 格式 [{fields: 'mobile', msg: '请填写手机号码', is_can_zero: 1(是否可以为0)}, ...]
|
||||
*/
|
||||
fields_check(data, validation) {
|
||||
for (var i in validation) {
|
||||
var temp_value = data[validation[i]["fields"]];
|
||||
var temp_is_can_zero = validation[i]["is_can_zero"] || null;
|
||||
|
||||
if ((temp_value == undefined || temp_value.length == 0 || temp_value == -1) || (temp_is_can_zero == null && temp_value == 0)
|
||||
) {
|
||||
this.showToast(validation[i]["msg"]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取当前时间戳
|
||||
*/
|
||||
get_timestamp() {
|
||||
return parseInt(new Date().getTime() / 1000);
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取日期
|
||||
* format 日期格式(默认 yyyy-MM-dd h:m:s)
|
||||
* timestamp 时间戳(默认当前时间戳)
|
||||
*/
|
||||
get_date(format, timestamp) {
|
||||
var d = new Date((timestamp || this.get_timestamp()) * 1000);
|
||||
var date = {
|
||||
"M+": d.getMonth() + 1,
|
||||
"d+": d.getDate(),
|
||||
"h+": d.getHours(),
|
||||
"m+": d.getMinutes(),
|
||||
"s+": d.getSeconds(),
|
||||
"q+": Math.floor((d.getMonth() + 3) / 3),
|
||||
"S+": d.getMilliseconds()
|
||||
};
|
||||
if (/(y+)/i.test(format)) {
|
||||
format = format.replace(
|
||||
RegExp.$1,
|
||||
(d.getFullYear() + "").substr(4 - RegExp.$1.length)
|
||||
);
|
||||
}
|
||||
for (var k in date) {
|
||||
if (new RegExp("(" + k + ")").test(format)) {
|
||||
format = format.replace(
|
||||
RegExp.$1,
|
||||
RegExp.$1.length == 1
|
||||
? date[k]
|
||||
: ("00" + date[k]).substr(("" + date[k]).length)
|
||||
);
|
||||
}
|
||||
}
|
||||
return format;
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取对象、数组的长度、元素个数
|
||||
* obj 要计算长度的元素(object、array、string)
|
||||
*/
|
||||
get_length(obj) {
|
||||
var obj_type = typeof obj;
|
||||
if (obj_type == "string") {
|
||||
return obj.length;
|
||||
} else if (obj_type == "object") {
|
||||
var obj_len = 0;
|
||||
for (var i in obj) {
|
||||
obj_len++;
|
||||
}
|
||||
return obj_len;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* 价格保留两位小数
|
||||
* price 价格保留两位小数
|
||||
*/
|
||||
price_two_decimal(x) {
|
||||
var f_x = parseFloat(x);
|
||||
if (isNaN(f_x)) {
|
||||
return 0;
|
||||
}
|
||||
var f_x = Math.round(x * 100) / 100;
|
||||
var s_x = f_x.toString();
|
||||
var pos_decimal = s_x.indexOf(".");
|
||||
if (pos_decimal < 0) {
|
||||
pos_decimal = s_x.length;
|
||||
s_x += ".";
|
||||
}
|
||||
while (s_x.length <= pos_decimal + 2) {
|
||||
s_x += "0";
|
||||
}
|
||||
return s_x;
|
||||
},
|
||||
|
||||
/**
|
||||
* 当前地址是否存在tabbar中
|
||||
*/
|
||||
is_tabbar_pages(url) {
|
||||
if (url.indexOf("?") == -1)
|
||||
{
|
||||
var value = url;
|
||||
} else {
|
||||
var temp_str = url.split("?");
|
||||
var value = temp_str[0];
|
||||
}
|
||||
if ((value || null) == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var temp_tabbar_pages = this.data.tabbar_pages;
|
||||
for (var i in temp_tabbar_pages)
|
||||
{
|
||||
if (temp_tabbar_pages[i] == value)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* 事件操作
|
||||
*/
|
||||
operation_event(e) {
|
||||
var value = e.target.dataset.value || null;
|
||||
var type = parseInt(e.target.dataset.type);
|
||||
|
||||
if (value != null) {
|
||||
switch(type) {
|
||||
// web
|
||||
case 0 :
|
||||
my.navigateTo({url: '/pages/web-view/web-view?url='+encodeURIComponent(value)});
|
||||
break;
|
||||
|
||||
// 内部页面
|
||||
case 1 :
|
||||
if (this.is_tabbar_pages(value))
|
||||
{
|
||||
my.switchTab({ url: value });
|
||||
} else {
|
||||
my.navigateTo({ url: value });
|
||||
}
|
||||
break;
|
||||
|
||||
// 跳转到外部小程序
|
||||
case 2 :
|
||||
my.navigateToMiniProgram({appId: value});
|
||||
break;
|
||||
|
||||
// 跳转到地图查看位置
|
||||
case 3 :
|
||||
var values = value.split('|');
|
||||
if (values.length != 4) {
|
||||
this.showToast('事件值格式有误');
|
||||
return false;
|
||||
}
|
||||
|
||||
my.openLocation({
|
||||
name: values[0],
|
||||
address: values[1],
|
||||
longitude: values[2],
|
||||
latitude: values[3],
|
||||
});
|
||||
break;
|
||||
|
||||
// 拨打电话
|
||||
case 4 :
|
||||
my.makePhoneCall({ number: value });
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 是否需要绑定手机号码
|
||||
*/
|
||||
user_is_need_login(user) {
|
||||
// 是否需要绑定手机号码
|
||||
if ((user.is_mandatory_bind_mobile || 0) == 1)
|
||||
{
|
||||
if ((user.mobile || null) == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* 默认弱提示方法
|
||||
* msg [string] 提示信息
|
||||
* status [string] 状态 默认error [正确success, 错误error]
|
||||
*/
|
||||
showToast(msg, status)
|
||||
{
|
||||
if ((status || 'error') == 'success')
|
||||
{
|
||||
my.showToast({
|
||||
type: "success",
|
||||
content: msg
|
||||
});
|
||||
} else {
|
||||
my.showToast({
|
||||
type: "fail",
|
||||
content: msg
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 拨打电话
|
||||
call_tel(value) {
|
||||
if ((value || null) != null) {
|
||||
my.makePhoneCall({ number: value });
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 登录校验
|
||||
* object 回调操作对象
|
||||
* method 回调操作对象的函数
|
||||
*/
|
||||
is_login_check(res, object, method) {
|
||||
if(res.code == -400)
|
||||
{
|
||||
my.clearStorage();
|
||||
this.get_user_info(object, method);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
// 获取用户openid
|
||||
get_user_openid() {
|
||||
var user = this.get_user_cache_info();
|
||||
return (user == false) ? null : user.alipay_openid || null;
|
||||
},
|
||||
|
||||
/**
|
||||
* 设置导航reddot
|
||||
* index tabBar 的哪一项,从左边算起(0开始)
|
||||
* type 0 移出, 1 添加 (默认 0 移出)
|
||||
*/
|
||||
set_tab_bar_reddot(index, type) {
|
||||
if (index !== undefined && index !== null)
|
||||
{
|
||||
if ((type || 0) == 0)
|
||||
{
|
||||
my.hideTabBarRedDot({ index: Number(index) });
|
||||
} else {
|
||||
my.showTabBarRedDot({ index: Number(index) });
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 设置导航车badge
|
||||
* index tabBar 的哪一项,从左边算起(0开始)
|
||||
* type 0 移出, 1 添加 (默认 0 移出)
|
||||
* value 显示的文本,超过 4 个字符则显示成 ...(type参数为1的情况下有效)
|
||||
*/
|
||||
set_tab_bar_badge(index, type, value) {
|
||||
if (index !== undefined && index !== null)
|
||||
{
|
||||
if ((type || 0) == 0) {
|
||||
my.removeTabBarBadge({ index: Number(index) });
|
||||
} else {
|
||||
my.setTabBarBadge({ index: Number(index), "text": value.toString() });
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 窗口背景色设置
|
||||
set_nav_bg_color_main(color) {
|
||||
// 默认主色
|
||||
if((color || null) == null)
|
||||
{
|
||||
color = '#d2364c';
|
||||
}
|
||||
|
||||
// 窗口和下拉顶部背景色
|
||||
my.setBackgroundColor({
|
||||
backgroundColorTop: color,
|
||||
backgroundColorBottom: '#f5f5f5',
|
||||
});
|
||||
|
||||
// 下拉文字颜色
|
||||
my.setBackgroundTextStyle({
|
||||
textStyle: 'light',
|
||||
});
|
||||
},
|
||||
|
||||
});
|
||||
103
sourcecode/alipay/app.json
Normal file
@ -0,0 +1,103 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages/index/index",
|
||||
"pages/goods-category/goods-category",
|
||||
"pages/cart/cart",
|
||||
"pages/user/user",
|
||||
"pages/web-view/web-view",
|
||||
"pages/login/login",
|
||||
"pages/paytips/paytips",
|
||||
"pages/goods-search/goods-search",
|
||||
"pages/goods-detail/goods-detail",
|
||||
"pages/goods-comment/goods-comment",
|
||||
"pages/goods-attribute/goods-attribute",
|
||||
"pages/buy/buy",
|
||||
"pages/user-address/user-address",
|
||||
"pages/user-address-save/user-address-save",
|
||||
"pages/user-order/user-order",
|
||||
"pages/user-order-detail/user-order-detail",
|
||||
"pages/user-order-comments/user-order-comments",
|
||||
"pages/user-faovr/user-faovr",
|
||||
"pages/user-answer-list/user-answer-list",
|
||||
"pages/answer-list/answer-list",
|
||||
"pages/answer-form/answer-form",
|
||||
"pages/message/message",
|
||||
"pages/user-integral/user-integral",
|
||||
"pages/user-goods-browse/user-goods-browse",
|
||||
"pages/user-orderaftersale/user-orderaftersale",
|
||||
"pages/user-orderaftersale-detail/user-orderaftersale-detail",
|
||||
"pages/extraction-address/extraction-address",
|
||||
"pages/common/open-setting-location/open-setting-location",
|
||||
"pages/plugins/coupon/index/index",
|
||||
"pages/plugins/coupon/user/user",
|
||||
"pages/plugins/membershiplevelvip/index/index",
|
||||
"pages/plugins/membershiplevelvip/buy/buy",
|
||||
"pages/plugins/membershiplevelvip/user/user",
|
||||
"pages/plugins/membershiplevelvip/order/order",
|
||||
"pages/plugins/membershiplevelvip/order-detail/order-detail",
|
||||
"pages/plugins/membershiplevelvip/profit-detail/profit-detail",
|
||||
"pages/plugins/membershiplevelvip/profit/profit",
|
||||
"pages/plugins/membershiplevelvip/statistics/statistics",
|
||||
"pages/plugins/membershiplevelvip/poster/poster",
|
||||
"pages/plugins/membershiplevelvip/team/team",
|
||||
|
||||
"pages/plugins/distribution/user/user",
|
||||
"pages/plugins/distribution/order/order",
|
||||
"pages/plugins/distribution/order-detail/order-detail",
|
||||
"pages/plugins/distribution/profit/profit",
|
||||
"pages/plugins/distribution/profit-detail/profit-detail",
|
||||
"pages/plugins/distribution/statistics/statistics",
|
||||
"pages/plugins/distribution/poster/poster",
|
||||
"pages/plugins/distribution/team/team",
|
||||
"pages/plugins/distribution/extraction/extraction",
|
||||
"pages/plugins/distribution/extraction-apply/extraction-apply",
|
||||
"pages/plugins/distribution/extraction-order/extraction-order",
|
||||
"pages/plugins/distribution/introduce/introduce",
|
||||
"pages/plugins/wallet/user/user",
|
||||
"pages/plugins/wallet/recharge/recharge",
|
||||
"pages/plugins/wallet/cash-auth/cash-auth",
|
||||
"pages/plugins/wallet/cash-create/cash-create",
|
||||
"pages/plugins/wallet/wallet-log/wallet-log",
|
||||
"pages/plugins/wallet/wallet-log-detail/wallet-log-detail",
|
||||
"pages/plugins/wallet/user-recharge/user-recharge",
|
||||
"pages/plugins/wallet/user-recharge-detail/user-recharge-detail",
|
||||
"pages/plugins/wallet/user-cash/user-cash",
|
||||
"pages/plugins/wallet/user-cash-detail/user-cash-detail"
|
||||
],
|
||||
"window": {
|
||||
"defaultTitle": "{{application_title}}",
|
||||
"titleBarColor": "#d2364c",
|
||||
"backgroundColor": "#f5f5f5"
|
||||
},
|
||||
"tabBar": {
|
||||
"textColor": "#8a8a8a",
|
||||
"selectedColor": "#d2364c",
|
||||
"backgroundColor": "#fff",
|
||||
"items": [
|
||||
{
|
||||
"pagePath": "pages/index/index",
|
||||
"icon": "/images/nav-icon-home.png",
|
||||
"activeIcon": "/images/nav-icon-home-active.png",
|
||||
"name": "首页"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/goods-category/goods-category",
|
||||
"icon": "/images/nav-icon-category.png",
|
||||
"activeIcon": "/images/nav-icon-category-active.png",
|
||||
"name": "分类"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/cart/cart",
|
||||
"icon": "/images/nav-icon-cart.png",
|
||||
"activeIcon": "/images/nav-icon-cart-active.png",
|
||||
"name": "购物车"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/user/user",
|
||||
"icon": "/images/nav-icon-user.png",
|
||||
"activeIcon": "/images/nav-icon-user-active.png",
|
||||
"name": "我的"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
26
sourcecode/alipay/components/badge/badge.acss
Executable file
@ -0,0 +1,26 @@
|
||||
.am-badge {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.am-badge-text {
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
transform: translate(50%, -50%);
|
||||
top: 0px;
|
||||
min-width: 16px;
|
||||
padding: 0;
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
text-align: center;
|
||||
background-color: #FF3B30;
|
||||
border-radius: 16px;
|
||||
color: #fff;
|
||||
font-size: 10px;
|
||||
padding: 1px 1px;
|
||||
}
|
||||
.am-badge-text-max {
|
||||
padding: 1px 2px;
|
||||
}
|
||||
5
sourcecode/alipay/components/badge/badge.axml
Executable file
@ -0,0 +1,5 @@
|
||||
<view a:if="{{propNumber > 0}}" class="am-badge">
|
||||
<view class="am-badge-text {{(propNumber > 99) ? 'am-badge-text-max' : ''}}">
|
||||
<text>{{(propNumber > 99) ? '99+' : propNumber}}</text>
|
||||
</view>
|
||||
</view>
|
||||
23
sourcecode/alipay/components/badge/badge.js
Executable file
@ -0,0 +1,23 @@
|
||||
// components/badge.js
|
||||
Component({
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
propNumber: Number,
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
|
||||
}
|
||||
})
|
||||
4
sourcecode/alipay/components/badge/badge.json
Executable file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
24
sourcecode/alipay/components/icon-nav/icon-nav.acss
Executable file
@ -0,0 +1,24 @@
|
||||
.data-list {
|
||||
overflow: hidden;
|
||||
}
|
||||
.data-list .items {
|
||||
width: calc(25% - 60rpx);
|
||||
float: left;
|
||||
padding: 30rpx;
|
||||
}
|
||||
.items-content {
|
||||
border-radius: 50%;
|
||||
padding: 20rpx;
|
||||
text-align: center;
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
}
|
||||
.data-list .items image {
|
||||
width: 80rpx !important;
|
||||
height: 80rpx !important;
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
.data-list .items .title {
|
||||
margin-top: 10rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
10
sourcecode/alipay/components/icon-nav/icon-nav.axml
Executable file
@ -0,0 +1,10 @@
|
||||
<view a:if="{{data.length > 0}}">
|
||||
<view class="data-list bg-white spacing-mb">
|
||||
<view class="items" a:for="{{data}}">
|
||||
<view class="items-content tc" style="background-color:{{item.bg_color}}" data-value="{{item.event_value}}" data-type="{{item.event_type}}" onTap="nav_event">
|
||||
<image class="wh-auto" src="{{item.images_url}}" mode="aspectFit" />
|
||||
</view>
|
||||
<view class="title tc single-text">{{item.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
17
sourcecode/alipay/components/icon-nav/icon-nav.js
Executable file
@ -0,0 +1,17 @@
|
||||
const app = getApp();
|
||||
Component({
|
||||
mixins: [],
|
||||
data: {},
|
||||
props: {
|
||||
data: []
|
||||
},
|
||||
didMount() {},
|
||||
didUpdate(){},
|
||||
didUnmount(){},
|
||||
methods: {
|
||||
// 操作事件
|
||||
nav_event(e) {
|
||||
app.operation_event(e);
|
||||
},
|
||||
}
|
||||
});
|
||||
3
sourcecode/alipay/components/icon-nav/icon-nav.json
Executable file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"component": true
|
||||
}
|
||||
60
sourcecode/alipay/components/popup/popup.acss
Executable file
@ -0,0 +1,60 @@
|
||||
.am-popup-content {
|
||||
position: fixed;
|
||||
background:#fff;
|
||||
z-index: 101;
|
||||
}
|
||||
|
||||
.am-popup-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background-color: rgba(0, 0, 0, 0.75);
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.am-popup-left {
|
||||
transform: translateX(-100%);
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.am-popup-right {
|
||||
transform: translateX(100%);
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.am-popup-top {
|
||||
top: 0;
|
||||
width: 100vw;
|
||||
transform: translateY(-100%);
|
||||
}
|
||||
|
||||
.am-popup-bottom {
|
||||
bottom: 0;
|
||||
width: 100vw;
|
||||
transform: translateY(100%);
|
||||
}
|
||||
|
||||
.am-popup-show .am-popup-content {
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.am-popup-show .am-popup-mask {
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.am-popup.animation .am-popup-content {
|
||||
transition: all 0.15s linear;
|
||||
}
|
||||
|
||||
.am-popup.animation .am-popup-mask {
|
||||
transition: all 0.15s linear;
|
||||
}
|
||||
6
sourcecode/alipay/components/popup/popup.axml
Executable file
@ -0,0 +1,6 @@
|
||||
<view class="am-popup {{propClassname || ''}} {{(propShow || false) ? 'am-popup-show' : ''}} {{ (propAnimation || true) ? 'animation': '' }}" disable-scroll="{{propDisablescroll || true}}">
|
||||
<view class="am-popup-mask" a:if="{{propMask || true}}" onTap="onMaskTap"></view>
|
||||
<view class="am-popup-content am-popup-{{propPosition || 'bottom'}}">
|
||||
<slot></slot>
|
||||
</view>
|
||||
</view>
|
||||
33
sourcecode/alipay/components/popup/popup.js
Executable file
@ -0,0 +1,33 @@
|
||||
// components/popup.js
|
||||
Component({
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
props: {
|
||||
propClassname: String,
|
||||
propShow: Boolean,
|
||||
propPosition: String,
|
||||
propMask: Boolean,
|
||||
propAnimation: Boolean,
|
||||
propDisablescroll: Boolean
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
onMaskTap: function onMaskTap() {
|
||||
var onClose = this.props.onClose;
|
||||
if (onClose) {
|
||||
onClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
4
sourcecode/alipay/components/popup/popup.json
Executable file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
10
sourcecode/alipay/components/slider/slider.acss
Executable file
@ -0,0 +1,10 @@
|
||||
.banner {
|
||||
background: #fff;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.banner image {
|
||||
min-width: 100%;
|
||||
}
|
||||
.banner, .banner image {
|
||||
height: 320rpx !important;
|
||||
}
|
||||
14
sourcecode/alipay/components/slider/slider.axml
Executable file
@ -0,0 +1,14 @@
|
||||
<swiper
|
||||
indicator-dots="{{data.length > 1}}"
|
||||
indicator-color="{{indicator_color}}"
|
||||
indicator-active-color="{{indicator_active_color}}"
|
||||
autoplay="{{data.length > 1}}"
|
||||
circular="{{circular}}"
|
||||
class="banner bg-white spacing-mb"
|
||||
a:if="{{data.length > 0}}">
|
||||
<block a:for="{{data}}">
|
||||
<swiper-item>
|
||||
<image class="wh-auto" src="{{item.images_url}}" mode="widthFix" data-value="{{item.event_value}}" data-type="{{item.event_type}}" onTap="banner_event" />
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
21
sourcecode/alipay/components/slider/slider.js
Executable file
@ -0,0 +1,21 @@
|
||||
const app = getApp();
|
||||
Component({
|
||||
mixins: [],
|
||||
data: {
|
||||
indicator_color: 'rgba(0, 0, 0, .3)',
|
||||
indicator_active_color: '#e31c55',
|
||||
circular: true,
|
||||
},
|
||||
props: {
|
||||
data: []
|
||||
},
|
||||
didMount() {},
|
||||
didUpdate() {},
|
||||
didUnmount() {},
|
||||
methods: {
|
||||
// 操作事件
|
||||
banner_event(e) {
|
||||
app.operation_event(e);
|
||||
},
|
||||
}
|
||||
});
|
||||
3
sourcecode/alipay/components/slider/slider.json
Executable file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"component": true
|
||||
}
|
||||
BIN
sourcecode/alipay/images/buy-address-divider.png
Executable file
|
After Width: | Height: | Size: 203 B |
BIN
sourcecode/alipay/images/default-bg-loding.gif
Normal file
|
After Width: | Height: | Size: 378 KiB |
BIN
sourcecode/alipay/images/default-cart-empty.png
Executable file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
sourcecode/alipay/images/default-cart-icon.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
sourcecode/alipay/images/default-round-error-icon.png
Executable file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
sourcecode/alipay/images/default-round-success-icon.png
Executable file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
sourcecode/alipay/images/default-select-active-icon.png
Executable file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
sourcecode/alipay/images/default-select-disabled-icon.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
sourcecode/alipay/images/default-select-icon.png
Executable file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
sourcecode/alipay/images/default-upload-icon.png
Normal file
|
After Width: | Height: | Size: 822 B |
BIN
sourcecode/alipay/images/default-user.png
Executable file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
sourcecode/alipay/images/default-xingxing-icon-active.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
sourcecode/alipay/images/default-xingxing-icon.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
sourcecode/alipay/images/empty.png
Executable file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
sourcecode/alipay/images/error.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
sourcecode/alipay/images/goods-detail-favor-icon-0.png
Executable file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
sourcecode/alipay/images/goods-detail-favor-icon-1.png
Executable file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
sourcecode/alipay/images/goods-detail-home-icon.png
Executable file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
sourcecode/alipay/images/goods-detail-share-icon.png
Executable file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
sourcecode/alipay/images/goods-detail-shop-icon.png
Executable file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
sourcecode/alipay/images/goods-detail-video-close.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
sourcecode/alipay/images/goods-detail-video-play.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
sourcecode/alipay/images/home-consulting-image.jpg
Executable file
|
After Width: | Height: | Size: 66 KiB |
BIN
sourcecode/alipay/images/nav-icon-cart-active.png
Executable file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
sourcecode/alipay/images/nav-icon-cart.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
sourcecode/alipay/images/nav-icon-category-active.png
Executable file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
sourcecode/alipay/images/nav-icon-category.png
Executable file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
sourcecode/alipay/images/nav-icon-home-active.png
Executable file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
sourcecode/alipay/images/nav-icon-home.png
Executable file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
sourcecode/alipay/images/nav-icon-user-active.png
Executable file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
sourcecode/alipay/images/nav-icon-user.png
Executable file
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 9.3 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
BIN
sourcecode/alipay/images/search-asc-icon.png
Executable file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
sourcecode/alipay/images/search-default-icon.png
Executable file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
sourcecode/alipay/images/search-desc-icon.png
Executable file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
sourcecode/alipay/images/search-submit-icon.png
Executable file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
sourcecode/alipay/images/tips.png
Executable file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
sourcecode/alipay/images/upload.png
Executable file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
sourcecode/alipay/images/user-address.png
Executable file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
sourcecode/alipay/images/user-head-message-icon.png
Executable file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
sourcecode/alipay/images/user-index-nav-order-icon-1.png
Executable file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
sourcecode/alipay/images/user-index-nav-order-icon-101.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
sourcecode/alipay/images/user-index-nav-order-icon-2.png
Executable file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
sourcecode/alipay/images/user-index-nav-order-icon-3.png
Executable file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
sourcecode/alipay/images/user-index-nav-order-icon-4.png
Executable file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
sourcecode/alipay/images/user-nav-cache-icon.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
sourcecode/alipay/images/user-nav-customer-service-icon.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
11
sourcecode/alipay/node_modules/domelementtype/LICENSE
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
Copyright (c) Felix Böhm
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
15
sourcecode/alipay/node_modules/domelementtype/index.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
//Types of elements found in the DOM
|
||||
module.exports = {
|
||||
Text: "text", //Text
|
||||
Directive: "directive", //<? ... ?>
|
||||
Comment: "comment", //<!-- ... -->
|
||||
Script: "script", //<script> tags
|
||||
Style: "style", //<style> tags
|
||||
Tag: "tag", //Any tag
|
||||
CDATA: "cdata", //<![CDATA[ ... ]]>
|
||||
Doctype: "doctype",
|
||||
|
||||
isTag: function(elem){
|
||||
return elem.type === "tag" || elem.type === "script" || elem.type === "style";
|
||||
}
|
||||
};
|
||||
90
sourcecode/alipay/node_modules/domelementtype/package.json
generated
vendored
Normal file
@ -0,0 +1,90 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
{
|
||||
"raw": "domelementtype@1",
|
||||
"scope": null,
|
||||
"escapedName": "domelementtype",
|
||||
"name": "domelementtype",
|
||||
"rawSpec": "1",
|
||||
"spec": ">=1.0.0 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"/data/www/project/shopxo/public/appmini/old/alipay/node_modules/domhandler"
|
||||
]
|
||||
],
|
||||
"_from": "domelementtype@>=1.0.0 <2.0.0",
|
||||
"_hasShrinkwrap": false,
|
||||
"_id": "domelementtype@1.3.1",
|
||||
"_inCache": true,
|
||||
"_location": "/domelementtype",
|
||||
"_nodeVersion": "11.3.0",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "s3://npm-registry-packages",
|
||||
"tmp": "tmp/domelementtype_1.3.1_1544088453224_0.16246904901637227"
|
||||
},
|
||||
"_npmUser": {
|
||||
"name": "feedic",
|
||||
"email": "me@feedic.com"
|
||||
},
|
||||
"_npmVersion": "6.4.1",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"raw": "domelementtype@1",
|
||||
"scope": null,
|
||||
"escapedName": "domelementtype",
|
||||
"name": "domelementtype",
|
||||
"rawSpec": "1",
|
||||
"spec": ">=1.0.0 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/domhandler"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz",
|
||||
"_shasum": "d048c44b37b0d10a7f2a3d5fee3f4333d790481f",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "domelementtype@1",
|
||||
"_where": "/data/www/project/shopxo/public/appmini/old/alipay/node_modules/domhandler",
|
||||
"author": {
|
||||
"name": "Felix Boehm",
|
||||
"email": "me@feedic.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/fb55/domelementtype/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "all the types of nodes in htmlparser2's dom",
|
||||
"devDependencies": {},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==",
|
||||
"shasum": "d048c44b37b0d10a7f2a3d5fee3f4333d790481f",
|
||||
"tarball": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz",
|
||||
"fileCount": 4,
|
||||
"unpackedSize": 2072,
|
||||
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCOuGCRA9TVsSAnZWagAAyyEP/i0IsOJYtr7ACAsPru/T\nqUkPekzIRjgNhQj97Bx/qc1uV23hvvcIACqY8c7QX0X3xwxtrmC43TP5+eGD\neU1BasHGTPtdEFHGAd4hGxh02Mh+ABWPnxo3RTWBaMFSq72qqAuwr2RS+Cia\nEsI5zme0CdGfpnBUF2pAYChwbqPpLnVTGNC3HlakmV57h6OwzfrlyXG1SkhT\nYItha7gNbIv7AuydH44S3AHyyWsw4BQlWjmC+cuasfvrEVsarocYUqTLHWLO\nWpMu/NP2Jct4H8nQzNWCYSI5Hu5F7GDd3wmqBkPZ2Q/GzjQx5tQP7C6ynwGA\n+wA9jVw21xVVzXfRu8d4PBZURppnYSCph8AraccelSYNoqwFleFlP/6EE32b\nj0TLsR4yAQFOy7zqHTmh4ew6mkc7mJGg+lbOsAYSVl4GaVqBiVwqj0zW1CGX\nwj9MSmqBfmM7NIp4lb8oLk1/5D1mtpS5Ng4tyfCE5HK5XGsdVAYKqjamAsPY\n4/y7ZAE8Zb5rglkTJZk4TY8/+s6Wu8IAYyuTD25mLaRu1Z4Kx6uPnZXDZKKw\n2JjTszTpinpNQq50VuhJnQcEyEyNJBra/4aSKgay8LfVqXNUBl+sVBwPJ6l5\nN0e8Vna3pGbeizO4QKm/7mxZnIKAVMZHi7LZ2PFh3LJ0XHIeMuYOsrEF3SKv\ngm4Y\r\n=pGU3\r\n-----END PGP SIGNATURE-----\r\n"
|
||||
},
|
||||
"gitHead": "19b2491101a4de3679b59db8eb7fdd9aa0fbc60b",
|
||||
"homepage": "https://github.com/fb55/domelementtype#readme",
|
||||
"keywords": [
|
||||
"dom",
|
||||
"htmlparser2"
|
||||
],
|
||||
"license": "BSD-2-Clause",
|
||||
"main": "index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "feedic",
|
||||
"email": "me@feedic.com"
|
||||
}
|
||||
],
|
||||
"name": "domelementtype",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/fb55/domelementtype.git"
|
||||
},
|
||||
"version": "1.3.1"
|
||||
}
|
||||
1
sourcecode/alipay/node_modules/domelementtype/readme.md
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
all the types of nodes in htmlparser2's dom
|
||||
6
sourcecode/alipay/node_modules/domhandler/.travis.yml
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
before_install:
|
||||
- '[ "${TRAVIS_NODE_VERSION}" != "0.8" ] || npm install -g npm@1.4.28'
|
||||
- npm install -g npm@latest
|
||||
language: node_js
|
||||
node_js:
|
||||
- 8
|
||||
11
sourcecode/alipay/node_modules/domhandler/LICENSE
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
Copyright (c) Felix Böhm
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
217
sourcecode/alipay/node_modules/domhandler/index.js
generated
vendored
Normal file
@ -0,0 +1,217 @@
|
||||
var ElementType = require("domelementtype");
|
||||
|
||||
var re_whitespace = /\s+/g;
|
||||
var NodePrototype = require("./lib/node");
|
||||
var ElementPrototype = require("./lib/element");
|
||||
|
||||
function DomHandler(callback, options, elementCB){
|
||||
if(typeof callback === "object"){
|
||||
elementCB = options;
|
||||
options = callback;
|
||||
callback = null;
|
||||
} else if(typeof options === "function"){
|
||||
elementCB = options;
|
||||
options = defaultOpts;
|
||||
}
|
||||
this._callback = callback;
|
||||
this._options = options || defaultOpts;
|
||||
this._elementCB = elementCB;
|
||||
this.dom = [];
|
||||
this._done = false;
|
||||
this._tagStack = [];
|
||||
this._parser = this._parser || null;
|
||||
}
|
||||
|
||||
//default options
|
||||
var defaultOpts = {
|
||||
normalizeWhitespace: false, //Replace all whitespace with single spaces
|
||||
withStartIndices: false, //Add startIndex properties to nodes
|
||||
withEndIndices: false, //Add endIndex properties to nodes
|
||||
};
|
||||
|
||||
DomHandler.prototype.onparserinit = function(parser){
|
||||
this._parser = parser;
|
||||
};
|
||||
|
||||
//Resets the handler back to starting state
|
||||
DomHandler.prototype.onreset = function(){
|
||||
DomHandler.call(this, this._callback, this._options, this._elementCB);
|
||||
};
|
||||
|
||||
//Signals the handler that parsing is done
|
||||
DomHandler.prototype.onend = function(){
|
||||
if(this._done) return;
|
||||
this._done = true;
|
||||
this._parser = null;
|
||||
this._handleCallback(null);
|
||||
};
|
||||
|
||||
DomHandler.prototype._handleCallback =
|
||||
DomHandler.prototype.onerror = function(error){
|
||||
if(typeof this._callback === "function"){
|
||||
this._callback(error, this.dom);
|
||||
} else {
|
||||
if(error) throw error;
|
||||
}
|
||||
};
|
||||
|
||||
DomHandler.prototype.onclosetag = function(){
|
||||
//if(this._tagStack.pop().name !== name) this._handleCallback(Error("Tagname didn't match!"));
|
||||
|
||||
var elem = this._tagStack.pop();
|
||||
|
||||
if(this._options.withEndIndices && elem){
|
||||
elem.endIndex = this._parser.endIndex;
|
||||
}
|
||||
|
||||
if(this._elementCB) this._elementCB(elem);
|
||||
};
|
||||
|
||||
DomHandler.prototype._createDomElement = function(properties){
|
||||
if (!this._options.withDomLvl1) return properties;
|
||||
|
||||
var element;
|
||||
if (properties.type === "tag") {
|
||||
element = Object.create(ElementPrototype);
|
||||
} else {
|
||||
element = Object.create(NodePrototype);
|
||||
}
|
||||
|
||||
for (var key in properties) {
|
||||
if (properties.hasOwnProperty(key)) {
|
||||
element[key] = properties[key];
|
||||
}
|
||||
}
|
||||
|
||||
return element;
|
||||
};
|
||||
|
||||
DomHandler.prototype._addDomElement = function(element){
|
||||
var parent = this._tagStack[this._tagStack.length - 1];
|
||||
var siblings = parent ? parent.children : this.dom;
|
||||
var previousSibling = siblings[siblings.length - 1];
|
||||
|
||||
element.next = null;
|
||||
|
||||
if(this._options.withStartIndices){
|
||||
element.startIndex = this._parser.startIndex;
|
||||
}
|
||||
if(this._options.withEndIndices){
|
||||
element.endIndex = this._parser.endIndex;
|
||||
}
|
||||
|
||||
if(previousSibling){
|
||||
element.prev = previousSibling;
|
||||
previousSibling.next = element;
|
||||
} else {
|
||||
element.prev = null;
|
||||
}
|
||||
|
||||
siblings.push(element);
|
||||
element.parent = parent || null;
|
||||
};
|
||||
|
||||
DomHandler.prototype.onopentag = function(name, attribs){
|
||||
var properties = {
|
||||
type: name === "script" ? ElementType.Script : name === "style" ? ElementType.Style : ElementType.Tag,
|
||||
name: name,
|
||||
attribs: attribs,
|
||||
children: []
|
||||
};
|
||||
|
||||
var element = this._createDomElement(properties);
|
||||
|
||||
this._addDomElement(element);
|
||||
|
||||
this._tagStack.push(element);
|
||||
};
|
||||
|
||||
DomHandler.prototype.ontext = function(data){
|
||||
//the ignoreWhitespace is officially dropped, but for now,
|
||||
//it's an alias for normalizeWhitespace
|
||||
var normalize = this._options.normalizeWhitespace || this._options.ignoreWhitespace;
|
||||
|
||||
var lastTag;
|
||||
|
||||
if(!this._tagStack.length && this.dom.length && (lastTag = this.dom[this.dom.length-1]).type === ElementType.Text){
|
||||
if(normalize){
|
||||
lastTag.data = (lastTag.data + data).replace(re_whitespace, " ");
|
||||
} else {
|
||||
lastTag.data += data;
|
||||
}
|
||||
} else {
|
||||
if(
|
||||
this._tagStack.length &&
|
||||
(lastTag = this._tagStack[this._tagStack.length - 1]) &&
|
||||
(lastTag = lastTag.children[lastTag.children.length - 1]) &&
|
||||
lastTag.type === ElementType.Text
|
||||
){
|
||||
if(normalize){
|
||||
lastTag.data = (lastTag.data + data).replace(re_whitespace, " ");
|
||||
} else {
|
||||
lastTag.data += data;
|
||||
}
|
||||
} else {
|
||||
if(normalize){
|
||||
data = data.replace(re_whitespace, " ");
|
||||
}
|
||||
|
||||
var element = this._createDomElement({
|
||||
data: data,
|
||||
type: ElementType.Text
|
||||
});
|
||||
|
||||
this._addDomElement(element);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
DomHandler.prototype.oncomment = function(data){
|
||||
var lastTag = this._tagStack[this._tagStack.length - 1];
|
||||
|
||||
if(lastTag && lastTag.type === ElementType.Comment){
|
||||
lastTag.data += data;
|
||||
return;
|
||||
}
|
||||
|
||||
var properties = {
|
||||
data: data,
|
||||
type: ElementType.Comment
|
||||
};
|
||||
|
||||
var element = this._createDomElement(properties);
|
||||
|
||||
this._addDomElement(element);
|
||||
this._tagStack.push(element);
|
||||
};
|
||||
|
||||
DomHandler.prototype.oncdatastart = function(){
|
||||
var properties = {
|
||||
children: [{
|
||||
data: "",
|
||||
type: ElementType.Text
|
||||
}],
|
||||
type: ElementType.CDATA
|
||||
};
|
||||
|
||||
var element = this._createDomElement(properties);
|
||||
|
||||
this._addDomElement(element);
|
||||
this._tagStack.push(element);
|
||||
};
|
||||
|
||||
DomHandler.prototype.oncommentend = DomHandler.prototype.oncdataend = function(){
|
||||
this._tagStack.pop();
|
||||
};
|
||||
|
||||
DomHandler.prototype.onprocessinginstruction = function(name, data){
|
||||
var element = this._createDomElement({
|
||||
name: name,
|
||||
data: data,
|
||||
type: ElementType.Directive
|
||||
});
|
||||
|
||||
this._addDomElement(element);
|
||||
};
|
||||
|
||||
module.exports = DomHandler;
|
||||
20
sourcecode/alipay/node_modules/domhandler/lib/element.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
// DOM-Level-1-compliant structure
|
||||
var NodePrototype = require('./node');
|
||||
var ElementPrototype = module.exports = Object.create(NodePrototype);
|
||||
|
||||
var domLvl1 = {
|
||||
tagName: "name"
|
||||
};
|
||||
|
||||
Object.keys(domLvl1).forEach(function(key) {
|
||||
var shorthand = domLvl1[key];
|
||||
Object.defineProperty(ElementPrototype, key, {
|
||||
get: function() {
|
||||
return this[shorthand] || null;
|
||||
},
|
||||
set: function(val) {
|
||||
this[shorthand] = val;
|
||||
return val;
|
||||
}
|
||||
});
|
||||
});
|
||||
44
sourcecode/alipay/node_modules/domhandler/lib/node.js
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
// This object will be used as the prototype for Nodes when creating a
|
||||
// DOM-Level-1-compliant structure.
|
||||
var NodePrototype = module.exports = {
|
||||
get firstChild() {
|
||||
var children = this.children;
|
||||
return children && children[0] || null;
|
||||
},
|
||||
get lastChild() {
|
||||
var children = this.children;
|
||||
return children && children[children.length - 1] || null;
|
||||
},
|
||||
get nodeType() {
|
||||
return nodeTypes[this.type] || nodeTypes.element;
|
||||
}
|
||||
};
|
||||
|
||||
var domLvl1 = {
|
||||
tagName: "name",
|
||||
childNodes: "children",
|
||||
parentNode: "parent",
|
||||
previousSibling: "prev",
|
||||
nextSibling: "next",
|
||||
nodeValue: "data"
|
||||
};
|
||||
|
||||
var nodeTypes = {
|
||||
element: 1,
|
||||
text: 3,
|
||||
cdata: 4,
|
||||
comment: 8
|
||||
};
|
||||
|
||||
Object.keys(domLvl1).forEach(function(key) {
|
||||
var shorthand = domLvl1[key];
|
||||
Object.defineProperty(NodePrototype, key, {
|
||||
get: function() {
|
||||
return this[shorthand] || null;
|
||||
},
|
||||
set: function(val) {
|
||||
this[shorthand] = val;
|
||||
return val;
|
||||
}
|
||||
});
|
||||
});
|
||||
111
sourcecode/alipay/node_modules/domhandler/package.json
generated
vendored
Normal file
@ -0,0 +1,111 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
{
|
||||
"raw": "domhandler@^2.4.2",
|
||||
"scope": null,
|
||||
"escapedName": "domhandler",
|
||||
"name": "domhandler",
|
||||
"rawSpec": "^2.4.2",
|
||||
"spec": ">=2.4.2 <3.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"/data/www/project/shopxo/public/appmini/old/alipay/node_modules/mini-html-parser2"
|
||||
]
|
||||
],
|
||||
"_from": "domhandler@>=2.4.2 <3.0.0",
|
||||
"_id": "domhandler@2.4.2",
|
||||
"_inCache": true,
|
||||
"_location": "/domhandler",
|
||||
"_nodeVersion": "10.0.0",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "s3://npm-registry-packages",
|
||||
"tmp": "tmp/domhandler_2.4.2_1525892844640_0.057355339211383916"
|
||||
},
|
||||
"_npmUser": {
|
||||
"name": "feedic",
|
||||
"email": "me@feedic.com"
|
||||
},
|
||||
"_npmVersion": "5.6.0",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"raw": "domhandler@^2.4.2",
|
||||
"scope": null,
|
||||
"escapedName": "domhandler",
|
||||
"name": "domhandler",
|
||||
"rawSpec": "^2.4.2",
|
||||
"spec": ">=2.4.2 <3.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/mini-html-parser2"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz",
|
||||
"_shasum": "8805097e933d65e85546f726d60f5eb88b44f803",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "domhandler@^2.4.2",
|
||||
"_where": "/data/www/project/shopxo/public/appmini/old/alipay/node_modules/mini-html-parser2",
|
||||
"author": {
|
||||
"name": "Felix Boehm",
|
||||
"email": "me@feedic.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/fb55/DomHandler/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"domelementtype": "1"
|
||||
},
|
||||
"description": "handler for htmlparser2 that turns pages into a dom",
|
||||
"devDependencies": {
|
||||
"htmlparser2": "^3.9.0",
|
||||
"jshint": "^2.9.1",
|
||||
"mocha": "^3.0.2"
|
||||
},
|
||||
"directories": {
|
||||
"test": "tests"
|
||||
},
|
||||
"dist": {
|
||||
"integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==",
|
||||
"shasum": "8805097e933d65e85546f726d60f5eb88b44f803",
|
||||
"tarball": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz",
|
||||
"fileCount": 33,
|
||||
"unpackedSize": 29945,
|
||||
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa80btCRA9TVsSAnZWagAAhQ4P/A4+DwDYOfgcue03Fsa3\nI+WBrBPQev1+huy0IUPiY64Dt26kQu5tUYckGCg8aEn2aA2hZf9EmnIdwrqD\n0h75PwmD4hkhE8GfRG4ehPff3vv86Gx2lLfk6HtYCGtUrrxWqY/XYgaYgJM+\nZmWzGheOqgXrphgOf8JgbWL6uBN7zT1eOLafvskMuKIGkfs4YWwNiLypy8Ue\nzYhxf+gimANQ84EhUzlQevDMXktqWuakH2aEbuDV2DaelnOFibO15xqoRl2P\ng0npC5v37NB1hxOvch8zBUtJ4NUfA2eR7VQx5bX0s6SCTTTFUBrh/qRdVDcy\nvLPlRO5koNgi4y2rwrQxqPG/duI1qvPSftRVzowmpS51hUwDSbbVxcZCwWp4\nNtj9lGC2qL3GIl+RtM6l4dHG0Rh34DUXEj74XjRODNP1ttew0/lk2bRFqMfO\nQrqAJnHj9WPa24ps91JssrA31bRQex6qvwWwR11rJ2IAZVIyu9lzPV503zM3\nPv7edFmyBQ5nwiI6gDiZGg5J2JM1E44DZPtTR+RWf0VBcmdoh8z22BtpoWTE\np8eKewHJn7h4UfbwA+YEzOi9NfJhk3FKLmTZF65ltKwyOtorPSoPmbHQSl/P\nNhmY/6TLMvn+XJx6Hc9oPSOWH8QPSkKltdVaSViDpAJqmZwxfa5sPC1Tar3l\nc8a8\r\n=kEog\r\n-----END PGP SIGNATURE-----\r\n"
|
||||
},
|
||||
"gitHead": "045bd8d634dca30192fbd23fee0c530adc9c6f52",
|
||||
"homepage": "https://github.com/fb55/DomHandler#readme",
|
||||
"jshintConfig": {
|
||||
"quotmark": "double",
|
||||
"trailing": true,
|
||||
"unused": true,
|
||||
"undef": true,
|
||||
"node": true,
|
||||
"proto": true,
|
||||
"globals": {
|
||||
"it": true
|
||||
}
|
||||
},
|
||||
"keywords": [
|
||||
"dom",
|
||||
"htmlparser2"
|
||||
],
|
||||
"license": "BSD-2-Clause",
|
||||
"main": "index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "feedic",
|
||||
"email": "me@feedic.com"
|
||||
}
|
||||
],
|
||||
"name": "domhandler",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/fb55/DomHandler.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha -R list && jshint index.js test/"
|
||||
},
|
||||
"version": "2.4.2"
|
||||
}
|
||||
116
sourcecode/alipay/node_modules/domhandler/readme.md
generated
vendored
Normal file
@ -0,0 +1,116 @@
|
||||
# domhandler [](https://travis-ci.org/fb55/domhandler)
|
||||
|
||||
The DOM handler (formally known as DefaultHandler) creates a tree containing all nodes of a page. The tree may be manipulated using the [domutils](https://github.com/fb55/domutils) library.
|
||||
|
||||
## Usage
|
||||
```javascript
|
||||
var handler = new DomHandler([ <func> callback(err, dom), ] [ <obj> options ]);
|
||||
// var parser = new Parser(handler[, options]);
|
||||
```
|
||||
|
||||
Available options are described below.
|
||||
|
||||
## Example
|
||||
```javascript
|
||||
var htmlparser = require("htmlparser2");
|
||||
var rawHtml = "Xyz <script language= javascript>var foo = '<<bar>>';< / script><!--<!-- Waah! -- -->";
|
||||
var handler = new htmlparser.DomHandler(function (error, dom) {
|
||||
if (error)
|
||||
[...do something for errors...]
|
||||
else
|
||||
[...parsing done, do something...]
|
||||
console.log(dom);
|
||||
});
|
||||
var parser = new htmlparser.Parser(handler);
|
||||
parser.write(rawHtml);
|
||||
parser.end();
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
```javascript
|
||||
[{
|
||||
data: 'Xyz ',
|
||||
type: 'text'
|
||||
}, {
|
||||
type: 'script',
|
||||
name: 'script',
|
||||
attribs: {
|
||||
language: 'javascript'
|
||||
},
|
||||
children: [{
|
||||
data: 'var foo = \'<bar>\';<',
|
||||
type: 'text'
|
||||
}]
|
||||
}, {
|
||||
data: '<!-- Waah! -- ',
|
||||
type: 'comment'
|
||||
}]
|
||||
```
|
||||
|
||||
## Option: normalizeWhitespace
|
||||
Indicates whether the whitespace in text nodes should be normalized (= all whitespace should be replaced with single spaces). The default value is "false".
|
||||
|
||||
The following HTML will be used:
|
||||
|
||||
```html
|
||||
<font>
|
||||
<br>this is the text
|
||||
<font>
|
||||
```
|
||||
|
||||
### Example: true
|
||||
|
||||
```javascript
|
||||
[{
|
||||
type: 'tag',
|
||||
name: 'font',
|
||||
children: [{
|
||||
data: ' ',
|
||||
type: 'text'
|
||||
}, {
|
||||
type: 'tag',
|
||||
name: 'br'
|
||||
}, {
|
||||
data: 'this is the text ',
|
||||
type: 'text'
|
||||
}, {
|
||||
type: 'tag',
|
||||
name: 'font'
|
||||
}]
|
||||
}]
|
||||
```
|
||||
|
||||
### Example: false
|
||||
|
||||
```javascript
|
||||
[{
|
||||
type: 'tag',
|
||||
name: 'font',
|
||||
children: [{
|
||||
data: '\n\t',
|
||||
type: 'text'
|
||||
}, {
|
||||
type: 'tag',
|
||||
name: 'br'
|
||||
}, {
|
||||
data: 'this is the text\n',
|
||||
type: 'text'
|
||||
}, {
|
||||
type: 'tag',
|
||||
name: 'font'
|
||||
}]
|
||||
}]
|
||||
```
|
||||
|
||||
## Option: withDomLvl1
|
||||
|
||||
Adds DOM level 1 properties to all elements.
|
||||
|
||||
<!-- TODO: description -->
|
||||
|
||||
## Option: withStartIndices
|
||||
Indicates whether a `startIndex` property will be added to nodes. When the parser is used in a non-streaming fashion, `startIndex` is an integer indicating the position of the start of the node in the document. The default value is "false".
|
||||
|
||||
## Option: withEndIndices
|
||||
Indicates whether a `endIndex` property will be added to nodes. When the parser is used in a non-streaming fashion, `endIndex` is an integer indicating the position of the end of the node in the document. The default value is "false".
|
||||
57
sourcecode/alipay/node_modules/domhandler/test/cases/01-basic.json
generated
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
{
|
||||
"name": "Basic test",
|
||||
"options": {},
|
||||
"html": "<!DOCTYPE html><html><title>The Title</title><body>Hello world</body></html>",
|
||||
"expected": [
|
||||
{
|
||||
"name": "!doctype",
|
||||
"data": "!DOCTYPE html",
|
||||
"type": "directive"
|
||||
},
|
||||
{
|
||||
"type": "tag",
|
||||
"name": "html",
|
||||
"attribs": {},
|
||||
"parent": null,
|
||||
"children": [
|
||||
{
|
||||
"type": "tag",
|
||||
"name": "title",
|
||||
"attribs": {},
|
||||
"parent": {
|
||||
"type": "tag",
|
||||
"name": "html",
|
||||
"attribs": {}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"data": "The Title",
|
||||
"type": "text",
|
||||
"parent": {
|
||||
"type": "tag",
|
||||
"name": "title",
|
||||
"attribs": {}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "tag",
|
||||
"name": "body",
|
||||
"attribs": {},
|
||||
"children": [
|
||||
{
|
||||
"data": "Hello world",
|
||||
"type": "text"
|
||||
}
|
||||
],
|
||||
"prev": {
|
||||
"type": "tag",
|
||||
"name": "title",
|
||||
"attribs": {}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
21
sourcecode/alipay/node_modules/domhandler/test/cases/02-single_tag_1.json
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "Single Tag 1",
|
||||
"options": {},
|
||||
"html": "<br>text</br>",
|
||||
"expected": [
|
||||
{
|
||||
"type": "tag",
|
||||
"name": "br",
|
||||
"attribs": {}
|
||||
},
|
||||
{
|
||||
"data": "text",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"type": "tag",
|
||||
"name": "br",
|
||||
"attribs": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
21
sourcecode/alipay/node_modules/domhandler/test/cases/03-single_tag_2.json
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "Single Tag 2",
|
||||
"options": {},
|
||||
"html": "<br>text<br>",
|
||||
"expected": [
|
||||
{
|
||||
"type": "tag",
|
||||
"name": "br",
|
||||
"attribs": {}
|
||||
},
|
||||
{
|
||||
"data": "text",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"type": "tag",
|
||||
"name": "br",
|
||||
"attribs": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
27
sourcecode/alipay/node_modules/domhandler/test/cases/04-unescaped_in_script.json
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "Unescaped chars in script",
|
||||
"options": {},
|
||||
"html": "<head><script language=\"Javascript\">var foo = \"<bar>\"; alert(2 > foo); var baz = 10 << 2; var zip = 10 >> 1; var yap = \"<<>>>><<\";</script></head>",
|
||||
"expected": [
|
||||
{
|
||||
"type": "tag",
|
||||
"name": "head",
|
||||
"attribs": {},
|
||||
"children": [
|
||||
{
|
||||
"type": "script",
|
||||
"name": "script",
|
||||
"attribs": {
|
||||
"language": "Javascript"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"data": "var foo = \"<bar>\"; alert(2 > foo); var baz = 10 << 2; var zip = 10 >> 1; var yap = \"<<>>>><<\";",
|
||||
"type": "text"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
18
sourcecode/alipay/node_modules/domhandler/test/cases/05-tags_in_comment.json
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "Special char in comment",
|
||||
"options": {},
|
||||
"html": "<head><!-- commented out tags <title>Test</title>--></head>",
|
||||
"expected": [
|
||||
{
|
||||
"type": "tag",
|
||||
"name": "head",
|
||||
"attribs": {},
|
||||
"children": [
|
||||
{
|
||||
"data": " commented out tags <title>Test</title>",
|
||||
"type": "comment"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
18
sourcecode/alipay/node_modules/domhandler/test/cases/06-comment_in_script.json
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "Script source in comment",
|
||||
"options": {},
|
||||
"html": "<script><!--var foo = 1;--></script>",
|
||||
"expected": [
|
||||
{
|
||||
"type": "script",
|
||||
"name": "script",
|
||||
"attribs": {},
|
||||
"children": [
|
||||
{
|
||||
"data": "<!--var foo = 1;-->",
|
||||
"type": "text"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
20
sourcecode/alipay/node_modules/domhandler/test/cases/07-unescaped_in_style.json
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "Unescaped chars in style",
|
||||
"options": {},
|
||||
"html": "<style type=\"text/css\">\n body > p\n\t{ font-weight: bold; }</style>",
|
||||
"expected": [
|
||||
{
|
||||
"type": "style",
|
||||
"name": "style",
|
||||
"attribs": {
|
||||
"type": "text/css"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"data": "\n body > p\n\t{ font-weight: bold; }",
|
||||
"type": "text"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
20
sourcecode/alipay/node_modules/domhandler/test/cases/08-extra_spaces_in_tag.json
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "Extra spaces in tag",
|
||||
"options": {},
|
||||
"html": "<font\t\n size='14' \n>the text</\t\nfont\t \n>",
|
||||
"expected": [
|
||||
{
|
||||
"type": "tag",
|
||||
"name": "font",
|
||||
"attribs": {
|
||||
"size": "14"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"data": "the text",
|
||||
"type": "text"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||