diff --git a/README.md b/README.md index a905f22..c57e3be 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ -# bsmall +# 本时商城 -本时商城支付宝小程序 \ No newline at end of file +本时商城支付宝小程序 diff --git a/api/api.js b/api/api.js new file mode 100755 index 0000000..e49bb47 --- /dev/null +++ b/api/api.js @@ -0,0 +1,71 @@ +let apiUrl = "https://www.ysd-bs.com/api/", + timeout = 30000 + +let request = (obj) => { + return new Promise((resolve, reject) => { + my.request({ + url : apiUrl + obj.url || '', + headers : obj.header || { 'content-type': 'application/json' }, + method : obj.method || 'GET', + data : obj.data || {}, + timeout : timeout, + success : (res) => { + if (res.data.status_code == '200') { + resolve(res.data) + } else if (res.data.status_code == '401') { + my.showToast({ + type : "fail", + content : "接口请求失败,未登录;err:" + res.data.message + }); + }else { + reject(err) + } + }, + fail : (err) => { + if(err.status == 401){ + // 清理缓存 + my.clearStorageSync() + // 清理全局数据 + getApp().globalData.userInfo = {} + getApp().globalData.isUser = false + getApp().globalData.token = "" + // 提示信息 + my.alert({ + title : '提示', + content : '登录状态已过期,请重新登录', + success : res => { + my.redirectTo({ + url: '../login/login' + }); + } + }); + }else{ + reject(err) + } + } + }); + }) +} + +let userinfo = (obj) => { + return request({ + url : "users/info", + header : { + "Authorization": obj + }, + method : "POST" + }).then(res=>{ + getApp().globalData.userInfo = res.data + return res.data + }).catch(err=>{ + my.showToast({ + type : "fail", + content: "未登录,获取信息失败" + }) + }) +} + +export default { + request, + userinfo +} \ No newline at end of file diff --git a/app.acss b/app.acss new file mode 100755 index 0000000..e3f80d1 --- /dev/null +++ b/app.acss @@ -0,0 +1,74 @@ + +/** + * Web唐明明 + * 一个梦想做木雕手艺人的程序员 + */ + +page { + background: white; + font-size: 28rpx; +} + +/* 按钮 */ + +.btn{ + background: #ff6600; + border-color: #ff6600; + color: white; + font-size: 32rpx; + height: 95rpx; + line-height: 95rpx; + font-weight: bold; +} + +.hover-btn{ + background: #da5700; +} + +/* 导航点击样式 */ +.nav-hover{ + background: rgba(0, 0, 0, .05); +} + +/* + * 水平居中 + */ +.pack-center { + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-box-pack: center; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; +} + +/* + * 文字截取 + */ + +.nowrap { + max-width: 100%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.nowrap-multi { + display: -webkit-box; + overflow: hidden; + text-overflow: ellipsis; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; +} + +/* + * 分页加载 + */ + +.pages-login{ + text-align: center; + color: gray; + padding: 30rpx 0; +} diff --git a/app.js b/app.js new file mode 100755 index 0000000..41d746e --- /dev/null +++ b/app.js @@ -0,0 +1,20 @@ +App({ + onLaunch(options) { + let userToken = my.getStorageSync({key:"userToken"}).data || null, + atTime = Math.round(new Date() / 1000) + + if(userToken != null){ + this.globalData.isUser = true + this.globalData.token = userToken.token + } + }, + onShow(options) { + + }, + globalData:{ + isUser : false, + token : "", + expires : 0, + userInfo: {} + } +}); diff --git a/app.json b/app.json new file mode 100755 index 0000000..2d4f2fc --- /dev/null +++ b/app.json @@ -0,0 +1,60 @@ +{ + "pages": [ + "pages/welcome/welcome", + "pages/login/login", + "pages/index/index", + "pages/set_meal/set_meal", + "pages/user/user", + "pages/sub_order/sub_order", + "pages/enter/enter", + "pages/find/find", + "pages/set/set", + "pages/shop_user/shop_user", + "pages/add_user/add_user", + "pages/order/order", + "pages/refund/refund", + "pages/refund_record/refund_record", + "pages/welfare/welfare", + "pages/welfare_list/welfare_list", + "pages/welfare_deta/welfare_deta", + "pages/changePwd/changePwd", + "pages/payCode/payCode", + "pages/results/results", + "pages/star_card/star_card", + "pages/equity/equity", + "pages/equity_list/equity_list", + "pages/wallet/wallet", + "pages/wallet_extract/wallet_extract", + "pages/logs/logs", + "pages/nuclear/nuclear", + "pages/nuclear_code/nuclear_code", + "pages/notice_date/notice_date", + "pages/gas_list/gas_list", + "pages/gas/gas", + "pages/stages_pay/stages_pay", + "pages/stages_form/stages_form" + ], + "window": { + "defaultTitle": " ", + "pullRefresh": false, + "backgroundColor": "#fafafa" + }, + "tabBar": { + "items": [ + { + "pagePath": "pages/index/index", + "name": "工作台", + "icon": "lib/icon/tabBar_icon_00.png", + "activeIcon": "lib/icon/tabBar_active_00.png" + }, + { + "pagePath": "pages/user/user", + "name": "我的", + "icon": "lib/icon/tabBar_icon_02.png", + "activeIcon": "lib/icon/tabBar_active_02.png" + } + ], + "selectedColor": "#ff6600", + "textColor": "#8a8a8a" + } +} diff --git a/lib/icon/add_icon.png b/lib/icon/add_icon.png new file mode 100755 index 0000000..ea2941b Binary files /dev/null and b/lib/icon/add_icon.png differ diff --git a/lib/icon/arrows_dow.png b/lib/icon/arrows_dow.png new file mode 100755 index 0000000..1c0f487 Binary files /dev/null and b/lib/icon/arrows_dow.png differ diff --git a/lib/icon/arrows_right.png b/lib/icon/arrows_right.png new file mode 100755 index 0000000..70e4bb4 Binary files /dev/null and b/lib/icon/arrows_right.png differ diff --git a/lib/icon/enter_code_icon.png b/lib/icon/enter_code_icon.png new file mode 100755 index 0000000..8c5cd32 Binary files /dev/null and b/lib/icon/enter_code_icon.png differ diff --git a/lib/icon/enter_phone_icon.png b/lib/icon/enter_phone_icon.png new file mode 100755 index 0000000..e8028b6 Binary files /dev/null and b/lib/icon/enter_phone_icon.png differ diff --git a/lib/icon/enter_shop_icon.png b/lib/icon/enter_shop_icon.png new file mode 100755 index 0000000..a84350e Binary files /dev/null and b/lib/icon/enter_shop_icon.png differ diff --git a/lib/icon/index_icon_00.png b/lib/icon/index_icon_00.png new file mode 100755 index 0000000..5980036 Binary files /dev/null and b/lib/icon/index_icon_00.png differ diff --git a/lib/icon/index_icon_01.png b/lib/icon/index_icon_01.png new file mode 100755 index 0000000..20ee013 Binary files /dev/null and b/lib/icon/index_icon_01.png differ diff --git a/lib/icon/index_icon_02.png b/lib/icon/index_icon_02.png new file mode 100755 index 0000000..007fdbd Binary files /dev/null and b/lib/icon/index_icon_02.png differ diff --git a/lib/icon/index_icon_03.png b/lib/icon/index_icon_03.png new file mode 100755 index 0000000..8d81141 Binary files /dev/null and b/lib/icon/index_icon_03.png differ diff --git a/lib/icon/index_icon_04.png b/lib/icon/index_icon_04.png new file mode 100644 index 0000000..fd2056f Binary files /dev/null and b/lib/icon/index_icon_04.png differ diff --git a/lib/icon/list_null.png b/lib/icon/list_null.png new file mode 100755 index 0000000..b8a80ec Binary files /dev/null and b/lib/icon/list_null.png differ diff --git a/lib/icon/login_pss_icon.png b/lib/icon/login_pss_icon.png new file mode 100755 index 0000000..09c25fd Binary files /dev/null and b/lib/icon/login_pss_icon.png differ diff --git a/lib/icon/login_user_icon.png b/lib/icon/login_user_icon.png new file mode 100755 index 0000000..c35e19a Binary files /dev/null and b/lib/icon/login_user_icon.png differ diff --git a/lib/icon/month_icon.png b/lib/icon/month_icon.png new file mode 100755 index 0000000..c0c3d87 Binary files /dev/null and b/lib/icon/month_icon.png differ diff --git a/lib/icon/permissions_icon.png b/lib/icon/permissions_icon.png new file mode 100755 index 0000000..fa4bc3f Binary files /dev/null and b/lib/icon/permissions_icon.png differ diff --git a/lib/icon/screen_calss.png b/lib/icon/screen_calss.png new file mode 100755 index 0000000..c1044e1 Binary files /dev/null and b/lib/icon/screen_calss.png differ diff --git a/lib/icon/screen_icon.png b/lib/icon/screen_icon.png new file mode 100755 index 0000000..c4fca61 Binary files /dev/null and b/lib/icon/screen_icon.png differ diff --git a/lib/icon/tabBar_active_00.png b/lib/icon/tabBar_active_00.png new file mode 100755 index 0000000..86239c6 Binary files /dev/null and b/lib/icon/tabBar_active_00.png differ diff --git a/lib/icon/tabBar_active_02.png b/lib/icon/tabBar_active_02.png new file mode 100755 index 0000000..bf8072e Binary files /dev/null and b/lib/icon/tabBar_active_02.png differ diff --git a/lib/icon/tabBar_icon_00.png b/lib/icon/tabBar_icon_00.png new file mode 100755 index 0000000..9ae85b0 Binary files /dev/null and b/lib/icon/tabBar_icon_00.png differ diff --git a/lib/icon/tabBar_icon_02.png b/lib/icon/tabBar_icon_02.png new file mode 100755 index 0000000..9e47452 Binary files /dev/null and b/lib/icon/tabBar_icon_02.png differ diff --git a/lib/icon/user_btn_icon_00.png b/lib/icon/user_btn_icon_00.png new file mode 100755 index 0000000..00a1afc Binary files /dev/null and b/lib/icon/user_btn_icon_00.png differ diff --git a/lib/icon/user_btn_icon_01.png b/lib/icon/user_btn_icon_01.png new file mode 100755 index 0000000..a587996 Binary files /dev/null and b/lib/icon/user_btn_icon_01.png differ diff --git a/lib/icon/user_btn_icon_02.png b/lib/icon/user_btn_icon_02.png new file mode 100755 index 0000000..46989d0 Binary files /dev/null and b/lib/icon/user_btn_icon_02.png differ diff --git a/lib/icon/user_btn_icon_03.png b/lib/icon/user_btn_icon_03.png new file mode 100755 index 0000000..9df53c7 Binary files /dev/null and b/lib/icon/user_btn_icon_03.png differ diff --git a/lib/icon/user_btn_icon_04.png b/lib/icon/user_btn_icon_04.png new file mode 100755 index 0000000..11d37e3 Binary files /dev/null and b/lib/icon/user_btn_icon_04.png differ diff --git a/lib/icon/user_btn_icon_05.png b/lib/icon/user_btn_icon_05.png new file mode 100755 index 0000000..c6da387 Binary files /dev/null and b/lib/icon/user_btn_icon_05.png differ diff --git a/lib/icon/user_btn_icon_06.png b/lib/icon/user_btn_icon_06.png new file mode 100755 index 0000000..27d54bf Binary files /dev/null and b/lib/icon/user_btn_icon_06.png differ diff --git a/lib/icon/welfareInfo_icon_00.png b/lib/icon/welfareInfo_icon_00.png new file mode 100755 index 0000000..95f1793 Binary files /dev/null and b/lib/icon/welfareInfo_icon_00.png differ diff --git a/lib/icon/welfareInfo_icon_01.png b/lib/icon/welfareInfo_icon_01.png new file mode 100755 index 0000000..561a80a Binary files /dev/null and b/lib/icon/welfareInfo_icon_01.png differ diff --git a/lib/icon/welfareInfo_icon_02.png b/lib/icon/welfareInfo_icon_02.png new file mode 100755 index 0000000..8f6853c Binary files /dev/null and b/lib/icon/welfareInfo_icon_02.png differ diff --git a/lib/icon/welfareInfo_icon_03.png b/lib/icon/welfareInfo_icon_03.png new file mode 100755 index 0000000..9a0f673 Binary files /dev/null and b/lib/icon/welfareInfo_icon_03.png differ diff --git a/lib/icon/welfareInfo_icon_04.png b/lib/icon/welfareInfo_icon_04.png new file mode 100755 index 0000000..18f5363 Binary files /dev/null and b/lib/icon/welfareInfo_icon_04.png differ diff --git a/lib/icon/welfareInfo_icon_05.png b/lib/icon/welfareInfo_icon_05.png new file mode 100755 index 0000000..86d7859 Binary files /dev/null and b/lib/icon/welfareInfo_icon_05.png differ diff --git a/lib/icon/welfareInfo_icon_06.png b/lib/icon/welfareInfo_icon_06.png new file mode 100755 index 0000000..9acbf66 Binary files /dev/null and b/lib/icon/welfareInfo_icon_06.png differ diff --git a/lib/icon/welfareInfo_icon_07.png b/lib/icon/welfareInfo_icon_07.png new file mode 100755 index 0000000..683513b Binary files /dev/null and b/lib/icon/welfareInfo_icon_07.png differ diff --git a/lib/icon/welfareInfo_icon_08.png b/lib/icon/welfareInfo_icon_08.png new file mode 100755 index 0000000..60812bc Binary files /dev/null and b/lib/icon/welfareInfo_icon_08.png differ diff --git a/lib/icon/welfareInfo_icon_09.png b/lib/icon/welfareInfo_icon_09.png new file mode 100755 index 0000000..57293b6 Binary files /dev/null and b/lib/icon/welfareInfo_icon_09.png differ diff --git a/lib/icon/welfareInfo_icon_10.png b/lib/icon/welfareInfo_icon_10.png new file mode 100755 index 0000000..4e68517 Binary files /dev/null and b/lib/icon/welfareInfo_icon_10.png differ diff --git a/lib/icon/welfareInfo_icon_11.png b/lib/icon/welfareInfo_icon_11.png new file mode 100755 index 0000000..cbcc7d4 Binary files /dev/null and b/lib/icon/welfareInfo_icon_11.png differ diff --git a/lib/icon/welfareInfo_icon_12.png b/lib/icon/welfareInfo_icon_12.png new file mode 100755 index 0000000..7298bfa Binary files /dev/null and b/lib/icon/welfareInfo_icon_12.png differ diff --git a/lib/icon/welfareInfo_icon_13.png b/lib/icon/welfareInfo_icon_13.png new file mode 100644 index 0000000..0141fcc Binary files /dev/null and b/lib/icon/welfareInfo_icon_13.png differ diff --git a/lib/icon/welfareInfo_icon_14.png b/lib/icon/welfareInfo_icon_14.png new file mode 100644 index 0000000..7f88e67 Binary files /dev/null and b/lib/icon/welfareInfo_icon_14.png differ diff --git a/lib/icon/welfareInfo_icon_15.png b/lib/icon/welfareInfo_icon_15.png new file mode 100644 index 0000000..8e22c2a Binary files /dev/null and b/lib/icon/welfareInfo_icon_15.png differ diff --git a/lib/icon/welfare_header_icon_00.png b/lib/icon/welfare_header_icon_00.png new file mode 100755 index 0000000..37d541a Binary files /dev/null and b/lib/icon/welfare_header_icon_00.png differ diff --git a/lib/icon/welfare_header_icon_01.png b/lib/icon/welfare_header_icon_01.png new file mode 100755 index 0000000..7503531 Binary files /dev/null and b/lib/icon/welfare_header_icon_01.png differ diff --git a/lib/img/banner_00.png b/lib/img/banner_00.png new file mode 100755 index 0000000..b9bd1ae Binary files /dev/null and b/lib/img/banner_00.png differ diff --git a/lib/img/banner_01.png b/lib/img/banner_01.png new file mode 100755 index 0000000..9b55e03 Binary files /dev/null and b/lib/img/banner_01.png differ diff --git a/lib/img/banner_02.png b/lib/img/banner_02.png new file mode 100755 index 0000000..58a41d6 Binary files /dev/null and b/lib/img/banner_02.png differ diff --git a/lib/img/login_back.png b/lib/img/login_back.png new file mode 100755 index 0000000..360c32c Binary files /dev/null and b/lib/img/login_back.png differ diff --git a/lib/img/user_cover.png b/lib/img/user_cover.png new file mode 100755 index 0000000..7c32143 Binary files /dev/null and b/lib/img/user_cover.png differ diff --git a/node_modules/domelementtype/LICENSE b/node_modules/domelementtype/LICENSE new file mode 100755 index 0000000..c464f86 --- /dev/null +++ b/node_modules/domelementtype/LICENSE @@ -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. diff --git a/node_modules/domelementtype/index.js b/node_modules/domelementtype/index.js new file mode 100755 index 0000000..ab15b0f --- /dev/null +++ b/node_modules/domelementtype/index.js @@ -0,0 +1,15 @@ +//Types of elements found in the DOM +module.exports = { + Text: "text", //Text + Directive: "directive", // + Comment: "comment", // + Script: "script", //", + "expected": [ + { + "type": "tag", + "name": "head", + "attribs": {}, + "children": [ + { + "type": "script", + "name": "script", + "attribs": { + "language": "Javascript" + }, + "children": [ + { + "data": "var foo = \"\"; alert(2 > foo); var baz = 10 << 2; var zip = 10 >> 1; var yap = \"<<>>>><<\";", + "type": "text" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/node_modules/domhandler/test/cases/05-tags_in_comment.json b/node_modules/domhandler/test/cases/05-tags_in_comment.json new file mode 100755 index 0000000..2d22d9e --- /dev/null +++ b/node_modules/domhandler/test/cases/05-tags_in_comment.json @@ -0,0 +1,18 @@ +{ + "name": "Special char in comment", + "options": {}, + "html": "", + "expected": [ + { + "type": "tag", + "name": "head", + "attribs": {}, + "children": [ + { + "data": " commented out tags Test", + "type": "comment" + } + ] + } + ] +} \ No newline at end of file diff --git a/node_modules/domhandler/test/cases/06-comment_in_script.json b/node_modules/domhandler/test/cases/06-comment_in_script.json new file mode 100755 index 0000000..9a21cda --- /dev/null +++ b/node_modules/domhandler/test/cases/06-comment_in_script.json @@ -0,0 +1,18 @@ +{ + "name": "Script source in comment", + "options": {}, + "html": "", + "expected": [ + { + "type": "script", + "name": "script", + "attribs": {}, + "children": [ + { + "data": "", + "type": "text" + } + ] + } + ] +} \ No newline at end of file diff --git a/node_modules/domhandler/test/cases/07-unescaped_in_style.json b/node_modules/domhandler/test/cases/07-unescaped_in_style.json new file mode 100755 index 0000000..77438fd --- /dev/null +++ b/node_modules/domhandler/test/cases/07-unescaped_in_style.json @@ -0,0 +1,20 @@ +{ + "name": "Unescaped chars in style", + "options": {}, + "html": "", + "expected": [ + { + "type": "style", + "name": "style", + "attribs": { + "type": "text/css" + }, + "children": [ + { + "data": "\n body > p\n\t{ font-weight: bold; }", + "type": "text" + } + ] + } + ] +} \ No newline at end of file diff --git a/node_modules/domhandler/test/cases/08-extra_spaces_in_tag.json b/node_modules/domhandler/test/cases/08-extra_spaces_in_tag.json new file mode 100755 index 0000000..5c2492e --- /dev/null +++ b/node_modules/domhandler/test/cases/08-extra_spaces_in_tag.json @@ -0,0 +1,20 @@ +{ + "name": "Extra spaces in tag", + "options": {}, + "html": "the text", + "expected": [ + { + "type": "tag", + "name": "font", + "attribs": { + "size": "14" + }, + "children": [ + { + "data": "the text", + "type": "text" + } + ] + } + ] +} \ No newline at end of file diff --git a/node_modules/domhandler/test/cases/09-unquoted_attrib.json b/node_modules/domhandler/test/cases/09-unquoted_attrib.json new file mode 100755 index 0000000..543ccee --- /dev/null +++ b/node_modules/domhandler/test/cases/09-unquoted_attrib.json @@ -0,0 +1,20 @@ +{ + "name": "Unquoted attributes", + "options": {}, + "html": "the text", + "expected": [ + { + "type": "tag", + "name": "font", + "attribs": { + "size": "14" + }, + "children": [ + { + "data": "the text", + "type": "text" + } + ] + } + ] +} \ No newline at end of file diff --git a/node_modules/domhandler/test/cases/10-singular_attribute.json b/node_modules/domhandler/test/cases/10-singular_attribute.json new file mode 100755 index 0000000..544636e --- /dev/null +++ b/node_modules/domhandler/test/cases/10-singular_attribute.json @@ -0,0 +1,15 @@ +{ + "name": "Singular attribute", + "options": {}, + "html": "