diff --git a/api/index.js b/api/index.js index 1c002a3..9a23d9e 100644 --- a/api/index.js +++ b/api/index.js @@ -24,6 +24,15 @@ import site from "./interfaces/site" // 个人中心 import user from "./interfaces/user" +// 支付收银台 +import pay from "./interfaces/pay" + +// 身份认证 +import idcard from "./interfaces/idcard" + +// 身份认证 +import withdraw from "./interfaces/withdraw" + export default { auth, bank, @@ -31,5 +40,8 @@ export default { mall, order, site, - user + user, + pay, + idcard, + withdraw } \ No newline at end of file diff --git a/api/interfaces/auth.js b/api/interfaces/auth.js index bf93ad1..cc40c2b 100644 --- a/api/interfaces/auth.js +++ b/api/interfaces/auth.js @@ -4,29 +4,37 @@ */ import { req } from "../request" -//登录 +// 登录 const Login = data => req({ url: "user/auth/login", method: "POST", data: data }) -//注册 +// 注册 const register = data => req({ url: "user/auth/register", method: "POST", data: data }) -//获取验证码 +// 获取验证码 const getSms = data => req({ url: "user/auth/verify", method: "POST", data: data }) +// 找回密码 +const resetPassword = data => req({ + url : "user/auth/reset_password", + method : "POST", + data +}) + export default ({ Login, register, - getSms + getSms, + resetPassword }) \ No newline at end of file diff --git a/api/interfaces/idcard.js b/api/interfaces/idcard.js new file mode 100644 index 0000000..31b1925 --- /dev/null +++ b/api/interfaces/idcard.js @@ -0,0 +1,45 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ +*/ + +import { req, upload } from "../request" + +// 上传身份证 +const updIdcard = (path, data) => upload({ + key : "upload", + url : "user/certification/upload", + path, + data +}) + +// 提交身份信息 +const ocr = data => req({ + url : "user/certification", + data, + method : "POST" +}) + +// 获取认证信息 +const getInfo = () => req({ + url : "user/certification", +}) + +// 获取认证地址 +const signUrl = data => req({ + url : "user/certification/go_real", + data +}) + +// 获取签约地址 +const pactUrl = () => req({ + url : "user/certification/go_contract" +}) + +export default ({ + updIdcard, + ocr, + getInfo, + signUrl, + pactUrl +}) \ No newline at end of file diff --git a/api/interfaces/mall.js b/api/interfaces/mall.js index 87392be..86275bb 100644 --- a/api/interfaces/mall.js +++ b/api/interfaces/mall.js @@ -10,6 +10,12 @@ const Banner = () => req({ url: "mall/banners" }) +// 身份产品包 + +const idpackage = () => req({ + url: "new/index" +}) + //商品分类 const Categorie = data => req({ url: "mall/categories", @@ -52,6 +58,7 @@ const articlesSee = (article_id) => req({ export default ({ Banner, + idpackage, Categorie, Goods, goodsSee, diff --git a/api/interfaces/pay.js b/api/interfaces/pay.js new file mode 100644 index 0000000..5d8a071 --- /dev/null +++ b/api/interfaces/pay.js @@ -0,0 +1,26 @@ + +import { req } from "../request" + +// 订单信息 +const info = data => req({ + url : "payments/cashier_desk", + data: data +}) + +// 获取支付信息 +const wechatPay = data => req({ + url: "payments/cashier_desk/wechat", + data +}) + +// 查询支付结果 +const payState = trade_id => req({ + url: "payments/cashier_desk/show", + data: { trade_id } +}) + +export default ({ + info, + wechatPay, + payState +}) diff --git a/api/interfaces/user.js b/api/interfaces/user.js index 16e46c7..b6f2608 100644 --- a/api/interfaces/user.js +++ b/api/interfaces/user.js @@ -22,8 +22,9 @@ const setting = (key, data) => req({ }) //我的余额首页 -const account = () => req({ - url: "user/account/index" +const account = data => req({ + url: "user/account/index", + data }) // 小程序码 diff --git a/api/interfaces/withdraw.js b/api/interfaces/withdraw.js new file mode 100644 index 0000000..428cf4f --- /dev/null +++ b/api/interfaces/withdraw.js @@ -0,0 +1,23 @@ +/* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ +*/ + +import { req } from "../request" + +// 账户提现前置 +const create = () => req({ + url: "withdraws/index/create", +}) + +// 提现 +const withdraws = data => req({ + url : 'withdraws/index', + method : 'POST', + data +}) + +export default ({ + create, + withdraws +}) \ No newline at end of file diff --git a/api/request.js b/api/request.js index aec6fc9..5d7bbfa 100644 --- a/api/request.js +++ b/api/request.js @@ -3,8 +3,8 @@ * 愿这世界都如故事里一样 美好而动人~ */ -import {errInfo} from './err' -import {updToken} from './updateToken' +import { errInfo } from './err' +import { updToken } from './updateToken' // 请求方式配置 // //正式地址 diff --git a/app.js b/app.js index aca5e80..dc27d8a 100644 --- a/app.js +++ b/app.js @@ -48,6 +48,7 @@ App({ }, globalData: { isUser : false, - barHeight : '' + barHeight : '', + invite : '' } }) \ No newline at end of file diff --git a/app.json b/app.json index 8ac9655..c5eaef4 100644 --- a/app.json +++ b/app.json @@ -24,7 +24,15 @@ "pages/user/team/index", "pages/user/code/code", "pages/bankCard/index", - "pages/bankCard/bankAdd/bankAdd" + "pages/bankCard/bankAdd/bankAdd", + "pages/sign/sign", + "pages/idcard/idcard", + "pages/idcard/signUrl/signUrl", + "pages/idcard/success/success", + "pages/idcard/eSign/eSign", + "pages/withdraw/withdraw", + "pages/pay/success/success", + "pages/resetPassword/resetPassword" ], "window": { "backgroundTextStyle": "light", diff --git a/pages/account/index.js b/pages/account/index.js index 6d125a2..03f2f9e 100644 --- a/pages/account/index.js +++ b/pages/account/index.js @@ -9,23 +9,26 @@ Page({ * 页面的初始数据 */ data: { - logsArr : [], //列表数据 - score : '', //数据 - page : {}, //分页信息 - lodingStats : false, //加载状态 - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad(options) { - + account : { + all_in : '0.00', + balance : '0.00', + frozen : '0.00' + }, + logsArr : [], + page : { current: 1 }, + pageLoding : false, + needSign : false }, /** * 生命周期函数--监听页面显示 */ onShow() { + // 页面数据 + this.setData({ + logsArr: [], + page : { current: 1 } + }) // 获取账户信息 this.accountInfo() }, @@ -33,32 +36,20 @@ Page({ /** * 获取账户信息 */ - accountInfo(page) { + accountInfo() { wx.$api.user.account({ - page: page + page: this.data.page.current }).then(res => { - console.log(res.data) - let listArr = this.data.logsArr, - newData = [] - if(page == 1 || page == undefined) listArr = [] - newData = listArr.concat(res.data.logs.data) + let { all_in, balance, frozen, need_sign, logs } = res.data this.setData({ - score : res.data, - logsArr : newData, - page : res.data.logs.page, - lodingStats : false + account : { all_in, balance, frozen }, + needSign : need_sign, + logsArr : logs.page.current == 1 ? logs.data : this.data.logsArr.concat(logs.data), + page : logs.page, + pageLoding : !logs.page.has_more }) wx.stopPullDownRefresh() - - }).catch(err => { }) - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh() { - // 获取账户信息 - this.accountInfo(); + }) }, /** @@ -66,13 +57,42 @@ Page({ */ onReachBottom(){ this.setData({ - lodingStats: true + pageLoding: true }) - let pageNumber = this.data.page.current if(this.data.page.has_more){ - pageNumber++ - // 获取账户信息 - this.accountInfo(pageNumber); + let atpage = this.data.page + atpage.current += 1 + this.setData({ + page: atpage + }) + this.accountInfo() } + }, + /** + * 提现 + */ + onWithdraw(){ + console.log(this.data.needSign) + + if(this.data.needSign){ + wx.showModal({ + title : '提示', + content : '您还未完成实名认证与签约成为VIP用户,暂时无法提现', + cancelText : '稍后完成', + confirmText : '立即完善', + confirmColor : '#da2b54', + complete : res => { + if (res.confirm) { + wx.navigateTo({ + url: '/pages/idcard/idcard' + }) + } + } + }) + return + } + wx.navigateTo({ + url: '/pages/withdraw/withdraw' + }) } }) \ No newline at end of file diff --git a/pages/account/index.wxml b/pages/account/index.wxml index 1d97430..36cf304 100644 --- a/pages/account/index.wxml +++ b/pages/account/index.wxml @@ -1,50 +1,37 @@ - 账户余额(元) - - {{score.balance}} + 账户余额(元) + {{account.balance}} - 提现 + 提现 - - - - 待发放(元) - {{score.frozen}} - - - 总收入(元) - {{score.all_in}} - + + + + 待发放(元) + {{account.frozen}} + + + 总收入(元) + {{account.all_in}} + - - 收益明细 - + 收益明细 - - - 当月贡献发放 - - - 2023-05-22 - - - - +100 + + {{item.remark}} + {{item.created_at}} + {{item.amount}} - - - 加载中... - - - 没有更多了~ - + + 加载中... + 没有更多了~ diff --git a/pages/account/index.wxss b/pages/account/index.wxss index d8b7ad7..788e7ca 100644 --- a/pages/account/index.wxss +++ b/pages/account/index.wxss @@ -1,126 +1,27 @@ -page { - background-color: #f6f6f6; -} +page { background-color: #f6f6f6; } -.top { - background-image: linear-gradient(to bottom, #dc3159, #f46284); - color: #ffffff; - padding: 40rpx 40rpx 120rpx; - box-sizing: border-box; - display: flex; -} +/* 账户余额 */ +.top { background-image: linear-gradient(to bottom, #dc3159, #f46284); color: #ffffff; padding: 40rpx 40rpx 120rpx; box-sizing: border-box; display: flex; align-items: center; } +.topSee { width: calc(100% - 180rpx); padding-right: 30rpx; box-sizing: border-box; } +.topSee-name { line-height: 40rpx; font-size: 30rpx; align-items: center; } +.topSee-number { font-size: 64rpx; letter-spacing: 2rpx; font-weight: bold; } +.topBtn { background-color: #ffffff; display: inline-block; color: #da2b54; line-height: 74rpx; border-radius: 37rpx; width: 180rpx; text-align: center; font-weight: bold; font-size: 32rpx; } -.topSee { - flex: 1; -} +/* 账户统计 */ +.tab { background-color: #ffffff; border-radius: 20rpx; padding: 40rpx 30rpx; box-sizing: border-box; display: flex; margin: -70rpx 30rpx 0; } +.tab-item { text-align: center; width: 50%; } +.tab-name{ font-size: 28rpx; color: gray; } +.tab-number { font-size: 34rpx; font-weight: bold; margin-top: 5rpx; } -.topSee-name { - display: flex; - line-height: 40rpx; -} - -.topSee-name image { - width: 34rpx; - margin: 5rpx 20rpx; - filter: grayscale(100%); - -webkit-filter: grayscale(100%); - filter: brightness(0%) invert(100%); - -webkit-filter: brightness(0%) invert(100%); -} - -.topSee-number { - font-size: 60rpx; - margin-top: 20rpx; - letter-spacing: 2rpx; -} - -.topBtn { - background-color: #ffffff; - display: inline-block; - color: #da2b54; - padding: 0 50rpx; - border-radius: 80rpx; - height: 68rpx; - line-height: 68rpx; - margin-top: 40rpx; -} - -.content { - padding: 0 30rpx; - box-sizing: border-box; - margin-top: -70rpx; -} - -.tab { - background-color: #ffffff; - border-radius: 20rpx; - padding: 40rpx 10rpx; - box-sizing: border-box; - display: flex; -} - -.tab-item { - text-align: center; - flex: 2; -} - -.tab-number { - font-size: 44rpx; - margin-top: 20rpx; -} - -.listTitle { - padding: 30rpx 30rpx 0; - font-weight: 600; - box-sizing: border-box; - font-size: 32rpx; -} - -.list { - padding: 30rpx; - box-sizing: border-box; -} - -.list-item { - background-color: #fff; - border-radius: 20rpx; - margin-bottom: 30rpx; - padding: 30rpx; - box-sizing: border-box; - display: flex; -} - -.item-top { - flex: 1; -} - -.item-name { - font-size: 30rpx; -} - -.item-number { - color: #da2b54; - font-weight: 600; - font-size: 38rpx; - line-height: 90rpx; -} - -.item-time { - color: #999999; - font-size: 28rpx; - margin-top: 15rpx; -} +/* 收益明细 */ +.listTitle { padding: 30rpx 30rpx 0; font-weight: 600; box-sizing: border-box; font-size: 30rpx; } +.list { padding: 30rpx; box-sizing: border-box;} +.list-item { background-color: #fff; border-radius: 20rpx; margin-bottom: 20rpx; padding: 30rpx; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; } +.item-text{ width: calc(100% - 200rpx); } +.item-name { font-size: 30rpx; font-weight: bold; line-height: 40rpx; } +.item-time { font-size: 28rpx; line-height: 40rpx; color: gray; margin-top: 5rpx; } +.item-number { color: #da2b54; font-size: 34rpx; font-weight: bold; width: 200rpx; text-align: right; padding-left: 20rpx; box-sizing: border-box; } /* 暂无数据 */ -.pages-no { - background-color: #fff; - margin-top: 30rpx; - text-align: center; - padding: 120rpx 0; - color: #6d6d6d; - font-size: 28rpx; -} - -.pages-no image { - width: 180rpx; -} \ No newline at end of file +.pages-no { background-color: #fff; margin: 30rpx; border-radius: 20rpx; display: flex; align-items: center; justify-content: center; flex-direction: column; color: #6d6d6d; font-size: 28rpx; height: 55vh; } +.pages-no image { width: 180rpx; height: 180rpx; } \ No newline at end of file diff --git a/pages/bankCard/bankAdd/bankAdd.js b/pages/bankCard/bankAdd/bankAdd.js index 279ba76..cb036dc 100644 --- a/pages/bankCard/bankAdd/bankAdd.js +++ b/pages/bankCard/bankAdd/bankAdd.js @@ -25,12 +25,10 @@ Page({ type : options.type, bankId: options.id }) - if(options.type == 'Compile') { // 获取银行编辑信息 this.bankEdit(); } - }, /** @@ -79,7 +77,6 @@ Page({ */ siteform(val) { let value = val.detail.value - console.log(value) let data = { name : value.name, mobile : value.mobile, diff --git a/pages/bankCard/bankAdd/bankAdd.wxml b/pages/bankCard/bankAdd/bankAdd.wxml index efda8f9..d0635c3 100644 --- a/pages/bankCard/bankAdd/bankAdd.wxml +++ b/pages/bankCard/bankAdd/bankAdd.wxml @@ -1,34 +1,62 @@ -
- - - - - - {{bankArr[bankIndex].name}} - - - - - - - - - - - - - - - - - - - - - - - - -
\ No newline at end of file + +
+ + + + + {{bankArr[bankIndex].name}} + + + + + + + + + + + + + + + + + + + + + + + + +
+
diff --git a/pages/bankCard/bankAdd/bankAdd.wxss b/pages/bankCard/bankAdd/bankAdd.wxss index 612e80e..72955e9 100644 --- a/pages/bankCard/bankAdd/bankAdd.wxss +++ b/pages/bankCard/bankAdd/bankAdd.wxss @@ -1,137 +1,15 @@ -.site-form { - margin: 20rpx; - display: block; - overflow: hidden; -} -.site-btn { - margin: 40rpx 0; -} +.content{ background: #f7f8f9; min-height: 100vh; padding: 30rpx; box-sizing: border-box; } -.site-input { - padding: 0 30rpx 0 280rpx; - position: relative; - line-height: 100rpx; - min-height: 100rpx; -} +/* 绑定银行卡 */ +.form{ background: white; border-radius: 20rpx; padding: 15rpx 0; } +.form-item{ display: flex; justify-content: space-between; padding: 0 30rpx; height: 90rpx; line-height: 90rpx; align-items: center; } +.form-label{ width: 180rpx; font-size: 30rpx; } +.form-intpu{ width: calc(100% - 180rpx); height: 90rpx; line-height: 90rpx; font-size: 30rpx; } +.form-picker{ width: calc(100% - 180rpx); position: relative; } +.form-picker-text{ line-height: 90rpx; height: 90rpx; font-size: 30rpx; } +.form-picker-icon{ width: 48rpx; height: 48rpx; position: absolute; right: 0; top: 50%; margin-top: -24rpx; } -.site-input label { - position: absolute; - left: 30rpx; - top: 0; -} - -.site-input input { - height: 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: #da2b54; - height: 90rpx; - line-height: 90rpx; - font-size: 30rpx; - color: white; - padding: 0; -} - -.site-btn button[disabled] { - opacity: .6; -} - -/* 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: #3ec28e; -} - -.pickerView-cancel { - color: #747788; -} - - -.site-input image { - width: 38rpx; - height: 38rpx; - position: absolute; - right: 20rpx; - top: calc(50% - 19rpx); -} - -.site-switch { - position: absolute; - right: 0; - top: 0; -} \ No newline at end of file +/* 确认添加 */ +.btn{ margin-top: 50rpx; } +.btn button[size="default"]{ background: #da2b54; width: 100%; height: 90rpx; line-height: 90rpx; padding: 0; border-radius: 45rpx; color: white; font-size: 32rpx; } diff --git a/pages/bankCard/index.wxml b/pages/bankCard/index.wxml index 7f2bdcf..0fec3b5 100644 --- a/pages/bankCard/index.wxml +++ b/pages/bankCard/index.wxml @@ -19,13 +19,13 @@
- - 选择地址 - - - 编辑账户 - 删除账户 - + + 选择地址 + + + 编辑账户 + 删除账户 +
diff --git a/pages/bankCard/index.wxss b/pages/bankCard/index.wxss index 14c9638..f7dea75 100644 --- a/pages/bankCard/index.wxss +++ b/pages/bankCard/index.wxss @@ -1,103 +1,19 @@ -page { - background: #f5f5f5; -} +.address { padding: 30rpx 30rpx 180rpx; min-height: 100vh; box-sizing: border-box; background: #f7f8f9; } +.address-li { margin-bottom: 20rpx; background-color: #ffffff; border-radius: 20rpx; } +.top { position: relative; border-bottom: 1rpx solid #ececec; padding: 30rpx; box-sizing: border-box; display: flex; align-items: center; } +.top-logo { width: 68rpx; height: 68rpx; border-radius: 50%; } +.top-name { font-weight: 600; font-size: 32rpx; margin-left: 20rpx; } +.cont { padding: 30rpx; box-sizing: border-box; } +.address-title { display: flex; justify-content: space-between; font-size: 28rpx; line-height: 70rpx; } +.address-title text { width: 200rpx; color: gray; } +.address-tool{ padding: 30rpx; box-sizing: border-box; display: flex; justify-content: flex-end; border-top: 1rpx solid #ececec; } +.address-tool-btn{ background: #e92152; color: white; height: 62rpx; line-height: 60rpx; border-radius: 30rpx; font-size: 28rpx; margin-left: 30rpx; padding: 0 30rpx; border:solid 1rpx #e92152; box-sizing: border-box; } +.address-tool-border{ color: #e92152; background: white; } -.address { - border-bottom: 120rpx solid transparent; - margin: 20rpx; -} +/* .address-tool { padding: 30rpx; box-sizing: border-box; font-size: 28rpx; } +.address-edit { margin-left: 30rpx; background-color: #e92152; border: 2rpx solid #e92152; color: #ffffff; line-height: 60rpx; padding: 0 30rpx; border-radius: 30rpx; font-size: 28rpx; } -.address-li { - margin-bottom: 20rpx; - background-color: #ffffff; - border-radius: 20rpx; -} - -.top { - position: relative; - border-bottom: 2rpx solid #ececec; - padding: 20rpx 20rpx 15rpx; - box-sizing: border-box; -} - -.top-logo { - width: 80rpx; - height: 80rpx; - border-radius: 50%; -} - -.top-name { - position: absolute; - left: 0; - top: 0; - width: 100%; - padding: 20rpx 20rpx 20rpx 120rpx; - box-sizing: border-box; - line-height: 80rpx; - font-weight: 600; - font-size: 32rpx; -} - -.cont { - padding: 30rpx; - box-sizing: border-box; -} - -.address-title { - display: flex; - font-size: 28rpx; - line-height: 80rpx; - background-color: #f9fbfc; - margin-bottom: 30rpx; - padding: 0 30rpx; - box-sizing: border-box; - border-radius: 10rpx; -} - -.address-title text { - display: inline-block; - width: 200rpx; - color: #aaaaaa; -} - -.address-title:last-child { - margin-bottom: 0; -} - -.address-nmae, -.address-tips { - flex: 1; -} - -.address-text { - font-size: 28rpx; - margin: 20rpx 0; -} - -.address-tool { - padding: 30rpx; - box-sizing: border-box; - font-size: 28rpx; - overflow: hidden; - border-top: 2rpx solid #ececec; -} - -.address-edit { - margin-left: 30rpx; - display: inline-block; - background-color: #ff9b26; - border: 2rpx solid #ff9b26; - color: #ffffff; - line-height: 58rpx; - padding: 0 30rpx; - border-radius: 10rpx; - font-size: 28rpx; -} - -.address-edit-border { - color: #ff9b26; - background-color: #ffffff; -} +.address-edit-border { color: #e92152; background-color: #ffffff; } .address-edit image { width: 32rpx; @@ -137,30 +53,30 @@ page { .address-icon { float: right; -} +} */ + +/* 空页面 */ +.pages-hint{ padding-bottom: 180rpx; } /* footer */ - .address-footer { position: fixed; bottom: 0; left: 0; right: 0; - padding-left: 30rpx; - padding-right: 30rpx; background: white; - z-index: 9; - height: 120rpx; + z-index: 99; + padding: 30rpx 30rpx 60rpx; } .address-footer navigator { width: 100%; line-height: 90rpx; height: 90rpx; - margin: 15rpx 0; text-align: center; background: #e92152; - font-size: 30rpx; + font-size: 32rpx; + font-weight: bold; color: white; - border-radius: 10rpx + border-radius: 45rpx } \ No newline at end of file diff --git a/pages/classify/index.wxss b/pages/classify/index.wxss index f04283a..f3edc5d 100644 --- a/pages/classify/index.wxss +++ b/pages/classify/index.wxss @@ -56,7 +56,7 @@ .stair-nav-li.active { background: white; - color: #e92344; + color: #da2b54; font-weight: bold; position: relative; } @@ -67,7 +67,7 @@ left: 0; top: 30rpx; height: 40rpx; - background: #e92344; + background: #da2b54; width: 6rpx; } diff --git a/pages/face/index.js b/pages/face/index.js index a7fe6cd..adc357a 100644 --- a/pages/face/index.js +++ b/pages/face/index.js @@ -1,66 +1,53 @@ -// pages/face/index.js Page({ /** * 页面的初始数据 */ data: { - + goFaceDone : false, + bizToken : '', + redirectUrl : '' }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { - + this.setData({ + bizToken : options.bizToken, + redirectUrl : decodeURIComponent(options.redirectUrl), + }, this.goFaceAuth) }, - /** - * 生命周期函数--监听页面初次渲染完成 + * 生命周期函数--页面再次显示 */ - onReady() { - + onShow(){ + const { goFaceDone, redirectUrl } = this.data + if (!goFaceDone) return + const options = wx.getEnterOptionsSync() + if(options.scene === 1038 && options.referrerInfo.extraData && options.referrerInfo.extraData.faceResult){ + const pages = getCurrentPages() + const pre = pages[pages.length - 2] + if (pre.reloadPage && typeof pre.reloadPage === 'function') { + pre.reloadPage(redirectUrl + `&timeStamp=${new Date().getTime()}`) + wx.navigateBack({ + delta: 1, + }) + } + } }, - /** - * 生命周期函数--监听页面显示 + * 打开E签报小程序 */ - onShow() { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide() { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload() { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh() { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom() { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage() { - + goFaceAuth(){ + wx.navigateToMiniProgram({ + appId: "wx1cf2708c2de46337", + path : "/pages/face/index?bizToken=" + this.data.bizToken, + success: () => { + this.setData({ + goFaceDone: true + }) + } + }) } }) \ No newline at end of file diff --git a/pages/face/index.json b/pages/face/index.json index 3928faa..f5fc409 100644 --- a/pages/face/index.json +++ b/pages/face/index.json @@ -1,3 +1,4 @@ { - "usingComponents": {} + "usingComponents": {}, + "navigationBarTitleText": "人脸识别" } \ No newline at end of file diff --git a/pages/face/index.wxml b/pages/face/index.wxml index 9b3ca66..871ff3c 100644 --- a/pages/face/index.wxml +++ b/pages/face/index.wxml @@ -1,2 +1,9 @@ - -pages/face/index.wxml + + + + 加载中... + + 如未成功跳转,请手动点击按钮转跳 + + + diff --git a/pages/face/index.wxss b/pages/face/index.wxss index e9ea303..22b9862 100644 --- a/pages/face/index.wxss +++ b/pages/face/index.wxss @@ -1 +1,16 @@ -/* pages/face/index.wxss */ \ No newline at end of file + +.face{ + width: 100vw; + height: 90vh; + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; +} + +.face-icon{ width: 48rpx; height: 48rpx; margin-bottom: 40rpx; } +.face-loding{ color: gray; } + +.btn-content{ margin-top: 150rpx; font-size: 30rpx; color: #333; } + +.btn-content button[size="default"]{ background: #da2b54; height: 90rpx; line-height: 90rpx; color: white; padding: 0; border-radius: 45rpx; width: 400rpx; margin-top: 100rpx; } diff --git a/pages/idcard/eSign/eSign.js b/pages/idcard/eSign/eSign.js new file mode 100644 index 0000000..1c31ed8 --- /dev/null +++ b/pages/idcard/eSign/eSign.js @@ -0,0 +1,36 @@ +Page({ + + /** + * 页面的初始数据 + */ + data: { + sign_url: '' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad() { + wx.showLoading({ + title: '加载中...', + mask : true + }) + wx.$api.idcard.pactUrl().then(res => { + let { sign_url } = res.data + this.setData({ + sign_url + }) + wx.hideLoading() + }) + }, + /** + * 监听签署结果 + */ + handleGetMessage(e){ + if(e.detail.data[0].result=='success'){ + wx.navigateTo({ + url: '/pages/idcard/success/success?type=idcard', + }) + } + }, +}) \ No newline at end of file diff --git a/pages/idcard/eSign/eSign.json b/pages/idcard/eSign/eSign.json new file mode 100644 index 0000000..3928faa --- /dev/null +++ b/pages/idcard/eSign/eSign.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/idcard/eSign/eSign.wxml b/pages/idcard/eSign/eSign.wxml new file mode 100644 index 0000000..640a4f1 --- /dev/null +++ b/pages/idcard/eSign/eSign.wxml @@ -0,0 +1,2 @@ + + diff --git a/pages/idcard/eSign/eSign.wxss b/pages/idcard/eSign/eSign.wxss new file mode 100644 index 0000000..0c4d322 --- /dev/null +++ b/pages/idcard/eSign/eSign.wxss @@ -0,0 +1 @@ +/* pages/idcard/eSign/eSign.wxss */ \ No newline at end of file diff --git a/pages/idcard/idcard.js b/pages/idcard/idcard.js new file mode 100644 index 0000000..2944101 --- /dev/null +++ b/pages/idcard/idcard.js @@ -0,0 +1,128 @@ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + front : null, + back : null, + procedure : 1, + info : { + name : '', + id_card : '', + created_at : '', + need_sign : '', + }, + isSignContract : false + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + wx.showLoading({ + title: "加载中...", + mask : true + }) + wx.$api.idcard.getInfo().then(res => { + let { data } = res; + wx.hideLoading() + if(data.length == 0){ + this.setData({ + procedure: 1 + }) + return + } + if(data != ''){ + this.setData({ + procedure : data.need_sign ? 2 : 3, + isSignContract : data.is_sign_contract, + info : { + name : data.name, + id_card : data.id_card, + created_at : data.created_at, + verified : data.verified, + need_sign : data.need_sign, + } + }) + } + }) + }, + /** + * 上传身份证 + */ + onUpd(e){ + let { type } = e.currentTarget.dataset + wx.chooseMedia({ + count : 1, + mediaType : ['image'], + success : resPaths => { + let { tempFiles } = resPaths; + this.setData({ + [type]: tempFiles[0].tempFilePath + }) + wx.$api.idcard.updIdcard(tempFiles[0].tempFilePath, { type }).then(res => { + this.setData({ + [type]: res + }) + }) + } + }) + }, + /** + * 提交身份证信息 + */ + onSubmitIdcard(e){ + wx.showLoading({ + title: '提交证件信息...', + mask : true + }) + let { address } = e.detail.value + wx.$api.idcard.ocr({ + front_card: this.data.front.path, + back_card : this.data.back.path, + address + }).then(res => { + let { name, id_card, created_at, verified, need_sign } = res.data + this.setData({ + info : { name, id_card, created_at, verified, need_sign }, + procedure : need_sign ? 2 : 3, + isSignContract : data.is_sign_contract, + }) + wx.hideLoading() + }) + }, + /** + * 获取人脸认证地址 + */ + onGetSignUrl(){ + wx.showLoading({ + title: '获取地址信息...', + mask : true + }) + wx.$api.idcard.signUrl({ + path : '/pages/idcard/idcard', + query : "getSign=1", + version : '' + }).then(res => { + let { url } = res.data; + wx.navigateTo({ + url: "./signUrl/signUrl?url=" + encodeURIComponent(url.authUrl), + }) + wx.hideLoading() + }) + }, + /** + * 开通会员获取签约地址 + */ + onGetOpenVip(){ + if(this.data.isSignContract){ + wx.navigateBack() + return + } + wx.navigateTo({ + url: "./eSign/eSign", + }) + } +}) \ No newline at end of file diff --git a/pages/idcard/idcard.json b/pages/idcard/idcard.json new file mode 100644 index 0000000..5ab196f --- /dev/null +++ b/pages/idcard/idcard.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "实名认证" +} \ No newline at end of file diff --git a/pages/idcard/idcard.wxml b/pages/idcard/idcard.wxml new file mode 100644 index 0000000..cdc7c9c --- /dev/null +++ b/pages/idcard/idcard.wxml @@ -0,0 +1,76 @@ + + + 上传证件 + 确认信息 + 认证完成 + + + + +
+ + + + + 上传身份证正面 + + + + + + + + 上传身份证反面 + + + + + + + + + + + + +
+
+ + + + + + + {{info.name || '-'}} + + + + {{info.id_card || '-'}} + + + + {{info.address || '-'}} + + + + {{info.created_at || '-'}} + + + + + + + + + + + + 认证完成 + {{info.name}}({{info.id_card}}) + 您已完成实名认证 + 点击按钮进行签约开通会员 + + + + + diff --git a/pages/idcard/idcard.wxss b/pages/idcard/idcard.wxss new file mode 100644 index 0000000..b4a00d5 --- /dev/null +++ b/pages/idcard/idcard.wxss @@ -0,0 +1,38 @@ + +/* 身份信息 */ +.schedule{ display: flex; align-items: center; justify-content: space-around; padding: 50rpx 30rpx; } +.schedule-item{ font-size: 28rpx; color: gray; padding-top: 60rpx; position: relative; } +.schedule-item::after{ content: " "; position: absolute; left: 50%; top: 0; width: 40rpx; height: 40rpx; margin-left: -25rpx; background: #ddd; text-align: center; border-radius: 50%; line-height: 40rpx; font-size: 28rpx; border: solid 5rpx #f7f8f9; } +.schedule-item:nth-child(1)::after{ content: "1"; } +.schedule-item:nth-child(2)::after{ content: "2"; } +.schedule-item:nth-child(3)::after{ content: "3"; } + +.schedule-item.show{color: #da2b54;} +.schedule-item.show::after{ background: #da2b54; color: white; border-color: #fbccd7; } + +/* 上传身份证 */ +.upds{ padding: 0 60rpx; } +.upds-item{ background: #f7f8f9; border-radius: 20rpx; margin-top: 20rpx; width: 100%; padding-top:58%; border: dashed 1rpx #ddd; position: relative; overflow: hidden; } +.upds-text{ font-size: 28rpx; color: gray; width: 100%; display: flex; align-items: center; flex-direction: column; justify-content: center; height: 100%; top: 0; left: 0; position: absolute; z-index: 1; } +.upds-icon{ width: 58rpx; height: 58rpx; margin: 20rpx 0; } +.upds-back{ position: absolute; top: 50%; left: 50%; width: 400rpx; height: 185rpx; opacity: .2; margin-left: -200rpx; margin-top: -92rpx; } +.upds-src{ position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; } +.idcard-input{ background: #f7f8f9; border-radius: 20rpx; height: 90rpx; margin-top: 20rpx; display: flex; align-items: center; padding: 0 30rpx; box-sizing: border-box; } +.idcard-input input{ width: calc(100% - 140rpx); height: 90rpx; line-height: 90rpx; font-size: 30rpx; box-sizing: border-box; padding-left: 20rpx; } +.idcard-input label{ width: 140rpx; font-size: 30rpx; } + +/* 认证信息 */ +.info-block{ background: #f7f8f9; margin: 0 50rpx; border-radius: 20rpx; padding: 30rpx; } +.info-flex{ display: flex; align-items: flex-start; justify-content: space-between; line-height: 40rpx; padding: 15rpx 0; font-size: 30rpx; } +.info-flex label{ color: gray; } + +/* 认证结果信息 */ +.idcard-success{ margin: 0 50rpx; display: flex; align-items: center; justify-content: center; height: 75vh; flex-direction: column; } +.idcard-icon{ width: 128rpx; margin-bottom: 50rpx; } +.idcard-title{ font-size: 50rpx; font-weight: bold; line-height: 50rpx; } +.idcard-subtitle{ font-size: 30rpx; color: gray; line-height: 40rpx; margin-top: 20rpx; margin-bottom: 100rpx; text-align: center; } +.idcard-info{ margin-top: 20rpx; font-size: 30rpx; } + +/* 下一步 */ +.idcard-btn{ padding: 50rpx 60rpx; width: 100vw; box-sizing: border-box; } +.idcard-btn button[size='default']{ background: #da2b54; width: 100%; height: 90rpx; border-radius: 45rpx; color: white; line-height: 90rpx; padding: 0; font-size: 32rpx; } diff --git a/pages/idcard/signUrl/signUrl.js b/pages/idcard/signUrl/signUrl.js new file mode 100644 index 0000000..76319cb --- /dev/null +++ b/pages/idcard/signUrl/signUrl.js @@ -0,0 +1,44 @@ +Page({ + + /** + * 页面的初始数据 + */ + data: { + url: '' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + console.log(options) + if(!options.url){ + wx.showToast({ + title: '系统错误:未获取到签约地址', + icon : 'none' + }) + return + } + this.setData({ + url: decodeURIComponent(options.url) + }) + }, + /** + * 监听签署结果 + */ + handleGetMessage(e){ + if(e.detail.data[0].result=='success'){ + wx.redirectTo({ + url: '/pages/idcard/success/success?type=sign', + }) + } + }, + /** + * 重新定向url + */ + reloadPage(redirectUrl) { + this.setData({ + url: redirectUrl, + }) + } +}) \ No newline at end of file diff --git a/pages/idcard/signUrl/signUrl.json b/pages/idcard/signUrl/signUrl.json new file mode 100644 index 0000000..68c7c99 --- /dev/null +++ b/pages/idcard/signUrl/signUrl.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "人脸识别认证" +} \ No newline at end of file diff --git a/pages/idcard/signUrl/signUrl.wxml b/pages/idcard/signUrl/signUrl.wxml new file mode 100644 index 0000000..472532d --- /dev/null +++ b/pages/idcard/signUrl/signUrl.wxml @@ -0,0 +1,2 @@ + + diff --git a/pages/idcard/signUrl/signUrl.wxss b/pages/idcard/signUrl/signUrl.wxss new file mode 100644 index 0000000..c06b8f8 --- /dev/null +++ b/pages/idcard/signUrl/signUrl.wxss @@ -0,0 +1 @@ +/* pages/idcard/signUrl/signUrl.wxss */ \ No newline at end of file diff --git a/pages/idcard/success/success.js b/pages/idcard/success/success.js new file mode 100644 index 0000000..48a78f4 --- /dev/null +++ b/pages/idcard/success/success.js @@ -0,0 +1,35 @@ +Page({ + + /** + * 页面的初始数据 + */ + data: { + title: "", + text : "" + }, + + /** + * 生命周期函数--页面加载 + */ + onLoad(e){ + if(e.type == 'sign'){ + this.setData({ + title: "签署完成", + text : "签署完成,恭喜您升级为平台会员" + }) + } + if(e.type == 'idcard'){ + this.setData({ + title: "认证完成", + text : "实名认证已完成" + }) + } + }, + + /** + * 返回 + */ + onBack(){ + wx.navigateBack() + } +}) \ No newline at end of file diff --git a/pages/idcard/success/success.json b/pages/idcard/success/success.json new file mode 100644 index 0000000..619784e --- /dev/null +++ b/pages/idcard/success/success.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "" +} \ No newline at end of file diff --git a/pages/idcard/success/success.wxml b/pages/idcard/success/success.wxml new file mode 100644 index 0000000..988d230 --- /dev/null +++ b/pages/idcard/success/success.wxml @@ -0,0 +1,9 @@ + + + + {{title}} + {{text}} + + + + diff --git a/pages/idcard/success/success.wxss b/pages/idcard/success/success.wxss new file mode 100644 index 0000000..d0d7455 --- /dev/null +++ b/pages/idcard/success/success.wxss @@ -0,0 +1,9 @@ + +.success{ height: 90vh; width: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; } +.icon{ width: 128rpx; height: 128rpx; margin-bottom: 40rpx; } +.title{ font-size: 50rpx; font-weight: bold; line-height: 50rpx; margin-bottom: 30rpx; color: #333; } +.text{ font-size: 30rpx; color: gray; margin-bottom: 100px; } + +.idcard-btn{ padding: 50rpx 60rpx; width: 100vw; box-sizing: border-box; } +.idcard-btn button[size='default']{ background: #da2b54; width: 100%; height: 90rpx; border-radius: 45rpx; color: white; line-height: 90rpx; padding: 0; font-size: 32rpx; } + diff --git a/pages/login/index.js b/pages/login/index.js index 917b778..aa39580 100644 --- a/pages/login/index.js +++ b/pages/login/index.js @@ -44,6 +44,8 @@ Page({ password : value.password, } wx.$api.auth.Login(data).then(res => { + // 存储邀请码 + // let { invite, } // 存储登录信息 wx.setStorage({ key : 'token', diff --git a/pages/login/index.wxml b/pages/login/index.wxml index 7b66d90..e5f9518 100644 --- a/pages/login/index.wxml +++ b/pages/login/index.wxml @@ -8,11 +8,11 @@
- + - 忘记密码? + 忘记密码? - 暂无账号,立即注册 + 暂无账号,立即注册 diff --git a/pages/mall/confirm/confirm.js b/pages/mall/confirm/confirm.js index 953bc44..460e935 100644 --- a/pages/mall/confirm/confirm.js +++ b/pages/mall/confirm/confirm.js @@ -15,7 +15,8 @@ Page({ address : '', // 地址 addressId : '', // 地址id goodskData : '', // 数据 - amount : '', // 总金额 + amount : '', // 商品总金额 + total : '', // 支付金额 freight : '', // 运费 weight : '', // 重量 }, @@ -46,12 +47,12 @@ Page({ qty: qty, address_id: this.data.addressId }).then(res => { - console.log(res) this.setData({ address : res.data.address, addressId : res.data.address.address_id, goodskData: res.data.detail, amount : res.data.amount, + total : res.data.total, freight : res.data.freight, weight : res.data.weight }) @@ -62,21 +63,20 @@ Page({ * 商品确认下单 */ buyTap() { + wx.showLoading({ + title: '下单中...', + mask : true + }) wx.$api.mall.placeTrue({ - goods_sku_id:this.data.skuId, - qty: this.data.goodsQty, - address_id: this.data.addressId + goods_sku_id : this.data.skuId, + qty : this.data.goodsQty, + address_id : this.data.addressId }).then(res => { - this.setData({ - disabled: true - }) wx.redirectTo({ url: '/pages/pay/index?params=' + encodeURIComponent(JSON.stringify(res.data)) }) - }).catch(err =>{ - this.setData({ - disabled: false - }) + }).catch(() =>{}).finally(() => { + wx.hideLoading() }) }, }) \ No newline at end of file diff --git a/pages/mall/confirm/confirm.wxml b/pages/mall/confirm/confirm.wxml index e0bb028..2ab300f 100644 --- a/pages/mall/confirm/confirm.wxml +++ b/pages/mall/confirm/confirm.wxml @@ -33,6 +33,7 @@
+ @@ -54,13 +55,7 @@ 合计: - {{amount}} + {{total}} - 立即支付 - 立即支付 + 立即支付 - - \ No newline at end of file diff --git a/pages/mall/confirm/confirm.wxss b/pages/mall/confirm/confirm.wxss index 47ba190..5f5d63a 100644 --- a/pages/mall/confirm/confirm.wxss +++ b/pages/mall/confirm/confirm.wxss @@ -53,6 +53,7 @@ page { .address-img { width: 100%; + height: 10rpx; display: block; } diff --git a/pages/mall/details/details.js b/pages/mall/details/details.js index 58b4946..63a330a 100644 --- a/pages/mall/details/details.js +++ b/pages/mall/details/details.js @@ -22,7 +22,8 @@ Page({ valueIndex : '', // 选中规格下标index specselectIndex : '', qtyNumber : 1, // 产品数量 - goodsSize : false + goodsSize : false, + invite : '' }, /** @@ -30,7 +31,8 @@ Page({ */ onLoad(options) { this.setData({ - goodsId: options.id + goodsId: options.id, + invite : options.invite || '' }) }, @@ -46,17 +48,23 @@ Page({ * 商品详情 */ goodsInfo() { + wx.showLoading({ + title: '加载中...', + mask : true + }) wx.$api.mall.goodsSee(this.data.goodsId).then(res => { - console.log(res.data) this.setData({ goodsData : res.data, mallContent : res.data.content.replace(/\{}) + }).catch(err =>{}).finally(() => { + wx.hideLoading() + }) }, /** @@ -245,5 +253,25 @@ Page({ urls : imgs, current : imgs[index] }) + }, + /** + * 分享给朋友 + */ + onShareAppMessage(){ + return{ + title : this.data.goodsData.name, + path : '/pages/mall/details/details?id=' + this.data.goodsId + '&invite=' + this.data.invite, + imageUrl: this.data.goodsData.cover + } + }, + /** + * 分享朋友圈 + */ + onShareTimeline(){ + return{ + title : this.data.goodsData.name, + query : '/pages/mall/details/details?id=' + this.data.goodsId + '&invite=' + this.data.invite, + imageUrl : this.data.goodsData.cover + } } }) \ No newline at end of file diff --git a/pages/mall/details/details.wxml b/pages/mall/details/details.wxml index 6d1ca13..228da44 100644 --- a/pages/mall/details/details.wxml +++ b/pages/mall/details/details.wxml @@ -23,15 +23,14 @@ {{goodsData.original_price}} - {{goodsData.name}} - + diff --git a/pages/mall/details/details.wxss b/pages/mall/details/details.wxss index 35f9df4..9958822 100644 --- a/pages/mall/details/details.wxss +++ b/pages/mall/details/details.wxss @@ -103,7 +103,7 @@ page { font-size: 32rpx; } -.goodsInfo-share { +.goodsInfo-share[size="mini"] { position: absolute; top: 40rpx; right: 30rpx; @@ -111,6 +111,8 @@ page { font-size: 27rpx; line-height: 34rpx; color: #9b9b9b; + padding: 0; + background: transparent; } .goodsInfo-share-image { diff --git a/pages/mall/index.js b/pages/mall/index.js index 8481aa4..3cea25f 100644 --- a/pages/mall/index.js +++ b/pages/mall/index.js @@ -9,19 +9,29 @@ Page({ * 页面的初始数据 */ data: { - scrollLeft : '', // 商品分类 - bannerArr : [], // 轮播信息 - categorieArr: [], // 分类信息 - goodsArr : [], // 商品信息 - articlesArr : [], // 公告列表 - page : {}, // 分页信息 - lodingStats : false,// 加载状态 + scrollLeft : '', // 商品分类 + bannerArr : [], // 轮播信息 + categorieArr : [], // 分类信息 + goodsArr : [], // 商品信息 + articlesArr : [], // 公告列表 + page : {}, // 分页信息 + lodingStats : false,// 加载状态 + buy_sku_id : false,// 身份包产品 + can_buy : false,// 是否可购买 + certification : false,// 是否已认证 }, /** * 生命周期函数--监听页面加载 */ - onLoad(options) {}, + onLoad(options) { + let sceneCode = options.scene || null + if(sceneCode != null ){ + let inviteCode = decodeURIComponent(sceneCode) + let invite = inviteCode.match(new RegExp("(^|&)" + 'invite' + "=([^&]*)(&|$)", "i")); + getApp().globalData.invite = invite[2] || null + } + }, /** * 生命周期函数--监听页面显示 @@ -38,6 +48,23 @@ Page({ // 获取公告列表 this.articlesInfo(); + + // 获取身份包产品 + this.getidpackage() + }, + + /** + * 身份包 + */ + getidpackage(){ + wx.$api.mall.idpackage().then(res => { + let { buy_sku_id, can_buy, certification } = res.data + this.setData({ + buy_sku_id, + can_buy, + certification + }) + }) }, /** @@ -48,8 +75,6 @@ Page({ this.setData({ bannerArr: res.data }) - }).catch(err =>{ - }) }, @@ -61,8 +86,6 @@ Page({ this.setData({ categorieArr: res.data }) - }).catch(err =>{ - }) }, @@ -83,8 +106,6 @@ Page({ lodingStats : false }) wx.stopPullDownRefresh() - }).catch(err =>{ - }) }, @@ -96,8 +117,7 @@ Page({ this.setData({ articlesArr: res.data.data }) - console.log(res) - }).catch(err =>{}) + }) }, /** @@ -117,6 +137,39 @@ Page({ }) }, + /** + * 购买产品包 + */ + onCapsule(){ + if(wx.getStorageSync("token") != ''){ + if(!this.data.certification){ + wx.showModal({ + title : '提示', + content : '您还未完成账号实名认证,暂不可购买', + cancelText : '稍后', + cancelColor : '#333', + confirmText : '去认证', + confirmColor : '#da2b54', + success : res => { + if(res.confirm){ + wx.navigateTo({ + url: '/pages/idcard/idcard', + }) + } + } + }) + return + } + wx.navigateTo({ + url: '/pages/mall/confirm/confirm?qty=1&skuId=' + this.data.buy_sku_id + }) + return + } + wx.navigateTo({ + url: "/pages/login/index" + }) + }, + /** * 页面相关事件处理函数--监听用户下拉动作 */ diff --git a/pages/mall/index.wxml b/pages/mall/index.wxml index 13530d6..6528712 100644 --- a/pages/mall/index.wxml +++ b/pages/mall/index.wxml @@ -40,6 +40,11 @@ + + + + + diff --git a/pages/mall/index.wxss b/pages/mall/index.wxss index 09ecab1..fa5a443 100644 --- a/pages/mall/index.wxss +++ b/pages/mall/index.wxss @@ -3,7 +3,7 @@ page { } .linearBack { - background-image: linear-gradient(to top, #ffffff 60%, #fde8e9); + background-image: linear-gradient(to top, #ffffff 60%, #fbe2e1); padding: 30rpx; box-sizing: border-box; } @@ -99,13 +99,13 @@ page { } .noticeCont-icon { - width: 38rpx; + width: 32rpx; margin-top: 28rpx; } .noticeCont-name { - width: calc(100% - 38rpx); - padding-left: 30rpx; + width: calc(100% - 32rpx); + padding-left: 20rpx; box-sizing: border-box; color: #da2b54; } @@ -310,7 +310,7 @@ page { .goodsItem-price { flex: 1; - color: #ff1122; + color: #da2b54; font-size: 32rpx; font-weight: 600; } @@ -320,6 +320,10 @@ page { color: #999999; } +/* 自选产品包 */ +.capsule{ padding: 0 40rpx 20rpx; } +.capsule-src{ width: 100%; } + /* 暂无列表 */ .goodsList-no { background-color: #ffffff; diff --git a/pages/pay/index.js b/pages/pay/index.js index 0149e69..00763ce 100644 --- a/pages/pay/index.js +++ b/pages/pay/index.js @@ -9,20 +9,104 @@ Page({ * 页面的初始数据 */ data: { - + total : "0.00", + orderNo : "", + modelId : "", + modelType : "", + payType : "", + can : { + coin : 0, + wechat : 0, + }, + loding : false }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { - const params = JSON.parse(decodeURIComponent(options.params)); - console.log(params) + const { order_id, order_type, order_no } = JSON.parse(decodeURIComponent(options.params)) + wx.showLoading({ + title: '加载中...', + mask : true + }) + wx.$api.pay.info({ order_id, order_type }).then(res => { + let { can, total, model_type, model_id } = res.data + this.setData({ + orderNo : order_no, + payType : res.data.default, + modelId : model_id, + modelType : model_type, + total, + can + }) + wx.hideLoading() + }) }, /** - * 生命周期函数--监听页面显示 + * 选择支付方式 */ - onShow() { - + onPayType(e){ + let { value } = e.detail + this.setData({ + payType: value + }) }, + /** + * 立即支付 + */ + onPay(){ + this.setData({ + loding: true + }) + switch (this.data.payType) { + case 'wechat': + this.wechatPay() + break; + case 'coin': + wx.showToast({ + title: '支付方式暂未开放', + icon : 'none' + }) + this.setData({ + loding: false + }) + break; + } + }, + /** + * 微信支付 + */ + wechatPay(){ + wx.login({ + success: wxCode => { + let { code } = wxCode; + wx.$api.pay.wechatPay({ + order_type : this.data.modelType, + order_id : this.data.modelId, + type : "mini", + code : code + }).then(res => { + let { wechat, trade_id } = res.data + let wechatObj = JSON.parse(wechat) + wx.requestPayment({ + nonceStr : wechatObj.nonceStr, + package : wechatObj.package, + paySign : wechatObj.paySign, + timeStamp: wechatObj.timeStamp, + signType : wechatObj.signType, + success : () => { + wx.redirectTo({ + url: './success/success?trade_id=' + trade_id, + }) + } + }) + }).finally(() => { + this.setData({ + loding: false + }) + }) + } + }) + } }) \ No newline at end of file diff --git a/pages/pay/index.wxml b/pages/pay/index.wxml index d873eee..1e7da49 100644 --- a/pages/pay/index.wxml +++ b/pages/pay/index.wxml @@ -1,23 +1,38 @@ - - 支付有效期为10分钟,请尽快支付 - 199.00 - 微信支付 - - - - - 微信支付 - + + + 实付金额 + {{total}} + 订单号{{orderNo}} + + + 选择支付方式 + + + + + + + + + + - - 确认支付 - 确认支付 - - - + 疯狂加载中... \ No newline at end of file diff --git a/pages/pay/index.wxss b/pages/pay/index.wxss index 12efd18..125c70e 100644 --- a/pages/pay/index.wxss +++ b/pages/pay/index.wxss @@ -1,86 +1,22 @@ -page { - background-color: #f4f4f6; -} -.payTop { - text-align: center; - padding: 140rpx 0; -} +.content{ background: white; min-height: 100vh; padding: 0 30rpx; } +.info{ padding:100rpx 50rpx; text-align: center; border-bottom: solid 1rpx #f7f8f9; } +.title{font-weight: bold; line-height: 40rpx;} +.price{ font-weight: bold; font-size: 80rpx; padding: 30rpx 0; line-height: 80rpx; } +.price text{ font-size: 80%; } +.no{ font-size: 28rpx; color: gray; line-height: 40rpx; } -.payTop-price { - font-weight: 600; - font-size: 78rpx; - line-height: 70rpx; - padding: 20rpx 0 0; -} +/* 支付方式 */ +.radio-title{ font-weight: bold; font-size: 30rpx; padding: 30rpx; } +.radio-group{ padding: 0 30rpx; position: relative; } +.radio-flex{ display: flex; align-items: center; justify-content: space-between; padding: 30rpx 0; border-bottom: solid 1rpx #f7f8f9; } +.radio-text{ display: flex; align-items: center; font-size: 30rpx; } +.radio-icon{ width: 58rpx; height: 58rpx; border-radius: 10rpx; margin-right: 30rpx; } +.radio-radio{ transform: scale(.8) } +.radio-lay{ position: absolute; top: 0; left: 0; width: 100%; height: 100%; } -.payTop-price text { - font-size: 36rpx; -} +/* 支付 */ +.pay{ margin-top: 100rpx; } +.pay-btn[size="default"]{ width: 100%; height: 100rpx; line-height: 100rpx; background: #da2b54; color: white; padding: 0; border-radius: 50rpx; font-size: 32rpx; } +.pay-btn[size="default"][disabled]{ opacity: .5; background: #da2b54; color: white;} -.payTop-time, -.payTop-text { - font-size: 28rpx; - color: #666666; -} - -.payWay { - padding: 0 30rpx; - box-sizing: border-box; -} - -.payWay-item { - background-color: #ffffff; - border-radius: 15rpx; - padding: 25rpx 30rpx; - box-sizing: border-box; - display: flex; - line-height: 74rpx; - font-size: 34rpx; - position: relative; -} - -.payWay-img { - width: 74rpx; - height: 74rpx; - margin-right: 20rpx; -} - -.payWay-icon { - width: 42rpx; - height: 42rpx; - position: absolute; - right: 30rpx; - top: 40rpx; -} - - -/* 按钮 */ -.footer { - width: 100%; - height: 100px; - background-color: #f4f4f6; - position: fixed; - left: 0; - bottom: 0; - z-index: 9; - padding: 20px 20px 50rpx; - box-sizing: border-box; -} - -.btn { - line-height: 54px; - background-color: #da2b54; - height: 100%; - text-align: center; - color: #FFFFFF; - border-radius: 10rpx; -} -.btn.active { - background-color: #cacaca; -} - -.grey { - background-color: #f9f9f9; - z-index: 99999; -} \ No newline at end of file diff --git a/pages/pay/success/success.js b/pages/pay/success/success.js new file mode 100644 index 0000000..632eb27 --- /dev/null +++ b/pages/pay/success/success.js @@ -0,0 +1,58 @@ + +var getNum = 0 + +Page({ + /** + * 页面的初始数据 + */ + data: { + loding : true, + success: true + }, + /** + * 生命周期函数--查询支付信息 + */ + onLoad(e){ + if(!e.trade_id){ + wx.showToast({ + title: '参数错误,请联系系统管理员', + icon : 'none' + }) + } + this.getPayState(e.trade_id) + getNum = 0 + }, + /** + * 查询支付结果 + */ + getPayState(trade_id){ + wx.$api.pay.payState(trade_id).then(res => { + console.log(res.data.is_paid) + let { is_paid } = res.data + if(is_paid){ + this.setData({ + success: true, + loding : false + }) + return + } + if(!is_paid && getNum >= 3){ + this.setData({ + success: false, + loding : false + }) + return + } + getNum++ + this.getPayState(trade_id) + }).catch(err => { + console.log(err) + }) + }, + /** + * 返回 + */ + onBack(){ + wx.navigateBack() + } +}) \ No newline at end of file diff --git a/pages/pay/success/success.json b/pages/pay/success/success.json new file mode 100644 index 0000000..c56eedd --- /dev/null +++ b/pages/pay/success/success.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "支付结果" +} \ No newline at end of file diff --git a/pages/pay/success/success.wxml b/pages/pay/success/success.wxml new file mode 100644 index 0000000..46a3fc2 --- /dev/null +++ b/pages/pay/success/success.wxml @@ -0,0 +1,21 @@ + + + + + 查询支付结果中... + + + + + {{success ? '支付成功' : '支付失败'}} + + 订单支付,可在【我的】中查询订单 + 暂未查询到您的订单支付信息 + 如已扣款请稍后前往【我的】查询订单 + + + + + + + diff --git a/pages/pay/success/success.wxss b/pages/pay/success/success.wxss new file mode 100644 index 0000000..d4d68ee --- /dev/null +++ b/pages/pay/success/success.wxss @@ -0,0 +1,11 @@ + +.success{ height: 90vh; width: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; } + +.loding{ width: 42rpx; height: 42rpx; margin-bottom: 50rpx; } +.icon{ width: 128rpx; height: 128rpx; margin-bottom: 40rpx; } +.title{ font-size: 50rpx; font-weight: bold; line-height: 50rpx; margin-bottom: 30rpx; color: #333; } +.text{ font-size: 30rpx; color: gray; margin-bottom: 100px; text-align: center; line-height: 50rpx; } + +.idcard-btn{ padding: 50rpx 60rpx; width: 100vw; box-sizing: border-box; } +.idcard-btn button[size='default']{ background: #da2b54; width: 100%; height: 90rpx; border-radius: 45rpx; color: white; line-height: 90rpx; padding: 0; font-size: 32rpx; } + diff --git a/pages/register/index.js b/pages/register/index.js index cf0c387..bfa5386 100644 --- a/pages/register/index.js +++ b/pages/register/index.js @@ -21,16 +21,6 @@ Page({ code : "", // 验证码 }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad() {}, - - /** - * 生命周期函数--监听页面显示 - */ - onShow() {}, - /** * 手机号码 */ @@ -127,7 +117,7 @@ Page({ code : value.code, password : value.password, password_confirmation : value.password_confirmation, - parent_id : '' + parent_id : getApp().globalData.invite } wx.$api.auth.register(data).then(res => { // 存储登录信息 diff --git a/pages/register/index.json b/pages/register/index.json index 1d4d7bd..2523d93 100644 --- a/pages/register/index.json +++ b/pages/register/index.json @@ -1,5 +1,5 @@ { "usingComponents": {}, - "navigationBarTitleText": "", + "navigationBarTitleText": "账号注册", "navigationBarBackgroundColor": "#f7f6fa" } \ No newline at end of file diff --git a/pages/register/index.wxml b/pages/register/index.wxml index ee64fd2..52102ba 100644 --- a/pages/register/index.wxml +++ b/pages/register/index.wxml @@ -28,8 +28,8 @@ 注册成功 - 恭喜您成功注册,请登录绚火平台 - 立即登录 + 恭喜您已完成注册,点击按钮返回 + 确定 \ No newline at end of file diff --git a/pages/resetPassword/resetPassword.js b/pages/resetPassword/resetPassword.js new file mode 100644 index 0000000..b86f408 --- /dev/null +++ b/pages/resetPassword/resetPassword.js @@ -0,0 +1,131 @@ +Page({ + + /** + * 页面的初始数据 + */ + data: { + codename : '获取验证码', + smsDisabled : false, // 获取验证码 禁止点击 + seeState : false, // 小眼睛 + againState : false, // 小眼睛-再次输入密码 + passwordState : true, // 小眼睛-显示 + passwordAgain : true, // 小眼睛-显示-再次输入密码 + phone : "", // 手机号 + code : "", // 验证码 + }, + /** + * 手机号码 + */ + bindInput(e) { + this.setData({ + phone: e.detail.value + }) + }, + + /** + * 短信验证码 + */ + bindCode(e) { + this.setData({ + code: e.detail.value + }) + }, + + /** + * 获取短信验证码 + */ + getPhoneCode(e) { + let mobile = this.data.phone + var _this = this + if (mobile == "") { + wx.showToast({ + title : '手机号不能为空', + icon : 'none', + duration : 1000 + }) + return false; + }else{ + wx.$api.auth.getSms({ + mobileNo: mobile + }).then(res=>{ + console.log(res) + _this.setData({ + smsDisabled : true + }) + + wx.showToast({ + title : '发送成功', + icon : 'success', + duration: 2000 + }) + var num = 60; + var timer = setInterval(function () { + num--; + if (num <= 0) { + clearInterval(timer); + _this.setData({ + codename : '重新发送', + smsDisabled : false + }) + + } else { + _this.setData({ + codename : num + "s后重新获取", + smsDisabled : true + }) + } + }, 1000) + }).catch(err=>{}) + } + }, + + /** + * 查看密码 + */ + seeClick() { + this.setData({ + seeState : !this.data.seeState, + passwordState: !this.data.passwordState + }) + }, + + /** + * 查看密码-再次 + */ + seeAgain() { + this.setData({ + againState : !this.data.againState, + passwordAgain : !this.data.passwordAgain + }) + }, + + /** + * 重置密码 + */ + registerForm(e) { + wx.showLoading({ + title: '加载中...', + mask : true + }) + + let value = e.detail.value + let data = { + username : this.data.phone, + code : value.code, + password : value.password, + password_confirmation : value.password_confirmation + } + wx.$api.auth.resetPassword(data).then(res => { + wx.hideLoading() + wx.showModal({ + content : res.data, + showCancel : false, + confirmText : '确定', + confirmColor: '#da2b54', + success : () => { + wx.navigateBack() + } + }) + }).catch(() =>{ }) + } +}) \ No newline at end of file diff --git a/pages/resetPassword/resetPassword.json b/pages/resetPassword/resetPassword.json new file mode 100644 index 0000000..1664770 --- /dev/null +++ b/pages/resetPassword/resetPassword.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "找回密码", + "navigationBarBackgroundColor": "#f7f6fa" +} \ No newline at end of file diff --git a/pages/resetPassword/resetPassword.wxml b/pages/resetPassword/resetPassword.wxml new file mode 100644 index 0000000..0c7f3a0 --- /dev/null +++ b/pages/resetPassword/resetPassword.wxml @@ -0,0 +1,35 @@ + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + 注册成功 + 恭喜您已完成注册,点击按钮返回 + 确定 + + + \ No newline at end of file diff --git a/pages/resetPassword/resetPassword.wxss b/pages/resetPassword/resetPassword.wxss new file mode 100644 index 0000000..8033194 --- /dev/null +++ b/pages/resetPassword/resetPassword.wxss @@ -0,0 +1,158 @@ +page { + background-color: #f7f6fa; +} + +.loginImg { + width: 100%; +} + +.loginTitle { + width: 100%; + text-align: center; + padding: 0 50rpx; + box-sizing: border-box; + margin-top: -50rpx; +} + +.site-form { + display: block; + padding: 50rpx 50rpx 20rpx; + box-sizing: border-box; +} + +.inputs { + background: #edebf1; + border: none; + position: relative; + margin-bottom: 40rpx; + height: 100rpx; + line-height: 100rpx; + border-radius: 80rpx; + padding: 0 50rpx; + box-sizing: border-box; + display: flex; + position: relative; +} + +.inputs input { + width: 100%; + height: 100rpx; + line-height: 100rpx; + border: none; + font-size: 32rpx; +} + +.inputs-see { + position: absolute; + right: 50rpx; + top: 32rpx; + width: 38rpx; + height: 38rpx; + z-index: 9; +} + +.sms-btn[size='mini'] { + font-weight: normal; + height: 100rpx; + line-height: 100rpx; + position: absolute; + top: 0; + right: 30rpx; + margin: 0; + border-radius: 0; + border-left: solid 1rpx #f2f2f2; + color: #da2b54 !important; + font-size: 32rpx; + background-color: transparent !important; + z-index: 9; +} + +.btn { + background: #da2b54 !important; + width: 100% !important; + color: white !important; + border-radius: 100rpx; + font-size: 32rpx; + line-height: 100rpx; + height: 100rpx; + font-weight: bold; + font-weight: normal; + padding: 0; +} + +.btn::after { + border: none; +} + +.btn[disabled] { + background: #da2b54 !important; +} + +/* 注册成功弹出 */ +/* 弹出 */ +.refertoEject { + position: fixed; + width: 100vw; + height: 100vh; + left: 0; + top: 0; + background-color: rgba(0, 0, 0, .7); + z-index: 1000; + display: none; +} + +.refertoEject.active { + display: block; +} + +.refertoCont { + -webkit-box-orient: vertical; + -webkit-box-pack: center; + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + z-index: 10000; + padding: 0 15%; + box-sizing: border-box; + text-align: center; + display: none; +} + +.refertoCont.active { + display: -webkit-box; +} + +.refertoWrite { + background-color: white; + border-radius: 20rpx; + overflow: hidden; +} + +.refertoCont-img { + width: 100%; +} + +.refertoCont-name { + padding: 30rpx 0 40rpx; +} + +.refertoCont-title { + color: #da2b54; + font-size: 40rpx; +} + +.refertoCont-text { + padding: 20rpx 0 40rpx; + color: #999999; +} + +.refertoCont-go { + background-color: #da2b54; + display: inline-block; + color: #ffffff; + line-height: 88rpx; + width: 80%; + border-radius: 80rpx; +} \ No newline at end of file diff --git a/pages/search/search.wxss b/pages/search/search.wxss index c16adee..ed31e37 100644 --- a/pages/search/search.wxss +++ b/pages/search/search.wxss @@ -18,6 +18,8 @@ height: 90rpx; line-height: 90rpx; background: #f7f7f7; + border-radius: 45rpx; + overflow: hidden; } .search-input input { @@ -25,16 +27,16 @@ box-sizing: border-box; height: 90rpx; color: #000; - font-size: 28rpx; + font-size: 30rpx; flex: 1; - width: calc(100% - 150rpx); + width: calc(100% - 180rpx); } .search-btn { - font-size: 28rpx; - background: #f1f1f1; - color: #4c4c4c; - width: 150rpx !important; + font-size: 30rpx; + background: #da2b54; + color: white; + width: 180rpx !important; padding: 0 !important; line-height: 90rpx; border-radius: 0; diff --git a/pages/sign/sign.js b/pages/sign/sign.js new file mode 100644 index 0000000..23f2024 --- /dev/null +++ b/pages/sign/sign.js @@ -0,0 +1,66 @@ +// pages/sign/sign.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/sign/sign.json b/pages/sign/sign.json new file mode 100644 index 0000000..b90af49 --- /dev/null +++ b/pages/sign/sign.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "签约" +} \ No newline at end of file diff --git a/pages/sign/sign.wxml b/pages/sign/sign.wxml new file mode 100644 index 0000000..60eb05e --- /dev/null +++ b/pages/sign/sign.wxml @@ -0,0 +1,2 @@ + +pages/sign/sign.wxml diff --git a/pages/sign/sign.wxss b/pages/sign/sign.wxss new file mode 100644 index 0000000..5b1ccef --- /dev/null +++ b/pages/sign/sign.wxss @@ -0,0 +1 @@ +/* pages/sign/sign.wxss */ \ No newline at end of file diff --git a/pages/site/add/add.js b/pages/site/add/add.js index 2b999aa..71daf87 100644 --- a/pages/site/add/add.js +++ b/pages/site/add/add.js @@ -9,10 +9,10 @@ Page({ * 页面的初始数据 */ data: { - nameValue : '', // 姓名 - mobile : '', // 电话 - address : '', // 地址 - isDefault : '', // 默认地址 + nameValue : '', // 姓名 + mobile : '', // 电话 + address : '', // 地址 + isDefault : '', // 默认地址 // 省份选择 areasArr : [], areaId : 0, @@ -28,6 +28,7 @@ Page({ regiId : 0, regiIndex : 0, + // 提交信息 disabled : false }, @@ -55,7 +56,6 @@ Page({ wx.$api.site.create().then(res => { let areas = res.data, areaIndex = this.data.areaIndex - this.setData({ areasArr : areas, areaId : areas[areaIndex].id, @@ -74,8 +74,14 @@ Page({ atcode = area[index].id if (index != this.data.areaIndex) { this.setData({ - areaIndex : index, - areaId : atcode + areaIndex : index, + areaId : atcode, + cityArr : [], + cityId : 0, + cityIndex : 0, + regiArr : [], + regiId : 0, + regiIndex : 0, }) // 获取市级列表 this.citylist(atcode) @@ -91,9 +97,12 @@ Page({ }).then(res=>{ let cityArr = res.data this.setData({ - cityId : cityArr[0].id, - cityIndex : 0, - cityArr : cityArr + cityId : cityArr[0].id, + cityIndex : 0, + cityArr : cityArr, + regiArr : [], + regiId : 0, + regiIndex : 0, }) // 获取区级列表 diff --git a/pages/site/add/add.wxml b/pages/site/add/add.wxml index 7ef256d..b1dc433 100644 --- a/pages/site/add/add.wxml +++ b/pages/site/add/add.wxml @@ -1,44 +1,48 @@ -
- - - - - - - - - - - - - {{ areasArr[areaIndex].name }} + + + + + + - - - - - - - - {{ cityArr[cityIndex].name }} + + + - - - - - - - - {{ regiArr[regiIndex].name }} + + + + + {{ areasArr[areaIndex].name }} + + + + + + + + + {{ cityArr[cityIndex].name }} + + + - - - - - - - - - - -
\ No newline at end of file + + + + + {{ regiArr[regiIndex].name }} + + + + + + + + +
+ + + + +
\ No newline at end of file diff --git a/pages/site/add/add.wxss b/pages/site/add/add.wxss index e6b52c1..58632ec 100644 --- a/pages/site/add/add.wxss +++ b/pages/site/add/add.wxss @@ -1,79 +1,17 @@ -.site-form { - background: white; - display: block; -} -.site-input { - padding: 0 30rpx 0 200rpx; - position: relative; - line-height: 110rpx; - min-height: 110rpx; - border-bottom: 2rpx solid #f3f3f3; -} +.content{ min-height: 100vh; background: #f7f8f9; padding-top: 30rpx; box-sizing: border-box; } -.site-input::before { - position: absolute; - bottom: 0; - left: 30rpx; - right: 0; - height: 1rpx; - content: ""; - background: #e4e6f2; -} +/* 收货地址 */ +.site-form{ background: white; border-radius: 20rpx; margin: 0 30rpx; padding: 20rpx 0; } +.site-input{ display: flex; justify-content: space-between; align-items: center; padding: 0 30rpx;} +.site-input label{ width: 170rpx; font-size: 30rpx; color: #333; line-height: 90rpx; } +.site-input input{ width: calc(100% - 170rpx); font-size: 30rpx; } +.site-input picker{ width: calc(100% - 170rpx); } +.picker{ padding-right: 90rpx; width: 100%; box-sizing: border-box; position: relative; } +.picker-icon{ width: 32rpx; height: 32rpx; position: absolute; right: 0; top: 50%; margin-top: -16rpx; } -.site-input:last-child::before { - display: none; -} +/* 保存地址 */ +.site-btn{ padding: 50rpx 30rpx; } +.site-btn button[size="mini"]{ background: #e92152; height: 90rpx; line-height: 90rpx; width: 100%; border-radius: 45rpx; color: white; font-size: 32rpx; } +.site-btn button[size="mini"][disabled] { background: #e92152; color: #fff; opacity: .5; } -.site-input label { - position: absolute; - left: 30rpx; - top: 0; -} - -.site-input input { - height: 110rpx; -} - -.site-input image { - width: 44rpx; - height: 44rpx; - position: absolute; - right: 20rpx; - top: calc(50% - 22rpx); -} - -.site-btn { - padding: 20rpx 30rpx; - margin-top: 100rpx; -} - -.site-btn button[size="mini"] { - width: 100%; - background: #e92152; - height: 88rpx; - line-height: 88rpx; - font-size: 30rpx; - color: white; - padding: 0; -} - -.site-btn button[disabled] { - background: #e92152 !important; - color: #fff !important; -} - -.site-switch { - font-size: 32rpx; - margin: 30rpx; - display: flex; - line-height: 40rpx; -} - -.site-switch text { - flex: 1; -} - -.site-switch-active { - color: #797979; -} \ No newline at end of file diff --git a/pages/site/edit/edit.js b/pages/site/edit/edit.js index 66880dd..806a10b 100644 --- a/pages/site/edit/edit.js +++ b/pages/site/edit/edit.js @@ -11,17 +11,14 @@ Page({ address : '', isDefault : '', disabled : false, - //省份选择 areas : [], areaId : '', areaIndex : 0, - //市级选择 cityList : [], cityId : 0, cityIndex : 0, - //区域选择 regiList : [], regiId : 0, @@ -90,8 +87,14 @@ Page({ atcode = area[index].id if (index != this.data.areaIndex) { this.setData({ - areaIndex : index, - areaId : atcode + areaIndex : index, + areaId : atcode, + cityList : [], + cityId : 0, + cityIndex : 0, + regiList : [], + regiId : 0, + regiIndex : 0, }) // 获取市级列表 this.citylist(atcode) @@ -107,9 +110,12 @@ Page({ }).then(res=>{ let cityArr = res.data this.setData({ - cityId : cityArr[0].id, - cityIndex : 0, - cityList : cityArr + cityId : cityArr[0].id, + cityIndex : 0, + cityList : cityArr, + regiList : [], + regiId : 0, + regiIndex : 0, }) // 获取区级列表 @@ -208,14 +214,17 @@ Page({ */ addressRemove(){ wx.showModal({ - title : '提示', - content : '是否删除地址', - success : res=> { + title : '提示', + content : '是否删除地址', + confirmText : '删除', + confirmColor: '#e92152', + success : res => { if (res.confirm) { wx.showLoading({ title: '删除中', }) - wx.$api.site.siteDel(this.data.addressId).then(res=>{ + wx.$api.site.siteDel(this.data.addressId).then(() => { + wx.hideLoading() wx.navigateBack() }) } diff --git a/pages/site/edit/edit.wxml b/pages/site/edit/edit.wxml index 646c5ea..23eadf5 100644 --- a/pages/site/edit/edit.wxml +++ b/pages/site/edit/edit.wxml @@ -1,52 +1,53 @@ -
- - - - - - - - - - - - - {{ areas[areaIndex].name }} + + + + + + - - - - - - - - {{ cityList[cityIndex].name }} + + + - - - - - - - - {{ regiList[regiIndex].name }} + + + + + {{ areas[areaIndex].name }} + + + - - - - - - - - - 设置默认地址 - - - - - 删除地址 - - - - -
\ No newline at end of file + + + + + {{ cityList[cityIndex].name }} + + + + + + + + + {{ regiList[regiIndex].name }} + + + + + + + + + + 设置默认地址 + + +
+ + + + 删除地址 + + \ No newline at end of file diff --git a/pages/site/edit/edit.wxss b/pages/site/edit/edit.wxss index 0a571a8..6d53157 100644 --- a/pages/site/edit/edit.wxss +++ b/pages/site/edit/edit.wxss @@ -1,99 +1,19 @@ -.site-form { - background: white; - display: block; -} -.site-input { - padding: 0 30rpx 0 200rpx; - position: relative; - line-height: 110rpx; - min-height: 110rpx; -} +.content{ min-height: 100vh; background: #f7f8f9; padding-top: 30rpx; box-sizing: border-box; } -.site-input::before { - position: absolute; - bottom: 0; - left: 30rpx; - right: 0; - height: 1rpx; - content: ""; - background: #e4e6f2; -} +/* 收货地址 */ +.site-form{ background: white; border-radius: 20rpx; margin: 0 30rpx; padding: 20rpx 0; } +.site-input{ display: flex; justify-content: space-between; align-items: center; padding: 0 30rpx;} +.site-input label{ width: 170rpx; font-size: 30rpx; color: #333; line-height: 90rpx; } +.site-input input{ width: calc(100% - 170rpx); font-size: 30rpx; } +.site-input picker{ width: calc(100% - 170rpx); } +.picker{ padding-right: 90rpx; width: 100%; box-sizing: border-box; position: relative; } +.picker-icon{ width: 32rpx; height: 32rpx; position: absolute; right: 0; top: 50%; margin-top: -16rpx; } +.site-switch{ display: flex; align-items: center; justify-content: space-between; padding: 0 30rpx; height: 90rpx; color: #333; } -.site-input:last-child::before { - display: none; -} +/* 保存地址 */ +.site-btn{ padding: 50rpx 30rpx 30rpx; } +.site-btn button[size="mini"]{ background: #e92152; height: 90rpx; line-height: 90rpx; width: 100%; vertical-align: top; border-radius: 45rpx; color: white; font-size: 32rpx; } +.site-btn button[size="mini"][disabled] { background: #e92152; color: #fff; opacity: .5; } +.site-del{ margin: 0 30rpx; line-height: 90rpx; text-align: center; color: #e92152; background: white; border-radius: 45rpx; } -.site-input label { - position: absolute; - left: 30rpx; - top: 0; -} - -.site-input input { - height: 110rpx; -} - -.site-input image { - width: 44rpx; - height: 44rpx; - position: absolute; - right: 20rpx; - top: calc(50% - 22rpx); -} - -.site-btn { - padding: 20rpx 30rpx; - margin-top: 100rpx; -} - -.site-btn button[size="mini"] { - width: 100%; - background: #e92152; - height: 88rpx; - line-height: 88rpx; - font-size: 30rpx; - color: white; - padding: 0; -} - -.site-btn button[disabled] { - background: #e92152 !important; - color: #fff !important; -} - -.site-switch { - font-size: 32rpx; - margin: 30rpx; - display: flex; - line-height: 40rpx; -} - -.site-switch text { - flex: 1; -} - -.site-switch-active { - color: #797979; -} - -.site-del { - width: 100%; - text-align: center; - margin-top: 40rpx; - padding-top: 60rpx; - border-top: 2rpx solid rgb(228, 230, 242); - color: #ff9951; -} - -.site-del-btn { - text-align: center; -} - -.site-del-img { - width: 46rpx; - height: 46rpx; - display: inline-block; - vertical-align: -10rpx; - margin-right: 5rpx; -} \ No newline at end of file diff --git a/pages/site/index.wxml b/pages/site/index.wxml index d31a91f..76d0f73 100644 --- a/pages/site/index.wxml +++ b/pages/site/index.wxml @@ -1,25 +1,16 @@ - - - - - + + - - - {{item.name}} - - - {{item.mobile}} - - - 默认 - + {{item.full_address}} + + {{item.name}} + {{item.mobile}} + 默认 - {{item.full_address}} - + diff --git a/pages/site/index.wxss b/pages/site/index.wxss index 906ae0a..e10027a 100644 --- a/pages/site/index.wxss +++ b/pages/site/index.wxss @@ -1,116 +1,21 @@ -page{ - background-color: #f4f4f6; -} -.list { - border-bottom: 90px solid transparent; - padding: 30rpx; - box-sizing: border-box; -} +/* 地址列表 */ +.list{ padding: 30rpx 0 180rpx; height: 100vh; box-sizing: border-box; background: #f7f8f9; } +.address{ background: white; border-radius: 20rpx; margin: 0 30rpx; } +.address-flex{ display: flex; justify-content: space-between; align-items: center; padding: 30rpx; } +.address-icon{ width: 38rpx; height: 38rpx; } +.address-btn{ width: 38rpx; height: 38rpx; } +.address-cont{ width: calc(100% - 76rpx); padding: 0 30rpx; box-sizing: border-box; } +.address-text{ font-size: 30rpx; line-height: 40rpx; font-weight: bold; padding-bottom: 15rpx; } +.address-info{ display: flex; align-items: center; } +.address-tag{ color: white; height: 30rpx; display: inline-block; font-size: 20rpx; background: #e92152; padding: 0 10rpx; border-radius: 10rpx; margin-left: 10rpx; } +.address-name{ font-size: 30rpx; max-width: 200rpx; } +.address-mobile{ padding-left: 20rpx; color: gray; } +.select{ text-align: center; color: #e92152; border-top: solid 1rpx #f7f8f9; font-size: 30rpx; line-height: 90rpx; } -.address { - background-color: #FFFFFF; - margin-bottom: 30rpx; - padding: 30rpx; - box-sizing: border-box; - border-radius: 10rpx; -} - -.address:last-child { - margin-bottom: 0; -} - -.address-top { - display: flex; -} - -.address-img { - background-color: #eeeeee; - border-radius: 50%; - width: 60rpx; - height: 60rpx; - padding: 10rpx; - box-sizing: border-box; - margin-top: 25rpx; -} - -.address-img image { - width: 100%; - height: 100%; -} - -.address-btn { - width: 40rpx; - height: 40rpx; - margin-top: 62rpx; -} - -.address-cont { - width: calc(100% - 102rpx); - padding: 0 30rpx; - box-sizing: border-box; -} - -.address-cont-title { - display: flex; - margin-bottom: 20rpx; - line-height: 44rpx; -} - -.address-cont-mobile { - margin: 0 20rpx; - color: rgb(104, 104, 104); -} - -.address-cont-default { - background-color: #ff9951; - color: #FFFFFF; - font-size: 24rpx; - border-radius: 40rpx; - padding: 0 15rpx; - height: 38rpx; - line-height: 38rpx; - margin-top: 2rpx; -} - -.address-cont-text { - line-height: 42rpx; - font-size: 28rpx; -} - -.select { - text-align: right; - padding-top: 30rpx; -} - -.select-btn { - border: 2rpx solid #e92152; - color: #ff9951; - display: inline-block; - font-size: 28rpx; - padding: 0 30rpx; - line-height: 54rpx; - border-radius: 5rpx; -} +/* 空页面 */ +.pages-hint{ padding-bottom: 180rpx; } /* 按钮 */ -.footer { - width: 100%; - height: 90px; - background-color: #FFFFFF; - position: fixed; - left: 0; - bottom: 0; - z-index: 9; - padding: 20px; - box-sizing: border-box; -} - -.btn { - line-height: 50px; - background-color: #e92152; - height: 100%; - text-align: center; - color: #FFFFFF; - border-radius: 10rpx; -} \ No newline at end of file +.footer { width: 100%; background-color: #FFFFFF; position: fixed; left: 0; bottom: 0; z-index: 9; padding: 30rpx 30rpx 60rpx; box-sizing: border-box; } +.footer .btn { line-height: 90rpx; padding: 0; font-size: 32rpx; font-weight: bold; background-color: #e92152; text-align: center; color: #FFFFFF; border-radius: 45rpx; } diff --git a/pages/user/code/code.js b/pages/user/code/code.js index 7c48f6a..40ffeb3 100644 --- a/pages/user/code/code.js +++ b/pages/user/code/code.js @@ -13,7 +13,6 @@ Page({ shareSee : false, //分享弹出 inviteText : '', //邀请码 inviteCode : '', //二维码 - //海报 canvas : '' }, @@ -38,7 +37,7 @@ Page({ */ onShow() { // 小程序码 - // this.ShareInfo(); + this.ShareInfo(); }, /** @@ -46,7 +45,7 @@ Page({ */ ShareInfo() { wx.$api.user.miniShare({ - url: '/pages/mall/index' + url: 'pages/mall/index' }).then(res => { this.setData({ inviteCode: res.data.qrcode @@ -151,9 +150,7 @@ Page({ // 返回上一页 returnGo() { - wx.navigateBack({ - delta: 1 - }) + wx.navigateBack() }, /** diff --git a/pages/user/code/code.wxml b/pages/user/code/code.wxml index 5c10c85..ef26c17 100644 --- a/pages/user/code/code.wxml +++ b/pages/user/code/code.wxml @@ -1,7 +1,10 @@ + + + @@ -20,16 +23,18 @@ - - - - - - 保存二维码 + + + + + + + 保存二维码 + + 取消 - 取消 - \ No newline at end of file + diff --git a/pages/user/code/code.wxss b/pages/user/code/code.wxss index 7972b93..05f6a2f 100644 --- a/pages/user/code/code.wxss +++ b/pages/user/code/code.wxss @@ -1,148 +1,31 @@ /* 返回上一页 */ -.navigation{ - position: fixed; - top: 0; - left: 0; - z-index: 99; - width: 100%; - height: 90rpx; - background-color: transparent; - transition: .2s; -} +.navigation{ position: fixed; top: 0; left: 0; z-index: 9; width: 100%; height: 90rpx; background-color: transparent; transition: .2s; } +.navigation.active { background-color: transparent; } +.navigation-arrow { width: 44rpx; height: 44rpx; margin: 20rpx 15rpx 0 20rpx; } -.navigation.active { - background-color: transparent; -} +/* 二维码海报 */ +.code { width: 100vw; height: 100vh; position: relative; } +.code-back { position: absolute; left: 0; top: 0; width: 100%; height: 100%; } +.code-cont { width: 400rpx; position: absolute; z-index: 9; text-align: center; left: calc(50% - 200rpx); bottom: 8vh; } +.code-img{ margin: 0 auto 20rpx; overflow: hidden; width: 260rpx; height: 260rpx; border: 4rpx solid #ff4f64; background-color: #ffffff; padding: 10rpx; box-sizing: border-box; border-radius: 50%; } +.code-img image { width: 100%; } +.code-text { color: #ffffff; font-size: 30rpx; } -.navigation-arrow { - width: 44rpx; - height: 44rpx; - margin: 20rpx 15rpx 0 20rpx; +/* 海报分享 */ +.code-share { position: absolute; right: 0; bottom: 15%; background: linear-gradient(to right, #fffafb, #ffd4dd); width: 50rpx; text-align: center; border-radius: 26rpx 0 0 26rpx; padding: 30rpx 10rpx 30rpx 15rpx; box-shadow: 0 0 0 6rpx rgba(249, 96, 116, .8); z-index: 9; } +.code-share-name { writing-mode:vertical-rl; font-size: 30rpx; padding-left: 4rpx; color: #da2b54; } +.code-share image { width: 36rpx; height: 36rpx; margin-bottom: 5rpx; } - -/* 二维码 */ -.code { - width: 100vw; - height: 100vh; - position: relative; -} - -.code-back { - position: absolute; - left: 0; - top: 0; - width: 100%; - height: 100%; -} - -.code-cont { - width: 400rpx; - position: absolute; - z-index: 9; - text-align: center; - left: calc(50% - 200rpx); - bottom: 5%; -} - -.code-img{ - margin: 0 auto 20rpx; - overflow: hidden; - width: 260rpx; - height: 260rpx; - border: 4rpx solid #ff4f64; - background-color: #ffffff; - padding: 10rpx; - box-sizing: border-box; -} - -.code-img image { - width: 100%; -} - -.code-text { - color: #ffffff; - font-size: 32rpx; -} - -.code-share { - position: absolute; - z-index: 10; - right: 0; - bottom: 15%; - background: linear-gradient(to right, #fffafb, #ffd4dd); - width: 50rpx; - text-align: center; - border-radius: 26rpx 0 0 26rpx; - padding: 30rpx 10rpx 30rpx 15rpx; - box-shadow: 0 0 0 6rpx rgba(249, 96, 116, .8); -} - -.code-share-name { - writing-mode:vertical-rl; - font-size: 30rpx; - padding-left: 4rpx; - color: #da2b54; -} - -.code-share image { - width: 36rpx; - height: 36rpx; - margin-bottom: 5rpx; -} - -.sharePop { - position: fixed; - width: 100%; - z-index: 99; - left: 0; - bottom: 0; - background-color: #ffffff; - display: none; -} - -.sharePop.active { - display: block; -} - -.shareCont-label image { - width: 60rpx; - height: 60rpx; - display: block; - margin: 0 auto 10rpx; -} - -.shareCancel { - border-top: 2rpx solid #ebebeb; - color: #000000; - width: 100%; - text-align: center; - line-height: 100rpx; -} - -.shareCont{ - display: flex; - padding: 30rpx 0; -} - -.shareCont-label { - color: #000000; - flex: 2; - text-align: center; - font-size: 28rpx; -} - -.codeShare-button { - background-color: transparent; - padding: 0; - font-weight: normal; -} +/* 弹出层 */ +.sharePop-lay{ background: rgba(0, 0, 0, .5); position: fixed; top: 0; left: 0; right: 0; height: 100vh; width: 100vw; z-index: 9; display: none; } +.sharePop-lay.active{ display: block; } +.sharePop { position: fixed; width: 100%; z-index: 99; left: 0; bottom: 0; background-color: #ffffff; } +.shareCont-label image { width: 60rpx; height: 60rpx; display: block; margin: 0 auto 10rpx; } +.shareCancel { border-top: 2rpx solid #ebebeb; color: #000000; width: 100%; text-align: center; line-height: 100rpx; } +.shareCont{ display: flex; padding: 30rpx 0; } +.shareCont-label { color: #000000; flex: 2; text-align: center; font-size: 28rpx; } +.codeShare-button { background-color: transparent; padding: 0; font-weight: normal; } /* canvas */ -.canvas-img { - position: fixed; - left: 0%; - /* left: -10000%; */ - top: 0; - z-index: 99; -} \ No newline at end of file +.canvas-img { position: fixed; left: 0%; left: -100%; top: 0; z-index: -1; } \ No newline at end of file diff --git a/pages/user/index.js b/pages/user/index.js index c012f08..868bd4b 100644 --- a/pages/user/index.js +++ b/pages/user/index.js @@ -8,15 +8,10 @@ Page({ * 页面的初始数据 */ data: { - userLogin: false, - userData: '', // 用户信息 + userLogin : false, + userData : '', }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad(options) {}, - /** * 生命周期函数--监听页面显示 */ @@ -31,7 +26,8 @@ Page({ return } this.setData({ - userLogin: false + userLogin: false, + userData : '' }) }, @@ -43,16 +39,31 @@ Page({ this.setData({ userData: res.data }) - console.log(res) - }).catch(err => {}) + }) }, - /** * 处理未登录时的转跳 */ userNav(e){ let pageUrl = e.currentTarget.dataset.url if(wx.getStorageSync("token") != ''){ + if(e.currentTarget.dataset.type && e.currentTarget.dataset.type == 'needSign' && this.data.userData.need_sign){ + wx.showModal({ + title : '提示', + content : '您还未完成实名认证与签约成为VIP用户,无法获得邀请码', + cancelText : '稍后完成', + confirmText : '立即完善', + confirmColor : '#da2b54', + complete : res => { + if (res.confirm) { + wx.navigateTo({ + url: '/pages/idcard/idcard' + }) + } + } + }) + return + } wx.navigateTo({ url: pageUrl }) @@ -62,5 +73,16 @@ Page({ url: "/pages/login/index" }) } + }, + /** + * 购买产品 + */ + onBuy(e){ + let { id } = e.currentTarget.dataset + if(id){ + wx.navigateTo({ + url: '/pages/mall/details/details?id=' + id, + }) + } } }) \ No newline at end of file diff --git a/pages/user/index.wxml b/pages/user/index.wxml index dfa2652..8f9241c 100644 --- a/pages/user/index.wxml +++ b/pages/user/index.wxml @@ -51,10 +51,6 @@ 已签收 - @@ -67,15 +63,15 @@ 我的账户 - + 我的团队 - + 邀请码 @@ -83,9 +79,9 @@ 我的地址 - + - 意见反馈 + 实名认证 @@ -105,7 +101,7 @@ 为你推荐 - + diff --git a/pages/user/index.wxss b/pages/user/index.wxss index 125118c..20bbab1 100644 --- a/pages/user/index.wxss +++ b/pages/user/index.wxss @@ -91,11 +91,12 @@ page { } .order-icon { - width: 56rpx; + width: 52rpx; } .order-label { font-size: 26rpx; + color: #333; } .order--number { @@ -120,8 +121,7 @@ page { } .tool-icon { - width: 62rpx; - margin-bottom: 10rpx; + width: 52rpx; } /* 推荐 */ @@ -230,7 +230,7 @@ page { .goodsItem-price { flex: 1; - color: #ff1122; + color: #da2b54; font-size: 32rpx; font-weight: 600; } diff --git a/pages/user/setup/setup.wxss b/pages/user/setup/setup.wxss index f55710c..3cbb0fc 100644 --- a/pages/user/setup/setup.wxss +++ b/pages/user/setup/setup.wxss @@ -147,7 +147,7 @@ page { padding: 0 !important; background-color: transparent; font-weight: normal !important; - color: #6c78f8; + color: #da2b54; } .publicPop-btn-go { diff --git a/pages/user/team/index.wxss b/pages/user/team/index.wxss index 47b6488..019dfed 100644 --- a/pages/user/team/index.wxss +++ b/pages/user/team/index.wxss @@ -123,6 +123,7 @@ page { padding: 120rpx 0; color: #6d6d6d; font-size: 28rpx; + border-radius: 20rpx; } .pages-no image { diff --git a/pages/withdraw/withdraw.js b/pages/withdraw/withdraw.js new file mode 100644 index 0000000..8355dcf --- /dev/null +++ b/pages/withdraw/withdraw.js @@ -0,0 +1,148 @@ +Page({ + + /** + * 页面的初始数据 + */ + data: { + banks : [], + type : 1, + bankVal : 0, + isDisabled : false, + balance : 0, + greater : false, + rate : 0, + min : 0, + name : '', + idcard : '', + identity : { + name : '', + id_card_no : '' + }, + bankNo : '', + mobile : '', + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad() { + wx.$api.withdraw.create().then(res => { + let { bank, tax, min, balance, banks, id_card, has_bank} = res.data; + let banksArr = [{ id: '', name: '请选择开户银行'}].concat(banks) + this.setData({ + banks : banksArr, + balance : balance, + rate : tax, + min : min, + name : id_card.name, + idcard : id_card.id_card_no, + identity : id_card, + isDisabled : has_bank + }) + if(has_bank){ + let bankIndex = banksArr.findIndex(val => val.name === bank.bank_name) + this.setData({ + type : bank.message_type, + bankNo : bank.bank_no, + mobile : bank.mobile, + bankVal : bankIndex >= 0 ? bankIndex: 0 + }) + } + }) + }, + /** + * 选择提现类型 + */ + onTypeTab(e){ + let { type } = e.currentTarget.dataset + if(type == this.data.type) return + if(this.data.isDisabled){ + wx.showToast({ + title: "银行卡信息已绑定,如需变更请联系系统管理员", + icon : "none" + }) + return + } + + if(type == 1){ + this.setData({ + name : this.data.identity.name, + idcard : this.data.identity.id_card_no + }) + }else{ + this.setData({ + name : '', + idcard : '' + }) + } + this.setData({ + type + }) + }, + /** + * 选择开户银行 + */ + bankChange(e){ + let { value } = e.detail; + this.setData({ + bankVal: value + }) + }, + /** + * 全部提现 + */ + onAll(){ + this.setData({ + amount: this.data.balance + }) + }, + /** + * 输入提现金额 + */ + onInput(e){ + let { value } = e.detail; + this.setData({ + greater: parseFloat(value) > parseFloat(this.data.balance) + }) + }, + /** + * 提现 + */ + onSubmit(e){ + if(this.data.bankVal == 0){ + wx.showToast({ + title: '请选择开户银行', + icon : 'none' + }) + return + } + wx.showLoading({ + title: '提交中...', + mask : true + }) + let valueObj = e.detail.value + let data = { + bank_name : this.data.banks[this.data.bankVal].name, + amount : valueObj.amount, + name : valueObj.name, + mobileNo : valueObj.mobile, + bank_no : valueObj.bankNo, + id_card : valueObj.idcard || '', + message_type: this.data.type, + } + wx.$api.withdraw.withdraws(data).then(res => { + wx.hideLoading() + wx.showModal({ + title : '提示', + content : res.data, + showCancel : false, + confirmColor : '#da2b54', + success : ModalRes => { + if(ModalRes.confirm){ + wx.navigateBack() + } + } + }) + }).catch(err => {}) + } +}) \ No newline at end of file diff --git a/pages/withdraw/withdraw.json b/pages/withdraw/withdraw.json new file mode 100644 index 0000000..2311639 --- /dev/null +++ b/pages/withdraw/withdraw.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "提现" +} \ No newline at end of file diff --git a/pages/withdraw/withdraw.wxml b/pages/withdraw/withdraw.wxml new file mode 100644 index 0000000..991ec2d --- /dev/null +++ b/pages/withdraw/withdraw.wxml @@ -0,0 +1,52 @@ + + +
+ + + 本人银行卡 + 非本人银行卡 + + + + + + {{banks[bankVal].name}} + + + + + + + + + + + + + + + + + + + + + + + + 提现金额 + 最小提现金额:{{min}}元,提现手续费{{rate}}% + + + + + 当前账户余额{{balance}}全部提现 + 输入金额超过账户余额 + + + +
+
+ + 后台提现管理时间 上午11:00-12:00 下午17:00-18:00 +
\ No newline at end of file diff --git a/pages/withdraw/withdraw.wxss b/pages/withdraw/withdraw.wxss new file mode 100644 index 0000000..80d91c8 --- /dev/null +++ b/pages/withdraw/withdraw.wxss @@ -0,0 +1,35 @@ + +.content{ min-height: 100vh; background: #f7f8f9; padding: 30rpx; box-sizing: border-box; } + +/* 提现前置 */ +.hint{ font-size: 28rpx; line-height: 90rpx; text-align: center; color: gray; } +.block{ background: white; border-radius: 20rpx; overflow: hidden; } +.block-title{ font-size: 30rpx; font-weight: bold; line-height: 50rpx; } + +/* 银行信息 */ +.bank{ background: #fdfdfd; padding: 50rpx; } +.bank-tabs{ margin-bottom: 30rpx; display: flex; align-items: center; line-height: 100rpx; } +.bank-tabs > .item{ width: 50%; text-align: center; font-size: 30rpx; } +.bank-tabs > .item.active{ color: #da2b54; font-weight: bold; } +.bank-input{ display: flex; justify-content: space-between; height: 90rpx; line-height: 90rpx; font-size: 30rpx; background: #f7f8f9; border-radius: 10rpx; margin-bottom: 30rpx; padding: 0 30rpx; } +.bank-input label{ width: 150rpx; color: #333; } +.bank-input input{ font-size: 30rpx; width: calc(100% - 150rpx); height: 90rpx; vertical-align: top; text-align: right; } +.banks-picker{ font-size: 30rpx; width: calc(100% - 150rpx); text-align: right; } +.banks-text{ display: flex; align-items: center; justify-content: flex-end; } +.banks-text.gray{ color: gray; } +.banks-icon{ vertical-align: middle; margin-left: 10rpx; width: 24rpx; height: 24rpx; } + + +/* 提现金额 */ +.cny{ padding: 50rpx; border-top: dashed 1rpx #ddd; } +.cny-title{ padding-bottom: 20rpx; line-height: 40rpx; font-size: 30rpx; color: #333; } +.cny-title text{ font-size: 90%; color: gray; } +.cny-input{ display: flex; font-size: 60rpx; height: 120rpx; line-height: 120rpx; font-weight: 500; font-family: Arial, Helvetica, sans-serif; border-bottom: solid 1rpx #ddd; } +.cny-input input{ flex: 1; height: 120rpx; padding: 0; margin: 0; font-size: 70rpx; } +.cny-balance{ font-size: 28rpx; line-height: 60rpx; padding-top: 20rpx; } +.cny-balance text{ color:#da2b54; margin-left: 10rpx; } +.cny-balance.red{ color: red; } +.cny-btn[size="default"]{ width: 100%; height: 90rpx; line-height: 90rpx; border-radius: 45rpx; background: #da2b54; color: white; font-size: 32rpx; margin-top: 50rpx; padding: 0;} +.cny-btn[size="default"][disabled]{ background: #da2b54; color: white; opacity: .5; } + + diff --git a/project.private.config.json b/project.private.config.json index b054770..07750c4 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -1,6 +1,6 @@ { "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", - "projectname": "xuan_wechat", + "projectname": "%E7%82%AB%E7%81%AB", "setting": { "compileHotReLoad": true, "urlCheck": true @@ -9,8 +9,29 @@ "miniprogram": { "list": [ { - "name": "", - "pathName": "pages/login/index", + "name": "详情详情", + "pathName": "pages/mall/details/details", + "query": "id=4&invite=", + "launchMode": "default", + "scene": null + }, + { + "name": "支付成功", + "pathName": "pages/pay/success/success", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "提现", + "pathName": "pages/withdraw/withdraw", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "实名认证", + "pathName": "pages/idcard/idcard", "query": "", "launchMode": "default", "scene": null diff --git a/static/icons/add_icon.png b/static/icons/add_icon.png new file mode 100644 index 0000000..addb8f4 Binary files /dev/null and b/static/icons/add_icon.png differ diff --git a/static/icons/fali_icon.png b/static/icons/fali_icon.png new file mode 100644 index 0000000..502fb08 Binary files /dev/null and b/static/icons/fali_icon.png differ diff --git a/static/icons/idcard_success.png b/static/icons/idcard_success.png new file mode 100644 index 0000000..a68dc7b Binary files /dev/null and b/static/icons/idcard_success.png differ diff --git a/static/icons/notice.png b/static/icons/notice.png index e488bb6..84994da 100644 Binary files a/static/icons/notice.png and b/static/icons/notice.png differ diff --git a/static/icons/success_icon.png b/static/icons/success_icon.png new file mode 100644 index 0000000..02158ba Binary files /dev/null and b/static/icons/success_icon.png differ diff --git a/static/imgs/capsule.png b/static/imgs/capsule.png new file mode 100644 index 0000000..c98a010 Binary files /dev/null and b/static/imgs/capsule.png differ diff --git a/static/imgs/tool_01.png b/static/imgs/tool_01.png index 52400c8..e7c3348 100644 Binary files a/static/imgs/tool_01.png and b/static/imgs/tool_01.png differ diff --git a/static/imgs/tool_02.png b/static/imgs/tool_02.png index 99d7009..ca6aaea 100644 Binary files a/static/imgs/tool_02.png and b/static/imgs/tool_02.png differ diff --git a/static/imgs/tool_03.png b/static/imgs/tool_03.png index 2acd08d..797ab6a 100644 Binary files a/static/imgs/tool_03.png and b/static/imgs/tool_03.png differ diff --git a/static/imgs/tool_04.png b/static/imgs/tool_04.png index 3f149ef..8bc5d72 100644 Binary files a/static/imgs/tool_04.png and b/static/imgs/tool_04.png differ diff --git a/static/imgs/tool_05.png b/static/imgs/tool_05.png index 46f46ba..9c2c0f1 100644 Binary files a/static/imgs/tool_05.png and b/static/imgs/tool_05.png differ diff --git a/static/imgs/tool_06.png b/static/imgs/tool_06.png index ff87f70..e6baee4 100644 Binary files a/static/imgs/tool_06.png and b/static/imgs/tool_06.png differ diff --git a/static/imgs/tool_07.png b/static/imgs/tool_07.png index 87e12e0..115664d 100644 Binary files a/static/imgs/tool_07.png and b/static/imgs/tool_07.png differ diff --git a/static/imgs/tool_08.png b/static/imgs/tool_08.png index 166a577..47aa73b 100644 Binary files a/static/imgs/tool_08.png and b/static/imgs/tool_08.png differ diff --git a/static/pay/coin.png b/static/pay/coin.png new file mode 100644 index 0000000..97d40a6 Binary files /dev/null and b/static/pay/coin.png differ diff --git a/static/pay/wechat.png b/static/pay/wechat.png new file mode 100644 index 0000000..c7844b1 Binary files /dev/null and b/static/pay/wechat.png differ