From f0302de899b504ff110c11db591a23612b5d6c75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=85=A2=E6=85=A2?= <994797151@qq.com> Date: Fri, 21 May 2021 15:02:18 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9C=AC=E6=97=B6=E7=94=9F=E6=B4=BB=E5=B0=8F?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F-=E7=BA=BF=E4=B8=8A=E5=A4=87=E4=BB=BD]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 14 + .vscode/settings.json | 3 + api/err.js | 54 +++ api/index.js | 29 ++ api/interfaces/address.js | 39 ++ api/interfaces/enroll.js | 18 + api/interfaces/exchange.js | 21 + api/interfaces/index.js | 93 ++++ api/interfaces/user.js | 70 +++ api/request.js | 65 +++ api/updateToken.js | 17 + app.js | 70 +++ app.json | 62 +++ app.wxss | 96 ++++ pages/account/account.js | 83 ++++ pages/account/account.json | 6 + pages/account/account.wxml | 57 +++ pages/account/account.wxss | 155 +++++++ pages/activate/activate.js | 70 +++ pages/activate/activate.json | 4 + pages/activate/activate.wxml | 29 ++ pages/activate/activate.wxss | 129 ++++++ pages/activity/activity.js | 53 +++ pages/activity/activity.json | 4 + pages/activity/activity.wxml | 7 + pages/activity/activity.wxss | 36 ++ pages/activityData/activityData.js | 138 ++++++ pages/activityData/activityData.json | 6 + pages/activityData/activityData.wxml | 115 +++++ pages/activityData/activityData.wxss | 427 +++++++++++++++++ pages/activityInfo/activityInfo.js | 183 ++++++++ pages/activityInfo/activityInfo.json | 4 + pages/activityInfo/activityInfo.wxml | 134 ++++++ pages/activityInfo/activityInfo.wxss | 575 +++++++++++++++++++++++ pages/activityOrder/activityOrder.js | 146 ++++++ pages/activityOrder/activityOrder.json | 5 + pages/activityOrder/activityOrder.wxml | 66 +++ pages/activityOrder/activityOrder.wxss | 228 ++++++++++ pages/address/address.js | 102 +++++ pages/address/address.json | 4 + pages/address/address.wxml | 40 ++ pages/address/address.wxss | 112 +++++ pages/address_form/address_form.js | 240 ++++++++++ pages/address_form/address_form.json | 3 + pages/address_form/address_form.wxml | 71 +++ pages/address_form/address_form.wxss | 148 ++++++ pages/chooseTel/chooseTel.js | 151 ++++++ pages/chooseTel/chooseTel.json | 4 + pages/chooseTel/chooseTel.wxml | 26 ++ pages/chooseTel/chooseTel.wxss | 75 +++ pages/classify/classify.js | 84 ++++ pages/classify/classify.json | 6 + pages/classify/classify.wxml | 70 +++ pages/classify/classify.wxss | 319 +++++++++++++ pages/coupon/coupon.js | 96 ++++ pages/coupon/coupon.json | 4 + pages/coupon/coupon.wxml | 71 +++ pages/coupon/coupon.wxss | 247 ++++++++++ pages/couponArr/couponArr.js | 78 ++++ pages/couponArr/couponArr.json | 4 + pages/couponArr/couponArr.wxml | 65 +++ pages/couponArr/couponArr.wxss | 173 +++++++ pages/couponDetails/couponDetails.js | 170 +++++++ pages/couponDetails/couponDetails.json | 4 + pages/couponDetails/couponDetails.wxml | 97 ++++ pages/couponDetails/couponDetails.wxss | 215 +++++++++ pages/frozen/frozen.js | 40 ++ pages/frozen/frozen.json | 4 + pages/frozen/frozen.wxml | 28 ++ pages/frozen/frozen.wxss | 101 +++++ pages/index/index.js | 240 ++++++++++ pages/index/index.json | 10 + pages/index/index.skeleton.wxml | 95 ++++ pages/index/index.skeleton.wxss | 94 ++++ pages/index/index.wxml | 142 ++++++ pages/index/index.wxss | 544 ++++++++++++++++++++++ pages/login/login.js | 124 +++++ pages/login/login.json | 6 + pages/login/login.wxml | 5 + pages/login/login.wxss | 36 ++ pages/order/order.js | 149 ++++++ pages/order/order.json | 4 + pages/order/order.wxml | 70 +++ pages/order/order.wxss | 241 ++++++++++ pages/orderData/orderData.js | 134 ++++++ pages/orderData/orderData.json | 3 + pages/orderData/orderData.wxml | 63 +++ pages/orderData/orderData.wxss | 241 ++++++++++ pages/packet/packet.js | 140 ++++++ pages/packet/packet.json | 4 + pages/packet/packet.wxml | 44 ++ pages/packet/packet.wxss | 223 +++++++++ pages/rights/rights.js | 327 +++++++++++++ pages/rights/rights.json | 6 + pages/rights/rights.wxml | 204 +++++++++ pages/rights/rights.wxss | 606 +++++++++++++++++++++++++ pages/store/store.js | 213 +++++++++ pages/store/store.json | 4 + pages/store/store.wxml | 64 +++ pages/store/store.wxss | 136 ++++++ pages/storeDetails/storeDetails.js | 62 +++ pages/storeDetails/storeDetails.json | 4 + pages/storeDetails/storeDetails.wxml | 37 ++ pages/storeDetails/storeDetails.wxss | 102 +++++ pages/switchcity/switchcity.js | 180 ++++++++ pages/switchcity/switchcity.json | 4 + pages/switchcity/switchcity.wxml | 66 +++ pages/switchcity/switchcity.wxss | 399 ++++++++++++++++ pages/user/user.js | 174 +++++++ pages/user/user.json | 4 + pages/user/user.wxml | 171 +++++++ pages/user/user.wxss | 228 ++++++++++ pages/webView/webView.js | 68 +++ pages/webView/webView.json | 3 + pages/webView/webView.wxml | 1 + pages/webView/webView.wxss | 1 + pages/welfare/welfare.js | 127 ++++++ pages/welfare/welfare.json | 5 + pages/welfare/welfare.wxml | 88 ++++ pages/welfare/welfare.wxss | 567 +++++++++++++++++++++++ project.config.json | 135 ++++++ project.private.config.json | 96 ++++ sitemap.json | 7 + static/icon/Check.png | Bin 0 -> 352 bytes static/icon/Point_icon.png | Bin 0 -> 644 bytes static/icon/activity_icon.png | Bin 0 -> 403 bytes static/icon/add.png | Bin 0 -> 198 bytes static/icon/address_icon.png | Bin 0 -> 873 bytes static/icon/arrow_down.png | Bin 0 -> 279 bytes static/icon/arrow_left.png | Bin 0 -> 380 bytes static/icon/arrow_right.png | Bin 0 -> 408 bytes static/icon/arrow_right_black.png | Bin 0 -> 405 bytes static/icon/arrow_tips.png | Bin 0 -> 711 bytes static/icon/choice.png | Bin 0 -> 232 bytes static/icon/indexSite.png | Bin 0 -> 734 bytes static/icon/integra_icon00.png | Bin 0 -> 508 bytes static/icon/integra_icon01.png | Bin 0 -> 439 bytes static/icon/location.png | Bin 0 -> 569 bytes static/icon/news_icon.png | Bin 0 -> 622 bytes static/icon/notice_icon.png | Bin 0 -> 428 bytes static/icon/order_icon_00.png | Bin 0 -> 702 bytes static/icon/order_icon_01.png | Bin 0 -> 714 bytes static/icon/order_icon_02.png | Bin 0 -> 1033 bytes static/icon/refresh_loding.gif | Bin 0 -> 1787 bytes static/icon/rightsArrow.png | Bin 0 -> 217 bytes static/icon/secrch_icon.png | Bin 0 -> 1009 bytes static/icon/select.png | Bin 0 -> 781 bytes static/icon/select_avtive.png | Bin 0 -> 404 bytes static/icon/site_icon.png | Bin 0 -> 708 bytes static/icon/storeArrow.png | Bin 0 -> 252 bytes static/icon/switch.png | Bin 0 -> 312 bytes static/icon/tel.png | Bin 0 -> 820 bytes static/icon/time_icon.png | Bin 0 -> 612 bytes static/img/activate-back.jpg | Bin 0 -> 38035 bytes static/img/activity_coupon.png | Bin 0 -> 7105 bytes static/img/address_back.png | Bin 0 -> 314 bytes static/img/arrow.png | Bin 0 -> 201 bytes static/img/card_img.png | Bin 0 -> 19780 bytes static/img/card_top.png | Bin 0 -> 1553 bytes static/img/class_back_01.png | Bin 0 -> 7461 bytes static/img/coupon_icon_00.png | Bin 0 -> 6999 bytes static/img/coupon_icon_01.png | Bin 0 -> 6890 bytes static/img/coupon_img.png | Bin 0 -> 2358 bytes static/img/coupon_tips.png | Bin 0 -> 9269 bytes static/img/coupon_tips_00.png | Bin 0 -> 4942 bytes static/img/coupon_tips_01.png | Bin 0 -> 4897 bytes static/img/default_cover.png | Bin 0 -> 922 bytes static/img/frozen_time.png | Bin 0 -> 993 bytes static/img/gift_box.png | Bin 0 -> 287 bytes static/img/grant_icon.png | Bin 0 -> 1201 bytes static/img/legal_tips.png | Bin 0 -> 29502 bytes static/img/location_img.jpg | Bin 0 -> 3230 bytes static/img/login_img.png | Bin 0 -> 202990 bytes static/img/null_icon.png | Bin 0 -> 2023 bytes static/img/packet.png | Bin 0 -> 111112 bytes static/img/packetText_icon.png | Bin 0 -> 444 bytes static/img/packetText_top.png | Bin 0 -> 65967 bytes static/img/packet_arr.png | Bin 0 -> 1460 bytes static/img/packet_title.png | Bin 0 -> 15429 bytes static/img/pointMore-up.png | Bin 0 -> 1692 bytes static/img/pointMore.png | Bin 0 -> 1721 bytes static/img/receive.png | Bin 0 -> 66699 bytes static/img/refresh_loding.gif | Bin 0 -> 1787 bytes static/img/rights_back_02.png | Bin 0 -> 1486 bytes static/img/rights_top.png | Bin 0 -> 350197 bytes static/img/staff_null.png | Bin 0 -> 1824 bytes static/img/tel_img.png | Bin 0 -> 12680 bytes static/img/userCoupon.png | Bin 0 -> 500 bytes static/img/userOrder_00.png | Bin 0 -> 405 bytes static/img/userOrder_01.png | Bin 0 -> 1094 bytes static/img/userOrder_02.png | Bin 0 -> 889 bytes static/img/userOrder_03.png | Bin 0 -> 439 bytes static/img/userOrder_04.png | Bin 0 -> 15822 bytes static/img/userOrder_05.png | Bin 0 -> 16216 bytes static/img/userOrder_06.png | Bin 0 -> 1528 bytes static/img/userSite.png | Bin 0 -> 443 bytes static/img/user_card_00.png | Bin 0 -> 23889 bytes static/img/user_card_01.png | Bin 0 -> 23642 bytes static/img/user_card_02.png | Bin 0 -> 98964 bytes static/img/welfare_back.png | Bin 0 -> 30332 bytes static/tabBarIcon/00.png | Bin 0 -> 533 bytes static/tabBarIcon/00_active.png | Bin 0 -> 744 bytes static/tabBarIcon/01.png | Bin 0 -> 572 bytes static/tabBarIcon/01_active.png | Bin 0 -> 501 bytes utils/qqmap-wx-jssdk.min.js | 1 + utils/util.js | 19 + 206 files changed, 12884 insertions(+) create mode 100644 .gitignore create mode 100644 .vscode/settings.json create mode 100644 api/err.js create mode 100644 api/index.js create mode 100644 api/interfaces/address.js create mode 100644 api/interfaces/enroll.js create mode 100644 api/interfaces/exchange.js create mode 100644 api/interfaces/index.js create mode 100644 api/interfaces/user.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 pages/account/account.js create mode 100644 pages/account/account.json create mode 100644 pages/account/account.wxml create mode 100644 pages/account/account.wxss create mode 100644 pages/activate/activate.js create mode 100644 pages/activate/activate.json create mode 100644 pages/activate/activate.wxml create mode 100644 pages/activate/activate.wxss create mode 100644 pages/activity/activity.js create mode 100644 pages/activity/activity.json create mode 100644 pages/activity/activity.wxml create mode 100644 pages/activity/activity.wxss create mode 100644 pages/activityData/activityData.js create mode 100644 pages/activityData/activityData.json create mode 100644 pages/activityData/activityData.wxml create mode 100644 pages/activityData/activityData.wxss create mode 100644 pages/activityInfo/activityInfo.js create mode 100644 pages/activityInfo/activityInfo.json create mode 100644 pages/activityInfo/activityInfo.wxml create mode 100644 pages/activityInfo/activityInfo.wxss create mode 100644 pages/activityOrder/activityOrder.js create mode 100644 pages/activityOrder/activityOrder.json create mode 100644 pages/activityOrder/activityOrder.wxml create mode 100644 pages/activityOrder/activityOrder.wxss create mode 100644 pages/address/address.js create mode 100644 pages/address/address.json create mode 100644 pages/address/address.wxml create mode 100644 pages/address/address.wxss create mode 100644 pages/address_form/address_form.js create mode 100644 pages/address_form/address_form.json create mode 100644 pages/address_form/address_form.wxml create mode 100644 pages/address_form/address_form.wxss create mode 100644 pages/chooseTel/chooseTel.js create mode 100644 pages/chooseTel/chooseTel.json create mode 100644 pages/chooseTel/chooseTel.wxml create mode 100644 pages/chooseTel/chooseTel.wxss create mode 100644 pages/classify/classify.js create mode 100644 pages/classify/classify.json create mode 100644 pages/classify/classify.wxml create mode 100644 pages/classify/classify.wxss create mode 100644 pages/coupon/coupon.js create mode 100644 pages/coupon/coupon.json create mode 100644 pages/coupon/coupon.wxml create mode 100644 pages/coupon/coupon.wxss create mode 100644 pages/couponArr/couponArr.js create mode 100644 pages/couponArr/couponArr.json create mode 100644 pages/couponArr/couponArr.wxml create mode 100644 pages/couponArr/couponArr.wxss create mode 100644 pages/couponDetails/couponDetails.js create mode 100644 pages/couponDetails/couponDetails.json create mode 100644 pages/couponDetails/couponDetails.wxml create mode 100644 pages/couponDetails/couponDetails.wxss create mode 100644 pages/frozen/frozen.js create mode 100644 pages/frozen/frozen.json create mode 100644 pages/frozen/frozen.wxml create mode 100644 pages/frozen/frozen.wxss create mode 100644 pages/index/index.js create mode 100644 pages/index/index.json create mode 100644 pages/index/index.skeleton.wxml create mode 100644 pages/index/index.skeleton.wxss create mode 100644 pages/index/index.wxml create mode 100644 pages/index/index.wxss create mode 100644 pages/login/login.js create mode 100644 pages/login/login.json create mode 100644 pages/login/login.wxml create mode 100644 pages/login/login.wxss create mode 100644 pages/order/order.js create mode 100644 pages/order/order.json create mode 100644 pages/order/order.wxml create mode 100644 pages/order/order.wxss create mode 100644 pages/orderData/orderData.js create mode 100644 pages/orderData/orderData.json create mode 100644 pages/orderData/orderData.wxml create mode 100644 pages/orderData/orderData.wxss create mode 100644 pages/packet/packet.js create mode 100644 pages/packet/packet.json create mode 100644 pages/packet/packet.wxml create mode 100644 pages/packet/packet.wxss create mode 100644 pages/rights/rights.js create mode 100644 pages/rights/rights.json create mode 100644 pages/rights/rights.wxml create mode 100644 pages/rights/rights.wxss create mode 100644 pages/store/store.js create mode 100644 pages/store/store.json create mode 100644 pages/store/store.wxml create mode 100644 pages/store/store.wxss create mode 100644 pages/storeDetails/storeDetails.js create mode 100644 pages/storeDetails/storeDetails.json create mode 100644 pages/storeDetails/storeDetails.wxml create mode 100644 pages/storeDetails/storeDetails.wxss create mode 100644 pages/switchcity/switchcity.js create mode 100644 pages/switchcity/switchcity.json create mode 100644 pages/switchcity/switchcity.wxml create mode 100644 pages/switchcity/switchcity.wxss create mode 100644 pages/user/user.js create mode 100644 pages/user/user.json create mode 100644 pages/user/user.wxml create mode 100644 pages/user/user.wxss create mode 100644 pages/webView/webView.js create mode 100644 pages/webView/webView.json create mode 100644 pages/webView/webView.wxml create mode 100644 pages/webView/webView.wxss create mode 100644 pages/welfare/welfare.js create mode 100644 pages/welfare/welfare.json create mode 100644 pages/welfare/welfare.wxml create mode 100644 pages/welfare/welfare.wxss create mode 100644 project.config.json create mode 100644 project.private.config.json create mode 100644 sitemap.json create mode 100644 static/icon/Check.png create mode 100644 static/icon/Point_icon.png create mode 100644 static/icon/activity_icon.png create mode 100644 static/icon/add.png create mode 100644 static/icon/address_icon.png create mode 100644 static/icon/arrow_down.png create mode 100644 static/icon/arrow_left.png create mode 100644 static/icon/arrow_right.png create mode 100644 static/icon/arrow_right_black.png create mode 100644 static/icon/arrow_tips.png create mode 100644 static/icon/choice.png create mode 100644 static/icon/indexSite.png create mode 100644 static/icon/integra_icon00.png create mode 100644 static/icon/integra_icon01.png create mode 100644 static/icon/location.png create mode 100644 static/icon/news_icon.png create mode 100644 static/icon/notice_icon.png create mode 100644 static/icon/order_icon_00.png create mode 100644 static/icon/order_icon_01.png create mode 100644 static/icon/order_icon_02.png create mode 100644 static/icon/refresh_loding.gif create mode 100644 static/icon/rightsArrow.png create mode 100644 static/icon/secrch_icon.png create mode 100644 static/icon/select.png create mode 100644 static/icon/select_avtive.png create mode 100644 static/icon/site_icon.png create mode 100644 static/icon/storeArrow.png create mode 100644 static/icon/switch.png create mode 100644 static/icon/tel.png create mode 100644 static/icon/time_icon.png create mode 100644 static/img/activate-back.jpg create mode 100644 static/img/activity_coupon.png create mode 100644 static/img/address_back.png create mode 100644 static/img/arrow.png create mode 100644 static/img/card_img.png create mode 100644 static/img/card_top.png create mode 100644 static/img/class_back_01.png create mode 100644 static/img/coupon_icon_00.png create mode 100644 static/img/coupon_icon_01.png create mode 100644 static/img/coupon_img.png create mode 100644 static/img/coupon_tips.png create mode 100644 static/img/coupon_tips_00.png create mode 100644 static/img/coupon_tips_01.png create mode 100644 static/img/default_cover.png create mode 100644 static/img/frozen_time.png create mode 100644 static/img/gift_box.png create mode 100644 static/img/grant_icon.png create mode 100644 static/img/legal_tips.png create mode 100644 static/img/location_img.jpg create mode 100644 static/img/login_img.png create mode 100644 static/img/null_icon.png create mode 100644 static/img/packet.png create mode 100644 static/img/packetText_icon.png create mode 100644 static/img/packetText_top.png create mode 100644 static/img/packet_arr.png create mode 100644 static/img/packet_title.png create mode 100644 static/img/pointMore-up.png create mode 100644 static/img/pointMore.png create mode 100644 static/img/receive.png create mode 100644 static/img/refresh_loding.gif create mode 100644 static/img/rights_back_02.png create mode 100644 static/img/rights_top.png create mode 100644 static/img/staff_null.png create mode 100644 static/img/tel_img.png create mode 100644 static/img/userCoupon.png create mode 100644 static/img/userOrder_00.png create mode 100644 static/img/userOrder_01.png create mode 100644 static/img/userOrder_02.png create mode 100644 static/img/userOrder_03.png create mode 100644 static/img/userOrder_04.png create mode 100644 static/img/userOrder_05.png create mode 100644 static/img/userOrder_06.png create mode 100644 static/img/userSite.png create mode 100644 static/img/user_card_00.png create mode 100644 static/img/user_card_01.png create mode 100644 static/img/user_card_02.png create mode 100644 static/img/welfare_back.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 utils/qqmap-wx-jssdk.min.js create mode 100644 utils/util.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..14ea590 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +# Windows +[Dd]esktop.ini +Thumbs.db +$RECYCLE.BIN/ + +# macOS +.DS_Store +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes + +# Node.js +node_modules/ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..3b66410 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "git.ignoreLimitWarning": true +} \ No newline at end of file diff --git a/api/err.js b/api/err.js new file mode 100644 index 0000000..cee8984 --- /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/index/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..094cfe5 --- /dev/null +++ b/api/index.js @@ -0,0 +1,29 @@ + +/* + * 亿时代 v1.0.0 (2020-07-02 09:25:32) + *https://card.ysd-bs.com/api/ + */ + +// 首页 +import index from "./interfaces/index" + +// 授权登录 +import enroll from "./interfaces/enroll" + +// 个人中心 +import user from "./interfaces/user" + +// 地址管理 +import address from "./interfaces/address" + +// 兑换订单 +import exchange from "./interfaces/exchange" + + +export default{ + index, + enroll, + user, + address, + exchange +} diff --git a/api/interfaces/address.js b/api/interfaces/address.js new file mode 100644 index 0000000..93a8e76 --- /dev/null +++ b/api/interfaces/address.js @@ -0,0 +1,39 @@ + +import {req} from "../request" + +//我的地址列表 +const index = () => req({url: "addresses"}) + +//获取省 +const create = () => req({url: "addresses/create"}) + +// 获取市级列表 +const children = (psn) => req({url: "areas/children", data: {psn: psn}}) + +// 获取已有地址信息 +const edit = (addressId) => req({url: "addresses/" + addressId + '/edit'}) + + +// 创建地址保存 +const add = (name, mobile, province_id, city_id, district_id, address, def) => req({url: "addresses/store", method: "POST", data: {name: name, mobile: mobile, province_id: province_id, city_id: city_id, district_id: district_id, address: address, def: def}}) + +// 编辑地址保存 +const keep = (addressId,name, mobile, province_id, city_id, district_id, address) => req({url: "addresses/" + addressId + '/update', method: "POST", data: {name: name, mobile: mobile, province_id: province_id, city_id: city_id, district_id: district_id, address: address}}) + +// 设为默认地址 +const setdef = (addressId) => req({url: "addresses/" + addressId + '/setdef', method: "POST"}) + +// 删除地址 +const remove = (addressId) => req({url: "addresses/" + addressId + '/destroy', method: "DELETE"}) + + +export default({ + index, + create, + children, + edit, + add, + keep, + setdef, + remove +}) diff --git a/api/interfaces/enroll.js b/api/interfaces/enroll.js new file mode 100644 index 0000000..0805d56 --- /dev/null +++ b/api/interfaces/enroll.js @@ -0,0 +1,18 @@ + +import {req} from "../request" + +//微信授权登录 +const record = (code, iv, encryptedData) => req({url: "auth/openwx", method: "POST", data: {code: code, iv: iv, encryptedData: encryptedData}}) + +//微信手机授权 +const bindmobile = (code, iv, mobile) => req({url: "auth/bindmobile", method: "POST", data: {code: code, iv: iv, mobile: mobile}}) + +//切换手机授权 +const tel = (wechatUser_id, username) => req({url: "auth/loginbymobile", method: "POST", data: {wechatUser_id: wechatUser_id,username: username}}) + + +export default({ + record, + bindmobile, + tel +}) diff --git a/api/interfaces/exchange.js b/api/interfaces/exchange.js new file mode 100644 index 0000000..e390db9 --- /dev/null +++ b/api/interfaces/exchange.js @@ -0,0 +1,21 @@ + +import {req} from "../request" + +//兑换订单列表 +const index = (type) => req({url: "orders/index", data: {type: type}}) + +//兑换订单详情 +const show = (orderid) => req({url: "orders/show?", data: {orderid: orderid}}) + +//取消兑换订单 +const cancel = (orderid) => req({url: "orders/cancel?orderid=" + orderid , method: "POST"}) + +//兑换订单支付 +const payments = (orderid) => req({url: "payments/order?orderid=" + orderid}) + +export default({ + index, + show, + cancel, + payments +}) diff --git a/api/interfaces/index.js b/api/interfaces/index.js new file mode 100644 index 0000000..1130c89 --- /dev/null +++ b/api/interfaces/index.js @@ -0,0 +1,93 @@ + +import {req} from "../request" + +//首页权益 +const index = (area_name, user_lng, user_lat) => req({url: "home", data: {area_name: area_name, user_lng: user_lng, user_lat:user_lat}}) + +//白金+钻石权益 +const choice = (type, area_name, user_lng, user_lat) => req({url: "home/group", data: {type: type,area_name: area_name, user_lng: user_lng, user_lat:user_lat}}) + +//权益分类 +const classify = (category_id) => req({url: "categories/" + category_id}) + +//周五福利详情 +const welfares = (welfare_id) => req({url: "welfare/" + welfare_id}) + +//市区选择 +const idxCity = (province_id) => req({url: "areas/citys?province_id=" + province_id || ''}) + +//活动商品列表 +const redwine = () => req({url: "redwine/index"}) + +//活动商品详情 +const redwinePay = (goodId) => req({url: "redwine/" + goodId + "/pay", method: "POST"}) + +//活动商品订单提交 +const payment = (good_id, param_id, address_id, islogistics) => req({url: "redwine/payment", method: "POST", data: {good_id: good_id, param_id: param_id, address_id: address_id, islogistics: islogistics}}) + +//活动商品订单 +const activityOrder = (type, page) => req({url: "activity/orders", data: {type: type, page: page}}) + +//活动商品取消订单 +const cance = (orderId) => req({url: "activity/orders/" + orderId + '/cancel', method: "POST"}) + +//活动商品支付订单 +const repay = (orderId) => req({url: "redwine/" + orderId + '/repay', method: "POST"}) + +//活动商品订单详情 +const ordersInfo = (orderId) => req({url: "activity/orders/" + orderId + '/info', method: "POST"}) + +// 权益详情 +const rightShow = (right_id, address_id, num, is_deliver) => req({url: "orders/create/", data: {right_id: right_id, address_id: address_id || '', num: num || '', is_deliver: is_deliver}}) + +// 权益购买提交 +const rightStore = (right_id, address_id, is_deliver, qty) => req({url: "orders/store/", method: "POST", data: {right_id: right_id, address_id: address_id || '', is_deliver: is_deliver, qty: qty || ''}}) + +// 权益购买信息 +const wechat = (trade_no) => req({url: "payments/wechat?",method: "POST", data: {trade_no: trade_no}}) + +//获取openid地址-web +const unionpay = (callback_url, callback_type, right_id) => req({url: "unionpay/openid", data: {callback_url: callback_url, callback_type: callback_type, right_id: right_id}}) + +//领取权益优惠券 +const receiveCode = (openid, event_no, right_id) => req({url: "unionpay/code", data: {openid: openid, event_no: event_no, right_id: right_id}}) + +//领取权益优惠券 +const unionCode = (openid) => req({url: "unionpay/union_openid", data: {openid: openid}, method: "POST"}) + +//所有城市-最新无字母 +const newCity = () => req({url: "ajax/all_right_citys"}) + +//市区选择-最新无字母 +const newidxCity = (code) => req({url: "ajax/all_right_children", data: {code: code}}) + +//周五福利-获取支付信息 +const fridayInfo = (orderId) => req({url: "welfare/order/" + orderId}) + +//周五福利-支付 +const fridayPay = (trade_no) => req({url: "payments/welfare/wechat",method: "POST", data: {trade_no: trade_no}}) + +export default({ + index, + choice, + classify, + welfares, + idxCity, + redwine, + redwinePay, + payment, + activityOrder, + cance, + repay, + ordersInfo, + rightShow, + rightStore, + wechat, + unionpay, + receiveCode, + unionCode, + newCity, + newidxCity, + fridayInfo, + fridayPay +}) diff --git a/api/interfaces/user.js b/api/interfaces/user.js new file mode 100644 index 0000000..f14b067 --- /dev/null +++ b/api/interfaces/user.js @@ -0,0 +1,70 @@ + +import {req} from "../request" + +//用户信息 +const index = () => req({url: "user"}) + +//切换用户登录 +const mobiles = () => req({url: "user/mobiles"}) + +//卡券 +const coupon = (status) => req({url: "coupons?status=" + status}) + +//卡券分组 +const couponArr = (activityId, status, page) => req({url: "coupons/list", data:{activityId : activityId, status : status, page : page}}) + +//卡券详情 +const couponinfo = (coupon_id, user_lng, user_lat) => req({url: "coupons/show", data:{coupon_id : coupon_id, user_lng : user_lng, user_lat : user_lat}}) + +//卡券二维码 +const qrcode = (coupon_id) => req({url: "coupons/qrcode", data:{coupon_id : coupon_id}}) + +//卡券二维码 +const barcode = (coupon_id) => req({url: "coupons/" + coupon_id + '/barcode'}) + +//门店列表 +const stores = (coupon_id, province_id, city_id, district_id, title, user_lng, user_lat, page) => req({url: "coupons/new_stores", method: "POST", data:{coupon_id : coupon_id, province_id : province_id || '', city_id : city_id || '', district_id : district_id || '', title : title || '', user_lng : user_lng, user_lat : user_lat, page : page}}) + +//门店详情 +const storesShow = (store_id, user_lng, user_lat) => req({url: "coupons/store/show", data:{store_id : store_id, user_lng : user_lng, user_lat : user_lat}}) + +//省市区 +const areas = (psn) => req({url: "areas/children?psn=" + psn}) + +// 加入微信卡包 +const jssdk = (coupon_id) => req({url: "coupons/jssdk?coupon_id=" + coupon_id}) + +// 积分卡激活 +const cards = (code, pass) => req({url: "user/cards/activate", method: "POST", data:{code : code, pass : pass}}) + +// 积分账变记录 +const logs = (type, page) => req({url: "account/logs", data:{type : type, page : page}}) + +// 冻结列表 +const ungrants = (type,) => req({url: "account/ungrants", data:{type : type}}) + +// 发送短信 +const send = (mobile, channel, type) => req({url: "sms/send", method: "POST", data:{mobile : mobile, channel : channel, type : type}}) + +// 领取红包 +const unicom = (mobile, channel, code) => req({url: "unicom/get", method: "POST", data:{mobile : mobile, channel : channel, code : code}}) + + +export default({ + index, + mobiles, + coupon, + couponArr, + couponinfo, + qrcode, + barcode, + stores, + storesShow, + areas, + jssdk, + cards, + logs, + ungrants, + send, + unicom +}) diff --git a/api/request.js b/api/request.js new file mode 100644 index 0000000..32f336c --- /dev/null +++ b/api/request.js @@ -0,0 +1,65 @@ +import {errInfo} from './err' +import {updToken} from './updateToken' + +// 请求方式配置 +const api = "https://card.ysd-bs.com/api/" //正式地址 +const header = { + "Accept" : "application/json" +} + +/** + * 请求 + * @property {Object} req + */ + +const req = (obj) => { + // 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") || "" + } + + 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 => { + wx.showToast({ + title : err.errMsg, + icon : "none" + }) + reject(err) + } + }) + }) +} + +module.exports = { + req +} diff --git a/api/updateToken.js b/api/updateToken.js new file mode 100644 index 0000000..8207d76 --- /dev/null +++ b/api/updateToken.js @@ -0,0 +1,17 @@ + +/** + * 更新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..b567e1d --- /dev/null +++ b/app.js @@ -0,0 +1,70 @@ + +/* + * 亿时代 + */ + +import api from "api/index" + +var QQMapWX = require('utils/qqmap-wx-jssdk.min.js'); +var qqmapsdk; + +App({ + onLaunch() { + // 获取系统信息 + this.globalData.statusBarHeight = wx.getSystemInfoSync().statusBarHeight + + // 检查用户登录状态 + const token = wx.getStorageSync("token") + if (token) { + this.globalData.isUser = true + } + + this.qqmapsdk = new QQMapWX({ + key: '4KYBZ-LCAKF-QWOJN-NIDNZ-FZHLZ-2XFW7' + }) + + // 版本更新提示 + const updateManager = wx.getUpdateManager() + + updateManager.onUpdateReady(function () { + wx.showModal({ + title : "更新提示", + content : "新版本已经准备好,是否重启应用?", + confirmText : "重启", + cancelColor : "#555", + confirmColor: "#26589f", + success: res => { + if (res.confirm) { + updateManager.applyUpdate() + } + } + }) + }) + + + // 获取系统信息 + wx.getSystemInfo({ + success: res=>{ + this.globalData.systInfo = { + statusBarHeight: res.statusBarHeight, + safeArea : res.safeArea + } + } + }) + // 挂载api + wx.$api = api + }, + globalData: { + isUser : false, + userInfo : null, + token : "", + statusBarHeight : 0, + userCurrent : 0, + wechatUser : '', + city : "", + atcity : "", + adcode : '', + longitude : '', + latitude : '' + } +}) \ No newline at end of file diff --git a/app.json b/app.json new file mode 100644 index 0000000..cc3e22a --- /dev/null +++ b/app.json @@ -0,0 +1,62 @@ +{ + "pages": [ + "pages/index/index", + "pages/user/user", + "pages/coupon/coupon", + "pages/couponDetails/couponDetails", + "pages/store/store", + "pages/storeDetails/storeDetails", + "pages/chooseTel/chooseTel", + "pages/login/login", + "pages/couponArr/couponArr", + "pages/rights/rights", + "pages/activity/activity", + "pages/activityInfo/activityInfo", + "pages/address/address", + "pages/address_form/address_form", + "pages/activityOrder/activityOrder", + "pages/activityData/activityData", + "pages/order/order", + "pages/orderData/orderData", + "pages/activate/activate", + "pages/account/account", + "pages/switchcity/switchcity", + "pages/webView/webView", + "pages/packet/packet", + "pages/frozen/frozen", + "pages/welfare/welfare", + "pages/classify/classify" + ], + "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/user/user", + "text": "我的", + "iconPath": "/static/tabBarIcon/01.png", + "selectedIconPath": "/static/tabBarIcon/01_active.png" + } + ], + "color": "#b6b9bb", + "selectedColor": "#000", + "borderStyle": "white" + }, + "style": "v2", + "sitemapLocation": "sitemap.json", + "permission": { + "scope.userLocation": { + "desc": "你的位置信息将用于小程序位置接口的效果展示" + } + } +} \ No newline at end of file diff --git a/app.wxss b/app.wxss new file mode 100644 index 0000000..00d27c0 --- /dev/null +++ b/app.wxss @@ -0,0 +1,96 @@ +/**app.wxss**/ +page { + background: #f7f7f7; +} + +/* 下边框 */ +.uni-border-top, +.uni-border-bottom { + position: relative; +} + +.uni-border-top::after, +.uni-border-bottom::after { + position: absolute; + content: ''; + left: 0; + width: 100%; + height: 2rpx; + background: #f3f3f3; +} + +.uni-border-top::after { + top: 0; +} + +.uni-border-bottom::after { + bottom: 0; +} + +/* + * 文字截取 + */ + +.nowrap { + max-width: 100%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.nowrap-multi { + display: -webkit-box; + overflow: hidden; + text-overflow: ellipsis; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; +} + +/* + * 水平居中 + */ + +.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; +} + + + +/* 上拉加载 */ +.pagesLoding{ + text-align: center; + line-height: 90rpx; + color: gray; +} + +.pagesLoding-icon{ + width: 28rpx; + height: 28rpx; + vertical-align: middle; + margin-right: 10rpx; + margin-bottom: 3rpx; +} \ No newline at end of file diff --git a/pages/account/account.js b/pages/account/account.js new file mode 100644 index 0000000..0f66061 --- /dev/null +++ b/pages/account/account.js @@ -0,0 +1,83 @@ +// pages/account/account.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + type : '', //卡类型 + number : '', //账户余额 + accounts : '', //账户列表 + blockeds : '', //待发放余额 + page : {}, //分页信息 + lodingStats : false, //加载状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { + this.setData({ + type : options.type + }) + }, + + onShow() { + // 获取账变记录 + this.accountInfo(); + }, + + /** + * 账变记录 + */ + accountInfo(page) { + wx.$api.user.logs(this.data.type, page).then(res=>{ + //判断金卡、银卡、钻石卡 + let number + if(this.data.type == "silver") { + number = res.data.account.silver + } else if(this.data.type == "gold") { + number = res.data.account.gold + } else if(this.data.type == "drill") { + number = res.data.account.drill + } else { + return + } + + let listArr = this.data.accounts, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.data) + + this.setData({ + number : number, + blockeds : res.data.blockeds, + accounts : newData, + page : res.data.page + }) + }) + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取账变记录 + this.accountInfo(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取账变记录 + this.accountInfo(pageNumber); + } + } +}) \ No newline at end of file diff --git a/pages/account/account.json b/pages/account/account.json new file mode 100644 index 0000000..54ed85e --- /dev/null +++ b/pages/account/account.json @@ -0,0 +1,6 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "账变记录", + "navigationBarBackgroundColor": "#dfb48b", + "navigationBarTextStyle": "white" +} \ No newline at end of file diff --git a/pages/account/account.wxml b/pages/account/account.wxml new file mode 100644 index 0000000..676387b --- /dev/null +++ b/pages/account/account.wxml @@ -0,0 +1,57 @@ + + + + 白金账户余额 + + 钻石账户余额 + + + + 可用余额 + {{number}} + 可用余额,入账记录 + + + 待发放 + {{blockeds}} + 立即查询 + + + + + + 入账记录 + + + + {{item.title}} + + + {{item.variable}} + + + + + 有效期: + {{item.created_at}} 至 {{item.expired_at}} + + + + + + + 加载中... + + + 没有更多了~ + + + + + + + + 抱歉,目前暂无内容~ + \ No newline at end of file diff --git a/pages/account/account.wxss b/pages/account/account.wxss new file mode 100644 index 0000000..d643194 --- /dev/null +++ b/pages/account/account.wxss @@ -0,0 +1,155 @@ +/* 积分 */ +.integra-cont-name { + padding: 40rpx 20rpx 10rpx; + font-weight: 600; +} + +.integra-list { + background: #fff; + border-radius: 10rpx; + width: calc(100% - 40rpx); + margin: 20rpx; + box-sizing: border-box; +} + +.integra-top { + padding: 30rpx 20rpx 0; + background-color: #dfb48b; + border-radius: 0 0 100rpx 100rpx; +} + +.integra-name { + color: #fff; + font-size: 32rpx; + margin-bottom: 30rpx; +} + +.integra-title { + margin-bottom: 20rpx; +} + +.integra-number { + font-size: 40rpx; +} + +.integra-btn { + font-size: 28rpx; + margin-top: 20rpx; + color: #adadad; + display: flex; +} + +.integra-btn text { + color: #dfb48b; +} + +.integra-btn image { + width: 36rpx; + height: 36rpx; + margin-top: 2rpx; +} + +.integra-blue { + color: #317afa; +} + +.integra-info { + background-color: #fff; + text-align: center; + border-radius: 20rpx; + display: flex; + box-shadow: 0 10rpx 10rpx rgba(0, 0, 0, .1); + padding: 30rpx 20rpx; + box-sizing: border-box; + text-align: left; +} + +.integra-right { + flex: 2; + position: relative; +} + +.integra-right::after { + position: absolute; + content: ''; + left: 0; + top: 0; + background-color: #eeeeee; + width: 2rpx; + height: 100%; +} + +.integra-right:first-child { + padding-right: 20rpx; + box-sizing: border-box; +} + +.integra-right:last-child { + padding-left: 30rpx; + box-sizing: border-box; +} + +.integra-right:first-child::after { + display: none; +} + +.integra-list { + padding: 30rpx 20rpx; + position: relative; + box-sizing: border-box; +} + +.integra-list::after { + position: absolute; + content: ''; + left: 0; + bottom: 0; + width: 100%; + height: 2rpx; + background: #eaeaea; +} + +.integra-list:last-child::after { + display: none; +} + +.integra-text { + display: flex; + margin-bottom: 20rpx; +} + +.integra-title { + flex: 1; + font-size: 30rpx; + display: flex; +} + +.integra-title text { + flex: 1; +} + +.integra-title image { + width: 36rpx; + height: 36rpx; +} + +.integra-oints { + color: #f0a479; +} + +.integra-date { + display: flex; +} + +.integra-time:last-child{ + box-sizing: border-box; +} + +.integra-time { + color: #999; + font-size: 28rpx; +} + +.integra-time text { + color: #000; +} \ No newline at end of file diff --git a/pages/activate/activate.js b/pages/activate/activate.js new file mode 100644 index 0000000..c080a14 --- /dev/null +++ b/pages/activate/activate.js @@ -0,0 +1,70 @@ + +/* + * 本时生活 + */ + +const app = getApp() + + +Page({ + + /** + * 页面的初始数据 + */ + data: { + carmi: '' //卡密 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { + }, + + /** + * 卡激活 + */ + cardform(e) { + let code = e.detail.value.code, + pass = this.data.carmi + + wx.$api.user.cards(code, pass).then(res=>{ + if(res.data.type == "silver") { + app.globalData.userCurrent = 0 + }else if(res.data.type == "gold") { + app.globalData.userCurrent = 1 + }else if(res.data.type == "drill") { + app.globalData.userCurrent = 2 + }else { + return + } + + // 写入缓存 + wx.setStorage({ + key : 'current', + data : app.globalData.userCurrent + }) + + wx.showToast({ + title: res.data.message, + icon : 'none' + }) + setTimeout(()=>{ + wx.switchTab({ + url: '/pages/user/user' + }) + },2000) + }) + }, + + /** + * 获取卡密 + */ + carmiTab(e){ + var number = e.detail.value + var change = number.replace(/(\d{4})(?=\d)/g, "$1-");//replace(/\s/g,''); + this.setData({ + carmi: change + }) + } +}) \ No newline at end of file diff --git a/pages/activate/activate.json b/pages/activate/activate.json new file mode 100644 index 0000000..286a508 --- /dev/null +++ b/pages/activate/activate.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "卡激活" +} \ No newline at end of file diff --git a/pages/activate/activate.wxml b/pages/activate/activate.wxml new file mode 100644 index 0000000..57ddcfd --- /dev/null +++ b/pages/activate/activate.wxml @@ -0,0 +1,29 @@ + + + + + 消费红包【储值卡】 +
+ + + + + + + + + + + +
+ + 温馨提示: + + 尊敬的会员:储值后,将开启您,愉快的消费之旅! + + + +
+
\ No newline at end of file diff --git a/pages/activate/activate.wxss b/pages/activate/activate.wxss new file mode 100644 index 0000000..157abdd --- /dev/null +++ b/pages/activate/activate.wxss @@ -0,0 +1,129 @@ +/* 卡激活 */ +.activate-back { + width: 100%; + height: 100vh; + left: 0; + top: 0; + position: relative; +} + +.activate-img { + position: relative; + left: 0; + top: 0; + width: 100%; + height: 100%; + z-index: 2; +} + +.activate-cont { + position: absolute; + top: 0; + left: 0; + padding: 60rpx; + width: 100%; + box-sizing: border-box; + z-index: 9; +} + +.activate-title { + font-size: 60rpx; + font-weight: 600; + text-align: center; + margin: 20rpx 0 100rpx; +} + +.activate-label, .activate-pass { + margin-bottom: 60rpx; +} + +.activate-label label, .activate-pass label { + margin-bottom: 40rpx; + display: block; + font-weight: 600; + font-size: 34rpx; +} + +.activate-label input, .activate-pass input { + background: rgba(255, 255, 255, .3); + border-radius: 60rpx; + height: 90rpx; + line-height: 90rpx; + padding: 0 1rem; + box-sizing: border-box; + box-shadow: inset -2px 2px 4px 1.5px rgba(0, 0, 0, 0.7); +} + +.activate-label input { + width: 100%; +} + +.activate-label text { + display: block; + font-size: 32rpx; + margin-top: 10rpx; + font-weight: normal; +} + +.activate-entry { + display: flex; + line-height: 80rpx; + color: #fff; + font-weight: 600; +} + +.activate-entry input { + background: #fff; + border-radius: 60rpx; + width: calc(25% - 1rem); + margin: 0 .5rem; + height: 80rpx; + line-height: 80rpx; +} + +.activate-btn { + width: 100%; + height: 90rpx; + border: none; + margin: 2rem 0 2.2rem; +} + +.activate-btn button { + width: 100% !important; + height: 100%; + line-height: 90rpx; + border-radius: 50rpx; + background: #000; + border: none; + font-size: 40rpx; + color: #fff; + margin: 0; + padding: 0; +} + +.activate-tips { + color: #000; + font-weight: 600; + font-size: 32rpx; +} + +.activate-tips-text { + line-height: 46rpx; + margin-top: 20rpx; +} + +.activate-tips-img { + width: 240rpx; + height: 240rpx; + border-radius: 50%; + margin: 2rem auto 0; +} + +.activate-tips-img image { + width: 100%; + height: 100%; +} + +.activate-tips-text { + text-indent: 2rem; +} \ No newline at end of file diff --git a/pages/activity/activity.js b/pages/activity/activity.js new file mode 100644 index 0000000..997570f --- /dev/null +++ b/pages/activity/activity.js @@ -0,0 +1,53 @@ + +/* + * 本时生活 + */ + +const app = getApp() + +Page({ + + /** + * 页面的初始数据 + */ + data: { + isUser : false, //用户登录状态 + indexArr : '', //商品列表 + page : '', //下一页 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { + if(app.globalData.isUser){ + this.setData({ + isUser: app.globalData.isUser + }) + } + + wx.$api.index.redwine().then(res=>{ + this.setData({ + indexArr : res.data.data, + page : res.data.page + }) + }) + }, + + /** + * 处理未登录时的转跳 + */ + userNav(e){ + let pageUrl = e.currentTarget.dataset.url + if(this.data.isUser){ + wx.navigateTo({ + url: pageUrl + }) + }else{ + // 去登录 + wx.navigateTo({ + url: "/pages/login/login?way=activity" + }) + } + } +}) \ No newline at end of file diff --git a/pages/activity/activity.json b/pages/activity/activity.json new file mode 100644 index 0000000..951f122 --- /dev/null +++ b/pages/activity/activity.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "产品活动" +} \ No newline at end of file diff --git a/pages/activity/activity.wxml b/pages/activity/activity.wxml new file mode 100644 index 0000000..24137bd --- /dev/null +++ b/pages/activity/activity.wxml @@ -0,0 +1,7 @@ + + + 商品列表 + + + + \ No newline at end of file diff --git a/pages/activity/activity.wxss b/pages/activity/activity.wxss new file mode 100644 index 0000000..f9ea2f9 --- /dev/null +++ b/pages/activity/activity.wxss @@ -0,0 +1,36 @@ +/* 活动列表 */ +.activityTitle { + background: #000; + color: #fff; + border-radius: 40rpx 14rpx 14rpx 40rpx; + margin: 20rpx 24rpx 0; + padding: 10rpx; + width: 190rpx; + box-sizing: border-box; + display: flex; + font-size: 28rpx; +} + +.activityTitle image { + width: 40rpx; + height: 40rpx; + margin-right: 5rpx; +} + +.activityList { + width: calc(100% - 40rpx); + margin: 30rpx 20rpx; + box-sizing: border-box; + position: relative; + padding-top: 40%; +} + +/* 5:2 */ +.activityList image { + border-radius: 10rpx; + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; +} \ No newline at end of file diff --git a/pages/activityData/activityData.js b/pages/activityData/activityData.js new file mode 100644 index 0000000..517cd4c --- /dev/null +++ b/pages/activityData/activityData.js @@ -0,0 +1,138 @@ + +/* + * 本时生活 + */ + +const app = getApp() + + +Page({ + + /** + * 页面的初始数据 + */ + data: { + statusHeight : app.globalData.statusBarHeight, + order : '' //订单详情 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { + + // 获取商品活动订单详情 + this.orderInfo(options.id); + }, + + /** + * 商品活动订单详情 + */ + orderInfo(id) { + wx.$api.index.ordersInfo(id).then(res=>{ + this.setData({ + order : res.data + }) + }) + }, + + /** + * 取消订单 + */ + orderDelete(e) { + let orderId = e.currentTarget.dataset.id + wx.showModal({ + title : '订单取消', + content : '确认取消吗?', + success : res=> { + if (res.confirm) { + wx.$api.index.cance(orderId).then(res=>{ + wx.showToast({ + title: res.data, + icon : 'none' + }) + setTimeout(()=>{ + wx.reLaunch({ + url: '/pages/activityOrder/activityOrder', + }) + },2000) + }) + } else if (res.cancel) { + wx.showToast({ + title : '取消', + icon : 'loading', + duration: 1000 + }) + } + } + }) + }, + + /** + * 订单支付 + */ + orderPay(e) { + let orderId = e.currentTarget.dataset.id + + wx.login({ + success: res=> { + wx.$api.index.repay(orderId).then(res=>{ + let payInfo = JSON.parse(res.data.json) + wx.requestPayment({ + timeStamp: payInfo.timeStamp, + nonceStr : payInfo.nonceStr, + package : payInfo.package, + paySign : payInfo.paySign, + signType : payInfo.signType, + success : res=>{ + if(res.errMsg == "requestPayment:ok"){ + wx.showToast({ + title: '支付成功', + icon : 'success' + }) + setTimeout(()=>{ + wx.reLaunch({ + url: '/pages/activityOrder/activityOrder', + }) + },2000) + } + }, + fail : res=>{ + wx.reLaunch({ + url: '/pages/activityOrder/activityOrder', + }) + } + }) + }) + } + }) + }, + + /** + * 返回上一页 + */ + orderRun() { + wx.navigateBack({ + delta: 1 + }) + }, + + /** + * 复制快递单号 + */ + copyText (e) { + let text = e.currentTarget.dataset.text + wx.setClipboardData({ + data : text, + success : res=> { + wx.getClipboardData({ + success: res => { + wx.showToast({ + title: '复制成功' + }) + } + }) + } + }) + } +}) \ No newline at end of file diff --git a/pages/activityData/activityData.json b/pages/activityData/activityData.json new file mode 100644 index 0000000..87ee6d0 --- /dev/null +++ b/pages/activityData/activityData.json @@ -0,0 +1,6 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "订单详情", + "navigationBarBackgroundColor": "#f57e32", + "navigationBarTextStyle": "white" +} \ No newline at end of file diff --git a/pages/activityData/activityData.wxml b/pages/activityData/activityData.wxml new file mode 100644 index 0000000..350576b --- /dev/null +++ b/pages/activityData/activityData.wxml @@ -0,0 +1,115 @@ + + + {{order.status_text}} + + + + + + + + + + + + + + + + 收货人:{{order.address.name}} + {{order.address.mobile}} + + {{order.address.province}}{{order.address.city}}{{order.address.district}}{{order.address.info}} + + + + + + + + {{order.title}} + ¥{{order.param.price}} + ×{{order.param.number}} + + + + + + + + + + + + + {{item.amount}} + + + 超市券满减券 + + + + + {{item.title}} + + 卡数(张) + x {{item.number}} + + + + + + + + + + + + + + {{item.title}} + {{item.subtitle}} + 原价:{{item.amount}}元 + + 活动:0.00元 + x {{item.number}} + + + + + + + + 订单号 + {{order.order_id}} + + + + + + 物流公司 + {{order.ex_type_text}} + + + + + 快递单号 + {{order.ex_no}} + + + + + + 实际支付 + ¥{{order.amount}} + + + + + 返回订单 + 取消订单 + 立即支付 + \ No newline at end of file diff --git a/pages/activityData/activityData.wxss b/pages/activityData/activityData.wxss new file mode 100644 index 0000000..e50e247 --- /dev/null +++ b/pages/activityData/activityData.wxss @@ -0,0 +1,427 @@ + +/* + * 亿时代 + */ + .order-statl{ + background-color: #f57e32; + padding: 0 30rpx 10rpx; + color: white; + line-height: 90rpx; + height: 90rpx; + position: relative; +} + +.order-statl-icon{ + width: 80rpx; + height: 80rpx; + vertical-align: middle; + position: absolute; + right: 30rpx; + top: 5rpx; +} + + /* 收货人信息 */ +.order-address{ + padding: 30rpx 30rpx 30rpx 100rpx; + position: relative; + background: white; +} + +.order-address-back{ + position: absolute; + left: 0; + bottom: 0; + width: 100%; + vertical-align:bottom; +} + +.order-address-name{ + padding-right: 300rpx; + position: relative; + font-size: 33rpx; + padding-bottom: 10rpx; +} + +.order-address-name text{ + position: absolute; + right: 0; + top: 0; + width: 280rpx; + text-align: right; +} + +.order-address-text{ + color: #464854; + font-size: 26rpx; +} + +.address-icon, +.arrows-right{ + position: absolute; +} + +.address-icon{ + height: 42rpx; + width: 42rpx; + left: 30rpx; + top: calc(50% - 26rpx); + top: -webkit-calc(50% - 26rpx); +} + +.arrows-right{ + height: 28rpx; + width: 28rpx; + right: 30rpx; + top: calc(50% - 19rpx); + top: -webkit-calc(50% - 19rpx); +} + +.order-add-address{ + text-align: center; + padding: 30rpx 0; +} + +.order-add-address navigator{ + display: inline-block; + background: #e92344; + color: white; + line-height: 60rpx; + padding: 0 30rpx; + margin-right: 20rpx; +} + +/* 订单商品 */ + +.order-content{ + border-bottom: solid 100rpx transparent; +} + +.order-goods{ + margin-bottom: 20rpx; +} + +.goods-goods-mall{ + padding: 20rpx 30rpx 0 30rpx; + line-height: 50rpx; +} + +.goods-goods-mall image{ + width: 48rpx; + height: 48rpx; + vertical-align: middle; + margin-right: 15rpx; + margin-bottom: 2rpx; +} + +.goods-goods-li{ + padding: 20rpx 30rpx; + position: relative; + border-bottom: solid 1rpx #f2f2f2; + min-height: 130rpx; + background: white; +} + +.goods-goods-li:last-child{ + border-bottom: none; +} + +.goods-img{ + position: absolute; + top: 20rpx; + left: 30rpx; + height: 130rpx; + width: 130rpx; + background: #f5f6fa; +} + +.goods-body{ + padding-left: 150rpx; +} + +.goods-name{ + font-weight: bold; + padding: 10rpx 0 20rpx; +} + +.goods-price{ + color: #e92344; +} + +.goods-qty{ + color: gray; + font-weight: normal; + padding-left: 10rpx; + font-size: 28rpx; +} + +.goods-params{ + color: gray; + padding-bottom: 20rpx; + font-size: 28rpx; +} + +/* 统计信息 */ + +.order-total{ + background: white; + margin: 20rpx 0; +} + +.order-total-li{ + padding: 0 30rpx; + line-height: 90rpx; + position: relative; + font-size: 28rpx; +} + +.order-total-li::before{ + position: absolute; + content: " "; + left: 30rpx; + bottom: 0; + right: 0; + height: 1rpx; + background: #f2f2f2; +} + +.order-total-li:last-child::before{ + display: none; +} + +.order-total-li text{ + float: right; + color: #999; +} + +.order-total-li .redCor { + color: #e92344; + font-size: 32rpx; +} + + + +/* 购物券 */ +.goodsCoupon { + background: #fff; + padding: 20rpx; + box-sizing: border-box; + position: relative; +} + +.goodsCoupon-right { + width: calc(100% - 270rpx); + position: absolute; + left: 250rpx; + top: 20rpx; + right: 20rpx; +} + +.goodsCoupon-text { + color: #999; + font-size: 26rpx; + margin-bottom: 24rpx; +} + +.goodsCoupon-name { + margin-bottom: 40rpx; + font-size: 32rpx; +} + +.goodsCoupon-name-box { + margin-bottom: 10rpx; +} + +.goodsCoupon-sheet { + display: flex; + font-size: 28rpx; + color: #999; +} + +.goodsCoupon-cost { + color: #000; + font-size: 28rpx; + margin: 14rpx 0; +} + +.goodsCoupon-price { + font-size: 28rpx; + color: #f57e32; +} + +.goodsCoupon-sheet view { + display: inline-block; + flex: 1; +} + +.goodsCoupon-sheet text { + font-size: 24rpx; + line-height: 40rpx; + padding-right: 6rpx; +} + + +.goodsCoupon-left { + position: relative; + width: 200rpx; + height: 130rpx; +} + +.goodsCoupon-box { + width: 200rpx; + height: 200rpx; +} + +.goodsBox-img { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; +} + +.goodsCoupon-img { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} + +.goodsCoupon-number { + position: absolute; + top: 0; + left: 0; + z-index: 2; + width: 100%; + text-align: center; + font-size: 40rpx; + color: #f57e32; + height: 94rpx; + line-height: 94rpx; + font-weight: 600; +} + +.goodsCoupon-number text { + font-size: 28rpx; +} + +.goodsCoupon-btn { + position: absolute; + right: 10rpx; + left: 10rpx; + bottom: 4rpx; + z-index: 2; + background: #f57e32; + color: #fff; + font-size: 24rpx; + width: calc(100% - 20rpx); + text-align: center; + height: 40rpx; + line-height: 40rpx; + border-radius: 30rpx; + transform: scale(0.83, 0.83); +} + +.goodsCoupon-tips { + position: absolute; + top: -4rpx; + left: 10rpx; + z-index: 2; + color: #fff; + transform: rotate(-45deg); +} + +.goodsCoupon-tips text { + transform: scale(0.83, 0.83); + font-size: 24rpx; + display: inline-block; +} + +.goodsBox-tips { + display: inline-block; + width: 49rpx; + padding: 8rpx 0 6rpx 0; + background: #EDBA19; + top: -10rpx; + left: 10rpx; + position: absolute; + text-align: center; + border-top-left-radius: 4rpx; + font-size: 24rpx; + color: #ffff; + transform: scale(.9, .9); +} + +.goodsBox-tips:before, .goodsBox-tips:after { + content: ""; + position: absolute; +} + +.goodsBox-tips:before { + height: 0; + width: 0; + border-bottom: 10rpx solid #745800; + border-right: 10rpx solid transparent; + right: -10rpx; + top: 0; +} + +.goodsBox-tips:after { + height: 0; + width: 0; + border-left: 25rpx solid #EDBA19; + border-right: 25rpx solid #EDBA19; + border-bottom: 25rpx solid transparent; + bottom: -22rpx; + left: 0; +} + +.goodsLabel { + background: #fff; + text-align: right; + padding: 20rpx; + font-size: 32rpx; +} + +.goodsLabel text { + font-weight: 600; +} + + +/* 底部工具栏 */ +.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; +} + +.order-data-footer.iphoneX { + padding-bottom: 30rpx; +} + +.order-btn{ + margin-left: 20rpx; + height: 54rpx; + line-height: 50rpx; + box-sizing: border-box; + border:solid 1rpx #747788; + padding: 0 20rpx; + font-size: 26rpx; + border-radius: 40rpx; + margin-top: 10rpx; +} + +.order-btn-back { + border-color: #f57e32; + color: #f57e32; +} \ No newline at end of file diff --git a/pages/activityInfo/activityInfo.js b/pages/activityInfo/activityInfo.js new file mode 100644 index 0000000..45cfc96 --- /dev/null +++ b/pages/activityInfo/activityInfo.js @@ -0,0 +1,183 @@ + +/* + * 本时生活 + */ + +const app = getApp() + + +Page({ + + /** + * 页面的初始数据 + */ + data: { + isUser : false, //用户登录状态 + indexId : '', //tab状态 + indexArr : '', //商品列表 + page : '', //下一页 + address : '', //收货地址 + goodId : '', //商品id + goodCont : '', //商品信息 + params : '', //商品数量组 + paramsIndex : 0, + platIndex : 0, //选择提交方式下标 + platformCp :[ //选择提交数组 + { + id : 0, + name : '快递' + }, + { + id : 1, + name : '自提' + } + ], + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { + + // this.setData({ + // goodId: options.id + // }) + + if(app.globalData.isUser){ + this.setData({ + isUser: app.globalData.isUser + }) + } + + // 活动商品列表 + wx.$api.index.redwine().then(res=>{ + this.setData({ + indexArr : res.data.data, + indexId : res.data.data[1].id, + page : res.data.page + }) + + // 获取商品信息 + this.redwineInfo(res.data.data[1].id) + }) + }, + + /** + * 商品信息 + */ + redwineInfo(id) { + wx.$api.index.redwinePay(id).then(res=>{ + this.setData({ + address : res.data.address, + goodCont : res.data.good, + params : res.data.params, + paramsIndex : res.data.params.findIndex(val => val.def == 1) + }) + }) + }, + + /** + * 商品数量选择 + */ + goodsNumber(e) { + let onType = e.currentTarget.dataset.type, + atIndex = this.data.paramsIndex + // atIndex = this.data.params.findIndex(val => val.number == this.data.qty) + if(onType == 'plus' && atIndex < this.data.params.length - 1){ + atIndex++ + }else if(onType == 'remove' && atIndex >= 1){ + atIndex-- + }else{ + return + } + this.setData({ + paramsIndex: atIndex + }) + }, + + /** + * 选择提交方式 + */ + platBind(e) { + this.setData({ + platIndex : e.detail.value + }) + }, + + /** + * 订单提交 + */ + submitOrder() { + let good_id = this.data.indexId, + param_id = this.data.params[this.data.paramsIndex].id, + address_id = this.data.address.id, + islogistics = this.data.platIndex + + wx.login({ + success: res=> { + wx.$api.index.payment(good_id, param_id, address_id, islogistics).then(res=>{ + let payInfo = JSON.parse(res.data.json) + wx.requestPayment({ + timeStamp: payInfo.timeStamp, + nonceStr : payInfo.nonceStr, + package : payInfo.package, + paySign : payInfo.paySign, + signType : payInfo.signType, + success : res=>{ + if(res.errMsg == "requestPayment:ok"){ + wx.showToast({ + title: '支付成功', + icon : 'success' + }) + setTimeout(()=>{ + wx.reLaunch({ + url: '/pages/activityOrder/activityOrder', + }) + },2000) + } + }, + fail : res=>{ + wx.reLaunch({ + url: '/pages/activityOrder/activityOrder', + }) + } + }) + }) + } + }) + }, + + /** + * 选择tab + */ + orderTab(e) { + let indexId = e.currentTarget.dataset.id + if (indexId != this.data.indexId) { + this.setData({ + indexId : indexId + }) + } + // 获取商品信息 + this.redwineInfo(indexId) + }, + + /** + * 点击图片放大 + */ + clickImg(e) { + let imgUrl = e.currentTarget.dataset.img + wx.previewImage({ + urls : [imgUrl], //需要预览的图片http链接列表,注意是数组 + current : '' // 当前显示图片的http链接,默认是第一个 + }) + }, + + /** + * 处理未登录时的转跳 + */ + loginGo(e){ + wx.navigateTo({ + url: "/pages/login/login?way=activity" + }) + } +}) \ No newline at end of file diff --git a/pages/activityInfo/activityInfo.json b/pages/activityInfo/activityInfo.json new file mode 100644 index 0000000..f7eceee --- /dev/null +++ b/pages/activityInfo/activityInfo.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "商品购买" +} \ No newline at end of file diff --git a/pages/activityInfo/activityInfo.wxml b/pages/activityInfo/activityInfo.wxml new file mode 100644 index 0000000..625063a --- /dev/null +++ b/pages/activityInfo/activityInfo.wxml @@ -0,0 +1,134 @@ + + + + + + + + + 收货人:{{address.name}}{{address.mobile}} + + 收货地址:{{address.all_address}} + + + + + + 添加地址 + + + + + + + + + + + {{item.classtitle}} + + + + + + + 平安好车主超级福利专享 + + + + + + + + {{goodCont.title}} + {{goodCont.subtitle}} + + {{params[paramsIndex].price}} + + - + + + + + + + + + + + + + + + + {{item.amount}} + + + 比优特电子券 + + + + + {{item.title}} + + 卡数(张) + x {{item.number}} + + + + + + + + + + + + + + {{item.title}} + {{item.subtitle}} + 原价:{{item.amount}}元 + + 活动:0.00元 + x {{item.number}} + + + + + + + + 小计¥{{params[paramsIndex].amount}} + + + + 请选择提交方式 + + + + {{platformCp[platIndex].name}} + + + + + + + + 快递 + + 免运费 包邮 + + + + + + + 应付金额: + ¥{{params[paramsIndex].amount}} + + + + + + 请先微信授权登录 + \ No newline at end of file diff --git a/pages/activityInfo/activityInfo.wxss b/pages/activityInfo/activityInfo.wxss new file mode 100644 index 0000000..bca5656 --- /dev/null +++ b/pages/activityInfo/activityInfo.wxss @@ -0,0 +1,575 @@ +/* 收货地址 */ +.borderBottom { + + border-bottom: 110rpx solid transparent; +} + +.order-address { + padding: 20rpx 80rpx 30rpx 100rpx; + position: relative; + background: white; +} + +.order-address-back { + position: absolute; + left: 0; + bottom: 0; + width: 100%; + vertical-align: bottom; +} + +.order-address-name { + padding-right: 300rpx; + position: relative; + font-size: 33rpx; + padding-bottom: 10rpx; +} + +.order-address-name text { + position: absolute; + right: 0; + top: 0; + width: 280rpx; + text-align: right; +} + +.order-address-text { + color: #464854; + font-size: 26rpx; +} + +.address-icon, +.arrows-right { + position: absolute; +} + +.address-icon { + height: 42rpx; + width: 42rpx; + left: 30rpx; + top: calc(50% - 26rpx); + top: -webkit-calc(50% - 26rpx); +} + +.arrows-right { + height: 28rpx; + width: 28rpx; + right: 30rpx; + top: calc(50% - 19rpx); + top: -webkit-calc(50% - 19rpx); +} + +.order-add-address { + text-align: center; + padding: 30rpx 0; +} + +.order-add-address navigator { + display: inline-block; + background: #f57e32; + color: white; + line-height: 60rpx; + padding: 0 30rpx; + margin-right: 20rpx; + font-size: 28rpx; + border-radius: 4rpx; +} + + +.order-add-address-img { + width: 25rpx; + height: 25rpx; + margin-right: 10rpx; + vertical-align: -2rpx; +} + +/* 订单商品 */ + +.order-goods { + margin: 0 0 20rpx; +} + +.order-content { + border-bottom: solid 100rpx transparent; +} + +.goods-goods-mall { + padding: 20rpx 30rpx 0 30rpx; + line-height: 50rpx; +} + +.goods-goods-mall image { + width: 48rpx; + height: 48rpx; + vertical-align: middle; + margin-right: 15rpx; + margin-bottom: 2rpx; +} + +.goods-goods-li { + padding: 20rpx 30rpx; + position: relative; + background: white; + display: flex; + height: 200rpx; +} + +.goods-img { + position: absolute; + top: 20rpx; + left: 20rpx; + height: 200rpx; + width: 200rpx; + background: #f5f6fa; + border-radius: 4rpx; +} + +.goods-body { + padding-left: 220rpx; + width: calc(100% - 220rpx); +} + +.goods-name { + font-weight: bold; + padding-bottom: 20rpx; + font-size: 32rpx; +} + +.goods-cont { + display: flex; +} + +.goods-text { + color: #999; + font-size: 28rpx; + margin-bottom: 40rpx; +} + +.goods-price { + flex: 1; + line-height: 50rpx; + font-size: 36rpx; + font-weight: 600; + color: #f57e32; +} + +.goods-price text { + font-size: 26rpx; +} + +.good-number { + display: flex; + width: 180rpx; + text-align: center; + height: 50rpx; +} + +.good-number-btn { + width: 50rpx; + color: #000; + font-weight: 600; +} + +.good-number-input { + flex: 1; + margin: 0 6rpx; + height: 50rpx; + line-height: 50rpx; + color: #000; + font-size: 26rpx; +} + +.good-number-input { + background: #f7f7f7; + font-size: 24rpx; +} + +.good-number-btn { + background: #f0f0f0; +} + +/* 购物券 */ +.goodsCoupon { + background: #fff; + padding: 20rpx; + box-sizing: border-box; + position: relative; +} + +.goodsCoupon-right { + width: calc(100% - 270rpx); + position: absolute; + left: 250rpx; + top: 30rpx; + right: 20rpx; +} + +.goodsCoupon-name { + margin-bottom: 30rpx; + font-size: 32rpx; +} + +.goodsCoupon-text { + color: #999; + font-size: 26rpx; + margin-bottom: 24rpx; +} + +.goodsCoupon-name-box { + margin-bottom: 10rpx; +} + +.goodsCoupon-sheet { + display: flex; + font-size: 30rpx; + color: #999; +} + +.goodsCoupon-cost { + color: #000; + font-size: 28rpx; + margin: 14rpx 0; +} + +.goodsCoupon-price { + font-size: 28rpx; + color: #f57e32; +} + +.goodsCoupon-box-right { + top: 16rpx; +} + +.goodsCoupon-sheet view { + display: inline-block; + flex: 1; +} + +.goodsCoupon-sheet text { + font-size: 24rpx; + line-height: 44rpx; + padding-right: 6rpx; +} + +.goodsCoupon-left { + position: relative; + width: 200rpx; + height: 140rpx; +} + +.goodsCoupon-box { + width: 200rpx; + height: 200rpx; +} + +.goodsBox-img { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; +} + +.goodsCoupon-img { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} + +.goodsCoupon-number { + position: absolute; + top: 20rpx; + left: 0; + z-index: 2; + width: 100%; + text-align: center; + font-size: 40rpx; + color: #fff; + font-weight: 600; + text-shadow: 2rpx 2rpx 2rpx #d69e50; +} + +.goodsCoupon-number text { + font-size: 28rpx; +} + +.goodsCoupon-btn { + position: absolute; + right: 10rpx; + left: 10rpx; + bottom: 20rpx; + z-index: 2; + background-image: linear-gradient(#eacf90, #f7e09f, #ce9e4d); + color: #000; + font-size: 24rpx; + width: calc(100% - 20rpx); + text-align: center; + height: 40rpx; + line-height: 40rpx; + border-radius: 30rpx; + transform: scale(0.83, 0.83); +} + +.goodsCoupon-tips { + position: absolute; + top: 6rpx; + left: 14rpx; + z-index: 2; + color: #fff; + transform: rotate(-48deg); +} + +.goodsCoupon-tips text { + transform: scale(0.83, 0.83); + font-size: 24rpx; + display: inline-block; +} + +.goodsBox-tips { + display: inline-block; + width: 49rpx; + padding: 8rpx 0 6rpx 0; + background: #EDBA19; + top: -10rpx; + left: 10rpx; + position: absolute; + text-align: center; + border-top-left-radius: 4rpx; + font-size: 24rpx; + color: #ffff; + transform: scale(.9, .9); +} + +.goodsBox-tips:before, +.goodsBox-tips:after { + content: ""; + position: absolute; +} + +.goodsBox-tips:before { + height: 0; + width: 0; + border-bottom: 10rpx solid #745800; + border-right: 10rpx solid transparent; + right: -10rpx; + top: 0; +} + +.goodsBox-tips:after { + height: 0; + width: 0; + border-left: 25rpx solid #EDBA19; + border-right: 25rpx solid #EDBA19; + border-bottom: 25rpx solid transparent; + bottom: -22rpx; + left: 0; +} + +.goodsLabel { + background: #fff; + text-align: right; + padding: 20rpx; + font-size: 26rpx; +} + +.goodsLabel text { + font-weight: 600; + font-size: 30rpx; + padding-left: 10rpx; + color: #f57e32; +} + +/* 底部工具栏 */ + +.order-footer, +.order-login-footer { + position: fixed; + bottom: 0; + left: 0; + width: 100%; + border-top: solid 1rpx #f2f2f2; + height: 100rpx; + line-height: 100rpx; + z-index: 99; +} + +.order-footer { + background: white; +} + +.order-login-footer { + background: #f57e32; + text-align: center; + color: #fff; +} + +.order-footer-total { + padding-right: calc(30vw + 30rpx); + padding-right: -webkit-calc(30vw + 30rpx); + padding-left: 30rpx; + color: #737787; + font-size: 28rpx; +} + +.order-footer-total text { + color: #f57e32; +} + +.order-footer-total-price { + font-weight: bold; + font-size: 30rpx; +} + +.order-footer-btn[size="mini"] { + width: 30vw; + background: #f57e32; + color: white; + border-radius: 0; + height: 100rpx; + line-height: 100rpx; + font-size: 30rpx; + position: absolute; + top: 0; + right: 0; +} + +.order-footer-btn:after { + border: none; +} + +.order-footer-btn.insufficient { + background: #737787; + text-align: center; +} + +.order-textarea { + padding: 20rpx; +} + + +.rightsLabel { + background: #fff; + display: flex; + padding: 20rpx; + color: #6f7880; + font-size: 30rpx; + margin: 20rpx 0; +} + +.rightsLabel .rightsLabel-left { + flex: 1; + color: #747d86; +} + +.rightsLabel-black { + padding-top: 30rpx; +} + +.rightsLabel-range { + display: flex; + color: #000; + font-weight: 600; +} + +.rightsLabel-row { + width: 38rpx; + height: 38rpx; + margin: 2rpx 0 0 6rpx; +} + +.rightsLabel-black .rightsLabel-right { + color: #000; + font-weight: 600; + font-size: 32rpx; +} + +.rightsLabel-black .rightsLabel-left { + color: #000; +} + + +.rightsLabel-pay { + color: #000; +} + +.rightsLabel-pay .rightsLabel-left { + flex: 1; +} + +.rightsLabel-free { + color: #999; + padding-right: 20rpx; +} + +/* tab */ +.order-tab { + display: flex; + background: #fff; + padding: 20rpx 0 25rpx; + color: #999; +} + +.order-tab-item { + flex: 2; + text-align: center; + position: relative; +} + +.order-tab-item::after { + position: absolute; + left: calc(50% - 50rpx); + bottom: -25rpx; + width: 100rpx; + height: 4rpx; + border-radius: 20rpx; + content: ''; + background: transparent; +} + +.order-tab-item.active { + color: #e2952b; + font-weight: 600; +} + +.order-tab-item.active::after { + background: #e2952b; +} + +/* 提示 */ +.goods-tips { + background: #fffbec; + color: #e2952b; + padding: 20rpx; + box-sizing: border-box; + font-size: 29rpx; + display: flex; + position: relative; +} + +.goods-tips::after, +.goods-tips::before { + position: absolute; + content: ''; + left: 0; + bottom: 0; + width: 100%; + height: 2rpx; + background: #fef5d1; +} + +.goods-tips::after { + bottom: 0; +} + +.goods-tips::before { + top: 0; +} + +.goods-tips image { + width: 30rpx; + height: 30rpx; + margin-right: 14rpx; + margin-top: 3rpx; +} \ No newline at end of file diff --git a/pages/activityOrder/activityOrder.js b/pages/activityOrder/activityOrder.js new file mode 100644 index 0000000..72b9f69 --- /dev/null +++ b/pages/activityOrder/activityOrder.js @@ -0,0 +1,146 @@ +// pages/activityOrder/activityOrder.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + stateType : '', //状态 + counts : '', //数量 + orderArr : [], //列表 + page : {}, //下一页 + lodingStats : false //加载状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { + + // 获取商品活动订单 + this.orderInfo(); + }, + + /** + * 商品活动订单 + */ + orderInfo(page) { + wx.$api.index.activityOrder(this.data.stateType, page).then(res=>{ + let listArr = this.data.orderArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + + newData = listArr.concat(res.data.data) + this.setData({ + counts : res.data.count, + orderArr : newData, + page : res.data.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + }) + }, + + /** + * tabs + */ + orderTab(e){ + if(this.data.stateType != e.currentTarget.dataset.state){ + this.setData({ + stateType: e.currentTarget.dataset.state + }) + + // 获取商品活动订单 + this.orderInfo() + + wx.pageScrollTo({ + scrollTop: 0 + }) + } + }, + + /** + * 取消订单 + */ + orderDelete(e) { + let orderId = e.currentTarget.dataset.id + wx.showModal({ + title : '订单取消', + content : '确认取消吗?', + success : res=> { + if (res.confirm) { + wx.$api.index.cance(orderId).then(res=>{ + // 获取商品活动订单 + this.orderInfo() + + wx.showToast({ + title: res.data, + icon : 'none' + }) + }) + } else if (res.cancel) { + wx.showToast({ + title : '取消', + icon : 'loading', + duration: 1000 + }) + } + } + }) + }, + + /** + * 订单支付 + */ + orderPay(e) { + let orderId = e.currentTarget.dataset.id + + wx.login({ + success: res=> { + wx.$api.index.repay(orderId).then(res=>{ + let payInfo = JSON.parse(res.data.json) + wx.requestPayment({ + timeStamp: payInfo.timeStamp, + nonceStr : payInfo.nonceStr, + package : payInfo.package, + paySign : payInfo.paySign, + signType : payInfo.signType, + success : res=>{ + if(res.errMsg == "requestPayment:ok"){ + wx.showToast({ + title: '支付成功', + icon : 'success' + }) + setTimeout(()=>{ + wx.redirectTo({ + url: '/pages/activityOrder/activityOrder', + }) + },2000) + } + }, + fail : res=>{ + wx.redirectTo({ + url: '/pages/activityOrder/activityOrder', + }) + } + }) + }) + } + }) + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + this.orderInfo(pageNumber) + } + } + +}) \ No newline at end of file diff --git a/pages/activityOrder/activityOrder.json b/pages/activityOrder/activityOrder.json new file mode 100644 index 0000000..f825b95 --- /dev/null +++ b/pages/activityOrder/activityOrder.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "我的订单", + "enablePullDownRefresh": true +} \ No newline at end of file diff --git a/pages/activityOrder/activityOrder.wxml b/pages/activityOrder/activityOrder.wxml new file mode 100644 index 0000000..0fce770 --- /dev/null +++ b/pages/activityOrder/activityOrder.wxml @@ -0,0 +1,66 @@ + + + + 全部 + + + 未支付 + {{counts.init}} + + + 已支付 + {{counts.paid}} + + + 已发货 + {{counts.send}} + + + + + + + + + {{item.activity_name}} + + + {{item.order_id}} + {{item.status_text}} + {{item.status_text}} + {{item.status_text}} + + + + + {{item.title}} + + ¥{{item.price}} × {{item.number}} + + + 礼盒 + 购物券 + + + + + 订单详情 + 取消订单 + 立即支付 + + + + + + 加载中... + + + 没有更多了~ + + + + + + + 暂无订单 + \ No newline at end of file diff --git a/pages/activityOrder/activityOrder.wxss b/pages/activityOrder/activityOrder.wxss new file mode 100644 index 0000000..3abc3ae --- /dev/null +++ b/pages/activityOrder/activityOrder.wxss @@ -0,0 +1,228 @@ +/* + * 亿时代 + */ + +.order-tab { + position: fixed; + left: 0; + top: 0; + width: 100%; + display: flex; + height: 80rpx; + line-height: 80rpx; + z-index: 9; + background: white; +} + +.order-tab-item { + font-size: 28rpx; + width: 25%; + text-align: center; + border-bottom: solid 2rpx #f7f7f7; + color: #464854; + background: white; + position: relative; +} + +.order-tab-item.active { + color: #f57e32; +} + +.order-tab-item::after { + content: ''; + position: absolute; + width: 30rpx; + height: 4rpx; + background: transparent; + left: calc(50% - 15rpx); + bottom: -2rpx; +} + +.order-tab-item.active::after { + background: #f57e32; +} + +.state-tips { + position: absolute; + top: 10rpx; + right: 14rpx; + background: #e92706; + color: #fff; + font-size: 24rpx; + transform: scale(.7, .7); + border-radius: 60rpx 60rpx 60rpx 0; + width: 48rpx; + height: 34rpx; + line-height: 34rpx; +} + +/* 订单列表 */ + +.order-content { + padding: 80rpx 0 20rpx 0; +} + +.order-content-li { + background: white; + margin-top: 20rpx; + position: relative; +} + +.order-name { + background: #fff; + padding: 20rpx; + box-sizing: border-box; + border-bottom: solid 1rpx #f3f3f3; + display: flex; +} + +.order-name image { + background: linear-gradient(#000, #000); + background-blend-mode: lighten; + background-size: cover; + width: 26rpx; + height: 26rpx; + border-radius: 50%; + margin: 8rpx 14rpx 0 0; +} + +.order-store { + padding: 20rpx; + border-bottom: solid 1rpx #f3f3f3; + display: flex; +} + +.order-goods-tips { + display: flex; +} + +.order-goods-tips text { + display: inline-block; + background: #e92706; + color: #fff; + border-radius: 20rpx; + padding: 0 20rpx; + height: 42rpx; + line-height: 42rpx; + font-size: 24rpx; + transform: scale(.8, .8); +} + +text.order-goods-tips-color { + background: #e6b329; +} + +.order-store-stateText { + color: #e6b329; + font-size: 26rpx; +} + +.order-store-stateText.red { + color: #e92344; +} + +.order-store-stateText.green { + color: #79b300; +} + +.order-store-title { + flex: 1; + color: #999; + font-size: 28rpx; +} + +.order-store-orderid { + color: #747788; + font-size: 25rpx; +} + +.order-store-title text { + color: white; + font-size: 24rpx; + background: #e92344; + margin-right: 10rpx; + padding: 0 10rpx; +} + +.order-goods { + padding: 20rpx; + box-sizing: border-box; + position: relative; +} + +.order-goods-cover { + width: 150rpx; + height: 150rpx; + vertical-align: top; + border-radius: 4rpx; +} + +.order-goods-content { + position: absolute; + left: 190rpx; + top: 20rpx; + right: 20rpx; + width: calc(100% - 210rpx); +} + +.order-goods-content-name { + margin-bottom: 15rpx; + font-size: 28rpx; + font-weight: 600; +} + +.order-goods-content-price { + color: #747788; + display: flex; + margin-bottom: 14rpx; + font-size: 28rpx; +} + +.order-goods-content-price text { + color: #f57e32; + display: inline-block; + margin-right: 10rpx; + font-size: 30rpx; +} + +.order-total { + padding: 20rpx; + box-sizing: border-box; + font-size: 26rpx; + line-height: 50rpx; + color: #747788; + display: flex; +} + +.order-total view { + margin-right: 30rpx; +} + +.order-total text { + color: #e92344; + font-weight: bold; +} + +.order-btns { + font-size: 25rpx; + display: flex; + padding: 20rpx; + box-sizing: border-box; + flex-wrap: wrap; + flex-direction: row-reverse; +} + +.order-btn { + margin-left: 20rpx; + height: 52rpx; + line-height: 50rpx; + box-sizing: border-box; + border: solid 1rpx #747788; + padding: 0 20rpx; + border-radius: 30rpx; +} + +.order-btn-back { + border-color: #f57e32; + color: #f57e32; +} \ No newline at end of file diff --git a/pages/address/address.js b/pages/address/address.js new file mode 100644 index 0000000..20bc164 --- /dev/null +++ b/pages/address/address.js @@ -0,0 +1,102 @@ +// pages/address/address.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + type : '', //来源类型 + addressArr : [] //收货地址 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { + this.setData({ + type: options.type + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow(){ + this.addressInfo(); + }, + + /* 地址列表 + */ + addressInfo(){ + wx.$api.address.index().then(res=>{ + this.setData({ + addressArr: res.data + }) + }) + }, + + /** + * 删除地址 + */ + addressRemove(e){ + let id = e.target.dataset.id, + index = e.target.dataset.index, + list = this.data.addressArr + + list.splice(index,1) + + wx.showModal({ + title : '提示', + content : '是否删除地址', + success : res=> { + if (res.confirm) { + wx.showLoading({ + title: '删除中', + }) + wx.$api.address.remove(id).then(res=>{ + this.setData({ + addressArr: list + }) + wx.showToast({ + title: res.data, + icon : "none" + }) + + wx.hideLoading() + }) + } + } + }) + }, + + /** + * 设为默认地址 + */ + addressDefault(e){ + let id = e.currentTarget.dataset.id + + wx.$api.address.setdef(id).then(res=>{ + this.addressInfo(); + wx.showToast({ + title: res.data, + icon : "none" + }) + }) + }, + + /** + * 选择地址 + */ + selectAddress(e){ + let atAdds = this.data.addressArr[e.currentTarget.dataset.index] + + let pages = getCurrentPages(), + prepage = pages[pages.length-2] + + prepage.setData({ + address: atAdds + }) + + wx.navigateBack() + } +}) \ No newline at end of file diff --git a/pages/address/address.json b/pages/address/address.json new file mode 100644 index 0000000..36ec88b --- /dev/null +++ b/pages/address/address.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "我的地址" +} \ No newline at end of file diff --git a/pages/address/address.wxml b/pages/address/address.wxml new file mode 100644 index 0000000..181f38e --- /dev/null +++ b/pages/address/address.wxml @@ -0,0 +1,40 @@ + + + {{item.name}}{{item.mobile}} + + + 默认 + + {{item.all_address}} + + + + + 选择地址 + + + + 删除 + 编辑 + + + 设为默认地址 + + + + + 默认地址 + + + + + + + + + 还未添加收货地址 + + + + 添加地址 + \ No newline at end of file diff --git a/pages/address/address.wxss b/pages/address/address.wxss new file mode 100644 index 0000000..47effc5 --- /dev/null +++ b/pages/address/address.wxss @@ -0,0 +1,112 @@ + +/** + * 亿时代 + */ + + .address-list{ + border-bottom: 110rpx solid transparent; +} + +.address{ + padding: 20rpx 30rpx; + border-bottom: solid 20rpx #f2f2f2; + background: white; +} + +.address-name{ + font-size: 32rpx; + line-height: 50rpx; +} + +.address-name text{ + color: #747788; + padding-left: 10rpx; + font-size: 28rpx; +} + +.address-info{ + padding-bottom: 20rpx; + display: flex; +} + +.address-tool{ + overflow: hidden; +} + +.address-info-tag{ + background: #30bb29; + margin-right: 20rpx; + padding: 0 10rpx; + height: 32rpx; + line-height: 32rpx; + color: white; + font-size: 22rpx; + border-radius: 4rpx; + margin-top: 6rpx; +} + +.address-tool-btn{ + margin-left: 30rpx; + float: right; + border:solid 1rpx #c0c0c0; + height: 46rpx; + line-height: 44rpx; + padding: 0 30rpx; + border-radius: 6rpx; + font-size: 24rpx; +} + +.address-tool-btn.yellow { + border:solid 1rpx #f57e32; + color: #f57e32; + padding: 0 14rpx; + height: 50rpx; + line-height: 50rpx; +} + +.address-tool-btn.acitve{ + float: left; + margin-left: 0; + padding: 0; + border: none; + color: #747788; + font-size: 26rpx; +} + +.address-tool-btn.acitve image{ + margin-right: 10rpx; + vertical-align: -7rpx; +} + +.address-tool-btn image { + width: 30rpx; + height: 30rpx; + margin-right: 4rpx; + vertical-align: -6rpx; +} + +/* footer */ + +.address-footer{ + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding-left: 30rpx; + padding-right: 30rpx; + background: white; + z-index: 9; + height: 110rpx; +} + +.address-footer navigator{ + width: 100%; + line-height: 80rpx; + height: 80rpx; + margin: 15rpx 0; + text-align: center; + background: #f57e32; + font-size: 30rpx; + color: white; + border-radius: 10rpx +} diff --git a/pages/address_form/address_form.js b/pages/address_form/address_form.js new file mode 100644 index 0000000..5df69f0 --- /dev/null +++ b/pages/address_form/address_form.js @@ -0,0 +1,240 @@ + +/* + * 本时生活 + */ + +const app = getApp() + + +Page({ + + /** + * 页面的初始数据 + */ + data: { + addressInfo: '', + type : '', //类型 + addressId : '', + defaultVal :'', + name : '', + mobile : '', + address : '', + + //省份选择 + areas : [], + areaSn : '', + areaIndex : 0, + + //市级选择 + cityList : [], + cityId : 0, + cityIndex : 0, + + //区域选择 + regiList : [], + regiId : 0, + regiIndex : 0, + + cityLayer : false + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { + this.setData({ + type : options.type + }) + if (options.type == 'Add') { + wx.setNavigationBarTitle({ + title: '添加收货地址' + }) + // 获取位置 + wx.getLocation({ + type: 'gcj02', + success: res=> { + this.setData({ + longitude : res.longitude, + latitude : res.latitude + }) + // 解析坐标 + getApp().qqmapsdk.reverseGeocoder({ + location: { + latitude : res.latitude, + longitude : res.longitude + }, + success: res=>{ + if(res.message == "query ok"){ + let addressInfo = res.result.address_component + let areaIndex = this.data.areas.findIndex(val => val.name == addressInfo.province) + this.setData({ + areaIndex : areaIndex + }) + this.getProvince() + }else{ + wx.showToast({ + title: res.message, + icon : 'none' + }) + } + } + }) + } + }) + this.getProvince() + } else if (options.type == 'Compile') { + wx.setNavigationBarTitle({ + title: '编辑收货地址' + }) + this.setData({ + addressId: options.id + }) + this.getUserAddress() + } + }, + + /** + * 获取收货人信息 + */ + getUserAddress(){ + wx.$api.address.edit(this.data.addressId).then(res=>{ + let areasValue = res.data.provinces.findIndex(val=> val.name == res.data.address.province_name), + cityValue = res.data.cities.findIndex(val=> val.name == res.data.address.city_name), + regiValue = res.data.districts.findIndex(val=> val.name == res.data.address.district_name) + this.setData({ + name : res.data.address.name, + mobile : res.data.address.mobile, + areas : res.data.provinces, + cityList : res.data.cities, + regiList : res.data.districts, + areaIndex : areasValue, + cityIndex : cityValue, + regiIndex : regiValue, + areaSn : res.data.address.province_id, + cityId : res.data.address.city_id, + regiId : res.data.address.district_id, + address : res.data.address.address, + defaultList : res.data.address, + isDefault : res.data.address.is_default + }) + }) + }, + + /** + * 获取省信息 + */ + getProvince() { + wx.$api.address.create().then(res=>{ + let areaArr = res.data.provinces, + areaIndex = this.data.areaIndex + this.citylist(areaArr[areaIndex].code) + this.setData({ + areaSn : areaArr[areaIndex].code, + areas : areaArr + }) + }) + }, + + /** + * 所在省份 + */ + areasChange(e) { + let area = this.data.areas, + index = e.detail.value, + atcode = area[index].code + if (index != this.data.areaIndex) { + this.setData({ + areaIndex : index, + areaSn : atcode + }) + + // 获取市级列表 + this.citylist(atcode) + } + }, + + /** + * 市级列表 + */ + citylist(code) { + wx.$api.address.children(code).then(res=>{ + let cityArr = res.data + this.regilist(cityArr[0].code) + this.setData({ + cityId : cityArr[0].code, + cityList : cityArr, + cityIndex : 0 + }) + }) + }, + + /** + * 市级下拉筛选 + */ + city(e) { + let city = this.data.cityList, + index = e.detail.value, + citycode = city[index].code + if (index != this.data.areaIndex) { + this.setData({ + cityIndex: index, + cityId : citycode + }) + + // 获取市级列表 + this.regilist(citycode) + } + }, + + + /** + * 区列表 + */ + regilist(areaCode) { + wx.$api.address.children(areaCode).then(res=>{ + this.setData({ + regiList : res.data, + regiId : res.data[0].code, + regiIndex : 0 + }) + }) + }, + + /** + * 区下拉筛选 + */ + regi(e) { + let newIndex = e.detail.value + this.setData({ + regiIndex : newIndex, + regiId : this.data.regiList[newIndex].code + }) + }, + + /** + * 保存信息 + */ + siteform(e) { + if(this.data.type == 'Compile') { + // 编辑地址 + wx.$api.address.keep(this.data.addressId, e.detail.value.name, e.detail.value.mobile, this.data.areaSn, this.data.cityId, this.data.regiId, e.detail.value.address).then(res=>{ + wx.navigateBack() + }) + } else { + // 创建地址 + wx.$api.address.add(e.detail.value.name, e.detail.value.mobile, this.data.areaSn, this.data.cityId, this.data.regiId, e.detail.value.address, this.data.defaultVal).then(res=>{ + wx.navigateBack() + }) + } + }, + + /** + * 设为默认地址 + */ + addressDefault(e) { + let val = e.detail.value + this.setData({ + defaultVal: val + }) + } +}) \ No newline at end of file diff --git a/pages/address_form/address_form.json b/pages/address_form/address_form.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/address_form/address_form.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/address_form/address_form.wxml b/pages/address_form/address_form.wxml new file mode 100644 index 0000000..065679a --- /dev/null +++ b/pages/address_form/address_form.wxml @@ -0,0 +1,71 @@ + +
+ + + + + + + + + + + + + {{areas[areaIndex].name}} + + + + + + + + + {{cityList[cityIndex].name}} + + + + + + + + + + {{regiList[regiIndex].name}} + + + + + + + + + + + 设置默认地址 + + + + + + + + + + + 取消 + 确定 + + + + {{item.name}} + + + {{item.name}} + + + {{item.name}} + + + +
\ No newline at end of file diff --git a/pages/address_form/address_form.wxss b/pages/address_form/address_form.wxss new file mode 100644 index 0000000..7b78406 --- /dev/null +++ b/pages/address_form/address_form.wxss @@ -0,0 +1,148 @@ +/** + * 亿时代 + */ + +.site-form { + background: white; + display: block; +} + +.site-btn { + padding: 20rpx 30rpx; +} + +.site-input { + padding: 0 30rpx 0 200rpx; + position: relative; + line-height: 90rpx; + min-height: 90rpx; +} + +.site-input label { + position: absolute; + left: 30rpx; + top: 0; +} + +.site-input input { + height: 90rpx; +} + +.site-input image { + width: 38rpx; + height: 38rpx; + position: absolute; + right: 20rpx; + top: calc(50% - 19rpx); +} + +.conneColor { + width: calc(100%- 100rpx); +} + +.site-input::before { + position: absolute; + bottom: 0; + left: 30rpx; + right: 0; + height: 1rpx; + content: ""; + background: #e4e6f2; +} + +.site-input:last-child::before { + display: none; +} + +.tui-picker-detail { + width: 33%; +} + +.site-btn button[size="mini"] { + width: 100%; + background: #f57e32; + height: 80rpx; + line-height: 80rpx; + font-size: 30rpx; + color: white; + padding: 0; +} + +/* pickerView */ + +.pickerView-back { + background: rgba(0, 0, 0, .3); + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + display: none; +} + +.pickerView-back.active { + display: block; +} + +.pickerView-layer { + position: fixed; + bottom: -571rpx; + left: 0; + width: 100%; + background: white; + transition: all .3s; +} + +.pickerView-layer.active { + bottom: 0; +} + +.pickerView-btn { + line-height: 90rpx; + font-size: 30rpx; + padding: 0 30rpx; + display: flex; + justify-content: space-between; +} + +.pickerView { + height: 480rpx; + padding: 0 10rpx; +} + +.pickerView-name { + line-height: 80rpx; + padding: 0 20rpx; + text-align: center; +} + +.pickerView-mask { + border-top: solid 1rpx #e4e6f2; +} + +.pickerView-indicator { + height: 80rpx; +} + +.pickerView-determine { + color: #f57e32; +} + +.pickerView-cancel { + color: #747788; +} + +.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/chooseTel/chooseTel.js b/pages/chooseTel/chooseTel.js new file mode 100644 index 0000000..8a25ceb --- /dev/null +++ b/pages/chooseTel/chooseTel.js @@ -0,0 +1,151 @@ + +/* + * 本时生活 + */ + +const app = getApp() + + +Page({ + + /** + * 页面的初始数据 + */ + data: { + wechatUserId: "", + loginCode : "", + userInfo : "", + isLogin : false, + iv : '', + enData : '', + loginTel : [] //用户手机号 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { + + // 登录方式-活动 + this.setData({ + way : options.way + }) + + if(options.type == "mobiles") { + wx.$api.user.mobiles().then(res=>{ + this.setData({ + loginTel : res.data + }) + }) + }else { + // 获取用户手机列表 + const logintel = wx.getStorageSync("users") + + this.setData({ + loginTel : logintel + }) + } + }, + + /** + * 生命周期函数--页面显示 + */ + onShow() { + wx.login({ + success: res => { + this.setData({ + loginCode: res.code + }) + } + }) + }, + + /** + * 绑定手机号码 + */ + mobile(e){ + if(e.detail.errMsg == "getPhoneNumber:ok"){ + this.setData({ + isLogin : true, + iv : e.detail.iv, + enData : e.detail.encryptedData + }) + this.binMobel() + }else{ + wx.showToast({ + title: '拒绝了手机号码授权', + icon : 'none' + }) + } + }, + + /** + * 绑定手机号码 + */ + binMobel(){ + let code = this.data.loginCode, + iv = this.data.iv, + mobile = this.data.enData + + wx.$api.enroll.bindmobile(code, iv, mobile).then(res=>{ + this.setData({ + isLogin: false + }) + + getApp().globalData.token = res.data.token + + // 更新全局存储器用户状态 + getApp().globalData.isUser = true + + + // 写入缓存 + wx.setStorage({ + key : 'token', + data : res.data.token + }) + + if(this.data.way == "activity") { + // 回到活动首页 + wx.reLaunch({ + url: '/pages/activityInfo/activityInfo' + }) + } else { + // 回到个人中心 + wx.switchTab({ + url: '/pages/user/user' + }) + } + }) + }, + + /** + * 点击账号登录 + */ + loginGo(e) { + let username = e.currentTarget.dataset.name, + wechatUser_id = app.globalData.wechatUser + + wx.$api.enroll.tel(wechatUser_id, username).then(res=>{ + app.globalData.token = res.data.token + app.globalData.isUser = true + + // 写入缓存 + wx.setStorage({ + key : 'token', + data : res.data.token + }) + + if(this.data.way == "activity") { + // 回到活动首页 + wx.reLaunch({ + url: '/pages/activityInfo/activityInfo' + }) + } else { + // 回到个人中心 + wx.switchTab({ + url: '/pages/user/user' + }) + } + }) + } +}) \ No newline at end of file diff --git a/pages/chooseTel/chooseTel.json b/pages/chooseTel/chooseTel.json new file mode 100644 index 0000000..42c8728 --- /dev/null +++ b/pages/chooseTel/chooseTel.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "绑定手机号" +} \ No newline at end of file diff --git a/pages/chooseTel/chooseTel.wxml b/pages/chooseTel/chooseTel.wxml new file mode 100644 index 0000000..012a561 --- /dev/null +++ b/pages/chooseTel/chooseTel.wxml @@ -0,0 +1,26 @@ + + + 切换手机号登录 + 轻触账户以登录 + + + + + + + + {{item.username}} + + 当前登录 + + + + + + + + 您还没有绑定手机号 + + + + \ No newline at end of file diff --git a/pages/chooseTel/chooseTel.wxss b/pages/chooseTel/chooseTel.wxss new file mode 100644 index 0000000..317a7bd --- /dev/null +++ b/pages/chooseTel/chooseTel.wxss @@ -0,0 +1,75 @@ +/* 切换手机号 */ +.chooseTel-title { + background: #fff; + padding: 40rpx 30rpx; + color: #999; +} + +.chooseTel-title text { + font-size: 36rpx; + font-weight: 600; + margin-bottom: 20rpx; + display: block; + color: #000; +} + +.chooseList { + display: flex; + background: #fff; + line-height: 100rpx; + padding: 20rpx; + box-sizing: border-box; +} + +.chooseList-left { + display: flex; +} + +.chooseList-img { + width: 90rpx; + height: 90rpx; + border-radius: 50%; + margin-right: 30rpx; +} + +.chooseList-btn { + font-size: 24rpx; + background: #00c12d; + border-radius: 30rpx; + height: 42rpx; + line-height: 42rpx; + color: #fff; + padding: 0 15rpx; + margin-top: 28rpx; + margin-left: 30rpx; +} + +.chooseAdd { + width: calc(100% - 60rpx); + margin: 60rpx auto 0; + background: #fff; + border-radius: 50rpx; + line-height: 80rpx; + height: 80rpx; + text-align: center; + box-shadow: 0 0 10rpx rgba(0, 0,0, .05); + padding: 0; +} + +.chooseTips { + background: #fff; + text-align: center; + padding: 30rpx 0 50rpx; +} + +.chooseTips image { + width: 400rpx; + height: 350rpx; + display: block; + margin: 0 auto 20rpx; +} + +.chooseTips text { + font-size: 34rpx; + color: #999; +} \ No newline at end of file diff --git a/pages/classify/classify.js b/pages/classify/classify.js new file mode 100644 index 0000000..c886244 --- /dev/null +++ b/pages/classify/classify.js @@ -0,0 +1,84 @@ +/* + * 本时生活 + */ + +const app = getApp() + +Page({ + + /** + * 页面的初始数据 + */ + data: { + noticeData : '', //公告 + infoData : '', //权益数据 + content : '', //内容简介 + noticeShow : '', //公告开关 + infoItems : [], //卡券专区 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { + this.indexNav(options.id) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow () { + + }, + + /** + * 卡权益分类 + */ + indexNav(id) { + wx.$api.index.classify(id).then(res=>{ + this.setData({ + noticeData : res.data.notice, + infoData : res.data.info, + infoItems : res.data.items, + content : res.data.info.content.replace(/\{ + if(!err.login){ + // 写入缓存 + wx.setStorage({ + key : 'token', + data : '' + }) + } + }) + }, + + /** + * 须知展开收起状态 + */ + noticeTap() { + this.setData({ + noticeShow : !this.data.noticeShow + }) + }, + + /** + * 处理未登录时的转跳 + */ + userNav(e){ + let id = e.currentTarget.dataset.id + wx.getStorage({ + key : 'token', + success:res=>{ + wx.navigateTo({ + url: '/pages/rights/rights?rightsId=' + id + }) + }, + fail: (err) => { + wx.navigateTo({ + url: "/pages/login/login" + }) + } + }) + } +}) \ No newline at end of file diff --git a/pages/classify/classify.json b/pages/classify/classify.json new file mode 100644 index 0000000..15b8460 --- /dev/null +++ b/pages/classify/classify.json @@ -0,0 +1,6 @@ +{ + "usingComponents": {}, + "navigationBarBackgroundColor": "#000000", + "navigationBarTextStyle": "white", + "navigationBarTitleText": "卡券权益" +} \ No newline at end of file diff --git a/pages/classify/classify.wxml b/pages/classify/classify.wxml new file mode 100644 index 0000000..4b41042 --- /dev/null +++ b/pages/classify/classify.wxml @@ -0,0 +1,70 @@ + + + + + + + {{infoData.two_title}} + + + {{infoData.three_title == null ? '' : infoData.three_title}} + + + {{infoData.two_description}} + + + + + + + + + + {{noticeData}} + + + + + + 卡券专区 + + + + {{item.label}} + + + + + + + {{item.title}} + {{item.subtitle}} + + + + + + + 抱歉, 暂无内容 + + + + + + + + + + + 购买前请仔细阅读内容介绍 + + + + + + + + + + \ No newline at end of file diff --git a/pages/classify/classify.wxss b/pages/classify/classify.wxss new file mode 100644 index 0000000..b23393b --- /dev/null +++ b/pages/classify/classify.wxss @@ -0,0 +1,319 @@ +/* 卡券权益 */ +.cont { + width: 100%; + overflow: hidden; +} + +.contBack { + position: relative; + width: 200%; + height: 400rpx; + left: -50%; + text-align: center; + background: #000000; + border-radius: 0 0 100% 100%; + overflow: hidden; +} + +.contBack::after { + width: 100%; + height: 30rpx; + position: absolute; + left: 0; + bottom: 0; + z-index: 2; + content: ''; + background-image: linear-gradient(transparent, rgba(0,0,0,.25)); +} + +.classBack { + position: absolute; + left: 30%; + right: 30%; + width: 40%; + top: 40rpx; +} + +.classCircle { + position: relative; +} + +.classCircle::after, +.contBack::before { + position: absolute; + border-radius: 50%; + content: ''; + z-index: 1; + background-color: rgba(255,255,255,.1); +} + +.classCircle::after { + left: 20%; + top: -20rpx; + width: 260rpx; + height: 260rpx; +} + +.contBack::before { + right: 20%; + top: 55%; + width: 300rpx; + height: 300rpx; +} + +.rightsCont { + position: absolute; + z-index: 3; + left: calc(30% - 2rpx); + right: calc(30% - 2rpx); + width: calc(40% + 4rpx); + top: 58rpx; +} + +.rightsCont-title { + color: #63320a; + font-size: 60rpx; + margin: 60rpx 0 20rpx; + padding: 0 20rpx; + box-sizing: border-box; +} + +.rightsCont-btn { + background-color: #f4dfcc; + width: 100%; + line-height: 70rpx; + font-size: 38rpx; + color: #2d2d2d; + padding: 0 20rpx; + box-sizing: border-box; +} + +.rightsCont-tips { + color: #fff; +} + +/* 须知 */ +.notice, +.indexNews, +.special { + border-radius: 10rpx; + padding: 25rpx 20rpx; + box-sizing: border-box; + background: #fff; + margin: 30rpx 20rpx; +} + +.indexColor { + background: #c4c4c4; +} + +.noticeTitle { + color: #747d86; + display: flex; + line-height: 46rpx; +} + +.noticeTitle-flex { + flex: 1; + display: flex; + font-size: 30rpx; + color: #000; +} + +.noticeTitle-img { + width: 46rpx; + height: 46rpx; + margin-right: 20rpx; +} + +.noticeText { + font-size: 26rpx; + height: 0; + overflow: hidden; +} + +.noticeText.active { + height: auto; +} + +.noticeText-top { + margin: 30rpx 0 10rpx; + font-weight: 600; +} + +.noticeText-cont { + line-height: 60rpx; +} + +.noticeTitle-row { + width: 32rpx; + height: 32rpx; + margin-top: 6rpx; + transform:rotate(-180deg); +} + +.noticeTitle-row.active { + transform: rotate(90deg); +} + + +/* 公告 */ +.indexNews { + display: flex; + font-size: 28rpx; + line-height: 46rpx; +} + +.indexNews image { + width: 42rpx; + height: 42rpx; + margin: 4rpx 20rpx 0 0; +} + +/* 卡券专区 */ +.special-list { + margin: 20rpx -10rpx 0; + flex-wrap: wrap; + display: flex; +} + +.special-label { + margin: 10rpx; + width: calc(50% - 20rpx); + height: 330rpx; + flex: 0 0 calc(50% - 20rpx); + border: 4rpx solid #fb9b00; + background-color: #ffe0b8; + border-radius: 10rpx; + text-align: center; + padding: 20rpx 0; + box-sizing: border-box; + position: relative; +} + +.special-label:last-child { + margin-bottom: 0; +} + +.special-rebate { + position: absolute; + top: -30rpx; + right: 10rpx; + background: #fe0002; + color: #fff; + border-radius: 30rpx; + line-height: 52rpx; + height: 52rpx; + font-size: 26rpx; + padding: 0 20rpx; + font-weight: 600; +} + +.welfareCont-top{ + white-space: nowrap; + flex-direction: row; + align-items: center; + justify-content: space-around; + width: 100%; + padding: 0 10rpx; + box-sizing: border-box; + margin: 10rpx 0; +} + +.welfareCont-list-img { + border: 2rpx solid #eccc69; + border-radius: 50%; + width: 100rpx; + height: 100rpx; + display: inline-block; + margin: 0 10rpx; + overflow: hidden; +} + +.welfareCont-list-img image { + width: 100%; + height: 100%; +} + + +.special-text { + padding: 0 15rpx; + box-sizing: border-box; + position: relative; + font-size: 26rpx; + border-top: 4rpx dashed #fb9b00; + margin-top: 20rpx; + padding-top: 20rpx; +} + +.special-name { + color: #6f4a2d; + font-weight: 600; + font-size: 28rpx; +} + +.special-tips { + background-color: #242424; + color: #fff; + border-radius: 10rpx; + padding: 4rpx 20rpx; + line-height: 46rpx; + height: 46rpx; + margin-top: 20rpx; + font-size: 24rpx; + display: inline-block; + overflow: hidden; + text-overflow: ellipsis; +} + +/* 滚动 */ +/*首页跑马灯效果*/ +@keyframes around { + from { + margin-left: 60rpx; + } + + to { + /* var接受传入的变量 */ + margin-left: var(--marqueeWidth--); + } +} + +.marquee_container { + width: calc(100% - 40rpx); + overflow: hidden; +} + +.marquee_container:hover { + /* 不起作用 */ + animation-play-state: paused; +} + +.marquee_text { + font-size: 28rpx; + display: inline-block; + white-space: nowrap; +} + +.marquee_text.active { + animation-name: around; + animation-duration: 10s; + /*过渡时间*/ + animation-iteration-count: infinite; + animation-timing-function: linear; +} + + +/* 权益提示 */ +.legalTips { + text-align: center; + font-size: 26rpx; + color: #999; +} + +.legalTips image { + width: 180rpx; + height: 180rpx; + display: block; + margin: 0 auto; +} \ No newline at end of file diff --git a/pages/coupon/coupon.js b/pages/coupon/coupon.js new file mode 100644 index 0000000..18a1096 --- /dev/null +++ b/pages/coupon/coupon.js @@ -0,0 +1,96 @@ +// pages/coupon/coupon.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + couponArr : '', + coupons : [], + count : '', + couponLabel : [ + { title : "未使用", used: 0 }, + { title : "已使用", used: 1 }, + { title : "已过期", used: 2 } + ], + stateType : '0', //卡券状态 + barHeight : getApp().globalData.statusBarHeight, + type : '' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { + this.setData({ + type : options.type + }) + }, + + /** + * tabs + */ + orderTab(e){ + if(this.data.stateType != e.currentTarget.dataset.state){ + this.setData({ + stateType: e.currentTarget.dataset.state + }) + + // 获取卡权益 + this.couponInfo() + } + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow () { + // 获取列表 + this.couponInfo(); + }, + + /** + * 卡券列表 + */ + couponInfo() { + wx.$api.user.coupon(this.data.stateType).then(res=>{ + this.setData({ + count : res.data.count, + coupons : res.data.list + }) + }) + }, + + /** + * 去使用卡券 + */ + // applyTap(e) { + // let id = e.currentTarget.dataset.id + // wx.navigateTo({ + // url: '/pages/couponDetails/couponDetails?id=' + id + // }) + // }, + + /** + * 查看优惠券分组 + */ + couponTap(e) { + let id = e.currentTarget.dataset.id, + status = e.currentTarget.dataset.status + wx.navigateTo({ + url: '/pages/couponArr/couponArr?id=' + id + '&status=' + status + }) + }, + + publicTap() { + if(this.data.type == 'couponPublic'){ + wx.switchTab({ + url: '/pages/user/user' + }) + }else { + wx.navigateBack({ + delta: 1 + }) + } + } +}) \ No newline at end of file diff --git a/pages/coupon/coupon.json b/pages/coupon/coupon.json new file mode 100644 index 0000000..0de239e --- /dev/null +++ b/pages/coupon/coupon.json @@ -0,0 +1,4 @@ +{ + "usingComponents" : {}, + "navigationStyle" : "custom" +} \ No newline at end of file diff --git a/pages/coupon/coupon.wxml b/pages/coupon/coupon.wxml new file mode 100644 index 0000000..ad60812 --- /dev/null +++ b/pages/coupon/coupon.wxml @@ -0,0 +1,71 @@ + + + 我的卡券 + + + + + + {{item.title}} + ({{count.init}}张) + ({{count.used}}张) + ({{count.pass}}张) + + + + + + + + + + + + + + + + + + + + + + {{item.name}} + {{item.startTime}} 至 {{item.endTime}} + 活动来源: {{item.activity_name}} + 使用时间:{{item.used_at}} + + + + 去使用 + + + + + + + + + + 查看全部{{item.count}}张卡券 + + + + + + + + + + 暂无优惠券 + \ No newline at end of file diff --git a/pages/coupon/coupon.wxss b/pages/coupon/coupon.wxss new file mode 100644 index 0000000..95086d2 --- /dev/null +++ b/pages/coupon/coupon.wxss @@ -0,0 +1,247 @@ +.publicHeader { + position: fixed; + top: 0; + left: 0; + z-index: 9; + width: 100%; + height: 90px; + display: flex; + line-height: 44px; + background: #fff; + text-align: center; +} + +.publicHeader-icon { + width: 20px; + height: 20px; + position: absolute; + left: 20rpx; + z-index: 9; + margin-top: 12px; +} + +.publicHeader-title { + width: 100%; + text-align: center; +} + +/* 优惠券 */ +.couponTab { + display: flex; + background: #fff; + position: fixed; + width: 100%; + left: 0; + height: 100rpx; + top: 90px; + z-index: 99; +} + +.couponTab-label { + flex: 3; + text-align: center; + position: relative; + padding: 10rpx 0 0; + font-size: 26rpx; +} + +.couponTab-label::after { + position: absolute; + content: ''; + left: calc(50% - 20rpx); + bottom: 0; + width: 40rpx; + background: transparent; + height: 6rpx; + border-radius: 30%; +} + +.couponTab-label.active { + color: #f57e32 +} + +.couponTab-label.active::after { + background: #f57e32 +} + +.couponTab-label view { + font-size: 24rpx; + margin-top: 6rpx; +} + + +/* 列表 */ +.coupon { + margin-top: 170px; +} + +.couponCont { + margin: 0 20rpx 20rpx; + width: calc(100% - 40rpx); + border-radius: 10rpx; + overflow: hidden; +} + +.couponList { + background: #fff; + width: 100%; + height: 160rpx; + position: relative; +} + +.couponList-left { + position: relative; + left: 0; + top: 0; + width: 160rpx; + height: 160rpx; +} + +.couponList-img { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + z-index: 1; +} + +.couponList-icon { + position: absolute; + left: calc(50% - 56rpx); + top: calc(50% - 50rpx); + z-index: 2; + width: 100rpx; + height: 100rpx; + background: #fff; + border-radius: 50%; + padding: 20rpx; + box-sizing: border-box; +} + +.couponList-icon image { + width: 100%; + height: 100%; +} + +.couponList-center { + position: absolute; + left: 180rpx; + top: 35rpx; + width: calc(100% - 330rpx); +} + +.couponList-center.active { + top: 15rpx; +} + +.couponList-title { + margin-bottom: 10rpx; + font-size: 28rpx; + font-weight: 600; +} + +.couponList-time, +.couponList-used { + font-size: 24rpx; + color: grey; +} + +.couponList-used { + margin-top: 14rpx; + color: grey; +} + +.couponList-right { + background: #ee8e44; + color: #fff; + border-radius: 30rpx; + width: 110rpx; + text-align: center; + height: 50rpx; + line-height: 50rpx; + position: absolute; + right: 20rpx; + top: 55rpx; + font-size: 24rpx; +} + +.couponList-right.active { + background: #dddddd; +} + +.couponMore { + font-size: 28rpx; + color: #686868; + position: relative; + height: 120rpx; +} + +.couponMore::after, +.couponMore::before { + position: absolute; + content: ''; + height: 20rpx; + border-radius: 10rpx; + background: #fff; + box-shadow: 0 0 20rpx rgba(0, 0, 0, .1); + z-index: 1; + height: 30rpx; +} + +.couponMore::after { + width: calc(100% - 40rpx); + top: 70rpx; + left: 20rpx; +} + +.couponMore::before { + width: calc(100% - 80rpx); + top: 90rpx; + left: 40rpx; +} + +.couponMore-text { + display: flex; + position: absolute; + left: 0; + top: 0; + width: 100%; + z-index: 99; + height: 80rpx; + border-radius: 0 0 10rpx 10rpx; + line-height: 80rpx; + padding: 0 30rpx; + box-sizing: border-box; + background: #fff; + box-shadow: 0 0 10rpx rgba(0, 0, 0, .1); +} + +.couponMore-title { + flex: 1; +} + +.couponMore-arrow { + width: 28rpx; + height: 28rpx; + margin-top: 26rpx; +} + +.couponCont.active .couponList-img, +.couponCont.active .couponList-icon { + -webkit-filter: grayscale(100%); + -moz-filter: grayscale(100%); + -ms-filter: grayscale(100%); + -o-filter: grayscale(100%); + filter: grayscale(100%); + filter: gray; +} + +.coupoTips { + position: absolute; + top: 22rpx; + right: 20rpx; + z-index: 99; + width: 120rpx; + height: 120rpx; +} \ No newline at end of file diff --git a/pages/couponArr/couponArr.js b/pages/couponArr/couponArr.js new file mode 100644 index 0000000..51856a7 --- /dev/null +++ b/pages/couponArr/couponArr.js @@ -0,0 +1,78 @@ +// pages/couponArr/couponArr.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + id : '', + status : '', + couponArr : '', //卡券组列表 + page : 1, //分页 + lodingStats : false //加载状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { + this.setData({ + id : options.id, + status : options.status + }) + + // 获取卡券组列表 + this.couponInfo(); + }, + + /** + * 卡券组列表 + */ + couponInfo(page) { + wx.$api.user.couponArr(this.data.id, this.data.status, page || '').then(res=>{ + let listArr = this.data.couponArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + + newData = listArr.concat(res.data.data) + this.setData({ + couponArr : newData, + page : res.data.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + }) + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取团购列表 + this.couponInfo(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + this.couponInfo(pageNumber) + } + } + + /** + * 去使用卡券 + */ + // applyTap(e) { + // let id = e.currentTarget.dataset.id + // wx.navigateTo({ + // url: '/pages/couponDetails/couponDetails?id=' + id + // }) + // } +}) \ No newline at end of file diff --git a/pages/couponArr/couponArr.json b/pages/couponArr/couponArr.json new file mode 100644 index 0000000..977aa6f --- /dev/null +++ b/pages/couponArr/couponArr.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "我的卡券" +} \ No newline at end of file diff --git a/pages/couponArr/couponArr.wxml b/pages/couponArr/couponArr.wxml new file mode 100644 index 0000000..55ac026 --- /dev/null +++ b/pages/couponArr/couponArr.wxml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + {{item.name}} + {{item.startTime}} 至 {{item.endTime}} + 活动来源: {{item.activity_name}} + 使用时间:{{item.used_at}} + + + + 去使用 + + + + + + + + + + 查看全部{{item.count}}张卡券 + + + + + + + 加载中... + + + 没有更多了~ + + + + + + + + 暂无优惠券 + \ No newline at end of file diff --git a/pages/couponArr/couponArr.wxss b/pages/couponArr/couponArr.wxss new file mode 100644 index 0000000..874341a --- /dev/null +++ b/pages/couponArr/couponArr.wxss @@ -0,0 +1,173 @@ + +/* 列表 */ +.coupon { + margin: 20rpx 0; +} + +.couponCont { + margin: 0 20rpx 20rpx; + width: calc(100% - 40rpx); + border-radius: 10rpx; + overflow: hidden; +} + +.couponList { + background: #fff; + width: 100%; + height: 160rpx; + position: relative; +} + +.couponList-left { + position: relative; + left: 0; + top: 0; + width: 160rpx; + height: 160rpx; +} + +.couponList-img { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + z-index: 1; +} + +.couponList-icon { + position: absolute; + left: calc(50% - 56rpx); + top: calc(50% - 50rpx); + z-index: 2; + width: 100rpx; + height: 100rpx; + background: #fff; + border-radius:50%; + padding: 20rpx; + box-sizing: border-box; +} + +.couponList-icon image { + width: 100%; + height: 100%; +} + +.couponList-center { + position: absolute; + left: 180rpx; + top: 35rpx; + width: calc(100% - 330rpx); +} + +.couponList-center.active { + top: 15rpx; +} + +.couponList-title { + margin-bottom: 10rpx; + font-size: 28rpx; + font-weight: 600; +} + +.couponList-time, .couponList-used { + font-size: 24rpx; + color: grey; +} + +.couponList-used { + margin-top: 14rpx; +} + +.couponList-right { + background: #ee8e44; + color: #fff; + border-radius: 30rpx; + width: 110rpx; + text-align: center; + height: 50rpx; + line-height: 50rpx; + position: absolute; + right: 20rpx; + top: 55rpx; + font-size: 24rpx; +} + +.couponList-right.active { + background: #dddddd; +} + +.couponMore { + font-size: 28rpx; + color: #686868; + position: relative; + height: 120rpx; +} + +.couponMore::after, .couponMore::before { + position: absolute; + content: ''; + height: 20rpx; + border-radius: 10rpx; + background: #fff; + box-shadow: 0 0 20rpx rgba(0, 0,0, .1); + z-index: 1; + height: 30rpx; +} + +.couponMore::after { + width: calc(100% - 40rpx); + top: 70rpx; + left: 20rpx; +} + +.couponMore::before { + width: calc(100% - 80rpx); + top: 90rpx; + left: 40rpx; + } + +.couponMore-text { + display: flex; + position: absolute; + left: 0; + top: 0; + width: 100%; + z-index: 99; + height: 80rpx; + border-radius: 0 0 10rpx 10rpx; + line-height: 80rpx; + padding: 0 30rpx; + box-sizing: border-box; + background: #fff; + box-shadow: 0 0 10rpx rgba(0, 0,0, .1); +} + +.couponMore-title { + flex: 1; +} + +.couponMore-arrow { + width: 28rpx; + height: 28rpx; + margin-top: 26rpx; +} + + +.couponCont.active .couponList-img, .couponCont.active .couponList-icon { + -webkit-filter: grayscale(100%); + -moz-filter: grayscale(100%); + -ms-filter: grayscale(100%); + -o-filter: grayscale(100%); + filter: grayscale(100%); + filter: gray; +} + +.coupoTips { + position: absolute; + top: 22rpx; + right: 20rpx; + z-index: 99; + width: 120rpx; + height: 120rpx; +} \ No newline at end of file diff --git a/pages/couponDetails/couponDetails.js b/pages/couponDetails/couponDetails.js new file mode 100644 index 0000000..c120611 --- /dev/null +++ b/pages/couponDetails/couponDetails.js @@ -0,0 +1,170 @@ +// pages/couponDetails/couponDetails.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + id : 0, //优惠券id + longitude : 0, //经度 + latitude : 0, //纬度 + details : '', //优惠券信息 + stores : [], //商家列表 + content : '', //内容介绍 + remark : '', //使用须知 + qrcode : '', //二维码 + barcode : '', //条形码 + }, + + /** + * 生命周期函数--监听页面加载 + */ + + onLoad (options) { + + // 优惠券id + this.setData({ + id :options.id + }) + + // 获取二维码 + this.detailsCode() + + // 获取条形码 + this.detailsBarcode() + + // 获取详情信息 + this.detailsInfo(); + + }, + + onShow(){ + // 检查定位是否为空 + if(this.data.latitude == 0 && this.data.longitude == 0){ + wx.getSetting({ + success: res=>{ + this.getCity() + } + }) + } + }, + + /** + * 获取城市信息 + */ + getCity(){ + wx.getLocation({ + type : 'wgs84', + success : res=> { + this.setData({ + longitude : res.longitude, + latitude : res.latitude + }) + + // 获取详情信息 + this.detailsInfo(); + } + }) + }, + + /** + * 二维码 + */ + detailsCode() { + let coupon_id = this.data.id + wx.$api.user.qrcode(coupon_id).then(res=>{ + this.setData({ + qrcode : res.data.qrcode + }) + }) + }, + + /** + * 条形码 + */ + detailsBarcode() { + let coupon_id = this.data.id + wx.$api.user.barcode(coupon_id).then(res=>{ + this.setData({ + barcode : res.data.barcode + }) + }) + }, + + /** + * 详情信息 + */ + detailsInfo() { + let coupon_id = this.data.id, + user_lng = this.data.longitude, + user_lat = this.data.latitude + wx.$api.user.couponinfo(coupon_id, user_lng, user_lat).then(res=>{ + let stores = res.data.stores + stores.map(res=>{ + let distance = res.distance + if(res.distance > 1000){ + distance = (distance / 1000) + "km" + }else{ + distance = distance + "m" + } + res.km = distance + }) + + this.setData({ + details : res.data.info, + stores : stores, + remark : res.data.info.right.remark.replace(/\{ + if(res.tapIndex==0){ + wx.makePhoneCall({ + phoneNumber: tel + }) + } + } + }) + }, + + /** + * 查看门店详情页 + */ + detailsTap(e) { + let store_id = e.currentTarget.dataset.id, + user_lng = this.data.longitude, + user_lat = this.data.latitude + + wx.navigateTo({ + url: '/pages/storeDetails/storeDetails?store_id=' + store_id + '&user_lng=' + user_lng + '&user_lat=' + user_lat, + }) + }, + + /** + * 加入微信卡包 + */ + join(e) { + let cardId = this.data.id + wx.$api.user.jssdk(cardId).then(res=>{ + let pay = JSON.parse(res.data) + wx.addCard({ + cardList : pay, + success : res => { + // 获取详情信息 + this.detailsInfo(); + },fail : res=> { + } + }) + }) + } +}) \ No newline at end of file diff --git a/pages/couponDetails/couponDetails.json b/pages/couponDetails/couponDetails.json new file mode 100644 index 0000000..57e13af --- /dev/null +++ b/pages/couponDetails/couponDetails.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "卡券详情" +} \ No newline at end of file diff --git a/pages/couponDetails/couponDetails.wxml b/pages/couponDetails/couponDetails.wxml new file mode 100644 index 0000000..6fc4948 --- /dev/null +++ b/pages/couponDetails/couponDetails.wxml @@ -0,0 +1,97 @@ + + + + + {{details.name}} + + + 有效期: {{details.startTime}} - {{details.endTime}} + + + 活动来源 : {{details.activity_name}} + + 劵码 + + + + {{details.code}} + + + + + 请出示以上券码给网点工作人员 + + + {{details.is_get == true ? '已加入微信卡包':'加入微信卡包'}} + + + + + + + + 适用门店 + + + 查看所有 + + + + + + 您尚未授权本时生活开启定位服务 + 不能看到附近的商家哦,点击下方按钮开启 + + + + + + + + + + {{item.title}} + + + {{item.address}} + {{item.km}} + + + + + + + + + + 暂无门店 + + + + + + + + + + 使用须知 + + + + + + + + + + + 内容介绍 + + + + + \ No newline at end of file diff --git a/pages/couponDetails/couponDetails.wxss b/pages/couponDetails/couponDetails.wxss new file mode 100644 index 0000000..82d7ede --- /dev/null +++ b/pages/couponDetails/couponDetails.wxss @@ -0,0 +1,215 @@ +/* 卡券详情 */ +.details { + background: #fff; + margin: 20rpx; + width: calc(100% - 40rpx); + border-radius: 20rpx; + padding: 30rpx; + box-sizing: border-box; + box-shadow: 0 0 20rpx rgba(0, 0,0, .1); +} + +.detailsTop { + border-bottom: 2rpx dashed #c8c8c8; + padding-bottom: 40rpx; +} + +.detailsTop-name { + font-size: 36rpx; + font-weight: 600; + margin-bottom: 20rpx; +} + +.detailsTop-time { + color: #7e7e7e; + font-size: 26rpx; +} + +.detailsCode { + text-align: center; + padding: 0 0 20rpx; + margin: 40rpx 0 30rpx; +} + +.detailsCode image { + width: 300rpx; + height: 300rpx; + margin-bottom: 30rpx; +} + +.detailsCode-text, .detailsStore-row { + color: #949494; + font-size: 28rpx; +} + +.detailsCode-text { + text-align: center; + font-size: 32rpx; + font-weight: 600; + color: #000; +} + +.detailsCode-text text { + color: #999; + font-weight: normal; + font-size: 26rpx; +} + +.detailsStore { + border-top: 2rpx #c8c8c8 solid; + padding-top: 40rpx; +} + +.detailsStore-top, .detailsStore-row { + display: flex; + line-height: 30rpx; + margin-bottom: 20rpx; +} + +.detailsStore-title { + flex: 1; + font-weight: 600; +} + +.detailsStore-row image { + width: 26rpx; + height: 26rpx; + margin: 3rpx 0 0 6rpx; +} + +.detailsStore-list { + position: relative; + margin-bottom: 40rpx; +} + +.detailsStore-list:last-child { + margin-bottom: 0; +} + +.detailsStore-logo { + width: 100rpx; + height: 100rpx; + border-radius: 10rpx; +} + +.detailsStore-cont { + position: absolute; + left: 130rpx; + top: 0; + width: calc(100% - 130rpx); + display: flex; +} + +.detailsStore-left { + width: calc(100% - 90rpx); + margin-right: 30rpx; +} + +.detailsStore-tel { + width: 60rpx; + height: 60rpx; + margin-top: 25rpx; +} + +.detailsStore-place { + font-size: 24rpx; + line-height: 40rpx; + color: #5a5a5a; + display: flex; +} + +.detailsStore-place text { + flex: 1; + display: inline-block; + font-size: 28rpx; + margin-right: 20rpx; +} + + +.detailsStore-name { + margin-bottom: 20rpx; +} + +.detailsText { + padding: 30rpx 30rpx 20rpx; + box-sizing: border-box; +} + +.detailsText-title { + font-size: 32rpx; + font-weight: 600; + margin-bottom: 20rpx; +} + +.detailsText-tips { + font-size: 26rpx; + line-height: 50rpx; + color: #555557; + padding-bottom: 20rpx; +} + +.detailsCode-join { + color: #ee8e44; + font-size: 24rpx; + border-radius: 50rpx; + border: 2rpx solid #ee8e44; + padding: 10rpx 20rpx; + display: inline-block; + margin-top: 30rpx; +} + +.detailsCode-join.active { + border: 2rpx solid #999; + color: #999; +} + +.source{ + margin: 30rpx 0; + font-size: 28rpx; +} + +.location { + background: white; + width: 100%; + text-align: center; + margin: 60rpx 0 0; +} + +.location text { + font-size: 28rpx; + display: block; + line-height: 46rpx; + color: #999; +} + +.location-btn[size="mini"] { + background-color: #ee8e44; + color: #fff; + font-size: 26rpx; + line-height: 66rpx; + margin-top: 30rpx; +} + +.location-img { + width: 150rpx; + height: 120rpx; + margin-bottom: 20rpx; +} + +.detailsBar { + text-align: center; + padding: 0 50rpx; + box-sizing: border-box; + margin-top: 60rpx; + margin-bottom: 40rpx; +} + + +.detailsBar image { + width: 100%; +} + +.detailsBar .detailsCode-text { + margin-bottom: 10px; + color: #000; +} \ No newline at end of file diff --git a/pages/frozen/frozen.js b/pages/frozen/frozen.js new file mode 100644 index 0000000..725a08e --- /dev/null +++ b/pages/frozen/frozen.js @@ -0,0 +1,40 @@ +/* + * 本时生活 + */ + +const app = getApp() + +Page({ + + /** + * 页面的初始数据 + */ + data: { + type : '', //类型 + frozenData : [], //数组列表 + blockeds : '', //待发放金额 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { + this.setData({ + type : options.type, + blockeds : options.blockeds + }) + // 获取冻结列表 + this.frozenInfo() + }, + + /** + * 冻结列表 + */ + frozenInfo() { + wx.$api.user.ungrants(this.data.type).then(res=>{ + this.setData({ + frozenData: res.data + }) + }) + } +}) \ No newline at end of file diff --git a/pages/frozen/frozen.json b/pages/frozen/frozen.json new file mode 100644 index 0000000..aa6068c --- /dev/null +++ b/pages/frozen/frozen.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "待发放" +} \ No newline at end of file diff --git a/pages/frozen/frozen.wxml b/pages/frozen/frozen.wxml new file mode 100644 index 0000000..25b4fb9 --- /dev/null +++ b/pages/frozen/frozen.wxml @@ -0,0 +1,28 @@ + + + + 待发放(额度) + {{blockeds}} + + 待发放期数详情 + 共 {{frozenData.length}} 期 + + + 分期 + + + 第{{item.num}}期 + 发放时间:{{item.start_at}} + + + +{{item.variable}} + 发放额度 + + + + + + + + 抱歉,目前暂无内容~ + \ No newline at end of file diff --git a/pages/frozen/frozen.wxss b/pages/frozen/frozen.wxss new file mode 100644 index 0000000..adcbeee --- /dev/null +++ b/pages/frozen/frozen.wxss @@ -0,0 +1,101 @@ +/* 待发放 */ +.frozenTop { + background: #3e3c37; + color: #e7e4d5; + margin: 20rpx; + padding: 40rpx; + box-sizing: border-box; + border-radius: 20rpx; + font-size: 34rpx; + position: relative; + overflow: hidden; +} + +.frozenTop-number { + font-size: 40rpx; + font-weight: 600; + margin-top: 30rpx; +} + +.frozenTop-tips { + position: absolute; + top: 0; + right: 0; + background: #030200; + color: #fff; + font-size: 28rpx; + padding: 12rpx 20rpx; + border-radius: 0 0 20rpx 20rpx; + display: flex; +} + +.frozenTop-tips image { + width: 30rpx; + height: 30rpx; + margin: 4rpx 10rpx 0 0; +} + +.frozenTop-btn { + position: absolute; + top: 110rpx; + right: 40rpx; + background: #dab684; + color: #fff; + font-size: 28rpx; + border-radius: 80rpx; + padding: 8rpx 30rpx; +} + +.frozenCont { + background-color: #fff; + margin: 30rpx 20rpx; + border-radius: 20rpx; + font-size: 36rpx; +} + +.frozenTitle { + padding: 20rpx; + box-sizing: border-box; + color: #9c9c9c; +} + +.frozenList { + padding: 20rpx; + display: flex; + font-size: 32rpx; +} + +.frozenList-left { + flex: 1; + line-height: 50rpx; +} + +.frozenList-number { + line-height: 50rpx; + text-align: center; +} + +.frozenList-name { + display: flex; +} + +.frozenList-name image { + width: 32rpx; + height: 32rpx; + margin: 10rpx 10rpx 0 0; +} + +.frozenList-time { + padding-left: 40rpx; +} + +.frozenList-variable, +.frozenList-time { + font-size: 26rpx; + color: #aaaaaa; +} + +.frozenList-yellow { + color: #317afa; + font-weight: 600; +} \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js new file mode 100644 index 0000000..e060074 --- /dev/null +++ b/pages/index/index.js @@ -0,0 +1,240 @@ + +/* + * 本时生活 + */ + +const app = getApp() + + +Page({ + + /** + * 页面的初始数据 + */ + data: { + swiperCurrent :0, + current :0, //轮播图当前的下标 + dots :true, + cityAll : '', + statusBarHeight : getApp().globalData.systInfo.statusBarHeight, + longitude : 0, //经度 + latitude : 0, //纬度 + adverts : [], //轮播图 + stateType : "silver", + cardArr : [], //权益数组 + activities : [], //周五福利 + isUser : false, //用户登录状态 + noticeData : '', //首页公告 + loading : true, //骨架屏加载 + address : { + city: "", //市 + area: "", //区 + city_code: "", //市编号 + area_code: "" //区编号 + } + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow () { + this.locaTion() + // 获取用户登录状态 + this.setData({ + isUser : getApp().globalData.isUser + }) + }, + + /** + * 获取位置 + */ + locaTion(){ + wx.getLocation({ + success: res => { + this.setData({ + latitude    : res.latitude, +                    longitude   : res.longitude +                }) + + }, + complete: () => { + // 获取卡权益 + this.indexInfo(); + } + }) + }, + + /** + * 卡权益 + */ + indexInfo() { + if(this.data.stateType == 'shaky') { + wx.$api.index.index(this.data.city, this.data.longitude, this.data.latitude).then(res=>{ + this.setData({ + adverts : res.data.adverts, + cardArr : res.data.rights, + activities : res.data.activities, + noticeData : res.data.notice, + loading : false, + address : { + city: res.data.location.city_name, + area: res.data.location.district_name || "", + city_code: res.data.location.city_id, + area_code: res.data.location.district_id || "" + } + }) + wx.stopPullDownRefresh() + }).catch(err=>{ + if(!err.login){ + // 写入缓存 + wx.setStorage({ + key : 'token', + data : '' + }) + } + }) + } else { + wx.$api.index.choice(this.data.stateType,this.data.city, this.data.longitude, this.data.latitude).then(res=>{ + this.setData({ + adverts : res.data.adverts, + cardArr : res.data.categorys, + noticeData : res.data.notice, + cityName : res.data.city_name, + loading : false, + address : { + city: res.data.location.city_name, + area: res.data.location.district_name || "", + city_code: res.data.location.city_id, + area_code: res.data.location.district_id || "" + } + }) + + wx.stopPullDownRefresh() + }).catch(err=>{ + if(!err.login){ + // 写入缓存 + wx.setStorage({ + key : 'token', + data : '' + }) + } + }) + } + }, + + + /** + * tabs + */ + orderTab(e){ + if(this.data.stateType != e.currentTarget.dataset.state){ + this.setData({ + stateType: e.currentTarget.dataset.state + }) + // 获取卡权益 + this.indexInfo() + + // 重置轮播图 + this.setData({ + current : 0, + swiperCurrent: 0 + }); + } + }, + + /** + * 处理未登录时的转跳 + */ + userNav(e){ + let id = e.currentTarget.dataset.id + wx.getStorage({ + key : 'token', + success:res=>{ + wx.navigateTo({ + url: '/pages/classify/classify?id=' + id + }) + }, + fail: (err) => { + wx.navigateTo({ + url: "/pages/login/login" + }) + } + }) + }, + + /** + * 点击图片放大 + */ + clickImg(e) { + if(e.currentTarget.dataset.img == "") return + let imgUrl = [e.currentTarget.dataset.img] + wx.previewImage({ + urls : imgUrl, //需要预览的图片http链接列表,注意是数组 + current : imgUrl[0] // 当前显示图片的http链接,默认是第一个 + }) + }, + + /** + * 周五福利抢购 + */ + Snapup(e) { + let canBuy = e.currentTarget.dataset.can, + canText = e.currentTarget.dataset.text, + canId = e.currentTarget.dataset.id + if(!canBuy) { + wx.showToast({ + title : canText, + icon : 'none', + duration: 2000 + }) + return + } + + // 跳转分类页 + wx.navigateTo({ + url: '/pages/welfare/welfare?id=' + canId + }) + }, + + /** + * 活动中心权益跳转详情 + */ + rightNav(e) { + let id = e.currentTarget.dataset.id + wx.getStorage({ + key : 'token', + success:res=>{ + wx.navigateTo({ + url: '/pages/rights/rights?id=' + id + }) + }, + fail: (err) => { + wx.navigateTo({ + url: "/pages/login/login" + }) + } + }) + }, + + /** + * 下拉刷新 + */ + onPullDownRefresh(){ + // 获取卡权益 + this.indexInfo(); + this.locaTion(); + }, + + /** + * 防止swiper控件卡死 + */ + swiperChange(e){ + if (this.data.current == 0 && this.data.swiperCurrent>1 ) {//卡死时,重置current为正确索引 + this.setData({ current: this.data.swiperCurrent }); + } + else {//正常轮转时,记录正确页码索引 + this.setData({ swiperCurrent: e.detail.current }); + } + + } +}) \ No newline at end of file diff --git a/pages/index/index.json b/pages/index/index.json new file mode 100644 index 0000000..2d21589 --- /dev/null +++ b/pages/index/index.json @@ -0,0 +1,10 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "", + "navigationBarBackgroundColor": "#000000", + "backgroundColor": "#f4f4f4", + "navigationBarTextStyle": "white", + "navigationStyle" : "custom", + "backgroundTextStyle" : "dark", + "enablePullDownRefresh" : true +} \ No newline at end of file diff --git a/pages/index/index.skeleton.wxml b/pages/index/index.skeleton.wxml new file mode 100644 index 0000000..f3b4dfc --- /dev/null +++ b/pages/index/index.skeleton.wxml @@ -0,0 +1,95 @@ + + \ No newline at end of file diff --git a/pages/index/index.skeleton.wxss b/pages/index/index.skeleton.wxss new file mode 100644 index 0000000..be722ac --- /dev/null +++ b/pages/index/index.skeleton.wxss @@ -0,0 +1,94 @@ +/* +此文件为开发者工具生成,生成时间: 2021/4/22 下午3:55:40 + +在 H:\工作项目\亿时代-本时生活-2021-04-13\本时生活\pages\index\index.wxss 中引入样式 +``` +@import "./index.skeleton.wxss"; +``` + +更多详细信息可以参考文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/skeleton.html +*/ +.sk-transparent { + color: transparent !important; + } +.sk-text-30-0000-789 { + background-image: linear-gradient(transparent 30.0000%, #EEEEEE 0%, #EEEEEE 70.0000%, transparent 0%) !important; + background-size: 100% 80.0000rpx; + position: relative !important; + } +.sk-text { + background-origin: content-box !important; + background-clip: content-box !important; + background-color: transparent !important; + color: transparent !important; + background-repeat: repeat-y !important; + } +.sk-text-32-2222-11 { + background-image: linear-gradient(transparent 32.2222%, #EEEEEE 0%, #EEEEEE 67.7778%, transparent 0%) !important; + background-size: 100% 90.0000rpx; + position: relative !important; + } +.sk-text-32-2222-270 { + background-image: linear-gradient(transparent 32.2222%, #EEEEEE 0%, #EEEEEE 67.7778%, transparent 0%) !important; + background-size: 100% 90.0000rpx; + position: relative !important; + } +.sk-text-14-2857-898 { + background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important; + background-size: 100% 39.2000rpx; + position: relative !important; + } +.sk-text-14-2857-980 { + background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important; + background-size: 100% 39.2000rpx; + position: relative !important; + } +.sk-text-14-2857-662 { + background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important; + background-size: 100% 39.2000rpx; + position: relative !important; + } +.sk-text-14-2857-553 { + background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important; + background-size: 100% 39.2000rpx; + position: relative !important; + } +.sk-text-13-6364-777 { + background-image: linear-gradient(transparent 13.6364%, #EEEEEE 0%, #EEEEEE 86.3636%, transparent 0%) !important; + background-size: 100% 44.0000rpx; + position: relative !important; + } +.sk-text-13-6364-28 { + background-image: linear-gradient(transparent 13.6364%, #EEEEEE 0%, #EEEEEE 86.3636%, transparent 0%) !important; + background-size: 100% 44.0000rpx; + position: relative !important; + } +.sk-text-22-7273-273 { + background-image: linear-gradient(transparent 22.7273%, #EEEEEE 0%, #EEEEEE 77.2727%, transparent 0%) !important; + background-size: 100% 44.0000rpx; + position: relative !important; + } +.sk-image { + background: #EFEFEF !important; + } +.sk-pseudo::before, .sk-pseudo::after { + background: #EFEFEF !important; + background-image: none !important; + color: transparent !important; + border-color: transparent !important; + } +.sk-pseudo-rect::before, .sk-pseudo-rect::after { + border-radius: 0 !important; + } +.sk-pseudo-circle::before, .sk-pseudo-circle::after { + border-radius: 50% !important; + } +.sk-container { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + overflow: hidden; + background-color: transparent; + } diff --git a/pages/index/index.wxml b/pages/index/index.wxml new file mode 100644 index 0000000..a951715 --- /dev/null +++ b/pages/index/index.wxml @@ -0,0 +1,142 @@ + +