commit 5a6b3517e6e92bc52f1834bdd1bf3f6b2f1e767e Author: zhangjing Date: Sat Jul 22 19:04:56 2023 +0800 锶源昆仑会员+体验官 diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..115cc02 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,31 @@ +/* + * Eslint config file + * Documentation: https://eslint.org/docs/user-guide/configuring/ + * Install the Eslint extension before using this feature. + */ +module.exports = { + env: { + es6: true, + browser: true, + node: true, + }, + ecmaFeatures: { + modules: true, + }, + parserOptions: { + ecmaVersion: 2018, + sourceType: 'module', + }, + globals: { + wx: true, + App: true, + Page: true, + getCurrentPages: true, + getApp: true, + Component: true, + requirePlugin: true, + requireMiniProgram: true, + }, + // extends: 'eslint:recommended', + rules: {}, +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..ca6fe06 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "git.ignoreLimitWarning": true +} \ No newline at end of file diff --git a/api/err.js b/api/err.js new file mode 100644 index 0000000..bbfd4b5 --- /dev/null +++ b/api/err.js @@ -0,0 +1,54 @@ + +/** + * 处理错误信息 + * @property {Object} errInfo + */ + +const errInfo = (obj) =>{ + if(obj.status_code == 401){ + wx.showModal({ + title : "登录提示", + content : "长时间未操作,登录已过期,请重新登录", + showCancel : false, + confirmColor: "#0b0041", + confirmText : "确定", + success : ()=>{ + // 清理客户端登录缓存 + wx.removeStorageSync("token") + // 返回首页 + wx.redirectTo({ + url: "/pages/login/index", + }) + } + }) + }else if(obj.status_code == 422){ + wx.showToast({ + title: obj.message, + icon : "none" + }) + }else if(obj.status_code == 400 || obj.status_code == 0){ + wx.showToast({ + title: obj.message, + icon : "none" + }) + }else if(obj.status_code == 404){ + wx.showToast({ + title: "接口地址不存在,请联系系统管理员", + icon : "none" + }) + }else if(obj.status_code == 500){ + wx.showToast({ + title: "服务端:" + obj.message, + icon : "none" + }) + }else { + wx.showToast({ + title: "code:" + obj.status_code + ", msg:" + obj.message, + icon : "none" + }) + } +} + +module.exports = { + errInfo +} diff --git a/api/index.js b/api/index.js new file mode 100644 index 0000000..e8c0674 --- /dev/null +++ b/api/index.js @@ -0,0 +1,35 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + + // 体验官 +import index from "./interfaces/index" + + // 商城 +import mall from "./interfaces/mall" + +// 锶人中心 +import user from "./interfaces/user" + +// 授权登录 +import auth from "./interfaces/auth" + +// 图片上传 +import file from "./interfaces/file" + +// 库存 +import stock from "./interfaces/stock" + +// 档案 +import member from "./interfaces/member" + +export default{ + index, + mall, + user, + auth, + file, + stock, + member +} diff --git a/api/interfaces/auth.js b/api/interfaces/auth.js new file mode 100644 index 0000000..526f9d1 --- /dev/null +++ b/api/interfaces/auth.js @@ -0,0 +1,21 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +import {req} from "../request" + +//验证码登录 +const smsAuth = data => req({url: "user/auth/sms", method: "POST", data: data}) + +//获取验证码 +const getSms = data => req({url: "user/auth/verify", method: "POST", data: data}) + +//隐私+协议 +const registeragree = (website) => req({url: "cms/pages/" + website}) + +export default({ + smsAuth, + getSms, + registeragree +}) \ No newline at end of file diff --git a/api/interfaces/file.js b/api/interfaces/file.js new file mode 100644 index 0000000..8e56170 --- /dev/null +++ b/api/interfaces/file.js @@ -0,0 +1,11 @@ +/* + * 图图片上传公用接口 + */ +import {upload} from "../request" + +//图上传 +const uploadImg = (imgPaht, data) => upload({url: "storage/upload", method: "POST", key: "upload", path: imgPaht, data: data}) + +export default({ + uploadImg +}) diff --git a/api/interfaces/index.js b/api/interfaces/index.js new file mode 100644 index 0000000..dda74d6 --- /dev/null +++ b/api/interfaces/index.js @@ -0,0 +1,45 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +import {req} from "../request" + +//首页 +const home = () => req({url: "gout"}) + +//商品详情 +const goods = (activity_id) => req({url: "mall/activities/" + activity_id}) + +//打卡海报背景 +const poster = () => req({url: "user/sign/backgrounds"}) + +//喝水打卡 +const sign = () => req({url: "user/sign", method: 'POST'}) + +//喝水补卡 +const replenish = (data) => req({url: "user/sign/replenish", method: 'POST', data: data}) + +//喝水打卡日历 +const calendar = () => req({url: "user/sign"}) + +//反馈列表 +const surveys = (data) => req({url: "gout/surveys", data: data}) + +//反馈列表 +const surveysForm = (data) => req({url: "gout/surveys", method: 'POST', data: data}) + +//我的反馈前置 +const feedback = () => req({url: "gout/result/" + user_case_id + "/logs"}) + +export default({ + home, + goods, + poster, + sign, + replenish, + calendar, + surveys, + surveysForm, + feedback +}) \ No newline at end of file diff --git a/api/interfaces/mall.js b/api/interfaces/mall.js new file mode 100644 index 0000000..5b343fa --- /dev/null +++ b/api/interfaces/mall.js @@ -0,0 +1,49 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +import {req} from "../request" + +//商城首页 +const index = () => req({url: "mall"}) + +//商品详情 +const goodsShow = (goods) => req({url: "mall/goods/" + goods}) + +//创建订单 +const foundOrder = (data) => req({url: "mall/buy/goods", data: data}) + +//确认订单 +const affirmOrder = (data) => req({url: "mall/buy/goods", method: 'POST', data: data}) + +//水滴支付 +const affirmPay = (order_no) => req({url: "mall/pay/" + order_no + "/score", method: 'POST'}) + +//文章详情 +const articlesSee = (article_id) => req({url: "cms/articles/" + article_id}) + +// //文章列表 +const articlesList = (data) => req({url: "cms/articles", data: data}) +//收藏 +const favorite = (article_id) => req({url: "cms/articles/favorite/" + article_id}) +//点赞 +const subscribe = (article_id) => req({url: "cms/articles/subscribe/" + article_id}) +//文章列表-全部分类 +const classifysAll = () => req({url: "cms/categories"}) +//文章列表-全部 +const favorites = (data) => req({url: "cms/articles", data: data}) + +export default({ + index, + goodsShow, + foundOrder, + affirmOrder, + affirmPay, + articlesSee, + articlesList, + favorite, + subscribe, + classifysAll, + favorites +}) \ No newline at end of file diff --git a/api/interfaces/member.js b/api/interfaces/member.js new file mode 100644 index 0000000..0939853 --- /dev/null +++ b/api/interfaces/member.js @@ -0,0 +1,61 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +import {req} from "../request" + +//添加病例-前置 +const goutCreate = () => req({url: "gout/result/create"}) + +//添加病例 +const goutAdd = (data) => req({url: "gout/result", method: 'POST', data: data}) + +// 查看病例 +const goutSee = () => req({url: "gout/result"}) + +// 添加报告 +const AddlastLog = (user_case_id, data) => req({url: "gout/result/" + user_case_id + "/logs", method: 'POST', data: data}) + +// 报告记录 +const ListLog = (user_case_id, data) => req({url: "gout/result/" + user_case_id + "/logs", data: data}) + +// 健康记录时间轴 +const timelSee = (data) => req({url: "gout/result/timelines", data: data}) + +// 会员权益信息 +const identitySee = (identity) => req({url: "user/identities/" + identity}) + +// 确认开通身份 +const identityOpen = (identity_id) => req({url: "user/identities/create/" + identity_id, method: 'POST'}) + +// 确认开通身份 +const identityPay = (order_id, data) => req({url: "user/identities/pay/" + order_id + "/wechat", data: data}) + +// 激活码支付 +const codePay = (order_id, data) => req({url: "user/identities/pay/" + order_id + "/invite", method: 'POST', data: data}) + +// 体检报告数据 +const lastLog = (order_id, data) => req({url: "gout/result/last_log"}) + +// 开通会员身份 +const openIndex = (identity_id, data) => req({url: "user/identities/create/" + identity_id, method: 'POST', data: data}) + +// 获取小程序openid +const openid = (data) => req({url: "user/auth/mini_openid", data: data}) + +export default({ + goutCreate, + goutAdd, + goutSee, + AddlastLog, + ListLog, + timelSee, + identitySee, + identityOpen, + identityPay, + codePay, + lastLog, + openIndex, + openid +}) \ No newline at end of file diff --git a/api/interfaces/stock.js b/api/interfaces/stock.js new file mode 100644 index 0000000..fcbcfa7 --- /dev/null +++ b/api/interfaces/stock.js @@ -0,0 +1,42 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + * 库存 + */ + +import {req} from "../request" + +//提货前置 +const pick = () => req({url: "user/stock/pick"}) + +//提货列表-记录 +const list = (data) => req({url: "user/stock", data: data}) + +//账变记录 +const logs = (data) => req({url: "user/stock/logs", data: data}) + +//提货提交 +const pickTake = (data) => req({url: "user/stock/pick", method: 'POST', data: data}) + +//省市区-获取 +const create = (data) => req({url: "mall/addresses/create", data: data}) + +//新增地址 +const siteAdd = (data) => req({url: "mall/addresses", method: 'POST', data: data}) + +//地址列表 +const siteList = () => req({url: "mall/addresses"}) + +// 删除地址 +const siteDel = (address) => req({url: "mall/addresses/" + address, method: 'DELETE'}) + +export default({ + pick, + list, + logs, + pickTake, + create, + siteAdd, + siteList, + siteDel +}) \ No newline at end of file diff --git a/api/interfaces/user.js b/api/interfaces/user.js new file mode 100644 index 0000000..ee3eade --- /dev/null +++ b/api/interfaces/user.js @@ -0,0 +1,149 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +import {req} from "../request" + +//首页 +const userIndex = () => req({url: "user"}) + +//订单 +const orders = (data) => req({url: "mall/orders", data: data}) + +//订单详情 +const goodsDet = (order_no) => req({url: "mall/orders/" + order_no}) + +//订单签收 +const goodsSign = (order_no) => req({url: "mall/orders/" + order_no + "/sign", method: 'PUT'}) + +//我的抵值券 +const coupon = (data) => req({url: "coupons/user/coupons", data: data}) + +//我的抵值券列表 +const couponList = (coupon_id, data) => req({url: "coupons/user/coupons/" + coupon_id + "/list", data: data}) + +//现金账户 +const account = (data) => req({url: "user/account/balance", data: data}) + +//我的提现记录 +const bankList = (data) => req({url: "withdraws/index", data: data}) + +//提现前置 +const createUser = () => req({url: "withdraws/index/create"}) + +//提现提交 +const bankCash = (data) => req({url: "withdraws/index",method: 'POST', data: data}) + +//添加账户前置 +const create = () => req({url: "withdraws/accounts/create"}) + +//添加账户 +const createAdd = (data) => req({url: "withdraws/accounts", method: 'POST', data: data}) + +//账户编辑提交 +const bankPut = (bank_account_id,data) => req({url: "withdraws/accounts/" + bank_account_id, method: 'PUT', data: data}) + +//我的银行卡列表 +const createList = (data) => req({url: "withdraws/accounts", data: data}) + +//我的银行卡账户编辑 +const bankEdit = (bank_account_id) => req({url: "withdraws/accounts/" + bank_account_id + "/edit"}) + +//删除银行卡 +const bankDel = (bank_account_id) => req({url: "withdraws/accounts/" + bank_account_id, method: 'DELETE'}) + +//我的伙伴 +const relations = (data) => req({url: "user/relations", data: data}) + +//消息 +const notice = () => req({url: "notifications"}) + +//消息列表 +const noticeList = (type,data) => req({url: "notifications/" + type + "/list", data: data}) + +//消息详情 +const noticeShow = (notification_id) => req({url: "notifications/" + notification_id}) + +//上传头像 +const setting = (key,data) => req({url: "user/setting/" + key, method: 'PUT', data: data}) + +//我的推广码 +const invite = () => req({url: "user/invite"}) + +//水滴账户 +const score = (data) => req({url: "user/account/score", data: data}) + +//激活码管理 +const invites = (data) => req({url: "user/invites", data: data}) + +//微信授权 +const authFollow = (data) => req({url: "user/auth/get_auth_url", data: data}) + +//小程序入库用户数据(微信授权) +const wechatMini = (data) => req({url: "user/socialite/login/wechat/mini/add", method: 'POST', data: data}) + +//我的推广码 +const invitesCode = () => req({url: "user/invite"}) + +//小开通前置 +const identitiesee = (identity_id) => req({url: "user/identities/create/" + identity_id}) + +//小程序码 +const miniShare = (data) => req({url: "user/mini_share", data: data}) + +//我的收藏 +const favorites = (data) => req({url: "user/favorites", data: data}) + +//产品中心-分类 +const mallCategories = (data) => req({url: "mall/categories", data: data}) + +//产品中心-列表 +const mallGoods = (data) => req({url: "mall/goods", data: data}) + +//任务分类 +const taskIndex = () => req({url: "tasks/categories"}) + +//任务列表 +const taskList = (data) => req({url: "tasks", data: data}) + +//微信运动 +const wechatStep = (data) => req({url: "tasks/wechat_step", data: data}) + +export default({ + userIndex, + orders, + goodsDet, + goodsSign, + coupon, + couponList, + account, + bankList, + createUser, + bankCash, + create, + createAdd, + bankPut, + createList, + bankEdit, + bankDel, + relations, + notice, + noticeList, + noticeShow, + setting, + invite, + score, + invites, + authFollow, + wechatMini, + invitesCode, + identitiesee, + miniShare, + favorites, + mallCategories, + mallGoods, + taskIndex, + taskList, + wechatStep +}) \ No newline at end of file diff --git a/api/request.js b/api/request.js new file mode 100644 index 0000000..3c17795 --- /dev/null +++ b/api/request.js @@ -0,0 +1,136 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +import {errInfo} from './err' +import {updToken} from './updateToken' + +// 请求方式配置 +// https://api.water.shangkelian.cn //测试地址 +// https://api.siyuankunlun.com //正式地址 + +// wxecf8786d25af47b3 正式appid +const api = "https://api.siyuankunlun.com/api/" +const header = { + "Accept" : "application/json" +} +let isToken = true + +/** + * 请求 + * @property {Object} req + */ + +const req = (obj, noToken) => { + // 检查是否无需要token + if(noToken != undefined){ + isToken = noToken + } + + // header + if(obj.token){ + header.Authorization = obj.token || '' + } else { + header.Authorization = wx.getStorageSync("token") || "" + } + + // 处理请求信息 + return new Promise((resolve, reject) => { + // 组合header + obj.header = { + "Accept" : "application/json", + "Authorization" : wx.getStorageSync("token") || "" + } + if(!isToken){ + obj.header.Authorization = '' + } + wx.request({ + url : api + obj.url, + header : obj.header || {}, + method : obj.method || 'GET', + data : obj.data || {}, + success : res => { + // 更新token + if (res.header.Authorization) updToken(res.header.Authorization) + // 处理信息 + if (res.data.status_code == 200) { + resolve(res.data) + } else { + if (res.data.status_code == 401 || res.data.status_code == 400) { + reject({ + login : false, + codeBeen: false + }) + } + errInfo(res.data) + } + }, + fail: err => { + wx.showToast({ + title : err.errMsg, + icon : "none" + }) + reject(err) + }, + complete(){ + if(!isToken) isToken = true + } + }) + }) +} + + +/** + * 上传 + * @property {Object} upload + */ + +const upload = (obj) => { + // header + header.Authorization = wx.getStorageSync("token") || "" + // 处理上传信息 + return new Promise((resolve, reject) => { + wx.showLoading({ + title: "上传中..", + mask: true + }) + wx.uploadFile({ + url : api + obj.url, + header : header, + name : obj.key || "", + filePath: obj.path || "", + formData: obj.data || {}, + success : res=>{ + wx.hideLoading(); + // 处理返回值 + let jsonData = JSON.parse(res.data) + // 更新token + if (res.header.Authorization) updToken(res.header.Authorization) + // 处理信息 + if (jsonData.status_code == 200) { + resolve(jsonData.data) + } else { + if (jsonData.status_code == 401) { + reject({ + login: false + }) + } + errInfo(jsonData) + } + }, + fail : err=>{ + wx.showToast({ + title : err.errMsg, + icon : "none" + }) + reject(err) + } + }) + }) +} + +module.exports = { + req, + upload +} diff --git a/api/updateToken.js b/api/updateToken.js new file mode 100644 index 0000000..86f5ec3 --- /dev/null +++ b/api/updateToken.js @@ -0,0 +1,21 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +/** + * 更新token + * @property {String} updToken + */ + +const updToken = (token) =>{ + // 更新全局存储器 + getApp().globalData.token = token + // 更新客户端登录缓存 + wx.setStorageSync('token', token) +} + +module.exports = { + updToken +} + diff --git a/app.js b/app.js new file mode 100644 index 0000000..ef39420 --- /dev/null +++ b/app.js @@ -0,0 +1,106 @@ +/* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +import api from "api/index" + +App({ + onLaunch(e) { + let { scene } = e + // 检查入口场景值 + if(scene === 1011 || scene === 1047 || scene === 1124 || scene === 1089 || scene === 1038){ + this.globalData.isOfficial = true + } + + // 检查用户登录状态 + const token = wx.getStorageSync("token") + if(token){ + this.globalData.isUser = true + } + + // 检查系统更新 + const updateManager = wx.getUpdateManager() + updateManager.onUpdateReady(function () { + wx.showModal({ + title : '更新提示', + content : '新版本已经准备好,是否重启应用?', + cancelColor: '#666', + confirmColor: '#e50d01', + success : res=> { + if (res.confirm) { + updateManager.applyUpdate() + } + } + }) + }) + updateManager.onUpdateFailed(function(){ + wx.showModal({ + title : '更新提示', + content : '版本更新下载失败,请检查您的网络稍后重试', + showCancel: false, + confirmColor: '#e50d01' + }) + }) + + // 获取系统信息 + wx.getSystemInfo({ + success: res=>{ + this.globalData.systInfo = { + statusBarHeight: res.statusBarHeight, + safeArea : res.safeArea + } + } + }) + + // 挂载api + wx.$api = api + if(wx.getStorageSync("token")){ + wx.$api.user.invite().then(res => { + this.globalData.systInfo = { + invite: res.data.invite + } + + }).catch(err => {}) + } + // 获取分享 + // this.overShare() + + // 获取微信步数-云开发 + wx.cloud.init({ + traceUser: true, + }) + }, + + // 统一分享 + overShare () { + //监听路由切换 + wx.onAppRoute(() =>{ + let pages = getCurrentPages(), + view = pages[pages.length - 1] + if (view) { + wx.showShareMenu({ + withShareTicket: true, + menus: ['shareAppMessage', 'shareTimeline'], + }) + view.onShareAppMessage = function () { + return { + title: '分享标题', + imageUrl: "https://api.siyuankunlun.com/storage/materials/2022/09/14/code.jpg", + path: '/pages/index/index?invite=' + this.globalData.systInfo.invite + }; + } + } + }) + }, + globalData: { + systInfo : '', + isUser : false, + token : "", + isOfficial : false, + invite : "", + safeArea : '', + statusBarHeight: wx.getSystemInfoSync().statusBarHeight, + jiaonangheight: wx.getMenuButtonBoundingClientRect().height + } +}) \ No newline at end of file diff --git a/app.json b/app.json new file mode 100644 index 0000000..1d029f2 --- /dev/null +++ b/app.json @@ -0,0 +1,100 @@ +{ + "pages": [ + "pages/mall/index/index", + "pages/mall/buy/index", + "pages/index/index", + "pages/user/index", + "pages/login/index", + "pages/webView/index", + "pages/record/index/index", + "pages/record/report/index", + "pages/record/list/index", + "pages/record/healthy/index", + "pages/order/list/index", + "pages/order/details/index", + "pages/stock/index/index", + "pages/stock/site/index", + "pages/stock/addSite/index", + "pages/stock/take/index", + "pages/stock/list/index", + "pages/coupons/list/index", + "pages/coupons/organize/index", + "pages/account/index/index", + "pages/account/withdraw/index", + "pages/account/withdrawList/index", + "pages/account/bankList/index", + "pages/account/bankAdd/index", + "pages/code/index", + "pages/recommend/index", + "pages/news/list/index", + "pages/news/details/index", + "pages/news/classify/index", + "pages/about/index", + "pages/stock/detailed/index", + "pages/stock/examine/index", + "pages/account/tips/index", + "pages/member/index/index", + "pages/member/look/index", + "pages/member/rights/index", + "pages/member/open/index", + "pages/mall/submit/index", + "pages/mall/mallOrder/index", + "pages/mall/details/index", + "pages/login/agreement/index", + "pages/water/index", + "pages/bond/index", + "pages/bond/tips/index", + "pages/sign/index", + "pages/index/write/index", + "pages/index/feeling/index", + "pages/record/reportSee/index", + "pages/bond/activation/index", + "pages/memberOpen/index", + "pages/mall/article/articleList/index", + "pages/mall/article/articleInfo/index", + "pages/mall/exhibition/index", + "pages/user/collect/index", + "pages/user/goods/index", + "pages/mall/article/articleAll/index" + ], + "window": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#fff", + "navigationBarTitleText": "锶源昆仑", + "navigationBarTextStyle": "black" + }, + "tabBar": { + "list": [ + { + "pagePath": "pages/mall/index/index", + "text": "水滴商城", + "iconPath": "/static/tabBarIcon/00.png", + "selectedIconPath": "/static/tabBarIcon/00_active.png" + }, + { + "pagePath": "pages/index/index", + "text": "体验官", + "iconPath": "/static/tabBarIcon/02.png", + "selectedIconPath": "/static/tabBarIcon/02_active.png" + }, + { + "pagePath": "pages/memberOpen/index", + "text": "开通会员", + "iconPath": "/static/tabBarIcon/03.png", + "selectedIconPath": "/static/tabBarIcon/03_active.png" + }, + { + "pagePath": "pages/user/index", + "text": "锶人中心", + "iconPath": "/static/tabBarIcon/01.png", + "selectedIconPath": "/static/tabBarIcon/01_active.png" + } + ], + "color": "#b6b9bb", + "selectedColor": "#6c78f8", + "borderStyle": "white" + }, + "style": "v2", + "sitemapLocation": "sitemap.json", + "lazyCodeLoading": "requiredComponents" +} \ No newline at end of file diff --git a/app.wxss b/app.wxss new file mode 100644 index 0000000..682b9f5 --- /dev/null +++ b/app.wxss @@ -0,0 +1,79 @@ +/**app.wxss**/ +.container { + height: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-between; + padding: 200rpx 0; + box-sizing: border-box; +} + + +/* 上拉加载 */ +.pagesLoding { + text-align: center; + line-height: 90rpx; + color: gray; + font-size: 28rpx; +} + +.pagesLoding-icon { + width: 28rpx; + height: 28rpx; + vertical-align: middle; + margin-right: 10rpx; + margin-bottom: 3rpx; +} + + +/* + * 文字截取 + */ + +.nowrap { + max-width: 100%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.nowrap-multi { + display: -webkit-box; + overflow: hidden; + text-overflow: ellipsis; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; +} + +/* + * 水平居中 + */ + +.pack-center { + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-box-pack: center; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + z-index: -1; +} + +/* +* 页面信息提醒 +*/ + +.pages-hint { + text-align: center; + color: #747788; + font-size: 28rpx; + background: white; +} + +.pages-hint image { + width: 188rpx; + height: 188rpx; +} \ No newline at end of file diff --git a/pages/about/index.js b/pages/about/index.js new file mode 100644 index 0000000..c526e93 --- /dev/null +++ b/pages/about/index.js @@ -0,0 +1,28 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, +}) \ No newline at end of file diff --git a/pages/about/index.json b/pages/about/index.json new file mode 100644 index 0000000..5f59c44 --- /dev/null +++ b/pages/about/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "锶源昆仑" +} \ No newline at end of file diff --git a/pages/about/index.wxml b/pages/about/index.wxml new file mode 100644 index 0000000..eab3aa4 --- /dev/null +++ b/pages/about/index.wxml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/pages/about/index.wxss b/pages/about/index.wxss new file mode 100644 index 0000000..dcd130d --- /dev/null +++ b/pages/about/index.wxss @@ -0,0 +1,3 @@ +.product { + width: 100%; +} \ No newline at end of file diff --git a/pages/account/bankAdd/index.js b/pages/account/bankAdd/index.js new file mode 100644 index 0000000..5f478c6 --- /dev/null +++ b/pages/account/bankAdd/index.js @@ -0,0 +1,99 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + banksArr : [], //银行列表 + banksIndex: 0, //银行列表下标 + banksId : '', //银行列表id + disabled : false ,// 提交按钮状态 + bankData : '', //编辑信息 + ediStatet : '', //是否为编辑 + bankId : '', + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + if (options) { + this.setData({ + ediStatet: options.edistatet, + bankId : options.bankid + }) + } + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取账户前置 + this.createInfo(); + + // 获取编辑信息前置 + if( this.data.ediStatet == 'compile') { + this.createEdit(); + } + }, + + /** + * 账户前置 + */ + createInfo() { + wx.$api.user.create().then(res => { + this.setData({ + banksArr: res.data.banks + }) + }).catch(err => {}) + }, + + /** + * 选择银行 + */ + banksBind(e) { + this.setData({ + banksIndex: e.detail.value + }) + }, + + /** + * 编辑信息前置 + */ + createEdit() { + wx.$api.user.bankEdit(this.data.bankId).then(res => { + let areasValue = res.data.banks.findIndex(val=> val.name == res.data.info.bank.name) + this.setData({ + banksIndex: areasValue, + bankData : res.data.info + }) + }).catch(err => {}) + }, + + // 添加账户 + banksForm(e) { + let value = e.detail.value + let bankId = this.data.banksArr[this.data.banksIndex].id + let data = { + bank_id : bankId, + name : value.name, + mobile : value.mobile, + no : value.no + } + let urlData = wx.$api.user.createAdd(data) + // 编辑账户 + if(this.data.ediStatet == 'compile') urlData = wx.$api.user.bankPut(this.data.bankId,data) + urlData.then(res => { + this.setData({ + disabled: true + }) + wx.navigateBack() + }).catch(err => {}) + }, +}) \ No newline at end of file diff --git a/pages/account/bankAdd/index.json b/pages/account/bankAdd/index.json new file mode 100644 index 0000000..cf70660 --- /dev/null +++ b/pages/account/bankAdd/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "添加银行卡" +} \ No newline at end of file diff --git a/pages/account/bankAdd/index.wxml b/pages/account/bankAdd/index.wxml new file mode 100644 index 0000000..0c2bf26 --- /dev/null +++ b/pages/account/bankAdd/index.wxml @@ -0,0 +1,28 @@ +
+ + + + + + {{banksArr[banksIndex].name}} + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/pages/account/bankAdd/index.wxss b/pages/account/bankAdd/index.wxss new file mode 100644 index 0000000..49087f5 --- /dev/null +++ b/pages/account/bankAdd/index.wxss @@ -0,0 +1,88 @@ +page { + background: #f3f4f6; +} + +.case { + border-bottom: 160rpx solid transparent; +} + +.issue-title { + padding: 30rpx; + font-weight: 600; +} + +.issue-block { + background: white; + margin-bottom: 20rpx; +} + +.issue-inputs { + position: relative; + height: 110rpx; + line-height: 110rpx; + padding: 0 30rpx; + box-sizing: border-box; + border-bottom: 2rpx solid #f2f2f2; + display: flex; +} + +.issue-input-arrow { + width: 32rpx; + height: 32rpx; + position: absolute; + top: 32rpx; + right: 20rpx; +} + +.issue-input-label { + width: 170rpx; +} + +.issue-inputs-input { + padding-left: 40rpx; + box-sizing: border-box; + line-height: 110rpx; + height: 110rpx; + width: 100%; +} + +.uni-input-img { + width: 32rpx; + height: 32rpx; + position: absolute; + right: 0; + top: 30rpx; +} + +/* 按钮 */ +.userdata-btn { + width: 100%; + box-sizing: border-box; + padding: 30rpx; + position: fixed; + bottom: 0; + left: 0; + z-index: 99; + right: 0; + background: white; +} + +.issue-btn { + background: #1d37e2; + text-align: center; + color: white; + height: 90rpx; + line-height: 90rpx; + font-size: 34rpx; + font-weight: normal; + width: 100% !important; + margin: 0; + padding: 0; + border-radius: 10rpx; +} + +.issue-btn[disabled] { + background: #1d37e2 !important; + color: #fff !important; +} + diff --git a/pages/account/bankList/index.js b/pages/account/bankList/index.js new file mode 100644 index 0000000..df5a77c --- /dev/null +++ b/pages/account/bankList/index.js @@ -0,0 +1,115 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + createArr : [] , //列表 + page : {}, //分页信息 + type : '', //类型 + lodingStats : false, //加载状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + type: options.type + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取我的账户 + this.createInfo(); + }, + + // 我的银行卡 + createInfo(page){ + wx.$api.user.createList({page : page || 1}).then(res => { + let listArr = this.data.createArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.data) + this.setData({ + createArr : newData, + page : res.data.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + }).catch(err => {}) + }, + + // 删除地址 + bankRemove(e){ + let newid = e.currentTarget.dataset.id + let list = this.data.createArr + wx.showModal({ + title : '提示', + content : '是否删除银行卡', + success : res=> { + if (res.confirm) { + wx.showLoading({ + title: '删除中', + }) + wx.$api.user.bankDel(newid).then(res=>{ + this.setData({ + createArr: list + }) + wx.showToast({ + title: res.data, + icon : "none" + }) + wx.hideLoading() + // 获取我的账户 + this.createInfo(); + }) + } + } + }) + }, + + /** + * 选择地址 + */ + BankClick(e){ + let atAdds = this.data.createArr[e.currentTarget.dataset.index] + let pages = getCurrentPages(), + prepage = pages[pages.length-2] + prepage.setData({ + accounts: atAdds + }) + wx.navigateBack() + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取我的账户 + this.createInfo(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取我的账户 + this.createInfo(pageNumber); + } + } +}) \ No newline at end of file diff --git a/pages/account/bankList/index.json b/pages/account/bankList/index.json new file mode 100644 index 0000000..3928faa --- /dev/null +++ b/pages/account/bankList/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/account/bankList/index.wxml b/pages/account/bankList/index.wxml new file mode 100644 index 0000000..3911b3a --- /dev/null +++ b/pages/account/bankList/index.wxml @@ -0,0 +1,55 @@ + + + 我的卡(共{{createArr.length}}张) + + + 添加银行卡 + + + + + + + + + {{item.bank.name}} + + + {{item.name}} + + + + {{item.no}} + + + + + + 选择此账户 + + + + + 编辑 + + + 删除 + + + + + + + 加载中... + + + 没有更多了~ + + + + + + 暂无数据 + \ No newline at end of file diff --git a/pages/account/bankList/index.wxss b/pages/account/bankList/index.wxss new file mode 100644 index 0000000..7cee5fb --- /dev/null +++ b/pages/account/bankList/index.wxss @@ -0,0 +1,130 @@ +page { + background: #f4f5f9; + padding: 30rpx; + box-sizing: border-box; +} + +.title { + display: flex; + margin-bottom: 30rpx; + line-height: 54rpx; +} + +.title-name { + flex: 1; + font-weight: 600; +} + +.title-name text { + color: #9d9d9d; + font-weight: normal; +} + +.title-add { + background-color: #e2ecff; + display: inline-block; + font-size: 28rpx; + line-height: 54rpx; + padding: 0 15rpx; + border-radius: 50rpx; +} + +.title-add image { + width: 34rpx; + height: 34rpx; + vertical-align: middle; + margin-right: 6rpx; +} + +.item { + background-image: linear-gradient(to top left, #3b61ce, #3f8ad4); + border-radius: 30rpx; + margin-bottom: 30rpx; + position: relative; + padding: 30rpx; + box-sizing: border-box; +} + +.item:nth-child(even) { + background-image: linear-gradient(to top left, #e7796e, #e35d65); +} + +.item-logo { + width: 100rpx; + height: 100rpx; + border-radius: 50%; + overflow: hidden; + background-color: #ffffff; + padding: 20rpx; + box-sizing: border-box; +} + +.item-logo image { + width: 100%; + height: 100%; +} + +.item-text { + position: absolute; + left: 0; + top: 0; + width: 100%; + padding: 30rpx 30rpx 30rpx 160rpx; + box-sizing: border-box; +} + +.item-top { + display: flex; + color: #ffffff; + font-size: 34rpx; + line-height: 50rpx; +} + +.item-title { + flex: 1; + margin-bottom: 5rpx; +} + +.item-name { + font-size: 32rpx; +} + +.item-number { + color: #e9f3ff; +} + + +.item-tool { + display: flex; + margin-top: 40rpx; +} + +.item-left { + flex: 1; +} + +.item-btn { + text-align: right; +} + +.item-tool-btn { + margin-left: 30rpx; +} + +.item-tool-btn { + background-color: rgba(255, 255, 255, .4); + color: #ffffff; + border-radius: 6rpx; + height: 48rpx; + display: inline-block; + line-height: 48rpx; + font-size: 26rpx; + padding: 0 20rpx; +} + +.item-tool-btn image { + width: 26rpx; + height: 26rpx; + vertical-align: -2rpx; + margin-right: 5rpx; +} \ No newline at end of file diff --git a/pages/account/index/index.js b/pages/account/index/index.js new file mode 100644 index 0000000..7d97caf --- /dev/null +++ b/pages/account/index/index.js @@ -0,0 +1,97 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + accounts : '', //数额 + logsArr : [], // 提货列表数据 + listType : 'income', //列表分类 + page : {}, //分页信息 + lodingStats : false, //加载状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取账户信息 + this.accountInfo() + }, + + /** + * 账户信息 + */ + accountInfo(page){ + let urlPage = wx.$api.user.account + if(this.data.listType == 'withdrawal'){ + urlPage = wx.$api.user.bankList + } + urlPage({ + page : page || 1 + }).then(res => { + let listArr = this.data.logsArr, + newData = [], + newPage = '' + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.logs.data) + newPage = res.data.logs.page + if(this.data.listType == 'withdrawal'){ + newData = listArr.concat(res.data.lists.data) + newPage = res.data.lists.page + } + this.setData({ + accounts : res.data.account, + logsArr : newData, + page : newPage, + lodingStats : false + }) + wx.stopPullDownRefresh() + }).catch(err => {}) + }, + + /** + * 状态筛选 + */ + onTabs(val){ + if(this.data.listType === val.currentTarget.dataset.type) return + this.setData({ + listType: val.currentTarget.dataset.type + }) + // 获取账户信息 + this.accountInfo(); + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取账户信息 + this.accountInfo(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取账户信息 + this.accountInfo(pageNumber); + } + } +}) \ No newline at end of file diff --git a/pages/account/index/index.json b/pages/account/index/index.json new file mode 100644 index 0000000..43b0cb8 --- /dev/null +++ b/pages/account/index/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "现金账户" +} \ No newline at end of file diff --git a/pages/account/index/index.wxml b/pages/account/index/index.wxml new file mode 100644 index 0000000..a4e9c47 --- /dev/null +++ b/pages/account/index/index.wxml @@ -0,0 +1,62 @@ + + + + + + 账户总金额(元) + {{accounts.balance}} + + + 提现到银行卡 + + + + + 昨日收益金额(元) + {{accounts.yesterday}} + + + 提现金额(元) + {{accounts.withdraw}} + + + + + + + 账变记录 + 提现记录 + + + + + + {{listType == 'income' ? item.remark : item.way}} + + + {{item.status.status_text}} + + + + + {{listType == 'income' ? item.created_at : item.create_at}} + + + + {{item.amount}} + + + + + 加载中... + + + 没有更多了~ + + + + + + ~暂无数据哦~ + + \ No newline at end of file diff --git a/pages/account/index/index.wxss b/pages/account/index/index.wxss new file mode 100644 index 0000000..3e47d4b --- /dev/null +++ b/pages/account/index/index.wxss @@ -0,0 +1,171 @@ +page { + padding: 30rpx; + box-sizing: border-box; +} + +.cashBack { + width: 100%; + border-radius: 10rpx; + padding-top: 50%; + position: relative; + overflow: hidden; + box-shadow: 0 4rpx 10rpx 6rpx #f5d473; +} + +.cashBack-img { + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0; +} + +.cashBack-text { + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0; + z-index: 9; + padding: 40rpx; + box-sizing: border-box; +} + +.cashBack-total { + margin-bottom: 40rpx; + font-size: 30rpx; + position: relative; +} + +.cashBack-total text { + display: block; + font-size: 56rpx; + margin-top: 10rpx; + font-weight: 600; +} + +.cashBack-btn { + position: absolute; + top: 20rpx; + right: 0; + background-color: #000000; + color: #ffffff; + border-radius: 70rpx; + line-height: 80rpx; + padding: 0 35rpx; +} + +.cashBack-top { + margin-bottom: 30rpx; + display: flex; +} + +.cashBack-item { + flex: 2; + font-size: 30rpx; +} + +.cashBack-item text { + display: block; + font-weight: 600; + font-size: 42rpx; + margin-top: 10rpx; +} + +.record { + margin-top: 30rpx; +} + +.title { + display: flex; + font-size: 34rpx; +} + +.title text { + display: block; + flex: 2; + text-align: center; + line-height: 90rpx; + color: #9d9d9d; + position: relative; +} + +.title text::after { + position: absolute; + content: ''; + left: calc(50% - 25rpx); + bottom: 0; + width: 50rpx; + height: 6rpx; + background-color: #000000; + display: none; +} + +.title text.active { + color: #000000; +} + +.title text.active::after { + display: block; +} + +.list { + margin-top: 40rpx; +} + +.item { + margin-bottom: 30rpx; + padding-bottom: 30rpx; + border-bottom: 2rpx solid #f2f2f2; + display: flex; +} + +.top { + flex: 1; +} + +.name { + margin-bottom: 10rpx; + display: flex; +} + +.state { + font-size: 26rpx; + border: 2rpx solid green; + color: green; + border-radius: 10rpx; + margin-left: 20rpx; + padding: 0 10rpx; + height: 36rpx; + line-height: 36rpx; + margin-top: 2rpx; +} + +.state.red { + color: red; + border-color: red; +} + +.time { + font-size: 26rpx; + color: #9d9d9d; +} + +.number { + line-height: 92rpx; + text-align: right; + font-size: 34rpx; + font-weight: 600; +} + +.pages-no { + text-align: center; + padding: 180rpx 0 30rpx; + color: #9d9d9d; + font-size: 28rpx; +} + +.pages-no image { + width: 180rpx; + padding-bottom: 20rpx; +} \ No newline at end of file diff --git a/pages/account/tips/index.js b/pages/account/tips/index.js new file mode 100644 index 0000000..e930c98 --- /dev/null +++ b/pages/account/tips/index.js @@ -0,0 +1,30 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + + +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + +}) \ No newline at end of file diff --git a/pages/account/tips/index.json b/pages/account/tips/index.json new file mode 100644 index 0000000..3928faa --- /dev/null +++ b/pages/account/tips/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/account/tips/index.wxml b/pages/account/tips/index.wxml new file mode 100644 index 0000000..cf69107 --- /dev/null +++ b/pages/account/tips/index.wxml @@ -0,0 +1,9 @@ + + + + 提交成功 + 预计审核时间:1个工作日 + 申请提现成功,等待管理员审核 + + 返回 + \ No newline at end of file diff --git a/pages/account/tips/index.wxss b/pages/account/tips/index.wxss new file mode 100644 index 0000000..8506aba --- /dev/null +++ b/pages/account/tips/index.wxss @@ -0,0 +1,33 @@ +.examine { + padding: 240rpx 0 30rpx; + box-sizing: border-box; + text-align: center; +} + +.examine image { + width: 35%; + margin: 0 auto 30rpx; +} + +.title { + font-weight: 600; + font-size: 42rpx; + margin-bottom: 30rpx; +} + +.time { + color: #999999; + line-height: 50rpx; +} + +.return { + display: inline-block; + margin-top: 80rpx; + background-color: #1d37e2; + padding: 0 180rpx; + height: 90rpx; + line-height: 90rpx; + border-radius: 10rpx; + box-shadow: 0 3rpx 6rpx 4rpx rgba(6, 34, 214, .6); + color: #FFFFFF; +} \ No newline at end of file diff --git a/pages/account/withdraw/index.js b/pages/account/withdraw/index.js new file mode 100644 index 0000000..db58a3c --- /dev/null +++ b/pages/account/withdraw/index.js @@ -0,0 +1,102 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + balance : '', //金额 + accounts : '', //账户列表 + amount : '', //提现金额 + disabled : false ,// 提交按钮状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + // 获取账户前置 + this.createInfo(); + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() {}, + + /** + * 账户前置 + */ + createInfo() { + wx.$api.user.createUser().then(res => { + this.setData({ + balance : res.data.balance, + accounts : res.data.bank_account + }) + }).catch(err => {}) + }, + + /** + * 输入商品数量 + */ + goodsNumberInput(e) { + let goodsNum = (e.detail.value.match(/^\d*(\.?\d{0,2})/g)[0]) + if (goodsNum > 0) { + if(parseFloat(goodsNum) > parseFloat(this.data.balance)){ + wx.showToast({ + title: '提现金额不能大于总金额', + icon: 'none' + }); + return + } + this.setData({ + amount: goodsNum + }) + } else { + uni.showToast({ + title: '商品数量不能小于1', + icon: 'none' + }); + this.setData({ + amount: 1 + }) + } + }, + + /** + * 全部提现 + */ + allCash() { + this.setData({ + amount: this.data.balance + }) + }, + + //提现 + banksForm() { + let data = { + bank_account_id : this.data.accounts.bank_account_id, + amount : this.data.amount, + type : 1 + } + wx.$api.user.bankCash(data).then(() => { + this.setData({ + disabled: true + }) + + // 跳到审核页面 + wx.redirectTo({ + url: "../tips/index" + }) + }).catch(err => { + uni.showToast({ + title: err.message, + icon : 'none' + }) + }) + } +}) \ No newline at end of file diff --git a/pages/account/withdraw/index.json b/pages/account/withdraw/index.json new file mode 100644 index 0000000..546fe7a --- /dev/null +++ b/pages/account/withdraw/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "提现银行卡" +} \ No newline at end of file diff --git a/pages/account/withdraw/index.wxml b/pages/account/withdraw/index.wxml new file mode 100644 index 0000000..f8bb079 --- /dev/null +++ b/pages/account/withdraw/index.wxml @@ -0,0 +1,39 @@ + + + 提现记录 + + 当前余额(元) + {{balance}} + +
+ + + 到账方式 + + + {{accounts.bank.name}} + + + + + 添加银行账户 + + + 提现金额 + + + + + + + 全部 + + + + 输入的金额不能大于{{balance}} + + + + + +
\ No newline at end of file diff --git a/pages/account/withdraw/index.wxss b/pages/account/withdraw/index.wxss new file mode 100644 index 0000000..dee1f3a --- /dev/null +++ b/pages/account/withdraw/index.wxss @@ -0,0 +1,155 @@ +page { + background-color: #f2f2f2; +} + +.money { + background-image: linear-gradient(to bottom right, #1c37e2, #6a91dd); + text-align: center; + color: #ffffff; + padding: 30rpx 30rpx 50rpx; + box-sizing: border-box; +} + +.money-logs { + text-align: right; + margin-bottom: 30rpx; +} + +.money-tips { + opacity: .8; +} + +.money-number { + line-height: 110rpx; + font-size: 56rpx; + font-weight: 600; +} + +.issue-form { + padding: 30rpx; + box-sizing: border-box; + display: block; +} + +.issue-pay { + background-color: #fff; + padding: 0 30rpx; + box-sizing: border-box; + border-radius: 10rpx; + display: flex; + line-height: 110rpx; + position: relative; +} + +.name { + flex: 1; + color: #1e2540; +} + +.bank { + padding-right: 20rpx; + display: flex; +} + +.bank image { + width: 34rpx; + height: 34rpx; + border-radius: 50%; + margin: 40rpx 10rpx 0 0; +} + +.issue-input-arrow { + width: 30rpx; + height: 30rpx; + position: absolute; + top: 42rpx; + right: 20rpx; +} + +.issue-add { + background-color: #fff; + border-radius: 10rpx; + line-height: 110rpx; + text-align: center; +} + +.issue-add image { + width: 34rpx; + height: 34rpx; + vertical-align: -6rpx; + padding-right: 10rpx; +} + +.issue-cash { + margin: 30rpx 0; + background-color: #fff; + padding: 30rpx; + box-sizing: border-box; + border-radius: 10rpx; +} + +.title { + color: #1e2540; +} + +.entry { + margin: 10rpx 0 20rpx; + border-bottom: 2rpx solid #d9dbe4; + display: flex; + line-height: 110rpx; +} + +.entry-price { + flex: 1; + font-weight: 600; + font-size: 56rpx; + color: #1e2540; + display: flex; +} + +.entry-price input { + height: 110rpx; + line-height: 110rpx; + font-size: 56rpx; +} + +.entry-price text { + font-size: 46rpx; + padding-right: 10rpx; +} + +.entry-all { + color: #2858d0; + font-size: 30rpx; +} + +.tips { + color: #c64a52; + font-size: 30rpx; +} + +/* 按钮 */ +.userdata-btn { + width: 100%; + background: white; + margin-top: 90rpx; +} + +.issue-btn { + background: #1d37e2; + text-align: center; + color: white; + height: 90rpx; + line-height: 90rpx; + font-size: 34rpx; + font-weight: normal; + width: 100% !important; + margin: 0; + padding: 0; + border-radius: 10rpx; +} + +.issue-btn[disabled] { + background: #1d37e2 !important; + color: #fff !important; +} \ No newline at end of file diff --git a/pages/account/withdrawList/index.js b/pages/account/withdrawList/index.js new file mode 100644 index 0000000..882905e --- /dev/null +++ b/pages/account/withdrawList/index.js @@ -0,0 +1,74 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + logsArr : [], // 提货列表数据 + score : '', //总数量 + page : {}, //分页信息 + lodingStats : false, //加载状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取提现记录 + this.accountInfo(); + }, + + /** + * 提现记录 + */ + accountInfo (page){ + wx.$api.user.bankList({ + page: page + }).then(res => { + let listArr = this.data.logsArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.lists.data) + this.setData({ + logsArr : newData, + page : res.data.lists.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + + }).catch(err => { }) + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取提现记录 + this.accountInfo(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取提现记录 + this.accountInfo(pageNumber); + } + } +}) \ No newline at end of file diff --git a/pages/account/withdrawList/index.json b/pages/account/withdrawList/index.json new file mode 100644 index 0000000..0310563 --- /dev/null +++ b/pages/account/withdrawList/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "提现记录" +} \ No newline at end of file diff --git a/pages/account/withdrawList/index.wxml b/pages/account/withdrawList/index.wxml new file mode 100644 index 0000000..2d43c9e --- /dev/null +++ b/pages/account/withdrawList/index.wxml @@ -0,0 +1,35 @@ + + + + + {{item.way}} + + + {{item.create_at}} + + + + + {{item.status.status_text}} + + + {{item.status.status_text}} + + + + {{item.amount}} + + + + + 加载中... + + + 没有更多了~ + + + + + + ~暂无数据哦~ + \ No newline at end of file diff --git a/pages/account/withdrawList/index.wxss b/pages/account/withdrawList/index.wxss new file mode 100644 index 0000000..e4efcb0 --- /dev/null +++ b/pages/account/withdrawList/index.wxss @@ -0,0 +1,52 @@ +page { + padding: 30rpx; + box-sizing: border-box; +} + +.item { + margin-bottom: 30rpx; + padding-bottom: 30rpx; + border-bottom: 2rpx solid #f2f2f2; + display: flex; +} + +.top { + width: 45%; +} + +.name { + margin-bottom: 10rpx; +} + +.time { + font-size: 26rpx; + color: #9d9d9d; +} + +.state { + width: 30%; + text-align: center; + line-height: 92rpx; + font-size: 30rpx; + color: #949494; +} + +.state.green { + color: green; +} + +.state.red { + color: red; +} + +.number { + width: 25%; + line-height: 92rpx; + text-align: right; + font-size: 34rpx; + font-weight: 600; +} + +.number.active { + color: green; +} \ No newline at end of file diff --git a/pages/bond/activation/index.js b/pages/bond/activation/index.js new file mode 100644 index 0000000..814a185 --- /dev/null +++ b/pages/bond/activation/index.js @@ -0,0 +1,95 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + invitesArr : [], //记录列表 + page : {}, //分页信息 + lodingStats : false, //加载状态 + status : 2 //状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取激活码数据 + this.invitesInfo(); + }, + + // 激活码数据 + invitesInfo(page) { + wx.$api.user.invites({ + status: this.data.status, + page : page || 1 + }).then(res => { + let listArr = this.data.invitesArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.data) + this.setData({ + invitesArr : newData, + page : res.data.page, + lodingStats: false + }) + wx.stopPullDownRefresh() + }).catch(err => {}) + }, + + // 状态筛选 + onTabs(val){ + if(this.data.status === val.currentTarget.dataset.type) return + this.setData({ + status: val.currentTarget.dataset.type, + page : {} + }) + + // 获取激活码数据 + this.invitesInfo(); + }, + + // 复制激活码 + copyClick(val) { + wx.setClipboardData({ + data: val.currentTarget.dataset.code, + success: () => { + wx.showToast({ + title: "复制成功", + icon : "none" + }) + } + }) + }, + + // 页面相关事件处理函数--监听用户下拉动作 + onPullDownRefresh() { + // 获取激活码数据 + this.invitesInfo(); + }, + + // 上拉加载 + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 商品列表数据 + this.lastInfo(pageNumber); + } + } +}) \ No newline at end of file diff --git a/pages/bond/activation/index.json b/pages/bond/activation/index.json new file mode 100644 index 0000000..f43d5fd --- /dev/null +++ b/pages/bond/activation/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "激活码管理" +} \ No newline at end of file diff --git a/pages/bond/activation/index.wxml b/pages/bond/activation/index.wxml new file mode 100644 index 0000000..138870d --- /dev/null +++ b/pages/bond/activation/index.wxml @@ -0,0 +1,42 @@ + + 未使用 + 已使用 + + + + + {{item.code}} + 复制激活码 + + + + + 用户手机号 + + + {{item.user.username}} + + + + + 使用时间 + + + {{item.actived_at}} + + + + + + + 加载中... + + + 没有更多了~ + + + + + + 暂无数据 + \ No newline at end of file diff --git a/pages/bond/activation/index.wxss b/pages/bond/activation/index.wxss new file mode 100644 index 0000000..81da2f0 --- /dev/null +++ b/pages/bond/activation/index.wxss @@ -0,0 +1,110 @@ +page { + background-color: #f4f4f4; +} + +.tabs { + position: fixed; + top: 0; + left: 0; + right: 0; + z-index: 99; + display: flex; + background-color: #ffffff; +} + +.tabs-item { + flex: 2; + text-align: center; + height: 90rpx; + line-height: 90rpx; + position: relative; +} + +.tabs-item::after { + position: absolute; + width: 12%; + background-color: #1d37e2; + height: 6rpx; + border-radius: 60rpx; + content: ''; + left: 44%; + bottom: 0; + display: none; +} + +.tabs-item.show::after { + display: block; +} + +.tabs-item.show { + color: #1d37e2; + font-weight: 600; +} + + +.list { + margin-top: 100rpx; + padding: 30rpx; + box-sizing: border-box; +} + +.item { + background-color: #ffffff; + border-radius: 30rpx; + margin-bottom: 30rpx; + box-shadow: 0 0 5rpx rgba(0, 0, 0, .05); +} + +.top { + padding: 0 30rpx; + box-sizing: border-box; + line-height: 110rpx; + border-bottom: 2rpx solid #eeeef0; + display: flex; +} + +.code { + flex: 1; + font-weight: 600; + position: relative; + padding-left: 30rpx; +} + +.code::after { + position: absolute; + content: ''; + left: 0; + top: calc(50% - 7rpx); + width: 14rpx; + height: 14rpx; + border-radius: 50%; + background-color: #53c41a; +} + +.copy { + border: 2rpx solid #1d37e2; + color: #1d37e2; + border-radius: 10rpx; + font-size: 28rpx; + height: 64rpx; + line-height: 62rpx; + padding: 0 20rpx; + box-sizing: border-box; + margin-top: 26rpx; +} + +.label { + padding: 30rpx; + box-sizing: border-box; + display: flex; +} + +.label-item { + flex: 2; +} + +.label-name { + font-size: 30rpx; + color: #9d9d9d; + margin-bottom: 10rpx; +} \ No newline at end of file diff --git a/pages/bond/index.js b/pages/bond/index.js new file mode 100644 index 0000000..cae5ee4 --- /dev/null +++ b/pages/bond/index.js @@ -0,0 +1,157 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + orderId : '', + identityid : '', + items : [{ + value : 'wechat', + name : '微信支付', + cover : '/static/icons/payIcon_00.png', + checked: 'true' + }, + { + value : 'code', + name : '激活码支付', + cover : '/static/icons/payIcon_01.png' + } + ], + current : 0, + payState : false, //支付选择弹出 + writeState : false, //激活码弹出 + disabled : false, //按钮状态 + payType : 'wechat' //支付类型 wechat微信 code激活码 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + identityid: options.identityid + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取身份信息 + this.identityInfo(); + }, + + /** + * 身份信息 + */ + identityInfo() { + wx.$api.member.identityOpen(this.data.identityid).then(res => { + this.setData({ + // orderId: res.data.order + orderId: res.data.order_id + }) + }).catch(err => {}) + }, + + /** + * 选择支付 + */ + payChange(e) { + this.setData({ + payType: e.detail.value + }) + }, + + /** + * 显示支付选择弹出 + */ + payShow() { + this.setData({ + payState: !this.data.payState + }) + }, + + // 微信支付 + payment() { + // 隐藏支付选择弹出 + this.setData({ + payState: false + }) + if(this.data.payType == 'code') { + // 弹出激活码填写表单 + this.setData({ + writeState: !this.data.writeState + }) + return + } + // 微信支付 + wx.login({ + success: res => { + wx.$api.member.openid(res).then(openidRes => { + wx.$api.member.identityPay(this.data.orderId, { + channel: 'miniapp', + openid : openidRes.data + }).then(PayRes => { + let payInfo = JSON.parse(PayRes.data.wechat) + wx.requestPayment({ + timeStamp: payInfo.timeStamp, + nonceStr : payInfo.nonceStr, + package : payInfo.package, + paySign : payInfo.paySign, + signType : payInfo.signType, + success : payInfoRes=>{ + if(payInfoRes.errMsg == "requestPayment:ok"){ + wx.showToast({ + title: '支付成功', + icon : 'success' + }) + setTimeout(()=>{ + wx.navigateTo({ + url: './tips/index' + }) + },3000) + } + }, + fail : res=>{ + wx.showToast({ + title: '取消支付', + icon: 'none' + }) + } + }) + }).catch(err => {}) + }).catch(err => {}) + } + }) + }, + + // 激活码支付 + writePayment(e) { + let newCode = e.detail.value.code + wx.$api.member.codePay(this.data.orderId, { + code: newCode + }).then(res => { + this.setData({ + disabled: true + }) + + // 返回上一页 + wx.navigateBack(); + }).catch(err => {}) + }, + + /** + * 关闭激活码填写 + */ + writeHide(){ + this.setData({ + writeState: false + }) + }, +}) \ No newline at end of file diff --git a/pages/bond/index.json b/pages/bond/index.json new file mode 100644 index 0000000..ea7de7f --- /dev/null +++ b/pages/bond/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "保证金" +} \ No newline at end of file diff --git a/pages/bond/index.wxml b/pages/bond/index.wxml new file mode 100644 index 0000000..c8dde61 --- /dev/null +++ b/pages/bond/index.wxml @@ -0,0 +1,43 @@ + + + + 保证金支付 + + + + + + + + + + + + + + 立即支付 + + + + + + +
+ + + + + + + +
+
\ No newline at end of file diff --git a/pages/bond/index.wxss b/pages/bond/index.wxss new file mode 100644 index 0000000..455ea1b --- /dev/null +++ b/pages/bond/index.wxss @@ -0,0 +1,187 @@ +.temporary { + width: 100%; +} + +.member-btn { + position: fixed; + left: 0; + bottom: 0; + width: 100%; + padding: 30rpx; + box-sizing: border-box; + z-index: 9; +} + +.btnGo { + padding: 0 30rpx; + line-height: 90rpx; + font-size: 36rpx; + box-sizing: border-box; + background-image: linear-gradient(to right, #fce9cf, #dfac80); + box-shadow: 0 4rpx 4rpx 3rpx rgba(175, 136, 88, 1); + border-radius: 50rpx; + color: #633a25; + font-weight: 600; + text-align: center; +} + +.btnGo.active { + background-image: linear-gradient(to right, #d4d4d4, #e0e0e0); + box-shadow: 0 2px 2px 1px #b7b7b7; + color: #656565 +} + +/* 支付弹出 */ +.payPop { + position: fixed; + width: 100%; + height: 100%; + left: 0; + top: 0; + background-color: rgba(0, 0, 0, .4); + z-index: 999; + display: none; +} + +.payPop.active { + display: block; +} + +.payCont { + position: fixed; + width: 100%; + box-sizing: border-box; + bottom: 0; + left: 0; + background-color: #ffffff; + z-index: 1000; + border-radius: 90rpx 90rpx 0 0; + padding: 30rpx 40rpx; + display: none; +} + +.payCont.active { + display: block; +} + +.payCont-close { + text-align: right; + margin-bottom: 40rpx; + padding-right: 10rpx; + box-sizing: border-box; +} + +.payCont-close image { + width: 40rpx; + height: 40rpx; +} + +.payCont-radio { + display: flex; + line-height: 100rpx; +} + +.payCont-name { + flex: 1; + font-weight: 600; + display: flex; +} + +.payCont-name image { + width: 48rpx; + height: 48rpx; + margin-right: 20rpx; + margin-top: 26rpx; +} + +.payCont-radio radio { + transform: scale(.9); +} + +.payCont-btn { + margin: 60rpx 0 20rpx; + width: 100%; + background-color: #e8c198; + line-height: 90rpx; + color: #442b11; + text-align: center; + border-radius: 10rpx; +} + +/* 填写激活码弹出 */ +.writePop { + position: fixed; + width: 100%; + height: 100%; + left: 0; + top: 0; + background-color: rgba(0, 0, 0, .4); + z-index: 999; + display: none; +} + +.writePop.active { + display: block; +} + +.writeCont { + position: fixed; + width: 100%; + box-sizing: border-box; + bottom: 0; + left: 0; + background-color: #ffffff; + z-index: 1000; + border-radius: 90rpx 90rpx 0 0; + padding: 30rpx 40rpx; + display: none; +} + +.writeCont.active { + display: block; +} + +.writeCont-close { + text-align: right; + margin-bottom: 40rpx; + padding-right: 10rpx; + box-sizing: border-box; +} + +.writeCont-close image { + width: 40rpx; + height: 40rpx; +} + +.writePop-input { + background-color: #f5f5f5; + height: 90rpx; + border-radius: 10rpx; + padding: 0 30rpx; + box-sizing: border-box; +} + +.writePop-input input { + background-color: transparent; + border: none; + height: 100%; + line-height: 90rpx; +} + +.writeCont-btn { + margin: 60rpx 0 20rpx; + width: 100% !important; + padding: 0; + background-color: #e8c198 !important; + line-height: 90rpx; + color: #442b11 !important; + font-size: 32rpx; + text-align: center; + border-radius: 10rpx; + border: none; + box-shadow: none; +} + +.writeCont-btn::after { + display: none; +} \ No newline at end of file diff --git a/pages/bond/tips/index.js b/pages/bond/tips/index.js new file mode 100644 index 0000000..c526e93 --- /dev/null +++ b/pages/bond/tips/index.js @@ -0,0 +1,28 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, +}) \ No newline at end of file diff --git a/pages/bond/tips/index.json b/pages/bond/tips/index.json new file mode 100644 index 0000000..3928faa --- /dev/null +++ b/pages/bond/tips/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/bond/tips/index.wxml b/pages/bond/tips/index.wxml new file mode 100644 index 0000000..494cd10 --- /dev/null +++ b/pages/bond/tips/index.wxml @@ -0,0 +1,7 @@ + + + + 支付成功 + + 知道了 + \ No newline at end of file diff --git a/pages/bond/tips/index.wxss b/pages/bond/tips/index.wxss new file mode 100644 index 0000000..b484309 --- /dev/null +++ b/pages/bond/tips/index.wxss @@ -0,0 +1,34 @@ +.examine { + padding: 240rpx 0 30rpx; + box-sizing: border-box; + text-align: center; +} + +.examine image { + width: 45%; + margin: 0 auto 30rpx; +} + +.text .title { + font-weight: 600; + font-size: 42rpx; + margin-bottom: 30rpx; +} + +.text .time { + color: #999999; + line-height: 50rpx; +} + +.return { + display: inline-block; + margin-top: 80rpx; + background-color: #1d37e2; + padding: 0 180rpx; + height: 90rpx; + line-height: 90rpx; + border-radius: 10rpx; + box-shadow: 0 3rpx 6rpx 4rpx rgba(6, 34, 214, .6); + color: #FFFFFF; + font-size: 34rpx; +} \ No newline at end of file diff --git a/pages/code/index.js b/pages/code/index.js new file mode 100644 index 0000000..393ad4a --- /dev/null +++ b/pages/code/index.js @@ -0,0 +1,268 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + shareSee : false, //分享弹出 + identity : 1, //1为普通,2为上师版, 3为何院士 + userInfo : '', //用户信息 + inviteText: '', //邀请码 + invite : '' //二维码 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取推广码 + this.inviteInfo(); + + // 获取小程序码 + this.ShareInfo(); + }, + + /** + * 推广码 + */ + inviteInfo() { + wx.$api.user.invite().then(res => { + this.setData({ + identity : res.data.user_info.tag, + userInfo : res.data.user_info, + inviteText : res.data.invite + }) + }).catch(err => {}) + }, + + /** + * 小程序码 + */ + ShareInfo() { + wx.$api.user.miniShare({ + url: '/pages/login/index' + }).then(res => { + this.setData({ + invite: res.data.qrcode + }) + }).catch(err => {}) + }, + + /** + * 分享弹出 + */ + shareTap() { + this.setData({ + shareSee: !this.data.shareSee + }) + }, + + /** + * 第一种海报样式 保存图片到本地 + */ + saveImg(){ + this.dowImg(); + this.setData({ + shareSee: false + }) + }, + + /** + * 第二种海报样式 保存图片到本地 + */ + TwoImg(){ + this.TwoSaveImg(); + this.setData({ + shareSee: false + }) + }, + + /** + * 第一种海报样式 + */ + dowImg(){ + wx.showLoading({ + title: '生成中', + mask : true + }) + + // 下载背景素材 + let codeImg = new Promise(success => { + wx.getImageInfo({ + src : this.data.invite, + success : res => { + success(res.path) + } + }) + }) + + // 下载背景素材 + let backUrl + if (this.data.identity == 1) { + backUrl = "https://api.siyuankunlun.com/storage/materials/2022/09/14/code.jpg" + } else if (this.data.identity == 2) { + backUrl = "https://api.siyuankunlun.com/storage/materials/2022/09/14/code_01.png" + } + + Promise.all([codeImg]).then(res => { + wx.getImageInfo({ + src : backUrl, + success : networkImg => { + // 绘制海报 + const ctx = wx.createCanvasContext('qrcodeCard') + ctx.save() + + // 绘制背景 + ctx.drawImage(networkImg.path, 0, 0, 375, 800) + + // 绘制二维码背景 + ctx.drawImage("/static/imgs/codeshart_back.png", 137, 532, 100, 100) + + // 绘制二维码 + ctx.drawImage(res[0], 145, 540, 85, 85) + + // 文字 + ctx.setFontSize(12) + ctx.setFillStyle("#eadbc8") + ctx.setTextAlign('center') + ctx.fillText("扫描二维码了解更多", 188, 650 , 270) + + // 保存图片 + ctx.draw(true, () => { + wx.hideLoading() + wx.canvasToTempFilePath({ + canvasId: 'qrcodeCard', + x: 0, + y: 0, + success: keepRes => { + wx.saveImageToPhotosAlbum({ + filePath: keepRes.tempFilePath, + success : ()=>{ + wx.showToast({ + title: '分享海报已保存至相册', + icon : 'none' + }) + }, + fail : err=>{ + wx.showModal({ + title : '提示', + content : '暂未授权小程序写入您的相册,无法存储二维码海报', + confirmColor: '#d82526', + confirmText : '去设置', + success : info=>{ + if (info.confirm){ + wx.openSetting() + } + } + }) + }, + complete: e => {} + }) + } + }) + }) + } + }) + }).catch(err=>{}) + }, + + /** + * 第二种海报样式 + */ + TwoSaveImg() { + wx.showLoading({ + title: '加载中', + }) + + // 下载背景素材 + let codeImg = new Promise(success => { + wx.getImageInfo({ + src : this.data.invite, + success : res => { + success(res.path) + } + }) + }) + + Promise.all([codeImg]).then(res => { + wx.getImageInfo({ + src: "https://api.siyuankunlun.com/storage/materials/2022/09/14/code_02.png", + success : networkImg => { + // 绘制海报 + const ctx = wx.createCanvasContext('qrcodeCard') + ctx.save() + + // 绘制背景 + ctx.drawImage(networkImg.path, 0, 0, 375, 800) + + // 绘制二维码背景 + ctx.drawImage("/static/imgs/codeshart_back_02.png", 60, 550, 246, 94) + + // 绘制二维码 + ctx.drawImage(res[0], 215, 562, 70, 70) + + // 绘制标题 + ctx.drawImage("/static/imgs/codeShart_title1.png", 80, 570, 120, 56) + + // 保存图片 + ctx.draw(true, () => { + wx.hideLoading() + wx.canvasToTempFilePath({ + canvasId: 'qrcodeCard', + x: 0, + y: 0, + success: keepRes => { + wx.saveImageToPhotosAlbum({ + filePath: keepRes.tempFilePath, + success : ()=>{ + wx.showToast({ + title: '分享海报已保存至相册', + icon : 'none' + }) + }, + fail : err=>{ + wx.showModal({ + title : '提示', + content : '暂未授权小程序写入您的相册,无法存储二维码海报', + confirmColor: '#d82526', + confirmText : '去设置', + success : info=>{ + if (info.confirm){ + wx.openSetting() + } + } + }) + }, + complete: e => {} + }) + } + }) + }) + } + }) + }).catch(err=>{}) + }, + + /** + * 微信分享 + */ + onShareAppMessage(){ + return { + title : this.data.userInfo.nickname + '邀请您了解锶源昆仑', + path : "/pages/login/index?invite=" + this.data.inviteText, + imageUrl: "https://api.siyuankunlun.com/storage/materials/2022/09/14/code.jpg" + } + } +}) \ No newline at end of file diff --git a/pages/code/index.json b/pages/code/index.json new file mode 100644 index 0000000..2392939 --- /dev/null +++ b/pages/code/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "邀请码" +} \ No newline at end of file diff --git a/pages/code/index.wxml b/pages/code/index.wxml new file mode 100644 index 0000000..43c7cc4 --- /dev/null +++ b/pages/code/index.wxml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + 扫描二维码了解更多 + + + + 分享 + + + + + + + + + + + + + 保存二维码 + + + + 保存二维码 + + + 取消 + \ No newline at end of file diff --git a/pages/code/index.wxss b/pages/code/index.wxss new file mode 100644 index 0000000..5a44512 --- /dev/null +++ b/pages/code/index.wxss @@ -0,0 +1,164 @@ +.code { + width: 100vw; + height: 100vh; + position: relative; +} + +.code-back { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; +} + +.code-cont { + width: 100%; + position: absolute; + z-index: 9; + text-align: center; + left: 0; + bottom: 19%; +} + +.code-img{ + margin: 0 auto 20rpx; + overflow: hidden; + border-radius: 30rpx; + width: 190rpx; + height: 190rpx; + border: 4rpx solid #be9768; + background-color: #ffffff; +} + +.code-img image { + width: 100%; +} + +.code-text { + background: linear-gradient(to right, #aa957b, #ffeeda, #aa957b); + -webkit-background-clip: text; + background-clip: text; + color: transparent; + font-size: 26rpx; +} + +.code-share { + position: absolute; + z-index: 10; + left: 0; + bottom: 24%; + background: linear-gradient(to right, #aa957b, #ffeeda); + width: 50rpx; + text-align: center; + border-radius: 0 20rpx 20rpx 0; + padding: 20rpx 0; +} + +.code-share-name { + writing-mode:vertical-rl; + font-size: 28rpx; + padding-left: 4rpx; + color: #4d2a00; +} + +.code-share image { + width: 30rpx; + height: 30rpx; + margin-bottom: 5rpx; +} + +.sharePop { + position: fixed; + width: 100%; + z-index: 99; + left: 0; + bottom: 0; + background-color: #0a1930; + display: none; +} + +.sharePop.active { + display: block; +} + +.shareCont-label image { + width: 60rpx; + height: 60rpx; + display: block; + margin: 0 auto 10rpx; +} + +.shareCancel { + border-top: 2rpx solid #0e2c58; + color: #ffffff; + width: 100%; + text-align: center; + line-height: 100rpx; +} + +.shareCont{ + display: flex; + padding: 30rpx 0; +} + +.shareCont-label { + color: #ffffff; + flex: 2; + text-align: center; + font-size: 28rpx; +} + +.codeShare-button { + background-color: transparent; + padding: 0; + font-weight: normal; +} + +/* canvas */ +.canvasImg { + position: absolute; + left: -1000%; + height: 800px; + width: 375px; +} + +/* 何院士样式 */ +.newCode-cont { + width: 70%; + height: 200rpx; + position: absolute; + z-index: 9; + text-align: center; + left: 15%; + bottom: 19.5%; + background: linear-gradient(to top, #a09084, #a58367); + padding: 15rpx; + box-sizing: border-box; + border-radius: 30rpx; +} + +.newCode-img { + height: 170rpx; + margin: 0 auto; + background: linear-gradient(to top, #e9d1bd, #c49b7a); + border: 4rpx solid #f3c49d; + border-radius: 30rpx; + display: flex; + padding: 10rpx 30rpx 10rpx 10rpx; + box-sizing: border-box; +} + +.newCode-img-title { + width: calc(100% - 140rpx); +} + +.newCode-img-title image { + width: 80%; + margin-top: 15rpx; +} + +.newCode-img-code { + width: 140rpx; + height: 140rpx; +} \ No newline at end of file diff --git a/pages/coupons/list/index.js b/pages/coupons/list/index.js new file mode 100644 index 0000000..65a2612 --- /dev/null +++ b/pages/coupons/list/index.js @@ -0,0 +1,74 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + couponArr : [], //抵值券 + page : {}, //下一页 + lodingStats : false, //加载状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + couponId: options.couponid + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取我的抵值券 + this.couponInfo(); + }, + + // 我的抵值券 + couponInfo(page){ + wx.$api.user.couponList(this.data.couponId,{ + page : page || 1 + }).then(res => { + let listArr = this.data.couponArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.data) + this.setData({ + couponArr : newData, + page : res.data.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + }).catch(err => {}) + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取我的抵值券 + this.couponInfo(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取我的抵值券 + this.couponInfo(pageNumber); + } + } +}) \ No newline at end of file diff --git a/pages/coupons/list/index.json b/pages/coupons/list/index.json new file mode 100644 index 0000000..18e0e44 --- /dev/null +++ b/pages/coupons/list/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "抵值券" +} \ No newline at end of file diff --git a/pages/coupons/list/index.wxml b/pages/coupons/list/index.wxml new file mode 100644 index 0000000..8699971 --- /dev/null +++ b/pages/coupons/list/index.wxml @@ -0,0 +1,50 @@ + + + + + + + + {{item.title}} + + + {{item.time.end_at}} 到期 + + + + + {{item.price}} + + + {{item.price_text}} + + + + + + 开通季卡会员可低值 + + + + 立即使用 + + + {{item.status.text}} + + + + + + + + 加载中... + + + 没有更多了~ + + + + + + 暂无数据 + \ No newline at end of file diff --git a/pages/coupons/list/index.wxss b/pages/coupons/list/index.wxss new file mode 100644 index 0000000..b6780f0 --- /dev/null +++ b/pages/coupons/list/index.wxss @@ -0,0 +1,150 @@ +page { + padding: 30rpx; + box-sizing: border-box; + background-color: #f5f5f5; +} + +.item-label { + border-radius: 30rpx; + padding: 50rpx 40rpx 20rpx; + box-sizing: border-box; + margin-bottom: 40rpx; + position: relative; + box-shadow: 0 0 6rpx 2rpx rgba(0, 0, 0, .1); + background-image: linear-gradient(to top right, #f9e3b4, #ecc685); +} + +.item-label.active { + background-image: linear-gradient(to top right, #c9c9c9, #b5b5b5); +} + +.item-label::after, +.item-label::before { + position: absolute; + content: ''; + background-color: #f5f5f5; + width: 30rpx; + height: 30rpx; + bottom: 84rpx; + border-radius: 50%; +} + +.item-label::after { + left: -15rpx; +} + +.item-label::before { + right: -15rpx; +} + +.tipsImg { + position: absolute; + top: 0; + left: 30rpx; + width: 170rpx; +} + +.tipsImg.active { + -webkit-filter: grayscale(100%); + -moz-filter: grayscale(100%); + -ms-filter: grayscale(100%); + -o-filter: grayscale(100%); + filter: grayscale(100%); + filter: gray; +} + +.top { + margin-bottom: 20rpx; + display: flex; +} + +.left { + flex: 1; + font-weight: 600; +} + +.name { + margin-bottom: 15rpx; + font-size: 34rpx; + margin-top: 10rpx; +} + +.time { + background-color: #f6d4a6; + font-size: 26rpx; + display: inline-block; + color: #eb5941; + line-height: 48rpx; + padding: 0 10rpx; + border-radius: 10rpx; +} + +.time.active { + background-color: #b1b1b1; + color: #464646; +} + +.right { + color: #835529; +} + +.right-prop { + font-size: 52rpx; + font-weight: 600; + display: flex; +} + +.right-prop text { + font-size: 28rpx; + margin-top: 10rpx; + padding-right: 6rpx; +} + +.right-tips { + font-size: 26rpx; + text-align: center; +} + +.right.active { + color: #464646; +} + +.bottom { + border-top: 2rpx dashed #dfc796; + display: flex; + font-size: 28rpx; + padding-top: 20rpx; + margin-top: 30rpx; +} + +.bottom.active { + border-color: #adadad; +} + +.tips { + color: #b18c5d; + line-height: 58rpx; + flex: 1; +} + +.tips.active { + color: #464646; +} + +.btn { + background-image: linear-gradient(to right, #d8a76a, #b37a3e); + border-radius: 70rpx; + color: #ffffff; + padding: 0 30rpx; + height: 58rpx; + line-height: 58rpx; + font-weight: 600; + border: 2rpx solid #c38d4c; +} + +.btn.active { + background-image: linear-gradient(to right, #8f8f8f, #a7a7a7); + color: #000; + border-color: #a7a7a7; +} + diff --git a/pages/coupons/organize/index.js b/pages/coupons/organize/index.js new file mode 100644 index 0000000..e4c87ea --- /dev/null +++ b/pages/coupons/organize/index.js @@ -0,0 +1,72 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + couponArr : [], //抵值券 + page : {}, //下一页 + lodingStats : false, //加载状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取我的抵值券 + this.couponInfo(); + }, + + /** + * 我的抵值券 + */ + couponInfo(page){ + wx.$api.user.coupon({ + page : page || 1 + }).then(res => { + let listArr = this.data.couponArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.lists) + this.setData({ + couponArr : newData, + page : res.data.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + }).catch(err => {}) + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取我的抵值券 + this.couponInfo(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取我的抵值券 + this.couponInfo(pageNumber); + } + } +}) \ No newline at end of file diff --git a/pages/coupons/organize/index.json b/pages/coupons/organize/index.json new file mode 100644 index 0000000..18e0e44 --- /dev/null +++ b/pages/coupons/organize/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "抵值券" +} \ No newline at end of file diff --git a/pages/coupons/organize/index.wxml b/pages/coupons/organize/index.wxml new file mode 100644 index 0000000..a56b59e --- /dev/null +++ b/pages/coupons/organize/index.wxml @@ -0,0 +1,41 @@ + + + + + + + {{item.title}} + + + {{item.time.interval}} + + + + + {{item.price}} + + + {{item.price_text}} + + + + + + 共{{item.coupon_count}}张{{item.title}} + + + + + + + 加载中... + + + 没有更多了~ + + + + + + 暂无数据 + \ No newline at end of file diff --git a/pages/coupons/organize/index.wxss b/pages/coupons/organize/index.wxss new file mode 100644 index 0000000..9ee1a2e --- /dev/null +++ b/pages/coupons/organize/index.wxss @@ -0,0 +1,114 @@ +page { + padding: 30rpx; + box-sizing: border-box; + background-color: #f5f5f5; +} + +.item { + border-radius: 30rpx; + padding: 50rpx 40rpx 10rpx; + box-sizing: border-box; + margin-bottom: 40rpx; + position: relative; + box-shadow: 0 0 6rpx 2rpx rgba(0, 0, 0, .1); + background-image: linear-gradient(to top right, #f9e3b4, #ecc685); +} + +.item::after, +.item::before { + position: absolute; + content: ''; + background-color: #f5f5f5; + width: 30rpx; + height: 30rpx; + bottom: 84rpx; + border-radius: 50%; +} + +.item::after { + left: -15rpx; +} + +.item::before { + right: -15rpx; +} + +.tipsImg { + position: absolute; + top: 0; + left: 30rpx; + width: 170rpx; +} + +.top { + margin-bottom: 20rpx; + display: flex; +} + +.left { + flex: 1; + font-weight: 600; +} + +.name { + margin-bottom: 15rpx; + font-size: 34rpx; + margin-top: 10rpx; +} + +.time { + background-color: #f6d4a6; + font-size: 26rpx; + display: inline-block; + color: #eb5941; + line-height: 48rpx; + padding: 0 10rpx; + border-radius: 10rpx; +} + +.right { + color: #835529; +} + +.right-prop { + font-size: 50rpx; + font-weight: 600; + display: flex; +} + +.right-prop text { + font-size: 28rpx; + margin-top: 10rpx; + padding-right: 6rpx; +} + +.right-tips { + font-size: 26rpx; + text-align: center; +} + +.bottom { + border-top: 2rpx dashed #dfc796; + display: flex; + font-size: 28rpx; + padding-top: 20rpx; + margin-top: 30rpx; +} + +.tips { + color: #b18c5d; + line-height: 58rpx; + flex: 1; +} + +.tips text { + font-weight: 600; + padding: 0 5rpx; +} + +.arrow { + width: 32rpx; + height: 32rpx; + margin-top: 10rpx; +} + diff --git a/pages/index/carry/index.js b/pages/index/carry/index.js new file mode 100644 index 0000000..4de2b02 --- /dev/null +++ b/pages/index/carry/index.js @@ -0,0 +1,136 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + num : 1, //数量默认1 + address : '', //地址 + stockData : '', //数据 + isExperience : '', //身份 + disabled : false + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + // 获取提货前置 + this.pickInfo(); + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 提货前置 + */ + pickInfo (){ + wx.$api.stock.pick().then(res => { + this.setData({ + address : res.data.address, + stockData : res.data.stockData, + isExperience : res.data.dientity.is_experience + }) + }).catch(err => {}) + }, + + /** + * 商品数量加减 + */ + goodsNumber(e){ + let num = this.data.num, + val = e.currentTarget.dataset.type + if (val == 'plus'){ + num ++; + if(num > this.data.stockData.stock ){ + wx.showToast({ + title: '商品数量不能大于库存量', + icon: 'none' + }); + num = this.data.stockData.stock + } + + }else{ + if (num > 1){ + num --; + }else{ + wx.showToast({ + title : '商品数量不能小于1', + icon : 'none' + }) + } + this.setData({ + num: num + }) + } + this.setData({ + num: num + }) + }, + + /** + * 输入商品数量 + */ + goodsNumberInput(e) { + let goodsNum = e.detail.value; + if (goodsNum > 0) { + if(goodsNum > this.data.stockData.stock ){ + wx.showToast({ + title: '商品数量不能大于库存量', + icon: 'none' + }); + this.setData({ + num: this.data.stockData.stock + }) + return + } + this.setData({ + num: goodsNum + }) + } else { + wx.showToast({ + title: '商品数量不能小于1', + icon: 'none' + }); + this.setData({ + num: 1 + }) + } + }, + + /** + * 申请提货 + */ + stockForm(e) { + let newQty = this.data.num + if(this.data.isExperience) { + newQty = this.data.stockData.stock + } + let data = { + remark : e.detail.value.remark, + qty : newQty, + address_id : this.data.address.address_id + } + + wx.$api.stock.pickTake(data).then(res => { + this.setData({ + disabled: true + }) + + // 跳到审核页面 + wx.redirectTo({ + url: '../examine/index' + }) + }).catch(err => {}) + } +}) \ No newline at end of file diff --git a/pages/index/carry/index.json b/pages/index/carry/index.json new file mode 100644 index 0000000..28c8a62 --- /dev/null +++ b/pages/index/carry/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "申请提货" +} \ No newline at end of file diff --git a/pages/index/carry/index.wxml b/pages/index/carry/index.wxml new file mode 100644 index 0000000..8d05a03 --- /dev/null +++ b/pages/index/carry/index.wxml @@ -0,0 +1,63 @@ +
+ + + + + 温馨提示 + + 收货地址只限制广东省深圳市地区 + + + + + + 提货数量 + + + {{stockData.stock}} + + + + + 提货数量 + + + - + + + + + + + + 备注信息 + + + + + + + 删除 + + + + + 添加 + + + + + + + + + + + + + + + + +{{score}} + 水滴 + + + + 水滴已发放! + + + + + diff --git a/pages/index/write/index.wxss b/pages/index/write/index.wxss new file mode 100644 index 0000000..b0cb8ac --- /dev/null +++ b/pages/index/write/index.wxss @@ -0,0 +1,192 @@ +page { + background-color: #f5f5f5; + padding: 30rpx; + box-sizing: border-box; +} + +.issue-block { + background: white; + padding: 30rpx; + box-sizing: border-box; + border-radius: 10rpx; +} + +.issue-textarea textarea { + width: 100%; + height: 200rpx; +} + +.album-list { + display: flex; + flex-wrap: wrap; +} + +.album-list-li { + margin-right: 10rpx; + position: relative; + width: calc(25% - 10rpx); + padding-top: calc(25% - 10rpx); + box-sizing: border-box; +} + +.album-list-li:last-child { + margin: 0; +} + +.album-list-img, +.album-list-li-add { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: #f5f5f5; + border-radius: 6rpx; +} + +.album-list-li-add { + text-align: center; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-box-pack: center; + color: #666; + font-size: 26rpx; +} + +.album-list-add-icon { + width: 34rpx; + height: 34rpx; +} + +.album-remove { + position: absolute; + right: 0; + bottom: 0; + background: rgba(0, 0, 0, .5); + color: white; + font-size: 28rpx; + text-align: center; + line-height: 50rpx; + width: 100%; + z-index: 9; +} + +.site-btn { + margin-top: 120rpx; +} + +.site-btn button[size="mini"] { + width: 100%; + background: #1d37e2; + height: 88rpx; + line-height: 88rpx; + font-size: 30rpx; + color: white; + padding: 0; +} + +.site-btn button[disabled] { + background: #7789ff !important; + color: #fff !important; +} + +/* 获得水滴弹出层提示 */ +.publicBack { + position: fixed; + width: 100vw; + height: 100vh; + left: 0; + top: 0; + background-color: rgba(0, 0, 0, .5); + z-index: 99; + display: none; +} + +.publicBack.active { + display: block; +} + +.publicPop { + left: 50%; + top: 50%; + width: 440rpx; + height: 300rpx; + margin-left: -220rpx; + margin-top: -200rpx; + position: fixed; + z-index: 100; + background-color: #ffffff; + border-radius: 30rpx; + text-align: center; + display: none; +} + +.publicBack.active { + display: block; +} + +.publicPop-close { + position: absolute; + top: -20rpx; + right: -20rpx; + z-index: 102; + width: 54rpx; + height: 54rpx; +} + +.publicPop-img { + width: 70%; + margin: -30rpx auto 0; +} + +.publicPop-text { + padding-bottom: 20rpx; + box-sizing: border-box; + font-weight: 600; + color: #e56653; + padding-top: 40rpx; +} + +.number { + font-size: 72rpx; + display: inline-block; + padding-right: 10rpx; +} + +.publicPop-text text { + font-size: 36rpx; + display: inline-block; + line-height: 86rpx; + vertical-align: bottom; +} + +.publicPop-tips { + position: absolute; + bottom: 0; + left: 0; + width: 100%; + background-color: #fdfae7; + color: #e6a950; + line-height: 80rpx; + font-weight: 600; + border-top: 2rpx solid #f6ede6; + border-radius: 0 0 30rpx 30rpx; +} + +.publicPop-tips image { + width: 54rpx; + height: 54rpx; + vertical-align: -14rpx; +} + +.publicPop-left { + width: 90rpx; + position: absolute; + top: 46%; + right: 2rpx; +} + +.publicPop-right { + transform: rotate(180deg); + left: 2rpx; +} \ No newline at end of file diff --git a/pages/login/agreement/index.js b/pages/login/agreement/index.js new file mode 100644 index 0000000..6d51d02 --- /dev/null +++ b/pages/login/agreement/index.js @@ -0,0 +1,31 @@ +/* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + content: '' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + // 获取用户协议 + wx.$api.auth.registeragree(options.type).then(res => { + this.setData({ + content: res.data.content + }) + }).catch(err => {}) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() {}, +}) \ No newline at end of file diff --git a/pages/login/agreement/index.json b/pages/login/agreement/index.json new file mode 100644 index 0000000..3928faa --- /dev/null +++ b/pages/login/agreement/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/login/agreement/index.wxml b/pages/login/agreement/index.wxml new file mode 100644 index 0000000..7fd32b1 --- /dev/null +++ b/pages/login/agreement/index.wxml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/pages/login/agreement/index.wxss b/pages/login/agreement/index.wxss new file mode 100644 index 0000000..3f2d3bf --- /dev/null +++ b/pages/login/agreement/index.wxss @@ -0,0 +1,5 @@ +.agreement-content{ + padding: 30rpx; + box-sizing: border-box; + font-size: 32rpx; +} \ No newline at end of file diff --git a/pages/login/index.js b/pages/login/index.js new file mode 100644 index 0000000..b42f80d --- /dev/null +++ b/pages/login/index.js @@ -0,0 +1,162 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + phone : "", + code : "", + parentId: "", //邀请码 + newUser : '', //是否为新用户 + checked : false, //勾选协议 + codename: '获取验证码', + getSms : false + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + // 是否有邀请码 + if(options) { + this.setData({ + parentId : options.invite || '', + channelId : options.channel || '' + }) + } + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 手机号码 + */ + bindInput(e) { + this.setData({ + phone: e.detail.value + }) + }, + + /** + * 短信验证码 + */ + bindCode(e) { + this.setData({ + code: e.detail.value + }) + }, + + /** + * 获取短信验证码 + */ + getPhoneCode(e) { + let mobile = this.data.phone, + myreg = /^(14[0-9]|13[0-9]|15[0-9]|17[0-9]|18[0-9])\d{8}$$/ + + var _this = this + + if (mobile == "") { + wx.showToast({ + title : '手机号不能为空', + icon : 'none', + duration : 1000 + }) + return false; + }else if (!myreg.test(mobile)) { + wx.showToast({ + title : '请输入正确的手机号', + icon : 'none', + duration : 1000 + }) + return false; + }else{ + wx.$api.auth.getSms({ + mobileNo: mobile + }).then(res=>{ + _this.setData({ + newUser : res.data.new, + getSms : true + }) + + wx.showToast({ + title : '发送成功', + icon : 'success', + duration: 2000 + }) + var num = 60; + var timer = setInterval(function () { + num--; + if (num <= 0) { + clearInterval(timer); + _this.setData({ + codename : '重新发送', + getSms : false + }) + + } else { + _this.setData({ + codename : num + "s后重新获取", + getSms : true + }) + } + }, 1000) + }).catch(err=>{}) + } + }, + + /** + * 邀请码 + */ + parentInput(e) { + this.setData({ + parentId: e.detail.value + }) + }, + + /** + * 用户登录 + */ + login() { + if(this.data.checked) { + wx.$api.auth.smsAuth({ + mobileNo : this.data.phone, + code : this.data.code, + invite : this.data.parentId, + channel : this.data.channelId + }).then(res=>{ + // 写入缓存 + wx.setStorage({ + key : 'token', + data : res.data.token_type + ' ' + res.data.access_token + }) + + // 回到首页 + wx.switchTab({ + url: '/pages/mall/index/index' + }) + }).catch(err=>{}) + } else { + wx.showToast({ + title: '请勾选用户隐私和服务协议', + icon: "none" + }) + } + }, + + // 勾选协议 + radioChange() { + this.setData({ + checked: !this.data.checked + }) + } +}) \ No newline at end of file diff --git a/pages/login/index.json b/pages/login/index.json new file mode 100644 index 0000000..5f59c44 --- /dev/null +++ b/pages/login/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "锶源昆仑" +} \ No newline at end of file diff --git a/pages/login/index.wxml b/pages/login/index.wxml new file mode 100644 index 0000000..698fd9e --- /dev/null +++ b/pages/login/index.wxml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + 登录即表示同意用户《隐私协议》《服务协议》 + + \ No newline at end of file diff --git a/pages/login/index.wxss b/pages/login/index.wxss new file mode 100644 index 0000000..90a9e4b --- /dev/null +++ b/pages/login/index.wxss @@ -0,0 +1,164 @@ +page { + height: 100vh; + width: 100vw; + padding: 90rpx 60rpx; + box-sizing: border-box; + background: white; +} + +.login-top { + height: 17vh; + width: 100%; + flex-direction: row; + align-items: flex-end; + justify-content: center; + box-sizing: border-box; + position: relative; + color: #919191; +} + +.top-bg { + position: absolute; + bottom: 30rpx; + z-index: 2; + width: 740rpx; +} + +.top-logo-content { + box-sizing: border-box; + color: #000; + font-weight: 600; + font-size: 40rpx; + margin-bottom: 10rpx; +} + +.top-logo { + margin-bottom: 20rpx; + width: 146rpx; + height: 146rpx; +} + +.inputs { + background: rgba(68, 144, 255, 0.05); + border: solid 1rpx #f2f2f2; + position: relative; + margin-top: 30rpx; + height: 80rpx; + line-height: 80rpx; +} + +.inputs input { + width: 100%; + height: 80rpx; + line-height: 80rpx; + padding: 0 30rpx; + border: none; + box-sizing: border-box; + font-size: 30rpx; +} + +input.inputs-phone { + padding-left: 150rpx; +} + +input.inputs-sms { + padding-right: 200rpx; +} + +.label { + position: absolute; + left: 0; + top: 0; + width: 120rpx; + text-align: center; + border-right: solid 1rpx #f2f2f2; + font-size: 30rpx; +} + +.sms-btn[size='mini'] { + font-weight: normal; + height: 77rpx; + line-height: 77rpx; + position: absolute; + top: 1rpx; + right: 1rpx; + padding: 0 20rpx; + margin: 0; + border-radius: 0; + border-left: solid 1rpx #f2f2f2; + color: #4490ff !important; + font-size: 30rpx; + background-color: transparent !important; +} + +.sms-btn::after { + border: none; +} + +.sms-btn[disabled] { + color: rgba(68, 144, 255, .6) !important; +} + +.title { + text-align: center; + font-size: 38rpx; + font-weight: bold; + color: #2a2a2a; + margin-bottom: 100rpx; +} + +.btn { + background: #4490ff !important; + width: 100% !important; + color: white !important; + border-radius: 0; + margin-top: 30rpx; + font-size: 32rpx; + line-height: 90rpx; + height: 90rpx; + font-weight: bold; + padding: 0; +} + +.btn::after { + border: none; +} + +.btn[disabled] { + background: rgba(68, 144, 255, .6) !important; +} + +.beianNo { + font-size: 26rpx; + color: #9d9d9d; + text-align: center; + padding-top: 60rpx; + position: fixed; + width: 100%; + left: 0; + bottom: 50rpx; +} + +/* 协议 */ +.agreement { + font-size: 26rpx; + color: #9d9d9d; + margin-top: 20rpx; + display: flex; +} + +.radioGroup { + transform: scale(.6); + width: 55rpx; + text-align: left; +} + +.agreement-text { + width: calc(100% - 55rpx); + line-height: 48rpx; +} + +.agreement-text navigator { + color: #000; + display: inline-block; +} \ No newline at end of file diff --git a/pages/mall/article/articleAll/index.js b/pages/mall/article/articleAll/index.js new file mode 100644 index 0000000..7e92874 --- /dev/null +++ b/pages/mall/article/articleAll/index.js @@ -0,0 +1,107 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ +Page({ + + /** + * 页面的初始数据 + */ + data: { + categoriesArr: '', //分类 + articlesArr : [] , //列表 + page : {}, //分页信息 + listType : 0, //类型 + name : '', //名称 + lodingStats : false, //加载状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取分类 + this.classifysInfo(); + + // 获取列表 + this.articlesInfo(); + }, + + // 分类 + classifysInfo(){ + wx.$api.mall.classifysAll().then(res => { + let Arr = res.data + let valueFirst = { + category_id: 0, + slug : "ALL", + title : "全部" + } + Arr.unshift(valueFirst) + this.setData({ + categoriesArr : Arr + }) + }).catch(err => {}) + }, + + // 列表 + articlesInfo(page){ + wx.$api.mall.favorites({ + category_id : this.data.listType, + page : page || 1 + }).then(res => { + let listArr = this.data.articlesArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.data) + this.setData({ + articlesArr : newData, + page : res.data.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + }).catch(err => {}) + }, + + /** + * 状态筛选 + */ + onTabs(val){ + console.log(val) + if(this.data.listType === val) return + this.setData({ + listType: val.currentTarget.dataset.type + }) + + // 商品详情数据 + this.articlesInfo(); + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取列表 + this.articlesInfo(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取列表 + this.articlesInfo(pageNumber); + } + } +}) \ No newline at end of file diff --git a/pages/mall/article/articleAll/index.json b/pages/mall/article/articleAll/index.json new file mode 100644 index 0000000..78b53b3 --- /dev/null +++ b/pages/mall/article/articleAll/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "文章列表" +} \ No newline at end of file diff --git a/pages/mall/article/articleAll/index.wxml b/pages/mall/article/articleAll/index.wxml new file mode 100644 index 0000000..34bb93c --- /dev/null +++ b/pages/mall/article/articleAll/index.wxml @@ -0,0 +1,31 @@ + + + {{item.title}} + + + + + + + {{item.categories[0].slug}} | {{item.title}} + {{item.description}} + + {{item.clicks}} + {{item.subscribes}} + + + + + + + 加载中... + + + 没有更多了~ + + + + + + 暂无数据 + \ No newline at end of file diff --git a/pages/mall/article/articleAll/index.wxss b/pages/mall/article/articleAll/index.wxss new file mode 100644 index 0000000..95ffcf7 --- /dev/null +++ b/pages/mall/article/articleAll/index.wxss @@ -0,0 +1,99 @@ +page { + padding: 30rpx; + box-sizing: border-box; + background-color: #f6f6f6; +} + + +/* tabs */ +.header { + position: fixed; + top: 0; + left: 0; + right: 0; + z-index: 99; +} + +.tabs { + display: flex; + justify-content: space-around; + background: white; + padding: 15rpx 0; + font-size: 30rpx; + color: #9d9d9d; +} + +.tabs-item { + height: 60rpx; + line-height: 60rpx; +} + +.tabs-item.show { + color: #1d37e2; + border-bottom: solid 4rpx #1d37e2; +} + +.list { + margin-top: 90rpx; +} + +.item { + position: relative; + background-color: #ffffff; + border-radius: 10rpx; + height: 200rpx; + margin-bottom: 30rpx; +} + +.itemImg { + position: absolute; + right: 0; + top: 0; + width: 200rpx; + height: 200rpx; + border-radius: 10rpx; + overflow: hidden; +} + +.itemCont { + position: absolute; + left: 0; + top: 0; + padding: 25rpx 230rpx 0 30rpx; + box-sizing: border-box; + width: 100%; +} + +.itemCont-name { + font-size: 30rpx; +} + +.itemCont-name text { + text-transform: uppercase; +} + +.itemCont-text { + color: #999; + font-size: 26rpx; + margin: 15rpx 0 30rpx; + font-weight: 200; +} + +.itemCont-see { + color: #999; + display: flex; + font-size: 26rpx; + font-weight: 200; +} + +.itemCont-icon { + display: flex; + margin-right: 50rpx; + line-height: 26rpx; +} + +.itemCont-icon image { + width: 26rpx; + height: 26rpx; + margin-right: 10rpx; +} \ No newline at end of file diff --git a/pages/mall/article/articleInfo/index.js b/pages/mall/article/articleInfo/index.js new file mode 100644 index 0000000..440a1d1 --- /dev/null +++ b/pages/mall/article/articleInfo/index.js @@ -0,0 +1,137 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ +Page({ + + /** + * 页面的初始数据 + */ + data: { + id : '', //文章id + indexShow : '', //内容 + mallContent : '', //简介 + favoritesSee : '', //收藏状态 + favoritesNumber : '', //收藏数量 + subscribesSee : '', //点赞状态 + subscribesNumber: '', //点赞数量 + inviteText : '', //邀请码 + isFixedTop : 0, + barHeight : getApp().globalData.statusBarHeight // 状态栏高度 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + id: options.id + }) + if (options.type == 'memory') { + wx.setNavigationBarTitle({ + title: '锶源昆仑·记忆' + }) + } else if (options.type == 'wiki') { + wx.setNavigationBarTitle({ + title: '锶源昆仑·健康百科' + }) + } + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取详情数据 + this.indexInfo(); + + // 获取登录状态 + if(wx.getStorageSync("token")){ + // 获取推广码 + this.inviteInfo(); + } + }, + + /** + * 推广码 + */ + inviteInfo() { + wx.$api.user.invite().then(res => { + this.setData({ + inviteText : res.data.invite + }) + }).catch(err => {}) + }, + + /** + * 详情数据 + */ + indexInfo () { + wx.$api.mall.articlesSee(this.data.id).then(res => { + this.setData({ + indexShow : res.data, + favoritesSee : res.data.isFavorite, + subscribesSee : res.data.isSubscribed, + favoritesNumber : res.data.favorites, + subscribesNumber: res.data.subscribes, + mallContent : res.data.content.replace(/\ {}) + }, + + // 操作按钮 + toolTap(e) { + let newName = e.currentTarget.dataset.name + // 收藏 + if(newName == 'favorites') { + wx.$api.mall.favorite(this.data.id).then(res => { + this.setData({ + favoritesSee : res.data.favorite, + favoritesNumber: res.data.count + }) + }).catch(err => {}) + return + } + + // 点赞 + wx.$api.mall.subscribe(this.data.id).then(res => { + this.setData({ + subscribesSee : res.data.subscribed, + subscribesNumber: res.data.count + }) + }).catch(err => {}) + }, + + /** + * 微信分享 + */ + onShareAppMessage(){ + return { + title : this.data.indexShow.title, + imageUrl: this.data.indexShow.cover + } + }, + + // 返回上一页 + returnGo() { + wx.navigateBack({ + delta: 1 + }) + }, + + returnHome() { + wx.switchTab({ + url: '/pages/mall/index/index' + }) + }, + + /** + * 监听页面滑动事件 + */ + onPageScroll(e) { + this.setData({ + isFixedTop: parseInt(e.scrollTop) + }); + }, +}) \ No newline at end of file diff --git a/pages/mall/article/articleInfo/index.json b/pages/mall/article/articleInfo/index.json new file mode 100644 index 0000000..f0f1934 --- /dev/null +++ b/pages/mall/article/articleInfo/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "navigationStyle": "custom", + "navigationBarTextStyle": "white" +} \ No newline at end of file diff --git a/pages/mall/article/articleInfo/index.wxml b/pages/mall/article/articleInfo/index.wxml new file mode 100644 index 0000000..4ca8a39 --- /dev/null +++ b/pages/mall/article/articleInfo/index.wxml @@ -0,0 +1,40 @@ + + + + + + + + + + {{indexShow.categories[0].slug}} | {{indexShow.title}} + + + {{indexShow.created_at}} + 浏览 {{indexShow.clicks}} + + + + + + + + + + + + + + + + {{favoritesNumber}} + + + + {{subscribesNumber}} + + + \ No newline at end of file diff --git a/pages/mall/article/articleInfo/index.wxss b/pages/mall/article/articleInfo/index.wxss new file mode 100644 index 0000000..e0f9696 --- /dev/null +++ b/pages/mall/article/articleInfo/index.wxss @@ -0,0 +1,102 @@ +page { + background-color: #ffffff; +} + +.articleImg { + width: 100%; + display: inline-block; +} + +.articleCont { + padding: 30rpx; + box-sizing: border-box; + border-bottom: 160rpx transparent solid; +} + +.articleName { + font-size: 36rpx; + margin-top: 20rpx; +} + +.articleName text { + text-transform: uppercase; +} + +.articleTool { + color: #666666; + font-size: 26rpx; + margin-top: 15rpx; +} + +.articleTool text { + padding-right: 30rpx; + font-weight: 200; +} + +.articleBanner { + text-align: center; + margin: 60rpx 0; +} + +.articleBanner image { + width: 100%; +} + +.tool { + position: fixed; + width: 100%; + height: 90rpx; + line-height: 90rpx; + left: 0; + bottom: 60rpx; + z-index: 99; + padding: 0 30rpx; + box-sizing: border-box; +} + +.toolCont { + background-color: #ffffff; + display: flex; + box-shadow: 0 0 10rpx rgba(0, 0, 0, .1); + border-radius: 80rpx; +} + +.toolCont-label { + flex: 3; + text-align: center; + color: #999; + font-size: 30rpx; + background-color: transparent; + padding: 0; + margin: 0; + line-height: 100rpx; + font-weight: 200; +} + +.toolCont-label-icon { + width: 36rpx; + height: 36rpx; + margin-right: 10rpx; + vertical-align: -4rpx; +} + +.navigation{ + position: fixed; + top: 0; + left: 0; + z-index: 99; + width: 100%; + height: 90rpx; + background-color: transparent; + transition: .2s; +} + +.navigation.active { + background-color: #ffffff; +} + +.navigation-arrow { + width: 44rpx; + height: 44rpx; + margin: 20rpx 15rpx 0 20rpx; +} \ No newline at end of file diff --git a/pages/mall/article/articleList/index.js b/pages/mall/article/articleList/index.js new file mode 100644 index 0000000..71a2032 --- /dev/null +++ b/pages/mall/article/articleList/index.js @@ -0,0 +1,92 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ +Page({ + + /** + * 页面的初始数据 + */ + data: { + articlesArr : [] , //列表 + page : {}, //分页信息 + type : '', //类型 + name : '', //名称 + lodingStats : false, //加载状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + console.log(options) + this.setData({ + type: options.type + }) + if (options.type == '1') { + wx.setNavigationBarTitle({ + title: '锶源昆仑·记忆' + }) + this.setData({ + name: 'memory' + }) + } else if (options.type == '2') { + wx.setNavigationBarTitle({ + title: '锶源昆仑·健康百科' + }) + this.setData({ + name: 'wiki' + }) + } + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取列表 + this.articlesInfo(); + }, + + // 列表 + articlesInfo(page){ + wx.$api.mall.articlesList({ + category_id : this.data.type, + page : page || 1 + }).then(res => { + let listArr = this.data.articlesArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.data) + this.setData({ + articlesArr : newData, + page : res.data.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + }).catch(err => {}) + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取列表 + this.articlesInfo(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取列表 + this.articlesInfo(pageNumber); + } + } +}) \ No newline at end of file diff --git a/pages/mall/article/articleList/index.json b/pages/mall/article/articleList/index.json new file mode 100644 index 0000000..3928faa --- /dev/null +++ b/pages/mall/article/articleList/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/mall/article/articleList/index.wxml b/pages/mall/article/articleList/index.wxml new file mode 100644 index 0000000..6ccd584 --- /dev/null +++ b/pages/mall/article/articleList/index.wxml @@ -0,0 +1,25 @@ + + + + {{item.categories[0].slug}} | {{item.title}} + {{item.description}} + + {{item.clicks}} + {{item.subscribes}} + + + + + + + 加载中... + + + 没有更多了~ + + + + + + 暂无数据 + \ No newline at end of file diff --git a/pages/mall/article/articleList/index.wxss b/pages/mall/article/articleList/index.wxss new file mode 100644 index 0000000..4d5cdc1 --- /dev/null +++ b/pages/mall/article/articleList/index.wxss @@ -0,0 +1,66 @@ +page { + padding: 30rpx; + box-sizing: border-box; + background-color: #f6f6f6; +} + +.item { + position: relative; + background-color: #ffffff; + border-radius: 10rpx; + height: 200rpx; + margin-bottom: 30rpx; +} + +.itemImg { + position: absolute; + right: 0; + top: 0; + width: 200rpx; + height: 200rpx; + border-radius: 10rpx; + overflow: hidden; +} + +.itemCont { + position: absolute; + left: 0; + top: 0; + padding: 25rpx 230rpx 0 30rpx; + box-sizing: border-box; + width: 100%; +} + +.itemCont-name { + font-size: 30rpx; +} + +.itemCont-name text { + text-transform: uppercase; +} + +.itemCont-text { + color: #999; + font-size: 26rpx; + margin: 15rpx 0 30rpx; + font-weight: 200; +} + +.itemCont-see { + color: #999; + display: flex; + font-size: 26rpx; + font-weight: 200; +} + +.itemCont-icon { + display: flex; + margin-right: 50rpx; + line-height: 26rpx; +} + +.itemCont-icon image { + width: 26rpx; + height: 26rpx; + margin-right: 10rpx; +} \ No newline at end of file diff --git a/pages/mall/buy/index.js b/pages/mall/buy/index.js new file mode 100644 index 0000000..dc99dd8 --- /dev/null +++ b/pages/mall/buy/index.js @@ -0,0 +1,102 @@ +/* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + avatar : '', //用户头像 + nickName : '', //用户昵称 + identity : '', //用户身份 + goodId : '', //商品id + surplus : '', //我的水滴 + mallData : '', //商品详情 + mallContent : '', //商品介绍 + userLogin : '', //登录状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + goodId: options.id + }) + + // 获取商品详情 + this.goodInfo(options.id); + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + if(wx.getStorageSync("token")){ + this.setData({ + userLogin: true + }) + // 获取用户信息 + this.userInfo(); + } + }, + + /** + * 用户信息 + */ + userInfo() { + wx.$api.user.userIndex().then(res => { + this.setData({ + avatar : res.data.avatar, + nickName : res.data.nickname, + identity : res.data.identity, + surplus : res.data.account.score.surplus + }) + }).catch(err => {}) + }, + + /** + * 商品详情 + */ + goodInfo(id) { + wx.$api.mall.goodsShow(id).then(res => { + this.setData({ + mallData : res.data, + mallContent : res.data.content.replace(/\ {}) + }, + + + /** + * 放大轮播相册图片 + */ + opneBanner(e){ + let imgs = [], + index = e.currentTarget.dataset.index + for (let img of e.currentTarget.dataset.imgs){ + imgs.push(img) + } + wx.previewImage({ + urls : imgs, + current : imgs[index] + }) + }, + + // 购买 + buyTap(e) { + if(wx.getStorageSync("token")){ + wx.navigateTo({ + url: '../submit/index?skuid=' + this.data.mallData.skus[0].sku_id + '&goodsid=' + this.data.mallData.goods_id + '&qty=' + 1, + }) + }else { + // 去登录 + wx.navigateTo({ + url: "/pages/login/index" + }) + } + } +}) \ No newline at end of file diff --git a/pages/mall/buy/index.json b/pages/mall/buy/index.json new file mode 100644 index 0000000..ca7bcdb --- /dev/null +++ b/pages/mall/buy/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "水滴商城" +} \ No newline at end of file diff --git a/pages/mall/buy/index.wxml b/pages/mall/buy/index.wxml new file mode 100644 index 0000000..5396af3 --- /dev/null +++ b/pages/mall/buy/index.wxml @@ -0,0 +1,69 @@ + + + + + + + {{mallData.name}} + + + + + + + + + + 产品详情 + + + + + + + + + 已经到底拉,在往上逛一逛吧 + + + \ No newline at end of file diff --git a/pages/mall/buy/index.wxss b/pages/mall/buy/index.wxss new file mode 100644 index 0000000..b6f7932 --- /dev/null +++ b/pages/mall/buy/index.wxss @@ -0,0 +1,232 @@ +page { + background-color: #f3f3f5; +} + +/* 产品轮播 */ + +.banner { + overflow: hidden; + position: relative; + padding-top: 100%; +} + +.swiperCont, +.swiperImg { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} + +/* 用户 */ +.user-cont { + width: 100%; + position: absolute; + bottom: 0; + left: 0; + z-index: 99; + padding: 20rpx 30rpx; + display: flex; + box-sizing: border-box; +} + +.user-head { + position: relative; + width: 90rpx; + height: 90rpx; + border-radius: 50%; + border: 6rpx solid #ffe0a8; + margin-top: 10rpx; +} + +.user-avatar { + position: absolute; + width: 100%; + height: 100%; + border-radius: 50%; +} + +.user-ancrown { + position: absolute; + width: 48rpx; + height: 48rpx; + right: 0; + top: -34rpx; +} + +.user-text { + height: 120rpx; + width: calc(100% - 120rpx); + padding-left: 20rpx; + box-sizing: border-box; +} + +.user-top { + display: flex; + line-height: 58rpx; +} + +.user-name { + color: #ffffff; + padding-right: 10rpx; +} + +.user-icon image { + width: 32rpx; + height: 32rpx; + margin: 12rpx 0 0 5rpx; +} + +.user-identity { + margin-top: 5rpx; + width: 120rpx; +} + +.water { + background-color: rgba(0, 0, 0, .3); + border-radius: 30rpx 30rpx 30rpx 0; + padding: 0 15rpx 0 10rpx; + height: 60rpx; + line-height: 60rpx; + display: flex; + position: absolute; + right: 30rpx; + top: 50rpx; + color: #ffffff; +} + +.water image { + width: 46rpx; + height: 46rpx; + margin: 6rpx 5rpx 0 0; +} + +/* 商品信息 */ +.goodsInfo { + background-color: #ffffff; + padding: 30rpx; + width: 100%; + box-sizing: border-box; + font-weight: 600; + font-size: 32rpx; +} + +.goodsInfo-name { + margin-bottom: 20rpx; +} + +.goodsInfo-info { + display: flex; + line-height: 44rpx; +} + +.goodsInfo-price { + font-size: 36rpx; + color: #df723a; + flex: 1; +} + +.goodsInfo-price-symbol { + font-size: 28rpx; + display: inline-block; + margin-left: 10rpx;} + +.goodsInfo-price-see { + font-weight: normal; + color: #959595; + font-size: 28rpx; +} + +/* 产品详情 */ +.detailsBrief { + padding: 30rpx 0; + box-sizing: border-box; + background-color: #ffffff; + margin-top: 20rpx; + border-bottom: 60px solid transparent; +} + +.detailsBrief-title { + position: relative; + font-size: 32rpx; + height: 70rpx; + margin-bottom: 10rpx; + font-weight: 600; + text-align: center; +} + +.goods-info-footer { + line-height: 40rpx; + text-align: center; + font-size: 24rpx; + color: #747788; + padding-top: 20rpx; +} + +.detailsBrief-text { + padding: 30rpx; + box-sizing: border-box; + line-height: 44rpx; +} + +.detailsBrief-back { + text-align: center; + padding: 0 30rpx; + box-sizing: border-box; +} + +.cardcase-like-online { + font-weight: normal; + font-size: 24rpx; + border: solid 2rpx #d8c283; + color: #c7a232; + border-radius: 4rpx; + display: inline-block; + height: 32rpx; + line-height: 32rpx; + padding: 0 10rpx; + margin: 2rpx 10rpx; +} + +/* 底部 */ +.footer { + width: 100%; + height: 60px; + background-color: #FFFFFF; + position: fixed; + left: 0; + bottom: 0; + z-index: 9; + padding: 8px 30rpx; + box-sizing: border-box; + display: flex; +} + +.number { + flex: 1; + line-height: 44px; + color: #6c78f8; +} + +.number text { + padding: 0 5rpx; + font-weight: 600; + font-size: 38rpx; +} + +.btn { + height: 36px; + line-height: 36px; + background-color: #6c78f8; + text-align: center; + color: #FFFFFF; + border-radius: 60rpx; + font-size: 28rpx; + padding: 0 30rpx; + margin-top: 8rpx; +} + +.detailsBrief-back{ + width: 100%; +} \ No newline at end of file diff --git a/pages/mall/details/index.js b/pages/mall/details/index.js new file mode 100644 index 0000000..c8f9c74 --- /dev/null +++ b/pages/mall/details/index.js @@ -0,0 +1,77 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + goodsData : '', //详情 + sign : '', //签收 + express : '', //物流 + orderNo : '' //订单号 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + orderNo: options.orderNo + }) + + // 订单详情 + this.goodsInfo(options.orderNo); + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() {}, + + // 获取订单详情 + goodsInfo(orderNo) { + wx.$api.user.goodsDet(orderNo).then(res => { + this.setData({ + goodsData : res.data, + sign : res.data.can.sign, + express : res.data.express + }) + }).catch(err => {}) + }, + + // 复制订单号 + copyUrl(val) { + wx.setClipboardData({ + data: val.currentTarget.dataset.no, + success: () => { + wx.showToast({ + title: "复制成功", + icon : "none" + }) + } + }) + }, + + // 订单签收 + signClick() { + wx.showModal({ + title : '提示', + content : '是否签收', + success : res=> { + if (res.confirm) { + wx.$api.user.goodsSign(this.data.orderNo).then(res => { + wx.showToast({ + title:'签收成功', + icon:'none' + }) + wx.navigateBack() + }).catch(err => {}) + } + } + }) + } +}) \ No newline at end of file diff --git a/pages/mall/details/index.json b/pages/mall/details/index.json new file mode 100644 index 0000000..7418a99 --- /dev/null +++ b/pages/mall/details/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "订单详情" +} \ No newline at end of file diff --git a/pages/mall/details/index.wxml b/pages/mall/details/index.wxml new file mode 100644 index 0000000..0b38456 --- /dev/null +++ b/pages/mall/details/index.wxml @@ -0,0 +1,80 @@ + + + + + + 订单编号 + + {{ goodsData.order_no }} + 复制 + + + + + + + {{ goodsData.express.name }} {{ goodsData.express.mobile }} + + {{ goodsData.express.full_address }} + + + + + + + + + + + {{ item.sku.goods_name }} + + {{ item.price }}x{{ item.qty }} + + + + + + + 订单信息 + + 交易时间 + {{ goodsData.created_at }} + + + 总水滴数 + {{ goodsData.amount }} + + + 运费金额 + {{ goodsData.freight == 0 ? '免邮' : goodsData.freight }} + + + 交易状态 + {{ goodsData.state }} + + + + 物流信息 + + 物流公司 + {{ express.express_name }} + + + 收货姓名 + {{ express.name }} + + + 收货电话 + {{ express.mobile }} + + + 物流单号 + {{ express.express_no }}复制 + + + + + + 返回订单 + 签收订单 + \ No newline at end of file diff --git a/pages/mall/details/index.wxss b/pages/mall/details/index.wxss new file mode 100644 index 0000000..65adaa4 --- /dev/null +++ b/pages/mall/details/index.wxss @@ -0,0 +1,202 @@ +page { + background: #f3f4f6; + padding: 30rpx; + box-sizing: border-box; +} + +.While { + border-radius: 10rpx; + margin-bottom: 30rpx; + background-color: #FFFFFF; + box-shadow: 0 0 10rpx rgba(0, 0, 0, .05); +} + +.orderData { + border-bottom: 70rpx transparent solid; + +} + +/* 订单 */ +.orderData-cont-label { + padding: 40rpx 30rpx; + display: flex; + box-sizing: border-box; + border-bottom: #f2f2f2 2rpx solid; +} + +.orderData-cont-img { + width: 48rpx; + height: 48rpx; + vertical-align: middle; +} + +.orderData-cont-text { + width: calc(100% - 68rpx); + margin-left: 20rpx; + box-sizing: border-box; +} + +.orderData-cont-name { + margin-bottom: 10rpx; +} + +.orderData-cont-name text { + color: #999; + padding-left: 20rpx; +} + +.orderData-cont-copy { + display: flex; + font-size: 28rpx; + color: #999; +} + +.orderData-cont-copy text { + flex: 1; + display: inline-block; + margin-right: 20rpx; +} + +.orderData-cont-copy view { + color: #eb504c; +} + +/* 产品 */ +.orderGoods { + padding: 30rpx; + box-sizing: border-box; +} + +.orderGoods-wares { + position: relative; +} + +.orderGoods-img { + width: 100rpx; + height: 100rpx; + border: 2rpx solid #dddddd; + border-radius: 10rpx; +} + +.orderGoods-cont { + position: absolute; + width: 100%; + left: 0; + padding-left: 130rpx; + box-sizing: border-box; + top: 0; +} + +.orderGoods-text { + margin: 20rpx 0 30rpx; + color: #666666; + font-size: 26rpx; +} + +.orderGoods-price { + display: flex; + color: #555555; + margin-top: 15rpx; +} + +.orderGoods-number { + flex: 1; + color: #000; + font-weight: 600; +} + +.orderGoods-price text { + color: #999; +} + +.reserve-red { + font-weight: 600; + color: #1d37e2; +} + +.orderGoods-brief { + display: flex; + padding-top: 30rpx; +} + +.orderGoods-brief view { + flex: 1; + color: #333333; +} + +.orderGoods-brief text { + font-weight: 600; +} + +/* 规格 */ +.reserveCont-title { + font-weight: 600; + padding: 30rpx; +} + +.reserve-label { + display: flex; + padding: 0 30rpx 30rpx; + box-sizing: border-box; + font-size: 28rpx; +} + +.reserve-name { + flex: 1; + width: 200rpx; + margin-right: 20rpx; + color: #7e7e7e; +} + +.reserve-text { + width: calc(100% - 240rpx); + text-align: right; + line-height: 50rpx; +} + +.reserve-text.reserve-price { + font-weight: 600; + color: #1d37e2; +} + +.reserve-copy { + color: #6774ff; + border: #6774ff 2rpx solid; + display: inline-block; + height: 34rpx; + line-height: 34rpx; + font-size: 26rpx; + padding: 0 10rpx; + border-radius: 4rpx; + margin-left: 10rpx; +} + +/* 底部菜单 */ +.order-data-footer { + position: fixed; + bottom: 0; + left: 0; + right: 0; + border-top: solid 1rpx #f2f2f2; + padding-top: 17rpx; + padding-right: 30rpx; + padding-left: 30rpx; + height: 83rpx; + background: white; + display: flex; + flex-wrap: wrap; + flex-direction: row-reverse; + z-index: 9; +} + +.order-btn { + margin-left: 20rpx; + height: 58rpx; + line-height: 58rpx; + box-sizing: border-box; + border: solid 1rpx #747788; + padding: 0 20rpx; + font-size: 26rpx; + border-radius: 10rpx; + margin-top: 5rpx; +} \ No newline at end of file diff --git a/pages/mall/exhibition/index.js b/pages/mall/exhibition/index.js new file mode 100644 index 0000000..c2d315e --- /dev/null +++ b/pages/mall/exhibition/index.js @@ -0,0 +1,71 @@ +// pages/mall/exhibition/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + detailsImg: '' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 商品详情数据 + wx.$api.index.goods(1).then(res => { + this.setData({ + detailsImg: res.data.content.replace(/\ {}) + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/mall/exhibition/index.json b/pages/mall/exhibition/index.json new file mode 100644 index 0000000..82aa3d0 --- /dev/null +++ b/pages/mall/exhibition/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "体验官活动" +} \ No newline at end of file diff --git a/pages/mall/exhibition/index.wxml b/pages/mall/exhibition/index.wxml new file mode 100644 index 0000000..1b2db9f --- /dev/null +++ b/pages/mall/exhibition/index.wxml @@ -0,0 +1,8 @@ + + + + + + 点击参与活动 + + \ No newline at end of file diff --git a/pages/mall/exhibition/index.wxss b/pages/mall/exhibition/index.wxss new file mode 100644 index 0000000..cd8da2e --- /dev/null +++ b/pages/mall/exhibition/index.wxss @@ -0,0 +1,23 @@ +/* 申请体验馆 */ +.exhibition-img { + width: 100%; +} + +.exhibition-btn { + position: fixed; + bottom: 0; + left: 0; + z-index: 99; + width: 100%; + text-align: center; + padding: 30rpx; + box-sizing: border-box; +} + +.exhibition-btn-go { + background-color: #e8c198; + color: #442b11; + border-radius: 50rpx; + height: 90rpx; + line-height: 90rpx; +} \ No newline at end of file diff --git a/pages/mall/index/index.js b/pages/mall/index/index.js new file mode 100644 index 0000000..8599325 --- /dev/null +++ b/pages/mall/index/index.js @@ -0,0 +1,246 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + BarHeight : '', + indicatorDots: false, + vertical : false, + autoplay : false, + interval : 2000, + duration : 500, + previousmargin: '40rpx',//前边距 + nextmargin : '40rpx',//后边距 + otherCurrent : 1, + goodsArr : [], //商品 + bannersArr : [], //轮播商品 + surplus : '', //水滴量 + healthsArr : [], //健康文章 + centerInfo : [], //体验官介绍 + serviceMobile: '', //客服电话 + categories : '', //详情分类 + userLogin : '', //是否登录 + videos : '', + videoFlx : false, //视频定位 + showGoods : '', //默认商品 + waterMobile : '', //电话 + memoryCurrent: 0, + videoState : true, //第一个视频是否加载 + videoFilex : true, //第二个视频是否加载 + + // 记忆 + startX : 0, + endX : 0, + iCenter : 3, + datas: [], + order: [] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + BarHeight: getApp().globalData.systInfo.statusBarHeight + wx.getMenuButtonBoundingClientRect().height + }) + this.__set__(); + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取首页数据 + this.indexInfo(); + + // 获取登录状态 + if(wx.getStorageSync("token")){ + this.setData({ + userLogin: true + }) + + // 获取用户信息 + this.userInfo(); + } + }, + + /** + * 首页数据 + */ + indexInfo (e) { + wx.$api.mall.index().then(res => { + this.setData({ + goodsArr : res.data.goods, + showGoods : res.data.show_goods, + bannersArr : res.data.banners, + videos : res.data.videos[0], + healthsArr : res.data.healths, + datas : res.data.memories, + centerInfo : res.data.center[0], + categories : res.data.categories, + waterMobile : res.data.water_mobile + }) + this.move(); + }).catch(err => {}) + }, + + /** + * 用户信息 + */ + userInfo() { + wx.$api.user.userIndex().then(res => { + this.setData({ + surplus : res.data.account.score.surplus, + serviceMobile : res.data.service.mobile, + }) + }).catch(err => {}) + }, + + /** + * 轮播图的切换事件 + */ + swiperOther (e) { + this.setData({ + otherCurrent: e.detail.current //获取当前轮播图片的下标 + }) + }, + + /** + * 跳转文章列表 + */ + tapMore(e){ + console.log(e) + wx.navigateTo({ + url: '../article/articleList/index?type=' + e.currentTarget.dataset.type + }) + }, + + /** + * 拨打电话 + */ + phoneCall(){ + wx.makePhoneCall({ + phoneNumber: this.data.waterMobile + }); + }, + + /** + * 处理未登录时的转跳 + */ + userNav(e){ + let pageUrl = e.currentTarget.dataset.url + if(wx.getStorageSync("token")){ + wx.navigateTo({ + url: pageUrl + }) + }else{ + // 去登录 + wx.navigateTo({ + url: "/pages/login/index" + }) + } + }, + + /** + * 监听页面滚动 + */ + bestScroll(e){ + if(e.detail.scrollTop >= this.data.systInfo.safeArea.width && !this.data.videoFlx){ + this.setData({ + videoFlx: true + }) + }else if(e.detail.scrollTop < this.data.systInfo.safeArea.width && this.data.videoFlx){ + this.setData({ + videoFlx: false + }) + } + }, + + move () { + var datas = this.data.datas; + /*图片分布*/ + for (var i = 0; i < datas.length; i++) { + var data = datas[i]; + var animation = wx.createAnimation({ + duration: 200 + }); + animation.translateX(data.left).step(); + this.setData({ + ["datas[" + i + "].animation"]: animation.export(), + ["datas[" + i + "].zIndex"]: data.zIndex + }) + } + }, + /**左箭头 */ + left: function () { + var last = this.data.datas.pop(); //获取数组的最后一个 + this.data.datas.unshift(last);//放到数组的第一个 + var orderFirst = this.data.order.shift(); + this.data.order.push(orderFirst); + this.move(); + }, + /** */ + right: function () { + var first = this.data.datas.shift(); //获取数组的第一个 + this.data.datas.push(first);//放到数组的最后一个位置 + var orderLast = this.data.order.pop(); + this.data.order.unshift(orderLast); + this.move(); + }, + /**新的排列复制到新的数组中 */ + __set__: function () { + var that = this; + var order = that.data.order; + var datas = that.data.datas; + for (var i = 0; i < datas.length; i++) { + that.setData({ + ["order[" + i + "]"]: datas[i].id + }) + } + }, + //手指触发开始移动 + moveStart (e) { + var startX = e.changedTouches[0].pageX; + this.setData({ + startX : startX + }); + + }, + //手指触摸后移动完成触发事件 + moveItem (e) { + var that = this; + var endX = e.changedTouches[0].pageX; + this.setData({ + endX: endX + }); + //计算手指触摸偏移剧距离 + var moveX = this.data.startX - this.data.endX; + //向左移动 + if (moveX > 20) { + this.left(); + } + if (moveX < -20) { + this.right(); + } + }, + + // 第一个播放进度变化时触发 + bindloadedOne() { + this.setData({ + videoState: false + }) + }, + + // 第二个播放进度变化时触发 + bindloadedTwo() { + this.setData({ + videoFilex: false + }) + }, +}) diff --git a/pages/mall/index/index.json b/pages/mall/index/index.json new file mode 100644 index 0000000..f0f1934 --- /dev/null +++ b/pages/mall/index/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "navigationStyle": "custom", + "navigationBarTextStyle": "white" +} \ No newline at end of file diff --git a/pages/mall/index/index.wxml b/pages/mall/index/index.wxml new file mode 100644 index 0000000..e28f4a4 --- /dev/null +++ b/pages/mall/index/index.wxml @@ -0,0 +1,198 @@ + + + + + + + + + + + 水滴 + + + {{surplus}} + + + + + + + + + + + + + + + + other + 其他商品 + + + + + + + + + + 古海冰泉造就不凡 + {{item.name}} + {{item.price.show}}水滴/箱 + + + + + + + + + + + + guide + 用水指南 + + + + + + temperature + 最佳水温饮用 + + + + 加热至40-50度 + + + + + + + quantity + 最佳饮水量 + + + 每日饮用4瓶~6瓶 + (2000mL-3000ml) + + + + + + time + 最佳饮水时间 + + + 早:7点-9点 + 午:12点-14点 + 晚:18点-21点 + + + + + + special + 注意事项 + + + 不建议冷冻保存 + 开瓶后24小时内饮用最佳 + + + + + + + + + + + + experience + 体验官介绍 + + + + + + + + 申请体验官 + + + + + + + + + + + + 锶源昆仑·订购热线 + Hi!需要订水,请联系我们~ + + + + + + + + + + memory + 锶源昆仑·记忆 + + + + + + + + + + + {{item.title}} + GO > + + {{item.description}} + + + + + + + + + + + + Health + 锶源昆仑·健康百科 + + + + + + + Health | {{item.title}} + {{item.description ? item.description : '源自万山之祖昆仑山脉,绵延华夏龙之 脉中川流的“圣血”'}} + + + + \ No newline at end of file diff --git a/pages/mall/index/index.wxss b/pages/mall/index/index.wxss new file mode 100644 index 0000000..25b601a --- /dev/null +++ b/pages/mall/index/index.wxss @@ -0,0 +1,559 @@ +page { + background-color: #f3f3f5; +} + +/* 轮播 */ +.page-section { + position: relative; + width: 100%; + height: 100vh; +} + +.videoCover { + position: absolute; + width: 100%; + height: 100vh; + z-index: 1; +} + +.page-swiper { + position: absolute; + width: 100%; + height: 100vh; +} + +.page-swiper image { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; +} + +/* 头部 */ +.drift { + position: fixed; + left: 0; + width: 100%; + padding: 30rpx 0; + box-sizing: border-box; + z-index: 99; + color: #ffffff; + display: flex; +} + +.drift .title { + flex: 1; + font-weight: 600; + position: relative; + padding-bottom: 20rpx; + padding-left: 30rpx; + font-size: 40rpx; + text-shadow: 0 6rpx 6rpx rgba(0, 0, 0, .6); +} + +.drift .title::after { + position: absolute; + content: ''; + left: 45rpx; + bottom: 0; + background-color: #df723a; + width: 40rpx; + height: 6rpx; + border-radius: 10rpx; +} + +.drift .balance { + font-size: 34rpx; + background-color: rgba(0, 0, 0, .3); + border-radius: 30rpx 0 0 30rpx; + padding: 0 20rpx; + height: 60rpx; + line-height: 60rpx; + display: flex; + box-shadow: 0 6rpx 6rpx rgba(0, 0, 0, .3); + text-shadow: 0 6rpx 6rpx rgba(0, 0, 0, .6); +} + +.drift .balance image { + width: 46rpx; + height: 46rpx; + margin: 6rpx 5rpx 0 0; +} + +/* 按钮 */ +.backView { + position: absolute; + bottom: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 98; + background-color: rgba(0, 0, 0, .05); +} + +.tips { + position: absolute; + bottom: 0; + left: 0; + width: 100%; + text-align: center; + z-index: 99; + padding: 40rpx 0 90rpx; + box-sizing: border-box; + background-image: linear-gradient(to bottom, transparent, #26252a); +} + +.tips .btn { + background-color: #ffffff; + display: inline-block; + border-radius: 80rpx; + padding: 0 50rpx; + line-height: 74rpx; + margin: 0 15rpx; + border: 2rpx solid transparent; + font-size: 30rpx; +} + +.tips .btn.number { + background-color: rgba(0, 0, 0, .2); + border-color: #fff; + color: #fff; +} + +.tips .btn.number image { + width: 48rpx; + height: 48rpx; + vertical-align: -12rpx; + margin-right: 5rpx; +} + +.indexTop { + position: absolute; + bottom: 15rpx; + left: calc(50% - 27rpx); + width: 54rpx; + height: 54rpx; + z-index: 99; + opacity: .5; +} + +/* 内容 */ +.other { + padding: 0 30rpx 30rpx; + box-sizing: border-box; +} + +.content { + background-color: #ffffff; + border-radius: 10rpx; + padding: 30rpx 30rpx 10rpx; + box-sizing: border-box; +} + +.publicTitle { + margin-bottom: 30rpx; + position: relative; +} + +.publicTitle text { + display: block; + text-transform: uppercase; + font-size: 42rpx; + margin-bottom: 5rpx; +} + +.publicTitle .lighter { + display: flex; + font-weight: 200; +} + +.publicTitle .lighter .article-more { + width: 32rpx; + height: 32rpx; + margin-left: 15rpx; + margin-top: 4rpx; +} + +.goldenLogo { + position: absolute; + right: 0; + top: 10rpx; + width: 130rpx; +} + +.other-swiper swiper { + background: #fff; + height: 450rpx; +} + +.other-swiper .slide-image image { + position: absolute; + width: 100%; + height: calc(100% - 40rpx); + left: 0; + top: 0; + margin-top: 20rpx; + border-radius: 12rpx; + transition: .2s; + display: block; +} + +/*图片的容器*/ +.slide-image { + padding: 0 10rpx; + box-sizing: border-box; +} + +.other-swiper .box { + display: inline-block; + width: 100%; + padding-top: 50%; + position: relative; +} + +.other-swiper .slide-image image.active { + height: 100% !important; + margin: 0; +} + +.other-swiper .othertitle { + width: 100%; + text-align: center; + margin-bottom: 10rpx; +} + +.other-swiper .otherText { + font-weight: 200; + width: 100%; + font-size: 26rpx; + text-align: center; + line-height: 68rpx; + color: #999999; + position: relative; +} + +.other-swiper .otherText::after, +.other-swiper .otherText::before { + position: absolute; + content: ''; + width: 90rpx; + top: calc(50% - 1rpx); + background-color: #bdbdbd; + height: 2rpx; +} + +.other-swiper .otherText::after { + left: 40rpx; +} + +.other-swiper .otherText::before { + right: 40rpx; +} + +.other-swiper .name { + width: 100%; + text-align: center; + color: #d5a56d; + font-size: 25rpx; + font-weight: normal; +} + +/* 视频 */ +.videos { + padding: 30rpx; +} + +.videos-filex-view { + position: relative; + width: 100%; + padding-top: 50%; + border-radius: 20rpx; + overflow: hidden; +} + +.videos-cover { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 2; +} + +.videos video { + position: absolute; + border-radius: 20rpx; + overflow: hidden; + top: 0; + left: 0; + width: 100%; + height: 100%; +} + +.videos-filex-view.filex { + position: fixed; + top: 0; + left: 0; + z-index: 99; +} + +/* 用水指南 */ +.guide { + overflow: hidden; + margin: 0 -10rpx; +} + +.guide-label { + width: calc(50% - 20rpx); + margin: 0 10rpx 20rpx; + float: left; + background-image: linear-gradient(#f6f6f7, #f5f6fe); + border-radius: 15rpx; + padding: 10rpx 20rpx; + box-sizing: border-box; + position: relative; +} + +.guide-top { + position: relative; + margin-bottom: 30rpx; +} + +.guide-english { + text-transform: uppercase; + color: #dfdedf; + font-size: 34rpx; +} + +.guide-name { + font-size: 32rpx; + position: absolute; + top: 18rpx; + left: 0; + z-index: 9; +} + +.guide-text { + vertical-align: middle; + height: 90rpx; + display: table; + line-height: 28rpx; +} + +.guide-cell { + display: table-cell; + vertical-align: middle; +} + +.guide-text text { + display: block; + font-size: 22rpx; + color: #333333; + font-weight: 200; +} + +.guide-icon { + position: absolute; + width: 60rpx; + height: 60rpx; + right: 20rpx; + bottom: 20rpx; +} + +/* 申请体验官 */ +.brief-img { + border-radius: 10rpx; + overflow: hidden; + position: relative; + padding-top: 50%; +} + +.brief-img image { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; +} + +.brief-btn { + background-color: #6c78f8; + color: #fff; + border-radius: 40rpx; + text-align: center; + line-height: 84rpx; + margin: 30rpx 0 20rpx; + font-size: 28rpx; +} + +/* 订购热线 */ +.hotline .content { + padding: 30rpx; +} + +.hotline-cont { + display: flex; +} + +.hotline-head { + width: 90rpx; + height: 90rpx; +} + +.hotline-text { + width: calc(100% - 184rpx); + margin: 0 20rpx; +} + +.hotline-name { + margin-bottom: 15rpx; + line-height: 44rpx; +} + +.hotline-tips { + color: #999999; + font-size: 24rpx; + font-weight: 200; +} + +.hotline-tel { + width: 54rpx; + height: 54rpx; + margin-top: 20rpx; +} + +/* 文章列表 */ +.article { + padding: 0 30rpx 30rpx; + box-sizing: border-box; +} + +/* 健康百科 */ +.wiki { + margin-top: 60rpx; +} + +.wiki-label { + background-color: #fff; + margin-bottom: 60rpx; + position: relative; + height: 150rpx; + border-radius: 10rpx; +} + +.wiki-label:last-child { + margin-bottom: 0; +} + +.wiki-label-img { + width: 160rpx; + height: 160rpx; + position: absolute; + top: -30rpx; + left: 20rpx; + border-radius: 10rpx 10rpx 0 0; +} + +.wiki-label-cont { + position: absolute; + left: 0; + top: 0; + width: 100%; + padding: 20rpx 25rpx 20rpx 200rpx; + box-sizing: border-box; +} + +.wiki-label-name { + font-size: 30rpx; +} + +.wiki-label-name text { + text-transform: uppercase; +} + +.wiki-label-text { + color: #999999; + font-size: 25rpx; + margin-top: 10rpx; + line-height: 30rpx; + font-weight: 200; +} + +/* 记忆 */ +.memory { + width: 100%; + background-size: cover; + position: relative; + overflow: hidden; +} + +.teachers_b { + position: relative; +} + +#slide { + margin: 0 auto; + width: 100%; + height: 530rpx; + position: relative; +} + +.memoryLable { + background-color: #fff; + position: absolute; + width: 580rpx; + border-radius: 10rpx; + overflow: hidden; +} + +.memory-img { + width: 580rpx; + height: 387rpx; + border-radius: 10rpx; + overflow: hidden; +} + +.memory-cont { + padding: 20rpx 20rpx 30rpx; + box-sizing: border-box; +} + +.memory-title { + display: flex; +} + +.memory-name { + font-size: 30rpx; + flex: 1; + line-height: 40rpx; + margin-right: 20rpx; +} + +.memory-go { + background-color: #f8f8f8; + font-size: 26rpx; + color: #d5a56d; + padding: 0 10rpx; + line-height: 40rpx; + border-radius: 10rpx; +} + +.memory-text { + font-size: 26rpx; + color: #999; + margin-top: 10rpx; + font-weight: 200; +} + +.slide_right { + padding: 40px; + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + min-width: 0; +} + +.slide_right dl { + padding-top: 10px; +} \ No newline at end of file diff --git a/pages/mall/mallOrder/index.js b/pages/mall/mallOrder/index.js new file mode 100644 index 0000000..f193019 --- /dev/null +++ b/pages/mall/mallOrder/index.js @@ -0,0 +1,92 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + listType : 'paid', //paid待发货,delivered已发货,signed已签收 + orderArr : [], //订单列表 + page : {}, //下一页 + lodingStats : false,//加载状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + listType: options.listType + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取订单列表 + this.ordersInfo(); + }, + + /** + * 订单列表 + */ + ordersInfo(page) { + wx.$api.user.orders({ + state: this.data.listType, + type : 'score', + page : page + }).then(res => { + let listArr = this.data.orderArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.data) + this.setData({ + orderArr : newData, + page : res.data.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + }).catch(err => {}) + }, + + /** + * 状态筛选 + */ + onTabs(val){ + if(this.data.listType === val) return + this.setData({ + listType: val.currentTarget.dataset.type + }) + + // 商品详情数据 + this.ordersInfo(); + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取订单列表 + this.ordersInfo(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取订单列表 + this.ordersInfo(pageNumber); + } + } +}) \ No newline at end of file diff --git a/pages/mall/mallOrder/index.json b/pages/mall/mallOrder/index.json new file mode 100644 index 0000000..8e7c7a8 --- /dev/null +++ b/pages/mall/mallOrder/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "水滴订单" +} \ No newline at end of file diff --git a/pages/mall/mallOrder/index.wxml b/pages/mall/mallOrder/index.wxml new file mode 100644 index 0000000..8effcc8 --- /dev/null +++ b/pages/mall/mallOrder/index.wxml @@ -0,0 +1,54 @@ + + + 待发货 + 已发货 + 已签收 + + + + + + + {{ item.order_no }} + {{ item.state }} + + + + + + + + {{ goodItem.sku.goods_name }} + + + {{ goodItem.sku.price }}水滴 + + + + x{{ goodItem.qty }} + + + + + 下单时间:{{ item.created_at }} + + + 总水滴数:{{ item.amount }} + + + 订单详情 + + + + + 加载中... + + + 没有更多了~ + + + + + + 暂无数据 + \ No newline at end of file diff --git a/pages/mall/mallOrder/index.wxss b/pages/mall/mallOrder/index.wxss new file mode 100644 index 0000000..fd21925 --- /dev/null +++ b/pages/mall/mallOrder/index.wxss @@ -0,0 +1,164 @@ +page { + overflow: hidden; + background: #f3f4f6; + padding: 30rpx; + box-sizing: border-box; +} + +.While { + border-radius: 10rpx; + margin-bottom: 30rpx; + background-color: #FFFFFF; + padding: 0 30rpx; + box-sizing: border-box; + box-shadow: 0 0 10rpx rgba(0, 0, 0, .05); +} + +.order { + margin-top: 90rpx; +} + +.order-top { + line-height: 90rpx; + box-sizing: border-box; + display: flex; + font-size: 28rpx; + border-bottom: 2rpx #f2f2f2 solid; +} + +.order-top-number { + flex: 1; +} + +.order-top-tips { + font-size: 26rpx; + color: #eb504c; +} + +.order-name { + padding: 20rpx 0; + box-sizing: border-box; + position: relative; +} + +.order-img { + width: 90rpx; + height: 90rpx; + margin-right: 20rpx; + border-radius: 10rpx; +} + +.order-goods { + position: absolute; + width: 100%; + left: 0; + top: 0; + padding: 20rpx 20rpx 20rpx 110rpx; + box-sizing: border-box; +} + +.order-label { + display: flex; + font-size: 30rpx; + margin-bottom: 15rpx; +} + +.order-label-name { + flex: 1; + margin-right: 30rpx; +} + +.order-label-price { + font-weight: 600; +} + +.order-label-price text { + font-size: 24rpx; + padding-left: 10rpx; +} + + +.order-specs { + font-size: 24rpx; + color: #919191; + display: flex; +} + +.order-specs text { + display: inline-block; + flex: 1; +} + +.order-text { + font-size: 28rpx; + line-height: 40rpx; + display: flex; + padding-bottom: 20rpx; + border-top: 2rpx solid #f2f2f2; + border-bottom: 2rpx solid #f2f2f2; + padding-top: 20rpx; +} + +.order-time { + color: #919191; + font-size: 26rpx; + flex: 1; +} + +.order-price text, +.order-time text { + font-weight: 600; + color: #1d37e2; +} + +.order-btn { + text-align: right; + padding: 30rpx 0; + box-sizing: border-box; + position: relative; +} + +.order-btn-atn { + border: 2rpx solid #f2f2f2; + border-radius: 40rpx; + padding: 0 30rpx; + height: 52rpx; + line-height: 52rpx; + color: #767676; + display: inline-block; + margin-left: 15rpx; + font-size: 24rpx; +} + +.order-btn-atn.active { + color: #1d37e2; + border-color: #bfc5ff; +} + +/* tabs */ +.header { + position: fixed; + top: 0; + left: 0; + right: 0; + z-index: 99; +} + +.tabs { + display: flex; + justify-content: space-around; + background: white; + padding: 15rpx 0; + font-size: 30rpx; + color: #9d9d9d; +} + +.item { + height: 60rpx; + line-height: 60rpx; +} + +.item.show { + color: #1d37e2; + border-bottom: solid 4rpx #1d37e2; +} \ No newline at end of file diff --git a/pages/mall/submit/index.js b/pages/mall/submit/index.js new file mode 100644 index 0000000..04a8cb6 --- /dev/null +++ b/pages/mall/submit/index.js @@ -0,0 +1,163 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + goodId : '', //店铺id + skuId : '', //产品id + num : 1, //数量默认1 + address : '', //地址 + addressId : '', //地址id + stockData : '', //数据 + amount : '', //总金额 + freight : '', //运费 + weight : '', //重量 + remark : '', //备注 + exchangeSee : false, //是否兑换 + disabled : false + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + goodId: options.goodsid, + skuId : options.skuid, + num : options.qty + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取订单前置 + this.orderShow() + }, + + /** + * 订单前置 + */ + orderShow() { + wx.$api.mall.foundOrder({ + goods_sku_id: this.data.skuId, + address_id : this.data.addressId, + qty : this.data.num + }).then(res => { + this.setData({ + address : res.data.address, + addressId : res.data.address.address_id, + stockData : res.data.detail, + amount : res.data.amount, + freight : res.data.freight, + weight : res.data.weight + }) + }).catch(err => {}) + }, + + /** + * 商品数量加减 + */ + goodsNumber(e){ + let num = this.data.num, + val = e.currentTarget.dataset.type + if (val == 'plus'){ + num ++; + }else{ + if (num > 1){ + num --; + }else{ + wx.showToast({ + title : '商品数量不能小于1', + icon : 'none' + }) + } + this.setData({ + num: num + }) + } + this.setData({ + num: num + }) + + // 获取订单前置 + this.orderShow() + }, + + /** + * 输入商品数量 + */ + goodsNumberInput(e) { + let goodsNum = e.detail.value; + if (goodsNum > 0) { + this.setData({ + num: goodsNum + }) + } else { + wx.showToast({ + title: '商品数量不能小于1', + icon: 'none' + }); + this.setData({ + num: 1 + }) + } + + }, + + /** + * 是否确认兑换 + */ + exchangeShow() { + this.setData({ + exchangeSee: !this.data.exchangeSee + }) + }, + + /** + * 关闭兑换弹出 + */ + goodsCancel() { + this.setData({ + exchangeSee: false + }) + }, + + /** + * 确认订单 + */ + goodsForm(e) { + let newQty = this.data.num + let data = { + goods_sku_id: this.data.skuId, + remark : this.data.remark, + qty : newQty, + address_id : this.data.address.address_id + } + wx.$api.mall.affirmOrder(data).then(res => { + wx.$api.mall.affirmPay(res.data.order_no).then(res => { + this.setData({ + exchangeSee: false, + disabled : true + }) + wx.showToast({ + title: '兑换成功', + icon : 'success' + }) + setTimeout(()=>{ + wx.redirectTo({ + url: '/pages/order/list/index?listType=paid' + }) + },3000) + }).catch(err => {}) + + }).catch(err => {}) + } +}) \ No newline at end of file diff --git a/pages/mall/submit/index.json b/pages/mall/submit/index.json new file mode 100644 index 0000000..db7dae0 --- /dev/null +++ b/pages/mall/submit/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "确认订单" +} \ No newline at end of file diff --git a/pages/mall/submit/index.wxml b/pages/mall/submit/index.wxml new file mode 100644 index 0000000..a59718e --- /dev/null +++ b/pages/mall/submit/index.wxml @@ -0,0 +1,75 @@ + + + + + {{address.province.name}}{{address.city.name}} + {{address.full_address}} + + + {{address.name}}{{address.mobile}} + + + + + 新增收货地址 + + + + + + + + + + + {{items.title}} + 24瓶/箱 + {{items.price}}水滴 + + + + + + + + 购买数量 + + - + + + + + + + 快递 + 免邮 + + + 重量 + {{weight}} + + + 水滴兑换 + {{amount}}水滴 + + + + + + {{amount}}水滴 + + + + + + + + 确认兑换产品吗? + + + + 需要{{amount}}个水滴 + + + 取消 + 确定 + + diff --git a/pages/mall/submit/index.wxss b/pages/mall/submit/index.wxss new file mode 100644 index 0000000..3b6249a --- /dev/null +++ b/pages/mall/submit/index.wxss @@ -0,0 +1,286 @@ +page { + background-color: #f5f6f8; + padding: 30rpx; + box-sizing: border-box; +} + +/* 地址 */ +.address { + background-color: #FFFFFF; + border-radius: 20rpx; + overflow: hidden; + position: relative; +} + +.address-arrow { + position: absolute; + right: 30rpx; + top: 80rpx; + width: 38rpx; + height: 38rpx; +} + +.address-cont { + padding: 30rpx 30rpx 0; + box-sizing: border-box; +} + +.address-area { + color: #585866; + font-size: 28rpx; +} + +.address-text { + font-weight: 600; + padding: 10px 0; +} + +.address-name text { + color: #585866; + padding-left: 30rpx; +} + +.address-img { + width: 100%; +} + +.address-add { + width: 100%; + text-align: center; + padding: 30rpx 30rpx 0; + box-sizing: border-box; +} + +.address-go { + display: inline-block; + font-size: 28rpx; + line-height: 68rpx; + border-radius: 10rpx; + color: #df723a; +} + +/* 商品 */ +.good { + background-color: #FFFFFF; + border-radius: 20rpx; + overflow: hidden; + margin: 30rpx 0; + position: relative; + padding: 30rpx; +} + +.good-img { + width: 160rpx; + height: 160rpx; +} + +.good-cont { + position: absolute; + left: 0; + top: 0; + width: 100%; + padding: 30rpx 30rpx 0 220rpx; + box-sizing: border-box; +} + +.good-name { + font-size: 30rpx; +} + +.good-price { + color: #df723a; +} + +.good-price text { + font-size: 26rpx; + padding-left: 10rpx; +} + +.label-integral { + color: #6c78f8; + font-weight: 600; +} + +.good-tips { + margin: 10rpx 0 25rpx; + color: #585866; + font-size: 28rpx; +} + +/* 规格 */ +.label { + background-color: #FFFFFF; + border-radius: 20rpx; + overflow: hidden; + box-sizing: border-box; +} + +.label-item { + display: flex; + line-height: 100rpx; + color: #585866; + font-size: 30rpx; + padding: 0 30rpx; + box-sizing: border-box; + border-bottom: 2rpx solid rgb(243, 243, 243); +} + +.label-item:last-child { + border: none; +} + +.label-name { + flex: 1; +} + +.label-price { + text-align: right; + line-height: 90rpx; + font-size: 30rpx; + font-weight: 600; + padding: 0 30rpx 5rpx; + box-sizing: border-box; +} + +.label-price text { + font-size: 34rpx; + padding: 0 10rpx; +} + +.label-number { + display: flex; + margin-top: 25rpx; +} + +.number-btn { + background-color: #f1f1f1; + width: 48rpx; + height: 48rpx; + line-height: 46rpx; + text-align: center; +} + +.number-input { + width: 80rpx; + text-align: center; +} + +/* 底部 */ +.footer { + width: 100%; + height: 60px; + background-color: #FFFFFF; + position: fixed; + left: 0; + bottom: 0; + z-index: 9; + padding: 8px 30rpx; + box-sizing: border-box; + display: flex; +} + +.number { + flex: 1; + line-height: 44px; + color: #6c78f8; +} + +.number text { + padding: 0 5rpx; + font-weight: 600; + font-size: 38rpx; +} + +.btn { + height: 36px; + line-height: 36px; + background-color: #6c78f8; + text-align: center; + color: #FFFFFF; + border-radius: 60rpx; + font-size: 28rpx; + padding: 0 30rpx !important; + width: auto !important; + margin-top: 8rpx; +} + +/* 兑换弹出 */ +.exchangePop { + position: fixed; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, .5); + left: 0; + top: 0; + display: none; + z-index: 9; +} + +.exchangePop.active { + display: block; +} + +.exchangeCont { + left: 10%; + top: 50%; + width: 80%; + margin-top: -200rpx; + position: fixed; + z-index: 100; + background-color: #FFFFFF; + border-radius: 20rpx; + overflow: hidden; + text-align: center; + padding: 40rpx; + display: none; + box-sizing: border-box; +} + +.exchangeCont.active { + display: block; +} + +.exchange-title { + text-align: center; + color: #2b2b2b; + font-weight: 600; + font-size: 34rpx; +} + +.exchange-number { + font-size: 28rpx; + margin: 30rpx 0; +} + +.exchange-number text { + color: #f31d23; + font-weight: 600; + padding: 0 5rpx; +} + +.exchange-img { + display: block; + width: 80rpx; + height: 80rpx; + margin: 10rpx auto; +} + +.exchange-btn { + display: flex; +} + +.exchange-item { + line-height: 78rpx; + flex: 2; + text-align: center; + margin: 0 15rpx; + border: 2rpx solid #000; + border-radius: 50rpx; + background-color: #FFFFFF; +} + +.exchange-item:last-child { + background-color: #f31d23; + color: #FFFFFF; + border-color: #f31d23; +} \ No newline at end of file diff --git a/pages/member/index/index.js b/pages/member/index/index.js new file mode 100644 index 0000000..3955b52 --- /dev/null +++ b/pages/member/index/index.js @@ -0,0 +1,82 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + identities : '', //身份信息 + userData : '', //用户信息 + tabType : 'season', //会员标签 + can : '', //操作按钮 + buttonText : '', //按钮名字 + notRules : '', //权益 + couponPrice : '' ,//抵值券 + newId : '' //会员id + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取用户信息 + this.userInfo(); + + // 获取身份前置 + this.identityInfo(); + }, + + /** + * 用户信息 + */ + userInfo() { + wx.$api.user.userIndex().then(res => { + this.setData({ + userData: res.data + }) + }).catch(err => {}) + }, + + /** + * 身份前置 + */ + identityInfo(){ + // 3为季卡,4为年卡 + let identityId = '' + if(this.data.tabType == 'season') { + identityId = 3 + } else { + identityId = 4 + } + wx.$api.member.identitySee(identityId).then(res => { + this.setData({ + identities : res.data, + couponPrice : res.data.coupon_price, + notRules : res.data.not_rules, + can : res.data.can, + buttonText : res.data.buttonText, + newId : res.data.identity_id + }) + }).catch(err => {}) + }, + + /** + * 切换身份 + */ + typeClick(e) { + this.setData({ + tabType: e.currentTarget.dataset.type + }) + // 获取身份前置 + this.identityInfo(); + } +}) \ No newline at end of file diff --git a/pages/member/index/index.json b/pages/member/index/index.json new file mode 100644 index 0000000..bb98f7a --- /dev/null +++ b/pages/member/index/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "会员权益" +} \ No newline at end of file diff --git a/pages/member/index/index.wxml b/pages/member/index/index.wxml new file mode 100644 index 0000000..df8b817 --- /dev/null +++ b/pages/member/index/index.wxml @@ -0,0 +1,40 @@ + + + 季卡会员 + 年卡会员 + + + + + + + + + + + + + + + 点击开通会员 + + + 立即续费 + + + {{buttonText}} + + + + + + + 您有一张抵值券可抵(¥8640元) + + + + + 开通年度会员享受5.25折 + + + \ No newline at end of file diff --git a/pages/member/index/index.wxss b/pages/member/index/index.wxss new file mode 100644 index 0000000..eb81582 --- /dev/null +++ b/pages/member/index/index.wxss @@ -0,0 +1,127 @@ +.tab { + position: fixed; + left: 0; + top: 0; + z-index: 99; + width: 100%; + display: flex; + padding: 0 30rpx; + box-sizing: border-box; + height: 90rpx; + background-color: #2b0a58; + font-weight: 600; + border-bottom: 2rpx solid #402663; +} + +.tab.active { + background-color: #a92021; + border-bottom: 2rpx solid #bd3335; +} + +.tab-item { + height: 90rpx; + flex: 2; + text-align: center; + line-height: 90rpx; + color: #efb480; + position: relative; +} + +.tab-item::after { + position: absolute; + content: ''; + left: calc(50% - 40rpx); + bottom: 0; + width: 80rpx; + height: 6rpx; + background-color: #efb480; + border-radius: 30rpx; + display: none; +} + +.tab-item.active::after { + display: block; +} + +.member-back { + position: fixed; + left: 0; + top: 0; + width: 100vw; + height: 100vh; + text-align: center; +} + +.rights { + position: relative; + width: 100%; +} + +.member-cont { + padding: 140rpx 30rpx 30rpx; + box-sizing: border-box; + text-align: center; + width: 100%; + position: absolute; + top: 0; + left: 0; + height: calc(70vh + 120rpx); +} + +.member-title { + width: 100%; + margin: 0 auto; +} + +.member-error { + width: 40%; + margin-top: -30rpx; +} + +.member-btn { + position: absolute; + z-index: 1; + top: calc(30vh + 80rpx); + left: 0; + width: 100%; + text-align: center; +} + +.member-btn-img { + width: 100%; +} + +.member-btn-text { + position: absolute; + width: 100%; + z-index: 200; + color: #fff; + bottom: 42rpx; + color: #a21a1e; + left: 0; + font-size: 38rpx; +} + +.member-btn-text.active { + color: #000; +} + +.member-btn-tips { + position: absolute; + text-align: center; + width: 100%; + z-index: 2; + color: #fff; + color: #f1c39a; + font-size: 26rpx; + bottom: -40rpx; + line-height: 34rpx; +} + +.member-btn-tips image { + width: 30rpx; + height: 30rpx; + vertical-align: -4rpx; + display: inline-block; + margin-right: 10rpx; +} \ No newline at end of file diff --git a/pages/member/look/index.js b/pages/member/look/index.js new file mode 100644 index 0000000..52b1a35 --- /dev/null +++ b/pages/member/look/index.js @@ -0,0 +1,53 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + orderId: '', //身份id + rights : [], //权益 + rules : [], + newId: '', + identities: '', + identityId: '', + can: '' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + // 获取身份前置 + this.identityInfo(options.orderid); + this.setData({ + orderId: options.orderid + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() {}, + + /** + * 身份前置 + */ + identityInfo(orderId){ + wx.$api.member.identitySee(orderId).then(res => { + this.setData({ + identities : res.data, + rules : res.data.rules, + couponPrice : res.data.coupon_price, + rights : res.data.rights, + newId : res.data.identity_id, + can : res.data.can, + buttonText : res.data.buttonText + }) + }).catch(err => {}) + } +}) \ No newline at end of file diff --git a/pages/member/look/index.json b/pages/member/look/index.json new file mode 100644 index 0000000..bb98f7a --- /dev/null +++ b/pages/member/look/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "会员权益" +} \ No newline at end of file diff --git a/pages/member/look/index.wxml b/pages/member/look/index.wxml new file mode 100644 index 0000000..b21c800 --- /dev/null +++ b/pages/member/look/index.wxml @@ -0,0 +1,58 @@ + + 创始会员 + 合伙人 + + + + + + + {{identities.name}} + + + + {{identities.times.serial}} + + + + 到期时间: + + + {{identities.times.ended_at}} + + + + + + + + + + + + {{item.value}} + + + {{item.text}} + + + 现金 + + + + + + + {{orderId == 5 ? '创始会员' : '合伙人'}}权益说明 + + + + {{index + 1}} + + {{item.remark}} + + + + + + \ No newline at end of file diff --git a/pages/member/look/index.wxss b/pages/member/look/index.wxss new file mode 100644 index 0000000..97ec911 --- /dev/null +++ b/pages/member/look/index.wxss @@ -0,0 +1,220 @@ +page { + background-image: linear-gradient(to bottom, #383041, #1a1528); +} + +.tab { + position: fixed; + width: 100%; + left: 0; + top: 0; + z-index: 100; + height: 100rpx; + line-height: 100rpx; + background-color: #383041; + display: flex; +} + +.tab-item { + text-align: center; + flex: 2; + color: #c3c1c5; + font-size: 34rpx; + position: relative; + font-weight: 600; +} + +.tab-item::after { + position: absolute; + content: ''; + left: calc(50% - 40rpx); + bottom: 0; + background-color: transparent; + width: 80rpx; + height: 6rpx; + border-radius: 50rpx; +} + +.tab-item.active { + color: #ffffff; +} + +.tab-item.active::after { + background-color: #ffffff; +} + +.rights { + position: absolute; + width: 100%; + top: 120rpx; + background-image: linear-gradient(to bottom, #383041, #1a1528); +} + +.card { + position: relative; + height: 380rpx; +} + +.cardBack { + position: absolute; + width: 100%; + left: 0; + top: 0; +} + +.cardText { + position: absolute; + width: 100%; + left: 0; + top: 0; + z-index: 3; + padding: 50rpx 60rpx; + box-sizing: border-box; +} + +.card-title { + font-weight: 600; + font-size: 44rpx; + color: #4c2616; + display: flex; +} + +.card-title image { + width: 46rpx; + height: 46rpx; + margin: 6rpx 10rpx 0 0; +} + +.tips { + color: #653925; + margin: 10rpx 0 30rpx; + font-size: 30rpx; +} + +.price { + font-size: 30rpx; + color: #653925; + display: flex; + margin-top: 140rpx; +} + +.price-left { + text-align: right; + display: flex; +} + +.price-serial { + font-weight: 600; + font-size: 36rpx; + flex: 1; +} + +.list { + display: flex; + padding: 30rpx 20rpx; + box-sizing: border-box; + white-space: nowrap; + flex-direction: row; + align-items: center; + justify-content: space-around; +} + +.list-item { + width: 25%; + display: inline-block; + position: relative; + text-align: center; +} + +.list-tips { + position: absolute; + top: 0; + left: 60%; + font-size: 24rpx; + background: #f1bd6e; + color: #681e0f; + border-radius: 30rpx; + padding: 0 10rpx; + line-height: 30rpx; + height: 30rpx; +} + +.list-tips.active { + background: #f2c2a3; +} + +.list-img { + width: 100rpx; + height: 100rpx; + margin: 0 auto; + background-color: rgba(255, 255, 255, .1); + border-radius: 50%; + padding: 20rpx; + box-sizing: border-box; +} + +.list-img image { + width: 100%; + height: 100%; +} + +.list-rights { + color: #ffffff; + margin: 20rpx 0 10rpx; + font-size: 28rpx; +} + +.list-name { + color: #8d8a93; + font-size: 26rpx; +} + +.suggest { + padding: 20rpx 40rpx; + box-sizing: border-box; +} + +.suggest-cont { + border: 2rpx solid #d2bfa9; + border-radius: 40rpx; + padding: 30rpx 40rpx; + box-sizing: border-box; +} + +.suggest-title { + color: #e8bb9f; + font-size: 36rpx; + margin-bottom: 30rpx; +} + +.suggest-item { + color: #b3a3a3; + font-size: 30rpx; +} + +.suggest-label { + display: flex; + margin-bottom: 30rpx; +} + +.suggest-label:last-child { + margin-bottom: 0; +} + +.suggest-label text { + width: 38rpx; + height: 38rpx; + border-radius: 50%; + border: 2rpx solid #b3a3a3; + text-align: center; + font-size: 26rpx; + display: inline-block; + margin-top: 5rpx; +} + +.suggest-text { + width: calc(100% - 50rpx); + padding-left: 20rpx; + line-height: 40rpx; + box-sizing: border-box; + text-align: justify; +} \ No newline at end of file diff --git a/pages/member/open/index.js b/pages/member/open/index.js new file mode 100644 index 0000000..5f4c2e7 --- /dev/null +++ b/pages/member/open/index.js @@ -0,0 +1,84 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + service : '', + username: '', //用户手机号 + price : '', //打款金额 + name : '', + card_no : '', + //打款凭证 + showpath: '', + path : '', + disabled : false ,// 提交按钮状态 + identityId: '' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + identityId: options.identity_id + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + wx.$api.user.userIndex().then(res => { + this.setData({ + username: res.data.username + }) + }).catch(err => {}) + + wx.$api.user.identitiesee(this.data.identityId).then(res => { + this.setData({ + service: res.data.identity.service, + price : res.data.identity.price + }) + }).catch(err => {}) + }, + + // 上传图片 + openImg(){ + wx.chooseMedia({ + count : 1, + success : path => { + // 上传图片 + wx.$api.file.uploadImg(path.tempFiles[0].tempFilePath, {}).then(res=>{ + this.setData({ + showpath: res.url, + path : res.path + }) + }) + } + }) + }, + + // 提交表单 + issueForm(e) { + let value = e.detail.value; + let data = { + name : value.name, + price : value.price, + cover : this.data.path + } + wx.$api.member.openIndex(this.data.identityId, data).then(res => { + this.setData({ + disabled: true + }) + wx.switchTab({ + url: '/pages/user/index' + }) + }).catch(err => {}) + } +}) \ No newline at end of file diff --git a/pages/member/open/index.json b/pages/member/open/index.json new file mode 100644 index 0000000..3928faa --- /dev/null +++ b/pages/member/open/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/member/open/index.wxml b/pages/member/open/index.wxml new file mode 100644 index 0000000..e8ad32d --- /dev/null +++ b/pages/member/open/index.wxml @@ -0,0 +1,40 @@ +
+ + + + 收款银行 + + {{service.bank}} + + + + 收款银行帐号 + + {{service.bank_no}} + + + + 打款金额 + + + + + + 转款账户 + + + + + + 打款凭证 + + + + 请上传转款电子回单 + + + + + + +
\ No newline at end of file diff --git a/pages/member/open/index.wxss b/pages/member/open/index.wxss new file mode 100644 index 0000000..e0c9bf9 --- /dev/null +++ b/pages/member/open/index.wxss @@ -0,0 +1,96 @@ +page { + background-color: #f4f4f4; +} + +.take-label { + padding: 30rpx 30rpx 0; + box-sizing: border-box; + border-bottom: 160rpx solid transparent; +} + +.item { + padding:25rpx 20rpx 30rpx; + box-sizing: border-box; + background-color: #FFFFFF; + border-bottom: 2rpx solid #f3f3f3; + font-size: 32rpx; + margin-bottom: 30rpx; + border-radius: 30rpx; +} + +.name { + width: 100%; + display: flex; + line-height: 44rpx; + margin-bottom: 20rpx; +} + +.name image { + width: 44rpx; + height: 44rpx; + margin-right: 15rpx; +} + +.time { + width: 100%; + color: #9d9d99; +} + +.entry { + width: 100%; + background-color: #f4f4f4; + font-size: 30rpx; + padding: 0 30rpx; + height: 84rpx; + line-height: 84rpx; + box-sizing: border-box; + border-radius: 10rpx; + color: #9d9d99; +} + +.issueNew { + text-align: center; + margin-top: 20rpx; +} + +.issueNew-icon { + width: 200rpx; + height: 200rpx; +} + +.issueNew-text { + font-size: 28rpx; + color: #9d9d9d; +} + +/* 按钮 */ +.userdata-btn { + width: 100%; + box-sizing: border-box; + padding: 30rpx; + position: fixed; + bottom: 0; + left: 0; + z-index: 99; + right: 0; + background: white; +} + +.issue-btn { + background: #1d37e2; + text-align: center; + color: white; + height: 90rpx; + line-height: 90rpx !important; + font-size: 34rpx; + font-weight: normal; + width: 100% !important; + margin: 0; + padding: 0; + border-radius: 10rpx; +} + +.issue-btn[disabled] { + background: #1d37e2 !important; + color: #fff !important; +} \ No newline at end of file diff --git a/pages/member/rights/index.js b/pages/member/rights/index.js new file mode 100644 index 0000000..0f44266 --- /dev/null +++ b/pages/member/rights/index.js @@ -0,0 +1,70 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + buttonText : '', + couponPrice : '', //抵值券 + tabType : 'season', //会员标签 + rights : [], //权益 + rules : [], + newId: '', + identities : '', + identityId : '', + can : '' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取身份前置 + this.identityInfo(); + }, + + /** + * 身份前置 + */ + identityInfo(){ + // 3为季卡,4为年卡 + let identityId = '' + if(this.data.tabType == 'season') { + identityId = 3 + } else { + identityId = 4 + } + wx.$api.member.identitySee(identityId).then(res => { + this.setData({ + identities : res.data, + rules : res.data.rules, + couponPrice : res.data.coupon_price, + rights : res.data.rights, + newId : res.data.identity_id, + can : res.data.can, + buttonText : res.data.buttonText + }) + }).catch(err => {}) + }, + + /** + * 切换身份 + */ + typeClick(e) { + this.setData({ + tabType: e.currentTarget.dataset.type + }) + // 获取身份前置 + this.identityInfo(); + } +}) \ No newline at end of file diff --git a/pages/member/rights/index.json b/pages/member/rights/index.json new file mode 100644 index 0000000..bb98f7a --- /dev/null +++ b/pages/member/rights/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "会员权益" +} \ No newline at end of file diff --git a/pages/member/rights/index.wxml b/pages/member/rights/index.wxml new file mode 100644 index 0000000..8d3f169 --- /dev/null +++ b/pages/member/rights/index.wxml @@ -0,0 +1,92 @@ + + + 季卡会员 + + + 年卡会员 + + + + + + + + {{identities.name}} + + + + {{identities.times.serial}} + + + 到期时间: {{identities.times.ended_at}} + + + + + 开通{{tabType == 'season' ? '季卡' : '年卡'}}会员金额 + + + ¥{{identities.price}} + + + + + + + + + + + {{item.name == 'recommend_coupon' ? '¥' : '+'}} + {{item.name == 'open_nk' ? '' : '+'}} + {{item.value}} + + + {{item.text}} + + + {{item.name == 'recommend_coupon' ? '券' : '水滴'}} + + + + + 水滴 + + + + + + + {{tabType == 'season' ? '季卡' : '年卡'}}权益说明 + + + + {{index + 1}} + + {{item.remark}} + + + + + + + + + + ¥{{identities.price}} + (抵值券¥{{couponPrice}}) + ({{tabType == 'season'?'季卡会员' : '年卡会员'}}) + + + 立即开通 + + + + 立即续费 + + + {{buttonText}} + + + + \ No newline at end of file diff --git a/pages/member/rights/index.wxss b/pages/member/rights/index.wxss new file mode 100644 index 0000000..4e276f2 --- /dev/null +++ b/pages/member/rights/index.wxss @@ -0,0 +1,292 @@ +page { + background-image: linear-gradient(to bottom, #383041, #1a1528); +} + +.tab { + position: fixed; + width: 100%; + left: 0; + top: 0; + z-index: 100; + height: 100rpx; + line-height: 100rpx; + background-color: #383041; + display: flex; +} + +.tab-item { + text-align: center; + flex: 2; + color: #c3c1c5; + font-size: 34rpx; + position: relative; + font-weight: 600; +} + +.tab-item::after { + position: absolute; + content: ''; + left: calc(50% - 40rpx); + bottom: 0; + background-color: transparent; + width: 80rpx; + height: 6rpx; + border-radius: 50rpx; +} + +.tab-item.active { + color: #ffffff; +} + +.tab-item.active::after { + background-color: #ffffff; +} + +.rights { + position: absolute; + width: 100%; + top: 120rpx; + background-image: linear-gradient(to bottom, #383041, #1a1528); + border-bottom: 160rpx solid transparent; +} + +.card { + position: relative; + height: 380rpx; +} + +.cardBack { + position: absolute; + width: 100%; + left: 0; + top: 0; +} + +.cardText { + position: absolute; + width: 100%; + left: 0; + top: 0; + z-index: 3; + padding: 50rpx 60rpx; + box-sizing: border-box; +} + +.card-title { + font-weight: 600; + font-size: 44rpx; + color: #4c2616; + display: flex; +} + +.card-title image { + width: 46rpx; + height: 46rpx; + margin: 6rpx 10rpx 0 0; +} + +.tips { + color: #653925; + margin: 10rpx 0 30rpx; + font-size: 30rpx; +} + +.price-left { + color: #653925; + display: flex; + margin-top: 140rpx; +} + +.price-top { + flex: 1; + line-height: 64rpx; +} + +.price-number { + font-weight: 600; + font-size: 46rpx; + display: flex; +} + +.price-number image { + width: 32rpx; + height: 32rpx; + margin: 16rpx 0 0 10rpx; +} + +.price-serial { + font-weight: 600; + font-size: 36rpx; + flex: 1; + line-height: 64rpx; +} + +.price-time { + line-height: 60rpx; + font-size: 28rpx; +} + +.list { + display: flex; + padding: 30rpx 20rpx; + box-sizing: border-box; + white-space: nowrap; + flex-direction: row; + align-items: center; + justify-content: space-around; +} + +.list-item { + width: 25%; + display: inline-block; + position: relative; + text-align: center; +} + +.list-tips { + position: absolute; + top: 0; + left: 60%; + font-size: 24rpx; + background: #f1bd6e; + color: #681e0f; + border-radius: 30rpx; + padding: 0 10rpx; + line-height: 30rpx; + height: 30rpx; +} + +.list-tips.active { + background: #f2c2a3; +} + +.list-img { + width: 100rpx; + height: 100rpx; + margin: 0 auto; + background-color: rgba(255, 255, 255, .1); + border-radius: 50%; + padding: 20rpx; + box-sizing: border-box; +} + +.list-img image { + width: 100%; + height: 100%; +} + +.list-rights { + color: #ffffff; + margin: 20rpx 0 10rpx; +} + +.list-name { + color: #8d8a93; + font-size: 26rpx; +} + +.suggest { + padding: 20rpx 40rpx; + box-sizing: border-box; +} + +.suggest-cont { + border: 2rpx solid #d2bfa9; + border-radius: 40rpx; + padding: 30rpx 40rpx; + box-sizing: border-box; +} + +.suggest-title { + color: #e8bb9f; + font-size: 36rpx; + margin-bottom: 30rpx; +} + +.suggest-item { + color: #b3a3a3; + font-size: 30rpx; +} + +.suggest-label { + display: flex; + margin-bottom: 30rpx; +} + +.suggest-label:last-child { + margin-bottom: 0; +} + +.suggest-label text { + width: 38rpx; + height: 38rpx; + border-radius: 50%; + border: 2rpx solid #b3a3a3; + text-align: center; + font-size: 26rpx; + display: inline-block; + margin-top: 5rpx; +} + +.suggest-text { + width: calc(100% - 50rpx); + padding-left: 20rpx; + line-height: 40rpx; + box-sizing: border-box; + text-align: justify; +} + +.emption { + position: fixed; + background-color: #251f31; + bottom: 0; + left: 0; + padding: 30rpx; + box-sizing: border-box; + width: 100%; + height: 160rpx; + z-index: 99; +} + +.emption-cont { + border: 2rpx solid #e9c1a4; + border-radius: 50rpx; + line-height: 100rpx; + height: 100rpx; + color: #fbe8d2; + display: flex; + padding: 0 15rpx; + box-sizing: border-box; +} + +.emption-price { + flex: 1; + display: flex; +} + +.emption-top { + font-weight: 600; + font-size: 40rpx; + padding-right: 10rpx; +} + +.emption-tips { + font-size: 28rpx +} + +.emption-btn { + background-image: linear-gradient(to right, #f5c17d, #fbe9d6); + color: #681e0f; + height: 74rpx; + line-height: 74rpx; + padding: 0 30rpx; + border-radius: 50rpx; + font-weight: 600; + font-size: 30rpx; + margin-top: 13rpx; +} + +.emption-btn.active { + background-image: linear-gradient(to right, #bbbbbb, #9e9e9e); + color: #000; +} \ No newline at end of file diff --git a/pages/memberOpen/index.js b/pages/memberOpen/index.js new file mode 100644 index 0000000..3851d12 --- /dev/null +++ b/pages/memberOpen/index.js @@ -0,0 +1,89 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + userLogin : false, + identities : '', //身份信息 + userData : '', //用户信息 + tabType : 'season', //会员标签 + can : '', //操作按钮 + buttonText : '', //按钮名字 + notRules : '', //权益 + couponPrice : '' ,//抵值券 + newId : '' //会员id + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取登录状态 + if(wx.getStorageSync("token")){ + this.setData({ + userLogin: true + }) + // 获取用户信息 + this.userInfo(); + } + + // 获取身份前置 + this.identityInfo(); + }, + + /** + * 用户信息 + */ + userInfo() { + wx.$api.user.userIndex().then(res => { + this.setData({ + userData: res.data.identity.order + }) + }).catch(err => {}) + }, + + /** + * 身份前置 + */ + identityInfo(){ + // 3为季卡,4为年卡 + let identityId = '' + if(this.data.tabType == 'season') { + identityId = 3 + } else { + identityId = 4 + } + wx.$api.member.identitySee(identityId).then(res => { + this.setData({ + identities : res.data, + couponPrice : res.data.coupon_price, + notRules : res.data.not_rules, + can : res.data.can, + buttonText : res.data.buttonText, + newId : res.data.identity_id + }) + }).catch(err => {}) + }, + + /** + * 切换身份 + */ + typeClick(e) { + this.setData({ + tabType: e.currentTarget.dataset.type + }) + // 获取身份前置 + this.identityInfo(); + } +}) \ No newline at end of file diff --git a/pages/memberOpen/index.json b/pages/memberOpen/index.json new file mode 100644 index 0000000..406b11d --- /dev/null +++ b/pages/memberOpen/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "开通会员" +} \ No newline at end of file diff --git a/pages/memberOpen/index.wxml b/pages/memberOpen/index.wxml new file mode 100644 index 0000000..a9f20a7 --- /dev/null +++ b/pages/memberOpen/index.wxml @@ -0,0 +1,62 @@ + + + + + 你已开通 + 锶源昆仑天然饮用水会员 + + + + 都兰圣地 源水活取,饮水锶源 古海冰泉 + 高镁高钙 富氢低氘,大地礼物 好水天成 + + 会员中心 + + + + + + + 季卡会员 + 年卡会员 + + + + + + + + + + + + + + + + 点击开通会员 + + + 立即续费 + + + {{buttonText}} + + + + + + 您有一张抵值券可抵(¥8640元) + + + + + 开通年度会员享受5.25折 + + + + 点击开通会员 + + + + \ No newline at end of file diff --git a/pages/memberOpen/index.wxss b/pages/memberOpen/index.wxss new file mode 100644 index 0000000..5ccc5e6 --- /dev/null +++ b/pages/memberOpen/index.wxss @@ -0,0 +1,188 @@ +.tab { + position: fixed; + left: 0; + top: 0; + z-index: 99; + width: 100%; + display: flex; + padding: 0 30rpx; + box-sizing: border-box; + height: 90rpx; + background-color: #2b0a58; + font-weight: 600; + border-bottom: 2rpx solid #402663; +} + +.tab.active { + background-color: #a92021; + border-bottom: 2rpx solid #bd3335; +} + +.tab-item { + height: 90rpx; + flex: 2; + text-align: center; + line-height: 90rpx; + color: #efb480; + position: relative; +} + +.tab-item::after { + position: absolute; + content: ''; + left: calc(50% - 40rpx); + bottom: 0; + width: 80rpx; + height: 6rpx; + background-color: #efb480; + border-radius: 30rpx; + display: none; +} + +.tab-item.active::after { + display: block; +} + +.member-back { + position: fixed; + left: 0; + top: 0; + width: 100vw; + height: 100vh; + text-align: center; +} + +.rights { + position: relative; + width: 100%; +} + +.member-cont { + padding: 140rpx 30rpx 30rpx; + box-sizing: border-box; + text-align: center; + width: 100%; + position: absolute; + top: 0; + left: 0; + height: calc(70vh + 120rpx); +} + +.member-title { + width: 100%; + margin: 0 auto; +} + +.member-error { + width: 40%; + margin-top: -30rpx; +} + +.member-btn { + position: absolute; + z-index: 1; + top: calc(30vh + 80rpx); + left: 0; + width: 100%; + text-align: center; +} + +.member-btn-img { + width: 100%; +} + +.member-btn-text { + position: absolute; + width: 100%; + z-index: 200; + color: #fff; + bottom: 42rpx; + color: #a21a1e; + left: 0; + font-size: 38rpx; +} + +.member-btn-text.active { + color: #000; +} + +.member-btn-tips { + position: absolute; + text-align: center; + width: 100%; + z-index: 2; + color: #fff; + color: #f1c39a; + font-size: 26rpx; + bottom: -40rpx; + line-height: 34rpx; +} + +.member-btn-tips image { + width: 30rpx; + height: 30rpx; + vertical-align: -4rpx; + display: inline-block; + margin-right: 10rpx; +} +/* 已是会员 */ +.memberBack { + position: fixed; + width: 100%; + height: 100%; + left: 0; + top: 0; + z-index: 1; +} + +.memberTips { + position: absolute; + width: 100%; + height: 100%; + left: 0; + top: 0; + z-index: 9; + padding: 120rpx 80rpx; + text-align: center; + box-sizing: border-box; +} + +.memberTips-icon { + width: 45%; + margin: 100rpx auto; +} + +.memberTips-top text { + background-image:-webkit-linear-gradient(bottom,#826352,#3f404a); + -webkit-background-clip:text; + -webkit-text-fill-color:transparent; + font-weight: 600; +} + +.memberTips-name { + font-size: 50rpx; + line-height: 84rpx; +} + +.memberTips-title { + font-size: 28rpx; + color: #4c5264; + font-weight: 600; + box-sizing: border-box; + line-height: 44rpx; +} +.memberTips-title text { + display: block; +} + +.memberTips-brn { + background-color: #41424e; + color: #fff; + border-radius: 80rpx; + height: 82rpx; + line-height: 82rpx; + color: #fff0c6; + font-size: 28rpx; + width: 55%; + margin: 100rpx auto 0; +} \ No newline at end of file diff --git a/pages/news/classify/index.js b/pages/news/classify/index.js new file mode 100644 index 0000000..9b1957e --- /dev/null +++ b/pages/news/classify/index.js @@ -0,0 +1,40 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + noticeData: [] //消息列表 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取消息通知列表 + this.noticeInfo(); + }, + + /** + * 消息通知列表 + */ + noticeInfo (){ + wx.$api.user.notice().then(res => { + this.setData({ + noticeData: res.data + }) + }).catch(err => {}) + }, +}) \ No newline at end of file diff --git a/pages/news/classify/index.json b/pages/news/classify/index.json new file mode 100644 index 0000000..abc332e --- /dev/null +++ b/pages/news/classify/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "我的消息" +} \ No newline at end of file diff --git a/pages/news/classify/index.wxml b/pages/news/classify/index.wxml new file mode 100644 index 0000000..dd3732b --- /dev/null +++ b/pages/news/classify/index.wxml @@ -0,0 +1,13 @@ + + + + + + {{item.name}} + + + 锶源昆仑饮水-平台系统通知 + + + + \ No newline at end of file diff --git a/pages/news/classify/index.wxss b/pages/news/classify/index.wxss new file mode 100644 index 0000000..71071c2 --- /dev/null +++ b/pages/news/classify/index.wxss @@ -0,0 +1,46 @@ +.news { + background-color: #FFFFFF; + padding: 30rpx; + box-sizing: border-box; +} + +.item { + margin-bottom: 30rpx; + padding-bottom: 30rpx; + display: flex; + position: relative; +} + +.item.active::after { + position: absolute; + content: ''; + left: 64rpx; + top: 2rpx; + background-color: #e44a3f; + border: 4rpx solid #FFFFFF; + width: 16rpx; + height: 16rpx; + border-radius: 50%; +} + +.item-icon { + width: 84rpx; + height: 84rpx; + margin-top: 4rpx; + position: relative; +} +.item-text { + width: calc(100% - 114rpx); + border-bottom: 2rpx solid #f3f3f3; + margin-left: 30rpx; + padding-bottom: 40rpx; +} + +.item-name { + margin-bottom: 10rpx; +} + +.item-tips { + font-size: 26rpx; + color: #9d9d9d; +} \ No newline at end of file diff --git a/pages/news/details/index.js b/pages/news/details/index.js new file mode 100644 index 0000000..390be7e --- /dev/null +++ b/pages/news/details/index.js @@ -0,0 +1,41 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + noticeData: [], //内容 + noticeId : '' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + noticeId: options.id + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取消息内容 + this.noticeInfo(); + }, + + // 消息通知列表 + noticeInfo(){ + wx.$api.user.noticeShow(this.data.noticeId).then(res => { + this.setData({ + noticeData: res.data + }) + }).catch(err => {}) + }, +}) \ No newline at end of file diff --git a/pages/news/details/index.json b/pages/news/details/index.json new file mode 100644 index 0000000..7e94d07 --- /dev/null +++ b/pages/news/details/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "消息详情" +} \ No newline at end of file diff --git a/pages/news/details/index.wxml b/pages/news/details/index.wxml new file mode 100644 index 0000000..3f3571f --- /dev/null +++ b/pages/news/details/index.wxml @@ -0,0 +1,11 @@ + + + {{noticeData.title}} + + + {{noticeData.created_at}} + + + {{noticeData.content}} + + \ No newline at end of file diff --git a/pages/news/details/index.wxss b/pages/news/details/index.wxss new file mode 100644 index 0000000..997fd52 --- /dev/null +++ b/pages/news/details/index.wxss @@ -0,0 +1,25 @@ +page{ + background: #f4f5f9; + padding: 30rpx; + box-sizing: border-box; + height: 100vh; +} + +.list { + padding: 30rpx; + box-sizing: border-box; + background-color: #FFFFFF; + border-radius: 10rpx; + margin-bottom: 30rpx; +} + +.list-time { + font-size: 26rpx; + color: #9d9d9d; + margin: 20rpx 0 30rpx; +} + +.list-text { + font-size: 28rpx; + color: #4a4a4a; +} \ No newline at end of file diff --git a/pages/news/list/index.js b/pages/news/list/index.js new file mode 100644 index 0000000..4d88a3c --- /dev/null +++ b/pages/news/list/index.js @@ -0,0 +1,75 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + type : '', + noticeArr: [] //列表 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + type: options.type + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取消息通知列表 + this.noticeInfo(); + }, + + /** + * 消息通知列表 + */ + noticeInfo (page){ + wx.$api.user.noticeList(this.data.type, { + page: page, + }).then(res => { + let listArr = this.data.noticeArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.data) + this.setData({ + noticeArr : newData, + page : res.data.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + }).catch(err => { }) + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取消息通知列表 + this.noticeInfo(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取消息通知列表 + this.noticeInfo(pageNumber); + } + } +}) \ No newline at end of file diff --git a/pages/news/list/index.json b/pages/news/list/index.json new file mode 100644 index 0000000..e03318d --- /dev/null +++ b/pages/news/list/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "消息列表" +} \ No newline at end of file diff --git a/pages/news/list/index.wxml b/pages/news/list/index.wxml new file mode 100644 index 0000000..a0347fd --- /dev/null +++ b/pages/news/list/index.wxml @@ -0,0 +1,50 @@ + + + 未读 + + + + 开通会员通知 + + + + 发货通知 + + + + 打卡通知 + + + + 上传报告通知 + + + + + {{item.title}} + + + + 时间: + + {{item.created_at}} + + + + 内容: + + {{item.content}} + + + + + + 查看详情 + + + + + + + 暂无数据 + \ No newline at end of file diff --git a/pages/news/list/index.wxss b/pages/news/list/index.wxss new file mode 100644 index 0000000..eff7c3f --- /dev/null +++ b/pages/news/list/index.wxss @@ -0,0 +1,88 @@ +page{ + background: #f4f5f9; + padding: 30rpx; + box-sizing: border-box; +} + +.list { + background-color: #FFFFFF; + border-radius: 10rpx; + margin-bottom: 30rpx; + position: relative; +} + +.unread { + position: absolute; + right: 0; + top: 0; + background-color: #e44a3f; + border-radius: 0 10rpx 0 10rpx; + font-size: 22rpx; + color: #FFFFFF; + padding: 0 15rpx; + line-height: 44rpx; +} + +.list-top { + display: flex; + font-size: 26rpx; + line-height: 44rpx; + padding: 20rpx 25rpx; + box-sizing: border-box; +} + +.list-top image { + width: 44rpx; + height: 44rpx; + margin-right: 20rpx; +} + +.list-cont { + padding: 20rpx 25rpx; + box-sizing: border-box; + border-bottom: 2rpx solid rgb(243, 243, 243); + border-top: 2rpx solid rgb(243, 243, 243); +} + +.list-label { + margin-top: 20rpx; +} + +.list-name { + font-size: 30rpx; +} + +.list-text { + display: flex; + font-size: 26rpx; + line-height: 60rpx; +} + +.list-text text { + color: #999; + display: inline-block; + width: 90rpx; +} + +.list-time { + width: calc(100% - 90rpx); +} + +.list-more { + display: flex; + font-size: 26rpx; + padding: 0 25rpx; + box-sizing: border-box; + line-height: 70rpx; +} + +.list-more text { + flex: 1; + display: inline-block; +} + +.list-more image { + width: 24rpx; + height: 24rpx; + margin-top: 22rpx; +} \ No newline at end of file diff --git a/pages/order/details/index.js b/pages/order/details/index.js new file mode 100644 index 0000000..c8f9c74 --- /dev/null +++ b/pages/order/details/index.js @@ -0,0 +1,77 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + goodsData : '', //详情 + sign : '', //签收 + express : '', //物流 + orderNo : '' //订单号 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + orderNo: options.orderNo + }) + + // 订单详情 + this.goodsInfo(options.orderNo); + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() {}, + + // 获取订单详情 + goodsInfo(orderNo) { + wx.$api.user.goodsDet(orderNo).then(res => { + this.setData({ + goodsData : res.data, + sign : res.data.can.sign, + express : res.data.express + }) + }).catch(err => {}) + }, + + // 复制订单号 + copyUrl(val) { + wx.setClipboardData({ + data: val.currentTarget.dataset.no, + success: () => { + wx.showToast({ + title: "复制成功", + icon : "none" + }) + } + }) + }, + + // 订单签收 + signClick() { + wx.showModal({ + title : '提示', + content : '是否签收', + success : res=> { + if (res.confirm) { + wx.$api.user.goodsSign(this.data.orderNo).then(res => { + wx.showToast({ + title:'签收成功', + icon:'none' + }) + wx.navigateBack() + }).catch(err => {}) + } + } + }) + } +}) \ No newline at end of file diff --git a/pages/order/details/index.json b/pages/order/details/index.json new file mode 100644 index 0000000..7418a99 --- /dev/null +++ b/pages/order/details/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "订单详情" +} \ No newline at end of file diff --git a/pages/order/details/index.wxml b/pages/order/details/index.wxml new file mode 100644 index 0000000..8084d10 --- /dev/null +++ b/pages/order/details/index.wxml @@ -0,0 +1,83 @@ + + + + + + 订单编号 + + {{ goodsData.order_no }} + 复制 + + + + + + + {{ goodsData.express.name }} {{ goodsData.express.mobile }} + + {{ goodsData.express.full_address }} + + + + + + + + + + + {{ item.sku.goods_name }} + + x{{ item.qty }} + + + + + + + 订单信息 + + 订单类型 + + 兑换订单 + 提货订单 + + + + 交易时间 + {{ goodsData.created_at }} + + + 运费 + {{ goodsData.freight == 0 ? '免邮' : goodsData.freight }} + + + 交易状态 + {{ goodsData.state }} + + + + 物流信息 + + 物流公司 + {{ express.express_name }} + + + 收货姓名 + {{ express.name }} + + + 收货电话 + {{ express.mobile }} + + + 物流单号 + {{ express.express_no }}复制 + + + + + + 返回订单 + 签收订单 + \ No newline at end of file diff --git a/pages/order/details/index.wxss b/pages/order/details/index.wxss new file mode 100644 index 0000000..2712a66 --- /dev/null +++ b/pages/order/details/index.wxss @@ -0,0 +1,209 @@ +page { + background: #f3f4f6; + padding: 30rpx; + box-sizing: border-box; +} + +.While { + border-radius: 10rpx; + margin-bottom: 30rpx; + background-color: #FFFFFF; + box-shadow: 0 0 10rpx rgba(0, 0, 0, .05); +} + +.orderData { + border-bottom: 70rpx transparent solid; + +} + +/* 订单 */ +.orderData-cont-label { + padding: 40rpx 30rpx; + display: flex; + box-sizing: border-box; + border-bottom: #f2f2f2 2rpx solid; +} + +.orderData-cont-img { + width: 48rpx; + height: 48rpx; + vertical-align: middle; +} + +.orderData-cont-text { + width: calc(100% - 68rpx); + margin-left: 20rpx; + box-sizing: border-box; + font-size: 30rpx; +} + +.orderData-cont-name { + margin-bottom: 10rpx; +} + +.orderData-cont-name text { + color: #999; + padding-left: 20rpx; +} + +.orderData-cont-copy { + display: flex; + font-size: 26rpx; + color: #999; +} + +.orderData-cont-copy text { + flex: 1; + display: inline-block; + margin-right: 20rpx; +} + +.orderData-cont-copy view { + color: #eb504c; +} + +/* 产品 */ +.orderGoods { + padding: 30rpx; + box-sizing: border-box; +} + +.orderGoods-wares { + position: relative; +} + +.orderGoods-img { + width: 100rpx; + height: 100rpx; + border: 2rpx solid #dddddd; + border-radius: 10rpx; +} + +.orderGoods-cont { + position: absolute; + width: calc(100% - 130rpx); + left: 130rpx; + top: 0; + font-size: 30rpx; +} + +.orderGoods-text { + margin: 20rpx 0 30rpx; + color: #666666; + font-size: 26rpx; +} + +.orderGoods-price { + display: flex; + color: #555555; + margin-top: 15rpx; +} + +.orderGoods-price text { + flex: 1; + color: #000; +} + +.orderGoods-brief { + display: flex; + padding-top: 30rpx; +} + +.orderGoods-brief view { + flex: 1; + color: #333333; +} + +.orderGoods-brief text { + font-weight: 600; +} + +/* 规格 */ +.reserveCont-title { + font-weight: 600; + padding: 30rpx; + font-size: 30rpx; +} + +.reserve-label { + display: flex; + padding: 0 30rpx 30rpx; + box-sizing: border-box; + font-size: 26rpx; +} + +.reserve-name { + flex: 1; + width: 200rpx; + margin-right: 20rpx; + color: #7e7e7e; +} + +.reserve-text { + width: calc(100% - 240rpx); + text-align: right; + line-height: 50rpx; +} + +.reserve-text text { + font-size: 24rpx; + display: inline-block; + background-image: linear-gradient(to right, #f16e06, #f34206); + color: #FFFFFF; + border-radius: 6rpx; + padding: 0 10rpx; + height: 44rpx; + line-height: 44rpx; + margin-top: 6rpx; +} + +.reserve-text text.active { + background-image: linear-gradient(to right, #027be6, #2855f0); +} + +.reserve-text.reserve-price { + font-weight: 600; + color: #1d37e2; +} + +.reserve-copy { + color: #6774ff; + border: #6774ff 2rpx solid; + display: inline-block; + height: 34rpx; + line-height: 34rpx; + font-size: 26rpx; + padding: 0 10rpx; + border-radius: 4rpx; + margin-left: 10rpx; +} + +/* 底部菜单 */ +.order-data-footer { + position: fixed; + bottom: 0; + left: 0; + right: 0; + border-top: solid 1rpx #f2f2f2; + padding-top: 17rpx; + padding-right: 30rpx; + padding-left: 30rpx; + height: 83rpx; + background: white; + display: flex; + flex-wrap: wrap; + flex-direction: row-reverse; + z-index: 9; +} + +.order-btn { + margin-left: 20rpx; + height: 58rpx; + line-height: 58rpx; + box-sizing: border-box; + border: solid 1rpx #747788; + padding: 0 20rpx; + font-size: 26rpx; + border-radius: 10rpx; + margin-top: 5rpx; +} \ No newline at end of file diff --git a/pages/order/list/index.js b/pages/order/list/index.js new file mode 100644 index 0000000..54fa595 --- /dev/null +++ b/pages/order/list/index.js @@ -0,0 +1,89 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + listType: 'paid', //paid待发货,delivered已发货,signed已签收 completed已完成 + orderArr: [], //订单列表 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + listType: options.listType + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取订单列表 + this.ordersInfo(); + }, + + /** + * 订单列表 + */ + ordersInfo(page) { + wx.$api.user.orders({ + state: this.data.listType, + page : page + }).then(res => { + let listArr = this.data.orderArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.data) + this.setData({ + orderArr : newData, + page : res.data.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + }).catch(err => {}) + }, + + /** + * 状态筛选 + */ + onTabs(val){ + if(this.data.listType === val) return + this.setData({ + listType: val.currentTarget.dataset.type + }) + + // 商品详情数据 + this.ordersInfo(); + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取订单列表 + this.ordersInfo(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取订单列表 + this.ordersInfo(pageNumber); + } + } +}) \ No newline at end of file diff --git a/pages/order/list/index.json b/pages/order/list/index.json new file mode 100644 index 0000000..e3130c7 --- /dev/null +++ b/pages/order/list/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "我的订单" +} \ No newline at end of file diff --git a/pages/order/list/index.wxml b/pages/order/list/index.wxml new file mode 100644 index 0000000..399875d --- /dev/null +++ b/pages/order/list/index.wxml @@ -0,0 +1,55 @@ + + + 待发货 + 已发货 + 已签收 + + + + + + + {{ item.order_no }} + {{ item.state }} + + + + + + + + {{ goodItem.sku.goods_name }} + + + {{goodItem.sku.price != 0 ? '¥' + goodItem.sku.price : '兑换'}} + + + + x{{ goodItem.qty }} + + + + + 下单时间:{{ item.created_at }} + + + + 兑换订单 + 提货订单 + + 订单详情 + + + + + 加载中... + + + 没有更多了~ + + + + + + 暂无数据 + \ No newline at end of file diff --git a/pages/order/list/index.wxss b/pages/order/list/index.wxss new file mode 100644 index 0000000..16b6f9b --- /dev/null +++ b/pages/order/list/index.wxss @@ -0,0 +1,177 @@ +page { + overflow: hidden; + background: #f3f4f6; + padding: 30rpx; + box-sizing: border-box; +} + +.While { + border-radius: 10rpx; + margin-bottom: 30rpx; + background-color: #FFFFFF; + padding: 0 30rpx; + box-sizing: border-box; + box-shadow: 0 0 10rpx rgba(0, 0, 0, .05); +} + +.order { + margin-top: 90rpx; +} + +.order-top { + line-height: 90rpx; + box-sizing: border-box; + display: flex; + font-size: 28rpx; + border-bottom: 2rpx #f2f2f2 solid; +} + +.order-top-number { + flex: 1; +} + +.order-top-tips { + font-size: 26rpx; + color: #eb504c; +} + +.order-name { + padding: 20rpx 0; + box-sizing: border-box; + position: relative; +} + +.order-img { + width: 90rpx; + height: 90rpx; + margin-right: 20rpx; + border-radius: 10rpx; +} + +.order-goods { + position: absolute; + width: 100%; + left: 0; + top: 0; + padding: 20rpx 20rpx 20rpx 110rpx; + box-sizing: border-box; +} + +.order-label { + display: flex; + font-size: 30rpx; + margin-bottom: 15rpx; +} + +.order-label-name { + flex: 1; + margin-right: 30rpx; +} + +.order-label-price { + font-size: 26rpx; + color: #999; +} + +.order-specs { + font-size: 24rpx; + color: #919191; + display: flex; +} + +.order-specs text { + display: inline-block; + flex: 1; +} + +.order-text { + font-size: 28rpx; + line-height: 40rpx; + display: flex; + padding-bottom: 20rpx; + border-top: 2rpx solid #f2f2f2; + border-bottom: 2rpx solid #f2f2f2; + padding-top: 20rpx; +} + +.order-time { + color: #919191; + font-size: 24rpx; + flex: 1; +} + +.order-price text { + font-weight: 600; + color: #1d37e2; +} + +.order-btn { + padding: 30rpx 0; + box-sizing: border-box; + position: relative; + display: flex; + font-size: 24rpx; +} + +.order-btn-type { + flex: 1; +} + +.order-btn-type text { + display: inline-block; + background-image: linear-gradient(to right, #f16e06, #f34206); + color: #FFFFFF; + border-radius: 6rpx; + padding: 0 10rpx; + height: 44rpx; + line-height: 44rpx; + margin-top: 6rpx; +} + +.order-btn-type text.active { + background-image: linear-gradient(to right, #027be6, #2855f0); +} + +.order-btn-atn { + border: 2rpx solid #f2f2f2; + border-radius: 40rpx; + padding: 0 30rpx; + height: 52rpx; + line-height: 52rpx; + color: #767676; + display: inline-block; + margin-left: 15rpx; +} + +.order-btn-atn.active { + color: #1d37e2; + border-color: #bfc5ff; +} + +/* tabs */ +.header { + position: fixed; + top: 0; + left: 0; + right: 0; + z-index: 99; +} + +.tabs { + display: flex; + justify-content: space-around; + background: white; + padding: 15rpx 0; + font-size: 30rpx; + color: #9d9d9d; +} + +.item { + height: 60rpx; + line-height: 60rpx; +} + +.item.show { + color: #1d37e2; + border-bottom: solid 4rpx #1d37e2; +} \ No newline at end of file diff --git a/pages/recommend/index.js b/pages/recommend/index.js new file mode 100644 index 0000000..bc00cd5 --- /dev/null +++ b/pages/recommend/index.js @@ -0,0 +1,68 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + larerType : 1, //默认列表 1 直接 2 间接 + count : '', //数量 + identity : '', //身份 + relationArr: [], //我的伙伴列表 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取商品详情数据 + this.relationsInfo(); + }, + + /** + * 商品详情数据 + */ + relationsInfo() { + wx.$api.user.relations({ + larer: this.data.larerType + }).then(res => { + this.setData({ + count : res.data.count, + relationArr : res.data.users + }) + }).catch(err => {}) + }, + + /** + * 状态筛选 + */ + onTabs(e){ + let val = e.currentTarget.dataset.type + if(this.data.larerType === val) return + this.setData({ + larerType: val + }) + + // 获取商品详情数据 + this.relationsInfo(); + }, + + /** + * 拨打电话 + */ + telClick(e){ + wx.makePhoneCall({ + phoneNumber: e.currentTarget.dataset.name + }); + } +}) \ No newline at end of file diff --git a/pages/recommend/index.json b/pages/recommend/index.json new file mode 100644 index 0000000..aa0dd3a --- /dev/null +++ b/pages/recommend/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "我的推荐" +} \ No newline at end of file diff --git a/pages/recommend/index.wxml b/pages/recommend/index.wxml new file mode 100644 index 0000000..3235c87 --- /dev/null +++ b/pages/recommend/index.wxml @@ -0,0 +1,43 @@ + + + + 我的推荐(总) + {{count.all}} + + + + + 直接推荐 + + + 间接推荐 + + + + + + + + + {{ item.nickname }} + + + + + + + + + + + + + + + + + + + + 暂无数据 + \ No newline at end of file diff --git a/pages/recommend/index.wxss b/pages/recommend/index.wxss new file mode 100644 index 0000000..897c033 --- /dev/null +++ b/pages/recommend/index.wxss @@ -0,0 +1,139 @@ +page { + background: #f3f4f6; +} + +.all { + background-color: #FFFFFF; + position: relative; + height: 220rpx; +} + +.all-back { + width: 100%; + height: 100%; + position: absolute; + left: 0; + top: 0; +} + +.all-text { + width: 100%; + height: 100%; + position: absolute; + left: 0; + top: 0; + padding: 30rpx; + box-sizing: border-box; + color: #FFFFFF; + font-size: 34rpx; + font-weight: 600; +} + +.number { + font-size: 62rpx; + font-weight: 600; + margin-top: 10rpx; +} + +.number text { + font-size: 26rpx; +} + +.tab { + height: 100rpx; + line-height: 100rpx; + position: relative; + display: flex; + margin-top: -20rpx; +} + +.tab .item { + flex: 2; + text-align: center; + border-radius: 30rpx 30rpx 0 0; + font-weight: 600; + background-color: #1e50f1; + color: #b4c8ff; +} + +.tab .item.active { + background-color: #FFFFFF; + color: #000000; +} + +.tab .item image { + width: 34rpx; + height: 34rpx; + vertical-align: -7rpx; + margin-right: 10rpx; +} + +.list { + background-color: #FFFFFF; + padding: 30rpx; + box-sizing: border-box; +} + +.list .item { + margin-bottom: 30rpx; + display: flex; + border-bottom: 2rpx solid #f3f3f3; + padding-bottom: 30rpx; + position: relative; +} + +.list .item:last-child { + padding-bottom: 0; + margin-bottom: 0; + border: none; +} + +.list-cover { + width: 100rpx; + height: 100rpx; + border-radius: 50%; +} + +.list-text { + width: calc(100% - 120rpx); + margin-left: 20rpx; + margin-top: 5rpx; +} + +.list-nick { + display: flex; +} + +.name { + font-weight: 600; +} + +.user-sex { + width: 40rpx; + margin-left: 10rpx; +} + +.identity { + margin-top: 10rpx; +} + +.user-identity { + width: 130rpx; +} + +.list-user { + background-color: #f2f5fd; + width: 70rpx; + height: 70rpx; + border-radius: 50%; + text-align: center; + padding: 18rpx; + box-sizing: border-box; + position: absolute; + right: 0; + top: 20rpx; +} + +.list-user image { + width: 100%; +} \ No newline at end of file diff --git a/pages/record/healthy/index.js b/pages/record/healthy/index.js new file mode 100644 index 0000000..f84e18d --- /dev/null +++ b/pages/record/healthy/index.js @@ -0,0 +1,92 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + year : '', //年 + years : [], + timelineArr : [], //时间轴 + index : 0 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取健康记录 + this.timelInfo() + }, + + /** + * 健康记录 + */ + timelInfo(page) { + wx.$api.member.timelSee({ + year: this.data.year, + page: page || 1 + }).then(res => { + let listArr = this.data.timelineArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.timelines.data) + + this.setData({ + year : res.data.base.year, + years : res.data.base.years, + timelineArr : newData, + page : res.data.timelines.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + }).catch(err => {}) + }, + + /** + * 日期选择 + */ + platBind(e) { + this.setData({ + index: e.detail.value, + year : this.data.years[e.detail.value] + }) + + // 获取健康记录 + this.timelInfo() + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取健康记录 + this.timelInfo() + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取健康记录 + this.timelInfo(pageNumber) + } + } +}) \ No newline at end of file diff --git a/pages/record/healthy/index.json b/pages/record/healthy/index.json new file mode 100644 index 0000000..74f1c0f --- /dev/null +++ b/pages/record/healthy/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "健康记录" +} \ No newline at end of file diff --git a/pages/record/healthy/index.wxml b/pages/record/healthy/index.wxml new file mode 100644 index 0000000..5a2eb91 --- /dev/null +++ b/pages/record/healthy/index.wxml @@ -0,0 +1,60 @@ + + + + {{year}} + + + + + {{years[index]}} + + + + + + + + + + {{item.time.monthDay}} + {{item.time.time}} + + + + + {{item.text}} + 上传档案 + 订单记录 + 反馈记录 + + + + + + {{item.item.goods.goods_name}} + + + 数量:{{item.item.qty}} + + + + + 备注{{item.item.remark}} + + + + + + + 加载中... + + + 没有更多了~ + + + + + + + 暂无数据 + \ No newline at end of file diff --git a/pages/record/healthy/index.wxss b/pages/record/healthy/index.wxss new file mode 100644 index 0000000..4eea91d --- /dev/null +++ b/pages/record/healthy/index.wxss @@ -0,0 +1,232 @@ +page { + background-color: #f5f5f5; +} + +.year { + box-sizing: border-box; + padding-bottom: 40rpx; +} + +.year-cont { + width: 100%; + background-color: #FFFFFF; + position: relative; +} + +.year-name { + line-height: 100rpx; + width: 300rpx; + font-size: 42rpx; + text-align: right; + position: relative; + font-weight: 600; +} + +.year-name::after { + position: absolute; + content: ''; + left: 170rpx; + top: 50rpx; + width: 2rpx; + height: 100%; + background-color: #ffd4cf; +} + +.year-name::before { + position: absolute; + content: ''; + left: 160rpx; + top: 40rpx; + background-color: #FFFFFF; + border: 6rpx solid #f1422d; + width: 10rpx; + height: 10rpx; + border-radius: 50%; + z-index: 3; +} + +.year-name.active::after { + display: none; +} + +.year-screen { + position: absolute; + right: 40rpx; + top: 20rpx; + border: 2rpx solid #e0e0e0; + border-radius: 10rpx; + padding: 0 45rpx 0 20rpx; + height: 50rpx; + line-height: 50rpx; +} + +.year-screen image { + width: 24rpx; + height: 24rpx; + position: absolute; + top: 15rpx; + right: 15rpx; +} + +.timeList { + padding: 0 30rpx 30rpx; + background-color: #f5f5f5; + box-sizing: border-box; +} + +.item { + display: flex; +} + +.time { + text-align: left; + width: 120rpx; + height: 100%; + font-size: 32rpx; + font-weight: 600; +} + +.time text { + display: block; + color: #9d9d9d; + margin-top: 10rpx; + font-size: 28rpx; +} + +.text { + height: 100%; + padding-left: 70rpx; + box-sizing: border-box; + width: 100%; + position: relative; + padding-bottom: 40rpx; +} + +.text::after { + position: absolute; + content: ''; + left: 40rpx; + top: 12rpx; + width: 2rpx; + height: 100%; + background-color: #ffd4cf; +} + +.text::before { + position: absolute; + content: ''; + left: 30rpx; + top: 12rpx; + background-color: #FFFFFF; + border: 6rpx solid #f1422d; + width: 14rpx; + height: 14rpx; + border-radius: 50%; + z-index: 3; +} + +.contain { + width: 100%; + background-color: #FFFFFF; + padding: 25rpx 30rpx; + box-sizing: border-box; + border-radius: 10rpx; + display: inline-block; + color: #3a3a3a; +} + +.tips { + display: flex; +} + +.tips text { + display: inline-block; + font-size: 28rpx; + padding: 0 20rpx; + height: 52rpx; + line-height: 52rpx; + border-radius: 10rpx; +} + +.tips text.yellow { + background-color: #fff7e5; + color: #ffaa00; +} + +.tips text.green { + background-color: #edf7f1; + color: #43b26b; +} + +.tips text.blue { + background-color: #e4ecff; + color: #265deb; +} + +.name { + font-weight: 600; + line-height: 48rpx; + flex: 1 +} + +.remark { + margin-top: 30rpx; + font-size: 28rpx; + line-height: 38rpx; + color: #9d9d9d; + text-align: justify; + background-color: #f5f5f5; + border-radius: 10rpx; + padding: 20rpx; + box-sizing: border-box; + position: relative; +} + +.remark-tips { + left: 0; + top: 0; + background-color: #989898; + color: #FFFFFF; + font-size: 26rpx; + position: absolute; + border-radius: 10rpx 0 30rpx 0; + padding: 0 18rpx 0 15rpx; + line-height: 44rpx; + transform: scale(.85); +} + +.remark text { + padding-top: 35rpx; + display: block; +} + +.goods { + position: relative; + margin-top: 30rpx; +} + +.goods-img { + width: 80rpx; + height: 80rpx; + border-radius: 10rpx; + overflow: hidden; +} + +.goods-text { + position: absolute; + left: 0; + top: 0; + width: 100%; + padding-left: 100rpx; + box-sizing: border-box; +} + +.name { + font-size: 30rpx; + margin-bottom: 8rpx; +} + +.number { + font-size: 26rpx; + color: #9d9d9d; +} \ No newline at end of file diff --git a/pages/record/index/index.js b/pages/record/index/index.js new file mode 100644 index 0000000..2c897f2 --- /dev/null +++ b/pages/record/index/index.js @@ -0,0 +1,166 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + disabled : false ,// 提交按钮状态 + editState: false, //是否可以编辑表单 + experience: '', + numberVal: '', + count : '', + //查看我的病例内容 + name : '', + id_card : '', + username: '', + sex : '', + cover : '', + remark : '', + age : '', + height : '', + weight : '', + gout_case_id: '', + isCase : '', + status : '', + sexIndex : 0, + sexName : 'man', + sexArray : [{ + val : 'man', + name : '男' + },{ + val : 'woman', + name : '女' + }], + symptomSee: [], //查看身体状况 + symptoms : [] ,//身体状况前置 + statusArr: [] //身体状况选择 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + experience: options.experience + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 是否有档案 + wx.$api.user.userIndex().then(res => { + if(res.data.status.isCase){ + this.setData({ + editState: true, + isCase : res.data.status.isCase + }) + // 获取已有档案信息 + this.goutSeeInfo(); + return + } + // 健康前置信息 + wx.$api.member.goutCreate().then(res => { + this.setData({ + symptoms: res.data.symptoms + }) + }).catch(err => {}) + }).catch(err => {}) + }, + + /** + * 查看已有档案信息 + */ + goutSeeInfo() { + wx.$api.member.goutSee().then(res => { + this.setData({ + status : res.data.case.status, + name : res.data.case.name, + username : res.data.case.user.username, + sex : res.data.case.sex, + age : res.data.case.age, + height : res.data.case.height, + weight : res.data.case.weight, + symptomSee : res.data.case.symptoms, + sexName : res.data.case.sex, + caseId : res.data.case.case_id, + gout_case_id : res.data.case.gout_case_id + }) + }).catch(err => {}) + }, + + // 高血脂 + hyperlipemiaInput(e) { + this.data.hyperlipemiaNumber = e.detail.value + }, + // 高血压 + hypertensionInput(e) { + this.data.hypertensionNumber = e.detail.value + }, + // 高血糖 + hyperglycemiaInput(e) { + this.data.hyperglycemiaNumber = e.detail.value + }, + + // 身体状况多选 + statusChange(e){ + this.data.statusArr = String(e.detail.value) + }, + + // 提交表单 hyperlipemia;hypertension;hyperglycemia + issueForm(e) { + let value = e.detail.value; + + let data = { + name : value.name, + age : value.age, + height : value.height, + weight : value.weight, + remark : value.remark, + symptoms : this.data.statusArr, + sex : this.data.sexArray[this.data.sexIndex].val, + experience : this.data.experience + } + wx.$api.member.goutAdd(data).then(res => { + this.setData({ + disabled: true + }) + wx.navigateBack() + }).catch(err => {}) + }, + + /** + * 选择男女 + */ + bindSexChange(e) { + this.setData({ + sexIndex : parseInt(e.detail.value), + sexName : this.data.sexArray[e.detail.value].val + }) + // if(this.data.sexArray[e.detail.value].val == 'woman') { + // this.setData({ + // hyperlipemiaMax : this.data.count.woman.hyperlipidemia.max, + // hyperlipemiaMin : this.data.count.woman.hyperlipidemia.min, + // hypertensionMax : this.data.count.woman.hypertension.max, + // hypertensionMin : this.data.count.woman.hypertension.min, + // hyperglycemiaMax : this.data.count.woman.hyperglycemia.max, + // hyperglycemiaMin : this.data.count.woman.hyperglycemia.min + // }) + // }else { + // this.setData({ + // hyperlipemiaMax : this.data.count.man.hyperlipidemia.max, + // hyperlipemiaMin : this.data.count.man.hyperlipidemia.min, + // hypertensionMax : this.data.count.man.hypertension.max, + // hypertensionMin : this.data.count.man.hypertension.min, + // hyperglycemiaMax : this.data.count.man.hyperglycemia.max, + // hyperglycemiaMin : this.data.count.man.hyperglycemia.min, + // }) + // } + }, +}) \ No newline at end of file diff --git a/pages/record/index/index.json b/pages/record/index/index.json new file mode 100644 index 0000000..13279c1 --- /dev/null +++ b/pages/record/index/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "用户档案" +} \ No newline at end of file diff --git a/pages/record/index/index.wxml b/pages/record/index/index.wxml new file mode 100644 index 0000000..b3e5c6b --- /dev/null +++ b/pages/record/index/index.wxml @@ -0,0 +1,79 @@ +
+ + + 个人档案 + + + + + + + + + + + {{ sex == 'woman' ? '女' : '男' }} + + + + + {{sexArray[sexIndex].name}} + + + + + + + + + + + + + + + + + + + 亚健康状态(多选) + + + + + + + + 亚健康状态(多选) + + + + + + + + + + + + {{status.text}}~请您耐心等待~ + + + + + 上传报告 + + + 报告记录 + + + + + +
\ No newline at end of file diff --git a/pages/record/index/index.wxss b/pages/record/index/index.wxss new file mode 100644 index 0000000..e6bff08 --- /dev/null +++ b/pages/record/index/index.wxss @@ -0,0 +1,112 @@ +page { + background: #f3f4f6; +} + +.case { + border-bottom: 160rpx solid transparent; +} + +.issue-title { + padding: 30rpx; + font-weight: 600; +} + +.issue-block { + background: white; + margin-bottom: 20rpx; + padding: 0 25rpx; +} + +.issue-inputs { + position: relative; + height: 90rpx; + line-height: 90rpx; + padding-left: 170rpx; +} + +.issue-input-label { + position: absolute; + left: 0; + top: 0; + width: 170rpx; +} + +.issue-inputs-input { + line-height: 90rpx; + height: 90rpx; + width: 100%; +} + +.uni-input-img { + width: 32rpx; + height: 32rpx; + position: absolute; + right: 0; + top: 30rpx; +} + +.status { + padding: 10rpx 0 30rpx; +} + +.status-title { + margin-bottom: 30rpx; +} + +.status-label { + margin-right: 40rpx; +} + +.status-label:last-child { + margin: 0; +} + +/* 按钮 */ +.userdata-btn { + width: 100%; + box-sizing: border-box; + padding: 30rpx; + position: fixed; + bottom: 0; + left: 0; + z-index: 99; + right: 0; + background: white; +} + +.issue-btn { + background: #1d37e2; + text-align: center; + color: white; + height: 90rpx; + line-height: 90rpx; + font-size: 30rpx; + font-weight: normal; + width: 100% !important; + margin: 0; + padding: 0; + border-radius: 10rpx; +} + +.issue-btn[disabled] { + background: #1d37e2 !important; + color: #fff !important; +} +.userdata-go { + display: flex; + padding: 30rpx 20rpx; +} + +.tools-item { + flex: 2; + font-size: 30rpx; + text-align: center; + margin: 0 10rpx; + background: #1d37e2; + text-align: center; + color: white; + height: 90rpx; + line-height: 90rpx; + border-radius: 10rpx; +} + diff --git a/pages/record/list/index.js b/pages/record/list/index.js new file mode 100644 index 0000000..9ff602a --- /dev/null +++ b/pages/record/list/index.js @@ -0,0 +1,90 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + LogArr : [], //记录列表 + LogInfo : '', //记录详情 + caseId : '', //档案id + recordShow : false, + page : {}, //下一页 + lodingStats : false, //加载状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + caseId: options.caseid + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取数据信息 + this.lastInfo(); + }, + + /** + * 数据信息 + */ + lastInfo(page) { + wx.$api.member.ListLog(this.data.caseId,{ + page : page || 1 + }).then(res => { + let listArr = this.data.LogArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.data) + this.setData({ + LogArr : newData, + page : res.data.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + }).catch(err => {}) + }, + + /** + * 查看图片 + */ + opneImg(e) { + let photoImg = e.currentTarget.dataset.img + wx.previewImage({ + current: photoImg, + urls:[photoImg] + }) + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取数据信息 + this.lastInfo(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取数据信息 + this.lastInfo(pageNumber); + } + } +}) \ No newline at end of file diff --git a/pages/record/list/index.json b/pages/record/list/index.json new file mode 100644 index 0000000..37ed7b7 --- /dev/null +++ b/pages/record/list/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "报告记录" +} \ No newline at end of file diff --git a/pages/record/list/index.wxml b/pages/record/list/index.wxml new file mode 100644 index 0000000..af8de85 --- /dev/null +++ b/pages/record/list/index.wxml @@ -0,0 +1,48 @@ + + + + {{item.created_at}} + + + + + + + {{items.diff.text}} + + + + + + + + {{items.high}}(高) + + + {{items.low}}(低) + + {{items.diff.unit}} + + {{items.low}}{{items.diff.unit}} + + + + + {{item.remark}} + + + + + + 加载中... + + + 没有更多了~ + + + + + + + 暂无数据 + \ No newline at end of file diff --git a/pages/record/list/index.wxss b/pages/record/list/index.wxss new file mode 100644 index 0000000..63ef7a7 --- /dev/null +++ b/pages/record/list/index.wxss @@ -0,0 +1,152 @@ +page { + padding: 30rpx 40rpx; + box-sizing: border-box; +} + +.list-label { + padding-left: 60rpx; + box-sizing: border-box; + padding-bottom: 60rpx; + border-left: 2rpx dashed #1d37e2; + position: relative; +} + +.list-label::after { + position: absolute; + content: ''; + left: -16rpx; + top: 6rpx; + width: 16rpx; + height: 16rpx; + border-radius: 50%; + background-color: #6377ff; + border: 8rpx solid #bec6fb; + z-index: 4; +} + +.list-label::before { + position: absolute; + content: ''; + left: -25rpx; + top: 0; + width: 50rpx; + height: 50rpx; + border-radius: 50%; + background-color: #eef1ff; +} + +.time { + color: #6377ff; + font-weight: 600; + margin-bottom: 30rpx; + display: flex; + line-height: 50rpx; +} + +.created { + flex: 1; +} + +.del { + font-size: 26rpx; + color: #eb504c; + display: flex; +} + +.del image { + width: 38rpx; + height: 38rpx; + margin: 6rpx 0 0 4rpx; +} + +.list { + background-color: #f5f5f5; + padding: 30rpx; + box-sizing: border-box; + border-radius: 10rpx; +} + +.label { + display: flex; + background-color: #FFFFFF; + margin-bottom: 30rpx; + padding: 20rpx; + box-sizing: border-box; + position: relative; +} + +.enlarge { + position: absolute; + right: 20rpx; + top: 50rpx; + width: 36rpx; + height: 36rpx; + z-index: 9; +} + +.label-img { + width: 90rpx; + height: 90rpx; + border-radius: 10rpx; +} + +.label-data { + width: calc(100% - 100rpx); + margin-left: 20rpx; +} + +.text { + margin: 5rpx 0; + font-size: 30rpx; + display: flex; +} + +.text image { + width: 34rpx; + margin-left: 10rpx; + margin-top: 4rpx; + height: 34rpx; +} + +.number { + font-weight: 600; +} + +.number text { + font-weight: normal; + font-size: 26rpx; + padding-left: 5rpx; +} + +.number-label { + font-weight: 600; + display: flex; +} + +.number-label>text { + font-weight: normal; + font-size: 30rpx; + padding-left: 5rpx; + padding-top: 6rpx; +} + +.number-value { + margin-right: 10rpx; +} + +.number-value text { + font-weight: normal; + font-size: 26rpx; + padding-left: 5rpx; +} + +.remark { + background-color: #FFFFFF; + padding: 20rpx; + box-sizing: border-box; + border-radius: 10rpx; + font-size: 26rpx; + color: #4a4a4a; + line-height: 38rpx; + text-align: justify; +} \ No newline at end of file diff --git a/pages/record/report/index.js b/pages/record/report/index.js new file mode 100644 index 0000000..69f6810 --- /dev/null +++ b/pages/record/report/index.js @@ -0,0 +1,248 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + numberWrite : '', //第几次填写报告 + disabled : false, //按钮样式 + sexName : 'man', + caseId : '', //档案ID + symptoms: [], + // 血脂 + hyperlipidemia:{ + Max : '', + Min : '', + Number:'', + Id :'', + showpath: '', + path : '' + }, + + // 血压 + hypertension: { + Max : '', + Min : '', + High : '', + Number:'', + Id :'', + showpath: '', + path : '' + }, + + // 血糖 + hyperglycemia: { + Max : '', + Min : '', + Number:'', + Id :'', + showpath: '', + path : '' + }, + + // 尿酸 + ua: { + Max : '', + Min : '', + Number:'', + Id :'', + showpath: '', + path : '' + } + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + console.log(options) + this.setData({ + numberWrite : options.number, + caseId : options.caseid + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 健康前置信息 + wx.$api.member.goutCreate().then(res => { + this.setData({ + // 血脂 + ['hyperlipidemia.Max']: Number(res.data.count.man.hyperlipidemia.max), + ['hyperlipidemia.Min']: Number(res.data.count.man.hyperlipidemia.min), + + // 血压 + ['hypertension.Max']: Number(res.data.count.man.hypertension.max), + ['hypertension.Min']: Number(res.data.count.man.hypertension.min), + + // 血糖 + ['hyperglycemia.Max']: Number(res.data.count.man.hyperglycemia.max), + ['hyperglycemia.Min']: Number(res.data.count.man.hyperglycemia.min), + + // 尿酸 + ['ua.Max']: Number(res.data.count.man.ua.max), + ['ua.Min']: Number(res.data.count.man.ua.min), + }) + }).catch(err => {}) + + // 反馈前置信息 + wx.$api.member.goutSee().then(res => { + this.setData({ + symptoms: res.data.case.symptoms, + sexName : res.data.case.sex + }) + }).catch(err => {}) + }, + + /** + * 记录值 + */ + recordInput(e) { + let value = Number(e.detail.value), + name = e.target.dataset.name, + id = e.target.dataset.id + if(name == 'hyperlipidemia') { + // 血脂 + this.setData({ + ['hyperlipidemia.Number']: value, + ['hyperlipidemia.Id']: id + }) + } else if(name == 'hypertension') { + // 血压 + this.setData({ + ['hypertension.Number']: value, + ['hypertension.Id']: id + }) + } else if(name == 'hyperglycemia') { + // 血糖 + this.setData({ + ['hyperglycemia.Number']: value, + ['hyperglycemia.Id']: id + }) + } else { + // 尿酸 + this.setData({ + ['ua.Number']: value, + ['ua.Id']: id + }) + } + }, + + /** + * 记录高血压值 + */ + highInput(e) { + this.setData({ + ['hypertension.High']: Number(e.detail.value) + }) + }, + + /** + * 上传图片 + */ + updImg(type){ + let newName = type.currentTarget.dataset.name + wx.chooseMedia({ + count : 1, + success : path => { + // 上传图片 + wx.$api.file.uploadImg(path.tempFiles[0].tempFilePath, {}).then(res=>{ + if(newName == 'hyperlipidemia') { + // 血脂 + this.setData({ + ['hyperlipidemia.showpath']: res.url, + ['hyperlipidemia.path']: res.path + }) + } else if(newName == 'hypertension') { + // 血压 + this.setData({ + ['hypertension.showpath']: res.url, + ['hypertension.path']: res.path + }) + } else if(newName == 'hyperglycemia') { + // 血糖 + this.setData({ + ['hyperglycemia.showpath']: res.url, + ['hyperglycemia.path']: res.path + }) + } else { + // 尿酸 + this.setData({ + ['ua.showpath']: res.url, + ['ua.path']: res.path + }) + } + }) + } + }) + }, + + /** + * 提交表单 + */ + uploadSubmit(val) { + let dataArr = [] + let symptoms = this.data.symptoms + for(let val of symptoms){ + switch (val.symptom_id){ + // 血脂 + case this.data.hyperlipidemia.Id: + dataArr.push({ + symptom_id : val.symptom_id, + high : 0, + low : this.data.hyperlipidemia.Number, + cover : this.data.hyperlipidemia.path + }) + break; + // 血压 + case this.data.hypertension.Id: + dataArr.push({ + symptom_id : val.symptom_id, + high : this.data.hypertension.High, + low : this.data.hypertension.Number, + cover : this.data.hypertension.path + }) + break; + // 血糖 + case this.data.hyperglycemia.Id: + dataArr.push({ + symptom_id : val.symptom_id, + high : 0, + low : this.data.hyperglycemia.Number, + cover : this.data.hyperglycemia.path + }) + break; + // 尿酸 + case this.data.ua.Id: + dataArr.push({ + symptom_id : val.symptom_id, + high : 0, + low : this.data.ua.Number, + cover : this.data.ua.path + }) + break; + default: + // wx.showToast({ + // title: '请填写完整信息', + // icon : 'none' + // }) + // break; + } + } + + let data = { + remark : val.detail.value.remark, + symptoms: dataArr + } + wx.$api.member.AddlastLog(this.data.caseId,data).then(res => { + wx.navigateBack() + }).catch(err => {}) + } +}) \ No newline at end of file diff --git a/pages/record/report/index.json b/pages/record/report/index.json new file mode 100644 index 0000000..8cc2a1a --- /dev/null +++ b/pages/record/report/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "上传报告" +} \ No newline at end of file diff --git a/pages/record/report/index.wxml b/pages/record/report/index.wxml new file mode 100644 index 0000000..b87084b --- /dev/null +++ b/pages/record/report/index.wxml @@ -0,0 +1,105 @@ +
+ + + + {{item.title}} + + + + + + + + + + + + + 偏高 + 偏低 + mmol/L + + + + + + 偏高 + 偏低 + mmHg + + + + + + 偏高 + 偏低 + mmol/L + + + + + + 偏高 + 偏低 + μmol/L + + + + {{sexName == 'man' ? '男性' : '女性'}} + {{item.title}}正常指标 {{ hyperlipidemia.Min }} ~ {{ hyperlipidemia.Max }} + {{item.title}}正常指标 {{ hypertension.Min }} ~ {{ hypertension.Max }} + {{item.title}}正常指标 {{ hyperglycemia.Min }} ~ {{ hyperglycemia.Max }} + {{item.title}}正常指标 {{ ua.Min }} ~ {{ ua.Max }} + + + + + + + + + + + + 偏高 + 偏低 + mmHg + + + + {{sexName == 'man' ? '男性' : '女性'}}{{item.title}}正常指标 {{ hypertension.Min }} ~ {{ hypertension.Max }} + + + + + + + 请保证上传的图片、资料清晰可辨、重点突出,有利于全面掌握相关信息,准确判断患者病情 + + + + + + + + + + + + + + * + 亚健康状态描述 + 好转反馈 + 状态描述 + + + + + + + + 删除 + + + + + 添加 + + + + + + + + + + + + + + + + +5 + 水滴 + + + + 水滴已发放! + + + + + diff --git a/pages/sign/write/index.wxss b/pages/sign/write/index.wxss new file mode 100644 index 0000000..0ca3516 --- /dev/null +++ b/pages/sign/write/index.wxss @@ -0,0 +1,182 @@ +page { + background-color: #f5f5f5; + padding: 30rpx; + box-sizing: border-box; +} + +.issue-block { + background: white; + padding: 30rpx; + box-sizing: border-box; + border-radius: 10rpx; +} + +.issue-textarea textarea { + width: 100%; + height: 200rpx; +} + +.album-list { + display: flex; + flex-wrap: wrap; +} + +.album-list-li { + margin-right: 10rpx; + position: relative; + width: calc(25% - 10rpx); + padding-top: calc(25% - 10rpx); + box-sizing: border-box; +} + +.album-list-li:last-child { + margin: 0; +} + +.album-list-img, +.album-list-li-add { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: #f5f5f5; + border-radius: 6rpx; +} + +.album-list-li-add { + text-align: center; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-box-pack: center; + color: #666; + font-size: 26rpx; +} + +.album-list-add-icon { + width: 34rpx; + height: 34rpx; +} + +.album-remove { + position: absolute; + right: 0; + bottom: 0; + background: rgba(0, 0, 0, .5); + color: white; + font-size: 28rpx; + text-align: center; + line-height: 50rpx; + width: 100%; + z-index: 9; +} + +.site-btn { + margin-top: 120rpx; +} + +.site-btn button[size="mini"] { + width: 100%; + background: #1d37e2; + height: 88rpx; + line-height: 88rpx; + font-size: 30rpx; + color: white; + padding: 0; +} + +.site-btn button[disabled] { + background: #7789ff !important; + color: #fff !important; +} + +/* 获得水滴弹出层提示 */ +.publicBack { + position: fixed; + width: 100vw; + height: 100vh; + left: 0; + top: 0; + background-color: rgba(0, 0, 0, .5); + z-index: 99; +} + +.publicPop { + left: 50%; + top: 50%; + width: 440rpx; + height: 300rpx; + margin-left: -220rpx; + margin-top: -200rpx; + position: fixed; + z-index: 100; + background-color: #ffffff; + border-radius: 30rpx; + text-align: center; +} + +.publicPop-close { + position: absolute; + top: -20rpx; + right: -20rpx; + z-index: 102; + width: 54rpx; + height: 54rpx; +} + +.publicPop-img { + width: 70%; + margin: -30rpx auto 0; +} + +.publicPop-text { + padding-bottom: 20rpx; + box-sizing: border-box; + font-weight: 600; + color: #e56653; + padding-top: 40rpx; +} + +.number { + font-size: 72rpx; + display: inline-block; + padding-right: 10rpx; +} + +.publicPop-text text { + font-size: 36rpx; + display: inline-block; + line-height: 86rpx; + vertical-align: bottom; +} + +.publicPop-tips { + position: absolute; + bottom: 0; + left: 0; + width: 100%; + background-color: #fdfae7; + color: #e6a950; + line-height: 80rpx; + font-weight: 600; + border-top: 2rpx solid #f6ede6; + border-radius: 0 0 30rpx 30rpx; +} + +.publicPop-tips image { + width: 54rpx; + height: 54rpx; + vertical-align: -14rpx; +} + +.publicPop-left { + width: 90rpx; + position: absolute; + top: 46%; + right: 2rpx; +} + +.publicPop-right { + transform: rotate(180deg); + left: 2rpx; +} \ No newline at end of file diff --git a/pages/stock/addSite/index.js b/pages/stock/addSite/index.js new file mode 100644 index 0000000..e906fcf --- /dev/null +++ b/pages/stock/addSite/index.js @@ -0,0 +1,183 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + name : '', // 姓名 + mobile : '', // 电话 + address : '', // 地址 + defaultVal: '', // 默认地址 + // 省份选择 + areasArr : [], + areaId : '', + areaIndex : 0, + + // 市级选择 + cityArr : [], + cityId : 0, + cityIndex : 0, + + // 区域选择 + regiArr : [], + regiId : 0, + regiIndex : 0, + + disabled : false + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + experience: options.experience + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + if(this.data.experience != false) { + this.setData({ + areaIndex: 18 + }) + } + + // 获取省市区列表 + this.createInfo(); + }, + + /** + * 省市区列表 + */ + createInfo() { + wx.$api.stock.create().then(res => { + let areas = res.data, + areaIndex = this.data.areaIndex + + this.setData({ + areasArr : areas, + areaId : areas[areaIndex].id, + + }) + this.citylist(areas[areaIndex].id) + }).catch(err => {}) + }, + + /** + * 所在省份-下拉 + */ + areasChange(e) { + let area = this.data.areasArr, + index = e.detail.value, + atcode = area[index].id + if (index != this.data.areaIndex) { + this.setData({ + areaIndex : index, + areaId : atcode + }) + // 获取市级列表 + this.citylist(atcode) + } + }, + + /** + * 市级列表 + */ + citylist(cityId) { + wx.$api.stock.create({ + parent_id: cityId + }).then(res=>{ + let cityArr = res.data + // 从体验官入口进入 默认为深圳 + if(this.data.experience) { + this.setData({ + cityId : cityArr[2].id, + cityIndex : 2, + cityArr : cityArr + }) + this.regilist(cityArr[2].id) + return + } + + this.setData({ + cityId : cityArr[0].id, + cityIndex : 0, + cityArr : cityArr + }) + + // 获取区级列表 + this.regilist(cityArr[0].id) + }) + }, + + /** + * 市级下拉筛选 + */ + cityDrop(e) { + let city = this.data.cityArr, + index = e.detail.value, + citycode = city[index].id + if (index != this.data.areaIndex) { + this.setData({ + cityIndex : index, + qcityId : citycode + }) + + // 获取市级列表 + this.regilist(citycode) + } + }, + + /** + * 区列表 + */ + regilist(areaId) { + wx.$api.stock.create({ + parent_id: areaId + }).then(res=>{ + this.setData({ + regiArr : res.data, + regiId : res.data[0].id, + regiIndex : 0 + }) + }) + }, + + /** + * 区下拉筛选 + */ + regiDrop(e) { + let newIndex = e.detail.value + this.setData({ + regiIndex : newIndex, + regiId : this.data.regiArr[newIndex].id + }) + }, + + // 提交表单 + siteform(e) { + let value = e.detail.value + let data = { + name : value.name, + mobile : value.mobile, + address : value.address, + province_id : this.data.areaId, + city_id : this.data.cityId, + district_id : this.data.regiId + } + wx.$api.stock.siteAdd(data).then(res => { + this.setData({ + disabled: true + }) + wx.navigateBack() + }).catch(err => {}) + } +}) \ No newline at end of file diff --git a/pages/stock/addSite/index.json b/pages/stock/addSite/index.json new file mode 100644 index 0000000..9b706f4 --- /dev/null +++ b/pages/stock/addSite/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "新增地址" +} \ No newline at end of file diff --git a/pages/stock/addSite/index.wxml b/pages/stock/addSite/index.wxml new file mode 100644 index 0000000..a043359 --- /dev/null +++ b/pages/stock/addSite/index.wxml @@ -0,0 +1,48 @@ +
+ + + + + + + + + + + + + {{ areasArr[areaIndex].name }} + + + + + + + + + {{ cityArr[cityIndex].name }} + + + + + + + + + {{ regiArr[regiIndex].name }} + + + + + + + + + + + + +
\ No newline at end of file diff --git a/pages/stock/addSite/index.wxss b/pages/stock/addSite/index.wxss new file mode 100644 index 0000000..784d196 --- /dev/null +++ b/pages/stock/addSite/index.wxss @@ -0,0 +1,79 @@ +.site-form { + background: white; + display: block; +} + +.site-input { + padding: 0 30rpx 0 200rpx; + position: relative; + line-height: 110rpx; + min-height: 110rpx; + border-bottom: 2rpx solid #f3f3f3; +} + +.site-input::before { + position: absolute; + bottom: 0; + left: 30rpx; + right: 0; + height: 1rpx; + content: ""; + background: #e4e6f2; +} + +.site-input:last-child::before { + display: none; +} + +.site-input label { + position: absolute; + left: 30rpx; + top: 0; +} + +.site-input input { + height: 110rpx; +} + +.site-input image { + width: 38rpx; + height: 38rpx; + position: absolute; + right: 20rpx; + top: calc(50% - 19rpx); +} + +.site-btn { + padding: 20rpx 30rpx; + margin-top: 100rpx; +} + +.site-btn button[size="mini"] { + width: 100%; + background: #1d37e2; + height: 88rpx; + line-height: 88rpx; + font-size: 30rpx; + color: white; + padding: 0; +} + +.site-btn button[disabled] { + background: #7789ff !important; + color: #fff !important; +} + +.site-switch { + font-size: 32rpx; + margin: 30rpx; + display: flex; + line-height: 40rpx; +} + +.site-switch text { + flex: 1; +} + +.site-switch-active { + color: #797979; +} \ No newline at end of file diff --git a/pages/stock/detailed/index.js b/pages/stock/detailed/index.js new file mode 100644 index 0000000..d09f62f --- /dev/null +++ b/pages/stock/detailed/index.js @@ -0,0 +1,87 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + stockData : '', //前置 + logsArr : [], // 提货列表数据 + page : {}, //下一页 + lodingStats : false, //加载状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取提货前置 + this.pickInfo(); + + // 获取账变记录 + this.logsList(); + }, + + /** + * 提货前置 + */ + pickInfo (){ + wx.$api.stock.pick().then(res => { + this.setData({ + stockData : res.data.stockData + }) + }).catch(err => {}) + }, + + /** + * 账变记录 + */ + logsList (page){ + wx.$api.stock.logs({ + page: page + }).then(res => { + let listArr = this.data.logsArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.data) + this.setData({ + logsArr : newData, + page : res.data.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + }).catch(err => {}) + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取账变记录 + this.logsList(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取账变记录 + this.logsList(pageNumber); + } + } +}) \ No newline at end of file diff --git a/pages/stock/detailed/index.json b/pages/stock/detailed/index.json new file mode 100644 index 0000000..c77ab60 --- /dev/null +++ b/pages/stock/detailed/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "库存明细" +} \ No newline at end of file diff --git a/pages/stock/detailed/index.wxml b/pages/stock/detailed/index.wxml new file mode 100644 index 0000000..c9a42eb --- /dev/null +++ b/pages/stock/detailed/index.wxml @@ -0,0 +1,44 @@ + + + + + 库存总量 + {{stockData.stock}} + + + 提货量 + {{stockData.hold}} + + + + + + 库存明细 + + + + + {{item.type}} + + + {{item.variable}} + + + + {{item.created_at}} + + + + + 加载中... + + + 没有更多了~ + + + + + + ~暂无数据哦~ + + \ No newline at end of file diff --git a/pages/stock/detailed/index.wxss b/pages/stock/detailed/index.wxss new file mode 100644 index 0000000..788ea3c --- /dev/null +++ b/pages/stock/detailed/index.wxss @@ -0,0 +1,107 @@ +/* 头部 */ +.top { + position: relative; + height: 200rpx; +} + +.top-img { + position: absolute; + width: 100%; + height: 100%; + left: 0; + top: 0; +} + +.top-back { + position: absolute; + padding: 45rpx 30rpx 0 90rpx; + box-sizing: border-box; + width: 100%; + height: 100%; + left: 0; + top: 0; + color: #FFFFFF; + display: flex; +} + +.top-item { + flex: 2; +} + +.item-name { + font-size: 28rpx; + margin-bottom: 10rpx; + opacity: .8; +} + +.item-number { + font-size:54rpx; +} + +.item-number text { + font-size: 26rpx; + padding-left: 10rpx; +} + +/* 列表 */ +.list { + padding: 30rpx; + box-sizing: border-box; +} + +.list-name { + color: #13234a; + font-weight: 600; + margin-bottom: 40rpx; + font-size: 36rpx; +} + +.item { + margin-bottom: 30rpx; + padding-bottom: 30rpx; + border-bottom: 2rpx solid #f3f3f3; +} + +.title { + display: flex; + margin-bottom: 20rpx; +} + +.name { + flex: 1; + font-weight: 600; + font-size: 30rpx; + display: flex; + line-height: 28rpx; +} + +.name image { + width: 28rpx; + height: 28rpx; + margin-right: 20rpx; +} + +.number { + font-weight: 600; + color: #175ad6; + line-height: 28rpx; +} +.reduce { + color: #ef5555; +} + +.time { + color: #676767; + font-size: 28rpx; +} + +.pages-no { + text-align: center; + padding: 120rpx 0 30rpx; + color: #9d9d9d; + font-size: 28rpx; +} + +.pages-no image { + width: 180rpx; +} \ No newline at end of file diff --git a/pages/stock/examine/index.js b/pages/stock/examine/index.js new file mode 100644 index 0000000..6130cdc --- /dev/null +++ b/pages/stock/examine/index.js @@ -0,0 +1,66 @@ +// pages/stock/examine/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/stock/examine/index.json b/pages/stock/examine/index.json new file mode 100644 index 0000000..d5796cd --- /dev/null +++ b/pages/stock/examine/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "等待审核" +} \ No newline at end of file diff --git a/pages/stock/examine/index.wxml b/pages/stock/examine/index.wxml new file mode 100644 index 0000000..4e19979 --- /dev/null +++ b/pages/stock/examine/index.wxml @@ -0,0 +1,9 @@ + + + + 审核中 + 预计审核时间:1个工作日 + 审核结果会微信消息提醒,请您耐心等待 + + 返回 + \ No newline at end of file diff --git a/pages/stock/examine/index.wxss b/pages/stock/examine/index.wxss new file mode 100644 index 0000000..8506aba --- /dev/null +++ b/pages/stock/examine/index.wxss @@ -0,0 +1,33 @@ +.examine { + padding: 240rpx 0 30rpx; + box-sizing: border-box; + text-align: center; +} + +.examine image { + width: 35%; + margin: 0 auto 30rpx; +} + +.title { + font-weight: 600; + font-size: 42rpx; + margin-bottom: 30rpx; +} + +.time { + color: #999999; + line-height: 50rpx; +} + +.return { + display: inline-block; + margin-top: 80rpx; + background-color: #1d37e2; + padding: 0 180rpx; + height: 90rpx; + line-height: 90rpx; + border-radius: 10rpx; + box-shadow: 0 3rpx 6rpx 4rpx rgba(6, 34, 214, .6); + color: #FFFFFF; +} \ No newline at end of file diff --git a/pages/stock/index/index.js b/pages/stock/index/index.js new file mode 100644 index 0000000..0d8da55 --- /dev/null +++ b/pages/stock/index/index.js @@ -0,0 +1,109 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + stockData: '', //数据 + address : '', //地址 + listArr : [], //提货列表数据 + avatar : '', //头像 + identity : '', //身份 + page : {}, //下一页 + lodingStats : false,//加载状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取用户信息 + this.userInfo(); + + // 获取提货前置 + this.pickInfo(); + + // 获取提货列表 + this.pickList(); + }, + + /** + * 用户信息 + */ + userInfo() { + wx.$api.user.userIndex().then(res => { + this.setData({ + avatar : res.data.avatar, + identity : res.data.identity + }) + }).catch(err => {}) + }, + + /** + * 提货前置 + */ + pickInfo (){ + wx.$api.stock.pick().then(res => { + this.setData({ + stockData : res.data.stockData, + address : res.data.address + }) + }).catch(err => {}) + }, + + /** + * 提货列表 + */ + pickList (page){ + wx.$api.stock.list({ + page: page + }).then(res => { + let listArr = this.data.listArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.data) + this.setData({ + listArr : newData, + page : res.data.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + + }).catch(err => {}) + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取提货列表 + this.pickList(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取提货列表 + this.pickList(pageNumber); + } + } +}) \ No newline at end of file diff --git a/pages/stock/index/index.json b/pages/stock/index/index.json new file mode 100644 index 0000000..539ef6d --- /dev/null +++ b/pages/stock/index/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "库存量" +} \ No newline at end of file diff --git a/pages/stock/index/index.wxml b/pages/stock/index/index.wxml new file mode 100644 index 0000000..25eff8b --- /dev/null +++ b/pages/stock/index/index.wxml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + 库存总数量(单位:箱) + + + {{stockData.residue}} + + + + + + + + {{stockData.hold}} + 已提数量 + + + + {{stockData.residue}} + 待提数量 + + + + 申请提货 + + + + 地址管理 + + + + + + + + + + 提货记录 + + + 查看全部 + + + + + + + + 提货量 + + + {{item.items[0].qty}}(箱) + + + + 申请时间 + {{item.created_at}} + + + 申请状态 + {{item.state}} + {{item.state}} + {{item.state}} + + + + + 加载中... + + + 没有更多了~ + + + + + + + ~抱歉,暂无内容~ + + \ No newline at end of file diff --git a/pages/stock/index/index.wxss b/pages/stock/index/index.wxss new file mode 100644 index 0000000..8df4325 --- /dev/null +++ b/pages/stock/index/index.wxss @@ -0,0 +1,261 @@ +/* 用户 */ +.user { + text-align: right; + box-sizing: border-box; + position: relative; + height: 150rpx; +} + +.user-order { + position: absolute; + left: 55rpx; + top: 30rpx; + background-color: #e9eaef; + width: 80rpx; + height: 80rpx; + text-align: center; + border-radius: 50%; + padding: 16rpx; + box-sizing: border-box; +} + +.user-order image { + width: 100%; + height: 100%; +} + +.user-head { + width: 80rpx; + height: 80rpx; + border-radius: 50%; + position: absolute; + right: 30rpx; + top: 30rpx; + border: 2rpx solid #efefef; +} + +.user-member { + position: absolute; + right: 80rpx; + top: 84rpx; + width: 30rpx; + height: 30rpx; + line-height: 26rpx; + text-align: center; + background-color: #1835c1; + border-radius: 50%; +} + +.user-member image { + width: 16rpx; + height: 16rpx; +} + +.stock-top { + padding: 0 30rpx 30rpx 60rpx; + box-sizing: border-box; +} + +.top-title { + color: #82828e; + margin-bottom: 20rpx; + display: flex; + line-height: 34rpx; + font-size: 32rpx; +} + +.top-title text { + flex: 1; +} + +.top-number { + font-size: 72rpx; + color: #333657; +} + +.top-number image { + width: 32rpx; + height: 32rpx; + margin-right: 10rpx; +} + +.stock-label { + padding-left: 60rpx; + box-sizing: border-box; + background: #ecf4f6; + padding-top: 40rpx; + height: 430rpx; +} + +.stock-cont { + background-color: #1d37e2; + border-radius: 60rpx 0 0 60rpx; + padding: 60rpx 30rpx 90rpx 90rpx; + box-sizing: border-box; + display: flex; + position: relative; +} + +.stock-item { + color: #FFFFFF; + flex: 2; +} + +.stock-icon { + width: 34rpx; + height: 34rpx; +} + +.stock-number { + font-size: 50rpx; + margin-bottom: 10rpx; + +} + +.stock-numbe text { + font-size: 28rpx; + padding-left: 10rpx; +} + +.stock-tips { + font-size: 28rpx; + color: #8999ff; +} + +.stock-btn { + position: absolute; + bottom: -40rpx; + right: 0; + display: flex; +} + +.btn { + background-color: #FFFFFF; + height: 80rpx; + line-height: 80rpx; + margin-right: 30rpx; + padding: 0 40rpx; + border-radius: 30rpx; +} + +.btn:first-child { + color: #FFFFFF; + background-color: #4d70fe; + box-shadow: 0 3rpx 6rpx 2rpx rgba(79, 99, 226, .6); +} + +.btn:last-child { + color: #8a5400; + background-color: #f9d093; + box-shadow: 0 3rpx 6rpx 2rpx rgba(255, 192, 92, .6); +} + +.btn text { + padding-right: 10rpx; +} + +.btn image { + width: 24rpx; + height: 24rpx; +} + +.record { + padding: 30rpx; + box-sizing: border-box; +} + +.title { + display: flex; +} + +.name { + flex: 1; + font-weight: 600; + display: flex; +} + +.name image { + width: 42rpx; + height: 42rpx; + margin-right: 10rpx; +} + +.more { + font-size: 30rpx; + color: #9d9d9d; + line-height: 42rpx; +} + +.more image { + width: 24rpx; + height: 24rpx; +} + +.list { + margin-top: 30rpx; +} + +.item { + border: 2rpx solid #f3f3f3; + padding: 30rpx 30rpx 20rpx; + box-sizing: border-box; + border-radius: 30rpx; + margin-bottom: 30rpx; +} + +.item-top { + display: flex; + margin-bottom: 20rpx; +} + +.item-name { + flex: 1; + font-weight: 600; +} + +.item-number { + color: #2487ff; + font-weight: 600; +} + +.item-number text { + font-size: 26rpx; + padding-left: 10rpx; + font-weight: normal; +} + +.item-label { + line-height: 60rpx; + display: flex; + font-size: 28rpx; + color: #9d9d9d; +} + +.item-left { + flex: 1; +} + +.item-state { + color: #eb504c; +} + +.item-state.green { + color: #03af03; +} + +.item-state.yellow { + color: #8a5400; +} + +/* 暂无内容 */ +.recommend-hint { + text-align: center; + color: #999; + padding: 100rpx 0; + font-size: 28rpx; +} + +.recommend-hint image { + width: 160rpx; + height: 160rpx; +} \ No newline at end of file diff --git a/pages/stock/list/index.js b/pages/stock/list/index.js new file mode 100644 index 0000000..b84e823 --- /dev/null +++ b/pages/stock/list/index.js @@ -0,0 +1,73 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + listArr : [], //提货列表数据 + page : {}, //下一页 + lodingStats : false,//加载状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取提货列表 + this.pickList(); + }, + + /** + * 提货列表 + */ + pickList (page){ + wx.$api.stock.list({ + page: page + }).then(res => { + let listArr = this.data.listArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.data) + this.setData({ + listArr : newData, + page : res.data.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + + }).catch(err => { }) + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取提货列表 + this.pickList(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取提货列表 + this.pickList(pageNumber); + } + } +}) \ No newline at end of file diff --git a/pages/stock/list/index.json b/pages/stock/list/index.json new file mode 100644 index 0000000..783d4c8 --- /dev/null +++ b/pages/stock/list/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "提货记录" +} \ No newline at end of file diff --git a/pages/stock/list/index.wxml b/pages/stock/list/index.wxml new file mode 100644 index 0000000..c6997b4 --- /dev/null +++ b/pages/stock/list/index.wxml @@ -0,0 +1,35 @@ + + + + + 提货量 + + + {{item.items[0].qty}}(箱) + + + + 申请时间 + {{item.created_at}} + + + 申请状态 + {{item.state}} + {{item.state}} + {{item.state}} + + + + + 加载中... + + + 没有更多了~ + + + + + + + ~抱歉,暂无内容~ + \ No newline at end of file diff --git a/pages/stock/list/index.wxss b/pages/stock/list/index.wxss new file mode 100644 index 0000000..735c499 --- /dev/null +++ b/pages/stock/list/index.wxss @@ -0,0 +1,69 @@ + +.list { + margin-top: 30rpx; +} + +.item { + border: 2rpx solid #f3f3f3; + padding: 30rpx 30rpx 20rpx; + box-sizing: border-box; + border-radius: 30rpx; + margin-bottom: 30rpx; +} + +.item-top { + display: flex; + margin-bottom: 20rpx; +} + +.item-name { + flex: 1; + font-weight: 600; +} + +.item-number { + color: #2487ff; + font-weight: 600; +} + +.item-number text { + font-size: 26rpx; + padding-left: 10rpx; + font-weight: normal; +} + +.item-label { + line-height: 60rpx; + display: flex; + font-size: 28rpx; + color: #9d9d9d; +} + +.item-left { + flex: 1; +} + +.item-state { + color: #eb504c; +} + +.item-state.green { + color: #03af03; +} + +.item-state.yellow { + color: #8a5400; +} + +/* 暂无内容 */ +.recommend-hint { + text-align: center; + color: #999; + padding: 100rpx 0; + font-size: 28rpx; +} + +.recommend-hint image { + width: 160rpx; + height: 160rpx; +} \ No newline at end of file diff --git a/pages/stock/site/index.js b/pages/stock/site/index.js new file mode 100644 index 0000000..560e766 --- /dev/null +++ b/pages/stock/site/index.js @@ -0,0 +1,91 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + Experience : '', //是否从体验官进入 + type : '', //类型 + listArr : [] //收货地址 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + console.log(options) + this.setData({ + type: options.type, + Experience: options.experience + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取地址列表 + this.listInfo(); + }, + + /** + * 地址列表 + */ + listInfo (){ + wx.$api.stock.siteList().then(res => { + this.setData({ + listArr: res.data + }) + }).catch(err => { }) + }, + + /** + * 删除地址 + */ + addressRemove(e){ + let newid = e.currentTarget.dataset.id + wx.showModal({ + title : '提示', + content : '是否删除地址', + success : res=> { + if (res.confirm) { + wx.showLoading({ + title: '删除中', + }) + wx.$api.stock.siteDel(newid).then(res=>{ + // 获取地址列表 + this.listInfo(); + wx.hideLoading() + }) + } + } + }) + }, + + /** + * 选择地址 + */ + selectAddress(e){ + let atAdds = this.data.listArr[e.currentTarget.dataset.index] + let pages = getCurrentPages(), + prepage = pages[pages.length-2] + + if(this.data.type == 'goodsAddress') { + prepage.setData({ + address: atAdds, + addressId: atAdds.address_id + }) + wx.navigateBack() + return + } + prepage.setData({ + address: atAdds + }) + wx.navigateBack() + } +}) \ No newline at end of file diff --git a/pages/stock/site/index.json b/pages/stock/site/index.json new file mode 100644 index 0000000..f30802c --- /dev/null +++ b/pages/stock/site/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "地址管理" +} \ No newline at end of file diff --git a/pages/stock/site/index.wxml b/pages/stock/site/index.wxml new file mode 100644 index 0000000..48593b8 --- /dev/null +++ b/pages/stock/site/index.wxml @@ -0,0 +1,27 @@ + + + + 默认{{item.name}}{{item.mobile}} + + + {{item.full_address}} + + + + 删除 + + + + + 选择地址 + + + + + + + 暂无地址 + + + 添加地址 + \ No newline at end of file diff --git a/pages/stock/site/index.wxss b/pages/stock/site/index.wxss new file mode 100644 index 0000000..863377c --- /dev/null +++ b/pages/stock/site/index.wxss @@ -0,0 +1,123 @@ +page{ + background-color: #f4f4f4; +} + +.list { + border-bottom: 60px solid transparent; + padding: 30rpx; + box-sizing: border-box; +} + +.address { + background-color: #FFFFFF; + margin-bottom: 30rpx; + padding: 30rpx; + box-sizing: border-box; + border-radius: 30rpx; +} + +.address:last-child { + margin-bottom: 0; +} + +.address-name { + display: flex; + font-weight: 600; +} + +.address-name text { + font-weight: normal; + font-size: 34rpx; + flex: 1; + display: block; +} + +.defaultEdit { + font-size: 26rpx; + height: 36rpx; + line-height: 36rpx; + border: 2rpx solid #eb504c; + color: #eb504c; + padding: 0 10rpx; + margin-right: 20rpx; + margin-top: 4rpx; + border-radius: 10rpx; +} + +.address-info { + margin: 20rpx 0; + font-size: 30rpx; + color: #9d9d9d; +} + +.address-tool { + border-top: 2rpx solid #f3f3f3; + padding-top: 20rpx; + font-size: 28rpx; + text-align: right; +} + +.address-tool-btn { + display: inline-block; + color: #666666; + margin-left: 60rpx; +} + +.address-tool-btn image { + width: 28rpx; + height: 28rpx; + vertical-align: -2rpx; + margin-right: 10rpx; +} + +.select { + text-align: center; + border: 2rpx solid #e64248; + color: #e64248; + font-size: 28rpx; + margin-top: 30rpx; + line-height: 72rpx; + font-weight: 600; + border-radius: 10rpx; +} + +.footer { + width: 100%; + height: 60px; + background-color: #FFFFFF; + position: fixed; + left: 0; + bottom: 0; + z-index: 9; + padding: 8px; + box-sizing: border-box; +} + +.btn { + line-height: 44px; + background-color: #1d37e2; + height: 100%; + text-align: center; + color: #FFFFFF; + border-radius: 10rpx; +} + +/* 无列表 */ +.edit-no { + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-box-pack: center; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + z-index: 1; + text-align: center; + color: #9d9d9d; +} + +.edit-no image { + width: 240rpx; + height: 240rpx; +} \ No newline at end of file diff --git a/pages/stock/take/index.js b/pages/stock/take/index.js new file mode 100644 index 0000000..488232d --- /dev/null +++ b/pages/stock/take/index.js @@ -0,0 +1,134 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + num : 1, //数量默认1 + address : '', //地址 + stockData : '', //数据 + disabled : false + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + // 获取提货前置 + this.pickInfo(); + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() {}, + + /** + * 提货前置 + */ + pickInfo (){ + wx.$api.stock.pick().then(res => { + console.log(res.data.dientity.is_experience) + this.setData({ + address : res.data.address, + stockData : res.data.stockData, + isExperience : res.data.dientity.is_experience + }) + }).catch(err => {}) + }, + + /** + * 商品数量加减 + */ + goodsNumber(e){ + let num = this.data.num, + val = e.currentTarget.dataset.type + if (val == 'plus'){ + num ++; + if(num > this.data.stockData.stock ){ + wx.showToast({ + title: '商品数量不能大于库存量', + icon: 'none' + }); + num = this.data.stockData.stock + } + + }else{ + if (num > 1){ + num --; + }else{ + wx.showToast({ + title : '商品数量不能小于1', + icon : 'none' + }) + } + this.setData({ + num: num + }) + } + this.setData({ + num: num + }) + }, + + /** + * 输入商品数量 + */ + goodsNumberInput(e) { + let goodsNum = e.detail.value; + if (goodsNum > 0) { + if(goodsNum > this.data.stockData.stock ){ + wx.showToast({ + title: '商品数量不能大于库存量', + icon: 'none' + }); + this.setData({ + num: this.data.stockData.stock + }) + return + } + this.setData({ + num: goodsNum + }) + } else { + wx.showToast({ + title: '商品数量不能小于1', + icon: 'none' + }); + this.setData({ + num: 1 + }) + } + }, + + /** + * 申请提货 + */ + stockForm(e) { + let newQty = this.data.num + if(this.data.isExperience) { + newQty = this.data.stockData.stock + } + let data = { + remark : e.detail.value.remark, + qty : newQty, + address_id : this.data.address.address_id + } + + wx.$api.stock.pickTake(data).then(res => { + this.setData({ + disabled: true + }) + + // 跳到审核页面 + wx.redirectTo({ + url: '../examine/index' + }) + }).catch(err => {}) + } +}) \ No newline at end of file diff --git a/pages/stock/take/index.json b/pages/stock/take/index.json new file mode 100644 index 0000000..f0b269f --- /dev/null +++ b/pages/stock/take/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "申请提现" +} \ No newline at end of file diff --git a/pages/stock/take/index.wxml b/pages/stock/take/index.wxml new file mode 100644 index 0000000..1033829 --- /dev/null +++ b/pages/stock/take/index.wxml @@ -0,0 +1,69 @@ +
+ + + + + 温馨提示 + + 收货地址只限制广东省深圳市地区 + + + + + + + 提货数量 + + + {{stockData.stock}} + + + + + 提货数量 + + + - + + + + + + + + 备注信息 + +