From 2a998468d93faf413ad0d5c0def7bc8f8b4baba1 Mon Sep 17 00:00:00 2001 From: zhangjing Date: Fri, 15 Dec 2023 17:53:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E5=91=98=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 31 + api/err.js | 54 ++ api/index.js | 43 + api/interfaces/auth.js | 31 + api/interfaces/file.js | 17 + api/interfaces/index.js | 46 ++ api/interfaces/mall.js | 49 ++ api/interfaces/member.js | 67 ++ api/interfaces/record.js | 37 + api/interfaces/stock.js | 65 ++ api/interfaces/user.js | 108 +++ api/interfaces/water.js | 37 + api/request.js | 139 ++++ api/updateToken.js | 21 + app.js | 69 ++ app.json | 84 ++ app.wxss | 78 ++ .../milliliter-input/milliliter-input.js | 115 +++ .../milliliter-input/milliliter-input.json | 6 + .../milliliter-input/milliliter-input.wxml | 15 + .../milliliter-input/milliliter-input.wxss | 78 ++ components/milliliter/milliliter.js | 122 +++ components/milliliter/milliliter.json | 4 + components/milliliter/milliliter.wxml | 86 ++ components/milliliter/milliliter.wxss | 115 +++ pages/article/articleList/index.js | 92 +++ pages/article/articleList/index.json | 3 + pages/article/articleList/index.wxml | 25 + pages/article/articleList/index.wxss | 66 ++ pages/article/index.js | 91 ++ pages/article/index.json | 3 + pages/article/index.wxml | 25 + pages/article/index.wxss | 66 ++ pages/article/info/info.js | 139 ++++ pages/article/info/info.json | 5 + pages/article/info/info.wxml | 40 + pages/article/info/info.wxss | 102 +++ pages/clock/base/base.js | 70 ++ pages/clock/base/base.json | 7 + pages/clock/base/base.wxml | 39 + pages/clock/base/base.wxss | 159 ++++ pages/clock/index.js | 182 ++++ pages/clock/index.json | 5 + pages/clock/index.wxml | 135 +++ pages/clock/index.wxss | 455 ++++++++++ pages/index/index.js | 105 +++ pages/index/index.json | 5 + pages/index/index.wxml | 113 +++ pages/index/index.wxss | 342 ++++++++ pages/login/agreement/agreement.js | 31 + pages/login/agreement/agreement.json | 3 + pages/login/agreement/agreement.wxml | 3 + pages/login/agreement/agreement.wxss | 5 + pages/login/index.js | 166 ++++ pages/login/index.json | 4 + pages/login/index.wxml | 28 + pages/login/index.wxss | 164 ++++ pages/mall/buy/index.js | 105 +++ pages/mall/buy/index.json | 4 + pages/mall/buy/index.wxml | 74 ++ pages/mall/buy/index.wxss | 233 ++++++ pages/mall/details/index.js | 77 ++ pages/mall/details/index.json | 4 + pages/mall/details/index.wxml | 80 ++ pages/mall/details/index.wxss | 202 +++++ pages/mall/goods/index.js | 94 +++ pages/mall/goods/index.json | 4 + pages/mall/goods/index.wxml | 31 + pages/mall/goods/index.wxss | 108 +++ pages/mall/submit/index.js | 300 +++++++ pages/mall/submit/index.json | 4 + pages/mall/submit/index.wxml | 109 +++ pages/mall/submit/index.wxss | 342 ++++++++ pages/member/cause/cause.js | 99 +++ pages/member/cause/cause.json | 3 + pages/member/cause/cause.wxml | 40 + pages/member/cause/cause.wxss | 96 +++ pages/member/examine/examine.js | 66 ++ pages/member/examine/examine.json | 4 + pages/member/examine/examine.wxml | 10 + pages/member/examine/examine.wxss | 26 + pages/member/index.js | 204 +++++ pages/member/index.json | 4 + pages/member/index.wxml | 105 +++ pages/member/index.wxss | 241 ++++++ pages/member/open/open.js | 93 +++ pages/member/open/open.json | 3 + pages/member/open/open.wxml | 40 + pages/member/open/open.wxss | 96 +++ pages/order/details/index.js | 77 ++ pages/order/details/index.json | 4 + pages/order/details/index.wxml | 88 ++ pages/order/details/index.wxss | 213 +++++ pages/order/list/index.js | 246 ++++++ pages/order/list/index.json | 4 + pages/order/list/index.wxml | 84 ++ pages/order/list/index.wxss | 278 +++++++ pages/record/detail/detail.js | 148 ++++ pages/record/detail/detail.json | 4 + pages/record/detail/detail.wxml | 199 +++++ pages/record/detail/detail.wxss | 651 +++++++++++++++ pages/record/index.js | 160 ++++ pages/record/index.json | 5 + pages/record/index.wxml | 41 + pages/record/index.wxss | 243 ++++++ pages/record/list/list.js | 93 +++ pages/record/list/list.json | 4 + pages/record/list/list.wxml | 32 + pages/record/list/list.wxss | 105 +++ pages/record/share/share.js | 187 +++++ pages/record/share/share.json | 5 + pages/record/share/share.wxml | 41 + pages/record/share/share.wxss | 174 ++++ pages/stock/addSite/index.js | 183 ++++ pages/stock/addSite/index.json | 4 + pages/stock/addSite/index.wxml | 48 ++ pages/stock/addSite/index.wxss | 79 ++ pages/stock/detailed/index.js | 87 ++ pages/stock/detailed/index.json | 4 + pages/stock/detailed/index.wxml | 44 + pages/stock/detailed/index.wxss | 107 +++ pages/stock/examine/index.js | 66 ++ pages/stock/examine/index.json | 4 + pages/stock/examine/index.wxml | 9 + pages/stock/examine/index.wxss | 33 + pages/stock/index.js | 109 +++ pages/stock/index.json | 4 + pages/stock/index.wxml | 90 ++ pages/stock/index.wxss | 261 ++++++ pages/stock/list/index.js | 73 ++ pages/stock/list/index.json | 4 + pages/stock/list/index.wxml | 35 + pages/stock/list/index.wxss | 69 ++ pages/stock/site/index.js | 80 ++ pages/stock/site/index.json | 4 + pages/stock/site/index.wxml | 27 + pages/stock/site/index.wxss | 123 +++ pages/stock/take/index.js | 133 +++ pages/stock/take/index.json | 4 + pages/stock/take/index.wxml | 69 ++ pages/stock/take/index.wxss | 196 +++++ pages/user/about/about.js | 28 + pages/user/about/about.json | 4 + pages/user/about/about.wxml | 1 + pages/user/about/about.wxss | 3 + pages/user/code/code.js | 191 +++++ pages/user/code/code.json | 4 + pages/user/code/code.wxml | 34 + pages/user/code/code.wxss | 18 + pages/user/collect/collect.js | 88 ++ pages/user/collect/collect.json | 4 + pages/user/collect/collect.wxml | 31 + pages/user/collect/collect.wxss | 99 +++ pages/user/index.js | 269 ++++++ pages/user/index.json | 5 + pages/user/index.wxml | 235 ++++++ pages/user/index.wxss | 782 ++++++++++++++++++ pages/water/index.js | 77 ++ pages/water/index.json | 3 + pages/water/index.wxml | 45 + pages/water/index.wxss | 143 ++++ pages/water/product/index.js | 81 ++ pages/water/product/index.json | 4 + pages/water/product/index.wxml | 31 + pages/water/product/index.wxss | 108 +++ project.config.json | 49 ++ project.private.config.json | 27 + sitemap.json | 7 + static/icons/address_01.png | Bin 0 -> 1504 bytes static/icons/address_02.png | Bin 0 -> 1521 bytes static/icons/arrow.png | Bin 0 -> 1444 bytes static/icons/arrowBlack.png | Bin 0 -> 1255 bytes static/icons/arrowWrite.png | Bin 0 -> 1252 bytes static/icons/arrow_grey.png | Bin 0 -> 1543 bytes static/icons/articleIcon_01.png | Bin 0 -> 2549 bytes static/icons/articleIcon_02.png | Bin 0 -> 2902 bytes static/icons/articleIcon_02_active.png | Bin 0 -> 2749 bytes static/icons/articleIcon_03.png | Bin 0 -> 2612 bytes static/icons/articleIcon_03_active.png | Bin 0 -> 1847 bytes static/icons/check_icon.png | Bin 0 -> 1525 bytes static/icons/close.png | Bin 0 -> 489 bytes static/icons/closeBig.png | Bin 0 -> 1883 bytes static/icons/homeBlack.png | Bin 0 -> 1396 bytes static/icons/homeWrite.png | Bin 0 -> 1364 bytes static/icons/indextop.png | Bin 0 -> 2760 bytes static/icons/interest_00.png | Bin 0 -> 8426 bytes static/icons/interest_01.png | Bin 0 -> 7709 bytes static/icons/interest_02.png | Bin 0 -> 7621 bytes static/icons/interest_03.png | Bin 0 -> 7503 bytes static/icons/interest_04.png | Bin 0 -> 7735 bytes static/icons/loadingGif.gif | Bin 0 -> 222205 bytes static/icons/member_01.png | Bin 0 -> 6008 bytes static/icons/member_02.png | Bin 0 -> 6031 bytes static/icons/member_03.png | Bin 0 -> 7318 bytes static/icons/member_04.png | Bin 0 -> 5770 bytes static/icons/member_05.png | Bin 0 -> 4804 bytes static/icons/member_06.png | Bin 0 -> 10103 bytes static/icons/member_07.png | Bin 0 -> 6661 bytes static/icons/newIcon_03.png | Bin 0 -> 2054 bytes static/icons/orderIcon_00.png | Bin 0 -> 15332 bytes static/icons/orderIcon_01.png | Bin 0 -> 14908 bytes static/icons/refresh_loding.gif | Bin 0 -> 1787 bytes static/icons/reportColse_grey.png | Bin 0 -> 320 bytes static/icons/returnBlue.png | Bin 0 -> 1308 bytes static/icons/share.png | Bin 0 -> 1786 bytes static/icons/stockList_01.png | Bin 0 -> 1250 bytes static/icons/stock_icon_01.png | Bin 0 -> 1299 bytes static/icons/stock_icon_02.png | Bin 0 -> 1418 bytes static/icons/stock_nav.png | Bin 0 -> 180 bytes static/icons/stock_order.png | Bin 0 -> 491 bytes static/icons/takeIcon_00.png | Bin 0 -> 1459 bytes static/icons/takeIcon_01.png | Bin 0 -> 1362 bytes static/icons/takeIcon_02.png | Bin 0 -> 1634 bytes static/icons/takeIcon_03.png | Bin 0 -> 16095 bytes static/icons/takeIcon_04.png | Bin 0 -> 1435 bytes static/icons/userLogin_icon.png | Bin 0 -> 580 bytes static/icons/water.png | Bin 0 -> 551 bytes static/icons/waterDrop.png | Bin 0 -> 15512 bytes static/icons/water_close.png | Bin 0 -> 982 bytes static/icons/water_icon.png | Bin 0 -> 15349 bytes static/imgs/address.png | Bin 0 -> 1377 bytes static/imgs/codeshart_back.png | Bin 0 -> 389 bytes static/imgs/coupon_null.png | Bin 0 -> 2037 bytes static/imgs/cover_img.png | Bin 0 -> 670 bytes static/imgs/default.png | Bin 0 -> 129706 bytes static/imgs/default_myHead.png | Bin 0 -> 12506 bytes static/imgs/member.png | Bin 0 -> 53963 bytes static/imgs/text_null.png | Bin 0 -> 2037 bytes static/imgs/time.png | Bin 0 -> 15330 bytes static/imgs/uaer_back.png | Bin 0 -> 261480 bytes static/imgs/waterIcon.png | Bin 0 -> 7034 bytes static/imgs/wqb.jpg | Bin 0 -> 2769 bytes static/imgs/wx.jpg | Bin 0 -> 2899 bytes static/ls/goldenLogo.png | Bin 0 -> 6993 bytes static/ls/memberArrow.png | Bin 0 -> 1395 bytes static/ls/memberIcon.png | Bin 0 -> 3926 bytes static/ls/memberTitle.png | Bin 0 -> 3343 bytes static/ls/taskIcon_01.png | Bin 0 -> 1568 bytes static/ls/taskIcon_02.png | Bin 0 -> 1925 bytes static/ls/taskIcon_03.png | Bin 0 -> 1420 bytes static/ls/taskIcon_04.png | Bin 0 -> 2923 bytes static/ls/taskIcon_05.png | Bin 0 -> 3846 bytes static/ls/taskIcon_05_active.png | Bin 0 -> 2950 bytes static/ls/taskIcon_06.png | Bin 0 -> 1333 bytes static/ls/taskIcon_07.png | Bin 0 -> 1559 bytes static/ls/taskIcon_08.png | Bin 0 -> 2228 bytes static/ls/taskIcon_09.png | Bin 0 -> 1479 bytes static/ls/taskIcon_10.png | Bin 0 -> 2016 bytes static/ls/taskIcon_11.png | Bin 0 -> 1877 bytes static/ls/taskIcon_12.png | Bin 0 -> 1559 bytes static/ls/taskIcon_13.png | Bin 0 -> 1807 bytes static/ls/taskIcon_14.png | Bin 0 -> 1954 bytes static/ls/taskIcon_15.png | Bin 0 -> 1966 bytes static/ls/taskIcon_16.png | Bin 0 -> 1931 bytes static/ls/userIcon_01.png | Bin 0 -> 1587 bytes static/ls/userIcon_02.png | Bin 0 -> 1681 bytes static/ls/userIcon_03.png | Bin 0 -> 1311 bytes static/ls/userIcon_04.png | Bin 0 -> 1789 bytes static/ls/userIcon_05.png | Bin 0 -> 2145 bytes static/ls/userIcon_06.png | Bin 0 -> 1394 bytes static/ls/userIcon_07.png | Bin 0 -> 1966 bytes static/ls/userIcon_08.png | Bin 0 -> 2773 bytes static/ls/userIcon_09.png | Bin 0 -> 1943 bytes static/ls/userIcon_10.png | Bin 0 -> 1877 bytes static/ls/userIcon_11.png | Bin 0 -> 2017 bytes static/ls/userTap.png | Bin 0 -> 6952 bytes static/report/report-face.png | Bin 0 -> 1228 bytes static/report/report-picture.png | Bin 0 -> 512 bytes static/report/shareLine.png | Bin 0 -> 857 bytes static/share_00.png | Bin 0 -> 11044 bytes static/share_01.png | Bin 0 -> 10184 bytes static/tabBarIcon/00.png | Bin 0 -> 1595 bytes static/tabBarIcon/00_active.png | Bin 0 -> 3861 bytes static/tabBarIcon/01.png | Bin 0 -> 1228 bytes static/tabBarIcon/01_active.png | Bin 0 -> 2739 bytes static/tabBarIcon/02.png | Bin 0 -> 1566 bytes static/tabBarIcon/02_active.png | Bin 0 -> 2809 bytes static/tabBarIcon/03.png | Bin 0 -> 1519 bytes static/tabBarIcon/03_active.png | Bin 0 -> 3232 bytes static/tabBarIcon/04.png | Bin 0 -> 2189 bytes static/tabBarIcon/04_active.png | Bin 0 -> 3524 bytes utils/util.js | 19 + 282 files changed, 14521 insertions(+) create mode 100644 .eslintrc.js create mode 100644 api/err.js create mode 100644 api/index.js create mode 100644 api/interfaces/auth.js create mode 100644 api/interfaces/file.js create mode 100644 api/interfaces/index.js create mode 100644 api/interfaces/mall.js create mode 100644 api/interfaces/member.js create mode 100644 api/interfaces/record.js create mode 100644 api/interfaces/stock.js create mode 100644 api/interfaces/user.js create mode 100644 api/interfaces/water.js create mode 100644 api/request.js create mode 100644 api/updateToken.js create mode 100644 app.js create mode 100644 app.json create mode 100644 app.wxss create mode 100644 components/milliliter-input/milliliter-input.js create mode 100644 components/milliliter-input/milliliter-input.json create mode 100644 components/milliliter-input/milliliter-input.wxml create mode 100644 components/milliliter-input/milliliter-input.wxss create mode 100644 components/milliliter/milliliter.js create mode 100644 components/milliliter/milliliter.json create mode 100644 components/milliliter/milliliter.wxml create mode 100644 components/milliliter/milliliter.wxss create mode 100644 pages/article/articleList/index.js create mode 100644 pages/article/articleList/index.json create mode 100644 pages/article/articleList/index.wxml create mode 100644 pages/article/articleList/index.wxss create mode 100644 pages/article/index.js create mode 100644 pages/article/index.json create mode 100644 pages/article/index.wxml create mode 100644 pages/article/index.wxss create mode 100644 pages/article/info/info.js create mode 100644 pages/article/info/info.json create mode 100644 pages/article/info/info.wxml create mode 100644 pages/article/info/info.wxss create mode 100644 pages/clock/base/base.js create mode 100644 pages/clock/base/base.json create mode 100644 pages/clock/base/base.wxml create mode 100644 pages/clock/base/base.wxss create mode 100644 pages/clock/index.js create mode 100644 pages/clock/index.json create mode 100644 pages/clock/index.wxml create mode 100644 pages/clock/index.wxss create mode 100644 pages/index/index.js create mode 100644 pages/index/index.json create mode 100644 pages/index/index.wxml create mode 100644 pages/index/index.wxss create mode 100644 pages/login/agreement/agreement.js create mode 100644 pages/login/agreement/agreement.json create mode 100644 pages/login/agreement/agreement.wxml create mode 100644 pages/login/agreement/agreement.wxss create mode 100644 pages/login/index.js create mode 100644 pages/login/index.json create mode 100644 pages/login/index.wxml create mode 100644 pages/login/index.wxss create mode 100644 pages/mall/buy/index.js create mode 100644 pages/mall/buy/index.json create mode 100644 pages/mall/buy/index.wxml create mode 100644 pages/mall/buy/index.wxss create mode 100644 pages/mall/details/index.js create mode 100644 pages/mall/details/index.json create mode 100644 pages/mall/details/index.wxml create mode 100644 pages/mall/details/index.wxss create mode 100644 pages/mall/goods/index.js create mode 100644 pages/mall/goods/index.json create mode 100644 pages/mall/goods/index.wxml create mode 100644 pages/mall/goods/index.wxss create mode 100644 pages/mall/submit/index.js create mode 100644 pages/mall/submit/index.json create mode 100644 pages/mall/submit/index.wxml create mode 100644 pages/mall/submit/index.wxss create mode 100644 pages/member/cause/cause.js create mode 100644 pages/member/cause/cause.json create mode 100644 pages/member/cause/cause.wxml create mode 100644 pages/member/cause/cause.wxss create mode 100644 pages/member/examine/examine.js create mode 100644 pages/member/examine/examine.json create mode 100644 pages/member/examine/examine.wxml create mode 100644 pages/member/examine/examine.wxss create mode 100644 pages/member/index.js create mode 100644 pages/member/index.json create mode 100644 pages/member/index.wxml create mode 100644 pages/member/index.wxss create mode 100644 pages/member/open/open.js create mode 100644 pages/member/open/open.json create mode 100644 pages/member/open/open.wxml create mode 100644 pages/member/open/open.wxss create mode 100644 pages/order/details/index.js create mode 100644 pages/order/details/index.json create mode 100644 pages/order/details/index.wxml create mode 100644 pages/order/details/index.wxss create mode 100644 pages/order/list/index.js create mode 100644 pages/order/list/index.json create mode 100644 pages/order/list/index.wxml create mode 100644 pages/order/list/index.wxss create mode 100644 pages/record/detail/detail.js create mode 100644 pages/record/detail/detail.json create mode 100644 pages/record/detail/detail.wxml create mode 100644 pages/record/detail/detail.wxss create mode 100644 pages/record/index.js create mode 100644 pages/record/index.json create mode 100644 pages/record/index.wxml create mode 100644 pages/record/index.wxss create mode 100644 pages/record/list/list.js create mode 100644 pages/record/list/list.json create mode 100644 pages/record/list/list.wxml create mode 100644 pages/record/list/list.wxss create mode 100644 pages/record/share/share.js create mode 100644 pages/record/share/share.json create mode 100644 pages/record/share/share.wxml create mode 100644 pages/record/share/share.wxss create mode 100644 pages/stock/addSite/index.js create mode 100644 pages/stock/addSite/index.json create mode 100644 pages/stock/addSite/index.wxml create mode 100644 pages/stock/addSite/index.wxss create mode 100644 pages/stock/detailed/index.js create mode 100644 pages/stock/detailed/index.json create mode 100644 pages/stock/detailed/index.wxml create mode 100644 pages/stock/detailed/index.wxss create mode 100644 pages/stock/examine/index.js create mode 100644 pages/stock/examine/index.json create mode 100644 pages/stock/examine/index.wxml create mode 100644 pages/stock/examine/index.wxss create mode 100644 pages/stock/index.js create mode 100644 pages/stock/index.json create mode 100644 pages/stock/index.wxml create mode 100644 pages/stock/index.wxss create mode 100644 pages/stock/list/index.js create mode 100644 pages/stock/list/index.json create mode 100644 pages/stock/list/index.wxml create mode 100644 pages/stock/list/index.wxss create mode 100644 pages/stock/site/index.js create mode 100644 pages/stock/site/index.json create mode 100644 pages/stock/site/index.wxml create mode 100644 pages/stock/site/index.wxss create mode 100644 pages/stock/take/index.js create mode 100644 pages/stock/take/index.json create mode 100644 pages/stock/take/index.wxml create mode 100644 pages/stock/take/index.wxss create mode 100644 pages/user/about/about.js create mode 100644 pages/user/about/about.json create mode 100644 pages/user/about/about.wxml create mode 100644 pages/user/about/about.wxss create mode 100644 pages/user/code/code.js create mode 100644 pages/user/code/code.json create mode 100644 pages/user/code/code.wxml create mode 100644 pages/user/code/code.wxss create mode 100644 pages/user/collect/collect.js create mode 100644 pages/user/collect/collect.json create mode 100644 pages/user/collect/collect.wxml create mode 100644 pages/user/collect/collect.wxss create mode 100644 pages/user/index.js create mode 100644 pages/user/index.json create mode 100644 pages/user/index.wxml create mode 100644 pages/user/index.wxss create mode 100644 pages/water/index.js create mode 100644 pages/water/index.json create mode 100644 pages/water/index.wxml create mode 100644 pages/water/index.wxss create mode 100644 pages/water/product/index.js create mode 100644 pages/water/product/index.json create mode 100644 pages/water/product/index.wxml create mode 100644 pages/water/product/index.wxss create mode 100644 project.config.json create mode 100644 project.private.config.json create mode 100644 sitemap.json create mode 100644 static/icons/address_01.png create mode 100644 static/icons/address_02.png create mode 100644 static/icons/arrow.png create mode 100644 static/icons/arrowBlack.png create mode 100644 static/icons/arrowWrite.png create mode 100644 static/icons/arrow_grey.png create mode 100644 static/icons/articleIcon_01.png create mode 100644 static/icons/articleIcon_02.png create mode 100644 static/icons/articleIcon_02_active.png create mode 100644 static/icons/articleIcon_03.png create mode 100644 static/icons/articleIcon_03_active.png create mode 100644 static/icons/check_icon.png create mode 100644 static/icons/close.png create mode 100644 static/icons/closeBig.png create mode 100644 static/icons/homeBlack.png create mode 100644 static/icons/homeWrite.png create mode 100644 static/icons/indextop.png create mode 100644 static/icons/interest_00.png create mode 100644 static/icons/interest_01.png create mode 100644 static/icons/interest_02.png create mode 100644 static/icons/interest_03.png create mode 100644 static/icons/interest_04.png create mode 100644 static/icons/loadingGif.gif create mode 100644 static/icons/member_01.png create mode 100644 static/icons/member_02.png create mode 100644 static/icons/member_03.png create mode 100644 static/icons/member_04.png create mode 100644 static/icons/member_05.png create mode 100644 static/icons/member_06.png create mode 100644 static/icons/member_07.png create mode 100644 static/icons/newIcon_03.png create mode 100644 static/icons/orderIcon_00.png create mode 100644 static/icons/orderIcon_01.png create mode 100644 static/icons/refresh_loding.gif create mode 100644 static/icons/reportColse_grey.png create mode 100644 static/icons/returnBlue.png create mode 100644 static/icons/share.png create mode 100644 static/icons/stockList_01.png create mode 100644 static/icons/stock_icon_01.png create mode 100644 static/icons/stock_icon_02.png create mode 100644 static/icons/stock_nav.png create mode 100644 static/icons/stock_order.png create mode 100644 static/icons/takeIcon_00.png create mode 100644 static/icons/takeIcon_01.png create mode 100644 static/icons/takeIcon_02.png create mode 100644 static/icons/takeIcon_03.png create mode 100644 static/icons/takeIcon_04.png create mode 100644 static/icons/userLogin_icon.png create mode 100644 static/icons/water.png create mode 100644 static/icons/waterDrop.png create mode 100644 static/icons/water_close.png create mode 100644 static/icons/water_icon.png create mode 100644 static/imgs/address.png create mode 100644 static/imgs/codeshart_back.png create mode 100644 static/imgs/coupon_null.png create mode 100644 static/imgs/cover_img.png create mode 100644 static/imgs/default.png create mode 100644 static/imgs/default_myHead.png create mode 100644 static/imgs/member.png create mode 100644 static/imgs/text_null.png create mode 100644 static/imgs/time.png create mode 100644 static/imgs/uaer_back.png create mode 100644 static/imgs/waterIcon.png create mode 100644 static/imgs/wqb.jpg create mode 100644 static/imgs/wx.jpg create mode 100644 static/ls/goldenLogo.png create mode 100644 static/ls/memberArrow.png create mode 100644 static/ls/memberIcon.png create mode 100644 static/ls/memberTitle.png create mode 100644 static/ls/taskIcon_01.png create mode 100644 static/ls/taskIcon_02.png create mode 100644 static/ls/taskIcon_03.png create mode 100644 static/ls/taskIcon_04.png create mode 100644 static/ls/taskIcon_05.png create mode 100644 static/ls/taskIcon_05_active.png create mode 100644 static/ls/taskIcon_06.png create mode 100644 static/ls/taskIcon_07.png create mode 100644 static/ls/taskIcon_08.png create mode 100644 static/ls/taskIcon_09.png create mode 100644 static/ls/taskIcon_10.png create mode 100644 static/ls/taskIcon_11.png create mode 100644 static/ls/taskIcon_12.png create mode 100644 static/ls/taskIcon_13.png create mode 100644 static/ls/taskIcon_14.png create mode 100644 static/ls/taskIcon_15.png create mode 100644 static/ls/taskIcon_16.png create mode 100644 static/ls/userIcon_01.png create mode 100644 static/ls/userIcon_02.png create mode 100644 static/ls/userIcon_03.png create mode 100644 static/ls/userIcon_04.png create mode 100644 static/ls/userIcon_05.png create mode 100644 static/ls/userIcon_06.png create mode 100644 static/ls/userIcon_07.png create mode 100644 static/ls/userIcon_08.png create mode 100644 static/ls/userIcon_09.png create mode 100644 static/ls/userIcon_10.png create mode 100644 static/ls/userIcon_11.png create mode 100644 static/ls/userTap.png create mode 100644 static/report/report-face.png create mode 100644 static/report/report-picture.png create mode 100644 static/report/shareLine.png create mode 100644 static/share_00.png create mode 100644 static/share_01.png create mode 100644 static/tabBarIcon/00.png create mode 100644 static/tabBarIcon/00_active.png create mode 100644 static/tabBarIcon/01.png create mode 100644 static/tabBarIcon/01_active.png create mode 100644 static/tabBarIcon/02.png create mode 100644 static/tabBarIcon/02_active.png create mode 100644 static/tabBarIcon/03.png create mode 100644 static/tabBarIcon/03_active.png create mode 100644 static/tabBarIcon/04.png create mode 100644 static/tabBarIcon/04_active.png create mode 100644 utils/util.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..115cc02 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,31 @@ +/* + * Eslint config file + * Documentation: https://eslint.org/docs/user-guide/configuring/ + * Install the Eslint extension before using this feature. + */ +module.exports = { + env: { + es6: true, + browser: true, + node: true, + }, + ecmaFeatures: { + modules: true, + }, + parserOptions: { + ecmaVersion: 2018, + sourceType: 'module', + }, + globals: { + wx: true, + App: true, + Page: true, + getCurrentPages: true, + getApp: true, + Component: true, + requirePlugin: true, + requireMiniProgram: true, + }, + // extends: 'eslint:recommended', + rules: {}, +} diff --git a/api/err.js b/api/err.js new file mode 100644 index 0000000..bbfd4b5 --- /dev/null +++ b/api/err.js @@ -0,0 +1,54 @@ + +/** + * 处理错误信息 + * @property {Object} errInfo + */ + +const errInfo = (obj) =>{ + if(obj.status_code == 401){ + wx.showModal({ + title : "登录提示", + content : "长时间未操作,登录已过期,请重新登录", + showCancel : false, + confirmColor: "#0b0041", + confirmText : "确定", + success : ()=>{ + // 清理客户端登录缓存 + wx.removeStorageSync("token") + // 返回首页 + wx.redirectTo({ + url: "/pages/login/index", + }) + } + }) + }else if(obj.status_code == 422){ + wx.showToast({ + title: obj.message, + icon : "none" + }) + }else if(obj.status_code == 400 || obj.status_code == 0){ + wx.showToast({ + title: obj.message, + icon : "none" + }) + }else if(obj.status_code == 404){ + wx.showToast({ + title: "接口地址不存在,请联系系统管理员", + icon : "none" + }) + }else if(obj.status_code == 500){ + wx.showToast({ + title: "服务端:" + obj.message, + icon : "none" + }) + }else { + wx.showToast({ + title: "code:" + obj.status_code + ", msg:" + obj.message, + icon : "none" + }) + } +} + +module.exports = { + errInfo +} diff --git a/api/index.js b/api/index.js new file mode 100644 index 0000000..bd8377b --- /dev/null +++ b/api/index.js @@ -0,0 +1,43 @@ +/* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ +*/ + +// 授权登录 +import auth from "./interfaces/auth" + +// 图片上传 +import file from "./interfaces/file" + +// 首页 +import index from "./interfaces/index" + + // 商城 + import mall from "./interfaces/mall" + +// 会员 +import member from "./interfaces/member" + +// 库存 +import stock from "./interfaces/stock" + +// 我的 +import user from "./interfaces/user" + +// 饮水打卡 +import water from "./interfaces/water" + +// 健康答案 +import record from "./interfaces/record" + +export default { + auth, + file, + index, + mall, + member, + stock, + user, + water, + record +} \ No newline at end of file diff --git a/api/interfaces/auth.js b/api/interfaces/auth.js new file mode 100644 index 0000000..00d6c7e --- /dev/null +++ b/api/interfaces/auth.js @@ -0,0 +1,31 @@ +/* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ +*/ + +import { req } from "../request" + +//验证码登录 +const smsAuth = data => req({ + url: "user/auth/sms", + method: "POST", + data: data +}) + +//获取验证码 +const getSms = data => req({ + url: "user/auth/verify", + method: "POST", + data: data +}) + +//隐私+协议 +const registeragree = (website) => req({ + url: "cms/pages/" + website +}) + +export default ({ + smsAuth, + getSms, + registeragree +}) \ No newline at end of file diff --git a/api/interfaces/file.js b/api/interfaces/file.js new file mode 100644 index 0000000..0f903f6 --- /dev/null +++ b/api/interfaces/file.js @@ -0,0 +1,17 @@ +/* + * 图图片上传公用接口 +*/ +import { upload } from "../request" + +//图上传 +const uploadImg = (imgPaht, data) => upload({ + url: "storage/upload", + method: "POST", + key: "upload", + path: imgPaht, + data: data +}) + +export default ({ + uploadImg +}) \ No newline at end of file diff --git a/api/interfaces/index.js b/api/interfaces/index.js new file mode 100644 index 0000000..496edd9 --- /dev/null +++ b/api/interfaces/index.js @@ -0,0 +1,46 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ +*/ + +import { req } from "../request" + +// 商城首页 +const home = () => req({ + url: "mall" +}) + +// 文章-列表 +const articlesList = (data) => req({ + url: "cms/articles", + data: data +}) + +// 文章-详情 + const articlesSee = (article_id) => req({ + url: "cms/articles/" + article_id +}) + +// 文章-分类 +const articlesClass = () => req({ + url: "cms/categories" +}) + +// 文章-收藏 +const articlesFavorite = (article_id) => req({ + url: "cms/articles/favorite/" + article_id +}) + +// 文章-点赞 +const articlesSubscribe = (article_id) => req({ + url: "cms/articles/subscribe/" + article_id +}) + +export default ({ + home, + articlesList, + articlesSee, + articlesClass, + articlesFavorite, + articlesSubscribe +}) \ No newline at end of file diff --git a/api/interfaces/mall.js b/api/interfaces/mall.js new file mode 100644 index 0000000..5de45b0 --- /dev/null +++ b/api/interfaces/mall.js @@ -0,0 +1,49 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +import {req} from "../request" + +//商城首页 +const index = () => req({url: "mall"}) + +//商品详情 +const goodsShow = (goods) => req({url: "mall/goods/" + goods}) + +//创建订单 +const foundOrder = (data) => req({url: "mall/buy/goods", data: data}) + +//确认订单 +const affirmOrder = (data) => req({url: "mall/buy/goods", method: 'POST', data: data}) + +//水滴支付 +const affirmPay = (order_no, data) => req({url: "mall/pay/" + order_no + "/score", method: 'POST', data: data}) + +//文章详情 +const articlesSee = (article_id) => req({url: "cms/articles/" + article_id}) + +// //文章列表 +const articlesList = (data) => req({url: "cms/articles", data: data}) +//收藏 +const favorite = (article_id) => req({url: "cms/articles/favorite/" + article_id}) +//点赞 +const subscribe = (article_id) => req({url: "cms/articles/subscribe/" + article_id}) +//文章列表-全部分类 +const classifysAll = () => req({url: "cms/categories"}) +//文章列表-全部 +const favorites = (data) => req({url: "cms/articles", data: data}) + +export default({ + index, + goodsShow, + foundOrder, + affirmOrder, + affirmPay, + articlesSee, + articlesList, + favorite, + subscribe, + classifysAll, + favorites +}) \ No newline at end of file diff --git a/api/interfaces/member.js b/api/interfaces/member.js new file mode 100644 index 0000000..8c5d290 --- /dev/null +++ b/api/interfaces/member.js @@ -0,0 +1,67 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ +*/ + +import { req } from "../request" + +// 会员开通-前置 +const openSee = (identity) => req({ + url: "user/identities/" + identity +}) + +// 会员开通-取可开通身份内容 +const identitieSee = (identity_id) => req({ + url: "user/identities/create/" + identity_id +}) + +// 会员开通-提交 +const openIndex = (identity_id, data) => req({ + url: "user/identities/create/" + identity_id, + method: 'POST', + data: data +}) + +// 会员开通-展示 +const openModel = () => req({ + url: "user/identities" +}) + +// 会员开通-获取升级单信息 +const orderSee = (order_id) => req({ + url: "user/identities/order/" + order_id +}) + +// 会员开通-编辑凭证 +const orderSubmit = (order_id, data) => req({ + url: "user/identities/order/" + order_id, + method: 'POST', + data: data +}) + +// 获取小程序openid +const openid = (data) => req({ + url: "user/auth/mini_openid", + data: data +}) + +// 微信支付-商品 +const wechatPay = (order_no, data) => req({ + url: "mall/pay/" + order_no + "/wechat", + data: data +}) + +// 确认开通身份 +const identityPay = (order_id, data) => req({url: "user/identities/pay/" + order_id + "/wechat", data: data}) + +export default ({ + openSee, + identitieSee, + openIndex, + openModel, + orderSee, + orderSubmit, + openid, + wechatPay, + identityPay +}) \ No newline at end of file diff --git a/api/interfaces/record.js b/api/interfaces/record.js new file mode 100644 index 0000000..27861bc --- /dev/null +++ b/api/interfaces/record.js @@ -0,0 +1,37 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +import {req} from "../request" + +//舌诊检测 +const tongue = data => req({ + url: "ais/tongue", + method: "POST", + data: data +}) + +//舌象类型详情 +const aiSee = (tongue_id) => req({ + url: "ais/tongue/" + tongue_id +}) + +//舌象类型结果 +const types = (tongue_id, data) => req({ + url: "ais/tongue/" + tongue_id + "/types", + data: data +}) + +//舌诊检测列表 +const aiList = data => req({ + url: "ais/tongue", + data: data +}) + +export default({ + tongue, + aiSee, + types, + aiList +}) \ No newline at end of file diff --git a/api/interfaces/stock.js b/api/interfaces/stock.js new file mode 100644 index 0000000..8bc56ec --- /dev/null +++ b/api/interfaces/stock.js @@ -0,0 +1,65 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ +*/ + +import { req } from "../request" + +// 提货-前置 +const pick = () => req({ + url: "user/stock/pick" +}) + +// 提货-列表记录 +const list = (data) => req({ + url: "user/stock", + data: data +}) + +// 提货-账变记录 +const logs = (data) => req({ + url: "user/stock/logs", + data: data +}) + +// 提货-提交 +const pickTake = (data) => req({ + url: "user/stock/pick", + method: 'POST', + data: data +}) + +// 地址-列表 +const siteList = () => req({ + url: "mall/addresses" +}) + +// 地址-新增 +const siteAdd = (data) => req({ + url: "mall/addresses", + method: 'POST', + data: data +}) + +// 地址-删除 +const siteDel = (address) => req({ + url: "mall/addresses/" + address, + method: 'DELETE' +}) + +// 地址-省市区获取 +const create = (data) => req({ + url: "mall/addresses/create", + data: data +}) + +export default ({ + pick, + list, + logs, + pickTake, + siteList, + siteAdd, + siteDel, + create +}) \ No newline at end of file diff --git a/api/interfaces/user.js b/api/interfaces/user.js new file mode 100644 index 0000000..a489a8e --- /dev/null +++ b/api/interfaces/user.js @@ -0,0 +1,108 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ +*/ + +import { req } from "../request" + +//首页 +const home = () => req({ + url: "user" +}) + +// 我的推广码 +const invite = () => req({ + url: "user/invite" +}) + +//任务列表 +const taskList = (data) => req({ + url: "tasks", + data: data +}) + +//任务分类 +const taskIndex = () => req({ + url: "tasks/categories" +}) + +//上传头像 +const setting = (key,data) => req({ + url: "user/setting/" + key, + method: 'PUT', + data: data +}) + +//小程序码 +const miniShare = (data) => req({ + url: "user/mini_share", + data: data +}) + +//我的收藏 +const favorites = (data) => req({ + url: "user/favorites", + data: data +}) + +//产品中心-分类 +const mallCategories = (data) => req({ + url: "mall/categories", + data: data +}) + +//产品中心-列表 +const mallGoods = (data) => req({ + url: "mall/goods", + data: data +}) + +//订单 +const orders = (data) => req({ + url: "mall/orders", + data: data +}) + +//订单详情 +const goodsDet = (order_no) => req({ + url: "mall/orders/" + order_no +}) + +//订单签收 +const goodsSign = (order_no) => req({ + url: "mall/orders/" + order_no + "/sign", + method: 'PUT' +}) + +// 邀请码背景 +const poster = (data) => req({ + url: "poster", + data: data +}) + +//水滴账户 +const score = (data) => req({url: "user/account/score", data: data}) + +//水滴商城-列表 +const scoresGoods = (data) => req({ + url: "mall/goods/scores", + data: data +}) + +export default ({ + home, + invite, + taskList, + taskIndex, + setting, + miniShare, + favorites, + mallCategories, + mallGoods, + orders, + goodsDet, + goodsSign, + poster, + score, + scoresGoods +}) \ No newline at end of file diff --git a/api/interfaces/water.js b/api/interfaces/water.js new file mode 100644 index 0000000..d9e5e7f --- /dev/null +++ b/api/interfaces/water.js @@ -0,0 +1,37 @@ +/* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ +*/ + +import { req } from "../request" + +//初始化接口 +const Init = () => req({ + url: "drink/init" +}) + +// 基本资料初始化 +const Base = () => req({ + url: "drink/base/init" +}) + +//提交基本资料 +const Store = data => req({ + url: "drink/base/store", + method: "POST", + data: data +}) + +//添加饮用水 +const Drink = data => req({ + url: "drink/drink", + method: "POST", + data: data +}) + +export default ({ + Init, + Base, + Store, + Drink +}) \ No newline at end of file diff --git a/api/request.js b/api/request.js new file mode 100644 index 0000000..fd0b7a4 --- /dev/null +++ b/api/request.js @@ -0,0 +1,139 @@ +/* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ +*/ + +import {errInfo} from './err' +import {updToken} from './updateToken' + +// 请求方式配置 +// https://apitest.siyuankunlun.com //测试地址 +// https://api.siyuankunlun.com //正式地址 + +// wxecf8786d25af47b3 正式appid +const api = "https://apitest.siyuankunlun.com/api/" +// const api = "https://api.siyuankunlun.com/api/" + +const header = { + "Accept" : "application/json" +} +let isToken = true + +/** + * 请求 + * @property {Object} req + */ + +const req = (obj, noToken) => { + // 检查是否无需要token + if(noToken != undefined){ + isToken = noToken + } + + // header + if(obj.token){ + header.Authorization = obj.token || '' + } else { + header.Authorization = wx.getStorageSync("token") || "" + } + + // 处理请求信息 + return new Promise((resolve, reject) => { + // 组合header + obj.header = { + "Accept" : "application/json", + "Authorization" : wx.getStorageSync("token") || "" + } + if(!isToken){ + obj.header.Authorization = '' + } + wx.request({ + url : api + obj.url, + header : obj.header || {}, + method : obj.method || 'GET', + data : obj.data || {}, + success : res => { + // 更新token + if (res.header.Authorization) updToken(res.header.Authorization) + // 处理信息 + if (res.data.status_code == 200) { + resolve(res.data) + } else { + if (res.data.status_code == 401 || res.data.status_code == 400) { + reject({ + login : false, + codeBeen: false + }) + } + errInfo(res.data) + } + }, + fail: err => { + console.log(err) + wx.showToast({ + title : err.errMsg, + icon : "none" + }) + reject(err) + }, + complete(){ + if(!isToken) isToken = true + } + }) + }) +} + + +/** + * 上传 + * @property {Object} upload + */ + +const upload = (obj) => { + // header + header.Authorization = wx.getStorageSync("token") || "" + // 处理上传信息 + return new Promise((resolve, reject) => { + wx.showLoading({ + title: "上传中..", + mask: true + }) + wx.uploadFile({ + url : api + obj.url, + header : header, + name : obj.key || "", + filePath: obj.path || "", + formData: obj.data || {}, + success : res=>{ + wx.hideLoading(); + // 处理返回值 + let jsonData = JSON.parse(res.data) + // 更新token + if (res.header.Authorization) updToken(res.header.Authorization) + // 处理信息 + if (jsonData.status_code == 200) { + resolve(jsonData.data) + } else { + if (jsonData.status_code == 401) { + reject({ + login: false + }) + } + errInfo(jsonData) + } + }, + fail : err=>{ + wx.showToast({ + title : err.errMsg, + icon : "none" + }) + reject(err) + } + }) + }) +} + +module.exports = { + req, + upload +} diff --git a/api/updateToken.js b/api/updateToken.js new file mode 100644 index 0000000..86f5ec3 --- /dev/null +++ b/api/updateToken.js @@ -0,0 +1,21 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +/** + * 更新token + * @property {String} updToken + */ + +const updToken = (token) =>{ + // 更新全局存储器 + getApp().globalData.token = token + // 更新客户端登录缓存 + wx.setStorageSync('token', token) +} + +module.exports = { + updToken +} + diff --git a/app.js b/app.js new file mode 100644 index 0000000..4e64b43 --- /dev/null +++ b/app.js @@ -0,0 +1,69 @@ +/* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +import api from "api/index" + +App({ + onLaunch(e) { + let { scene } = e + // 检查入口场景值 + if(scene === 1011 || scene === 1047 || scene === 1124 || scene === 1089 || scene === 1038){ + this.globalData.isOfficial = true + } + + // 检查用户登录状态 + const token = wx.getStorageSync("token") + if(token){ + this.globalData.isUser = true + } + + // 检查系统更新 + const updateManager = wx.getUpdateManager() + updateManager.onUpdateReady(function () { + wx.showModal({ + title : '更新提示', + content : '新版本已经准备好,是否重启应用?', + cancelColor: '#666', + confirmColor: '#e50d01', + success : res=> { + if (res.confirm) { + updateManager.applyUpdate() + } + } + }) + }) + updateManager.onUpdateFailed(function(){ + wx.showModal({ + title : '更新提示', + content : '版本更新下载失败,请检查您的网络稍后重试', + showCancel: false, + confirmColor: '#e50d01' + }) + }) + + // 获取系统信息 + wx.getSystemInfo({ + success: res=>{ + this.globalData.systInfo = { + statusBarHeight: res.statusBarHeight, + safeArea : res.safeArea + } + } + }) + + // 挂载api + wx.$api = api + }, + globalData: { + systInfo : '', + isUser : false, + token : "", + isOfficial : false, + invite : "", + safeArea : '', + statusBarHeight: wx.getSystemInfoSync().statusBarHeight, + jiaonangheight: wx.getMenuButtonBoundingClientRect().height + } +}) \ No newline at end of file diff --git a/app.json b/app.json new file mode 100644 index 0000000..c9159e0 --- /dev/null +++ b/app.json @@ -0,0 +1,84 @@ +{ + "pages": [ + "pages/index/index", + "pages/login/index", + "pages/login/agreement/agreement", + "pages/user/index", + "pages/record/index", + "pages/clock/index", + "pages/user/about/about", + "pages/user/code/code", + "pages/user/collect/collect", + "pages/order/list/index", + "pages/order/details/index", + "pages/record/list/list", + "pages/record/detail/detail", + "pages/record/share/share", + "pages/clock/base/base", + "pages/stock/index", + "pages/stock/site/index", + "pages/stock/addSite/index", + "pages/stock/take/index", + "pages/stock/list/index", + "pages/stock/detailed/index", + "pages/stock/examine/index", + "pages/article/index", + "pages/article/info/info", + "pages/article/articleList/index", + "pages/mall/buy/index", + "pages/mall/submit/index", + "pages/mall/goods/index", + "pages/mall/details/index", + "pages/member/index", + "pages/member/open/open", + "pages/member/examine/examine", + "pages/member/cause/cause", + "pages/water/index", + "pages/water/product/index" + ], + "window": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#fff", + "navigationBarTitleText": "锶源昆仑", + "navigationBarTextStyle": "black" + }, + "tabBar": { + "list": [ + { + "pagePath": "pages/index/index", + "text": "锶源昆仑", + "iconPath": "/static/tabBarIcon/00.png", + "selectedIconPath": "/static/tabBarIcon/00_active.png" + }, + { + "pagePath": "pages/record/index", + "text": "健康档案", + "iconPath": "/static/tabBarIcon/01.png", + "selectedIconPath": "/static/tabBarIcon/01_active.png" + }, + { + "pagePath": "pages/clock/index", + "text": "饮水打卡", + "iconPath": "/static/tabBarIcon/02.png", + "selectedIconPath": "/static/tabBarIcon/02_active.png" + }, + { + "pagePath": "pages/member/index", + "text": "锶源会员", + "iconPath": "/static/tabBarIcon/04.png", + "selectedIconPath": "/static/tabBarIcon/04_active.png" + }, + { + "pagePath": "pages/user/index", + "text": "锶人中心", + "iconPath": "/static/tabBarIcon/03.png", + "selectedIconPath": "/static/tabBarIcon/03_active.png" + } + ], + "color": "#999999", + "selectedColor": "#111111", + "borderStyle": "white" + }, + "style": "v2", + "sitemapLocation": "sitemap.json" +} \ No newline at end of file diff --git a/app.wxss b/app.wxss new file mode 100644 index 0000000..e754520 --- /dev/null +++ b/app.wxss @@ -0,0 +1,78 @@ +/**app.wxss**/ +.container { + height: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-between; + padding: 200rpx 0; + box-sizing: border-box; +} + +/* 上拉加载 */ +.pagesLoding { + text-align: center; + line-height: 90rpx; + color: gray; + font-size: 28rpx; +} + +.pagesLoding-icon { + width: 28rpx; + height: 28rpx; + vertical-align: middle; + margin-right: 10rpx; + margin-bottom: 3rpx; +} + + +/* + * 文字截取 + */ + +.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; +} + +/* + * 水平居中 + */ + +.pack-center { + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-box-pack: center; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + z-index: -1; +} + +/* +* 页面信息提醒 +*/ + +.pages-hint { + text-align: center; + color: #747788; + font-size: 28rpx; + background: white; +} + +.pages-hint image { + width: 188rpx; + height: 188rpx; +} \ No newline at end of file diff --git a/components/milliliter-input/milliliter-input.js b/components/milliliter-input/milliliter-input.js new file mode 100644 index 0000000..529c5a4 --- /dev/null +++ b/components/milliliter-input/milliliter-input.js @@ -0,0 +1,115 @@ +// components/milliliter-input/milliliter-input.js + +/** 附带输入框的数字拨盘自定义组件,封装了milliliter自定义组件 + * 在引用页面使用 this.selectComponent() 获取组件对象,调用 number 可获取组件值 + * careate by DH.tab + * 2021/07/14 + */ +Component({ + /** + * 组件的属性列表 + */ + properties: { + /** 最大值 */ + max: { type: Number, value: 120 }, + /** 最小值 */ + min: { type: Number, value: 0 }, + /** 值 */ + value: { type: Number, value: 0 }, + /** 单位名称 */ + unitName: { type: String }, + /** 单位值 */ + unitVal: { type: String, value: '厘米' }, + /** 是否精确到3位小数 */ + float: { type: Boolean, value: false }, + /** 是否不可为空 */ + noEmpty: { type: Boolean, value: false }, + }, + + /** + * 组件的初始数据 + */ + data: { + number: 0, + isblur: true, + first: true + }, + + attached() { + if(this.data.unitName == '身高') { + this.setData({ number: 160 }) + } else { + this.setData({ number: 65 }) + } + }, + + /** + * 组件的方法列表 + */ + methods: { + /** 数字拨盘值改变事件 */ + changeNumber(e) { + if (this.data.first) + this.setData({ first: false }) + else + this.setData({ number: e.detail }) + }, + + // 文本框获得焦点 + onNumberFocus(e) { + this.setData({ isblur: false }) + }, + + // 文本框输入事件 + onNumberInput(e) { + let val = e.detail.value + + // 检查是否出现多个小数点 + let a = val.toString().indexOf('.'), + b = val.toString().lastIndexOf('.'), + res = ''; + + if (a != b) { + let t = val.toString().split('') + t.splice(t.lastIndexOf('.'), 1) + res = t.join('') + this.setData({ number: res }) + } + }, + + // 文本框失去焦点 + onNumberBlur(e) { + let val = e.detail.value + + // 检查输入值是否溢出上限或下限 + if (parseInt(val) > this.data.max) + val = this.data.max + if (parseInt(val) < this.data.min) + val = this.data.min + + // 检查是否需要保留2位小数 + if (this.data.float) { + let t = val.toString().split('.') + if (t.length > 1 && t[1].length > 3) + val = `${t[0]}.${t[1].substr(0, 3)}` + this.setData({ + value: parseFloat(val), + number: parseFloat(val) + }) + } else { + let tmp = val.toString().split('.') + if (tmp.length > 1) + this.setData({ + value: parseFloat(tmp[0] + '.' + tmp[1].substr(0, 1)), + number: parseFloat(tmp[0] + '.' + tmp[1].substr(0, 1)) + }) + else + this.setData({ + value: parseFloat(val), + number: parseFloat(val) + }) + } + this.setData({ isblur: true }) + }, + } +}) diff --git a/components/milliliter-input/milliliter-input.json b/components/milliliter-input/milliliter-input.json new file mode 100644 index 0000000..073cc78 --- /dev/null +++ b/components/milliliter-input/milliliter-input.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "milliliter": "../milliliter/milliliter" + } +} \ No newline at end of file diff --git a/components/milliliter-input/milliliter-input.wxml b/components/milliliter-input/milliliter-input.wxml new file mode 100644 index 0000000..2c72577 --- /dev/null +++ b/components/milliliter-input/milliliter-input.wxml @@ -0,0 +1,15 @@ + + + + * + {{unitName}}* + {{number + (isblur?' ':'')}}({{unitName == '体重' ? 'kg': 'cm'}}) + + + + \ No newline at end of file diff --git a/components/milliliter-input/milliliter-input.wxss b/components/milliliter-input/milliliter-input.wxss new file mode 100644 index 0000000..5a7977c --- /dev/null +++ b/components/milliliter-input/milliliter-input.wxss @@ -0,0 +1,78 @@ +/* components/milliliter-input/milliliter-input.wxss */ + +.ctrlbox { + width: 100%; + /* height: calc(312rpx - 41rpx); */ + position: relative; + left: 50%; + transform: translate(-50%, 0); + padding-bottom: rpx; + overflow: hidden; + /* border-bottom: 3rpx dashed #e7e7e7; */ +} + +.ctrlbox>.title { + width: 100%; + height: 40rpx; + position: relative; + font-size: 30rpx; + color: #898d8d; + margin-bottom: 30rpx; + display: flex; +} + +.title-name { + flex: 1; + color: #000000; +} + +.title-number { + color: #000000; +} + +.title-name text { + color: red; + padding-left: 10rpx; +} + +.ctrlbox>.numbox { + width: 210rpx; + height: 73rpx; + line-height: 73rpx; + position: relative; + left: 50%; + transform: translate(-50%, 0); + background: #f5f5f5; + border-radius: 20rpx; + margin-top: 10rpx; + display: flex; + justify-content: center; + align-content: center; +} + +.ctrlbox>.numbox>input { + width: 100%; + height: 100%; + line-height: 73rpx; + font-size: 30rpx; + font-weight: 500; + text-align: center; + color: #898d8d; + position: absolute; + left: 0; +} + +.ctrlbox>.numbox>view { + width: 100%; + height: 100%; + line-height: 73rpx; + font-size: 30rpx; + font-weight: 500; + text-align: center; + color: #898d8d; +} + +.ctrlbox>.title>text { + color: #fc0000; + margin-right: 10rpx; +} \ No newline at end of file diff --git a/components/milliliter/milliliter.js b/components/milliliter/milliliter.js new file mode 100644 index 0000000..92248d3 --- /dev/null +++ b/components/milliliter/milliliter.js @@ -0,0 +1,122 @@ +Component({ + properties: { + // 显示开关 + isShow: { type: Boolean, value: false }, + // 设置返回单位(true:身高单位保留3位小数点)(false:体重单位保留1位小数点) + isWeight: { type: Boolean, value: false }, + // 当前指数 + num: { + type: Number, value: 0, observer: function () { + this.init() + } + }, + // 最短指数 + startNum: { type: Number, value: 0 }, + // 最长指数 + endNum: { type: Number, value: 200 }, + }, + + data: { + type: '', + scrollWidth: 0, + scrollLeft: 0, + isEditVal: false, + currval: 0 + }, + + methods: { + // 初始化 + init() { + let { num } = this.data + this.setData({ displayNum: num }) + if (num) { + if (this.data.scrollWidth) { + // 手动修改修改指数位置 + this.setNum() + } else { + // 初始化修改指数位置 + this.setData({ type: 'init', scrollLeft: 1 }) + } + } else { + this.setData({ scrollLeft: 0 }) + } + }, + + // (初始化/手动修改) 修改指数位置 + setNum() { + // 当前指数 + let { num } = this.data + // 只保留一位小数 + num = Math.floor(num * 10) / 10 + // 总宽度 + let { scrollWidth, startNum, endNum } = this.data + // 10 / 20 * 100 == 50% + // 50% / 100 * 20 == 10 + // 前后宽总值 + let restValue = 20 + // 实际总值 + let value = endNum - startNum + // 得出前后宽占总宽的百分比 [+1以勉误差] + let restPercent = ((restValue + 1) / (restValue + value) * 100) + // 实际宽度 = (总宽度 - 前后宽度) + let width = scrollWidth - (restPercent / 100 * scrollWidth) + // 得出百分比 + let percent = (num - startNum) / value * 100 + // 得出x距离[+1以勉误差] + let scrollLeft = (percent / 100 * width) + 1 + this.data.isEditVal = true + this.setData({ type: '', scrollLeft: scrollLeft, currval: num }) + }, + + // 监听滚动 + bindscroll(e) { + let { type, startNum, endNum, isWeight } = this.data + let { scrollLeft, scrollWidth } = e.detail + if (type == 'init') { + this.data.scrollWidth = scrollWidth + this.setNum() + } else { + // 前后宽总值 + let restValue = 20 + // 实际总值 + let value = endNum - startNum + // 得出前后宽占总宽的百分比 [+1以勉误差] + let restPercent = ((restValue + 1) / (restValue + value) * 100) + // 实际宽度 = (总宽度 - 前后宽度) + let width = scrollWidth - (restPercent / 100 * scrollWidth) + // 当前进度百分比 + let percent = scrollLeft / width * 100 + // 得出当前百分比对应的值 + let val1 = (startNum + (percent / 100 * value)).toFixed(1) + let list = val1.split('.') + let decimals = (list[1] >= 5) ? '' : '' + // let decimals = (list[1] >= 5) ? '.5' : '.0' + val1 = list[0] + decimals + let val2 = (startNum + (percent / 100 * value)).toFixed(0) + + // 保留3位小数点 + // let val2 = (startNum + (percent / 100 * value)).toFixed(3) + + if (this.data.isEditVal) { + val2 = this.data.displayNum + this.data.isEditVal = false + } else + val2 = val2 > value ? value + '' : val2 + // console.log({ + // scrollLeft: '当前x距离' + scrollLeft, + // scrollWidth: '总宽度' + scrollWidth, + // restPercent: '前后宽占总宽的百分比' + restPercent, + // width: '实际宽度' + width, + // percent: '当前进度百分比' + percent, + // val1: '对应的值' + val1 + // }) + let res = isWeight ? val2 : val1 + if(res>=endNum){ + res=endNum + } + this.setData({ currval: res }) + this.triggerEvent('getNum', res); + } + }, + }, +}) diff --git a/components/milliliter/milliliter.json b/components/milliliter/milliliter.json new file mode 100644 index 0000000..f719411 --- /dev/null +++ b/components/milliliter/milliliter.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} diff --git a/components/milliliter/milliliter.wxml b/components/milliliter/milliliter.wxml new file mode 100644 index 0000000..9fa2565 --- /dev/null +++ b/components/milliliter/milliliter.wxml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{item + startNum}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/components/milliliter/milliliter.wxss b/components/milliliter/milliliter.wxss new file mode 100644 index 0000000..fb21e84 --- /dev/null +++ b/components/milliliter/milliliter.wxss @@ -0,0 +1,115 @@ +.content { + width: 681rpx; + height: 139rpx; + margin: 0 auto; + position: relative; + display: flex; + align-items: center; + justify-content: center; +} + +.content .bg { + width: 681rpx; + height: 139rpx; + position: absolute; + left: 0; + top: 0; +} + +.content .box { + width: 654rpx; + height: 139rpx; + white-space: nowrap; +} + +.content .scroll-x { + width: 100%; + height: 100%; + white-space: nowrap; +} + +.content .scroll-x .column { + width: 4.8%; + height: 100%; + position: relative; + display: inline-flex; +} + +.content .scroll-x .column .val { + position: absolute; + left: 0; + bottom: 0; + width: 100%; + font-size: 22rpx; + color: #898d8d; + text-align: center; +} + +.content .scroll-x .opacity-hide { + opacity: 0; +} + +.content .scroll-x .long .line { + width: 4rpx; + height: 86rpx; + position: absolute; + left: 50%; + top: 12%; + transform: translate(-50%, -12%); + background-color: #a4a7a7; +} + +.content .scroll-x .short .line { + width: 4rpx; + height: 42rpx; + position: absolute; + left: 50%; + top: 30%; + transform: translate(-50%, -30%); + background-color: #a4a7a7; +} + +.content .pointer { + width: 30rpx; + height: 100rpx; + position: absolute; + left: calc(50% + 3rpx); + top: 0; + transform: translateX(-50%); +} + +.content .shade-left { + width: 80rpx; + height: 139rpx; + position: absolute; + left: 0; + top: 0; + background-image: linear-gradient(to right, #ffffff, rgba(255, 255, 255, 0.38)); +} + +.content .shade-left-hide { + width: 326rpx; + height: 139rpx; + position: absolute; + left: 0; + top: 0; + background-color: #fff; +} + +.content .shade-right { + width: 80rpx; + height: 139rpx; + position: absolute; + right: 0; + top: 0; + background-image: linear-gradient(to right, rgba(255, 255, 255, 0.38), #ffffff); +} + +.content .shade-right-hide { + width: 320rpx; + height: 139rpx; + position: absolute; + right: 0; + top: 0; + background-image: linear-gradient(to left, #ffffff, rgba(255, 255, 255, 1)); +} \ No newline at end of file diff --git a/pages/article/articleList/index.js b/pages/article/articleList/index.js new file mode 100644 index 0000000..71a2032 --- /dev/null +++ b/pages/article/articleList/index.js @@ -0,0 +1,92 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ +Page({ + + /** + * 页面的初始数据 + */ + data: { + articlesArr : [] , //列表 + page : {}, //分页信息 + type : '', //类型 + name : '', //名称 + lodingStats : false, //加载状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + console.log(options) + this.setData({ + type: options.type + }) + if (options.type == '1') { + wx.setNavigationBarTitle({ + title: '锶源昆仑·记忆' + }) + this.setData({ + name: 'memory' + }) + } else if (options.type == '2') { + wx.setNavigationBarTitle({ + title: '锶源昆仑·健康百科' + }) + this.setData({ + name: 'wiki' + }) + } + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取列表 + this.articlesInfo(); + }, + + // 列表 + articlesInfo(page){ + wx.$api.mall.articlesList({ + category_id : this.data.type, + page : page || 1 + }).then(res => { + let listArr = this.data.articlesArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.data) + this.setData({ + articlesArr : newData, + page : res.data.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + }).catch(err => {}) + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取列表 + this.articlesInfo(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取列表 + this.articlesInfo(pageNumber); + } + } +}) \ No newline at end of file diff --git a/pages/article/articleList/index.json b/pages/article/articleList/index.json new file mode 100644 index 0000000..3928faa --- /dev/null +++ b/pages/article/articleList/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/article/articleList/index.wxml b/pages/article/articleList/index.wxml new file mode 100644 index 0000000..59702ee --- /dev/null +++ b/pages/article/articleList/index.wxml @@ -0,0 +1,25 @@ + + + + {{item.categories[0].slug}} | {{item.title}} + {{item.description}} + + {{item.clicks}} + {{item.subscribes}} + + + + + + + 加载中... + + + 没有更多了~ + + + + + + 暂无数据 + \ No newline at end of file diff --git a/pages/article/articleList/index.wxss b/pages/article/articleList/index.wxss new file mode 100644 index 0000000..4d5cdc1 --- /dev/null +++ b/pages/article/articleList/index.wxss @@ -0,0 +1,66 @@ +page { + padding: 30rpx; + box-sizing: border-box; + background-color: #f6f6f6; +} + +.item { + position: relative; + background-color: #ffffff; + border-radius: 10rpx; + height: 200rpx; + margin-bottom: 30rpx; +} + +.itemImg { + position: absolute; + right: 0; + top: 0; + width: 200rpx; + height: 200rpx; + border-radius: 10rpx; + overflow: hidden; +} + +.itemCont { + position: absolute; + left: 0; + top: 0; + padding: 25rpx 230rpx 0 30rpx; + box-sizing: border-box; + width: 100%; +} + +.itemCont-name { + font-size: 30rpx; +} + +.itemCont-name text { + text-transform: uppercase; +} + +.itemCont-text { + color: #999; + font-size: 26rpx; + margin: 15rpx 0 30rpx; + font-weight: 200; +} + +.itemCont-see { + color: #999; + display: flex; + font-size: 26rpx; + font-weight: 200; +} + +.itemCont-icon { + display: flex; + margin-right: 50rpx; + line-height: 26rpx; +} + +.itemCont-icon image { + width: 26rpx; + height: 26rpx; + margin-right: 10rpx; +} \ No newline at end of file diff --git a/pages/article/index.js b/pages/article/index.js new file mode 100644 index 0000000..5bfc7bf --- /dev/null +++ b/pages/article/index.js @@ -0,0 +1,91 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ +Page({ + + /** + * 页面的初始数据 + */ + data: { + articlesArr : [] , //列表 + page : {}, //分页信息 + type : '', //类型 + name : '', //名称 + lodingStats : false, //加载状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + type: options.type + }) + if (options.type == '1') { + wx.setNavigationBarTitle({ + title: '锶源昆仑·记忆' + }) + this.setData({ + name: 'memory' + }) + } else if (options.type == '2') { + wx.setNavigationBarTitle({ + title: '锶源昆仑·健康百科' + }) + this.setData({ + name: 'wiki' + }) + } + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取列表 + this.articlesInfo(); + }, + + // 列表 + articlesInfo(page){ + wx.$api.index.articlesList({ + category_id : this.data.type, + page : page || 1 + }).then(res => { + let listArr = this.data.articlesArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.data) + this.setData({ + articlesArr : newData, + page : res.data.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + }).catch(err => {}) + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取列表 + this.articlesInfo(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取列表 + this.articlesInfo(pageNumber); + } + } +}) \ No newline at end of file diff --git a/pages/article/index.json b/pages/article/index.json new file mode 100644 index 0000000..3928faa --- /dev/null +++ b/pages/article/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/article/index.wxml b/pages/article/index.wxml new file mode 100644 index 0000000..530622a --- /dev/null +++ b/pages/article/index.wxml @@ -0,0 +1,25 @@ + + + + {{item.categories[0].slug}} | {{item.title}} + {{item.description}} + + {{item.clicks}} + {{item.subscribes}} + + + + + + + 加载中... + + + 没有更多了~ + + + + + + 暂无数据 + \ No newline at end of file diff --git a/pages/article/index.wxss b/pages/article/index.wxss new file mode 100644 index 0000000..4d5cdc1 --- /dev/null +++ b/pages/article/index.wxss @@ -0,0 +1,66 @@ +page { + padding: 30rpx; + box-sizing: border-box; + background-color: #f6f6f6; +} + +.item { + position: relative; + background-color: #ffffff; + border-radius: 10rpx; + height: 200rpx; + margin-bottom: 30rpx; +} + +.itemImg { + position: absolute; + right: 0; + top: 0; + width: 200rpx; + height: 200rpx; + border-radius: 10rpx; + overflow: hidden; +} + +.itemCont { + position: absolute; + left: 0; + top: 0; + padding: 25rpx 230rpx 0 30rpx; + box-sizing: border-box; + width: 100%; +} + +.itemCont-name { + font-size: 30rpx; +} + +.itemCont-name text { + text-transform: uppercase; +} + +.itemCont-text { + color: #999; + font-size: 26rpx; + margin: 15rpx 0 30rpx; + font-weight: 200; +} + +.itemCont-see { + color: #999; + display: flex; + font-size: 26rpx; + font-weight: 200; +} + +.itemCont-icon { + display: flex; + margin-right: 50rpx; + line-height: 26rpx; +} + +.itemCont-icon image { + width: 26rpx; + height: 26rpx; + margin-right: 10rpx; +} \ No newline at end of file diff --git a/pages/article/info/info.js b/pages/article/info/info.js new file mode 100644 index 0000000..33646ce --- /dev/null +++ b/pages/article/info/info.js @@ -0,0 +1,139 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ +Page({ + + /** + * 页面的初始数据 + */ + data: { + id : '', //文章id + indexShow : '', //内容 + mallContent : '', //简介 + favoritesSee : '', //收藏状态 + favoritesNumber : '', //收藏数量 + subscribesSee : '', //点赞状态 + subscribesNumber: '', //点赞数量 + inviteText : '', //邀请码 + isFixedTop : 0, + barHeight : getApp().globalData.statusBarHeight // 状态栏高度 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + id: options.id + }) + if (options.type == 'memory') { + wx.setNavigationBarTitle({ + title: '锶源昆仑·记忆' + }) + } else if (options.type == 'wiki') { + wx.setNavigationBarTitle({ + title: '锶源昆仑·健康百科' + }) + } + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取详情数据 + this.indexInfo(); + + // 获取登录状态 + if(wx.getStorageSync("token")){ + // 获取推广码 + this.inviteInfo(); + } + }, + + /** + * 推广码 + */ + inviteInfo() { + wx.$api.user.invite().then(res => { + this.setData({ + inviteText : res.data.invite + }) + }).catch(err => {}) + }, + + /** + * 详情数据 + */ + indexInfo () { + wx.$api.index.articlesSee(this.data.id).then(res => { + this.setData({ + indexShow : res.data, + favoritesSee : res.data.isFavorite, + subscribesSee : res.data.isSubscribed, + favoritesNumber : res.data.favorites, + subscribesNumber: res.data.subscribes, + mallContent : res.data.content.replace(/\ {}) + }, + + // 操作按钮 + toolTap(e) { + let newName = e.currentTarget.dataset.name + // 收藏 + if(newName == 'favorites') { + wx.$api.index.articlesFavorite(this.data.id).then(res => { + this.setData({ + favoritesSee : res.data.favorite, + favoritesNumber: res.data.count + }) + }).catch(err => {}) + return + } + + // 点赞 + wx.$api.index.articlesSubscribe(this.data.id).then(res => { + this.setData({ + subscribesSee : res.data.subscribed, + subscribesNumber: res.data.count + }) + }).catch(err => {}) + }, + + /** + * 微信分享 + */ + onShareAppMessage(){ + return { + title : this.data.indexShow.title, + path : "/pages/index/index?invite=" + this.data.inviteText, + imageUrl: this.data.indexShow.cover + } + }, + + // 返回上一页 + returnGo() { + wx.navigateBack({ + delta: 1 + }) + }, + + // 回到首页 + returnHome() { + wx.switchTab({ + url: '/pages/index/index' + }) + }, + + /** + * 监听页面滑动事件 + */ + onPageScroll(e) { + this.setData({ + isFixedTop: parseInt(e.scrollTop) + }); + }, +}) \ No newline at end of file diff --git a/pages/article/info/info.json b/pages/article/info/info.json new file mode 100644 index 0000000..f0f1934 --- /dev/null +++ b/pages/article/info/info.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "navigationStyle": "custom", + "navigationBarTextStyle": "white" +} \ No newline at end of file diff --git a/pages/article/info/info.wxml b/pages/article/info/info.wxml new file mode 100644 index 0000000..1aac6f5 --- /dev/null +++ b/pages/article/info/info.wxml @@ -0,0 +1,40 @@ + + + + + + + + + + {{indexShow.categories[0].slug}} | {{indexShow.title}} + + + {{indexShow.created_at}} + 浏览 {{indexShow.clicks}} + + + + + + + + + + + + + + + + {{favoritesNumber}} + + + + {{subscribesNumber}} + + + \ No newline at end of file diff --git a/pages/article/info/info.wxss b/pages/article/info/info.wxss new file mode 100644 index 0000000..e0f9696 --- /dev/null +++ b/pages/article/info/info.wxss @@ -0,0 +1,102 @@ +page { + background-color: #ffffff; +} + +.articleImg { + width: 100%; + display: inline-block; +} + +.articleCont { + padding: 30rpx; + box-sizing: border-box; + border-bottom: 160rpx transparent solid; +} + +.articleName { + font-size: 36rpx; + margin-top: 20rpx; +} + +.articleName text { + text-transform: uppercase; +} + +.articleTool { + color: #666666; + font-size: 26rpx; + margin-top: 15rpx; +} + +.articleTool text { + padding-right: 30rpx; + font-weight: 200; +} + +.articleBanner { + text-align: center; + margin: 60rpx 0; +} + +.articleBanner image { + width: 100%; +} + +.tool { + position: fixed; + width: 100%; + height: 90rpx; + line-height: 90rpx; + left: 0; + bottom: 60rpx; + z-index: 99; + padding: 0 30rpx; + box-sizing: border-box; +} + +.toolCont { + background-color: #ffffff; + display: flex; + box-shadow: 0 0 10rpx rgba(0, 0, 0, .1); + border-radius: 80rpx; +} + +.toolCont-label { + flex: 3; + text-align: center; + color: #999; + font-size: 30rpx; + background-color: transparent; + padding: 0; + margin: 0; + line-height: 100rpx; + font-weight: 200; +} + +.toolCont-label-icon { + width: 36rpx; + height: 36rpx; + margin-right: 10rpx; + vertical-align: -4rpx; +} + +.navigation{ + position: fixed; + top: 0; + left: 0; + z-index: 99; + width: 100%; + height: 90rpx; + background-color: transparent; + transition: .2s; +} + +.navigation.active { + background-color: #ffffff; +} + +.navigation-arrow { + width: 44rpx; + height: 44rpx; + margin: 20rpx 15rpx 0 20rpx; +} \ No newline at end of file diff --git a/pages/clock/base/base.js b/pages/clock/base/base.js new file mode 100644 index 0000000..f4fc4fd --- /dev/null +++ b/pages/clock/base/base.js @@ -0,0 +1,70 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + baseState : false, // 建议每日饮水量弹出 + drinkNeed : '', // 建议每日饮水量 + recordnum1: 160, // 身高 + recordnum2: 65, // 体重 + dateValue : '请选择' // 生日选择 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生日选择 + */ + birthdayChange(e) { + this.setData({ + dateValue: e.detail.value + }) + }, + + /** + * 提交信息 + */ + submitBtn() { + let birthday = this.data.dateValue, + height = this.selectComponent('#ctrlmill1').data.number, + weight = this.selectComponent('#ctrlmill2').data.number + wx.$api.water.Store({ + birthday: birthday, + height : height, + weight : weight + }).then(res => { + console.log(res) + this.setData({ + drinkNeed: res.data.drink.need, + baseState: true + }) + }).catch(err => {}) + }, + + /** + * 关闭弹窗-并跳走 + */ + perfect() { + wx.switchTab({ + url: '/pages/record/index' + }) + } +}) \ No newline at end of file diff --git a/pages/clock/base/base.json b/pages/clock/base/base.json new file mode 100644 index 0000000..6eb7e08 --- /dev/null +++ b/pages/clock/base/base.json @@ -0,0 +1,7 @@ +{ + "usingComponents": { + "milliliter": "/components/milliliter/milliliter", + "milliliter-input": "/components/milliliter-input/milliliter-input" + }, + "navigationBarTitleText": "完善信息" +} \ No newline at end of file diff --git a/pages/clock/base/base.wxml b/pages/clock/base/base.wxml new file mode 100644 index 0000000..9656110 --- /dev/null +++ b/pages/clock/base/base.wxml @@ -0,0 +1,39 @@ + + + 个人信息完善 + 以下信息将帮助我们为您定制个人健康饮水计划 + + + 生日* + + {{ dateValue }} + + + + + + + + + + + + + 提交信息 + + + + + + + 通知 + + + + 已完善资料,进行舌诊检测 + + + 确定 + + + \ No newline at end of file diff --git a/pages/clock/base/base.wxss b/pages/clock/base/base.wxss new file mode 100644 index 0000000..04f0df9 --- /dev/null +++ b/pages/clock/base/base.wxss @@ -0,0 +1,159 @@ +page { + padding: 30rpx; + box-sizing: border-box; + background-color: #f6f6f6; +} + +.baseTitle { + margin-bottom: 50rpx; + font-size: 26rpx; +} + +.baseTitle text { + display: block; + font-weight: 600; + font-size: 32rpx; + margin-bottom: 10rpx; +} + +.baseWrite { + background-color: #ffffff; + padding: 30rpx; + box-sizing: border-box; + border-radius: 20rpx; + box-shadow: 0 0 10rpx rgba(0, 0, 0, .1); + margin-bottom: 30rpx; +} + +.baseWrite-title { + margin-bottom: 30rpx; + display: flex; +} + +.baseWrite-title-name { + flex: 1; +} + +.baseWrite-title text { + color: red; + padding-left: 5rpx; +} + +.baseWrite-birthday { + border: 2rpx solid #e7e7e7; + margin-top: 30rpx; + border-radius: 20rpx; + position: relative; + line-height: 74rpx; + padding: 0 30rpx; + box-sizing: border-box; + font-size: 30rpx; +} + +.baseWrite-birthday-icon { + width: 34rpx; + height: 34rpx; + position: absolute; + right: 30rpx; + top: 20rpx; +} + +.baseBtn { + text-align: center; + background-color: #528cff; + color: #ffffff; + line-height: 100rpx; + margin-top: 80rpx; + border-radius: 20rpx; + font-weight: 600; + font-size: 32rpx; + box-shadow: 0 0 10rpx rgba(12, 83, 223, .5); +} + + +/* 饮水量弹出 */ +.refertoEject { + position: fixed; + width: 100vw; + height: 100vh; + left: 0; + top: 0; + background-color: rgba(0, 0, 0, .6); + z-index: 10000; + display: none; +} + +.refertoEject.active { + display: block; +} + +.refertoCont { + -webkit-box-orient: vertical; + -webkit-box-pack: center; + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + z-index: 100000; + padding: 0 15%; + box-sizing: border-box; + text-align: center; + display: none; +} + +.refertoCont.active { + display: -webkit-box; +} + +.refertoCont-text { + background-color: #f6f9fb; + border-radius: 20rpx; + box-sizing: border-box; + position: relative; +} + +.refertoCont-ls { + width: 200rpx; +} + +.refertoCont-title { + text-align: center; + font-weight: 600; + padding: 40rpx 0; + font-size: 34rpx; + box-sizing: border-box; +} + +.refertoCont-tips { + line-height: 48rpx; + text-align: center; + padding: 30rpx 60rpx; + box-sizing: border-box; +} + +.refertoCont-tips text { + color: #528cff; + font-weight: 600; + padding-right: 10rpx; +} + +.publicPop-btn { + line-height: 80rpx; + font-size: 32rpx; + display: flex; + border-top: 2rpx solid #e6e6e6; + padding: 30rpx 50rpx; + box-sizing: border-box; +} + +.publicPop-btn-go { + width: 100%; + color: #ffffff; + background-color: #528cff; + text-align: center; + height: 90rpx; + line-height: 90rpx; + font-size: 30rpx; + border-radius: 90rpx; +} \ No newline at end of file diff --git a/pages/clock/index.js b/pages/clock/index.js new file mode 100644 index 0000000..b103e1e --- /dev/null +++ b/pages/clock/index.js @@ -0,0 +1,182 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + needBase : '', // 是否需要完善资料 + baseState : false,// 完善资料弹出 + Drink : '', // 饮用量数值 + Element : '', // 摄入成分 + type : 'normal', // 默认普通饮用水 + scale : '10', // 默认饮用量 + number : 100, // 默认饮用量值 + seeNumber : 100, // 弹出默认饮用量值 + waterState : false,// 选择饮用量 + isFixedTop : 0, + barHeight : getApp().globalData.statusBarHeight, // 状态栏高度 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取登录状态 + if(wx.getStorageSync("token")){ + // 获取初始化 + this.initInfo(); + } + }, + + /** + * 初始化 + */ + initInfo () { + wx.$api.water.Init().then(res => { + let {drink, element, need_tongue} = res.data + if(this.data.type == 'normal') { + this.setData({ + Drink : drink.normal + }) + } else { + this.setData({ + Drink : drink.sykl + }) + } + this.setData({ + Element : element, + needBase: need_tongue + }) + }).catch(err => {}) + }, + + /** + * 滑动选择器 + */ + slider3change(e) { + this.setData({ + number: e.detail.value, + scale: (e.detail.value / 10) + }) + }, + + /** + * 兑换券数量加减 + */ + scaleNumber(e){ + let num = this.data.number, + val = e.currentTarget.dataset.type + if (val == 'plus'){ + num = num + 10; + }else{ + if (num > 100){ + num = num - 10; + } + this.setData({ + number: num + }) + } + this.setData({ + number: num, + scale: num / 10 + }) + }, + + /** + * 选择饮品 + */ + drinkSelect(e) { + this.setData({ + type : e.currentTarget.dataset.type + }) + // 获取登录状态 + if(wx.getStorageSync("token")){ + // 获取初始化 + this.initInfo(); + } + }, + + /** + * 喝水打卡 + */ + drinkTap() { + // 获取登录状态 + if(wx.getStorageSync("token")){ + // 是否需要完善资料 + if(this.data.needBase) { + this.setData({ + baseState: true + }) + return + } + this.setData({ + waterState : true, + number : 100, + scale : 100 / 10 + }) + return + } + + // 去登录 + wx.navigateTo({ + url: "/pages/login/index" + }) + }, + + /** + * 关闭选择饮品弹窗 + */ + drinkCancel() { + this.setData({ + waterState : false + }) + }, + + /** + * 确认饮用量 + */ + drinkSure() { + wx.$api.water.Drink({ + type: this.data.type, + ml : this.data.number + }).then(res => { + this.setData({ + waterState: false + }) + + // 获取初始化 + this.initInfo(); + }).catch(err => {}) + }, + + /** + * 关闭完善资料弹出 + */ + establish() { + this.setData({ + baseState: false + }) + }, + + /** + * 完善资料跳转 + */ + perfect() { + this.setData({ + baseState: false + }) + wx.switchTab({ + url: '/pages/record/index' + }) + } +}) \ No newline at end of file diff --git a/pages/clock/index.json b/pages/clock/index.json new file mode 100644 index 0000000..f0f1934 --- /dev/null +++ b/pages/clock/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "navigationStyle": "custom", + "navigationBarTextStyle": "white" +} \ No newline at end of file diff --git a/pages/clock/index.wxml b/pages/clock/index.wxml new file mode 100644 index 0000000..d958fc0 --- /dev/null +++ b/pages/clock/index.wxml @@ -0,0 +1,135 @@ + + + + + + + + + + + {{Drink.rate ? Drink.rate : '0'}}% + {{Drink.current ? Drink.current : '0'}} / {{Drink.need ? Drink.need : '0'}}ml + + + + + + 摄入成分 + + + + {{Element.sr ? Element.sr : '0'}}mg + + + + {{Element.mg ? Element.mg : '0'}}mg + + + + {{Element.k ? Element.k : '0'}}mg + + + + {{Element.ca ? Element.ca : '0'}}mg + + + + {{Element.na ? Element.na : '0'}}mg + + + + + + 0mg + + + + 0mg + + + + 0mg + + + + 0mg + + + + 0mg + + + + + + + + + + 点击选择饮品 + + + + 普通饮用水 + + + + 锶源昆仑天然水 + + + + + + + 喝水 + + + + + + + 取消 + 选择饮用量 + 确定 + + + + + + {{type == 'sykl' ? '锶源昆仑天然水' : '普通饮用水'}} + 饮用量:{{Drink.current ? Drink.current : '0'}}ml - {{Drink.need ? Drink.need : '0'}}ml + + + + + + + + + {{number}}ml + + + + + - + + + + + + + + + + + 健康档案提示 + + + 您还没有建立健康档案 + + + 暂不建立 + 去建立 + + + \ No newline at end of file diff --git a/pages/clock/index.wxss b/pages/clock/index.wxss new file mode 100644 index 0000000..e41e72b --- /dev/null +++ b/pages/clock/index.wxss @@ -0,0 +1,455 @@ +page { + background-color: #ffffff; +} + +/* 顶部 */ +.navigation { + position: fixed; + top: 0; + left: 0; + z-index: 999; + width: 100%; + height: 90rpx; + background-color: transparent; + transition: .5s; +} + +.navigation.active { + background-color: #ffffff; +} + +.navigation-arrow { + width: 120rpx; + margin-left: 40rpx; +} + +/* 小水怪 */ +.monster { + background-color: #ffffff; + padding: 40rpx 80rpx; + box-sizing: border-box; +} + +.monsterBack { + background-color: #eeeeee; + position: relative; + padding-top: 100%; +} + +.monsterImg { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + display: block; + z-index: 2; +} + +.monsterBar { + position: absolute; + left: 0; + bottom: 0; + z-index: 1; + width: 100%; + transition: 1s; +} + +.monsterBar::after { + position: absolute; + content: ''; + width: 100%; + height: 100%; + margin: auto; + bottom: 0; + background-color: #c9dbff; + border-radius: 0%; + transition: .2s ease-in-out; +} + +.monsterMark { + position: absolute; + margin-top: -120rpx; + left: 40rpx; + z-index: 3; + color: #3c7dff; +} + +.monsterMark-total { + font-weight: 600; + font-size: 60rpx; +} + +.monsterMark-see text { + font-weight: 600; +} + +.monsterPart { + padding: 0 30rpx; + box-sizing: border-box; +} + +.monsterPart-name { + margin-bottom: 30rpx; +} + +.monsterPart-list { + white-space: nowrap; + background-color: #f6f6f6; + padding: 20rpx; + box-sizing: border-box; + border-radius: 15rpx; +} + +.monsterPart-item { + display: inline-block; + background-color: #ffffff; + margin-right: 20rpx; + padding: 10rpx 30rpx 10rpx 50rpx; + box-sizing: border-box; + border-radius: 10rpx; + flex: 5; + font-size: 26rpx; + position: relative; + box-sizing: border-box; +} + +.monsterPart-item::after { + position: absolute; + content: ''; + left: 25rpx; + top: 20rpx; + width: 10rpx; + height: 10rpx; + border-radius: 50%; + background-color: #3c7dff; +} + +.monsterPart-item:last-child { + margin-right: 0; +} + +.monsterPart-item:nth-child(2)::after { + background-color: #d60000; +} + +.monsterPart-item:nth-child(3)::after { + background-color: #00c700; +} + +.monsterPart-item:nth-child(4)::after { + background-color: #f5d72e; +} + +.monsterPart-item:nth-child(5)::after { + background-color: #9721da; +} + +.monsterPart-item-text { + color: #919191; +} + +/* 选择饮品 */ +.drink { + padding: 30rpx; + box-sizing: border-box; +} + +.drinkCont { + background-color: #f6f6f6; + border-radius: 15rpx; + padding: 30rpx 0; + text-align: center; +} + +.drinkCont-name { + font-weight: 600; + margin-bottom: 30rpx; + font-size: 34rpx; +} + +.drinkCont-list { + display: flex; +} + +.drinkCont-item { + flex: 2; + text-align: center; +} + +.drinkCont-item-img { + width: 120rpx; + border: 2rpx solid #f6f6f6; + border-radius: 50%; +} + +.drinkCont-item-name { + font-size: 28rpx; +} + +.drinkCont-item.active .drinkCont-item-img { + border-color: #3c7dff; +} + +.drinkCont-item.active .drinkCont-item-name { + color: #3c7dff; +} + +/* 喝水按钮 */ +.drinkBtn { + width: 100%; + padding: 0 30rpx 30rpx; + box-sizing: border-box; +} + +.drinkBtn-go { + width: 100%; + background-color: #3c7dff; + text-align: center; + color: #ffffff; + line-height: 90rpx; + border-radius: 15rpx; +} + +/* 饮水弹出 */ +.waterBack { + position: fixed; + width: 100vw; + height: 100vh; + left: 0; + top: 0; + z-index: 9; + background-color: rgba(0, 0, 0, .5); + display: none; +} + +.waterBack.active { + display: block; +} + +.waterPop { + position: fixed; + width: 100vw; + bottom: -100%; + left: 0; + background-color: #ffffff; + z-index: 9; + border-radius: 20rpx 20rpx 0 0; + padding: 0 40rpx 60rpx; + box-sizing: border-box; + transition: .5s; +} + +.waterPop.active { + bottom: 0; +} + +.waterPop-top { + display: flex; +} + +.waterPop-top-label { + font-size: 32rpx; + flex: 3; + line-height: 110rpx; + border-bottom: 2rpx solid #eeeeee; +} + +.waterPop-name { + text-align: center; +} + +.waterPop-sure { + color: #548dff; + text-align: right; +} + +.waterPop-type { + position: relative; + padding: 20rpx 0; + box-sizing: border-box; +} + +.waterPop-type-cont-img { + width: 140rpx; +} + +.waterPop-type-cont { + position: absolute; + left: 0; + top: 0; + padding: 40rpx 0 0 140rpx; + box-sizing: border-box; + width: 100%; +} + +.waterPop-type-text { + margin-top: 20rpx; + font-size: 28rpx; + color: #919191; +} + +.waterPop-scale { + padding: 20rpx 25% 40rpx; + box-sizing: border-box; +} + +.waterPop-scale-pot { + text-align: center; + position: relative; + padding-top: 130%; + width: 100%; +} + +.waterPop-scale-pot-back { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + z-index: 10; + display: block; +} + +.waterPop-scale-pot-ruler { + position: absolute; + left: 0; + bottom: 0; + background-color: #548dff; + width: 100%; + transition: .8s; +} + +.waterPop-scale-pot-number { + position: absolute; + top: -50rpx; + font-weight: 600; + color: #3c7dff; + text-align: center; + width: 100%; + font-size: 32rpx; + z-index: 100; +} + +.waterPop-scale-pot-grey { + position: absolute; + left: 0; + bottom: 0; + background-color: #eef4ff; + width: 100%; + height: 100%; +} + +.waterPop-scale-grow { + display: flex; + line-height: 50rpx; +} + +.waterPop-scale-grow-btn { + width: 40rpx; + height: 40rpx; + line-height: 36rpx; + text-align: center; + background-color: #528cff; + color: #ffffff; + border-radius: 50%; + font-weight: 600; + font-size: 32rpx; +} + +.waterPop-scale-grow-slider { + width: calc(100% - 170rpx); + margin: 5rpx 30rpx 0 40rpx; +} + +/* 完善信息弹出 */ +.refertoEject { + position: fixed; + width: 100vw; + height: 100vh; + left: 0; + top: 0; + background-color: rgba(0, 0, 0, .6); + z-index: 10000; + display: none; +} + +.refertoEject.active { + display: block; +} + +.refertoCont { + -webkit-box-orient: vertical; + -webkit-box-pack: center; + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + z-index: 100000; + padding: 0 15%; + box-sizing: border-box; + text-align: center; + display: none; +} + +.refertoCont.active { + display: -webkit-box; +} + +.refertoCont-text { + background-color: #f6f9fb; + border-radius: 20rpx; + box-sizing: border-box; + position: relative; +} + +.refertoCont-ls { + width: 260rpx; +} + +.refertoCont-title { + text-align: center; + font-weight: 600; + padding: 40rpx 0; + font-size: 34rpx; + box-sizing: border-box; +} + +.refertoCont-tips { + line-height: 48rpx; + text-align: center; + padding: 0 60rpx 30rpx; + box-sizing: border-box; +} + +.publicPop-btn { + line-height: 80rpx; + font-size: 32rpx; + display: flex; + border-top: 2rpx solid #e6e6e6; +} + + +.publicPop-btn-go { + width: 50%; + text-align: center; + height: 100rpx; + line-height: 100rpx; + font-size: 30rpx; +} + +.publicPop-btn-border { + color: #528cff; + position: relative; +} + +.publicPop-btn-border::after { + position: absolute; + content: ''; + left: 0; + top: 0; + width: 2rpx; + height: 100rpx; + background-color: #e6e6e6; +} \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js new file mode 100644 index 0000000..4399d6a --- /dev/null +++ b/pages/index/index.js @@ -0,0 +1,105 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + videoState : true, //第一个视频是否加载 + videoFlx : false, //视频定位 + videos : '', + isFixedTop : 0, + barHeight : getApp().globalData.statusBarHeight, // 状态栏高度 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { + // 邀请码 + if(options.invite) { + this.setData({ + inviteCode : options.invite + }) + wx.setStorage({ + key : 'inviteData', + data : options.invite + }) + } + console.log(wx.getStorageSync("inviteData")) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow () { + // 获取首页数据 + this.indexInfo(); + }, + + /** + * 首页数据 + */ + indexInfo () { + wx.$api.index.home().then(res => { + this.setData({ + goodsArr : res.data.goods, + videos : res.data.videos[0], + healthsArr : res.data.healths, + datas : res.data.memories, + categories : res.data.categories + }) + }).catch(err => {}) + }, + + /** + * 监听页面滚动 + */ + bestScroll(e){ + if(e.detail.scrollTop >= this.data.systInfo.safeArea.width && !this.data.videoFlx){ + this.setData({ + videoFlx: true + }) + }else if(e.detail.scrollTop < this.data.systInfo.safeArea.width && this.data.videoFlx){ + this.setData({ + videoFlx: false + }) + } + }, + + // 第一个播放进度变化时触发 + bindloadedOne() { + this.setData({ + videoState: false + }) + }, + + // 第二个播放进度变化时触发 + bindloadedTwo() { + this.setData({ + videoFilex: false + }) + }, + + /** + * 监听页面滑动事件 + */ + onPageScroll(e) { + this.setData({ + isFixedTop: parseInt(e.scrollTop) + }); + }, + + /** + * 跳转文章列表 + */ + tapMore(e){ + wx.navigateTo({ + url: '/pages/article/index?type=' + e.currentTarget.dataset.type + }) + }, +}) \ No newline at end of file diff --git a/pages/index/index.json b/pages/index/index.json new file mode 100644 index 0000000..f0f1934 --- /dev/null +++ b/pages/index/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "navigationStyle": "custom", + "navigationBarTextStyle": "white" +} \ No newline at end of file diff --git a/pages/index/index.wxml b/pages/index/index.wxml new file mode 100644 index 0000000..0e25df8 --- /dev/null +++ b/pages/index/index.wxml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + siyuankunlun + 古海冰泉造就不凡 + + + + + {{item.name}} + 市场统一指导价 + {{item.price.show}} + 立即抢购 + + + + + + + + + Health guide + 健康饮水指南 + + + + 水温饮用最佳效果 + + + 40-50度 + + + + + + 每日最佳用水数量 + + 4瓶-6瓶 + (2000毫升-3000毫升) + + + + + 每日最佳用水时间 + + 早间 7点-9点 + 午间 12点-14点 + 晚间 18点-21点 + + + + + 用水特别注意事项 + + 禁用泡茶 + 开瓶后48小时内需饮用 + + + + + + + + + + all sciences + 健康百科 + + + + + {{item.sub_title}} + {{item.title}} + + + + + + + + + + + + — The miracle of nature — + 都兰圣地 源水活取 + 由昆仑山远古冰川和柴达木远古深海自然涌出 + + + + + + + + + + \ No newline at end of file diff --git a/pages/index/index.wxss b/pages/index/index.wxss new file mode 100644 index 0000000..8609f74 --- /dev/null +++ b/pages/index/index.wxss @@ -0,0 +1,342 @@ +/* 顶部 */ +.navigation { + position: fixed; + top: 0; + left: 0; + z-index: 999; + width: 100%; + height: 90rpx; + background-color: transparent; + transition: .5s; +} + +.navigation.active { + background-color: #ffffff; +} + +.navigation-arrow { + width: 120rpx; + margin-left: 40rpx; +} + +.page-section { + position: fixed; + width: 100vw; + height: 100vh; + left: 0; + top: 0; + z-index: -1; +} + +.videoCover, +.page-swiper { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; +} + +.indexTop { + position: absolute; + bottom: 30rpx; + left: calc(50% - 42rpx); + transform: rotate(180deg); + width: 84rpx; + height: 84rpx; + opacity: .5; +} + +/* 白色背景 */ +.pageWrite { + position: fixed; + height: 80vh; + top: 20vh; + left: 0; + width: 100%; + background-color: #ffffff; + z-index: 1; +} + +/* 布局 */ +.layout { + position: absolute; + top: 100vh; + left: 0; + z-index: 9; + width: 100vw; + background-color: #ffffff; +} + +/* 商品 */ +.goods { + position: relative; + padding-top: 100%; +} +.goodsBack, +.goodsCont { + width: 100%; + height: 100%; + display: block; + position: absolute; + left: 0; + top: 0; +} + +.goodsCont { + padding: 50rpx 40rpx; + box-sizing: border-box; +} + +.goodsCont-title-word { + text-transform: uppercase; + font-size: 36rpx; +} + +.goodsCont-title-text { + font-size: 40rpx; + line-height: 64rpx; +} + +.goodsCont-title-text .article-more { + width: 32rpx; + height: 32rpx; + margin-left: 15rpx; + margin-top: 4rpx; +} + +.goodsCont-title-text text { + padding-left: 20rpx; +} + +.goodsCont-product { + display: flex; + position: absolute; + bottom: 15%; + left: 0; +} + +.goodsCont-product-img { + width: 340rpx; + display: block; +} + +.goodsCont-product-name { + font-weight: 600; + font-size: 34rpx; +} + +.goodsCont-product-tips { + margin: 15rpx 0 20rpx; +} + +.goodsCont-product-price { + font-weight: 600; +} + +.goodsCont-product-price text { + font-size: 60rpx; +} + +.goodsCont-product-btn { + background-color: #333333; + display: inline-block; + color: #ffffff; + border-radius: 100rpx; + line-height: 72rpx; + padding: 0 40rpx; + margin-top: 30rpx; + font-size: 30rpx; +} + +/* 用水指南 */ +.other { + padding: 0 30rpx; + box-sizing: border-box; +} + +.guide { + overflow: hidden; + margin: 30rpx -10rpx; +} + +.guide-label { + width: calc(50% - 20rpx); + margin: 0 10rpx 20rpx; + float: left; + background-image: linear-gradient(#f6f6f6, #f6f6f6); + border-radius: 15rpx; + padding: 25rpx 30rpx; + box-sizing: border-box; + position: relative; +} + +.guide-top { + position: relative; + margin-bottom: 20rpx; +} + +.guide-english { + text-transform: uppercase; + color: #dfdedf; + font-size: 34rpx; +} + +.guide-name { + font-size: 32rpx; + position: absolute; + top: 18rpx; + left: 0; + z-index: 9; +} + +.guide-text { + vertical-align: middle; + height: 94rpx; + display: table; + line-height: 32rpx; +} + +.guide-cell { + display: table-cell; + vertical-align: middle; +} + +.guide-text text { + display: block; + font-size: 26rpx; + color: #333333; + font-weight: 200; +} + +.guide-icon { + position: absolute; + width: 70rpx; + height: 70rpx; + right: 25rpx; + bottom: 25rpx; +} + +/* 健康百科 */ +.sciences { + padding: 40rpx 30rpx; + box-sizing: border-box; + background-color: #f6f6f6; +} + +.list { + margin-top: 30rpx; +} + +.item { + background-color: #222222; + height: 200rpx; + display: flex; + margin-bottom: 30rpx; +} + +.itemCont { + width: calc(100% - 300rpx); + padding: 30rpx; + box-sizing: border-box; + color: #ffffff; + height: 200rpx; + position: relative; +} + +.itemCont-tips { + color: #acacac; + font-size: 28rpx; +} + +.itemImg { + width: 300rpx; + height: 200rpx; +} + +.itemCont-name { + position: absolute; + bottom: 40rpx; + left: 0; + font-weight: 300; + padding: 0 30rpx; + box-sizing: border-box; +} + +/* 短视频 */ +.brief { + position: relative; + width: 100vw; +} + +.briefImg, +.briefCont { + position: absolute; + left: 0; + top: 0; + width: 100%; +} + +.briefCont { + padding: 60rpx 30rpx; + box-sizing: border-box; +} + +.briefCont-title { + color: #ffffff; + text-align: center; +} + +.briefCont-title-word { + font-weight: 300; + text-transform: uppercase; + font-size: 28rpx; +} + +.briefCont-title-name { + font-size: 48rpx; + margin: 25rpx 0; +} + +.briefCont-title-text { + font-weight: 300; + font-size: 28rpx; +} + +.videos { + margin-top: 60rpx; +} + +.videos-filex-view { + position: relative; + width: 100%; + padding-top: 52%; + border-radius: 10rpx; + overflow: hidden; +} + +.videos-cover { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 2; +} + +.videos video { + position: absolute; + border-radius: 10rpx; + overflow: hidden; + top: 0; + left: 0; + width: 100%; + height: 100%; +} + +.videos-filex-view.filex { + position: fixed; + top: 0; + left: 0; + z-index: 99; +} \ No newline at end of file diff --git a/pages/login/agreement/agreement.js b/pages/login/agreement/agreement.js new file mode 100644 index 0000000..6d51d02 --- /dev/null +++ b/pages/login/agreement/agreement.js @@ -0,0 +1,31 @@ +/* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + content: '' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + // 获取用户协议 + wx.$api.auth.registeragree(options.type).then(res => { + this.setData({ + content: res.data.content + }) + }).catch(err => {}) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() {}, +}) \ No newline at end of file diff --git a/pages/login/agreement/agreement.json b/pages/login/agreement/agreement.json new file mode 100644 index 0000000..3928faa --- /dev/null +++ b/pages/login/agreement/agreement.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/login/agreement/agreement.wxml b/pages/login/agreement/agreement.wxml new file mode 100644 index 0000000..7fd32b1 --- /dev/null +++ b/pages/login/agreement/agreement.wxml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/pages/login/agreement/agreement.wxss b/pages/login/agreement/agreement.wxss new file mode 100644 index 0000000..3f2d3bf --- /dev/null +++ b/pages/login/agreement/agreement.wxss @@ -0,0 +1,5 @@ +.agreement-content{ + padding: 30rpx; + box-sizing: border-box; + font-size: 32rpx; +} \ No newline at end of file diff --git a/pages/login/index.js b/pages/login/index.js new file mode 100644 index 0000000..b21bb27 --- /dev/null +++ b/pages/login/index.js @@ -0,0 +1,166 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + phone : "", + code : "", + parentId: "", //邀请码 + newUser : '', //是否为新用户 + checked : false, //勾选协议 + codename: '获取验证码', + getSms : false, + inviteata: '' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + // 是否有邀请码 + if(options) { + this.setData({ + channelId : options.channel || '' + }) + } + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + if(wx.getStorageSync("inviteData")) { + this.setData({ + parentId: wx.getStorageSync("inviteData") + }) + } + }, + + /** + * 手机号码 + */ + bindInput(e) { + this.setData({ + phone: e.detail.value + }) + }, + + /** + * 短信验证码 + */ + bindCode(e) { + this.setData({ + code: e.detail.value + }) + }, + + /** + * 获取短信验证码 + */ + getPhoneCode(e) { + let mobile = this.data.phone, + myreg = /^(14[0-9]|13[0-9]|15[0-9]|17[0-9]|18[0-9])\d{8}$$/ + + var _this = this + + if (mobile == "") { + wx.showToast({ + title : '手机号不能为空', + icon : 'none', + duration : 1000 + }) + return false; + }else if (!myreg.test(mobile)) { + wx.showToast({ + title : '请输入正确的手机号', + icon : 'none', + duration : 1000 + }) + return false; + }else{ + wx.$api.auth.getSms({ + mobileNo: mobile + }).then(res=>{ + _this.setData({ + newUser : res.data.new, + getSms : true + }) + + wx.showToast({ + title : '发送成功', + icon : 'success', + duration: 2000 + }) + var num = 60; + var timer = setInterval(function () { + num--; + if (num <= 0) { + clearInterval(timer); + _this.setData({ + codename : '重新发送', + getSms : false + }) + + } else { + _this.setData({ + codename : num + "s后重新获取", + getSms : true + }) + } + }, 1000) + }).catch(err=>{}) + } + }, + + /** + * 邀请码 + */ + parentInput(e) { + this.setData({ + parentId: e.detail.value + }) + }, + + /** + * 用户登录 + */ + login() { + if(this.data.checked) { + wx.$api.auth.smsAuth({ + mobileNo : this.data.phone, + code : this.data.code, + invite : this.data.parentId, + channel : this.data.channelId + }).then(res=>{ + // 写入缓存 + wx.setStorage({ + key : 'token', + data : res.data.token_type + ' ' + res.data.access_token + }) + + // 回到首页 + wx.switchTab({ + url: '/pages/index/index' + }) + }).catch(err=>{}) + } else { + wx.showToast({ + title: '请勾选用户隐私和服务协议', + icon: "none" + }) + } + }, + + // 勾选协议 + radioChange() { + this.setData({ + checked: !this.data.checked + }) + } +}) \ No newline at end of file diff --git a/pages/login/index.json b/pages/login/index.json new file mode 100644 index 0000000..5f59c44 --- /dev/null +++ b/pages/login/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "锶源昆仑" +} \ No newline at end of file diff --git a/pages/login/index.wxml b/pages/login/index.wxml new file mode 100644 index 0000000..687596d --- /dev/null +++ b/pages/login/index.wxml @@ -0,0 +1,28 @@ + + + 手机号快捷登录 + + 未注册的手机号码将自动注册 + + + + + + + + + + + + + + + + + + + + + 我已阅读并同意《隐私协议》《服务协议》 + + diff --git a/pages/login/index.wxss b/pages/login/index.wxss new file mode 100644 index 0000000..90a9e4b --- /dev/null +++ b/pages/login/index.wxss @@ -0,0 +1,164 @@ +page { + height: 100vh; + width: 100vw; + padding: 90rpx 60rpx; + box-sizing: border-box; + background: white; +} + +.login-top { + height: 17vh; + width: 100%; + flex-direction: row; + align-items: flex-end; + justify-content: center; + box-sizing: border-box; + position: relative; + color: #919191; +} + +.top-bg { + position: absolute; + bottom: 30rpx; + z-index: 2; + width: 740rpx; +} + +.top-logo-content { + box-sizing: border-box; + color: #000; + font-weight: 600; + font-size: 40rpx; + margin-bottom: 10rpx; +} + +.top-logo { + margin-bottom: 20rpx; + width: 146rpx; + height: 146rpx; +} + +.inputs { + background: rgba(68, 144, 255, 0.05); + border: solid 1rpx #f2f2f2; + position: relative; + margin-top: 30rpx; + height: 80rpx; + line-height: 80rpx; +} + +.inputs input { + width: 100%; + height: 80rpx; + line-height: 80rpx; + padding: 0 30rpx; + border: none; + box-sizing: border-box; + font-size: 30rpx; +} + +input.inputs-phone { + padding-left: 150rpx; +} + +input.inputs-sms { + padding-right: 200rpx; +} + +.label { + position: absolute; + left: 0; + top: 0; + width: 120rpx; + text-align: center; + border-right: solid 1rpx #f2f2f2; + font-size: 30rpx; +} + +.sms-btn[size='mini'] { + font-weight: normal; + height: 77rpx; + line-height: 77rpx; + position: absolute; + top: 1rpx; + right: 1rpx; + padding: 0 20rpx; + margin: 0; + border-radius: 0; + border-left: solid 1rpx #f2f2f2; + color: #4490ff !important; + font-size: 30rpx; + background-color: transparent !important; +} + +.sms-btn::after { + border: none; +} + +.sms-btn[disabled] { + color: rgba(68, 144, 255, .6) !important; +} + +.title { + text-align: center; + font-size: 38rpx; + font-weight: bold; + color: #2a2a2a; + margin-bottom: 100rpx; +} + +.btn { + background: #4490ff !important; + width: 100% !important; + color: white !important; + border-radius: 0; + margin-top: 30rpx; + font-size: 32rpx; + line-height: 90rpx; + height: 90rpx; + font-weight: bold; + padding: 0; +} + +.btn::after { + border: none; +} + +.btn[disabled] { + background: rgba(68, 144, 255, .6) !important; +} + +.beianNo { + font-size: 26rpx; + color: #9d9d9d; + text-align: center; + padding-top: 60rpx; + position: fixed; + width: 100%; + left: 0; + bottom: 50rpx; +} + +/* 协议 */ +.agreement { + font-size: 26rpx; + color: #9d9d9d; + margin-top: 20rpx; + display: flex; +} + +.radioGroup { + transform: scale(.6); + width: 55rpx; + text-align: left; +} + +.agreement-text { + width: calc(100% - 55rpx); + line-height: 48rpx; +} + +.agreement-text navigator { + color: #000; + display: inline-block; +} \ No newline at end of file diff --git a/pages/mall/buy/index.js b/pages/mall/buy/index.js new file mode 100644 index 0000000..e17e231 --- /dev/null +++ b/pages/mall/buy/index.js @@ -0,0 +1,105 @@ +/* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + avatar : '', //用户头像 + nickName : '', //用户昵称 + identity : '', //用户身份 + goodId : '', //商品id + goodType : '', //商品类型 + surplus : '', //我的水滴 + mallData : '', //商品详情 + mallContent : '', //商品介绍 + userLogin : '', //登录状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + console.log(options.type) + this.setData({ + goodId : options.id, + goodType: options.type + }) + + // 获取商品详情 + this.goodInfo(options.id); + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + if(wx.getStorageSync("token")){ + this.setData({ + userLogin: true + }) + // 获取用户信息 + this.userInfo(); + } + }, + + /** + * 用户信息 + */ + userInfo() { + wx.$api.user.home().then(res => { + this.setData({ + avatar : res.data.avatar, + nickName : res.data.nickname, + identity : res.data.identity, + surplus : res.data.account.score.surplus + }) + }).catch(err => {}) + }, + + /** + * 商品详情 + */ + goodInfo(id) { + wx.$api.mall.goodsShow(id).then(res => { + this.setData({ + mallData : res.data, + mallContent : res.data.content.replace(/\ {}) + }, + + + /** + * 放大轮播相册图片 + */ + opneBanner(e){ + let imgs = [], + index = e.currentTarget.dataset.index + for (let img of e.currentTarget.dataset.imgs){ + imgs.push(img) + } + wx.previewImage({ + urls : imgs, + current : imgs[index] + }) + }, + + // 购买 + buyTap(e) { + if(wx.getStorageSync("token")){ + wx.navigateTo({ + url: '../submit/index?skuid=' + this.data.mallData.skus[0].sku_id + '&goodsid=' + this.data.mallData.goods_id + '&qty=' + 1 + '&goodtype=' + this.data.goodType + }) + }else { + // 去登录 + wx.navigateTo({ + url: "/pages/login/index" + }) + } + } +}) \ No newline at end of file diff --git a/pages/mall/buy/index.json b/pages/mall/buy/index.json new file mode 100644 index 0000000..30d4806 --- /dev/null +++ b/pages/mall/buy/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "锶源商城" +} \ No newline at end of file diff --git a/pages/mall/buy/index.wxml b/pages/mall/buy/index.wxml new file mode 100644 index 0000000..5290d97 --- /dev/null +++ b/pages/mall/buy/index.wxml @@ -0,0 +1,74 @@ + + + + + + + {{mallData.name}} + + + + + {{mallData.price.show}} 水滴 + + + {{mallData.price.show}} + + + + + + + + + 产品详情 + + + + + + + + + 已经到底拉,在往上逛一逛吧 + + + + {{mallData.price.show}}水滴 + {{mallData.price.show}} + {{goodType == 'waterType' ? '立即兑换' : '立即购买'}} + \ No newline at end of file diff --git a/pages/mall/buy/index.wxss b/pages/mall/buy/index.wxss new file mode 100644 index 0000000..083d0b1 --- /dev/null +++ b/pages/mall/buy/index.wxss @@ -0,0 +1,233 @@ +page { + background-color: #f3f3f5; +} + +/* 产品轮播 */ + +.banner { + overflow: hidden; + position: relative; + padding-top: 100%; +} + +.swiperCont, +.swiperImg { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} + +/* 用户 */ +.user-cont { + width: 100%; + position: absolute; + bottom: 0; + left: 0; + z-index: 99; + padding: 20rpx 30rpx; + display: flex; + box-sizing: border-box; +} + +.user-head { + position: relative; + width: 90rpx; + height: 90rpx; + border-radius: 50%; + border: 6rpx solid #ffe0a8; + margin-top: 10rpx; +} + +.user-avatar { + position: absolute; + width: 100%; + height: 100%; + border-radius: 50%; +} + +.user-ancrown { + position: absolute; + width: 48rpx; + height: 48rpx; + right: 0; + top: -34rpx; +} + +.user-text { + height: 120rpx; + width: calc(100% - 120rpx); + padding-left: 20rpx; + box-sizing: border-box; +} + +.user-top { + display: flex; + line-height: 58rpx; +} + +.user-name { + color: #ffffff; + padding-right: 10rpx; +} + +.user-icon image { + width: 32rpx; + height: 32rpx; + margin: 12rpx 0 0 5rpx; +} + +.user-identity { + margin-top: 5rpx; + width: 120rpx; +} + +.water { + background-color: rgba(0, 0, 0, .3); + border-radius: 30rpx 30rpx 30rpx 0; + padding: 0 15rpx 0 10rpx; + height: 60rpx; + line-height: 60rpx; + display: flex; + position: absolute; + right: 30rpx; + top: 50rpx; + color: #ffffff; +} + +.water image { + width: 46rpx; + height: 46rpx; + margin: 6rpx 5rpx 0 0; +} + +/* 商品信息 */ +.goodsInfo { + background-color: #ffffff; + padding: 30rpx; + width: 100%; + box-sizing: border-box; + font-weight: 600; + font-size: 32rpx; +} + +.goodsInfo-name { + margin-bottom: 20rpx; +} + +.goodsInfo-info { + display: flex; + line-height: 44rpx; +} + +.goodsInfo-price { + font-size: 36rpx; + color: #df723a; + flex: 1; +} + +.goodsInfo-price-symbol { + font-size: 28rpx; + display: inline-block; + margin-right: 5rpx; +} + +.goodsInfo-price-see { + font-weight: normal; + color: #959595; + font-size: 28rpx; +} + +/* 产品详情 */ +.detailsBrief { + padding: 30rpx 0; + box-sizing: border-box; + background-color: #ffffff; + margin-top: 20rpx; + /* border-bottom: 60px solid transparent; */ +} + +.detailsBrief-title { + position: relative; + font-size: 32rpx; + height: 70rpx; + margin-bottom: 10rpx; + font-weight: 600; + text-align: center; +} + +.goods-info-footer { + line-height: 40rpx; + text-align: center; + font-size: 24rpx; + color: #747788; + padding-top: 20rpx; +} + +.detailsBrief-text { + padding: 30rpx; + box-sizing: border-box; + line-height: 44rpx; +} + +.detailsBrief-back { + text-align: center; + padding: 0 30rpx; + box-sizing: border-box; +} + +.cardcase-like-online { + font-weight: normal; + font-size: 24rpx; + border: solid 2rpx #d8c283; + color: #c7a232; + border-radius: 4rpx; + display: inline-block; + height: 32rpx; + line-height: 32rpx; + padding: 0 10rpx; + margin: 2rpx 10rpx; +} + +/* 底部 */ +.footer { + width: 100%; + height: 60px; + background-color: #FFFFFF; + position: fixed; + left: 0; + bottom: 0; + z-index: 9; + padding: 8px 30rpx; + box-sizing: border-box; + display: flex; +} + +.number { + flex: 1; + line-height: 44px; + color: #6c78f8; +} + +.number text { + padding: 0 5rpx; + font-weight: 600; + font-size: 38rpx; +} + +.btn { + height: 36px; + line-height: 36px; + background-color: #6c78f8; + text-align: center; + color: #FFFFFF; + border-radius: 60rpx; + font-size: 28rpx; + padding: 0 30rpx; + margin-top: 8rpx; +} + +.detailsBrief-back { + width: 100%; +} \ No newline at end of file diff --git a/pages/mall/details/index.js b/pages/mall/details/index.js new file mode 100644 index 0000000..c8f9c74 --- /dev/null +++ b/pages/mall/details/index.js @@ -0,0 +1,77 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + goodsData : '', //详情 + sign : '', //签收 + express : '', //物流 + orderNo : '' //订单号 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + orderNo: options.orderNo + }) + + // 订单详情 + this.goodsInfo(options.orderNo); + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() {}, + + // 获取订单详情 + goodsInfo(orderNo) { + wx.$api.user.goodsDet(orderNo).then(res => { + this.setData({ + goodsData : res.data, + sign : res.data.can.sign, + express : res.data.express + }) + }).catch(err => {}) + }, + + // 复制订单号 + copyUrl(val) { + wx.setClipboardData({ + data: val.currentTarget.dataset.no, + success: () => { + wx.showToast({ + title: "复制成功", + icon : "none" + }) + } + }) + }, + + // 订单签收 + signClick() { + wx.showModal({ + title : '提示', + content : '是否签收', + success : res=> { + if (res.confirm) { + wx.$api.user.goodsSign(this.data.orderNo).then(res => { + wx.showToast({ + title:'签收成功', + icon:'none' + }) + wx.navigateBack() + }).catch(err => {}) + } + } + }) + } +}) \ No newline at end of file diff --git a/pages/mall/details/index.json b/pages/mall/details/index.json new file mode 100644 index 0000000..7418a99 --- /dev/null +++ b/pages/mall/details/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "订单详情" +} \ No newline at end of file diff --git a/pages/mall/details/index.wxml b/pages/mall/details/index.wxml new file mode 100644 index 0000000..0b38456 --- /dev/null +++ b/pages/mall/details/index.wxml @@ -0,0 +1,80 @@ + + + + + + 订单编号 + + {{ goodsData.order_no }} + 复制 + + + + + + + {{ goodsData.express.name }} {{ goodsData.express.mobile }} + + {{ goodsData.express.full_address }} + + + + + + + + + + + {{ item.sku.goods_name }} + + {{ item.price }}x{{ item.qty }} + + + + + + + 订单信息 + + 交易时间 + {{ goodsData.created_at }} + + + 总水滴数 + {{ goodsData.amount }} + + + 运费金额 + {{ goodsData.freight == 0 ? '免邮' : goodsData.freight }} + + + 交易状态 + {{ goodsData.state }} + + + + 物流信息 + + 物流公司 + {{ express.express_name }} + + + 收货姓名 + {{ express.name }} + + + 收货电话 + {{ express.mobile }} + + + 物流单号 + {{ express.express_no }}复制 + + + + + + 返回订单 + 签收订单 + \ No newline at end of file diff --git a/pages/mall/details/index.wxss b/pages/mall/details/index.wxss new file mode 100644 index 0000000..65adaa4 --- /dev/null +++ b/pages/mall/details/index.wxss @@ -0,0 +1,202 @@ +page { + background: #f3f4f6; + padding: 30rpx; + box-sizing: border-box; +} + +.While { + border-radius: 10rpx; + margin-bottom: 30rpx; + background-color: #FFFFFF; + box-shadow: 0 0 10rpx rgba(0, 0, 0, .05); +} + +.orderData { + border-bottom: 70rpx transparent solid; + +} + +/* 订单 */ +.orderData-cont-label { + padding: 40rpx 30rpx; + display: flex; + box-sizing: border-box; + border-bottom: #f2f2f2 2rpx solid; +} + +.orderData-cont-img { + width: 48rpx; + height: 48rpx; + vertical-align: middle; +} + +.orderData-cont-text { + width: calc(100% - 68rpx); + margin-left: 20rpx; + box-sizing: border-box; +} + +.orderData-cont-name { + margin-bottom: 10rpx; +} + +.orderData-cont-name text { + color: #999; + padding-left: 20rpx; +} + +.orderData-cont-copy { + display: flex; + font-size: 28rpx; + color: #999; +} + +.orderData-cont-copy text { + flex: 1; + display: inline-block; + margin-right: 20rpx; +} + +.orderData-cont-copy view { + color: #eb504c; +} + +/* 产品 */ +.orderGoods { + padding: 30rpx; + box-sizing: border-box; +} + +.orderGoods-wares { + position: relative; +} + +.orderGoods-img { + width: 100rpx; + height: 100rpx; + border: 2rpx solid #dddddd; + border-radius: 10rpx; +} + +.orderGoods-cont { + position: absolute; + width: 100%; + left: 0; + padding-left: 130rpx; + box-sizing: border-box; + top: 0; +} + +.orderGoods-text { + margin: 20rpx 0 30rpx; + color: #666666; + font-size: 26rpx; +} + +.orderGoods-price { + display: flex; + color: #555555; + margin-top: 15rpx; +} + +.orderGoods-number { + flex: 1; + color: #000; + font-weight: 600; +} + +.orderGoods-price text { + color: #999; +} + +.reserve-red { + font-weight: 600; + color: #1d37e2; +} + +.orderGoods-brief { + display: flex; + padding-top: 30rpx; +} + +.orderGoods-brief view { + flex: 1; + color: #333333; +} + +.orderGoods-brief text { + font-weight: 600; +} + +/* 规格 */ +.reserveCont-title { + font-weight: 600; + padding: 30rpx; +} + +.reserve-label { + display: flex; + padding: 0 30rpx 30rpx; + box-sizing: border-box; + font-size: 28rpx; +} + +.reserve-name { + flex: 1; + width: 200rpx; + margin-right: 20rpx; + color: #7e7e7e; +} + +.reserve-text { + width: calc(100% - 240rpx); + text-align: right; + line-height: 50rpx; +} + +.reserve-text.reserve-price { + font-weight: 600; + color: #1d37e2; +} + +.reserve-copy { + color: #6774ff; + border: #6774ff 2rpx solid; + display: inline-block; + height: 34rpx; + line-height: 34rpx; + font-size: 26rpx; + padding: 0 10rpx; + border-radius: 4rpx; + margin-left: 10rpx; +} + +/* 底部菜单 */ +.order-data-footer { + position: fixed; + bottom: 0; + left: 0; + right: 0; + border-top: solid 1rpx #f2f2f2; + padding-top: 17rpx; + padding-right: 30rpx; + padding-left: 30rpx; + height: 83rpx; + background: white; + display: flex; + flex-wrap: wrap; + flex-direction: row-reverse; + z-index: 9; +} + +.order-btn { + margin-left: 20rpx; + height: 58rpx; + line-height: 58rpx; + box-sizing: border-box; + border: solid 1rpx #747788; + padding: 0 20rpx; + font-size: 26rpx; + border-radius: 10rpx; + margin-top: 5rpx; +} \ No newline at end of file diff --git a/pages/mall/goods/index.js b/pages/mall/goods/index.js new file mode 100644 index 0000000..58f6de1 --- /dev/null +++ b/pages/mall/goods/index.js @@ -0,0 +1,94 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ +Page({ + + /** + * 页面的初始数据 + */ + data: { + categorieArr: [], //分类 + articlesArr : [] , //列表 + page : {}, //分页信息 + listType : '', //类型 + lodingStats : false, //加载状态 + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取列表分类 + this.categoriesInfo(); + }, + + // 列表分类 + categoriesInfo(){ + wx.$api.user.mallCategories({ + parent_id : this.data.listType + }).then(res => { + this.setData({ + categorieArr: res.data, + listType : res.data[0].category_id + }) + // 获取列表 + this.articlesInfo(); + }).catch(err => {}) + }, + + // 列表 + articlesInfo(page){ + wx.$api.user.mallGoods({ + category_id : this.data.listType, + page : page || 1 + }).then(res => { + let listArr = this.data.articlesArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.data) + this.setData({ + articlesArr : newData, + page : res.data.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + }).catch(err => {}) + }, + + /** + * 状态筛选 + */ + onTabs(val){ + if(this.data.listType === val) return + this.setData({ + listType: val.currentTarget.dataset.type + }) + + // 商品详情数据 + this.articlesInfo(); + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取列表 + this.articlesInfo(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取列表 + this.articlesInfo(pageNumber); + } + } +}) \ No newline at end of file diff --git a/pages/mall/goods/index.json b/pages/mall/goods/index.json new file mode 100644 index 0000000..0e633c7 --- /dev/null +++ b/pages/mall/goods/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "产品中心" +} \ No newline at end of file diff --git a/pages/mall/goods/index.wxml b/pages/mall/goods/index.wxml new file mode 100644 index 0000000..be0eb98 --- /dev/null +++ b/pages/mall/goods/index.wxml @@ -0,0 +1,31 @@ + + + + + + + {{item.name}} + {{item.description}} + + + ¥{{item.price.price_max}} + + + + + + 加载中... + + + 没有更多了~ + + + + + + 暂无数据 + \ No newline at end of file diff --git a/pages/mall/goods/index.wxss b/pages/mall/goods/index.wxss new file mode 100644 index 0000000..753edff --- /dev/null +++ b/pages/mall/goods/index.wxss @@ -0,0 +1,108 @@ +page { + background-color: #f6f6f6; +} + +.list { + background-color: #ffffff; + padding: 30rpx; + box-sizing: border-box; + margin-top: 30rpx; +} + +.item { + position: relative; + height: 180rpx; + margin-bottom: 30rpx; + border-bottom: 2rpx solid #eeeeee; + padding-bottom: 30rpx; +} + +.item:last-child { + margin-bottom: 0; + padding-bottom: 0; + border: none; +} + +.itemImg { + position: absolute; + left: 0; + top: 0; + width: 180rpx; + height: 180rpx; + border-radius: 10rpx; + overflow: hidden; +} + +.itemCont { + position: absolute; + left: 0; + top: 0; + padding-left: 210rpx; + box-sizing: border-box; + width: 100%; +} + +.itemCont-name { + line-height: 48rpx; + font-size: 30rpx; +} + +.itemCont-text { + color: #999; + font-size: 26rpx; + margin: 15rpx 0 35rpx; + font-weight: 200; +} + +.itemCont-price { + color: #f3ad47; + font-size: 36rpx; +} + +.itemCont-price image { + width: 22rpx; + height: 22rpx; + padding-right: 5rpx; +} + +/* tabs */ +.header { + position: fixed; + top: 0; + left: 0; + right: 0; + z-index: 99; + background-color: #ffffff; + line-height: 78rpx; +} + +.header-view { + padding: 0 30rpx; + box-sizing: border-box; + font-size: 30rpx; +} + +.tabs { + display: flex; + justify-content: space-around; + background: white; + padding: 15rpx 0; + font-size: 30rpx; + color: #9d9d9d; + height: 74rpx; +} + +.tabs-item { + display: inline-block; + padding: 0 50rpx; +} + +.tabs-item.show { + color: #1d37e2; + background-color: #f6f6f6; + border-radius: 10rpx 10rpx 0 0; +} + +/* .list { + margin-top: 110rpx; +} */ \ No newline at end of file diff --git a/pages/mall/submit/index.js b/pages/mall/submit/index.js new file mode 100644 index 0000000..9868181 --- /dev/null +++ b/pages/mall/submit/index.js @@ -0,0 +1,300 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + goodId : '', //店铺id + goodType : '', //商品类型 + skuId : '', //产品id + num : 1, //数量默认1 + address : '', //地址 + addressId : '', //地址id + stockData : '', //数据 + amount : '', //总金额 + freight : '', //运费 + weight : '', //重量 + remark : '', //备注 + exchangeSee : false, //是否兑换 + disabled : false, + orderNo : '', // 订单编号 + surplus : '', // 水滴数量 + paySuccess : false, // 兑换成功显示 + payType : 'wechat' //支付类型 wechat微信 water水滴兑换 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + goodId : options.goodsid, + goodType: options.goodtype, + skuId : options.skuid, + num : options.qty + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取订单前置 + this.orderShow() + + // 获取用户信息 + this.userInfo(); + }, + + /** + * 用户信息 + */ + userInfo() { + wx.$api.user.home().then(res => { + this.setData({ + surplus : res.data.account.score.surplus + }) + }).catch(err => {}) + }, + + /** + * 订单前置 + */ + orderShow() { + wx.$api.mall.foundOrder({ + goods_sku_id: this.data.skuId, + address_id : this.data.addressId, + qty : this.data.num + }).then(res => { + this.setData({ + address : res.data.address, + addressId : res.data.address.address_id, + stockData : res.data.detail, + amount : res.data.amount, + freight : res.data.freight, + weight : res.data.weight + }) + }).catch(err => {}) + }, + + /** + * 商品数量加减 + */ + goodsNumber(e){ + let num = this.data.num, + val = e.currentTarget.dataset.type + if (val == 'plus'){ + num ++; + }else{ + if (num > 1){ + num --; + }else{ + wx.showToast({ + title : '商品数量不能小于1', + icon : 'none' + }) + } + this.setData({ + num: num + }) + } + this.setData({ + num: num + }) + + // 获取订单前置 + this.orderShow() + }, + + /** + * 输入商品数量 + */ + goodsNumberInput(e) { + let goodsNum = e.detail.value; + if (goodsNum > 0) { + this.setData({ + num: goodsNum + }) + } else { + wx.showToast({ + title: '商品数量不能小于1', + icon: 'none' + }); + this.setData({ + num: 1 + }) + } + + }, + + /** + * 选择支付方式 + */ + radioChange(e) { + this.setData({ + payType : e.detail.value + }) + }, + + /** + * 是否确认兑换 + */ + exchangeShow() { + let newQty = this.data.num + let data = { + goods_sku_id: this.data.skuId, + remark : this.data.remark, + qty : newQty, + address_id : this.data.address.address_id + } + wx.$api.mall.affirmOrder(data).then(res => { + this.setData({ + orderNo: res.data.order_no + }) + // this.data.current == wechat 为微信支付 + // if(this.data.payType == 'wechat') { + // this.wxPay() + // return + // } + + // this.data.payType == water 为水滴兑换 + if(this.data.goodType == 'waterType') { + this.setData({ + exchangeSee: !this.data.exchangeSee + }) + return + } + + // 微信支付 + this.wxPay() + + }).catch(err => {}) + }, + + /** + * 水滴兑换确认订单 + */ + goodsForm() { + this.waterPay(); + }, + + /** + * 关闭兑换弹出 + */ + goodsCancel() { + this.setData({ + exchangeSee: false + }) + }, + + // 微信支付 + wxPay() { + wx.showLoading({ + title: '支付中...', + mask : true + }) + let that = this + wx.login({ + success: res => { + wx.$api.member.openid(res).then(openidRes => { + wx.$api.member.wechatPay(this.data.orderNo, { + type : 'miniapp', + openid : openidRes.data + }).then(PayRes => { + wx.hideLoading() + this.setData({ + disabled : true + }) + + let payInfo = JSON.parse(PayRes.data.wechat) + wx.requestPayment({ + timeStamp: payInfo.timeStamp, + nonceStr : payInfo.nonceStr, + package : payInfo.package, + paySign : payInfo.paySign, + signType : payInfo.signType, + success : payInfoRes=>{ + if(payInfoRes.errMsg == "requestPayment:ok"){ + wx.showToast({ + title: '支付成功', + icon: 'none', + duration: 2000, + //显示透明蒙层,防止触摸穿透 + mask:true, + success: function () { + that.setData({ + paySuccess: true + }) + setTimeout(()=>{ + wx.redirectTo({ + url: '/pages/order/list/index?listType=paid' + }) + },3000) + } + }) + } + }, + fail : res=>{ + wx.showToast({ + title: '支付失败', + icon: 'none', + duration: 500, + //显示透明蒙层,防止触摸穿透 + mask:true, + success: function () { + that.setData({ + paySuccess: true + }) + setTimeout(()=>{ + wx.redirectTo({ + url: '/pages/order/list/index?listType=unpay' + }) + },3000) + } + }) + } + }) + }).catch(err => {}) + }).catch(err => {}) + } + }) + }, + + // 水滴兑换 + waterPay() { + wx.showLoading({ + title: '兑换中...', + mask : true + }) + let that = this + wx.$api.mall.affirmPay(this.data.orderNo, {gateway: 'miniapp'}).then(res => { + wx.hideLoading() + this.setData({ + exchangeSee: false, + disabled : true + }) + wx.showToast({ + title: '兑换成功', + icon: 'none', + duration: 2000, + //显示透明蒙层,防止触摸穿透 + mask:true, + success: function () { + that.setData({ + paySuccess: true + }) + setTimeout(()=>{ + wx.redirectTo({ + url: '/pages/order/list/index?listType=paid' + }) + },3000) + } + }) + }).catch(err => {}) + } +}) \ No newline at end of file diff --git a/pages/mall/submit/index.json b/pages/mall/submit/index.json new file mode 100644 index 0000000..db7dae0 --- /dev/null +++ b/pages/mall/submit/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "确认订单" +} \ No newline at end of file diff --git a/pages/mall/submit/index.wxml b/pages/mall/submit/index.wxml new file mode 100644 index 0000000..f3c22b7 --- /dev/null +++ b/pages/mall/submit/index.wxml @@ -0,0 +1,109 @@ + + + + + + {{address.province.name}}{{address.city.name}} + {{address.full_address}} + + + {{address.name}}{{address.mobile}} + + + + + 新增收货地址 + + + + + + + + + + + {{items.title}} + x{{items.qty}} + + {{items.price}}水滴 + {{items.price}} + + + + + + + + 购买数量 + + - + + + + + + + 快递 + 免邮 + + + 重量 + {{weight}}ml + + + 水滴兑换 + 需{{amount}}水滴 + + + + + + + + + + + {{goodType == 'waterType' ? '需要' : '¥'}}{{amount}}{{payType == 'waterType' ? '水滴' : ''}} + + + + + + + + 确认兑换产品吗? + + + + 需要{{amount}}个水滴 + + + 取消 + 确定 + + + + + + 疯狂加载中... + \ No newline at end of file diff --git a/pages/mall/submit/index.wxss b/pages/mall/submit/index.wxss new file mode 100644 index 0000000..62100e6 --- /dev/null +++ b/pages/mall/submit/index.wxss @@ -0,0 +1,342 @@ +page { + background-color: #f5f6f8; + padding: 30rpx; + box-sizing: border-box; +} + +/* 地址 */ +.address { + background-color: #FFFFFF; + border-radius: 20rpx; + overflow: hidden; + position: relative; +} + +.address-arrow { + position: absolute; + right: 30rpx; + top: 80rpx; + width: 38rpx; + height: 38rpx; +} + +.address-cont { + padding: 30rpx 30rpx 0; + box-sizing: border-box; +} + +.address-area { + color: #585866; + font-size: 28rpx; +} + +.address-text { + font-weight: 600; + padding: 10px 0; +} + +.address-name text { + color: #585866; + padding-left: 30rpx; +} + +.address-img { + width: 100%; +} + +.address-add { + width: 100%; + text-align: center; + padding: 30rpx 30rpx 0; + box-sizing: border-box; +} + +.address-go { + display: inline-block; + font-size: 28rpx; + line-height: 68rpx; + border-radius: 10rpx; + color: #df723a; +} + +/* 商品 */ +.good { + background-color: #FFFFFF; + border-radius: 20rpx; + overflow: hidden; + margin: 30rpx 0; + position: relative; + padding: 30rpx; +} + +.good-img { + width: 160rpx; + height: 160rpx; +} + +.good-cont { + position: absolute; + left: 0; + top: 0; + width: 100%; + padding: 30rpx 30rpx 0 220rpx; + box-sizing: border-box; +} + +.good-name { + font-size: 30rpx; +} + +.good-price { + color: #df723a; +} + +.good-price text { + font-size: 26rpx; + padding-right: 5rpx; +} + +.label-integral { + color: #6c78f8; + font-weight: 600; +} + +.good-tips { + margin: 10rpx 0 25rpx; + color: #585866; + font-size: 28rpx; +} + +/* 规格 */ +.label { + background-color: #FFFFFF; + border-radius: 20rpx; + overflow: hidden; + box-sizing: border-box; +} + +.label-item { + display: flex; + line-height: 100rpx; + color: #585866; + font-size: 30rpx; + padding: 0 30rpx; + box-sizing: border-box; + border-bottom: 2rpx solid rgb(243, 243, 243); +} + +.label-item:last-child { + border: none; +} + +.label-name { + flex: 1; +} + +.label-price { + text-align: right; + line-height: 90rpx; + font-size: 30rpx; + font-weight: 600; + padding: 0 30rpx 5rpx; + box-sizing: border-box; +} + +.label-price text { + font-size: 34rpx; + padding: 0 10rpx; +} + +.label-number { + display: flex; + margin-top: 25rpx; +} + +.number-btn { + background-color: #f1f1f1; + width: 48rpx; + height: 48rpx; + line-height: 46rpx; + text-align: center; +} + +.number-input { + width: 80rpx; + text-align: center; +} + +/* 购买方式 */ +.payWay { + margin-top: 30rpx; + padding: 30rpx; + box-sizing: border-box; +} + +.cashierCont-pay-way { + padding: 40rpx 0; + height: 270rpx; + box-sizing: border-box; +} + +.cashierCont-way-label { + float: left; + border: 2rpx solid #e8e8e8; + box-sizing: border-box; + padding: 30rpx 0; + border-radius: 10rpx; + width: calc(50% - 84rpx); + text-align: center; + margin: 0 40rpx; + font-size: 30rpx; + position: relative; + color: #999999; +} + +.cashierCont-way-label.active { + border-color: #d5a56d; + color: #df723a; + box-shadow: 0 4rpx 20rpx rgba(204, 6, 29, 0.2); +} + +.cashierCont-way-label radio { + opacity: 0; + position: absolute; + width: 100%; + height: 100%; + left: 0; + top: 0; +} + +.cashierCont-way-label image { + width: 78rpx; + height: 78rpx; + display: block; + margin: 0 auto 20rpx; +} + +/* 底部 */ +.footer { + width: 100%; + height: 60px; + background-color: #FFFFFF; + position: fixed; + left: 0; + bottom: 0; + z-index: 9; + padding: 8px 30rpx; + box-sizing: border-box; + display: flex; +} + +.number { + flex: 1; + line-height: 44px; + color: #6c78f8; +} + +.number text { + padding: 0 5rpx; + font-weight: 600; + font-size: 38rpx; +} + +.btn { + height: 36px; + line-height: 36px; + background-color: #6c78f8; + text-align: center; + color: #FFFFFF; + border-radius: 60rpx; + font-size: 28rpx; + padding: 0 30rpx !important; + width: auto !important; + margin-top: 8rpx; +} + +/* 兑换弹出 */ +.exchangePop { + position: fixed; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, .5); + left: 0; + top: 0; + display: none; + z-index: 9; +} + +.exchangePop.active { + display: block; +} + +.exchangeCont { + left: 10%; + top: 50%; + width: 80%; + margin-top: -200rpx; + position: fixed; + z-index: 100; + background-color: #FFFFFF; + border-radius: 20rpx; + overflow: hidden; + text-align: center; + padding: 40rpx; + display: none; + box-sizing: border-box; +} + +.exchangeCont.active { + display: block; +} + +.exchange-title { + text-align: center; + color: #2b2b2b; + font-weight: 600; + font-size: 34rpx; +} + +.exchange-number { + font-size: 28rpx; + margin: 30rpx 0; +} + +.exchange-number text { + color: #f31d23; + font-weight: 600; + padding: 0 5rpx; +} + +.exchange-img { + display: block; + width: 80rpx; + height: 80rpx; + margin: 10rpx auto; +} + +.exchange-btn { + display: flex; +} + +.exchange-item { + line-height: 78rpx; + flex: 2; + text-align: center; + margin: 0 15rpx; + border: 2rpx solid #000; + border-radius: 50rpx; + background-color: #FFFFFF; +} + +.exchange-item:last-child { + background-color: #f31d23; + color: #FFFFFF; + border-color: #f31d23; +} + + +.grey { + background-color: #f9f9f9; + z-index: 99999; + position: fixed; +} \ No newline at end of file diff --git a/pages/member/cause/cause.js b/pages/member/cause/cause.js new file mode 100644 index 0000000..0d8dbfa --- /dev/null +++ b/pages/member/cause/cause.js @@ -0,0 +1,99 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + service : '', + orderId : '', + identityId : '', + username : '', //用户 + price : '', //打款金额 + name : '', + card_no : '', + //打款凭证 + showpath : '', + path : '', + disabled : false ,// 提交按钮状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + orderId : options.order_id, + identityId : options.identity_id + }) + + // 获取银行+账号 + wx.$api.member.identitieSee(options.identity_id).then(res => { + this.setData({ + service: res.data.identity.service, + price : res.data.identity.price + }) + }).catch(err => {}) + + // 获取账户+凭证 + wx.$api.member.orderSee(options.order_id).then(res => { + this.setData({ + username : res.data.name, + showpath : res.data.cover, + path : res.data.cover, + }) + }).catch(err => {}) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + }, + + // 上传图片 + openImg(){ + wx.chooseMedia({ + count : 1, + success : path => { + // 上传图片 + wx.$api.file.uploadImg(path.tempFiles[0].tempFilePath, {}).then(res=>{ + this.setData({ + showpath: res.url, + path : res.path + }) + }) + } + }) + }, + + // 提交表单 + issueForm(e) { + let value = e.detail.value; + let data = { + name : value.name, + price : value.price, + cover : this.data.path + } + wx.$api.member.orderSubmit(this.data.orderId, data).then(res => { + wx.showToast({ + title: '提交成功', + icon: 'none', + duration: 2000 + }) + setTimeout(()=>{ + wx.redirectTo({ + url: '/pages/member/examine/examine' + }) + },3000) + this.setData({ + disabled: true + }) + + }).catch(err => {}) + } +}) \ No newline at end of file diff --git a/pages/member/cause/cause.json b/pages/member/cause/cause.json new file mode 100644 index 0000000..3928faa --- /dev/null +++ b/pages/member/cause/cause.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/member/cause/cause.wxml b/pages/member/cause/cause.wxml new file mode 100644 index 0000000..26ce946 --- /dev/null +++ b/pages/member/cause/cause.wxml @@ -0,0 +1,40 @@ +
+ + + + 收款银行 + + {{service.bank}} + + + + 收款银行帐号 + + {{service.bank_no}} + + + + 打款金额 + + + + + + 转款账户 + + + + + + 打款凭证 + + + + 请上传转款电子回单 + + + + + + +
\ No newline at end of file diff --git a/pages/member/cause/cause.wxss b/pages/member/cause/cause.wxss new file mode 100644 index 0000000..e0ecbdb --- /dev/null +++ b/pages/member/cause/cause.wxss @@ -0,0 +1,96 @@ +page { + background-color: #f4f4f4; +} + +.take-label { + padding: 30rpx 30rpx 0; + box-sizing: border-box; + border-bottom: 160rpx solid transparent; +} + +.item { + padding:25rpx 20rpx 30rpx; + box-sizing: border-box; + background-color: #FFFFFF; + border-bottom: 2rpx solid #f3f3f3; + font-size: 32rpx; + margin-bottom: 30rpx; + border-radius: 30rpx; +} + +.name { + width: 100%; + display: flex; + line-height: 44rpx; + margin-bottom: 20rpx; +} + +.name image { + width: 44rpx; + height: 44rpx; + margin-right: 15rpx; +} + +.time { + width: 100%; + color: #9d9d99; +} + +.entry { + width: 100%; + background-color: #f4f4f4; + font-size: 30rpx; + padding: 0 30rpx; + height: 84rpx; + line-height: 84rpx; + box-sizing: border-box; + border-radius: 10rpx; + color: #9d9d99; +} + +.issueNew { + text-align: center; + margin-top: 20rpx; +} + +.issueNew-icon { + width: 200rpx; + height: 200rpx; +} + +.issueNew-text { + font-size: 28rpx; + color: #9d9d9d; +} + +/* 按钮 */ +.userdata-btn { + width: 100%; + box-sizing: border-box; + padding: 30rpx; + position: fixed; + bottom: 0; + left: 0; + z-index: 99; + right: 0; + background: white; +} + +.issue-btn { + background: #1d37e2; + text-align: center; + color: white; + height: 90rpx; + line-height: 90rpx !important; + font-size: 34rpx; + font-weight: normal; + width: 100% !important; + margin: 0; + padding: 0; + border-radius: 10rpx; +} + +.issue-btn[disabled] { + background: #9b9b9b !important; + color: #fff !important; +} \ No newline at end of file diff --git a/pages/member/examine/examine.js b/pages/member/examine/examine.js new file mode 100644 index 0000000..03f816d --- /dev/null +++ b/pages/member/examine/examine.js @@ -0,0 +1,66 @@ +// pages/member/examine/examine.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/member/examine/examine.json b/pages/member/examine/examine.json new file mode 100644 index 0000000..254cc25 --- /dev/null +++ b/pages/member/examine/examine.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "审核" +} \ No newline at end of file diff --git a/pages/member/examine/examine.wxml b/pages/member/examine/examine.wxml new file mode 100644 index 0000000..77abe17 --- /dev/null +++ b/pages/member/examine/examine.wxml @@ -0,0 +1,10 @@ + + + + 开通会员审核已提交 + 请耐心等待,可随时关注会会员状态 + + + 知道了 + + \ No newline at end of file diff --git a/pages/member/examine/examine.wxss b/pages/member/examine/examine.wxss new file mode 100644 index 0000000..47d3e4f --- /dev/null +++ b/pages/member/examine/examine.wxss @@ -0,0 +1,26 @@ +.tips { + margin: 30rpx 0; +} + +.tips-name { + color: #000000; + font-weight: 600; + font-size: 36rpx; + margin-bottom: 20rpx; +} + +.tips-text { + font-size: 30rpx; +} + +.btn { + background-color: #0074ff; + color: #ffffff; + display: inline-block; + width: 50%; + line-height: 96rpx; + border-radius: 60rpx; + font-size: 30rpx; + margin-top: 80rpx; + box-shadow: 0 0 20rpx 6rpx rgba(0, 116, 255, .5); +} \ No newline at end of file diff --git a/pages/member/index.js b/pages/member/index.js new file mode 100644 index 0000000..e0c0c81 --- /dev/null +++ b/pages/member/index.js @@ -0,0 +1,204 @@ +// pages/member/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + userLogin : '', //登录状态 + avatar : '', //头像 + nickName : '', //昵称 + identityId : '', //用户id + identityShow : '', //身份有效期 + tabType : 2, // 会员选项 + identitiesData : [], + interestData : '', // 会员权益 + vipsData : '', //会员公告 + barHeight : getApp().globalData.statusBarHeight, // 状态栏高度 + jiaonangheight : getApp().globalData.jiaonangheight, //胶囊高度 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取登录状态 + if(wx.getStorageSync("token")){ + this.setData({ + userLogin: true + }) + + // 获取用户信息 + this.userInfo(); + } + // 获取身份前置 + this.identityInfo(); + + // 获取身份权益 + this.openTab(); + }, + + /** + * 用户信息 + */ + userInfo() { + wx.$api.user.home().then(res => { + this.setData({ + userData : res.data, + avatar : res.data.avatar, + nickName : res.data.nickname, + identityId : res.data.identity.id, + identityShow : res.data.identityShow + }) + + }).catch(err => {}) + }, + + /** + * 身份前置 + */ + identityInfo(){ + wx.$api.member.openModel().then(res => { + this.setData({ + identitiesData : res.data.identities, + vipsData : res.data.vips + }) + + }).catch(err => {}) + }, + + /** + * 切换身份 + */ + typeClick(e) { + this.setData({ + tabType: e.currentTarget.dataset.type + }) + // 获取身份权益 + this.openTab(); + }, + + /** + * 身份权益 + */ + openTab() { + // 3为金卡,4为钻卡 + wx.$api.member.openSee(this.data.tabType).then(res => { + this.setData({ + interestData: res.data + }) + }).catch(err => {}) + }, + + /** + * 截获竖向滑动 + */ + catchTouchMove(){ + return false + }, + + /** + * 处理未登录时的转跳 + */ + userNav(e){ + let pageUrl = e.currentTarget.dataset.url + if(wx.getStorageSync("token")){ + // 微信支付-线上支付 + if(this.data.interestData.channel.value == 1) { + this.wxPay(); + return + } + // 上传打款凭证 + wx.navigateTo({ + url: pageUrl + }) + }else{ + // 去登录 + wx.navigateTo({ + url: "/pages/login/index" + }) + } + }, + + /** + * 立即续费 + */ + renewTap() { + // 微信支付-线上支付 + if(this.data.interestData.channel.value == 1) { + this.wxPay(); + return + } + // 上传打款凭证-线下支付 + wx.navigateTo({ + url: "/pages/member/open/open?identity_id=" + this.data.interestData.identity_id + }) + }, + + // 微信支付 + wxPay() { + wx.showLoading({ + title: '支付中...', + mask : true + }) + let that = this + wx.login({ + success: res => { + wx.$api.member.openid(res).then(openidRes => { + wx.$api.member.openIndex(that.data.interestData.identity_id,{}).then(memberRes => { + wx.hideLoading() + wx.$api.member.identityPay(memberRes.data.order_id, { + channel: 'miniapp', + openid : openidRes.data + }).then(PayRes => { + let payInfo = JSON.parse(PayRes.data.wechat) + wx.requestPayment({ + timeStamp: payInfo.timeStamp, + nonceStr : payInfo.nonceStr, + package : payInfo.package, + paySign : payInfo.paySign, + signType : payInfo.signType, + success : payInfoRes=>{ + if(payInfoRes.errMsg == "requestPayment:ok"){ + wx.showToast({ + title: '支付成功', + icon : 'success' + }) + setTimeout(()=>{ + wx.switchTab({ + url: '/pages/user/index' + }) + },3000) + } + }, + fail : res=>{ + wx.showToast({ + title: '取消支付', + icon: 'none' + }) + } + }) + }).catch(err => {}) + }).catch(err => {}) + }).catch(err => {}) + } + }) + }, + + /** + * 查看驳回原因 + */ + tapCause(e) { + wx.showModal({ + title : '驳回原因', + content : e.currentTarget.dataset.text, + showCancel: false, + success : res=> {} + }) + } +}) \ No newline at end of file diff --git a/pages/member/index.json b/pages/member/index.json new file mode 100644 index 0000000..7af8b0a --- /dev/null +++ b/pages/member/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationStyle": "custom" +} \ No newline at end of file diff --git a/pages/member/index.wxml b/pages/member/index.wxml new file mode 100644 index 0000000..06a29b1 --- /dev/null +++ b/pages/member/index.wxml @@ -0,0 +1,105 @@ + + + + + + + + + + {{nickName}} + + + + + + + + + {{identityShow.times.name}}会员有效期至 {{identityShow.times.ended_at}} + + + 暂未开通会员 + + + + + + + + + + 请先登录 + + + 登录后开通会员 + + + + + + + + + + + + 开通会员立享{{interestData.rules.length}}大权益 + + + + + {{item.text}} + + + + 会员充值 + + + + 锶享会·{{item.name}} + + + {{item.price}} + + {{item.bottle}}瓶({{item.stock}}箱) + + + + + + + + + + ¥{{interestData.price}}立即开通 + + + 立即续费 + + + + 修改{{interestData.buttonText}} + 查看驳回原因 + + + {{interestData.buttonText}} + + + + + ¥{{interestData.price}}立即开通 + \ No newline at end of file diff --git a/pages/member/index.wxss b/pages/member/index.wxss new file mode 100644 index 0000000..56cbca3 --- /dev/null +++ b/pages/member/index.wxss @@ -0,0 +1,241 @@ +/* 头部 */ +.Usetop { + width: 100%; + position: relative; + padding-top: 42%; +} + +.Usetop-back, +.Usetop-range { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + box-sizing: border-box; +} + +.Usetop-back { + z-index: 1; +} + +.Usetop-range { + z-index: 2; +} + +.Usetop-cont { + padding: 20rpx 0 0 50rpx; + box-sizing: border-box; + display: flex; +} + +.Usetop-head { + width: 100rpx; + height: 100rpx; + border-radius: 50%; + border: 6rpx solid #ffffff; + position: relative; +} + +.Usetop-head-avatar { + position: absolute; + width: 100%; + height: 100%; + border-radius: 50%; +} + +.Usetop-text { + width: calc(100% - 110rpx); + padding: 0 30rpx; + box-sizing: border-box; +} + +.Usetop-text-name { + font-size: 36rpx; + display: flex; + margin-top: 6rpx; +} + +.Usetop-text image { + width: 130rpx; + margin-left:20rpx; + vertical-align: middle; +} + +.Usetop-text-time { + font-size: 28rpx; + margin-top: 10rpx; +} + +/* 公告 */ +.notice { + padding: 0 30rpx; + box-sizing: border-box; +} + +.notice-cont { + background-color: #ffffff; + border-radius: 80rpx; + padding: 20rpx 30rpx; + box-sizing: border-box; + box-shadow: 0rpx 3rpx 20rpx 4rpx rgba(13, 81, 177, .05); + height: 100rpx; +} + +.notice-cont-swiper { + height: 100%; +} + +.notice-cont-avatar { + width: 60rpx; + height: 60rpx; + border-radius: 50%; +} + +.swiper-item { + display: flex; + font-size: 28rpx; + line-height: 64rpx; +} + +.notice-cont-name { + width: calc(100% - 60rpx); + padding-left: 20rpx; + box-sizing: border-box; +} + +.notice-cont-name text { + color: #3b7cff; +} + +/* 权益 */ +.interest { + padding: 0 15rpx 30rpx; + box-sizing: border-box; +} + +.interest-title { + text-align: center; + color: #4683ff; + font-size: 34rpx; +} + +.interest-cont { + padding: 40rpx 0; +} + +.monsterPart-list { + width: 100%; + white-space: nowrap; + padding-bottom: 30rpx; +} + +.interest-label { + display: inline-block; + font-size: 26rpx; + text-align: center; + margin: 0 20rpx; +} + +.interest-label-icon { + width: 120rpx; +} + +.interest-tab { + position: relative; + padding: 40rpx 0 30rpx; + box-sizing: border-box; +} + +.interest-tab::after { + position: absolute; + content: ''; + left: 15rpx; + top: 0; + width: calc(100% - 30rpx); + height: 2rpx; + background-color: #f1f4f9; +} + +.interest-tab-title { + font-weight: 600; + font-size: 34rpx; + padding: 0 15rpx; +} + +.interest-tab-item { + margin-top: 30rpx; + display: flex; +} + +.interest-tab-label { + flex: 3; + text-align: center; + box-shadow: 0rpx 0rpx 20rpx 4rpx rgba(13, 81, 177, .05); + margin: 0 15rpx; + padding: 30rpx 0; + box-sizing: border-box; + border-radius: 20rpx; + font-size: 30rpx; + border: 4rpx solid #ffffff; +} + +.interest-tab-label.active { + border-color: #3b7cff; +} + +.interest-tab-name { + color: #666666; + font-size: 24rpx; +} + +.interest-tab-number { + color: #3b7cff; + margin: 20rpx 0; + font-size: 40rpx; + font-weight: 600; +} + +.interest-tab-number text { + font-size: 26rpx; + font-weight: normal; +} + +.interest-tab-text { + font-size: 26rpx; + color: #999999; +} + +/* 按钮 */ +.open { + padding: 0 30rpx 30rpx; + box-sizing: border-box; +} + +.open-btn { + width: 100%; + line-height: 100rpx; + background-color: #3b7cff; + color: #ffffff; + border-radius: 60rpx; + overflow: hidden; + text-align: center; + font-size: 34rpx; +} + +.open-btn.active { + background-color: rgb(156, 156, 156); +} + +.seeCause { + text-align: center; + line-height: 90rpx; + font-size: 28rpx; + color: #8a5400; + text-decoration: underline; +} + +.open-btn text { + padding-right: 20rpx; + font-weight: 600; +} \ No newline at end of file diff --git a/pages/member/open/open.js b/pages/member/open/open.js new file mode 100644 index 0000000..0c964fb --- /dev/null +++ b/pages/member/open/open.js @@ -0,0 +1,93 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + service : '', + username: '', //用户手机号 + price : '', //打款金额 + name : '', + card_no : '', + //打款凭证 + showpath: '', + path : '', + disabled : false ,// 提交按钮状态 + identityId: '' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + identityId: options.identity_id + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + wx.$api.user.home().then(res => { + this.setData({ + username: res.data.username + }) + }).catch(err => {}) + + wx.$api.member.identitieSee(this.data.identityId).then(res => { + this.setData({ + service: res.data.identity.service, + price : res.data.identity.price + }) + }).catch(err => {}) + }, + + // 上传图片 + openImg(){ + wx.chooseMedia({ + count : 1, + success : path => { + // 上传图片 + wx.$api.file.uploadImg(path.tempFiles[0].tempFilePath, {}).then(res=>{ + this.setData({ + showpath: res.url, + path : res.path + }) + }) + } + }) + }, + + // 提交表单 + issueForm(e) { + let value = e.detail.value; + let data = { + name : value.name, + price : value.price, + cover : this.data.path + } + wx.$api.member.openIndex(this.data.identityId, data).then(res => { + wx.showToast({ + title: '提交成功', + icon: 'none', + duration: 2000 + }) + setTimeout(()=>{ + wx.redirectTo({ + url: '/pages/member/examine/examine' + }) + },3000) + this.setData({ + disabled: true + }) + + }).catch(err => { + }) + } +}) \ No newline at end of file diff --git a/pages/member/open/open.json b/pages/member/open/open.json new file mode 100644 index 0000000..3928faa --- /dev/null +++ b/pages/member/open/open.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/member/open/open.wxml b/pages/member/open/open.wxml new file mode 100644 index 0000000..7a93e36 --- /dev/null +++ b/pages/member/open/open.wxml @@ -0,0 +1,40 @@ +
+ + + + 收款银行 + + {{service.bank}} + + + + 收款银行帐号 + + {{service.bank_no}} + + + + 打款金额 + + + + + + 转款账户 + + + + + + 打款凭证 + + + + 请上传转款电子回单 + + + + + + +
\ No newline at end of file diff --git a/pages/member/open/open.wxss b/pages/member/open/open.wxss new file mode 100644 index 0000000..e0ecbdb --- /dev/null +++ b/pages/member/open/open.wxss @@ -0,0 +1,96 @@ +page { + background-color: #f4f4f4; +} + +.take-label { + padding: 30rpx 30rpx 0; + box-sizing: border-box; + border-bottom: 160rpx solid transparent; +} + +.item { + padding:25rpx 20rpx 30rpx; + box-sizing: border-box; + background-color: #FFFFFF; + border-bottom: 2rpx solid #f3f3f3; + font-size: 32rpx; + margin-bottom: 30rpx; + border-radius: 30rpx; +} + +.name { + width: 100%; + display: flex; + line-height: 44rpx; + margin-bottom: 20rpx; +} + +.name image { + width: 44rpx; + height: 44rpx; + margin-right: 15rpx; +} + +.time { + width: 100%; + color: #9d9d99; +} + +.entry { + width: 100%; + background-color: #f4f4f4; + font-size: 30rpx; + padding: 0 30rpx; + height: 84rpx; + line-height: 84rpx; + box-sizing: border-box; + border-radius: 10rpx; + color: #9d9d99; +} + +.issueNew { + text-align: center; + margin-top: 20rpx; +} + +.issueNew-icon { + width: 200rpx; + height: 200rpx; +} + +.issueNew-text { + font-size: 28rpx; + color: #9d9d9d; +} + +/* 按钮 */ +.userdata-btn { + width: 100%; + box-sizing: border-box; + padding: 30rpx; + position: fixed; + bottom: 0; + left: 0; + z-index: 99; + right: 0; + background: white; +} + +.issue-btn { + background: #1d37e2; + text-align: center; + color: white; + height: 90rpx; + line-height: 90rpx !important; + font-size: 34rpx; + font-weight: normal; + width: 100% !important; + margin: 0; + padding: 0; + border-radius: 10rpx; +} + +.issue-btn[disabled] { + background: #9b9b9b !important; + color: #fff !important; +} \ No newline at end of file diff --git a/pages/order/details/index.js b/pages/order/details/index.js new file mode 100644 index 0000000..c8f9c74 --- /dev/null +++ b/pages/order/details/index.js @@ -0,0 +1,77 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + goodsData : '', //详情 + sign : '', //签收 + express : '', //物流 + orderNo : '' //订单号 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + orderNo: options.orderNo + }) + + // 订单详情 + this.goodsInfo(options.orderNo); + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() {}, + + // 获取订单详情 + goodsInfo(orderNo) { + wx.$api.user.goodsDet(orderNo).then(res => { + this.setData({ + goodsData : res.data, + sign : res.data.can.sign, + express : res.data.express + }) + }).catch(err => {}) + }, + + // 复制订单号 + copyUrl(val) { + wx.setClipboardData({ + data: val.currentTarget.dataset.no, + success: () => { + wx.showToast({ + title: "复制成功", + icon : "none" + }) + } + }) + }, + + // 订单签收 + signClick() { + wx.showModal({ + title : '提示', + content : '是否签收', + success : res=> { + if (res.confirm) { + wx.$api.user.goodsSign(this.data.orderNo).then(res => { + wx.showToast({ + title:'签收成功', + icon:'none' + }) + wx.navigateBack() + }).catch(err => {}) + } + } + }) + } +}) \ No newline at end of file diff --git a/pages/order/details/index.json b/pages/order/details/index.json new file mode 100644 index 0000000..7418a99 --- /dev/null +++ b/pages/order/details/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "订单详情" +} \ No newline at end of file diff --git a/pages/order/details/index.wxml b/pages/order/details/index.wxml new file mode 100644 index 0000000..c288b7c --- /dev/null +++ b/pages/order/details/index.wxml @@ -0,0 +1,88 @@ + + + + + + 订单编号 + + {{ goodsData.order_no }} + 复制 + + + + + + + {{ goodsData.express.name }} {{ goodsData.express.mobile }} + + {{ goodsData.express.full_address }} + + + + + + + + + + + {{ item.sku.goods_name }} + + ¥{{ item.price }} + x{{ item.qty }} + + + + + + + 订单信息 + + 订单类型 + + 兑换订单 + 提货订单 + + + + 交易时间 + {{ goodsData.created_at }} + + + 运费 + {{ goodsData.freight == 0 ? '免邮' : goodsData.freight }} + + + 交易状态 + {{ goodsData.state }} + + + 水滴数量 + {{ goodsData.total }} 水滴 + + + + 物流信息 + + 物流公司 + {{ express.express_name }} + + + 收货姓名 + {{ express.name }} + + + 收货电话 + {{ express.mobile }} + + + 物流单号 + {{ express.express_no }}复制 + + + + + + 返回订单 + 签收订单 + \ No newline at end of file diff --git a/pages/order/details/index.wxss b/pages/order/details/index.wxss new file mode 100644 index 0000000..917fde3 --- /dev/null +++ b/pages/order/details/index.wxss @@ -0,0 +1,213 @@ +page { + background: #f3f4f6; + padding: 30rpx; + box-sizing: border-box; +} + +.While { + border-radius: 10rpx; + margin-bottom: 30rpx; + background-color: #FFFFFF; + box-shadow: 0 0 10rpx rgba(0, 0, 0, .05); +} + +.orderData { + border-bottom: 70rpx transparent solid; + +} + +/* 订单 */ +.orderData-cont-label { + padding: 40rpx 30rpx; + display: flex; + box-sizing: border-box; + border-bottom: #f2f2f2 2rpx solid; +} + +.orderData-cont-img { + width: 48rpx; + height: 48rpx; + vertical-align: middle; +} + +.orderData-cont-text { + width: calc(100% - 68rpx); + margin-left: 20rpx; + box-sizing: border-box; + font-size: 30rpx; +} + +.orderData-cont-name { + margin-bottom: 10rpx; +} + +.orderData-cont-name text { + color: #999; + padding-left: 20rpx; +} + +.orderData-cont-copy { + display: flex; + font-size: 26rpx; + color: #999; +} + +.orderData-cont-copy text { + flex: 1; + display: inline-block; + margin-right: 20rpx; +} + +.orderData-cont-copy view { + color: #eb504c; +} + +/* 产品 */ +.orderGoods { + padding: 30rpx; + box-sizing: border-box; +} + +.orderGoods-wares { + position: relative; +} + +.orderGoods-img { + width: 100rpx; + height: 100rpx; + border: 2rpx solid #dddddd; + border-radius: 10rpx; +} + +.orderGoods-cont { + position: absolute; + width: calc(100% - 130rpx); + left: 130rpx; + top: 0; + font-size: 30rpx; +} + +.orderGoods-text { + margin: 20rpx 0 30rpx; + color: #666666; + font-size: 26rpx; +} + +.orderGoods-price { + display: flex; + color: #555555; + margin-top: 15rpx; +} + +.orderGoods-price text { + flex: 1; + color: #000; +} + +.orderGoods-brief { + display: flex; + padding-top: 30rpx; +} + +.orderGoods-brief view { + flex: 1; + color: #333333; +} + +.orderGoods-brief text { + font-weight: 600; +} + +/* 规格 */ +.reserveCont-title { + font-weight: 600; + padding: 30rpx; + font-size: 30rpx; +} + +.reserve-label { + display: flex; + padding: 0 30rpx 30rpx; + box-sizing: border-box; + font-size: 26rpx; +} + +.reserve-name { + flex: 1; + width: 200rpx; + margin-right: 20rpx; + color: #7e7e7e; +} + +.reserve-text { + width: calc(100% - 240rpx); + text-align: right; + line-height: 50rpx; +} + +.reserve-text text { + font-size: 24rpx; + display: inline-block; + background-image: linear-gradient(to right, #f16e06, #f34206); + color: #FFFFFF; + border-radius: 6rpx; + padding: 0 10rpx; + height: 44rpx; + line-height: 44rpx; + margin-top: 6rpx; +} + +.reserve-text text.active { + background-image: linear-gradient(to right, #027be6, #2855f0); +} + +.reserve-text.reserve-price { + font-weight: 600; + color: #1d37e2; +} + +.reserve-text.green{ + color: #eb504c; +} + +.reserve-copy { + color: #6774ff; + border: #6774ff 2rpx solid; + display: inline-block; + height: 34rpx; + line-height: 34rpx; + font-size: 26rpx; + padding: 0 10rpx; + border-radius: 4rpx; + margin-left: 10rpx; +} + +/* 底部菜单 */ +.order-data-footer { + position: fixed; + bottom: 0; + left: 0; + right: 0; + border-top: solid 1rpx #f2f2f2; + padding-top: 17rpx; + padding-right: 30rpx; + padding-left: 30rpx; + height: 83rpx; + background: white; + display: flex; + flex-wrap: wrap; + flex-direction: row-reverse; + z-index: 9; +} + +.order-btn { + margin-left: 20rpx; + height: 58rpx; + line-height: 58rpx; + box-sizing: border-box; + border: solid 1rpx #747788; + padding: 0 20rpx; + font-size: 26rpx; + border-radius: 10rpx; + margin-top: 5rpx; +} \ No newline at end of file diff --git a/pages/order/list/index.js b/pages/order/list/index.js new file mode 100644 index 0000000..5f9e44d --- /dev/null +++ b/pages/order/list/index.js @@ -0,0 +1,246 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + listType : 'unpay', //unpay待付款, paid待发货,delivered已发货,signed已签收 completed已完成 + orderArr : [], //订单列表 + disabled : false, + surplus : '', // 水滴数量 + orderNo : '', // 订单编号 + payEject : false, // 支付弹出 + payType : 'wechat' //支付类型 wechat微信 water水滴兑换 + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + listType: options.listType + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取订单列表 + this.ordersInfo(); + + // 获取用户信息 + this.userInfo(); + }, + + /** + * 用户信息 + */ + userInfo() { + wx.$api.user.home().then(res => { + this.setData({ + surplus : res.data.account.score.surplus + }) + }).catch(err => {}) + }, + + /** + * 订单列表 + */ + ordersInfo(page) { + wx.$api.user.orders({ + state: this.data.listType, + page : page + }).then(res => { + let listArr = this.data.orderArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.data) + this.setData({ + orderArr : newData, + page : res.data.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + }).catch(err => {}) + }, + + /** + * 状态筛选 + */ + onTabs(val){ + if(this.data.listType === val) return + this.setData({ + listType: val.currentTarget.dataset.type + }) + + // 商品详情数据 + this.ordersInfo(); + }, + + /** + * 选择支付方式 + */ + radioChange(e) { + this.setData({ + payType : e.detail.value + }) + }, + + /** + * 立即付款 + */ + payTap(e) { + this.setData({ + orderNo: e.currentTarget.dataset.no, + payEject: true + }) + }, + + /** + * 立即付款-弹出关闭 + */ + payClose() { + this.setData({ + payEject: false + }) + }, + + // 支付提交 + paySubmit() { + this.setData({ + payEject: false + }) + + if(this.data.payType == 'wechat') { + this.wxPay() + return + } + // this.data.payType == water 为水滴兑换 + this.waterPay() + }, + + // 微信支付 + wxPay() { + wx.showLoading({ + title: '支付中...', + mask : true + }) + let that = this + + wx.login({ + success: res => { + wx.$api.member.openid(res).then(openidRes => { + wx.$api.member.wechatPay(this.data.orderNo, { + type : 'miniapp', + openid : openidRes.data + }).then(PayRes => { + wx.hideLoading() + this.setData({ + disabled : true + }) + let payInfo = JSON.parse(PayRes.data.wechat) + wx.requestPayment({ + timeStamp: payInfo.timeStamp, + nonceStr : payInfo.nonceStr, + package : payInfo.package, + paySign : payInfo.paySign, + signType : payInfo.signType, + success : payInfoRes=>{ + if(payInfoRes.errMsg == "requestPayment:ok"){ + wx.showToast({ + title: '支付成功', + icon: 'none', + duration: 2000, + //显示透明蒙层,防止触摸穿透 + mask:true, + success: function () { + // 获取订单列表 + that.ordersInfo(); + } + }) + } + }, + fail : res=>{ + wx.showToast({ + title: '支付失败', + icon: 'none', + duration: 500, + //显示透明蒙层,防止触摸穿透 + mask:true, + success: function () { + // 获取订单列表 + that.ordersInfo(); + that.setData({ + listType: 'unpay' + }) + } + }) + } + }) + }).catch(err => {}) + }).catch(err => {}) + } + }) + }, + + // 水滴兑换 + waterPay() { + wx.showLoading({ + title: '水滴兑换中...', + mask : true + }) + let that = this + + wx.$api.mall.affirmPay(this.data.orderNo, {gateway: 'miniapp'}).then(res => { + wx.hideLoading() + this.setData({ + disabled : true + }) + wx.showToast({ + title: '兑换成功', + icon: 'none', + duration: 2000, + //显示透明蒙层,防止触摸穿透 + mask:true, + success: function () { + // 获取订单列表 + that.ordersInfo(); + + that.setData({ + listType: 'unpay' + }) + } + }) + }).catch(err => {}) + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取订单列表 + this.ordersInfo(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取订单列表 + this.ordersInfo(pageNumber); + } + } +}) \ No newline at end of file diff --git a/pages/order/list/index.json b/pages/order/list/index.json new file mode 100644 index 0000000..e3130c7 --- /dev/null +++ b/pages/order/list/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "我的订单" +} \ No newline at end of file diff --git a/pages/order/list/index.wxml b/pages/order/list/index.wxml new file mode 100644 index 0000000..eb21759 --- /dev/null +++ b/pages/order/list/index.wxml @@ -0,0 +1,84 @@ + + + 待发货 + 待付款 + 已发货 + 已签收 + + + + + + + + {{ item.order_no }} + {{ item.state }} + + + + + + + + {{ goodItem.sku.goods_name }} + + + {{goodItem.sku.price != 0 ? '¥' + goodItem.sku.price : '兑换'}} + + + + x{{ goodItem.qty }} + + + + + 下单时间:{{ item.created_at }} + + + + + 去付款 + 订单详情 + + + + + 加载中... + + + 没有更多了~ + + + + + + 暂无数据 + + + + + + + + + + + 微信支付 + + + + + + + + 水滴兑换 + + + + + + {{ payType == 'wechat' ? '立即支付' : '立即兑换'}} + \ No newline at end of file diff --git a/pages/order/list/index.wxss b/pages/order/list/index.wxss new file mode 100644 index 0000000..3783d94 --- /dev/null +++ b/pages/order/list/index.wxss @@ -0,0 +1,278 @@ +page { + overflow: hidden; + background: #f3f4f6; + padding: 30rpx; + box-sizing: border-box; +} + +.While { + border-radius: 10rpx; + margin-bottom: 30rpx; + background-color: #FFFFFF; + padding: 0 30rpx; + box-sizing: border-box; + box-shadow: 0 0 10rpx rgba(0, 0, 0, .05); +} + +.order { + position: absolute; + width: 100%; + left: 0; + top: 0; + padding: 120rpx 30rpx 30rpx; + box-sizing: border-box; + height: 100%; + overflow-y: scroll; +} + +.order-top { + line-height: 90rpx; + box-sizing: border-box; + display: flex; + font-size: 28rpx; + border-bottom: 2rpx #f2f2f2 solid; +} + +.order-top-number { + flex: 1; +} + +.order-top-tips { + font-size: 26rpx; + color: #eb504c; +} + +.order-name { + padding: 20rpx 0; + box-sizing: border-box; + position: relative; +} + +.order-img { + width: 90rpx; + height: 90rpx; + margin-right: 20rpx; + border-radius: 10rpx; +} + +.order-goods { + position: absolute; + width: 100%; + left: 0; + top: 0; + padding: 20rpx 20rpx 20rpx 110rpx; + box-sizing: border-box; +} + +.order-label { + display: flex; + font-size: 30rpx; + margin-bottom: 15rpx; +} + +.order-label-name { + flex: 1; + margin-right: 30rpx; +} + +.order-label-price { + font-size: 26rpx; + color: #999; +} + +.order-specs { + font-size: 24rpx; + color: #919191; + display: flex; +} + +.order-specs text { + display: inline-block; + flex: 1; +} + +.order-text { + font-size: 28rpx; + line-height: 40rpx; + display: flex; + padding-bottom: 20rpx; + border-top: 2rpx solid #f2f2f2; + border-bottom: 2rpx solid #f2f2f2; + padding-top: 20rpx; +} + +.order-time { + color: #919191; + font-size: 24rpx; + flex: 1; +} + +.order-price text { + font-weight: 600; + color: #1d37e2; +} + +.order-btn { + padding: 30rpx 0; + box-sizing: border-box; + position: relative; + font-size: 24rpx; + text-align: right; +} + +.order-btn-type { + flex: 1; +} + +.order-btn-type text { + display: inline-block; + background-image: linear-gradient(to right, #f16e06, #f34206); + color: #FFFFFF; + border-radius: 6rpx; + padding: 0 10rpx; + height: 44rpx; + line-height: 44rpx; + margin-top: 6rpx; +} + +.order-btn-type text.active { + background-image: linear-gradient(to right, #027be6, #2855f0); +} + +.order-btn-atn { + border: 2rpx solid #f2f2f2; + border-radius: 40rpx; + padding: 0 30rpx; + height: 52rpx; + line-height: 52rpx; + color: #767676; + display: inline-block; + margin-left: 15rpx; +} + +.order-btn-go { + color: #eb504c; + border-color: #eb504c; +} + +.order-btn-atn.active { + color: #1d37e2; + border-color: #bfc5ff; +} + +/* tabs */ +.header { + position: fixed; + top: 0; + left: 0; + right: 0; + z-index: 99; +} + +.tabs { + display: flex; + justify-content: space-around; + background: white; + padding: 15rpx 0; + font-size: 30rpx; + color: #9d9d9d; +} + +.item { + height: 60rpx; + line-height: 60rpx; +} + +.item.show { + color: #1d37e2; + border-bottom: solid 4rpx #1d37e2; +} +.payPop { + position: fixed; + width: 100%; + height: 100vh; + background-color: rgba(0, 0, 0, .3); + left: 0; + top: 0; + z-index: 998; + display: none; +} + +.payPop.active { + display: block; +} + +.payCont { + position: fixed; + width: 100vw; + background-color: #FFFFFF; + border-radius: 20rpx 20rpx 0 0; + box-sizing: border-box; + left: 0; + bottom: -10000%; + z-index: 999; + padding: 100rpx 40rpx 40rpx; + transition: .2s; +} + +.payCont-label-close { + width: 40rpx; + height: 40rpx; + position: absolute; + top: 30rpx; + right: 40rpx; + z-index: 1000; +} + +.payCont.active { + bottom: 0; +} + +.payCont-label { + display: flex; + height: 80rpx; + line-height: 80rpx; + margin-bottom: 40rpx; + border-top: 2rpx solid #ececec; + padding-top: 40rpx; + position: relative; +} + +.payCont-label-img { + width: 64rpx; + height: 64rpx; + margin-top: 8rpx; + margin-right: 20rpx; +} + +.payContList-label-name { + line-height: 80rpx; + display: flex; + flex: 1; + font-weight: 600; +} + +.payCont-label radio { + opacity: 0; + position: absolute; + width: 100%; + height: 100%; + left: 0; + top: 0; +} + +.payContList-label-arrow { + width: 38rpx; + height: 38rpx; + margin-top: 18rpx; +} + +.payCont-btn { + width: 100%; + text-align: center; + margin: 80rpx 0 40rpx; + background-color: #1d37e2; + line-height: 100rpx; + border-radius: 10rpx; + color: #FFFFFF; +} \ No newline at end of file diff --git a/pages/record/detail/detail.js b/pages/record/detail/detail.js new file mode 100644 index 0000000..03c5ee9 --- /dev/null +++ b/pages/record/detail/detail.js @@ -0,0 +1,148 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + userData : '', // 用户信息 + goodsData : '', // 商品信息 + aiSeeData : '', // 检测结果 + baseData : '', // 基本资料 + typesType : '', // 类型分类 + typesData : '', // 舌象类型 + resultData : '', // 舌象类型结果 + imageId : '', // 结果id + typesState : false,// 舌象类型结果弹出 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + imageId: options.tongue_id + }) + + // 获取用户信息 + this.userInfo(); + + // 获取基本资料初始化 + this.baseInfo(); + + // 获取检测报告结果 + this.aiInfo(options.tongue_id) + + // 获取舌象类型结果 + wx.$api.record.types(this.data.imageId, {type: ''}).then(res => { + this.setData({ + typesData : res.data + }) + }).catch(err => { }); + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() {}, + + /** + * 用户信息 + */ + userInfo() { + wx.$api.user.home().then(res => { + this.setData({ + userData: res.data + }) + }).catch(err => {}) + }, + + /** + * 基本资料初始化 + */ + baseInfo() { + wx.$api.water.Base().then(res => { + this.setData({ + baseData: res.data.base + }) + }).catch(err => {}) + }, + + /** + * 检测报告结果 + */ + aiInfo(imageid) { + wx.$api.record.aiSee(imageid).then(res => { + let {goods, tongue} = res.data + this.setData({ + goodsData: goods, + aiSeeData: tongue + }) + }).catch(err => { }) + }, + + /** + * 舌象类型分类 + */ + assayTap(e) { + this.setData({ + typesType: e.currentTarget.dataset.type, + typesState: true + }) + + // 获取舌象类型结果 + this.typesInfo(); + }, + + /** + * 舌象类型结果 + */ + typesInfo() { + wx.$api.record.types(this.data.imageId, {type: this.data.typesType}).then(res => { + switch (this.data.typesType){ + case 'shexing': + this.setData({ + resultData: res.data.shexing + }) + break; + case 'shese': + this.setData({ + resultData: res.data.shese + }) + break; + case 'taizhi': + this.setData({ + resultData: res.data.taizhi + }) + break; + default: + this.setData({ + resultData: res.data.taise + }) + } + }).catch(err => { }) + }, + + /** + * 舌象类型结果-关闭 + */ + perfect() { + this.setData({ + typesState: false + }) + }, + + /** + * 查看检测原图 + */ + previewImg(e) { + wx.previewImage({ + urls : [e.currentTarget.dataset.imgs], //需要预览的图片http链接列表,注意是数组 + current : '' // 当前显示图片的http链接,默认是第一个 + }) + } +}) \ No newline at end of file diff --git a/pages/record/detail/detail.json b/pages/record/detail/detail.json new file mode 100644 index 0000000..dc71813 --- /dev/null +++ b/pages/record/detail/detail.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "评估报告" +} \ No newline at end of file diff --git a/pages/record/detail/detail.wxml b/pages/record/detail/detail.wxml new file mode 100644 index 0000000..e90cfb2 --- /dev/null +++ b/pages/record/detail/detail.wxml @@ -0,0 +1,199 @@ + + + + 舌诊评估报告 + + + + + + + + + Hi~{{userData.nickname}} + + + 您有{{aiSeeData.ext.probability}}%的概率为:{{aiSeeData.tizhi_name}} + + + + + 身高(CM) + {{baseData.height}} + + + 体重(KG) + {{baseData.weight}} + + + 年龄(岁) + {{baseData.age}} + + + + + + {{typesData.taise.name}} + + + + {{item.name}} + + {{'有' + typesData.taise.count + '个结果'}} + + 正常 + + + {{typesData.taizhi.name}} + + + + {{item.name}} + + {{'有' + typesData.taizhi.count + '个结果'}} + + 正常 + + + {{typesData.shese.name}} + + + + {{item.name}} + + {{'有' + typesData.shese.count + '个结果'}} + + 正常 + + + {{typesData.shexing.name}} + + + + {{item.name}} + + {{'有' + typesData.shexing.count + '个结果'}} + + 正常 + + + + 查看检测原图 + + + 常见表现: + {{aiSeeData.changjianbiaoxian}} + + + 微量元素匮乏: + {{aiSeeData.drink_water.ext.elements}} + + + + + + + + + + + VS + + + + {{item}} + + + {{item}} + + + + 日常饮水建议 + {{item.name}}:{{item.value}} + + + + + + + 饮用锶源昆仑最佳方案 + + + + + 温水饮用锶源昆仑更好哦~ + 40~45℃水温饮用最佳,从中医角度来说,我们饮 用水的温度最好比自己体温要高,经常喝冷饮会损 耗体内的阳气,导致阴阳不平衡。 + + + + + + + 其他建议: + + + 宜吃 + {{aiSeeData.shiliao.yc}} + + + 慎吃 + {{aiSeeData.shiliao.sc}} + + + + {{aiSeeData.shiliao.qt}} + + + + + + + + + {{goodsData.name}} + 规格 500ml + {{goodsData.price.show}} + buy + + + + + + *建议遵循为您定制的健康建议,逐步改善饮食和生活习惯。 + + + + + + 建议您1个月后(已明显改善生活习惯或有新的 体检结果后) + 再次测试获得新的营养补充方案 + + + + + + + + 返回 + 邀请好友测试 + + + + + + + + {{resultData.name}} + + + + {{item.alias_name}}{{item.description}} + + + {{resultData.name + '正常'}} + + + 确定 + + + \ No newline at end of file diff --git a/pages/record/detail/detail.wxss b/pages/record/detail/detail.wxss new file mode 100644 index 0000000..3e5274b --- /dev/null +++ b/pages/record/detail/detail.wxss @@ -0,0 +1,651 @@ +page { + background-color: #f7faff; +} + +.detailBack { + width: 100%; +} + +.detailCont { + width: 100vw; + position: absolute; + padding: 60rpx 30rpx; + box-sizing: border-box; + top: 0; + left: 0; + border-bottom: 90px solid transparent; +} + +.top { + display: flex; + margin-bottom: 60rpx; +} + +.top-title { + flex: 1; + font-size: 48rpx; + margin-top: 10rpx; + font-weight: 600; +} + +.top-img { + width: 160rpx; +} + +/* 分析 */ +.assay { + background-color: #ffffff; + border-radius: 20rpx; + padding: 40rpx; + box-sizing: border-box; + margin-top: 30rpx; + box-shadow: 0 0 10rpx rgba(153, 153, 153, .2); +} + +.assayUser-top { + display: flex; + line-height: 60rpx; +} + +.assayUser-odds { + line-height: 80rpx; +} + +.assayUser-odds text { + color: #3b7cff; + font-weight: 600; + font-size: 40rpx; +} + +.assayUser-top-head { + width: 60rpx; + height: 60rpx; + border-radius: 50%; +} + +.assayUser-top-name { + padding-left: 25rpx; + box-sizing: border-box; + width: calc(100% - 60rpx); + font-size: 36rpx; + font-weight: 600; +} + +.assayInfo { + display: flex; + border: 2rpx solid #909090; + border-radius: 15rpx; + padding: 20rpx 0; + font-size: 26rpx; + margin-bottom: 30rpx; +} + +.assayInfo-label { + text-align: center; + flex: 3; +} + +.assayInfo-label-name { + margin-bottom: 10rpx; +} + +.assayReport { + margin: 50rpx 0 40rpx; + position: relative; + padding-top: 45%; + font-size: 26rpx; +} + +.assayReport-back { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; +} + +.locateOne, .locateTwo, .locateThree, .locateFour { + position: absolute; + z-index: 2; +} + +.locateOne { + top: 0; + left: 0; +} + +.locateTwo { + bottom: 42rpx; + left: 0; +} + +.locateThree { + top: 48rpx; + right: 0; +} + +.locateFour { + bottom: 4rpx; + right: 0; +} + +.locateOne-name { + line-height: 44rpx; + display: flex; + font-weight: 600; +} + +.locateOne-name image { + width: 26rpx; + margin: 10rpx 0 0 10rpx; +} + +.locateOne-tips { + background-color: #e9f0ff; + border-radius: 80rpx; + padding: 0 15rpx; + line-height: 40rpx; + margin-top: 16rpx; + font-size: 24rpx; +} + +.assayMaster { + text-align: center; +} + +.assayMaster-cont { + margin-bottom: 30rpx; + font-size: 30rpx; + border-radius: 10rpx; + border: 2rpx solid #3b7cff; + display: inline-block; + color: #3b7cff; + padding: 0 15rpx; + line-height: 58rpx; +} + +.assayResult { + margin-bottom: 50rpx; + border-bottom: 2rpx solid #eeeeee; + padding-bottom: 50rpx; +} + +.assayResult-name { + font-weight: 600; + margin-bottom: 20rpx; +} + +.assayResult-text { + line-height: 40rpx; + font-size: 28rpx; +} + +.assayResult:last-child { + border: none; + margin-bottom: 0; + padding-bottom: 0; +} + +/* 对比 */ +.ratioTop { + position: relative; +} + +.ratioTop-see { + text-align: center; +} + +.ratioTop-img { + text-align: center; + width: 50%; + box-sizing: border-box; +} + +.ratioTop-img:nth-child(1) { + padding: 0 20% 0 5%; +} + +.ratioTop-img:nth-child(2) { + padding: 0 5% 0 20%; +} + +.ratioTop-vs { + color: #3b7cff; + font-weight: 600; + font-size: 56rpx; + position: absolute; + width: 100rpx; + text-align: center; + top: 0; + left: calc(50% - 50rpx); + line-height: 160rpx; +} + +.ratioData { + display: flex; +} + +.ratioData-label { + flex: 2; +} + +.ratioData-label-name { + background-color: #f7faff; + line-height: 80rpx; + margin-top: 20rpx; + text-align: center; + border-radius: 10rpx; + position: relative; + font-size: 26rpx; + +} + +.ratioData-label-name::after{ + content: ' '; + position: absolute; + bottom: 0; + left: -20rpx; + border-width: 73rpx 20rpx; + border-style: solid; + border-color: transparent transparent #f7faff transparent; + border-radius: 15rpx; +} + +.ratioData-label:first-child { + margin-right: 30rpx; +} + +.ratioData-label:last-child { + margin-left: 30rpx; +} + +.ratioData-label:last-child .ratioData-label-name { + background-color: #3b7cff; + color: #ffffff; +} + +.ratioData-label:last-child .ratioData-label-name::after { + border-color: transparent transparent #3b7cff transparent; +} + +.ratioSuggest { + margin-top: 30rpx; +} + +.ratioSuggest-title { + margin: 60rpx 0 30rpx; + font-weight: 600; + font-size: 34rpx; +} + +.ratioSuggest-text { + position: relative; + padding-left: 30rpx; + box-sizing: border-box; + line-height: 40rpx; + margin-top: 30rpx; + font-size: 28rpx; +} + +.ratioSuggest-text::after { + position: absolute; + content: ''; + left: 0; + top: 15rpx; + background-color: #000000; + width: 10rpx; + height: 10rpx; + border-radius: 50%; +} + +.ratioSuggest-text text { + font-weight: 600; +} + +/* 方案 */ +.planCont { + margin-top: 50rpx; + display: flex; +} + +.planCont-img { + width: 120rpx; +} + +.planCont-brief { + width: calc(100% - 120rpx); + padding-left: 40rpx; + box-sizing: border-box; +} + +.planCont-brief-name { + font-size: 32rpx; + margin-bottom: 20rpx; +} + +.planCont-brief-text { + color: #666666; + font-size: 26rpx; + text-align: justify; + line-height: 40rpx; +} + +.planTitle { + font-weight: 600; + font-size: 34rpx; + position: relative; + height: 40rpx; +} + +.planTitle::after { + background-color: #d8e5ff; + content: ''; + position: absolute; + left: 0; + bottom: -10rpx; + height: 30rpx; + width: 55%; +} + +.planTitle-name { + position: absolute; + left: 0; + bottom: 0; + z-index: 2; +} + +/* 其他建议 */ +.otherTitle { + font-weight: 600; + font-size: 32rpx; +} + +.otherLabel { + margin-top: 30rpx; +} + +.otherLabel-name { + font-weight: 600; + color: #00d005; + position: relative; + padding-left: 30rpx; +} + +.otherLabel-name::after { + position: absolute; + content: ''; + left: 0; + top: 15rpx; + background-color: #00d005; + width: 10rpx; + height: 10rpx; + border-radius: 50%; +} + +.otherLabel-text { + line-height: 40rpx; + margin-top: 30rpx; + text-align: justify; + font-size: 28rpx; +} + +.otherLabel.red .otherLabel-name { + color: #d80000; +} + +.otherLabel.red .otherLabel-name::after { + background-color: #d80000; +} + +/* 产品 */ +.goods { + position: relative; +} + +.goodsImg { + width: 180rpx; + height: 180rpx; + border-radius: 10rpx; + display: block; +} + +.goodsCont { + height: 180rpx; + position: absolute; + left: 0; + top: 0; + padding-left: 220rpx; + box-sizing: border-box; + width: 100%; +} + +.goodsCont-name { + font-size: 32rpx; +} + +.goodsCont-specs { + color: #999999; + font-size: 26rpx; + margin: 15rpx 0 30rpx; +} + +.goodsCont-price { + font-weight: 600; +} + +.goodsCont-price text { + font-size: 40rpx; +} + +.goodsCont-btn { + position: absolute; + right: 0; + bottom: 0rpx; + background-color: #3c7dff; + display: inline-block; + color: #ffffff; + height: 68rpx; + line-height: 68rpx; + padding: 0 35rpx; + border-radius: 90rpx; + text-transform: uppercase; +} + +/* 温馨提示 */ +.tips { + text-align: center; + font-size: 26rpx; + margin: 30rpx 0; + color: #999999; +} + +/* 机器人提示 */ +.robot { + display: flex; +} + +.robotImg { + width: 140rpx; + margin-top: 10rpx; +} + +.robotCont { + background-color: #ffffff; + padding: 20rpx 30rpx; + box-sizing: border-box; + width: calc(100% - 160rpx); + margin-left: 20rpx; + border-radius: 15rpx; + line-height: 40rpx; + font-size: 26rpx; +} + +.robotCont-name text { + color: #999999; +} + +/* 底部按钮 */ +.footer { + width: 100%; + height: 100px; + background-color: #f7faff; + position: fixed; + left: 0; + bottom: 0; + z-index: 9989; + padding: 30rpx 10rpx; + box-sizing: border-box; + display: block; +} + +.footer.active { + display: none; +} + +.footer-flex { + display: flex; +} + +.footer-flex-btn { + flex: 2; + margin: 0 15rpx; + line-height: 48px; + background-color: transparent; + height: 48px; + text-align: center; + color: #3b7cff; + border-radius: 80rpx; + border: 2rpx solid #3b7cff; +} + +.footer-flex-share { + background-color: #3b7cff; + color: #FFFFFF; +} + + +/* 饮水量弹出 */ +.refertoEject { + position: fixed; + width: 100vw; + height: 100vh; + left: 0; + top: 0; + background-color: rgba(0, 0, 0, .6); + z-index: 10000; + display: none; +} + +.refertoEject.active { + display: block; +} + +.refertoCont { + -webkit-box-orient: vertical; + -webkit-box-pack: center; + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + z-index: 100000; + padding: 0 15%; + box-sizing: border-box; + text-align: center; + display: none; +} + +.refertoCont.active { + display: -webkit-box; +} + +.refertoCont-text { + background-color: #ffffff; + border-radius: 20rpx; + box-sizing: border-box; + position: relative; +} + +.refertoCont-ls { + width: 200rpx; +} + +.refertoCont-title { + text-align: center; + font-weight: 600; + padding: 30rpx 0; + font-size: 34rpx; + box-sizing: border-box; + border-bottom: 2rpx solid #e4e4e4; +} + +.refertoCont-tips { + line-height: 48rpx; + text-align: justify; + padding: 30rpx 40rpx; + box-sizing: border-box; + font-size: 30rpx; + max-height: 30vh; + overflow-y: scroll; +} + +.refertoCont-tips text { + color: #528cff; + font-weight: 600; + padding-right: 10rpx; +} + +.refertoCont-tips-label { + position: relative; + padding-left: 30rpx; + box-sizing: border-box; + font-size: 30rpx; + margin-bottom: 30rpx; +} + +.refertoCont-tips-label:last-child { + margin-bottom: 0; +} + +.refertoCont-tips-label::after { + position: absolute; + content: ''; + left: 0; + top: 18rpx; + width: 14rpx; + height: 14rpx; + border-radius: 50%; + background-color: #b3b3b3; +} + +.refertoCont-tips-item { + display: inline-block; + font-size: 28rpx; + background-color: #528cff; + color: #ffffff; + padding: 0 13rpx; + border-radius: 10rpx; + margin-right: 15rpx; + height: 40rpx; + line-height: 40rpx; +} + +.publicPop-btn { + line-height: 80rpx; + font-size: 32rpx; + display: flex; + border-top: 2rpx solid #e6e6e6; + padding: 30rpx 50rpx; + box-sizing: border-box; +} + +.publicPop-btn-go { + width: 100%; + color: #ffffff; + background-color: #3b7cff; + text-align: center; + height: 90rpx; + line-height: 90rpx; + font-size: 30rpx; + border-radius: 90rpx; +} \ No newline at end of file diff --git a/pages/record/index.js b/pages/record/index.js new file mode 100644 index 0000000..7177fee --- /dev/null +++ b/pages/record/index.js @@ -0,0 +1,160 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + isFixedTop : 0, + barHeight : getApp().globalData.statusBarHeight, // 状态栏高度 + needBase : '', // 是否需要完善资料 + typesState : false, // 拍摄结果弹出 + baseState : false // 是否完善资料弹出 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取登录状态 + if(wx.getStorageSync("token")){ + // 获取初始化 + this.initInfo(); + } + }, + + /** + * 初始化 + */ + initInfo () { + wx.$api.water.Init().then(res => { + this.setData({ + needBase: res.data.need_base + }) + }).catch(err => {}) + }, + + /** + * 上传图片信息 + */ + uploadPhoto() { + if(wx.getStorageSync("token")){ + // 是否需要完善资料 + if(this.data.needBase) { + this.setData({ + baseState: true + }) + return + } + + // 拍摄 + wx.chooseMedia({ + count : 1, + mediaType: ['image'], + sourceType: ['camera'], + camera : 'front', + success : path => { + if(wx.cropImage){ + wx.cropImage({ + src: path.tempFiles[0].tempFilePath, // 图片路径 + cropScale: '3:4', // 裁剪比例 + success: res=> { + // 上传图片 + wx.$api.file.uploadImg(res.tempFilePath, {}).then(res=>{ + // 获取舌诊检测接口 + this.checkEnter(res.url); + + this.setData({ + typesState: true + }) + }) + }, + complete: err => {} + }) + return + } + + // 上传图片 + wx.$api.file.uploadImg(path.tempFiles[0].tempFilePath, {}).then(res=>{ + this.checkEnter(res.url); + this.setData({ + typesState: true + }) + }) + } + }) + }else { + // 去登录 + wx.navigateTo({ + url: "/pages/login/index" + }) + } + }, + + /** + * 皮肤检测接口 + */ + checkEnter(img) { + wx.$api.record.tongue({image: img}).then(res => { + wx.navigateTo({ + url: "/pages/record/detail/detail?tongue_id=" + res.data.tongue_id + }) + this.setData({ + typesState: false + }) + }).catch(err => { + this.setData({ + typesState: false + }) + }) + }, + + /** + * 处理未登录时的转跳 + */ + userNav(e){ + let pageUrl = e.currentTarget.dataset.url + if(wx.getStorageSync("token")){ + wx.navigateTo({ + url: pageUrl + }) + }else{ + // 去登录 + wx.navigateTo({ + url: "/pages/login/index" + }) + } + }, + + /** + * 关闭完善资料弹出 + */ + establish() { + this.setData({ + baseState: false + }) + }, + + /** + * 完善资料跳转 + */ + perfect() { + this.setData({ + baseState: false + }) + wx.navigateTo({ + url: '/pages/clock/base/base' + }) + } +}) \ No newline at end of file diff --git a/pages/record/index.json b/pages/record/index.json new file mode 100644 index 0000000..f0f1934 --- /dev/null +++ b/pages/record/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "navigationStyle": "custom", + "navigationBarTextStyle": "white" +} \ No newline at end of file diff --git a/pages/record/index.wxml b/pages/record/index.wxml new file mode 100644 index 0000000..d77f799 --- /dev/null +++ b/pages/record/index.wxml @@ -0,0 +1,41 @@ + + + + + + + AI智能舌诊 + 上传舌照 快速检测 专业分析 + + + 尽量使用后置摄像头拍摄请在无色灯光下使用 + + 点击拍摄 + 历史档案 去查看 > + + + + + + + + 检测中,请等待... + + + + + + + + + 完善资料提示 + + + 您还没有完善基本资料,完善资料后,可进行饮水打卡 + + + 暂不完善 + 去完善 + + + \ No newline at end of file diff --git a/pages/record/index.wxss b/pages/record/index.wxss new file mode 100644 index 0000000..95505ec --- /dev/null +++ b/pages/record/index.wxss @@ -0,0 +1,243 @@ +/* 顶部 */ +.navigation { + position: fixed; + top: 0; + left: 0; + z-index: 999; + width: 100%; + height: 90rpx; + background-color: transparent; + transition: .5s; +} + +.navigation.active { + background-color: #ffffff; +} + +.navigation-arrow { + width: 120rpx; + margin-left: 40rpx; +} + +.recordBack { + width: 100vw; + height: 100vh; + display: block; +} + +.recordCont { + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-box-pack: center; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + z-index: 9; + text-align: center; + padding: 0 100rpx 40rpx; + box-sizing: border-box; + overflow-y: scroll; +} + +.recordCont-title { + font-weight: 600; + font-size: 86rpx; + letter-spacing: 2px; + padding-top: 100rpx; +} + +.recordCont-tips { + display: inline-block; + border: 2rpx solid #2e2f2f; + font-size: 28rpx; + padding: 0 30rpx; + border-radius: 90rpx; + line-height: 50rpx; + margin-top: 30rpx; + position: relative; + margin-bottom: 40rpx; +} + +.recordCont-tips::after { + position: absolute; + content: ''; + left: calc(50% - 45rpx); + bottom: -40rpx; + width: 90rpx; + height: 4rpx; + background-color: #2e2f2f; +} + +.recordCont-img { + width: 100%; +} + +.recordCont-text text { + display: block; + line-height: 54rpx; + font-size: 30rpx; +} + +.recordCont-btn { + background-color: #000000; + color: #ffffff; + display: inline-block; + height: 100rpx; + line-height: 100rpx; + padding: 0 130rpx; + font-size: 38rpx; + margin: 50rpx 0 30rpx; + border-radius: 100rpx; +} + +.recordCont-record { + font-size: 30rpx; +} + + +/* 饮水量弹出 */ +.captureEject { + position: fixed; + width: 100vw; + height: 100vh; + left: 0; + top: 0; + background-color: rgba(0, 0, 0, .6); + z-index: 10000; + display: none; +} + +.captureEject.active { + display: block; +} + +.captureCont { + -webkit-box-orient: vertical; + -webkit-box-pack: center; + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + z-index: 100000; + padding: 0 15%; + box-sizing: border-box; + text-align: center; + display: none; +} + +.captureCont.active { + display: -webkit-box; +} + +.captureCont-write { + background-color: #ffffff; + border-radius: 20rpx; + padding: 50rpx; + box-sizing: border-box; +} + +.captureCont-write-img { + width: 60%; +} + +.captureCont-write-text { + color: #528cff; + font-weight: 600; + margin-top: 20rpx; +} + + +/* 完善信息弹出 */ +.refertoEject { + position: fixed; + width: 100vw; + height: 100vh; + left: 0; + top: 0; + background-color: rgba(0, 0, 0, .6); + z-index: 10000; + display: none; +} + +.refertoEject.active { + display: block; +} + +.refertoCont { + -webkit-box-orient: vertical; + -webkit-box-pack: center; + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + z-index: 100000; + padding: 0 15%; + box-sizing: border-box; + text-align: center; + display: none; +} + +.refertoCont.active { + display: -webkit-box; +} + +.refertoCont-text { + background-color: #ffffff; + border-radius: 20rpx; + box-sizing: border-box; + position: relative; +} + +.refertoCont-ls { + width: 260rpx; +} + +.refertoCont-title { + text-align: center; + font-weight: 600; + padding: 40rpx 0; + font-size: 34rpx; + box-sizing: border-box; +} + +.refertoCont-tips { + line-height: 48rpx; + text-align: center; + padding: 0 60rpx 30rpx; + box-sizing: border-box; +} + +.publicPop-btn { + line-height: 80rpx; + font-size: 32rpx; + display: flex; + border-top: 2rpx solid #e6e6e6; +} + + +.publicPop-btn-go { + width: 50%; + text-align: center; + height: 100rpx; + line-height: 100rpx; + font-size: 30rpx; +} + +.publicPop-btn-border { + color: #528cff; + position: relative; +} + +.publicPop-btn-border::after { + position: absolute; + content: ''; + left: 0; + top: 0; + width: 2rpx; + height: 100rpx; + background-color: #e6e6e6; +} \ No newline at end of file diff --git a/pages/record/list/list.js b/pages/record/list/list.js new file mode 100644 index 0000000..a12d770 --- /dev/null +++ b/pages/record/list/list.js @@ -0,0 +1,93 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + data: { + userLogin : false, + listArr : [], // 商品列表 + page : {}, // 分页信息 + lodingStats : false, // 加载状态 + disabled : false, // 支付按钮 + payStatus : false, // 支付弹框 + catchtouchmove: false + }, + + onLoad(options) {}, + + onShow() { + // 获取登录状态 + if(wx.getStorageSync("token") != ''){ + this.setData({ + userLogin: true, + disabled : false + }) + // 获取检测结果列表 + this.aiInfo(); + } else { + this.setData({ + userLogin: false + }) + } + }, + + /** + * 检测结果列表 + */ + aiInfo (page){ + wx.$api.record.aiList({ + page: page || 1 + }).then(res => { + let listArr = this.data.listArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.data) + this.setData({ + listArr : newData, + page : res.data.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + }).catch(err => { }) + }, + + /** + * 处理未登录时的转跳 + */ + assessGo(){ + if(wx.getStorageSync("token") != ''){ + wx.navigateTo({ + url: '/pages/index/assess/assess?code=' + wx.getStorageSync("openid") + }) + }else{ + // 去登录 + wx.navigateTo({ + url: "/pages/login/index" + }) + } + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取检测结果列表 + this.aiInfo(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取检测结果列表 + this.aiInfo(pageNumber); + } + } +}) diff --git a/pages/record/list/list.json b/pages/record/list/list.json new file mode 100644 index 0000000..327b647 --- /dev/null +++ b/pages/record/list/list.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "历史档案" +} \ No newline at end of file diff --git a/pages/record/list/list.wxml b/pages/record/list/list.wxml new file mode 100644 index 0000000..9ab4c94 --- /dev/null +++ b/pages/record/list/list.wxml @@ -0,0 +1,32 @@ + + 检测报告 + + + {{item.created_at}} + 检测报告精准分析您舌诊问题 + 查看报告 + + + + 加载中... + + + 没有更多了~ + + + + + + *建议遵循为您定制的健康建议,逐步改善饮食和生活习惯。 + + + + + + + + 暂无报告数据 + 进行AI智能舌诊后,可查看历史数据 + + + \ No newline at end of file diff --git a/pages/record/list/list.wxss b/pages/record/list/list.wxss new file mode 100644 index 0000000..9097750 --- /dev/null +++ b/pages/record/list/list.wxss @@ -0,0 +1,105 @@ +page { + background-color: #f7faff; +} + + +/* 列表 */ +.report { + width: 100%; + padding: 30rpx 30rpx 0; + box-sizing: border-box; +} + +.report-title { + font-size: 36rpx; +} + +.report-list { + margin-top: 30rpx; +} + +.report-item { + background-color: #fff; + border-radius: 20rpx; + padding: 30rpx; + box-sizing: border-box; + box-shadow: 0 4rpx 30rpx 2rpx rgba(0, 0, 0, .05); + color: #0d0d0d; + position: relative; + margin-bottom: 30rpx; +} + +.report-item:last-child { + margin: 0; +} + +.report-time { + font-size: 34rpx; +} + +.report-tips { + font-size: 28rpx; + margin-top: 20rpx; + line-height: 60rpx; + color: #414141; +} + +.report-btn { + position: absolute; + right: 30rpx; + bottom: 30rpx; + color: #3b7cff; + border: #3b7cff 2rpx solid; + font-size: 26rpx; + line-height: 56rpx; + padding: 0 30rpx; + border-radius: 90rpx; +} + +/* 友情提示 */ +.report-point { + padding: 40rpx 50rpx; + box-sizing: border-box; + text-align: center; +} + +.report-point-text { + color: #999999; + line-height: 50rpx; +} + +.report-point-text text { + display: block; + font-size: 30rpx; +} + +.report-point-btn { + margin-top: 50rpx; + background-color: #3b7cff; + display: inline-block; + color: #fff; + border-radius: 80rpx; + line-height: 90rpx; + width: 60%; +} + +/* 暂无数据 */ +.reportTips-title { + color: #000; + font-size: 34rpx; + line-height: 80rpx; +} + +.reportTips-text { + font-size: 26rpx; +} + +.reportTips-btn { + background-color: #3b7cff; + display: inline-block; + color: #fff; + line-height: 78rpx; + padding: 0 60rpx; + border-radius: 10rpx; + margin-top: 50rpx; +} diff --git a/pages/record/share/share.js b/pages/record/share/share.js new file mode 100644 index 0000000..800d38d --- /dev/null +++ b/pages/record/share/share.js @@ -0,0 +1,187 @@ +// pages/report/share/share.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + barHeight : getApp().globalData.statusBarHeight, // 状态栏高度 + userData : '', // 用户信息 + inviteCode : '', // 二维码 + + //海报 + canvas : '' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + // 初始化画布 + wx.createSelectorQuery().select('#coverCanvas').fields({node: true, size: true}).exec(canvasNode => { + const canvas = canvasNode[0].node + canvas.width = 375 + canvas.height = 800 + this.setData({ + canvas + }) + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 小程序码 + this.ShareInfo(); + + // 获取用户信息 + this.userInfo(); + }, + + /** + * 小程序码 + */ + ShareInfo() { + wx.$api.user.miniShare({ + url: '/pages/index/index' + }).then(res => { + this.setData({ + inviteCode: res.data.qrcode + }) + }).catch(err => {}) + }, + + /** + * 用户信息 + */ + userInfo() { + wx.$api.user.home().then(res => { + this.setData({ + userData : res.data + }) + }).catch(err => {}) + }, + + /** + * 生成海报 + */ + onCanvas(){ + wx.showLoading({ + title: '生成图片中...', + mask : true + }) + const canvas = this.data.canvas + const ctx = canvas.getContext('2d') + const codeImgEl = canvas.createImage() + const backBackEl = canvas.createImage() + + + codeImgEl.src = this.data.inviteCode //二维码 + backBackEl.src = 'https://api.siyuankunlun.com/storage/images/2023/11/17/1d57a567ca458f3cc162655cf9201bda.png' //背景素材 + + const codeImgLoding = new Promise((resolve, reason) => { + codeImgEl.onload = () => { + resolve() + } + }) + const backBackLoding = new Promise((resolve, reason) => { + backBackEl.onload = () => { + resolve() + } + }) + Promise.all([codeImgLoding, backBackLoding]).then(() => { + // 绘制[背景] + ctx.drawImage(backBackEl, 0, 0, 375, 800) + + // 绘制[二维码] + ctx.drawImage(codeImgEl, 260, 650, 80, 80) + + // 文字 + ctx.font = "bold 20px Arial"; //字体大小 + ctx.fillStyle = "#3b7cff"; //字体颜色 + ctx.textAlign = "center" + ctx.fillText('AI智能舌诊', 190, 530); + + // 文字 + ctx.font = "15px Arial"; //字体大小 + ctx.fillStyle = "#000000"; //字体颜色 + ctx.textAlign = "center" + ctx.fillText('上传舌照 快速检测 专业分析', 190, 573); + + // 文字 + ctx.font = "14px Arial"; //字体大小 + ctx.fillStyle = "#666666"; //字体颜色 + ctx.textAlign = "center" + ctx.fillText('舌形、舌色、苔质、苔色、微量元素等~', 188, 605); + + // 文字 + ctx.font = "15px Arial"; //字体大小 + ctx.fillStyle = "#000000"; //字体颜色 + ctx.fillText('锶源昆仑,舌诊评估检测', 145, 682); + + // 文字 + ctx.font = "15px Arial"; //字体大小 + ctx.fillStyle = "#000000"; //字体颜色 + ctx.fillText('为您推荐饮水建议', 120, 713); + + wx.hideLoading() + wx.canvasToTempFilePath({ + canvas: this.data.canvas, + success : res => { + wx.saveImageToPhotosAlbum({ + filePath: res.tempFilePath, + success: saveRes => { + wx.showToast({ + title: '海报已保存至您的相册', + icon : 'none' + }) + this.setData({ + shareSee: false + }) + }, + fail: () => { + wx.hideLoading() + wx.showModal({ + title: '提示', + content: '暂未授权小程序写入您的相册,无法存储海报', + confirmColor: '#e50d01', + confirmText: '去设置', + success: res => { + if (res.confirm) { + wx.openSetting() + } + } + }) + } + }) + }, + }) + }).catch(err => { + wx.showToast({ + title: '图片加载失败', + icon : 'none' + }) + }) + }, + + /** + * 返回上一页 + */ + returnGo() { + wx.navigateBack({ + delta: 1 + }) + }, + + /** + * 微信分享 + */ + onShareAppMessage(){ + return { + title : this.data.userData.nickname + ':' + '邀请您一起AI测肤', + path : "/pages/index/index?invite=" + this.data.userData.invite, + imageUrl: "https://api.siyuankunlun.com/storage/images/2023/11/13/e6c4ba347287a6234864adcb88e04e1e.png" + } + } +}) \ No newline at end of file diff --git a/pages/record/share/share.json b/pages/record/share/share.json new file mode 100644 index 0000000..f0f1934 --- /dev/null +++ b/pages/record/share/share.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "navigationStyle": "custom", + "navigationBarTextStyle": "white" +} \ No newline at end of file diff --git a/pages/record/share/share.wxml b/pages/record/share/share.wxml new file mode 100644 index 0000000..e9437ba --- /dev/null +++ b/pages/record/share/share.wxml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + AI智能舌诊 + 上传舌照 快速检测 专业分析 + 舌形、舌色、苔质、苔色、微量元素等~ + + + + 锶源昆仑 + 舌诊评估检测,为您推荐饮水建议 + + + + + + + + + + 保存海报 + + + + + \ No newline at end of file diff --git a/pages/record/share/share.wxss b/pages/record/share/share.wxss new file mode 100644 index 0000000..0cac786 --- /dev/null +++ b/pages/record/share/share.wxss @@ -0,0 +1,174 @@ +page { + background-color: #f7faff; +} + + +/* 返回 */ +.navigation{ + position: fixed; + top: 0; + left: 0; + z-index: 999; + width: 100%; + height: 90rpx; + background-color: transparent; + transition: .2s; +} + +.navigation.active { + background-color: transparent; +} + +.navigation-arrow { + width: 44rpx; + height: 44rpx; + margin: 20rpx 15rpx 0 20rpx; +} + + +/* 顶部背景 */ +.top { + width: 100%; + position: relative; + height: 100vh; + overflow: hidden; +} + +.top-back { + position: absolute; + height: 100%; + left: 0; + top: 0; + width: 100%; + z-index: 1; +} + +.top-img { + position: absolute; + left: 20%; + top: 15%; + width: 60%; + z-index: 1; +} + +/* 内容 */ +.seeCont { + position: absolute; + bottom: 0; + z-index: 100; + width: 100%; + padding: 60rpx 30rpx 120rpx; + box-sizing: border-box; +} + +.seeBorder { + border: 4rpx solid #ffffff; + border-radius: 15rpx; + overflow: hidden; + width: 100%; + box-sizing: border-box; +} + +.seeTop { + background-color: #ffffff; + opacity: .75; + padding: 30rpx 50rpx; + box-sizing: border-box; +} + +.seeTop-img { + text-align: center; +} + +.seeTop-img-title { + width: 34%; +} + +.seeTop-img-line { + width: 100%; + margin: 20rpx 0; +} + +.seeTop-cont { + text-align: center; + font-size: 28rpx; + border-bottom: 2rpx dashed #3b7cff; + padding-bottom: 40rpx; +} + +.seeTop-cont-name { + color: #3b7cff; + font-weight: 600; + font-size: 40rpx; +} + +.seeTop-cont-tips { + margin: 30rpx 0 15rpx; +} + +.seeTop-cont-tips text { + color: #3b7cff; +} + +.seeTop-cont-text { + color: #666666; +} + +.seeTop-share { + padding-top: 40rpx; + box-sizing: border-box; + display: flex; +} + +.seeTop-share-title { + font-size: 26rpx; + line-height: 58rpx; + flex: 1; +} + +.seeTop-share-code { + width: 110rpx; + height: 110rpx; + box-sizing: border-box; +} + +.seeTop-share-img { + width: 100%; + height: 100%; +} + +.seeBtn { + text-align: center; + width: 100%; + display: flex; + margin-top: 50rpx; +} + +.seeBtn-btn { + flex: 2; + background-color: #3d7eff; + display: inline-block; + color: #ffffff; + border-radius: 90rpx; + height: 90rpx !important; + line-height: 90rpx !important; + padding: 0 80rpx !important; + margin: 0 15rpx !important; + border: 2rpx solid #3d7eff; + font-size: 30rpx; +} + +.seeBtn-btn-border { + background-color: #ffffff; + color: #3d7eff; + font-weight: normal; + width: auto !important; +} + +/* canvas */ +.canvas-img { + position: fixed; + left: -10000%; + top: 0; + z-index: 99; +} \ No newline at end of file diff --git a/pages/stock/addSite/index.js b/pages/stock/addSite/index.js new file mode 100644 index 0000000..e906fcf --- /dev/null +++ b/pages/stock/addSite/index.js @@ -0,0 +1,183 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + name : '', // 姓名 + mobile : '', // 电话 + address : '', // 地址 + defaultVal: '', // 默认地址 + // 省份选择 + areasArr : [], + areaId : '', + areaIndex : 0, + + // 市级选择 + cityArr : [], + cityId : 0, + cityIndex : 0, + + // 区域选择 + regiArr : [], + regiId : 0, + regiIndex : 0, + + disabled : false + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + experience: options.experience + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + if(this.data.experience != false) { + this.setData({ + areaIndex: 18 + }) + } + + // 获取省市区列表 + this.createInfo(); + }, + + /** + * 省市区列表 + */ + createInfo() { + wx.$api.stock.create().then(res => { + let areas = res.data, + areaIndex = this.data.areaIndex + + this.setData({ + areasArr : areas, + areaId : areas[areaIndex].id, + + }) + this.citylist(areas[areaIndex].id) + }).catch(err => {}) + }, + + /** + * 所在省份-下拉 + */ + areasChange(e) { + let area = this.data.areasArr, + index = e.detail.value, + atcode = area[index].id + if (index != this.data.areaIndex) { + this.setData({ + areaIndex : index, + areaId : atcode + }) + // 获取市级列表 + this.citylist(atcode) + } + }, + + /** + * 市级列表 + */ + citylist(cityId) { + wx.$api.stock.create({ + parent_id: cityId + }).then(res=>{ + let cityArr = res.data + // 从体验官入口进入 默认为深圳 + if(this.data.experience) { + this.setData({ + cityId : cityArr[2].id, + cityIndex : 2, + cityArr : cityArr + }) + this.regilist(cityArr[2].id) + return + } + + this.setData({ + cityId : cityArr[0].id, + cityIndex : 0, + cityArr : cityArr + }) + + // 获取区级列表 + this.regilist(cityArr[0].id) + }) + }, + + /** + * 市级下拉筛选 + */ + cityDrop(e) { + let city = this.data.cityArr, + index = e.detail.value, + citycode = city[index].id + if (index != this.data.areaIndex) { + this.setData({ + cityIndex : index, + qcityId : citycode + }) + + // 获取市级列表 + this.regilist(citycode) + } + }, + + /** + * 区列表 + */ + regilist(areaId) { + wx.$api.stock.create({ + parent_id: areaId + }).then(res=>{ + this.setData({ + regiArr : res.data, + regiId : res.data[0].id, + regiIndex : 0 + }) + }) + }, + + /** + * 区下拉筛选 + */ + regiDrop(e) { + let newIndex = e.detail.value + this.setData({ + regiIndex : newIndex, + regiId : this.data.regiArr[newIndex].id + }) + }, + + // 提交表单 + siteform(e) { + let value = e.detail.value + let data = { + name : value.name, + mobile : value.mobile, + address : value.address, + province_id : this.data.areaId, + city_id : this.data.cityId, + district_id : this.data.regiId + } + wx.$api.stock.siteAdd(data).then(res => { + this.setData({ + disabled: true + }) + wx.navigateBack() + }).catch(err => {}) + } +}) \ No newline at end of file diff --git a/pages/stock/addSite/index.json b/pages/stock/addSite/index.json new file mode 100644 index 0000000..9b706f4 --- /dev/null +++ b/pages/stock/addSite/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "新增地址" +} \ No newline at end of file diff --git a/pages/stock/addSite/index.wxml b/pages/stock/addSite/index.wxml new file mode 100644 index 0000000..a043359 --- /dev/null +++ b/pages/stock/addSite/index.wxml @@ -0,0 +1,48 @@ +
+ + + + + + + + + + + + + {{ areasArr[areaIndex].name }} + + + + + + + + + {{ cityArr[cityIndex].name }} + + + + + + + + + {{ regiArr[regiIndex].name }} + + + + + + + + + + + + +
\ No newline at end of file diff --git a/pages/stock/addSite/index.wxss b/pages/stock/addSite/index.wxss new file mode 100644 index 0000000..784d196 --- /dev/null +++ b/pages/stock/addSite/index.wxss @@ -0,0 +1,79 @@ +.site-form { + background: white; + display: block; +} + +.site-input { + padding: 0 30rpx 0 200rpx; + position: relative; + line-height: 110rpx; + min-height: 110rpx; + border-bottom: 2rpx solid #f3f3f3; +} + +.site-input::before { + position: absolute; + bottom: 0; + left: 30rpx; + right: 0; + height: 1rpx; + content: ""; + background: #e4e6f2; +} + +.site-input:last-child::before { + display: none; +} + +.site-input label { + position: absolute; + left: 30rpx; + top: 0; +} + +.site-input input { + height: 110rpx; +} + +.site-input image { + width: 38rpx; + height: 38rpx; + position: absolute; + right: 20rpx; + top: calc(50% - 19rpx); +} + +.site-btn { + padding: 20rpx 30rpx; + margin-top: 100rpx; +} + +.site-btn button[size="mini"] { + width: 100%; + background: #1d37e2; + height: 88rpx; + line-height: 88rpx; + font-size: 30rpx; + color: white; + padding: 0; +} + +.site-btn button[disabled] { + background: #7789ff !important; + color: #fff !important; +} + +.site-switch { + font-size: 32rpx; + margin: 30rpx; + display: flex; + line-height: 40rpx; +} + +.site-switch text { + flex: 1; +} + +.site-switch-active { + color: #797979; +} \ No newline at end of file diff --git a/pages/stock/detailed/index.js b/pages/stock/detailed/index.js new file mode 100644 index 0000000..d09f62f --- /dev/null +++ b/pages/stock/detailed/index.js @@ -0,0 +1,87 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + stockData : '', //前置 + logsArr : [], // 提货列表数据 + page : {}, //下一页 + lodingStats : false, //加载状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取提货前置 + this.pickInfo(); + + // 获取账变记录 + this.logsList(); + }, + + /** + * 提货前置 + */ + pickInfo (){ + wx.$api.stock.pick().then(res => { + this.setData({ + stockData : res.data.stockData + }) + }).catch(err => {}) + }, + + /** + * 账变记录 + */ + logsList (page){ + wx.$api.stock.logs({ + page: page + }).then(res => { + let listArr = this.data.logsArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.data) + this.setData({ + logsArr : newData, + page : res.data.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + }).catch(err => {}) + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取账变记录 + this.logsList(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取账变记录 + this.logsList(pageNumber); + } + } +}) \ No newline at end of file diff --git a/pages/stock/detailed/index.json b/pages/stock/detailed/index.json new file mode 100644 index 0000000..c77ab60 --- /dev/null +++ b/pages/stock/detailed/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "库存明细" +} \ No newline at end of file diff --git a/pages/stock/detailed/index.wxml b/pages/stock/detailed/index.wxml new file mode 100644 index 0000000..25ad739 --- /dev/null +++ b/pages/stock/detailed/index.wxml @@ -0,0 +1,44 @@ + + + + + 库存总量 + {{stockData.stock}} + + + 提货量 + {{stockData.hold}} + + + + + + 库存明细 + + + + + {{item.type}} + + + {{item.variable}} + + + + {{item.created_at}} + + + + + 加载中... + + + 没有更多了~ + + + + + + ~暂无数据哦~ + + \ No newline at end of file diff --git a/pages/stock/detailed/index.wxss b/pages/stock/detailed/index.wxss new file mode 100644 index 0000000..788ea3c --- /dev/null +++ b/pages/stock/detailed/index.wxss @@ -0,0 +1,107 @@ +/* 头部 */ +.top { + position: relative; + height: 200rpx; +} + +.top-img { + position: absolute; + width: 100%; + height: 100%; + left: 0; + top: 0; +} + +.top-back { + position: absolute; + padding: 45rpx 30rpx 0 90rpx; + box-sizing: border-box; + width: 100%; + height: 100%; + left: 0; + top: 0; + color: #FFFFFF; + display: flex; +} + +.top-item { + flex: 2; +} + +.item-name { + font-size: 28rpx; + margin-bottom: 10rpx; + opacity: .8; +} + +.item-number { + font-size:54rpx; +} + +.item-number text { + font-size: 26rpx; + padding-left: 10rpx; +} + +/* 列表 */ +.list { + padding: 30rpx; + box-sizing: border-box; +} + +.list-name { + color: #13234a; + font-weight: 600; + margin-bottom: 40rpx; + font-size: 36rpx; +} + +.item { + margin-bottom: 30rpx; + padding-bottom: 30rpx; + border-bottom: 2rpx solid #f3f3f3; +} + +.title { + display: flex; + margin-bottom: 20rpx; +} + +.name { + flex: 1; + font-weight: 600; + font-size: 30rpx; + display: flex; + line-height: 28rpx; +} + +.name image { + width: 28rpx; + height: 28rpx; + margin-right: 20rpx; +} + +.number { + font-weight: 600; + color: #175ad6; + line-height: 28rpx; +} +.reduce { + color: #ef5555; +} + +.time { + color: #676767; + font-size: 28rpx; +} + +.pages-no { + text-align: center; + padding: 120rpx 0 30rpx; + color: #9d9d9d; + font-size: 28rpx; +} + +.pages-no image { + width: 180rpx; +} \ No newline at end of file diff --git a/pages/stock/examine/index.js b/pages/stock/examine/index.js new file mode 100644 index 0000000..6130cdc --- /dev/null +++ b/pages/stock/examine/index.js @@ -0,0 +1,66 @@ +// pages/stock/examine/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/stock/examine/index.json b/pages/stock/examine/index.json new file mode 100644 index 0000000..d5796cd --- /dev/null +++ b/pages/stock/examine/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "等待审核" +} \ No newline at end of file diff --git a/pages/stock/examine/index.wxml b/pages/stock/examine/index.wxml new file mode 100644 index 0000000..4e19979 --- /dev/null +++ b/pages/stock/examine/index.wxml @@ -0,0 +1,9 @@ + + + + 审核中 + 预计审核时间:1个工作日 + 审核结果会微信消息提醒,请您耐心等待 + + 返回 + \ No newline at end of file diff --git a/pages/stock/examine/index.wxss b/pages/stock/examine/index.wxss new file mode 100644 index 0000000..8506aba --- /dev/null +++ b/pages/stock/examine/index.wxss @@ -0,0 +1,33 @@ +.examine { + padding: 240rpx 0 30rpx; + box-sizing: border-box; + text-align: center; +} + +.examine image { + width: 35%; + margin: 0 auto 30rpx; +} + +.title { + font-weight: 600; + font-size: 42rpx; + margin-bottom: 30rpx; +} + +.time { + color: #999999; + line-height: 50rpx; +} + +.return { + display: inline-block; + margin-top: 80rpx; + background-color: #1d37e2; + padding: 0 180rpx; + height: 90rpx; + line-height: 90rpx; + border-radius: 10rpx; + box-shadow: 0 3rpx 6rpx 4rpx rgba(6, 34, 214, .6); + color: #FFFFFF; +} \ No newline at end of file diff --git a/pages/stock/index.js b/pages/stock/index.js new file mode 100644 index 0000000..9304ccf --- /dev/null +++ b/pages/stock/index.js @@ -0,0 +1,109 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + stockData: '', //数据 + address : '', //地址 + listArr : [], //提货列表数据 + avatar : '', //头像 + identity : '', //身份 + page : {}, //下一页 + lodingStats : false,//加载状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取用户信息 + this.userInfo(); + + // 获取提货前置 + this.pickInfo(); + + // 获取提货列表 + this.pickList(); + }, + + /** + * 用户信息 + */ + userInfo() { + wx.$api.user.home().then(res => { + this.setData({ + avatar : res.data.avatar, + identity : res.data.identity + }) + }).catch(err => {}) + }, + + /** + * 提货前置 + */ + pickInfo (){ + wx.$api.stock.pick().then(res => { + this.setData({ + stockData : res.data.stockData, + address : res.data.address + }) + }).catch(err => {}) + }, + + /** + * 提货列表 + */ + pickList (page){ + wx.$api.stock.list({ + page: page + }).then(res => { + let listArr = this.data.listArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.data) + this.setData({ + listArr : newData, + page : res.data.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + + }).catch(err => {}) + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取提货列表 + this.pickList(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取提货列表 + this.pickList(pageNumber); + } + } +}) \ No newline at end of file diff --git a/pages/stock/index.json b/pages/stock/index.json new file mode 100644 index 0000000..539ef6d --- /dev/null +++ b/pages/stock/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "库存量" +} \ No newline at end of file diff --git a/pages/stock/index.wxml b/pages/stock/index.wxml new file mode 100644 index 0000000..3a2eb5c --- /dev/null +++ b/pages/stock/index.wxml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + 库存总数量(单位:箱) + + + {{stockData.residue}} + + + + + + + + {{stockData.hold}} + 已提数量 + + + + {{stockData.residue}} + 待提数量 + + + + 申请提货 + + + + 地址管理 + + + + + + + + + + 提货记录 + + + 查看全部 + + + + + + + + 提货量 + + + {{item.items[0].qty}}(箱) + + + + 申请时间 + {{item.created_at}} + + + 申请状态 + {{item.state}} + {{item.state}} + {{item.state}} + + + + + 加载中... + + + 没有更多了~ + + + + + + + ~抱歉,暂无内容~ + + \ No newline at end of file diff --git a/pages/stock/index.wxss b/pages/stock/index.wxss new file mode 100644 index 0000000..8df4325 --- /dev/null +++ b/pages/stock/index.wxss @@ -0,0 +1,261 @@ +/* 用户 */ +.user { + text-align: right; + box-sizing: border-box; + position: relative; + height: 150rpx; +} + +.user-order { + position: absolute; + left: 55rpx; + top: 30rpx; + background-color: #e9eaef; + width: 80rpx; + height: 80rpx; + text-align: center; + border-radius: 50%; + padding: 16rpx; + box-sizing: border-box; +} + +.user-order image { + width: 100%; + height: 100%; +} + +.user-head { + width: 80rpx; + height: 80rpx; + border-radius: 50%; + position: absolute; + right: 30rpx; + top: 30rpx; + border: 2rpx solid #efefef; +} + +.user-member { + position: absolute; + right: 80rpx; + top: 84rpx; + width: 30rpx; + height: 30rpx; + line-height: 26rpx; + text-align: center; + background-color: #1835c1; + border-radius: 50%; +} + +.user-member image { + width: 16rpx; + height: 16rpx; +} + +.stock-top { + padding: 0 30rpx 30rpx 60rpx; + box-sizing: border-box; +} + +.top-title { + color: #82828e; + margin-bottom: 20rpx; + display: flex; + line-height: 34rpx; + font-size: 32rpx; +} + +.top-title text { + flex: 1; +} + +.top-number { + font-size: 72rpx; + color: #333657; +} + +.top-number image { + width: 32rpx; + height: 32rpx; + margin-right: 10rpx; +} + +.stock-label { + padding-left: 60rpx; + box-sizing: border-box; + background: #ecf4f6; + padding-top: 40rpx; + height: 430rpx; +} + +.stock-cont { + background-color: #1d37e2; + border-radius: 60rpx 0 0 60rpx; + padding: 60rpx 30rpx 90rpx 90rpx; + box-sizing: border-box; + display: flex; + position: relative; +} + +.stock-item { + color: #FFFFFF; + flex: 2; +} + +.stock-icon { + width: 34rpx; + height: 34rpx; +} + +.stock-number { + font-size: 50rpx; + margin-bottom: 10rpx; + +} + +.stock-numbe text { + font-size: 28rpx; + padding-left: 10rpx; +} + +.stock-tips { + font-size: 28rpx; + color: #8999ff; +} + +.stock-btn { + position: absolute; + bottom: -40rpx; + right: 0; + display: flex; +} + +.btn { + background-color: #FFFFFF; + height: 80rpx; + line-height: 80rpx; + margin-right: 30rpx; + padding: 0 40rpx; + border-radius: 30rpx; +} + +.btn:first-child { + color: #FFFFFF; + background-color: #4d70fe; + box-shadow: 0 3rpx 6rpx 2rpx rgba(79, 99, 226, .6); +} + +.btn:last-child { + color: #8a5400; + background-color: #f9d093; + box-shadow: 0 3rpx 6rpx 2rpx rgba(255, 192, 92, .6); +} + +.btn text { + padding-right: 10rpx; +} + +.btn image { + width: 24rpx; + height: 24rpx; +} + +.record { + padding: 30rpx; + box-sizing: border-box; +} + +.title { + display: flex; +} + +.name { + flex: 1; + font-weight: 600; + display: flex; +} + +.name image { + width: 42rpx; + height: 42rpx; + margin-right: 10rpx; +} + +.more { + font-size: 30rpx; + color: #9d9d9d; + line-height: 42rpx; +} + +.more image { + width: 24rpx; + height: 24rpx; +} + +.list { + margin-top: 30rpx; +} + +.item { + border: 2rpx solid #f3f3f3; + padding: 30rpx 30rpx 20rpx; + box-sizing: border-box; + border-radius: 30rpx; + margin-bottom: 30rpx; +} + +.item-top { + display: flex; + margin-bottom: 20rpx; +} + +.item-name { + flex: 1; + font-weight: 600; +} + +.item-number { + color: #2487ff; + font-weight: 600; +} + +.item-number text { + font-size: 26rpx; + padding-left: 10rpx; + font-weight: normal; +} + +.item-label { + line-height: 60rpx; + display: flex; + font-size: 28rpx; + color: #9d9d9d; +} + +.item-left { + flex: 1; +} + +.item-state { + color: #eb504c; +} + +.item-state.green { + color: #03af03; +} + +.item-state.yellow { + color: #8a5400; +} + +/* 暂无内容 */ +.recommend-hint { + text-align: center; + color: #999; + padding: 100rpx 0; + font-size: 28rpx; +} + +.recommend-hint image { + width: 160rpx; + height: 160rpx; +} \ No newline at end of file diff --git a/pages/stock/list/index.js b/pages/stock/list/index.js new file mode 100644 index 0000000..b84e823 --- /dev/null +++ b/pages/stock/list/index.js @@ -0,0 +1,73 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + listArr : [], //提货列表数据 + page : {}, //下一页 + lodingStats : false,//加载状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取提货列表 + this.pickList(); + }, + + /** + * 提货列表 + */ + pickList (page){ + wx.$api.stock.list({ + page: page + }).then(res => { + let listArr = this.data.listArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.data) + this.setData({ + listArr : newData, + page : res.data.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + + }).catch(err => { }) + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取提货列表 + this.pickList(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取提货列表 + this.pickList(pageNumber); + } + } +}) \ No newline at end of file diff --git a/pages/stock/list/index.json b/pages/stock/list/index.json new file mode 100644 index 0000000..783d4c8 --- /dev/null +++ b/pages/stock/list/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "提货记录" +} \ No newline at end of file diff --git a/pages/stock/list/index.wxml b/pages/stock/list/index.wxml new file mode 100644 index 0000000..012e6ad --- /dev/null +++ b/pages/stock/list/index.wxml @@ -0,0 +1,35 @@ + + + + + 提货量 + + + {{item.items[0].qty}}(箱) + + + + 申请时间 + {{item.created_at}} + + + 申请状态 + {{item.state}} + {{item.state}} + {{item.state}} + + + + + 加载中... + + + 没有更多了~ + + + + + + + ~抱歉,暂无内容~ + \ No newline at end of file diff --git a/pages/stock/list/index.wxss b/pages/stock/list/index.wxss new file mode 100644 index 0000000..735c499 --- /dev/null +++ b/pages/stock/list/index.wxss @@ -0,0 +1,69 @@ + +.list { + margin-top: 30rpx; +} + +.item { + border: 2rpx solid #f3f3f3; + padding: 30rpx 30rpx 20rpx; + box-sizing: border-box; + border-radius: 30rpx; + margin-bottom: 30rpx; +} + +.item-top { + display: flex; + margin-bottom: 20rpx; +} + +.item-name { + flex: 1; + font-weight: 600; +} + +.item-number { + color: #2487ff; + font-weight: 600; +} + +.item-number text { + font-size: 26rpx; + padding-left: 10rpx; + font-weight: normal; +} + +.item-label { + line-height: 60rpx; + display: flex; + font-size: 28rpx; + color: #9d9d9d; +} + +.item-left { + flex: 1; +} + +.item-state { + color: #eb504c; +} + +.item-state.green { + color: #03af03; +} + +.item-state.yellow { + color: #8a5400; +} + +/* 暂无内容 */ +.recommend-hint { + text-align: center; + color: #999; + padding: 100rpx 0; + font-size: 28rpx; +} + +.recommend-hint image { + width: 160rpx; + height: 160rpx; +} \ No newline at end of file diff --git a/pages/stock/site/index.js b/pages/stock/site/index.js new file mode 100644 index 0000000..50e259b --- /dev/null +++ b/pages/stock/site/index.js @@ -0,0 +1,80 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + type : '', //类型 + listArr : [] //收货地址 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + type: options.type + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取地址列表 + this.listInfo(); + }, + + /** + * 地址列表 + */ + listInfo (){ + wx.$api.stock.siteList().then(res => { + this.setData({ + listArr: res.data + }) + }).catch(err => { }) + }, + + /** + * 删除地址 + */ + addressRemove(e){ + let newid = e.currentTarget.dataset.id + wx.showModal({ + title : '提示', + content : '是否删除地址', + success : res=> { + if (res.confirm) { + wx.showLoading({ + title: '删除中', + }) + wx.$api.stock.siteDel(newid).then(res=>{ + // 获取地址列表 + this.listInfo(); + wx.hideLoading() + }) + } + } + }) + }, + + /** + * 选择地址 + */ + selectAddress(e){ + let atAdds = this.data.listArr[e.currentTarget.dataset.index] + let pages = getCurrentPages(), + prepage = pages[pages.length-2] + prepage.setData({ + address: atAdds, + addressId: atAdds.address_id + }) + wx.navigateBack() + } +}) \ No newline at end of file diff --git a/pages/stock/site/index.json b/pages/stock/site/index.json new file mode 100644 index 0000000..f30802c --- /dev/null +++ b/pages/stock/site/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "地址管理" +} \ No newline at end of file diff --git a/pages/stock/site/index.wxml b/pages/stock/site/index.wxml new file mode 100644 index 0000000..c18c42d --- /dev/null +++ b/pages/stock/site/index.wxml @@ -0,0 +1,27 @@ + + + + 默认{{item.name}}{{item.mobile}} + + + {{item.full_address}} + + + + 删除 + + + + + 选择地址 + + + + + + + 暂无地址 + + + 添加地址 + \ No newline at end of file diff --git a/pages/stock/site/index.wxss b/pages/stock/site/index.wxss new file mode 100644 index 0000000..863377c --- /dev/null +++ b/pages/stock/site/index.wxss @@ -0,0 +1,123 @@ +page{ + background-color: #f4f4f4; +} + +.list { + border-bottom: 60px solid transparent; + padding: 30rpx; + box-sizing: border-box; +} + +.address { + background-color: #FFFFFF; + margin-bottom: 30rpx; + padding: 30rpx; + box-sizing: border-box; + border-radius: 30rpx; +} + +.address:last-child { + margin-bottom: 0; +} + +.address-name { + display: flex; + font-weight: 600; +} + +.address-name text { + font-weight: normal; + font-size: 34rpx; + flex: 1; + display: block; +} + +.defaultEdit { + font-size: 26rpx; + height: 36rpx; + line-height: 36rpx; + border: 2rpx solid #eb504c; + color: #eb504c; + padding: 0 10rpx; + margin-right: 20rpx; + margin-top: 4rpx; + border-radius: 10rpx; +} + +.address-info { + margin: 20rpx 0; + font-size: 30rpx; + color: #9d9d9d; +} + +.address-tool { + border-top: 2rpx solid #f3f3f3; + padding-top: 20rpx; + font-size: 28rpx; + text-align: right; +} + +.address-tool-btn { + display: inline-block; + color: #666666; + margin-left: 60rpx; +} + +.address-tool-btn image { + width: 28rpx; + height: 28rpx; + vertical-align: -2rpx; + margin-right: 10rpx; +} + +.select { + text-align: center; + border: 2rpx solid #e64248; + color: #e64248; + font-size: 28rpx; + margin-top: 30rpx; + line-height: 72rpx; + font-weight: 600; + border-radius: 10rpx; +} + +.footer { + width: 100%; + height: 60px; + background-color: #FFFFFF; + position: fixed; + left: 0; + bottom: 0; + z-index: 9; + padding: 8px; + box-sizing: border-box; +} + +.btn { + line-height: 44px; + background-color: #1d37e2; + height: 100%; + text-align: center; + color: #FFFFFF; + border-radius: 10rpx; +} + +/* 无列表 */ +.edit-no { + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-box-pack: center; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + z-index: 1; + text-align: center; + color: #9d9d9d; +} + +.edit-no image { + width: 240rpx; + height: 240rpx; +} \ No newline at end of file diff --git a/pages/stock/take/index.js b/pages/stock/take/index.js new file mode 100644 index 0000000..0acd2d9 --- /dev/null +++ b/pages/stock/take/index.js @@ -0,0 +1,133 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + num : 1, //数量默认1 + address : '', //地址 + stockData : '', //数据 + disabled : false + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + // 获取提货前置 + this.pickInfo(); + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() {}, + + /** + * 提货前置 + */ + pickInfo (){ + wx.$api.stock.pick().then(res => { + this.setData({ + address : res.data.address, + stockData : res.data.stockData, + isExperience : res.data.dientity.is_experience + }) + }).catch(err => {}) + }, + + /** + * 商品数量加减 + */ + goodsNumber(e){ + let num = this.data.num, + val = e.currentTarget.dataset.type + if (val == 'plus'){ + num ++; + if(num > this.data.stockData.stock ){ + wx.showToast({ + title: '商品数量不能大于库存量', + icon: 'none' + }); + num = this.data.stockData.stock + } + + }else{ + if (num > 1){ + num --; + }else{ + wx.showToast({ + title : '商品数量不能小于1', + icon : 'none' + }) + } + this.setData({ + num: num + }) + } + this.setData({ + num: num + }) + }, + + /** + * 输入商品数量 + */ + goodsNumberInput(e) { + let goodsNum = e.detail.value; + if (goodsNum > 0) { + if(goodsNum > this.data.stockData.stock ){ + wx.showToast({ + title: '商品数量不能大于库存量', + icon: 'none' + }); + this.setData({ + num: this.data.stockData.stock + }) + return + } + this.setData({ + num: goodsNum + }) + } else { + wx.showToast({ + title: '商品数量不能小于1', + icon: 'none' + }); + this.setData({ + num: 1 + }) + } + }, + + /** + * 申请提货 + */ + stockForm(e) { + let newQty = this.data.num + if(this.data.isExperience) { + newQty = this.data.stockData.stock + } + let data = { + remark : e.detail.value.remark, + qty : newQty, + address_id : this.data.address.address_id + } + + wx.$api.stock.pickTake(data).then(res => { + this.setData({ + disabled: true + }) + + // 跳到审核页面 + wx.redirectTo({ + url: '../examine/index' + }) + }).catch(err => {}) + } +}) \ No newline at end of file diff --git a/pages/stock/take/index.json b/pages/stock/take/index.json new file mode 100644 index 0000000..28c8a62 --- /dev/null +++ b/pages/stock/take/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "申请提货" +} \ No newline at end of file diff --git a/pages/stock/take/index.wxml b/pages/stock/take/index.wxml new file mode 100644 index 0000000..1033829 --- /dev/null +++ b/pages/stock/take/index.wxml @@ -0,0 +1,69 @@ +
+ + + + + 温馨提示 + + 收货地址只限制广东省深圳市地区 + + + + + + + 提货数量 + + + {{stockData.stock}} + + + + + 提货数量 + + + - + + + + + + + + 备注信息 + +