From 69824dedeabf4032c6fc12e915ce4347952a2e6b Mon Sep 17 00:00:00 2001 From: zhangjing Date: Thu, 28 Sep 2023 14:35:28 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9C=AC=E6=97=B6=E7=94=9F=E6=B4=BBH5]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apis/interfaces/giftPack.js | 186 ++-- apis/interfaces/index.js | 147 +-- apis/interfaces/user.js | 794 +++++++------- apis/request.js | 268 ++--- main.js | 1 - manifest.json | 30 +- package-lock.json | 70 +- package.json | 8 + pages.json | 32 +- pages/auth/login.vue | 7 +- pages/business/business.vue | 273 +++++ pages/campus/buy.vue | 1344 ++++++++++++----------- pages/campus/campusPay.vue | 692 ++++++++++++ pages/campus/details.vue | 1061 ++++++++++--------- pages/campus/index.vue | 294 ++++-- pages/campus/myCoupon.vue | 1289 +++++++++++----------- pages/campus/password.vue | 150 +-- pages/campus/register.vue | 132 +-- pages/campus/setPassword.vue | 32 +- pages/campus/signin.vue | 156 +-- pages/cashier/index.vue | 1398 ++++++++++++------------ pages/giftPack/buy.vue | 1645 +++++++++++++++-------------- pages/giftPack/details.vue | 66 +- pages/giftPack/index.vue | 171 ++- pages/giftPack/list.vue | 484 +++++---- pages/giftPack/logs.vue | 498 +++++---- pages/giftPack/logsFrozen.vue | 341 ++++++ pages/giftPack/myCoupon.vue | 1114 +++++++++---------- pages/giftPack/password.vue | 2 +- pages/giftPack/register.vue | 6 +- pages/giftPack/setPassword.vue | 4 +- pages/giftPack/signin.vue | 13 +- pages/giftPack/superRed -备份.vue | 389 +++++++ pages/giftPack/superRed.vue | 392 +++++++ pages/giftPack/user.vue | 31 +- pages/oil/details.vue | 1180 ++++++++++----------- pages/packet/packet.vue | 710 ++++++------- pages/store/details.vue | 449 ++++---- static/icon/giftPack-hide.png | Bin 0 -> 1341 bytes static/icon/giftPack-show.png | Bin 0 -> 1493 bytes static/img/campusCoupon_img.png | Bin 299847 -> 297090 bytes static/img/campus_nologo.png | Bin 0 -> 42172 bytes static/img/draw_coupon_01.png | Bin 0 -> 4839 bytes static/img/giftPack-img06.png | Bin 2723 -> 3141 bytes static/img/giftPack-img10.png | Bin 0 -> 3458 bytes static/img/giftPackArrow.png | Bin 0 -> 1737 bytes static/img/superRed-img.png | Bin 0 -> 230838 bytes static/img/superRed.jpg | Bin 0 -> 66901 bytes 48 files changed, 9224 insertions(+), 6635 deletions(-) create mode 100644 package.json create mode 100644 pages/business/business.vue create mode 100644 pages/campus/campusPay.vue create mode 100644 pages/giftPack/logsFrozen.vue create mode 100644 pages/giftPack/superRed -备份.vue create mode 100644 pages/giftPack/superRed.vue create mode 100644 static/icon/giftPack-hide.png create mode 100644 static/icon/giftPack-show.png create mode 100644 static/img/campus_nologo.png create mode 100644 static/img/draw_coupon_01.png create mode 100644 static/img/giftPack-img10.png create mode 100644 static/img/giftPackArrow.png create mode 100644 static/img/superRed-img.png create mode 100644 static/img/superRed.jpg diff --git a/apis/interfaces/giftPack.js b/apis/interfaces/giftPack.js index be94cad..d5a78e9 100644 --- a/apis/interfaces/giftPack.js +++ b/apis/interfaces/giftPack.js @@ -1,78 +1,116 @@ /** * 手太欠 * 愿这世界都如故事里一样 美好而动人~ - */ -import request from '../request' - -// 月兑活动 - 首页 -const index = (data) => { - return request({ - url: 'months' - }) -} - -// 月兑活动 - 商品详情 -const details = (month_id) => { - return request({ - url : "months/" + month_id - }) -} - -// 月兑活动 - 确认订单 -const buy = (data) => { - return request({ - url : "months/buy", - data: data - }) -} - -// 月兑活动 - 提交订单 -const buySubmit = (data) => { - return request({ - url : "months/buy", - method : "POST", - data : data - }) -} - -// 月兑活动 - 优惠券列表 -const logs = (data) => { - return request({ - url : "account/logs", - data : data - }) -} - -// 月兑活动 - 账变列表 -const coupon = (data) => { - return request({ - url : "months/coupons", - data : data - }) -} - -// 月兑活动 - 兑换列表 -const monthsList = (category_id) => { - return request({ - url : "months/goods/" + category_id - }) -} - - -// 月兑活动 - 兑换列表 -const monthsChoose = (category_id) => { - return request({ - url : "months/category/" + category_id + "/choose" - }) -} - -export { - index, - details, - buy, - buySubmit, - coupon, - logs, - monthsList, - monthsChoose + */ +import request from '../request' + +// 月兑活动 - 首页 +const index = (data) => { + return request({ + url: 'months' + }) +} + +// 月兑活动 - 商品详情 +const details = (month_id) => { + return request({ + url : "months/" + month_id + }) +} + +// 月兑活动 - 确认订单 +const buy = (data) => { + return request({ + url : "months/buy", + data: data + }) +} + +// 月兑活动 - 提交订单 +const buySubmit = (data) => { + return request({ + url : "months/buy", + method : "POST", + data : data + }) +} + +// 月兑活动 - 优惠券列表 +const logs = (data) => { + return request({ + url : "account/logs", + data : data + }) +} + +// 月兑活动 - 账变列表 +const coupon = (data) => { + return request({ + url : "months/coupons", + data : data + }) +} + +// 月兑活动 - 兑换列表 +const monthsList = (category_id) => { + return request({ + url : "months/goods/" + category_id + }) +} + + +// 月兑活动 - 兑换列表 +const monthsChoose = (category_id) => { + return request({ + url : "months/category/" + category_id + "/choose" + }) +} + +// 月兑活动 - 领取红包 +const monthsPacket = (data) => { + return request({ + url : "months/red_packet", + data : data + }) +} + +// 月兑活动 - 可用商家列表 +const shopsUrl = (coupon_id, data) => { + return request({ + url : "washcar/" + coupon_id + "/shops", + data : data + }) +} + +// 入库用户微信信息 +const authInfo = (data) => { + return request({ + url : "auth/info", + method : "POST", + data : data + }) +} + + +// h5微信支付获取微信授权地址 +const getAuthUrl = (data) => { + return request({ + url : 'auth/get_auth_url', + data: data + }) +} + +export { + index, + details, + buy, + buySubmit, + coupon, + logs, + monthsList, + monthsChoose, + monthsPacket, + shopsUrl, + authInfo, + getAuthUrl } \ No newline at end of file diff --git a/apis/interfaces/index.js b/apis/interfaces/index.js index 3e20cd1..c441475 100644 --- a/apis/interfaces/index.js +++ b/apis/interfaces/index.js @@ -1,73 +1,84 @@ - + /** * 手太欠 * 愿这世界都如故事里一样 美好而动人~ - */ - -import request from '../request.js' - -// 活动权益内容 -const activity = (data) => { - return request({ - url: 'home', - data: data - }) + */ + +import request from '../request.js' + +// 活动权益内容 +const activity = (data) => { + return request({ + url: 'home', + data: data + }) } - -// 钻石+白金权益内容 -const index = (data) => { - return request({ - url: 'home/group', - data: data - }) -} - -// 周五福利日订阅 -const subscribe = (subscribe) => { - return request({ - url: 'wechat/' + subscribe + "/welfare_subscribe", - method: "POST" - }) -} - -// 所有城市-最新无字母 -const newCity = () => { - return request({ - url: 'ajax/all_right_citys' - }) -} - -// 市区选择-最新无字母 -const newidxCity = (data) => { - return request({ - url: 'ajax/all_right_children', - data: data - }) -} - -// h5掉起微信授权的前置获取相关的签名信息前置 -const subscribeUrl = (data) => { - return request({ - url: 'auth/jssdk', - data: data - }) -} - -const subscribeH5 = (subscribe, channel) => { - return request({ - url: "wechat/" + subscribe + "/welfare_subscribe", - method: "POST", - data: { - channel: 'h5' - } - }) -} -export { - activity, - index, - subscribe, - newCity, - newidxCity, - subscribeUrl, - subscribeH5 + +// 钻石+白金权益内容 +const index = (data) => { + return request({ + url: 'home/group', + data: data + }) +} + +// 周五福利日订阅 +const subscribe = (subscribe) => { + return request({ + url: 'wechat/' + subscribe + "/welfare_subscribe", + method: "POST" + }) +} + +// 所有城市-最新无字母 +const newCity = () => { + return request({ + url: 'ajax/all_right_citys' + }) +} + +// 市区选择-最新无字母 +const newidxCity = (data) => { + return request({ + url: 'ajax/all_right_children', + data: data + }) +} + +// h5掉起微信授权的前置获取相关的签名信息前置 +const subscribeUrl = (data) => { + return request({ + url: 'auth/jssdk', + data: data + }) +} + +const subscribeH5 = (subscribe, channel) => { + return request({ + url: "wechat/" + subscribe + "/welfare_subscribe", + method: "POST", + data: { + channel: 'h5' + } + }) +} + +// 营业厅列表 +const hallsIndex = (data) => { + return request({ + url: "halls", + data: data + }) +} + + +export { + activity, + index, + subscribe, + newCity, + newidxCity, + subscribeUrl, + subscribeH5, + hallsIndex } \ No newline at end of file diff --git a/apis/interfaces/user.js b/apis/interfaces/user.js index 7957c2b..229ad1b 100644 --- a/apis/interfaces/user.js +++ b/apis/interfaces/user.js @@ -1,419 +1,429 @@ - + /** * 手太欠 * 愿这世界都如故事里一样 美好而动人~ - */ - -import request from '../request.js' - -// 活动权益内容 -const index = () => { - return request({ - url: 'user' - }) -} - -// 卡券详情 -const couponinfo = (data) => { - return request({ - url: 'coupons/show', - data: data - }) -} - -// 卡券二维码 -const qrcode = (coupon_id) => { - return request({ - url: 'coupons/qrcode', - data: { - coupon_id - } - }) -} - -// 卡券条形码 -const barcode = (coupon_id) => { - return request({ - url: 'coupons/' + coupon_id + '/barcode' - }) -} - + */ + +import request from '../request.js' + +// 活动权益内容 +const index = () => { + return request({ + url: 'user' + }) +} + +// 卡券详情 +const couponinfo = (data) => { + return request({ + url: 'coupons/show', + data: data + }) +} + +// 卡券二维码 +const qrcode = (coupon_id) => { + return request({ + url: 'coupons/qrcode', + data: { + coupon_id + } + }) +} + +// 卡券条形码 +const barcode = (coupon_id) => { + return request({ + url: 'coupons/' + coupon_id + '/barcode' + }) +} + // 卡券列表 -const coupon = (status) => { - return request({ - url: 'coupons?status=' + status - }) -} +const coupon = (status) => { + return request({ + url: 'coupons?status=' + status + }) +} + +// 卡券分组 +const couponArr = (data) => { + return request({ + url: 'coupons/list', + data: data + }) +} + +// 积分账变记录 +const logs = (data) => { + return request({ + url: 'account/logs', + data: data + }) +} + +// 订单收益列表 +const profits = (data) => { + return request({ + url: 'data/profits', + data: data + }) +} -// 卡券分组 -const couponArr = (data) => { - return request({ - url: 'coupons/list', - data: data - }) +// 订单收益列表-下级明细 +const profitsNext = (data) => { + return request({ + url: 'data/profitlogs', + data: data + }) } - -// 积分账变记录 -const logs = (data) => { - return request({ - url: 'account/logs', - data: data - }) -} - -// 订单收益列表 -const profits = (data) => { - return request({ - url: 'data/profits', - data: data - }) -} - -// 订单收益列表-下级明细 -const profitsNext = (data) => { - return request({ - url: 'data/profitlogs', - data: data - }) -} - -// 积分卡激活 -const cards = (data) => { - return request({ - url: 'user/cards/activate', - method: "POST", - data: data - }) -} - + +// 积分卡激活 +const cards = (data) => { + return request({ + url: 'user/cards/activate', + method: "POST", + data: data + }) +} + // 冻结列表 -const ungrants = (type) => { - return request({ - url: 'account/newungrants', - data: { - type - } - }) -} - +const ungrants = (type) => { + return request({ + url: 'account/newungrants', + data: { + type + } + }) +} + +// 冻结列表-最新 +const ungrantsNew = (data) => { + return request({ + url: 'account/unaccountgrants', + data: data + }) +} + + // 洗车券-获取跳转地址 -const washcarCoupon = (coupon) => { - return request({ - url: 'washcar/' + coupon + "/info", - method: "POST" - }) -} - +const washcarCoupon = (coupon) => { + return request({ + url: 'washcar/' + coupon + "/info", + method: "POST" + }) +} + //权益商品订单列表 -const orders = (data) => { - return request({ - url: 'orders/index', - data: data - }) -} - -//权益订单列表 -const ordersCoupons = (data) => { - return request({ - url: 'orders/coupons', - data: data - }) -} - -//取消兑换订单 -const cancel = (orderid) => { - return request({ - url: 'orders/cancel?orderid=' + orderid, - method: "POST" - }) +const orders = (data) => { + return request({ + url: 'orders/index', + data: data + }) +} + +//权益订单列表 +const ordersCoupons = (data) => { + return request({ + url: 'orders/coupons', + data: data + }) +} + +//取消兑换订单 +const cancel = (orderid) => { + return request({ + url: 'orders/cancel?orderid=' + orderid, + method: "POST" + }) } // 福利商品订单列表 -const welfare = (data) => { - return request({ - url: 'welfares/orders', - data: data - }) -} - +const welfare = (data) => { + return request({ + url: 'welfares/orders', + data: data + }) +} + // 福利券订单列表 -const welfareCoupons = (data) => { - return request({ - url: 'welfares/coupons', - data: data - }) -} - +const welfareCoupons = (data) => { + return request({ + url: 'welfares/coupons', + data: data + }) +} + // 福利取消订单 -const welfaresCancel = (orderid) => { - return request({ - url: 'welfares/orders/cancel?orderid=' + orderid, - method: "POST" - }) +const welfaresCancel = (orderid) => { + return request({ + url: 'welfares/orders/cancel?orderid=' + orderid, + method: "POST" + }) +} + +//权益订单详情 +const show = (orderid) => { + return request({ + url: 'orders/show', + data: { + orderid + } + }) +} + +//周五福利订单详情 +const welfaresShow = (orderid) => { + return request({ + url: 'welfares/orders/show', + data: { + orderid + } + }) +} + +// 头像上传+昵称修改 +const upload = (data) => { + return request({ + url: 'user/setting/info', + method: "POST", + data: data + }) +} + +// 发送短信 +const send = (data) => { + return request({ + url: 'sms/send', + method: "POST", + data: data + }) +} + +// 设置支付密码 +const setPassword = (data) => { + return request({ + url: 'user/setting/set_password', + method: "POST", + data: data + }) } -//权益订单详情 -const show = (orderid) => { - return request({ - url: 'orders/show', - data: { - orderid - } - }) -} - -//周五福利订单详情 -const welfaresShow = (orderid) => { - return request({ - url: 'welfares/orders/show', - data: { - orderid - } - }) -} - -// 头像上传+昵称修改 -const upload = (data) => { - return request({ - url: 'user/setting/info', - method: "POST", - data: data - }) -} - -// 发送短信 -const send = (data) => { - return request({ - url: 'sms/send', - method: "POST", - data: data - }) -} - -// 设置支付密码 -const setPassword = (data) => { - return request({ - url: 'user/setting/set_password', - method: "POST", - data: data - }) -} - -// 修改支付密码 -const changePassword = (data) => { - return request({ - url: 'user/setting/change_password', - method: "POST", - data: data - }) -} - -// 重置支付密码 -const resetPassword = (data) => { - return request({ - url: 'user/setting/reset_password', - method: "POST", - data: data - }) -} - -//门店列表 -const stores = (data) => { - return request({ - url: 'coupons/new_stores', - method: "POST", - data: data - }) -} - -//门店详情 -const storesShow = (data) => { - return request({ - url: 'coupons/store/show', - data: data - }) -} - -//省市区 -const areas = (psn) => { - return request({ - url: 'areas/children?psn=' + psn - }) +// 修改支付密码 +const changePassword = (data) => { + return request({ + url: 'user/setting/change_password', + method: "POST", + data: data + }) } +// 重置支付密码 +const resetPassword = (data) => { + return request({ + url: 'user/setting/reset_password', + method: "POST", + data: data + }) +} + +//门店列表 +const stores = (data) => { + return request({ + url: 'coupons/new_stores', + method: "POST", + data: data + }) +} + +//门店详情 +const storesShow = (data) => { + return request({ + url: 'coupons/store/show', + data: data + }) +} + +//省市区 +const areas = (psn) => { + return request({ + url: 'areas/children?psn=' + psn + }) +} + // 2021-07-28新增 // 我的收益 -const myProfit = () => { - return request({ - url: 'data/index' - }) +const myProfit = () => { + return request({ + url: 'data/index' + }) } -// 我的收益-收益报表 -const myIncome = (month) => { - return request({ - url: 'data/income', - data:{ - month - } - }) +// 我的收益-收益报表 +const myIncome = (month) => { + return request({ + url: 'data/income', + data:{ + month + } + }) +} + +// 我的收益-收益报表 + 我的收益-我的团队 +const profitUrl = (url, data) => { + return request({ + url: url, + data: data + }) +} + +// 提现前置账户信息 +const withdraws = () => { + return request({ + url: 'withdraws/create' + }) +} + +// 提现记录列表 +const withdrawsList = (data) => { + return request({ + url: 'user/withdraws', + data: data + }) +} + +// 提现表单填写 +const withdrawsForm = (data) => { + return request({ + url: 'withdraws', + method: "POST", + data: data + }) +} + +// 权益详细列表 +const profitLogs = (data) => { + return request({ + url: 'data/logs', + data: data + }) +} + +// 转账获取积分账户分类 +const transfers = () => { + return request({ + url: 'user/transfers' + }) } -// 我的收益-收益报表 + 我的收益-我的团队 -const profitUrl = (url, data) => { - return request({ - url: url, - data: data - }) +// 转账提交表单 +const transfersForm = (data) => { + return request({ + url: 'user/transfers', + method: "POST", + data: data + }) } - -// 提现前置账户信息 -const withdraws = () => { - return request({ - url: 'withdraws/create' - }) -} - -// 提现记录列表 -const withdrawsList = (data) => { - return request({ - url: 'user/withdraws', - data: data - }) -} - -// 提现表单填写 -const withdrawsForm = (data) => { - return request({ - url: 'withdraws', - method: "POST", - data: data - }) -} - -// 权益详细列表 -const profitLogs = (data) => { - return request({ - url: 'data/logs', - data: data - }) -} - -// 转账获取积分账户分类 -const transfers = () => { - return request({ - url: 'user/transfers' - }) -} - -// 转账提交表单 -const transfersForm = (data) => { - return request({ - url: 'user/transfers', - method: "POST", - data: data - }) -} - -// 校验转账的手机号码 -const ajaxTel = (mobile) => { - return request({ - url: 'ajax/user', - data: { - mobile - } - }) -} - -// 产品分享 - 新增 -const productList = (page) => { - return request({ - url: 'shares/goods', - data: { - page - } - }) -} - -const productInfo = (right) => { - return request({ - url: 'shares/goods/' + right - }) -} - -const productPoster = (right) => { - return request({ - url: 'shares/goods/' + right + '/poster' - }) -} - -// 我的分享 -const myshare = (data) => { - return request({ - url: 'user/share', - data: data - }) -} - -// 产品分享二维码+储值分享二维码 -const publicCode = (data) => { - return request({ - url: 'user/share/goods', - data: data - }) -} - + +// 校验转账的手机号码 +const ajaxTel = (mobile) => { + return request({ + url: 'ajax/user', + data: { + mobile + } + }) +} + +// 产品分享 - 新增 +const productList = (page) => { + return request({ + url: 'shares/goods', + data: { + page + } + }) +} + +const productInfo = (right) => { + return request({ + url: 'shares/goods/' + right + }) +} + +const productPoster = (right) => { + return request({ + url: 'shares/goods/' + right + '/poster' + }) +} + +// 我的分享 +const myshare = (data) => { + return request({ + url: 'user/share', + data: data + }) +} + +// 产品分享二维码+储值分享二维码 +const publicCode = (data) => { + return request({ + url: 'user/share/goods', + data: data + }) +} + // 储值分享 -const storedList = () => { - return request({ - url: 'shares/recharges' - }) -} - - -export { - index, - couponinfo, - qrcode, - barcode, - coupon, - couponArr, - logs, - profits, - profitsNext, - cards, - ungrants, - washcarCoupon, - orders, - ordersCoupons, - cancel, - welfare, - welfareCoupons, - welfaresCancel, - show, - welfaresShow, - upload, - send, - setPassword, - changePassword, - resetPassword, - stores, - storesShow, - areas, - myProfit, - myIncome, - profitUrl, - withdraws, - withdrawsList, - withdrawsForm, - profitLogs, - transfers, - transfersForm, - ajaxTel, - productList, - productInfo, - productPoster, - myshare, - publicCode, - storedList +const storedList = () => { + return request({ + url: 'shares/recharges' + }) +} + + +export { + index, + couponinfo, + qrcode, + barcode, + coupon, + couponArr, + logs, + profits, + profitsNext, + cards, + ungrants, + ungrantsNew, + washcarCoupon, + orders, + ordersCoupons, + cancel, + welfare, + welfareCoupons, + welfaresCancel, + show, + welfaresShow, + upload, + send, + setPassword, + changePassword, + resetPassword, + stores, + storesShow, + areas, + myProfit, + myIncome, + profitUrl, + withdraws, + withdrawsList, + withdrawsForm, + profitLogs, + transfers, + transfersForm, + ajaxTel, + productList, + productInfo, + productPoster, + myshare, + publicCode, + storedList } \ No newline at end of file diff --git a/apis/request.js b/apis/request.js index 67e8111..459069a 100644 --- a/apis/request.js +++ b/apis/request.js @@ -1,140 +1,140 @@ - + /** * 手太欠 * 愿这世界都如故事里一样 美好而动人~ - */ - + */ + import store from '@/store' - -// 基础配置 + +// 基础配置 // https://lifetest.ysd-bs.com //测试地址 -// https://card.ysd-bs.com -const config = { - // apiUrl : 'https://lifetest.ysd-bs.com/api/', - apiUrl : 'https://card.ysd-bs.com/api/', - timeout: 60000 -} - -let loginHintState = false - -// 网络请求 -const request = (parameter) => { - // 检查url配置 - if(parameter.url === 'undefined' || parameter.url === '') { - uni.showToast({ - title: '请求地址不能为空', - icon : 'none' - }) - return - } - - // 注入header - config.header = { - 'Accept': 'application/json', - 'Authorization': store.getters.getToken || '' - } - // 请求实例 - return new Promise((resolve, reject) => { - uni.request({ - url : config.apiUrl + parameter.url, - timeout : config.timeout, - header : config.header || {}, - data : parameter.data || {}, - method : parameter.method || 'GET', - success: res => { - if (res.header.Authorization) { - updateToken('token', res.header.Authorization) - } - if (res.statusCode === 200) { - const resolveData = res.data - if(resolveData.status_code === 200) { - resolve(resolveData.data) - return - } - if (resolveData.status_code === 401) { - loginHint() - return - } - reject(resolveData) - return - } - errToast(res.statusCode) - } - }) - }) -} - -// 处理一些http请求错误提示 -const errToast = (code) => { - switch (code){ - case 404: - uni,uni.showToast({ - title: code + '接口不存在,请联系系统管理员', - icon : none - }) - break; - case 405: - uni.showToast({ - title: code + '请检查接口请求方式错误', - icon :'none' - }) - break; - case 500: - uni.showToast({ - title: code + '服务端错误,请检查服务器信息', - icon : 'none' - }) - break; - } -} - -// 更新token -const updateToken = (token) => { - store.commit('setToken', token) -} - -// 处理登录提示 -const loginHint = () => { - if(loginHintState) return - if(!loginHintState) loginHintState = true - updateToken('') - uni.showModal({ - title:'登录提示', - content:'您的登录信息已过期,请重新登录', - confirmColor:'#33f800', - showCancel:false, - success: res => { - console.log(getApp().globalData.envType) - loginHintState = false - if(res.confirm){ - if(getApp().globalData.envType == 'campusEnv') { - uni.reLaunch({ - url: '/pages/campus/signin' - }) - } else if(getApp().globalData.envType == 'oilEnv') { - uni.reLaunch({ - url: '/pages/oil/signin' - }) - }else if(getApp().globalData.envType == 'unicomEnv') { - uni.reLaunch({ - url: '/pages/unicom/signin' - }) - }else if(getApp().globalData.envType == 'drawEnv') { - uni.reLaunch({ - url: '/pages/draw/signin' - }) - }else if(getApp().globalData.envType == 'giftPEnv') { - uni.reLaunch({ - url: '/pages/giftPack/signin' - }) - }else { - uni.reLaunch({ - url: '/pages/auth/login' - }) - } - } - } - }) -} - +// https://card.ysd-bs.com +const config = { + // apiUrl : 'https://lifetest.ysd-bs.com/api/', //测试地址 + apiUrl : 'https://card.ysd-bs.com/api/', //正式地址 + timeout: 60000 +} + +let loginHintState = false + +// 网络请求 +const request = (parameter) => { + // 检查url配置 + if(parameter.url === 'undefined' || parameter.url === '') { + uni.showToast({ + title: '请求地址不能为空', + icon : 'none' + }) + return + } + + // 注入header + config.header = { + 'Accept': 'application/json', + 'Authorization': store.getters.getToken || '' + } + // 请求实例 + return new Promise((resolve, reject) => { + uni.request({ + url : config.apiUrl + parameter.url, + timeout : config.timeout, + header : config.header || {}, + data : parameter.data || {}, + method : parameter.method || 'GET', + success: res => { + if (res.header.Authorization) { + updateToken('token', res.header.Authorization) + } + if (res.statusCode === 200) { + const resolveData = res.data + if(resolveData.status_code === 200) { + resolve(resolveData.data) + return + } + if (resolveData.status_code === 401) { + loginHint() + return + } + reject(resolveData) + return + } + errToast(res.statusCode) + } + }) + }) +} + +// 处理一些http请求错误提示 +const errToast = (code) => { + switch (code){ + case 404: + uni,uni.showToast({ + title: code + '接口不存在,请联系系统管理员', + icon : none + }) + break; + case 405: + uni.showToast({ + title: code + '请检查接口请求方式错误', + icon :'none' + }) + break; + case 500: + uni.showToast({ + title: code + '服务端错误,请检查服务器信息', + icon : 'none' + }) + break; + } +} + +// 更新token +const updateToken = (token) => { + store.commit('setToken', token) +} + +// 处理登录提示 +const loginHint = () => { + if(loginHintState) return + if(!loginHintState) loginHintState = true + updateToken('') + uni.showModal({ + title:'登录提示', + content:'您的登录信息已过期,请重新登录', + confirmColor:'#33f800', + showCancel:false, + success: res => { + console.log(getApp().globalData.envType) + loginHintState = false + if(res.confirm){ + if(getApp().globalData.envType == 'campusEnv') { + uni.reLaunch({ + url: '/pages/campus/signin' + }) + } else if(getApp().globalData.envType == 'oilEnv') { + uni.reLaunch({ + url: '/pages/oil/signin' + }) + }else if(getApp().globalData.envType == 'unicomEnv') { + uni.reLaunch({ + url: '/pages/unicom/signin' + }) + }else if(getApp().globalData.envType == 'drawEnv') { + uni.reLaunch({ + url: '/pages/draw/signin' + }) + }else if(getApp().globalData.envType == 'giftPEnv') { + uni.reLaunch({ + url: '/pages/giftPack/signin' + }) + }else { + uni.reLaunch({ + url: '/pages/auth/login' + }) + } + } + } + }) +} + export default request \ No newline at end of file diff --git a/main.js b/main.js index a1160f5..32fbb50 100644 --- a/main.js +++ b/main.js @@ -14,7 +14,6 @@ Vue.prototype.$wx = require('jweixin-module') App.mpType = 'app' - // jsonp Vue.use(VueJsonp) diff --git a/manifest.json b/manifest.json index 3214008..3f68868 100644 --- a/manifest.json +++ b/manifest.json @@ -18,27 +18,29 @@ }, /* 模块配置 */ "modules" : { - "Payment" : {} + "Payment" : {}, + "Maps" : {} }, /* 应用发布信息 */ "distribute" : { /* android打包配置 */ "android" : { "permissions" : [ - "", - "", - "", - "", - "", + "", "", "", + "", "", - "", - "", + "", "", - "", "", - "", + "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -53,7 +55,13 @@ "UniversalLinks" : "" } }, - "ad" : {} + "ad" : {}, + "maps" : { + "amap" : { + "appkey_ios" : "73f1992898e143896d4529a8ffead6c3", + "appkey_android" : "73f1992898e143896d4529a8ffead6c3" + } + } } } }, diff --git a/package-lock.json b/package-lock.json index 301361e..9668889 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,69 +1,35 @@ { + "name": "ysdH5", + "lockfileVersion": 3, "requires": true, - "lockfileVersion": 1, - "dependencies": { - "encoding": { - "version": "0.1.13", - "resolved": "https://registry.npmmirror.com/encoding/-/encoding-0.1.13.tgz", - "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", - "requires": { - "iconv-lite": "^0.6.2" + "packages": { + "": { + "dependencies": { + "@vuemap/amap-jsapi-loader": "^1.0.3", + "jweixin-module": "^1.6.0", + "vue-jsonp": "^2.0.0", + "weixin-js-sdk": "^1.6.0" } }, - "iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "requires": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - } + "node_modules/@vuemap/amap-jsapi-loader": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/@vuemap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.3.tgz", + "integrity": "sha512-GdRWm7IAto18TJLySjm8JehNPlvYW8cNaqqnb1CQHvpr7k3zkGdvCrv+7H/Op1HaLMCt4LQsUjEAkiAqUfqZ7A==" }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmmirror.com/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==" - }, - "jweixin-module": { + "node_modules/jweixin-module": { "version": "1.6.0", - "resolved": "https://registry.npmjs.org/jweixin-module/-/jweixin-module-1.6.0.tgz", + "resolved": "https://registry.npmmirror.com/jweixin-module/-/jweixin-module-1.6.0.tgz", "integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w==" }, - "node-fetch": { - "version": "1.7.3", - "resolved": "https://registry.npmmirror.com/node-fetch/-/node-fetch-1.7.3.tgz", - "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", - "requires": { - "encoding": "^0.1.11", - "is-stream": "^1.0.1" - } - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmmirror.com/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "vue-jsonp": { + "node_modules/vue-jsonp": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/vue-jsonp/-/vue-jsonp-2.0.0.tgz", + "resolved": "https://registry.npmmirror.com/vue-jsonp/-/vue-jsonp-2.0.0.tgz", "integrity": "sha512-Mzd9GNeuKP5hHFDWZNMWOsCuMILSkA6jo2l4A02wheFz3qqBzH7aSEFTey1BRCZCLizlaf1EqJ5YUtF392KspA==" }, - "weixin-js-sdk": { + "node_modules/weixin-js-sdk": { "version": "1.6.0", "resolved": "https://registry.npmmirror.com/weixin-js-sdk/-/weixin-js-sdk-1.6.0.tgz", "integrity": "sha512-3IYQH7aalJGFJrwdT3epvTdR1MboMiH7vIZ5BRL2eYOJ12BNah7csoMkmSZzkq1+l92sSq29XdTCVjCJoK2sBQ==" - }, - "wxjssdk": { - "version": "1.0.1", - "resolved": "https://registry.npmmirror.com/wxjssdk/-/wxjssdk-1.0.1.tgz", - "integrity": "sha512-tY69YisKIiG6jT0cnTIwTvK4I6ivF8iWXyq5tmgVULiyKPRAWRDEIwhWUdHi7NljN9PQeLOZudUaiIq4gGfefA==", - "requires": { - "node-fetch": "^1.6.3" - } - }, - "wxjssdk-copy": { - "version": "1.4.1", - "resolved": "https://registry.npmmirror.com/wxjssdk-copy/-/wxjssdk-copy-1.4.1.tgz", - "integrity": "sha512-wTLfNrT7vIzsO4/YdalRCvErq/wD7pST1TOvWnOf00LvGHwqPcrm4ka3pYP0sI6sXDgfJh4HbjIcPgQTb20Gcg==" } } } diff --git a/package.json b/package.json new file mode 100644 index 0000000..4868702 --- /dev/null +++ b/package.json @@ -0,0 +1,8 @@ +{ + "dependencies": { + "@vuemap/amap-jsapi-loader": "^1.0.3", + "jweixin-module": "^1.6.0", + "vue-jsonp": "^2.0.0", + "weixin-js-sdk": "^1.6.0" + } +} diff --git a/pages.json b/pages.json index 9bf862a..3a03bd8 100644 --- a/pages.json +++ b/pages.json @@ -10,7 +10,7 @@ },{ "path": "pages/giftPack/index", "style": { - "navigationBarTitleText": "超级红包活动", + "navigationBarTitleText": "联通合约送全额消费金", "navigationStyle": "custom", "enablePullDownRefresh": false } @@ -64,10 +64,22 @@ "navigationBarTitleText": "重置密码", "enablePullDownRefresh": false } + },{ + "path" : "pages/giftPack/superRed", + "style" : { + "navigationBarTitleText": "领取消费金", + "enablePullDownRefresh": false + } + },{ + "path" : "pages/giftPack/logsFrozen", + "style" : { + "navigationBarTitleText": "待发放", + "enablePullDownRefresh": false + } },{ "path" : "pages/giftPack/logs", "style" : { - "navigationBarTitleText": "积分记录", + "navigationBarTitleText": "余额明细记录", "enablePullDownRefresh": false } },{ @@ -417,7 +429,7 @@ },{ "path": "pages/campus/index", "style": { - "navigationBarTitleText": "校园迎新活动", + "navigationBarTitleText": "消费金兑换活动", "navigationStyle": "custom", "enablePullDownRefresh": false } @@ -445,7 +457,7 @@ },{ "path": "pages/campus/signin", "style": { - "navigationBarTitleText": "校园迎新活动 登录", + "navigationBarTitleText": "消费金兑换活动登录", "navigationStyle": "custom", "enablePullDownRefresh": false } @@ -488,6 +500,12 @@ "navigationBarTitleText": "重置密码", "enablePullDownRefresh": false } + },{ + "path" : "pages/campus/campusPay", + "style" : { + "navigationBarTitleText": "收银台", + "enablePullDownRefresh": false + } },{ "path" : "pages/userGoods/index", "style" : { @@ -710,6 +728,12 @@ "navigationBarTitleText": "兑换成功", "enablePullDownRefresh": false } + },{ + "path" : "pages/business/business", + "style" : { + "navigationBarTitleText": "附近营业厅", + "enablePullDownRefresh": false + } } ], "tabBar": { diff --git a/pages/auth/login.vue b/pages/auth/login.vue index 084af26..78d716d 100644 --- a/pages/auth/login.vue +++ b/pages/auth/login.vue @@ -106,7 +106,12 @@ _this.disabled = true } }, 1000) - }).catch(err=>{}) + }).catch(err => { + uni.showToast({ + icon: 'none', + title: err.message + }) + }) } }, diff --git a/pages/business/business.vue b/pages/business/business.vue new file mode 100644 index 0000000..4c2676d --- /dev/null +++ b/pages/business/business.vue @@ -0,0 +1,273 @@ + + + + + diff --git a/pages/campus/buy.vue b/pages/campus/buy.vue index 4b45622..66fa2ce 100644 --- a/pages/campus/buy.vue +++ b/pages/campus/buy.vue @@ -1,680 +1,678 @@ -