commit 32cc588ae7b3f6d7f880bf53592ce40bd15619d7 Author: zhangjing Date: Tue Aug 15 17:18:15 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/.gitignore b/.gitignore new file mode 100644 index 0000000..a70bc78 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/unpackage +/node_modules diff --git a/README.MD b/README.MD new file mode 100644 index 0000000..d20c0a6 --- /dev/null +++ b/README.MD @@ -0,0 +1 @@ +# 水感应用户端小程序 diff --git a/api/err.js b/api/err.js new file mode 100644 index 0000000..5fab8db --- /dev/null +++ b/api/err.js @@ -0,0 +1,49 @@ + +/** + * 处理错误信息 + * @property {Object} errInfo + */ + +const errInfo = (obj) =>{ + if(obj.status_code == 401){ + // 清理客户端登录缓存 + // wx.removeStorageSync("") + wx.removeStorage({ + key : "token", + success: () => { + wx.navigateTo({ + 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..1c002a3 --- /dev/null +++ b/api/index.js @@ -0,0 +1,35 @@ +/* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ +*/ + +// 授权登录 +import auth from "./interfaces/auth" + +// 图片上传 +import bank from "./interfaces/bank" + +// 图片上传 +import file from "./interfaces/file" + +// 产品 +import mall from "./interfaces/mall" + +// 订单 +import order from "./interfaces/order" + +// 地址管理 +import site from "./interfaces/site" + +// 个人中心 +import user from "./interfaces/user" + +export default { + auth, + bank, + file, + mall, + order, + site, + user +} \ No newline at end of file diff --git a/api/interfaces/auth.js b/api/interfaces/auth.js new file mode 100644 index 0000000..bf93ad1 --- /dev/null +++ b/api/interfaces/auth.js @@ -0,0 +1,32 @@ +/* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ +*/ + +import { req } from "../request" +//登录 +const Login = data => req({ + url: "user/auth/login", + method: "POST", + data: data +}) + +//注册 +const register = data => req({ + url: "user/auth/register", + method: "POST", + data: data +}) + +//获取验证码 +const getSms = data => req({ + url: "user/auth/verify", + method: "POST", + data: data +}) + +export default ({ + Login, + register, + getSms +}) \ No newline at end of file diff --git a/api/interfaces/bank.js b/api/interfaces/bank.js new file mode 100644 index 0000000..4c08911 --- /dev/null +++ b/api/interfaces/bank.js @@ -0,0 +1,74 @@ +/* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ +*/ + +import { req } from "../request" + +//我的提现 +const Index = data => req({ + url: "withdraws/index", + data: data +}) + +//我的提现 +const Indexcreate = data => req({ + url: "withdraws/index/create", + data: data +}) + +//提现-提交 +const Indexpost = data => req({ + url: "withdraws/index", + method: "POST", + data: data +}) + +//我的银行账户 +const Cards = data => req({ + url: "withdraws/accounts", + data: data +}) + +//添加账户前置 +const Creates = () => req({ + url: "withdraws/accounts/create" +}) + +//添加账户 +const cardBind = data => req({ + url: "withdraws/accounts", + method: "POST", + data: data +}) + +//编辑前置 +const cardEdit = (bank_account_id, data) => req({ + url: "withdraws/accounts/" + bank_account_id + "/edit", + data: data +}) + +//编辑-提交 +const Confirm = (bank_account_id, data) => req({ + url: "withdraws/accounts/" + bank_account_id, + method: "PUT", + data: data +}) + +//删除 +const cardsDel = (bank_account_id) => req({ + url: "withdraws/accounts/" + bank_account_id, + method: "DELETE" +}) + +export default ({ + Index, + Indexcreate, + Indexpost, + Cards, + Creates, + cardBind, + cardEdit, + Confirm, + cardsDel, +}) \ No newline at end of file diff --git a/api/interfaces/file.js b/api/interfaces/file.js new file mode 100644 index 0000000..0f903f6 --- /dev/null +++ b/api/interfaces/file.js @@ -0,0 +1,17 @@ +/* + * 图图片上传公用接口 +*/ +import { upload } from "../request" + +//图上传 +const uploadImg = (imgPaht, data) => upload({ + url: "storage/upload", + method: "POST", + key: "upload", + path: imgPaht, + data: data +}) + +export default ({ + uploadImg +}) \ No newline at end of file diff --git a/api/interfaces/mall.js b/api/interfaces/mall.js new file mode 100644 index 0000000..87392be --- /dev/null +++ b/api/interfaces/mall.js @@ -0,0 +1,62 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ +*/ + +import { req } from "../request" + +//Banner图 +const Banner = () => req({ + url: "mall/banners" +}) + +//商品分类 +const Categorie = data => req({ + url: "mall/categories", + data: data +}) + +//商品列表 +const Goods = data => req({ + url: "mall/goods", + data: data +}) + +//商品详情 +const goodsSee = (goods) => req({ + url: "mall/goods/" + goods +}) + +//商品下单 +const place = data => req({ + url: "mall/buy/goods", + data: data +}) + +//商品确认下单 +const placeTrue = data => req({ + url: "mall/buy/goods", + method: "POST", + data: data +}) + +//公告列表 +const articles = () => req({ + url: "cms/articles" +}) + +//公告详情 +const articlesSee = (article_id) => req({ + url: "cms/articles/" + article_id +}) + +export default ({ + Banner, + Categorie, + Goods, + goodsSee, + place, + placeTrue, + articles, + articlesSee +}) \ No newline at end of file diff --git a/api/interfaces/order.js b/api/interfaces/order.js new file mode 100644 index 0000000..073ba0f --- /dev/null +++ b/api/interfaces/order.js @@ -0,0 +1,51 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ +*/ + +import { req } from "../request" + +// 订单首页 +const list = data => req({ + url : "mall/orders", + data: data +}) + +// 订单详情 +const goodsDet = (order) => req({ + url : "mall/orders/" + order +}) + +// 订单取消 +const goodsCancel = (order) => req({ + url : "mall/orders/" + order + "/cancel", + method: "PUT" +}) + +// 订单删除 +const goodsDel = (order) => req({ + url : "mall/orders/" + order, + method: "DELETE" +}) + +// 订单签收 +const goodsSign = (order) => req({ + url : "mall/orders/" + order + "/sign", + method: "PUT" +}) + +// 快递100-免费 +const kuaiDi = (order, data) => req({ + url : "mall/orders/" + order + "/logistic", + data: data +}) + + +export default ({ + list, + goodsDet, + goodsCancel, + goodsDel, + goodsSign, + kuaiDi +}) \ No newline at end of file diff --git a/api/interfaces/site.js b/api/interfaces/site.js new file mode 100644 index 0000000..9eabc68 --- /dev/null +++ b/api/interfaces/site.js @@ -0,0 +1,58 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ +*/ + +import { req } from "../request" + +// 收获地址(列表) +const siteList = () => req({ + url: "mall/addresses" +}) + +// 省市区-获取 +const create = data => req({ + url: "mall/addresses/create", + data: data +}) + +// 新增地址 +const siteAdd = data => req({ + url: "mall/addresses", + data: data, + method: 'POST' +}) + +// 地址详细 +const siteSee = (address) => req({ + url: "mall/addresses/" + address +}) + +// 编辑地址 +const siteEdit = (address, data) => req({ + url: "mall/addresses/" + address, + data: data, + method: 'PUT' +}) + +// 删除地址 +const siteDel = (address) => req({ + url: "mall/addresses/" + address, + method: 'DELETE' +}) + +// 设置默认地址 +const siteDefault = (address) => req({ + url: "mall/addresses/" + address + "/default", + method: 'POST' +}) + +export default ({ + siteList, + create, + siteAdd, + siteSee, + siteEdit, + siteDel, + siteDefault +}) \ No newline at end of file diff --git a/api/interfaces/user.js b/api/interfaces/user.js new file mode 100644 index 0000000..16e46c7 --- /dev/null +++ b/api/interfaces/user.js @@ -0,0 +1,48 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ +*/ + +import { req } from "../request" +//用户信息 +const userIndex = () => req({ + url: "user" +}) + +// 用户设置 +const userSetup = () => req({ + url: "user/setting" +}) + +//修改用户信息 +const setting = (key, data) => req({ + url: "user/setting/" + key, + method: "PUT", + data: data +}) + +//我的余额首页 +const account = () => req({ + url: "user/account/index" +}) + +// 小程序码 +const miniShare = data => req({ + url: "user/mini_share", + data: data +}) + +// 我的团队 +const teamList = data => req({ + url: "user/teams/lists", + data: data +}) + +export default ({ + userIndex, + userSetup, + setting, + account, + miniShare, + teamList +}) \ No newline at end of file diff --git a/api/request.js b/api/request.js new file mode 100644 index 0000000..aec6fc9 --- /dev/null +++ b/api/request.js @@ -0,0 +1,140 @@ +/* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ +*/ + +import {errInfo} from './err' +import {updToken} from './updateToken' + +// 请求方式配置 +// //正式地址 +// https://api.xhtest.douhuofalv.com/api/ //测试地址 +// wx989712ad2d06a40b 测试appid 三猿 +// wx7662853c6f7f46b4 正式appid +// 正式环境 +const api = "https://api.xhtest.douhuofalv.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", + "channel" : "client", + "Authorization" : wx.getStorageSync("token") || "" + } + if(!isToken){ + obj.header.Authorization = '' + } + wx.request({ + timeout: '13000', + 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 + }) + } + reject(res) + errInfo(res.data) + } + }, + fail: err => { + wx.showToast({ + title : (err.errMsg).indexOf('108') > 0 ? "网络错误,请检查您的网络环境" : 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 +} \ No newline at end of file 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..aca5e80 --- /dev/null +++ b/app.js @@ -0,0 +1,53 @@ +/* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +import api from "api/index" +App({ + onLaunch(e) { + // 检查用户登录状态 + 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.barHeight = res.statusBarHeight + } + }) + + // 挂载api + wx.$api = api + }, + globalData: { + isUser : false, + barHeight : '' + } +}) \ No newline at end of file diff --git a/app.json b/app.json new file mode 100644 index 0000000..8ac9655 --- /dev/null +++ b/app.json @@ -0,0 +1,62 @@ +{ + "pages": [ + "pages/mall/index", + "pages/classify/index", + "pages/face/index", + "pages/user/index", + "pages/login/index", + "pages/register/index", + "pages/mall/details/details", + "pages/mall/confirm/confirm", + "pages/pay/index", + "pages/site/index", + "pages/site/add/add", + "pages/site/edit/edit", + "pages/user/setup/setup", + "pages/user/about/about", + "pages/mall/goods/goods", + "pages/order/index", + "pages/order/details/details", + "pages/order/logistic/logistic", + "pages/search/search", + "pages/mall/article/article", + "pages/account/index", + "pages/user/team/index", + "pages/user/code/code", + "pages/bankCard/index", + "pages/bankCard/bankAdd/bankAdd" + ], + "window": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#fff", + "navigationBarTitleText": "绚火健康", + "navigationBarTextStyle": "black" + }, + "tabBar": { + "list": [ + { + "pagePath": "pages/mall/index", + "text": "商城", + "iconPath": "/static/tabBarIcon/tabBar_00.png", + "selectedIconPath": "/static/tabBarIcon/tabBar_selected_00.png" + }, + { + "pagePath": "pages/classify/index", + "text": "分类", + "iconPath": "/static/tabBarIcon/tabBar_01.png", + "selectedIconPath": "/static/tabBarIcon/tabBar_selected_01.png" + }, + { + "pagePath": "pages/user/index", + "text": "我的", + "iconPath": "/static/tabBarIcon/tabBar_03.png", + "selectedIconPath": "/static/tabBarIcon/tabBar_selected_03.png" + } + ], + "color": "#999999", + "selectedColor": "#da2b54", + "borderStyle": "white" + }, + "style": "v2", + "sitemapLocation": "sitemap.json" +} \ No newline at end of file diff --git a/app.wxss b/app.wxss new file mode 100644 index 0000000..d97b6a0 --- /dev/null +++ b/app.wxss @@ -0,0 +1,70 @@ +page { + font-size: 30rpx; +} + +/* +* 文字截取 +*/ + +.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; +} + +/* + * 上拉加载 + */ +.pagesLoding{ + width: 100%; + text-align: center; + color: gray; + line-height: 90rpx; + font-size: 28rpx; +} + +.pagesLoding-icon{ + width: 32rpx; + height: 32rpx; + vertical-align: middle; + margin-right: 10rpx; + margin-bottom: 6rpx; +} + +.pages-hint { + width: 100%; + text-align: center; + color: #747788; + font-size: 28rpx; + background: white; +} + +.pages-hint image { + width: 220rpx; + height: 220rpx; +} + +/* +* 水平居中 +*/ + +.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; +} \ No newline at end of file diff --git a/pages/account/index.js b/pages/account/index.js new file mode 100644 index 0000000..6d125a2 --- /dev/null +++ b/pages/account/index.js @@ -0,0 +1,78 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + logsArr : [], //列表数据 + score : '', //数据 + page : {}, //分页信息 + lodingStats : false, //加载状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取账户信息 + this.accountInfo() + }, + + /** + * 获取账户信息 + */ + accountInfo(page) { + wx.$api.user.account({ + page: page + }).then(res => { + console.log(res.data) + let listArr = this.data.logsArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.logs.data) + this.setData({ + score : res.data, + logsArr : newData, + page : res.data.logs.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/index.json b/pages/account/index.json new file mode 100644 index 0000000..0e8f4b6 --- /dev/null +++ b/pages/account/index.json @@ -0,0 +1,6 @@ +{ + "usingComponents": {}, + "navigationBarBackgroundColor": "#dc3159", + "navigationBarTextStyle": "white", + "navigationBarTitleText": "我的账户" +} \ No newline at end of file diff --git a/pages/account/index.wxml b/pages/account/index.wxml new file mode 100644 index 0000000..1d97430 --- /dev/null +++ b/pages/account/index.wxml @@ -0,0 +1,54 @@ + + + 账户余额(元) + + {{score.balance}} + + 提现 + + + + + + 待发放(元) + {{score.frozen}} + + + 总收入(元) + {{score.all_in}} + + + + + + + 收益明细 + + + + + + 当月贡献发放 + + + 2023-05-22 + + + + +100 + + + + + 加载中... + + + 没有更多了~ + + + + + + 暂无数据 + + \ No newline at end of file diff --git a/pages/account/index.wxss b/pages/account/index.wxss new file mode 100644 index 0000000..d8b7ad7 --- /dev/null +++ b/pages/account/index.wxss @@ -0,0 +1,126 @@ +page { + background-color: #f6f6f6; +} + +.top { + background-image: linear-gradient(to bottom, #dc3159, #f46284); + color: #ffffff; + padding: 40rpx 40rpx 120rpx; + box-sizing: border-box; + display: flex; +} + +.topSee { + flex: 1; +} + +.topSee-name { + display: flex; + line-height: 40rpx; +} + +.topSee-name image { + width: 34rpx; + margin: 5rpx 20rpx; + filter: grayscale(100%); + -webkit-filter: grayscale(100%); + filter: brightness(0%) invert(100%); + -webkit-filter: brightness(0%) invert(100%); +} + +.topSee-number { + font-size: 60rpx; + margin-top: 20rpx; + letter-spacing: 2rpx; +} + +.topBtn { + background-color: #ffffff; + display: inline-block; + color: #da2b54; + padding: 0 50rpx; + border-radius: 80rpx; + height: 68rpx; + line-height: 68rpx; + margin-top: 40rpx; +} + +.content { + padding: 0 30rpx; + box-sizing: border-box; + margin-top: -70rpx; +} + +.tab { + background-color: #ffffff; + border-radius: 20rpx; + padding: 40rpx 10rpx; + box-sizing: border-box; + display: flex; +} + +.tab-item { + text-align: center; + flex: 2; +} + +.tab-number { + font-size: 44rpx; + margin-top: 20rpx; +} + +.listTitle { + padding: 30rpx 30rpx 0; + font-weight: 600; + box-sizing: border-box; + font-size: 32rpx; +} + +.list { + padding: 30rpx; + box-sizing: border-box; +} + +.list-item { + background-color: #fff; + border-radius: 20rpx; + margin-bottom: 30rpx; + padding: 30rpx; + box-sizing: border-box; + display: flex; +} + +.item-top { + flex: 1; +} + +.item-name { + font-size: 30rpx; +} + +.item-number { + color: #da2b54; + font-weight: 600; + font-size: 38rpx; + line-height: 90rpx; +} + +.item-time { + color: #999999; + font-size: 28rpx; + margin-top: 15rpx; +} + +/* 暂无数据 */ +.pages-no { + background-color: #fff; + margin-top: 30rpx; + text-align: center; + padding: 120rpx 0; + color: #6d6d6d; + font-size: 28rpx; +} + +.pages-no image { + width: 180rpx; +} \ No newline at end of file diff --git a/pages/bankCard/bankAdd/bankAdd.js b/pages/bankCard/bankAdd/bankAdd.js new file mode 100644 index 0000000..279ba76 --- /dev/null +++ b/pages/bankCard/bankAdd/bankAdd.js @@ -0,0 +1,115 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + bankId : '', // 银行id + type : '', // 类型 + bankData : '', // 银行卡编辑 + bankArr : [], // 银行列表 + bankIndex : 0, // 银行列表 index + disabled : false// 提交按钮 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + type : options.type, + bankId: options.id + }) + + if(options.type == 'Compile') { + // 获取银行编辑信息 + this.bankEdit(); + } + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取银行列表 + this.bankInfo(); + }, + + /** + * 银行编辑信息 + */ + bankEdit() { + wx.$api.bank.cardEdit(this.data.bankId).then(res => { + let bankValue = res.data.banks.findIndex(val=> val.id == res.data.info.bank.id) + this.setData({ + bankData : res.data.info, + bankIndex: bankValue + }) + }).catch(err => { }) + }, + + /** + * 银行机构列表 + */ + bankInfo() { + wx.$api.bank.Creates().then(res => { + this.setData({ + bankArr: res.data.banks + }) + }).catch(err => { }) + }, + + /** + * 选择银行index + */ + bankChange(e) { + this.setData({ + bankIndex: e.detail.value + }) + }, + + /** + * 表单提交 + */ + siteform(val) { + let value = val.detail.value + console.log(value) + let data = { + name : value.name, + mobile : value.mobile, + no : value.no, + branch_name : value.branch_name, + bank_id : this.data.bankArr[this.data.bankIndex].id + } + this.setData({ + disabled: true + }) + + // 入口为编辑 + if(this.data.type == 'Compile') { + wx.$api.bank.Confirm(this.data.bankId, data).then(res => { + wx.navigateBack() + }).catch(() =>{ + this.setData({ + disabled: false + }) + }) + return + } + + // 新增 + wx.$api.bank.cardBind(data).then(res => { + wx.navigateBack() + }).catch(() =>{ + this.setData({ + disabled: false + }) + }) + } +}) \ No newline at end of file diff --git a/pages/bankCard/bankAdd/bankAdd.json b/pages/bankCard/bankAdd/bankAdd.json new file mode 100644 index 0000000..e2d770d --- /dev/null +++ b/pages/bankCard/bankAdd/bankAdd.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "绑定银行卡" +} \ No newline at end of file diff --git a/pages/bankCard/bankAdd/bankAdd.wxml b/pages/bankCard/bankAdd/bankAdd.wxml new file mode 100644 index 0000000..efda8f9 --- /dev/null +++ b/pages/bankCard/bankAdd/bankAdd.wxml @@ -0,0 +1,34 @@ + +
+ + + + + + {{bankArr[bankIndex].name}} + + + + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/pages/bankCard/bankAdd/bankAdd.wxss b/pages/bankCard/bankAdd/bankAdd.wxss new file mode 100644 index 0000000..612e80e --- /dev/null +++ b/pages/bankCard/bankAdd/bankAdd.wxss @@ -0,0 +1,137 @@ +.site-form { + margin: 20rpx; + display: block; + overflow: hidden; +} + +.site-btn { + margin: 40rpx 0; +} + +.site-input { + padding: 0 30rpx 0 280rpx; + position: relative; + line-height: 100rpx; + min-height: 100rpx; +} + +.site-input label { + position: absolute; + left: 30rpx; + top: 0; +} + +.site-input input { + height: 100rpx; +} + +.site-input::before { + position: absolute; + bottom: 0; + left: 30rpx; + right: 0; + height: 1rpx; + content: ""; + background: #e4e6f2; +} + +.site-input:last-child::before { + display: none; +} + +.tui-picker-detail { + width: 33%; +} + +.site-btn button[size="mini"] { + width: 100%; + background: #da2b54; + height: 90rpx; + line-height: 90rpx; + font-size: 30rpx; + color: white; + padding: 0; +} + +.site-btn button[disabled] { + opacity: .6; +} + +/* pickerView */ + +.pickerView-back { + background: rgba(0, 0, 0, .3); + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + display: none; +} + +.pickerView-back.active { + display: block; +} + +.pickerView-layer { + position: fixed; + bottom: -571rpx; + left: 0; + width: 100%; + background: white; + transition: all .3s; +} + +.pickerView-layer.active { + bottom: 0; +} + +.pickerView-btn { + line-height: 90rpx; + font-size: 30rpx; + padding: 0 30rpx; + display: flex; + justify-content: space-between; +} + +.pickerView { + height: 480rpx; + padding: 0 10rpx; +} + +.pickerView-name { + line-height: 80rpx; + padding: 0 20rpx; + text-align: center; +} + +.pickerView-mask { + border-top: solid 1rpx #e4e6f2; +} + +.pickerView-indicator { + height: 80rpx; +} + +.pickerView-determine { + color: #3ec28e; +} + +.pickerView-cancel { + color: #747788; +} + + +.site-input image { + width: 38rpx; + height: 38rpx; + position: absolute; + right: 20rpx; + top: calc(50% - 19rpx); +} + +.site-switch { + position: absolute; + right: 0; + top: 0; +} \ No newline at end of file diff --git a/pages/bankCard/index.js b/pages/bankCard/index.js new file mode 100644 index 0000000..cdf754e --- /dev/null +++ b/pages/bankCard/index.js @@ -0,0 +1,100 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + /** + * 页面的初始数据 + */ + data: { + bankArr : [], //列表数据 + page : {}, //分页信息 + lodingStats : false, //加载状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取银行卡列表 + this.bankInfo(); + }, + + /** + * 银行卡列表 + */ + bankInfo (page) { + wx.$api.bank.Cards({ + page: page + }).then(res=>{ + let listArr = this.data.bankArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.data) + this.setData({ + bankArr : newData, + page : res.data.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + }) + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取银行卡列表 + this.bankInfo(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取银行卡列表 + this.bankInfo(pageNumber); + } + }, + + /** + * 删除地址 + */ + bankRemove(e){ + let id = e.target.dataset.id, + index = e.target.dataset.index, + list = this.data.bankArr + + list.splice(index,1) + + wx.showModal({ + title : '提示', + content : '是否删除银行卡', + success : res=> { + if (res.confirm) { + wx.showLoading({ + title: '删除中', + }) + wx.$api.bank.cardsDel(id).then(res=>{ + this.setData({ + bankArr: list + }) + wx.hideLoading() + }) + } + } + }) + }, +}) \ No newline at end of file diff --git a/pages/bankCard/index.json b/pages/bankCard/index.json new file mode 100644 index 0000000..35177e7 --- /dev/null +++ b/pages/bankCard/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "银行账户" +} \ No newline at end of file diff --git a/pages/bankCard/index.wxml b/pages/bankCard/index.wxml new file mode 100644 index 0000000..7f2bdcf --- /dev/null +++ b/pages/bankCard/index.wxml @@ -0,0 +1,41 @@ + + + + + {{item.bank.name}} + + + + 支行名称{{item.branch_name}} + + + 银行卡号{{item.no}} + + + 收款人姓名{{item.name}} + + + 收款人手机号{{item.mobile}} + + + + + 选择地址 + + + 编辑账户 + 删除账户 + + + + + + + + 还未添加银行卡 + + + + + 添加银行卡 + \ No newline at end of file diff --git a/pages/bankCard/index.wxss b/pages/bankCard/index.wxss new file mode 100644 index 0000000..14c9638 --- /dev/null +++ b/pages/bankCard/index.wxss @@ -0,0 +1,166 @@ +page { + background: #f5f5f5; +} + +.address { + border-bottom: 120rpx solid transparent; + margin: 20rpx; +} + +.address-li { + margin-bottom: 20rpx; + background-color: #ffffff; + border-radius: 20rpx; +} + +.top { + position: relative; + border-bottom: 2rpx solid #ececec; + padding: 20rpx 20rpx 15rpx; + box-sizing: border-box; +} + +.top-logo { + width: 80rpx; + height: 80rpx; + border-radius: 50%; +} + +.top-name { + position: absolute; + left: 0; + top: 0; + width: 100%; + padding: 20rpx 20rpx 20rpx 120rpx; + box-sizing: border-box; + line-height: 80rpx; + font-weight: 600; + font-size: 32rpx; +} + +.cont { + padding: 30rpx; + box-sizing: border-box; +} + +.address-title { + display: flex; + font-size: 28rpx; + line-height: 80rpx; + background-color: #f9fbfc; + margin-bottom: 30rpx; + padding: 0 30rpx; + box-sizing: border-box; + border-radius: 10rpx; +} + +.address-title text { + display: inline-block; + width: 200rpx; + color: #aaaaaa; +} + +.address-title:last-child { + margin-bottom: 0; +} + +.address-nmae, +.address-tips { + flex: 1; +} + +.address-text { + font-size: 28rpx; + margin: 20rpx 0; +} + +.address-tool { + padding: 30rpx; + box-sizing: border-box; + font-size: 28rpx; + overflow: hidden; + border-top: 2rpx solid #ececec; +} + +.address-edit { + margin-left: 30rpx; + display: inline-block; + background-color: #ff9b26; + border: 2rpx solid #ff9b26; + color: #ffffff; + line-height: 58rpx; + padding: 0 30rpx; + border-radius: 10rpx; + font-size: 28rpx; +} + +.address-edit-border { + color: #ff9b26; + background-color: #ffffff; +} + +.address-edit image { + width: 32rpx; + height: 32rpx; + margin: 2rpx 10rpx 0 0; +} + + +.address-tool-btn { + height: 46rpx; + line-height: 44rpx; + border-radius: 6rpx; +} + +.address-tool-btn.active{ + color: #f57e32; +} + +.address-tool.active::after { + display: none; +} + +.address-tool-btn.yellow { + color: #f57e32; +} + +.address-tool-btn image { + width: 34rpx; + height: 34rpx; + margin-right: 10rpx; + vertical-align: -6rpx; +} + +.address-tool.active { + padding-top: 0; +} + +.address-icon { + float: right; +} + +/* footer */ + +.address-footer { + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding-left: 30rpx; + padding-right: 30rpx; + background: white; + z-index: 9; + height: 120rpx; +} + +.address-footer navigator { + width: 100%; + line-height: 90rpx; + height: 90rpx; + margin: 15rpx 0; + text-align: center; + background: #e92152; + font-size: 30rpx; + color: white; + border-radius: 10rpx +} \ No newline at end of file diff --git a/pages/classify/index.js b/pages/classify/index.js new file mode 100644 index 0000000..c802175 --- /dev/null +++ b/pages/classify/index.js @@ -0,0 +1,53 @@ +/* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ +*/ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + parentId : '', + categorieArr : [], + categorieindex : 0 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取商品分类 + this.categorieInfo(); + }, + + /** + * 商品分类信息 + */ + categorieInfo() { + wx.$api.mall.Categorie({ + parent_id: this.data.parentId + }).then(res => { + this.setData({ + categorieArr: res.data + }) + }).catch(err =>{ + + }) + }, + + // 一级分类 + categorieTap(e) { + this.setData({ + categorieindex: e.currentTarget.dataset.index + }) + } +}) \ No newline at end of file diff --git a/pages/classify/index.json b/pages/classify/index.json new file mode 100644 index 0000000..0221b05 --- /dev/null +++ b/pages/classify/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "全部分类" +} \ No newline at end of file diff --git a/pages/classify/index.wxml b/pages/classify/index.wxml new file mode 100644 index 0000000..b44ba28 --- /dev/null +++ b/pages/classify/index.wxml @@ -0,0 +1,23 @@ + + + + 搜索商品 + + + + + + {{item.name}} + + + {{categorieArr[categorieindex].name}} + + + + {{items.name}} + + + + 暂无产品 + + \ No newline at end of file diff --git a/pages/classify/index.wxss b/pages/classify/index.wxss new file mode 100644 index 0000000..f04283a --- /dev/null +++ b/pages/classify/index.wxss @@ -0,0 +1,138 @@ +/* 搜索 */ +.search { + height: 110rpx; + position: fixed; + left: 0; + top: 0; + width: 100%; + z-index: 999; + padding: 10rpx 30rpx 0; + box-sizing: border-box; + background: white; +} + +.mall-search { + background: #f7f7f7; + height: 90rpx; + line-height: 90rpx; + padding: 0 30rpx; + box-sizing: border-box; + width: 100%; + border-radius: 80rpx; + color: #b8b7bc; + display: flex; +} + +.mall-search-icon { + width: 38rpx; + height: 38rpx; + margin: 26rpx 20rpx 0 0; +} + +/* 一级分类 */ + +.stair-nav { + position: fixed; + top: 110rpx; + left: 0; + background: #fcfafb; + height: calc(100vh - 100rpx); + width: 160rpx; + text-align: center; + z-index: 9; +} + +::-webkit-scrollbar { + width: 0; + height: 0; + color: transparent; + display: none; +} + +.stair-nav-li { + line-height: 110rpx; + border-top: solid 1rpx #ffffff; +} + +.stair-nav-li.active { + background: white; + color: #e92344; + font-weight: bold; + position: relative; +} + +.stair-nav-li.active::before { + position: absolute; + content: ""; + left: 0; + top: 30rpx; + height: 40rpx; + background: #e92344; + width: 6rpx; +} + +/* 二级分类 */ + +.level-content{ + position: fixed; + top: 0; + left: 0; + padding: 110rpx 0 0 170rpx; + box-sizing: border-box; + width: 100%; + height: 100vh; + background: white; +} + +.levelList-title { + font-size: 26rpx; + color: #2c2c2c; + font-weight: 600; + line-height: 110rpx; + padding: 0 25rpx; + box-sizing: border-box; +} + +.level-nav{ + display: flex; + flex-wrap:wrap; +} + +.level-nav-li{ + width: 33.333%; + text-align: center; + padding: 0 20rpx; + box-sizing: border-box; + margin-bottom: 30rpx; +} + +.level-nav-cover{ + width: 100%; + padding-top: 100%; + position: relative; + border-radius: 10rpx; + overflow: hidden; + background-color: #fcfafb; +} + +.level-nav-cover image { + position: absolute; + width: 100%; + height: 100%; + left: 0; + top: 0; +} + +.level-nav-title{ + font-size: 26rpx; + margin-top: 15rpx; + color: #464854; +} + + +.level-tips { + text-align: center; + width: 100%; + padding: 80rpx 0; + color: #a3a3a3; +} \ No newline at end of file diff --git a/pages/face/index.js b/pages/face/index.js new file mode 100644 index 0000000..a7fe6cd --- /dev/null +++ b/pages/face/index.js @@ -0,0 +1,66 @@ +// pages/face/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/face/index.json b/pages/face/index.json new file mode 100644 index 0000000..3928faa --- /dev/null +++ b/pages/face/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/face/index.wxml b/pages/face/index.wxml new file mode 100644 index 0000000..9b3ca66 --- /dev/null +++ b/pages/face/index.wxml @@ -0,0 +1,2 @@ + +pages/face/index.wxml diff --git a/pages/face/index.wxss b/pages/face/index.wxss new file mode 100644 index 0000000..e9ea303 --- /dev/null +++ b/pages/face/index.wxss @@ -0,0 +1 @@ +/* pages/face/index.wxss */ \ No newline at end of file diff --git a/pages/login/index.js b/pages/login/index.js new file mode 100644 index 0000000..917b778 --- /dev/null +++ b/pages/login/index.js @@ -0,0 +1,68 @@ +/* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ +*/ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + checked : false, // 勾选协议 + phone : "", // 手机号 + password : "", // 密码 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad() {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() {}, + + /** + * 勾选协议 + */ + radioChange() { + this.setData({ + checked: !this.data.checked + }) + }, + + /** + * 立即登录 + */ + registerForm(e) { + if(this.data.checked) { + let value = e.detail.value + let data = { + username : value.username, + password : value.password, + } + wx.$api.auth.Login(data).then(res => { + // 存储登录信息 + wx.setStorage({ + key : 'token', + data : res.data.token_type + ' ' + res.data.access_token, + success: () =>{ + // 回到上一页 + wx.navigateBack() + } + }) + }).catch(() =>{ + this.setData({ + disabled: false + }) + }) + return + } + wx.showToast({ + title: '请勾选用户隐私和服务协议', + icon: "none" + }) + } +}) \ No newline at end of file diff --git a/pages/login/index.json b/pages/login/index.json new file mode 100644 index 0000000..1d4d7bd --- /dev/null +++ b/pages/login/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "", + "navigationBarBackgroundColor": "#f7f6fa" +} \ No newline at end of file diff --git a/pages/login/index.wxml b/pages/login/index.wxml new file mode 100644 index 0000000..7b66d90 --- /dev/null +++ b/pages/login/index.wxml @@ -0,0 +1,25 @@ + + + + +
+ + + + + + + + 忘记密码? + + 暂无账号,立即注册 +
+ + + + + + + 我已阅读并同意《隐私协议》《服务协议》 + + \ No newline at end of file diff --git a/pages/login/index.wxss b/pages/login/index.wxss new file mode 100644 index 0000000..de7619b --- /dev/null +++ b/pages/login/index.wxss @@ -0,0 +1,127 @@ +page { + background-color: #f7f6fa; +} + +.loginImg { + width: 100%; +} + +.loginTitle { + width: 100%; + text-align: center; + padding: 0 50rpx; + box-sizing: border-box; + margin-top: -50rpx; +} + +.site-form { + display: block; + padding: 50rpx 50rpx 40rpx; + box-sizing: border-box; +} + +.inputs { + background: #edebf1; + border: none; + position: relative; + margin-bottom: 40rpx; + height: 100rpx; + line-height: 100rpx; + border-radius: 80rpx; + padding: 0 50rpx; + box-sizing: border-box; + display: flex; + position: relative; +} + +.inputs input { + width: 100%; + height: 100rpx; + line-height: 100rpx; + border: none; + font-size: 32rpx; +} + +.inputs-see { + position: absolute; + right: 50rpx; + top: 32rpx; + width: 38rpx; + height: 38rpx; + z-index: 9; +} + +.sms-btn[size='mini'] { + font-weight: normal; + height: 100rpx; + line-height: 100rpx; + position: absolute; + top: 0; + right: 30rpx; + margin: 0; + border-radius: 0; + border-left: solid 1rpx #f2f2f2; + color: #da2b54 !important; + font-size: 32rpx; + background-color: transparent !important; + z-index: 9; +} + +.forget { + text-align: right; + margin-bottom: 40rpx; + color: #da2b54; +} + +.registerGo { + text-align: center; + margin-top: 30rpx; + color: #da2b54; +} + +.btn { + background: #da2b54 !important; + width: 100% !important; + color: white !important; + border-radius: 100rpx; + font-size: 32rpx; + line-height: 100rpx; + height: 100rpx; + font-weight: bold; + padding: 0; + font-weight: normal; +} + +.btn::after { + border: none; +} + +.btn[disabled] { + background: #da2b54 !important; +} + + +/* 协议 */ +.agreement { + padding: 0 60rpx 40rpx; + box-sizing: border-box; + font-size: 26rpx; + color: #9d9d9d; + 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/article.js b/pages/mall/article/article.js new file mode 100644 index 0000000..c015fef --- /dev/null +++ b/pages/mall/article/article.js @@ -0,0 +1,50 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ +Page({ + + /** + * 页面的初始数据 + */ + data: { + articleId : '', //文章id + indexShow : '', //内容 + mallContent : '', //简介 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + articleId : options.id + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取详情数据 + this.indexInfo(); + }, + + /** + * 详情数据 + */ + indexInfo () { + wx.$api.mall.articlesSee(this.data.articleId).then(res => { + console.log(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(/\ {}) + } +}) \ No newline at end of file diff --git a/pages/mall/article/article.json b/pages/mall/article/article.json new file mode 100644 index 0000000..78912b1 --- /dev/null +++ b/pages/mall/article/article.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "公告详情" +} \ No newline at end of file diff --git a/pages/mall/article/article.wxml b/pages/mall/article/article.wxml new file mode 100644 index 0000000..617c2c5 --- /dev/null +++ b/pages/mall/article/article.wxml @@ -0,0 +1,18 @@ + + + + + 水感应 | {{indexShow.title}} + + + {{indexShow.created_at}} + 浏览 {{indexShow.clicks}} + + + + + + + + + \ No newline at end of file diff --git a/pages/mall/article/article.wxss b/pages/mall/article/article.wxss new file mode 100644 index 0000000..652386b --- /dev/null +++ b/pages/mall/article/article.wxss @@ -0,0 +1,43 @@ +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%; +} diff --git a/pages/mall/confirm/confirm.js b/pages/mall/confirm/confirm.js new file mode 100644 index 0000000..953bc44 --- /dev/null +++ b/pages/mall/confirm/confirm.js @@ -0,0 +1,82 @@ +/* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ +*/ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + disabled : true,//按钮 + skuId : '', + goodsQty : '', // 产品数量 + address : '', // 地址 + addressId : '', // 地址id + goodskData : '', // 数据 + amount : '', // 总金额 + freight : '', // 运费 + weight : '', // 重量 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + goodsQty: options.qty, + skuId : options.skuId + }) + // 获取商品下单信息 + this.placeInfo(options.skuId, options.qty); + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() {}, + + /** + * 商品下单信息 + */ + placeInfo(skuid, qty) { + wx.$api.mall.place({ + goods_sku_id:skuid, + qty: qty, + address_id: this.data.addressId + }).then(res => { + console.log(res) + this.setData({ + address : res.data.address, + addressId : res.data.address.address_id, + goodskData: res.data.detail, + amount : res.data.amount, + freight : res.data.freight, + weight : res.data.weight + }) + }).catch(err =>{}) + }, + + /** + * 商品确认下单 + */ + buyTap() { + wx.$api.mall.placeTrue({ + goods_sku_id:this.data.skuId, + qty: this.data.goodsQty, + address_id: this.data.addressId + }).then(res => { + this.setData({ + disabled: true + }) + wx.redirectTo({ + url: '/pages/pay/index?params=' + encodeURIComponent(JSON.stringify(res.data)) + }) + }).catch(err =>{ + this.setData({ + disabled: false + }) + }) + }, +}) \ No newline at end of file diff --git a/pages/mall/confirm/confirm.json b/pages/mall/confirm/confirm.json new file mode 100644 index 0000000..b41059d --- /dev/null +++ b/pages/mall/confirm/confirm.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "订单确认" +} \ No newline at end of file diff --git a/pages/mall/confirm/confirm.wxml b/pages/mall/confirm/confirm.wxml new file mode 100644 index 0000000..e0bb028 --- /dev/null +++ b/pages/mall/confirm/confirm.wxml @@ -0,0 +1,66 @@ + + + + + + {{address.province.name}}{{address.city.name}} + + {{address.full_address}} + + + {{address.name}}{{address.mobile}} + + + + + 新增收货地址 + + + + + + + + + + + {{items.title}} + + 购买数量 x{{items.qty}} + + + ¥{{items.price}} + + + + + + + + 快递 + {{freight == 0 ? '免邮' : freight + '元'}} + + + 重量 + {{weight}}g + + + 金额 + ¥{{amount}} + + + + + + + 合计: + + {{amount}} + + 立即支付 + 立即支付 + + + \ No newline at end of file diff --git a/pages/mall/confirm/confirm.wxss b/pages/mall/confirm/confirm.wxss new file mode 100644 index 0000000..47ba190 --- /dev/null +++ b/pages/mall/confirm/confirm.wxss @@ -0,0 +1,289 @@ +page { + background-color: #f5f6f8; + padding: 30rpx; + box-sizing: border-box; +} + +/* 地址 */ +.address { + background-color: #FFFFFF; + border-radius: 15rpx; + overflow: hidden; + position: relative; +} + +.address-arrow { + position: absolute; + right: 15rpx; + top: 78rpx; + width: 50rpx; + height: 50rpx; +} + +.address-cont { + padding: 30rpx; + box-sizing: border-box; +} + +.address-top { + width: calc(100% - 80rpx); +} + +.address-area { + color: #585866; + font-size: 28rpx; + display: flex; + line-height: 40rpx; +} + +.address-icon { + width: 40rpx; + margin-right: 20rpx; +} + +.address-text { + font-weight: 600; + padding: 10px 0; +} + +.address-name text { + color: #585866; + padding-left: 30rpx; +} + +.address-img { + width: 100%; + display: block; +} + +.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; + padding-bottom: 20rpx; +} + +/* 商品 */ + +.list-goods { + background-color: #FFFFFF; + margin: 30rpx 0; + display: flex; + padding: 30rpx; + border-radius: 15rpx; + box-sizing: border-box; +} + +.list-goods-img { + width: 184rpx; + height: 184rpx; + margin-right: 30rpx; + border-radius: 10rpx; +} + +.list-goods-cont { + width: calc(100% - 214rpx); +} + +.list-goods-name { + font-size: 32rpx; +} + +.list-goods-text { + line-height: 90rpx; + display: flex; + font-size: 28rpx; + color: #999999; +} + +.list-goods-text text { + flex: 1; +} + +.list-goods-parice { + font-size: 26rpx; +} + +.list-goods-parice text { + font-size: 34rpx; +} + +/* 规格 */ +.label { + background-color: #FFFFFF; + border-radius: 15rpx; + 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-integral { + color: #da2b54; + font-weight: 600; +} + +.label-name { + flex: 1; +} + + +/*checkbox选中后样式 */ +.label-text-checkbox { + margin-right: -14rpx; + margin-left: 10rpx; +} + +.label-text-checkbox .wx-checkbox-input.wx-checkbox-input-checked { + background: #da2b54; + border-color: #da2b54; +} + +.label-text-checkbox .wx-checkbox-input.wx-checkbox-input-checked::before { + width: 30rpx; + height: 30rpx; + line-height: 28rpx; + text-align: center; + font-size: 30rpx; + color: #fff; + background: transparent; + transform: translate(-50%, -50%) scale(1); + -webkit-transform: translate(-50%, -50%) scale(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; + height: 48rpx; + border: 2rpx solid #d7d7d7; + border-radius: 10rpx; +} + +.number-btn { + background-color: transparent; + width: 48rpx; + height: 48rpx; + line-height: 48rpx; + text-align: center; +} + +.number-input { + width: 80rpx; + text-align: center; + height: 48rpx; + border-left: 2rpx solid #d7d7d7; + border-right: 2rpx solid #d7d7d7; +} + +/* 底部 */ +.footer { + width: 100%; + height: 60px; + background-color: #ffffff; + position: fixed; + left: 0; + bottom: 0; + z-index: 9; + box-sizing: border-box; + display: flex; +} + +.number { + flex: 1; + line-height: 60px; + color: #da2b54; + display: flex; + padding: 0 30rpx; + box-sizing: border-box; +} + +.number text { + font-size: 28rpx; + padding-top: 5rpx; +} + +.number-price { + padding: 0 5rpx; + font-size: 40rpx; +} + +.number-vip { + margin-left: 20rpx; + color: #8d97a1; + font-size: 28rpx; +} + +.btn { + height: 100%; + background-color: #da2b54; + text-align: center; + color: #FFFFFF; + padding: 0 70rpx; + line-height: 60px; +} + +.btn-disabled { + line-height: 60px; + text-align: center; + border: none; + border-radius:0; + background-color: #da2b54; + padding: 0; + margin: 0; +} + +button[disabled]{ + padding: 0; + padding: 0; + height: 60px; + line-height: 60px; + background-color: transparent !important; +} + +.btn.active { + background-color: #cacaca; +} + +.detailsBrief-back{ + width: 100%; +} + +.grey { + background-color: #f9f9f9; + z-index: 99999; +} \ No newline at end of file diff --git a/pages/mall/details/details.js b/pages/mall/details/details.js new file mode 100644 index 0000000..58b4946 --- /dev/null +++ b/pages/mall/details/details.js @@ -0,0 +1,249 @@ +/* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ +*/ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + isFixedTop : 0, + barHeight : getApp().globalData.barHeight, // 状态栏高度 + goodsId : '', // 商品id + goodsData : '', // 商品数据 + mallContent : '', // 商品详情 + skus : [], // 显示的规格-提交 + skuid : '', + specselect : '', // 确认购买的规格 + selectSkusValues: '', // 默认选项 + valueId : '', // 选中规格id + valueIndex : '', // 选中规格下标index + specselectIndex : '', + qtyNumber : 1, // 产品数量 + goodsSize : false + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + goodsId: options.id + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取商品详情 + this.goodsInfo(); + }, + + /** + * 商品详情 + */ + goodsInfo() { + wx.$api.mall.goodsSee(this.data.goodsId).then(res => { + console.log(res.data) + this.setData({ + goodsData : res.data, + mallContent : res.data.content.replace(/\{}) + }, + + /** + * 选规格 + */ + selectSize(e) { + this.setData({ + qtyNumber: 1 + }) + let valueid = e.currentTarget.dataset.valueid, + index = e.currentTarget.dataset.index + var temp1 = 'specselect['+index+']' + this.setData({ + [temp1]: valueid + }) + let newlist = [] + let str = '' + for (var i in this.data.specselect) { + if (i == index) { + newlist.push(valueid); + if (i == 0) { + str = valueid + } else { + str = str + '|' + valueid + } + } else { + newlist.push(this.data.specselect[i]) + if (i == 0) { + str = this.data.specselect[i] + } else { + str = str + '|' + this.data.specselect[i] + } + } + } + for (var i in this.data.skus) { + if (this.data.skus[i].unit == str) { + this.setData({ + selectSkusValues: this.data.skus[i] + }) + break; + } + } + this.setData({ + specselect: newlist + }) + }, + + /** + * 产品数量加减 + */ + goodsNumber(e){ + let num = this.data.qtyNumber, + val = e.currentTarget.dataset.type, + stock = this.data.selectSkusValues.stock + if (val == 'plus'){ + num ++; + if(num > stock) { + wx.showToast({ + title : '商品数量不能大于库存量', + icon : 'none' + }) + this.setData({ + qtyNumber: stock + }) + } else { + this.setData({ + qtyNumber: num + }) + } + + }else{ + if (num > 1){ + num --; + if(num < this.data.qtyNumber) { + this.setData({ + qtyNumber: num + }) + } + }else{ + wx.showToast({ + title : '商品数量不能小于1', + icon : 'none' + }) + } + this.setData({ + qtyNumber: num + }) + } + }, + + /** + * 规格弹出 + */ + buyPop() { + this.setData({ + goodsSize: !this.data.goodsSize + }) + }, + + /** + * 规格关闭 + */ + closeTap() { + this.setData({ + goodsSize: false + }) + }, + + /** + * 确认购买 + */ + buyTap() { + // 获取登录状态 + if(wx.getStorageSync("token") != ''){ + let { + sku_id, + stock + } = this.data.selectSkusValues; + if (stock > 0) { + this.setData({ + skuid: sku_id, + goodsSize: false + }) + wx.navigateTo({ + url: '/pages/mall/confirm/confirm?skuId=' + sku_id + '&qty=' + this.data.qtyNumber + }) + } else { + uni.showToast({ + title: '当前商品库存不足', + icon: 'none', + mask: true, + duration: 2000 + }) + } + + }else{ + // 去登录 + wx.navigateTo({ + url: "/pages/login/index" + }) + } + }, + + /** + * 监听页面滑动事件 + */ + onPageScroll(e) { + this.setData({ + isFixedTop: parseInt(e.scrollTop) + }); + }, + + /** + * 返回上一页 + */ + returnGo() { + wx.navigateBack({ + delta: 1, + fail: () => { + wx.switchTab({ + url: '/pages/mall/index?invite=' + getApp().globalData.inviteText + }) + } + }) + }, + + /** + * 回到首页 + */ + returnHome() { + wx.switchTab({ + url: '/pages/mall/index?invite=' + getApp().globalData.inviteText + }) + }, + + /** + * 放大轮播相册图片 + */ + 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] + }) + } +}) \ No newline at end of file diff --git a/pages/mall/details/details.json b/pages/mall/details/details.json new file mode 100644 index 0000000..7af8b0a --- /dev/null +++ b/pages/mall/details/details.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationStyle": "custom" +} \ No newline at end of file diff --git a/pages/mall/details/details.wxml b/pages/mall/details/details.wxml new file mode 100644 index 0000000..6d1ca13 --- /dev/null +++ b/pages/mall/details/details.wxml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + {{goodsData.original_price}} + + + + + {{goodsData.name}} + + + 分享 + + + + + + + + {{goodsData.shop.name}} + 服务态度:5.0 + + + + + + + + + + + + + + ¥{{goodsData.original_price}} + + + + + + + + + + + + + ¥{{selectSkusValues.price}} + 剩余库存: {{selectSkusValues.stock}} + 当前商品库存不足 + + + {{item.name}} + {{items.value}} + + + 数量 + + - + + + + + + - + + + + + + + + 抱歉,商品库存不足了 ~ + + + 立即购买 + + \ No newline at end of file diff --git a/pages/mall/details/details.wxss b/pages/mall/details/details.wxss new file mode 100644 index 0000000..35f9df4 --- /dev/null +++ b/pages/mall/details/details.wxss @@ -0,0 +1,419 @@ +page { + background-color: #f6f6f6; +} + +/* 返回 */ +.navigation { + position: fixed; + top: 0; + left: 0; + z-index: 999; + width: 100%; + height: 90rpx; + background-color: transparent; + transition: .2s; + padding: 0 20rpx; + box-sizing: border-box; +} + +.navigationCont { + background: white; + padding: 0 10rpx; + box-sizing: border-box; + display: inline-block; + border-radius: 80rpx; + height: 58rpx; + margin-top: 10rpx; +} + +.navigation-arrow { + width: 38rpx; + height: 38rpx; + margin: 10rpx 15rpx; +} + +/* 产品图 */ +.banner { + overflow: hidden; + position: relative; + padding-top: 100%; +} + +.swiperCont, +.swiperImg { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} + +/* 产品 */ +/* 产品详情 */ +.goodsCont { + padding: 30rpx; + border-bottom: 60px solid transparent; + box-sizing: border-box; +} + +.goodsWhite { + background-color: #ffffff; + box-sizing: border-box; + border-radius: 15rpx; + margin-bottom: 30rpx; +} + +.goodsInfo { + padding: 30rpx; + box-sizing: border-box; + position: relative; +} + +.goodsInfo-price { + display: flex; + position: relative; + line-height: 52rpx; + color: #da2b54; +} + +.goodsInfo-cost { + font-size: 48rpx; +} + +.goodsInfo-cost text { + font-size: 28rpx; +} + +.goodsInfo-vip { + background-color: #ffebeb; + border-radius: 80rpx; + margin-left: 30rpx; + padding: 0 25rpx; + height: 52rpx; + font-size: 32rpx; +} + +.goodsInfo-vip text { + font-size: 24rpx; + padding-right: 5rpx; +} + +.goodsInfo-name { + margin-top: 20rpx; + font-size: 32rpx; +} + +.goodsInfo-share { + position: absolute; + top: 40rpx; + right: 30rpx; + display: flex; + font-size: 27rpx; + line-height: 34rpx; + color: #9b9b9b; +} + +.goodsInfo-share-image { + width: 34rpx; + height: 34rpx; + margin-right: 10rpx; +} + + +/* 参数 */ +.goodsItem { + padding: 0 30rpx; +} + +.goodsItem-label { + display: flex; + padding: 30rpx 0; + box-sizing: border-box; +} + +.goodsItem-label-name { + color: #999999; + display: flex; +} + +.goodsItem-label-logo { + width: 80rpx; + height: 80rpx; + background-color: #fff; + border: 2rpx solid #cecece; + padding: 9rpx; + text-align: center; + box-sizing: border-box; + margin-right:30rpx; +} + +.goodsItem-label-logo image { + width: 60rpx; + height: 60rpx; +} + +.goodsItem-label-see { + display: flex; + width: calc(100% - 120rpx); + background-color: #fff9fa; + padding: 10rpx 0; + border-radius: 15rpx; +} + +.goodsItem-label-block { + flex: 3; + text-align: center; + font-size: 26rpx; + position: relative; +} + +.goodsItem-label-block::after { + position: absolute; + content: ''; + background-color: #cdcdcd; + width: 1rpx; + height: 60%; + top: 20%; + left: -1rpx; +} + +.goodsItem-label-block:first-child::after { + display: none; +} + +.goodsItem-label-title { + color: #da2b54; + line-height: 50rpx; +} + +.goodsItem-label-tips { + color: #999999; +} + +.goodsItem-label-text { +} + +.goodsItem-label-tips { + font-size: 26rpx; + margin-top: 10rpx; +} + +.goodsItem-label-tips text { + color: #da2b54; +} + + +/* 底部 */ +.footer { + width: 100%; + height: 60px; + background-color: #ffffff; + position: fixed; + left: 0; + bottom: 0; + z-index: 9; + box-sizing: border-box; + display: flex; +} + +.number { + flex: 1; + line-height: 60px; + color: #da2b54; + display: flex; + padding: 0 30rpx; + box-sizing: border-box; +} + +.number text { + font-size: 28rpx; + padding-top: 10rpx; +} + +.number-price { + padding: 0 5rpx; + font-size: 46rpx; +} + +.number-vip { + margin-left: 20rpx; + font-size: 26rpx; + color: #8d97a1; + padding-top: 6rpx; + box-sizing: border-box; +} + +.btn-disabled { + color: #FFFFFF; + line-height: 60px; + text-align: center; + border: none; + border-radius:0; + background-color: #da2b54; + padding: 0; + margin: 0; +} + +button[disabled]{ + padding: 0; + padding: 0; + height: 100rpx; + line-height: 60px; + color: white !important; + opacity: .8; + background-color: transparent !important; +} + +/* 规格弹出 */ + +/* 规格 */ + +.goods-size-back { + position: fixed; + top: 0; + left: 0; + height: 100%; + width: 100%; + background: rgba(0, 0, 0, 0.3); + z-index: 9; + display: none; +} + +.goods-size-back.active { + display: block; +} + +.goods-size-content { + position: fixed; + bottom: -100%; + left: 0; + width: 100%; + background: white; + z-index: 100; + transition: all 0.2s; +} + +.goods-size-close { + position: absolute; + width: 36rpx; + right: 20rpx; + top: 30rpx; +} + +.goods-size-content.active { + bottom: 0; +} + +.goods-size-img { + position: absolute; + left: 15rpx; + top: -40rpx; + background: white; + width: 200rpx; + height: 200rpx; + padding: 15rpx; + box-sizing: border-box; + border-radius: 6rpx; +} + +.goods-size-img image { + width: 100%; + height: 100%; +} + +.goods-size-info { + padding: 30rpx 30rpx 30rpx 230rpx; + height: 160rpx; + box-sizing: border-box; +} + +.goods-size-info-price { + line-height: 60rpx; + font-size: 32rpx; + color: #da2b54; + font-weight: bold; +} + +.goods-size-info-price text { + font-size: 26rpx; +} + +.goods-size-info-text { + line-height: 40rpx; + color: #747788; + font-size: 26rpx; +} + +.goods-size-specs { + padding: 10rpx 30rpx; +} + +.goods-size-title { + color: #747788; + font-size: 26rpx; +} + +.goods-size-tag { + padding: 0 20rpx 20rpx 20rpx; +} + +.goods-size-tag-text { + background: #f5f6fa; + color: #999; + margin: 20rpx 10rpx 0 10rpx; + line-height: 50rpx; + padding: 0 15rpx; + display: inline-block; + font-size: 24rpx; + border-radius: 10rpx; +} + +.goods-size-tag-text.active { + color: #fff; + background: #da2b54; +} + +.goods-size-number { + padding: 10rpx 30rpx 80rpx 30rpx; + line-height: 60rpx; + color: #747788; +} + +.goods-number { + display: flex; + float: right; + margin-top: 25rpx; + height: 48rpx; + border: 2rpx solid #d7d7d7; + border-radius: 10rpx; +} + +.goods-number-btn { + background-color: transparent; + width: 48rpx; + height: 48rpx; + line-height: 48rpx; + text-align: center; +} + +.goods-number-input { + width: 80rpx; + text-align: center; + height: 48rpx; + border-left: 2rpx solid #d7d7d7; + border-right: 2rpx solid #d7d7d7; +} + +.goods-size-btn view { + text-align: center; + line-height: 90rpx; + font-size: 28rpx; + background: #da2b54; + color: white; + width: 100%; + float: left; +} + +.goods-size-btn view.active { + background: #b8b8b8; +} diff --git a/pages/mall/goods/goods.js b/pages/mall/goods/goods.js new file mode 100644 index 0000000..67044ff --- /dev/null +++ b/pages/mall/goods/goods.js @@ -0,0 +1,145 @@ +/* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ +*/ +Page({ + + /** + * 页面的初始数据 + */ + data: { + name : '', // 搜索名字 + sortStaus : false, // 分类弹出 + ordertype : '', // 排序类型 price为价格 sales为销量 + orderasc : '', // 排序方式 asc为正序 desc为倒序 + goodsArr : [], // 商品列表 + goodsId : '', // 分类id + categorieArr : [], // 分类列表 + categorieindex : 0 // 第一分类下标 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + goodsId: options.id, + name: options.title + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取商品列表 + this.goodsInfo(); + }, + + /** + * 商品列表信息 + */ + goodsInfo(page) { + wx.$api.mall.Goods({ + name : this.data.name || '', + category_id: this.data.goodsId || '', + page : page || 1, + order_by : this.data.ordertype, + order_by_type: this.data.orderasc + }).then(res => { + let listArr = this.data.goodsArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.data) + this.setData({ + goodsArr : newData, + page : res.data.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + }).catch(err =>{ + + }) + }, + + /** + * 销量排序 + */ + orderTap (e) { + let type = e.currentTarget.dataset.type + this.setData({ + ordertype : type, + }) + if(type == 'price') { + if (this.data.orderasc == 'asc') { + this.setData({ + orderasc : 'desc', + }) + } else { + this.setData({ + orderasc : 'asc', + }) + } + } else { + this.setData({ + orderasc: '', + }) + } + // 拉取商品列表数据 + this.goodsInfo(); + }, + + /** + * 跳转商品详情 + */ + detailsGo(e) { + wx.navigateTo({ + url: '/pages/mall/details/details?id=' + e.currentTarget.dataset.id + }) + this.setData({ + name: '' + }) + }, + + /** + * 搜索 + */ + searchForm(e) { + this.setData({ + name: e.detail.value.search + }) + + // 拉取商品列表数据 + this.goodsInfo(); + }, + + /** + * 商品分类展示 + */ + sortShow() { + this.setData({ + sortStaus : !this.data.sortStaus + }) + + // 获取商品分类 + this.categorieInfo() + }, + + /** + * 商品分类信息 + */ + categorieInfo() { + wx.$api.mall.Categorie().then(res => { + this.setData({ + categorieArr: res.data + }) + }).catch(err =>{}) + }, + + // 一级分类 + categorieTap(e) { + this.setData({ + categorieindex: e.currentTarget.dataset.index + }) + } +}) \ No newline at end of file diff --git a/pages/mall/goods/goods.json b/pages/mall/goods/goods.json new file mode 100644 index 0000000..3928faa --- /dev/null +++ b/pages/mall/goods/goods.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/mall/goods/goods.wxml b/pages/mall/goods/goods.wxml new file mode 100644 index 0000000..31cae34 --- /dev/null +++ b/pages/mall/goods/goods.wxml @@ -0,0 +1,83 @@ + + +
+ + + + + +
+ + + + + 销量 + + + + 价格 + + + + + + + + + + + + + + + + + + {{item.name}} + {{item.description}} + + ¥{{item.original_price}} + 月销 {{item.sales}} + + + + + + 加载中... + + + 没有更多了~ + + + +
+ + + 暂无商品 + + + + + + + + {{item.name}} + + + {{categorieArr[categorieindex].name}} + + + + + + + {{level.name}} + + + + + 暂无产品 + + + \ No newline at end of file diff --git a/pages/mall/goods/goods.wxss b/pages/mall/goods/goods.wxss new file mode 100644 index 0000000..df0cfdb --- /dev/null +++ b/pages/mall/goods/goods.wxss @@ -0,0 +1,272 @@ +page { + background-color: #f6f6f6; +} + +/* 商城搜索 */ +.mallSearch { + position: fixed; + width: 100%; + top: 0; + left: 0; + height: 120rpx; + box-sizing: border-box; + padding: 20rpx 30rpx; + background-color: #fff; + z-index: 9; + } + + .mallSearch-cont { + background-color: #f7f7f7; + border-radius: 100rpx; + padding: 18rpx 30rpx; + box-sizing: border-box; + display: flex; + color: #999999; + height: 80rpx; + width: 100%; + } + + .mallSearch-cont-icon { + width: 34rpx; + height: 34rpx; + margin-right: 30rpx; + margin-top: 6rpx; + } + + .mallSearch-cont input { + width: calc(100% - 120px); + height: 48rpx; + line-height: 48rpx; + color: #000000; + } + + .mallSearch-btn { + line-height: 48rpx; + font-size: 28rpx; + background: transparent; + color: #4c4c4c; + width: 150rpx !important; + padding: 0 !important; + border-radius: 0; + text-align: right; +} + + .mallTag { + position: fixed; + left: 0; + top: 110rpx; + width: 100%; + background-color: #fff; + padding: 40rpx; + box-sizing: border-box; + display: flex; + z-index: 99; + } + + .mallTag-one { + width: 46rpx; + height: 46rpx; + position: absolute; + right: 30rpx; + } + + .mallTag-name { + display: flex; + line-height: 46rpx; + width: 150rpx; + } + + .mallTag-name image { + width: 30rpx; + height: 30rpx; + margin: 7rpx 10rpx; + } + + .mallTag-name.active, + .mallTag-one.active { + color: #d32300; + } + + /* 列表 */ + .goodsList { + margin: 260rpx 10rpx 30rpx; + flex-wrap: wrap; + justify-content: flex-start; +} + +.goodsItem { + margin: 0 15rpx 20rpx; + width: calc(50% - 30rpx); + display: inline-block; + background-color: white; + border-radius: 30rpx; + overflow: hidden; +} + +.goodsItem-img { + width: 100%; + position: relative; + padding-top: 100%; +} + +.goodsItem-img image { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; +} + +.goodsItem-cont { + padding: 30rpx 20rpx; + box-sizing: border-box; +} + +.goodsItem-text { + color: #ff9b26; + font-size: 26rpx; + line-height: 54rpx; +} + +.goodsItem-tips { + margin-top: 20rpx; + display: flex; + line-height: 40rpx; +} + +.goodsItem-price { + flex: 1; + color: #ff1122; + font-size: 32rpx; + font-weight: 600; +} + +.goodsItem-sales { + font-size: 26rpx; + color: #999999; +} + +/* 分类弹出 */ +.sortBack { + position: fixed; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, .5); + left: 0; + top: 0; + z-index: 998; + display: none; +} + +.sortBack.active { + display: block; +} + +.sortCont { + position: fixed; + right: -100%; + bottom: 0; + width: 70%; + background-color: #fff; + height: 100vh; + z-index: 999; + transition: .2s; +} + +.sortCont.active { + right: 0; +} + +/* 一级分类 */ +.stair-nav{ + position: absolute; + top: 0; + left: 0; + background: #f7f7f7; + height: 100%; + width: 160rpx; + text-align: center; + z-index: 9; +} + +::-webkit-scrollbar{ + width: 0; + height: 0; + color: transparent; + display:none; +} + +.stair-nav-li{ + line-height: 100rpx; + border-top: solid 1rpx #ffffff; +} + +.stair-nav-li.active{ + background: white; + color: #e92344; + font-weight: bold; + position: relative; +} + +.stair-nav-li.active::before{ + position: absolute; + content: ""; + left: 0; + top: 30rpx; + height: 40rpx; + background: #e92344; + width: 6rpx; +} + +/* 二级分类 */ + +.level-content{ + position: absolute; + left: 160rpx; + width: calc(100% - 160rpx); + width: -webkit-calc(100% - 160rpx); + height: 100%; + padding: 10rpx; + background: white; + box-sizing: border-box; +} + +.levelList-title { + color: #2c2c2c; + padding: 20rpx 20rpx 0; + font-weight: 600; +} + +.level-nav{ + display: flex; + flex-wrap:wrap; +} + +.level-nav-li{ + width: 50%; + text-align: center; + padding: 10rpx; + box-sizing: border-box; +} + +.level-nav-cover{ + width: 100%; + padding-top: 100%; + position: relative; + border-radius: 10rpx; + overflow: hidden; +} + +.level-nav-cover image { + position: absolute; + border-radius: 4rpx; + width: 80%; + height: 80%; + left: 10%; + top: 10%; +} + +.level-nav-title{ + font-size: 28rpx; + color: #464854; +} \ No newline at end of file diff --git a/pages/mall/index.js b/pages/mall/index.js new file mode 100644 index 0000000..8481aa4 --- /dev/null +++ b/pages/mall/index.js @@ -0,0 +1,142 @@ +/* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ +*/ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + scrollLeft : '', // 商品分类 + bannerArr : [], // 轮播信息 + categorieArr: [], // 分类信息 + goodsArr : [], // 商品信息 + articlesArr : [], // 公告列表 + page : {}, // 分页信息 + lodingStats : false,// 加载状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取banner信息 + this.bannerInfo(); + + // 获取商品分类 + this.categorieInfo(); + + // 获取商品列表 + this.goodsInfo(); + + // 获取公告列表 + this.articlesInfo(); + }, + + /** + * banner信息 + */ + bannerInfo() { + wx.$api.mall.Banner().then(res => { + this.setData({ + bannerArr: res.data + }) + }).catch(err =>{ + + }) + }, + + /** + * 商品分类信息 + */ + categorieInfo() { + wx.$api.mall.Categorie().then(res => { + this.setData({ + categorieArr: res.data + }) + }).catch(err =>{ + + }) + }, + + /** + * 商品列表信息 + */ + goodsInfo(page) { + wx.$api.mall.Goods({ + page : page || 1 + }).then(res => { + let listArr = this.data.goodsArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.data) + this.setData({ + goodsArr : newData, + page : res.data.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + }).catch(err =>{ + + }) + }, + + /** + * 获取公告列表 + */ + articlesInfo() { + wx.$api.mall.articles().then(res => { + this.setData({ + articlesArr: res.data.data + }) + console.log(res) + }).catch(err =>{}) + }, + + /** + * 分类选择 + */ + tabsTap(e) { + let newOffsetLeft = e.currentTarget.offsetLeft, + newScrollLeft = '' + if(newOffsetLeft < 270) { + newScrollLeft = 0 + } else { + newScrollLeft = newOffsetLeft - this.data.scrollViewWidth / 2 + 40 + } + this.setData({ + scrollLeft: newScrollLeft, + categoryId: e.currentTarget.dataset.id + }) + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取商品列表 + this.goodsInfo(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取商品列表 + this.goodsInfo(pageNumber); + } + } +}) \ No newline at end of file diff --git a/pages/mall/index.json b/pages/mall/index.json new file mode 100644 index 0000000..a27a73b --- /dev/null +++ b/pages/mall/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "绚火健康", + "navigationBarBackgroundColor": "#fbe2e1" +} \ No newline at end of file diff --git a/pages/mall/index.wxml b/pages/mall/index.wxml new file mode 100644 index 0000000..13530d6 --- /dev/null +++ b/pages/mall/index.wxml @@ -0,0 +1,138 @@ + + + + 搜索商品 + + + + + + + + + + + + + + + + + + + {{item.name}} + + + + + + + + + + + + + {{item.title}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 今日种草 + 教你挑选健康好物 + + + + + ¥199.9 + + + + ¥199.9 + + + + + + 超值好物 + 每日优选 限时抢购 + + + + + ¥199.9 + + + + ¥199.9 + + + + + + + + + + + 为你推荐 + 面部护理 + 口腔健康 + 睡眠健康 + 控卡美食 + + + + + + + + + + + {{item.name}} + {{item.description}} + + ¥{{item.original_price}} + 游览 {{item.clicks}} + + + + + + 加载中... + + + 没有更多了~ + + + + + + 暂无商品 + + \ No newline at end of file diff --git a/pages/mall/index.wxss b/pages/mall/index.wxss new file mode 100644 index 0000000..09ecab1 --- /dev/null +++ b/pages/mall/index.wxss @@ -0,0 +1,329 @@ +page { + background-color: #f6f6f6; +} + +.linearBack { + background-image: linear-gradient(to top, #ffffff 60%, #fde8e9); + padding: 30rpx; + box-sizing: border-box; +} + +/* 搜索 */ +.mall-search { + height: 90rpx; + line-height: 90rpx; + background-color: #ffffff; + border-radius: 100rpx; + padding: 0 40rpx; + display: flex; + color: #999999; + font-size: 32rpx; +} + +.mall-search-icon { + width: 40rpx; + margin: 25rpx 20rpx 0 0; +} + +/* 轮播 */ +.mallBanner-cont { + margin: 40rpx 0 15rpx; + position: relative; + border-radius: 30rpx; + padding-top: 35%; + overflow: hidden; +} + +.mallBanner-see, +.mallBanner-img { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} + +/* 修改dot形状 */ +.mallBanner-see .wx-swiper-dots .wx-swiper-dot { + background-color: #ffffff; + opacity: .6; +} + +.mallBanner-see .wx-swiper-dot-active { + background-color: #ffffff !important; + opacity: 1 !important; +} + +/* 分类 */ +.sort-list { + overflow: hidden; +} + +.sort-item { + width: 20%; + float: left; + text-align: center; + margin-top: 30rpx; +} + +.sort-item-icon { + width: 92rpx; +} + +.sort-item-name { + font-size: 26rpx; + color: #111111; + margin-top: 10rpx; +} + +/* 公告 */ +.notice { + padding: 30rpx; + box-sizing: border-box; +} + +.noticeCont { + background-color: #ffffff; + border-radius: 100rpx; + height: 90rpx; + padding: 0 40rpx; + box-sizing: border-box; + display: flex; + overflow: hidden; +} + +.noticeCont-swiper { + width: calc(100% - 38rpx); + height: 90rpx; + line-height: 90rpx; +} + +.noticeCont-icon { + width: 38rpx; + margin-top: 28rpx; +} + +.noticeCont-name { + width: calc(100% - 38rpx); + padding-left: 30rpx; + box-sizing: border-box; + color: #da2b54; +} + +/* 推荐 */ +.suggest { + padding: 10rpx 30rpx 0; + box-sizing: border-box; + display: flex; + display: none; +} + +.suggestLeft { + width: 50%; + padding-right: 15rpx; + box-sizing: border-box; +} + +.suggestLeft-swiper { + position: relative; + border-radius: 30rpx; + padding-top: 158%; + overflow: hidden; +} + +.suggestLeft-see, +.suggestLeft-img { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} + +/* 修改dot形状 */ +.suggestLeft-see .wx-swiper-dots.wx-swiper-dots-horizontal { + bottom: 25rpx; +} + +.suggestLeft-see .wx-swiper-dots .wx-swiper-dot { + width: 32rpx; + /*宽*/ + height: 12rpx; + /*高*/ + border-radius: 10rpx; + /*圆角*/ + background-color: transparent; + border: 4rpx solid #ffffff; + box-sizing: border-box; +} + +.suggestLeft-see .wx-swiper-dot-active { + background-color: #ffffff !important; +} + +.suggestRight { + width: 50%; + padding-left: 15rpx; + box-sizing: border-box; +} + +.moduleWrite { + background-color: #ffffff; + padding: 20rpx 30rpx; + box-sizing: border-box; + border-radius: 30rpx; + margin-bottom: 20rpx; +} + +.module:last-child { + margin-bottom: 0; +} + +.moduleTitle-name { + font-weight: 600; +} + +.moduleTitle-text { + color: #999999; + font-size: 26rpx; + line-height: 48rpx; +} + +.moduleList { + overflow: hidden; + margin-top: 10rpx; +} + +.moduleList-item { + width: 50%; + float: left; + padding: 0 20rpx; + box-sizing: border-box; + text-align: center; +} + +.moduleList-item-img { + width: 80%; +} + +.moduleList-item-price { + font-size: 26rpx; + color: #ff4040; + font-weight: 600; +} + +/* 商品 */ +.tabs { + box-sizing: border-box; + width: 100%; + display: none; +} + +.tabs-scroll { + line-height: 80rpx; + height: 84rpx; + white-space: nowrap; +} + +.tabs-scroll-name { + display: inline-block; + padding: 0 40rpx 10rpx; + font-size: 30rpx; + position: relative; + color: #111111; +} + +.tabs-scroll-name::after { + content: ''; + position: absolute; + bottom: 0; + left: calc(50% - 4rpx); + height: 18rpx; + width: 8rpx; + border-radius: 80rpx 0 0 80rpx; + border-top: 6rpx solid transparent; + border-left: 6rpx solid transparent; + border-bottom: 6rpx solid transparent; + transform: translate(0) rotate(-90deg); +} + +.tabs-scroll-name.active { + color: #da2b54; + font-weight: 600; +} + +.tabs-scroll-name.active::after { + border-top-color: #da2b54; + border-left-color:#da2b54; + border-bottom-color: #da2b54; +} + +.goods { + padding: 0 30rpx; + box-sizing: border-box; +} + +.goodsList { + flex-wrap: wrap; + justify-content: flex-start; +} + +.goodsItem { + margin: 0 15rpx 20rpx; + width: calc(50% - 30rpx); + display: inline-block; + background-color: white; + border-radius: 30rpx; + overflow: hidden; +} + +.goodsItem-img { + width: 100%; + position: relative; + padding-top: 100%; +} + +.goodsItem-img image { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; +} + +.goodsItem-cont { + padding: 30rpx 20rpx; + box-sizing: border-box; +} + +.goodsItem-text { + color: #ff9b26; + font-size: 26rpx; + line-height: 54rpx; +} + +.goodsItem-tips { + margin-top: 20rpx; + display: flex; + line-height: 40rpx; +} + +.goodsItem-price { + flex: 1; + color: #ff1122; + font-size: 32rpx; + font-weight: 600; +} + +.goodsItem-sales { + font-size: 26rpx; + color: #999999; +} + +/* 暂无列表 */ +.goodsList-no { + background-color: #ffffff; + border-radius: 20rpx; + padding: 30rpx 30rpx 60rpx; + box-sizing: border-box; +} \ No newline at end of file diff --git a/pages/order/details/details.js b/pages/order/details/details.js new file mode 100644 index 0000000..94d8857 --- /dev/null +++ b/pages/order/details/details.js @@ -0,0 +1,129 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + data: { + goodsData : '', //详情 + canState : '', //操作按钮 + express : '', //物流 + orderNo : '' //订单号 + }, + + onLoad(options) { + this.setData({ + orderNo: options.order_no + }) + }, + + onShow() { + // 获取订单详情 + this.goodsInfo(); + }, + + /** + * 订单详情 + */ + goodsInfo() { + wx.$api.order.goodsDet(this.data.orderNo).then(res => { + this.setData({ + goodsData : res.data, + canState : res.data.can, + express : res.data.express + }) + }).catch(err => {}) + }, + + /** + * 复制订单号 + */ + copyUrl(val) { + wx.setClipboardData({ + data: val.currentTarget.dataset.no, + success: () => { + wx.showToast({ + title: "订单编号复制成功", + icon : "none" + }) + } + }) + }, + + /** + * 支付订单 + */ + payClick() { + wx.navigateTo({ + url: '/pages/pay/index?order_no=' + this.data.goodsData.order_no + '&total=' + this.data.goodsData.total + }) + }, + + /** + * 订单签收 + */ + signClick(e) { + wx.showModal({ + title : '提示', + content : '是否签收', + success : res=> { + if (res.confirm) { + wx.$api.order.goodsSign(this.data.goodsData.order_no).then(res => { + wx.showToast({ + title:'签收成功', + icon:'none' + }) + + // 获取订单详情 + this.goodsInfo(); + }).catch(err => {}) + } + } + }) + }, + + /** + * 取消订单 + */ + cancelClick(e) { + wx.showModal({ + title : '提示', + content : '是否取消订单', + success : res=> { + if (res.confirm) { + wx.$api.order.goodsCancel(this.data.goodsData.order_no).then(res => { + wx.showToast({ + title:'取消成功', + icon:'none' + }) + + // 回到列表 + wx.navigateBack(1) + }).catch(err => {}) + } + } + }) + }, + + /** + * 复制物流单号 + */ + copyExpress(val) { + wx.setClipboardData({ + data: val.currentTarget.dataset.no, + success: () => { + wx.showToast({ + title: "物流单号复制成功", + icon : "none" + }) + } + }) + }, + + // 查看物流 + h5url() { + wx.navigateTo({ + url: "/pages/order/logistic/logistic?orderno=" + this.data.goodsData.order_no + }) + } +}) diff --git a/pages/order/details/details.json b/pages/order/details/details.json new file mode 100644 index 0000000..7418a99 --- /dev/null +++ b/pages/order/details/details.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "订单详情" +} \ No newline at end of file diff --git a/pages/order/details/details.wxml b/pages/order/details/details.wxml new file mode 100644 index 0000000..92cb4b5 --- /dev/null +++ b/pages/order/details/details.wxml @@ -0,0 +1,91 @@ + + + + + + 订单编号 + + {{goodsData.order_no}} + 复制 + + + + + + + {{ goodsData.express.name }} {{ goodsData.express.mobile }} + + {{ goodsData.express.full_address }} + + + + + + + {{goodsData.shop.name}} + {{goodsData.state}} + + + + + + {{item.sku.goods_name}} + + 购买数量x{{item.qty}} + + + ¥{{item.price}} + + + + + + + + 订单信息 + + 交易时间 + {{goodsData.created_at}} + + + 运费 + {{goodsData.freight == 0 ? '免邮' : goodsData.freight + '元'}} + + + 交易状态 + {{goodsData.state}} + + + 实付款 + ¥{{goodsData.total}} + + + + + 物流信息 + + 物流名称 + {{goodsData.express.express_name}} + + + 物流单号 + + {{goodsData.express.express_no}}复制 + + + + 查看物流信息 + + 去查看 + + + + + + + 取消订单 + 立即付款 + 签收订单 + 返回订单 + + \ No newline at end of file diff --git a/pages/order/details/details.wxss b/pages/order/details/details.wxss new file mode 100644 index 0000000..1d6d40e --- /dev/null +++ b/pages/order/details/details.wxss @@ -0,0 +1,256 @@ +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: 100rpx transparent solid; +} + +/* 订单 */ +.orderData-cont-label { + padding: 40rpx 30rpx; + display: flex; + box-sizing: border-box; + border-bottom: #f2f2f2 2rpx solid; +} + +.orderData-cont-img { + width: 38rpx; + height: 38rpx; + margin-top: 4rpx; +} + +.orderData-cont-text { + width: calc(100% - 68rpx); + margin-left: 20rpx; + box-sizing: border-box; + font-size: 30rpx; +} + +.orderData-cont-site { + width: calc(100% - 108rpx); +} + +.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: #da2b54; +} + +.address-btn { + width: 42rpx; + height: 42rpx; + margin-top: 46rpx; +} + +/* 产品 */ +.list-goods { + display: flex; + padding: 30rpx; + box-sizing: border-box; +} + +.shopSee { + line-height: 40rpx; + display: flex; + padding: 30rpx 30rpx 10rpx; + box-sizing: border-box; +} + +.shopSee-name { + flex: 1; + display: flex; +} + +.shopSee-name image { + width: 34rpx; + margin: 5rpx 15rpx 0 0; +} + +.shopSee-state { + font-size: 28rpx; +} + +.list-goods-img { + width: 184rpx; + height: 184rpx; + margin-right: 30rpx; + border-radius: 10rpx; +} + +.list-goods-cont { + width: calc(100% - 214rpx); +} + +.list-goods-name { + font-size: 32rpx; +} + +.list-goods-text { + line-height: 90rpx; + display: flex; + font-size: 28rpx; + color: #999999; +} + +.list-goods-text text { + flex: 1; +} + +.list-goods-parice { + text-align: right; + font-size: 28rpx; +} + +.list-goods-parice text { + font-size: 34rpx; +} + +/* 规格 */ +.reserveCont-title { + padding: 30rpx; + font-size: 30rpx; +} + +.reserve-label { + display: flex; + padding: 0 30rpx 30rpx; + box-sizing: border-box; + font-size: 28rpx; + line-height: 48rpx; +} + +.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-btn { + width: 120rpx; + text-align: center; + color: #ffffff; + background-color: #da2b54; + font-size: 26rpx; + border-radius: 10rpx; + line-height: 54rpx; +} + +.reserve-text-copy { + display: contents; +} + +.reserve-text-tap { + color: #ff9951; + padding-left: 30rpx; +} + +.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; + font-size: 34rpx; + color: #da2b54; +} + +.reserve-copy { + color: #da2b54; + border: #da2b54 2rpx solid; + display: inline-block; + height: 34rpx; + line-height: 34rpx; + font-size: 26rpx; + padding: 0 10rpx; + border-radius: 4rpx; + margin-left: 10rpx; +} + +.reserve-status { + color: #ff8100 +} + +/* 底部菜单 */ +.order-data-footer { + position: fixed; + bottom: 0; + left: 0; + right: 0; + border-top: solid 1rpx #f2f2f2; + padding-top: 20rpx; + padding-right: 30rpx; + padding-left: 30rpx; + height: 110rpx; + background: white; + flex-wrap: wrap; + flex-direction: row-reverse; + z-index: 9; +} + +.list-btn { + text-align: right; +} + +.order-btn { + border: 2rpx solid #da2b54; + color: #da2b54; + border-radius: 80rpx; + height: 56rpx; + line-height: 56rpx; + padding: 0 20rpx; + display: inline-block; + font-size: 26rpx; + margin-left: 30rpx; +} +.order-btn.grey { + color: grey; + border-color: grey; +} \ No newline at end of file diff --git a/pages/order/index.js b/pages/order/index.js new file mode 100644 index 0000000..8e1e0f7 --- /dev/null +++ b/pages/order/index.js @@ -0,0 +1,141 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + data: { + listType : '', // 订单状态 + listsArr : [], // 订单列表 + page : {}, // 分页信息 + lodingStats : false,// 加载状态 + }, + + onLoad(options) { + this.setData({ + listType: options.list_type + }) + }, + + onShow() { + // 获取订单列表 + this.listInfo() + }, + + /** + * 订单列表 + */ + listInfo(page) { + wx.$api.order.list({ + state: this.data.listType, + page : page || 1 + }).then(res => { + let listArr = this.data.listsArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.data) + this.setData({ + listsArr : 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.listInfo() + }, + + /** + * 支付订单 + */ + payClick(e) { + wx.navigateTo({ + url: '/pages/pay/index?order_no=' + e.currentTarget.dataset.order_no + '&total=' + e.currentTarget.dataset.total + }) + }, + + /** + * 更多操作 + */ + operateMore(e) { + wx.showActionSheet({ + itemList: ['取消订单'], + success: ()=> { + wx.showModal({ + title : '提示', + content : '是否取消订单', + success : res=> { + if (res.confirm) { + wx.$api.order.goodsCancel(e.currentTarget.dataset.order_no).then(res => { + wx.showToast({ + title:'取消成功', + icon:'none' + }) + // 获取订单列表 + this.listInfo() + }).catch(err => {}) + } + } + }) + }, + fail: err=> {} + }) + }, + + /** + * 订单签收 + */ + signClick(e) { + wx.showModal({ + title : '提示', + content : '是否签收', + success : res=> { + if (res.confirm) { + wx.$api.order.goodsSign(e.currentTarget.dataset.order_no).then(res => { + wx.showToast({ + title:'签收成功', + icon:'none' + }) + + // 获取订单列表 + this.listInfo() + }).catch(err => {}) + } + } + }) + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取订单列表 + this.listInfo(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取订单列表 + this.listInfo(pageNumber); + } + } +}) diff --git a/pages/order/index.json b/pages/order/index.json new file mode 100644 index 0000000..e3130c7 --- /dev/null +++ b/pages/order/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "我的订单" +} \ No newline at end of file diff --git a/pages/order/index.wxml b/pages/order/index.wxml new file mode 100644 index 0000000..55849c2 --- /dev/null +++ b/pages/order/index.wxml @@ -0,0 +1,66 @@ + + + 全部 + 待付款 + 待发货 + 待收货 + 已签收 + + + + + + + {{item.order_no}} + {{item.state}} + + + + + {{goodItem.sku.goods_name}} + + 规格 99mlx{{goodItem.qty}} + + + ¥{{goodItem.sku.price}} + + + + + 交易金额 + {{item.total}} + + + 兑换券兑换 + + + + 收货城市 + + {{item.province_city}} + + + + 更多 + + + 立即付款 + 签收订单 + 查看详情 + + + + + + 加载中... + + + 没有更多了~ + + + + + + + 暂无数据 + \ No newline at end of file diff --git a/pages/order/index.wxss b/pages/order/index.wxss new file mode 100644 index 0000000..fb61ea3 --- /dev/null +++ b/pages/order/index.wxss @@ -0,0 +1,174 @@ +page { + background-color: #f7faff; +} + +/* tabs */ +.header { + position: fixed; + top: 0; + left: 0; + right: 0; + z-index: 99; + height: 100rpx; + background-color: #f7faff; +} + +.tabs { + display: flex; + justify-content: space-around; + padding: 30rpx 10rpx; + font-size: 30rpx; + color: #3c3d3e; +} + +.tabs-item.show { + color: #da2b54; +} + +/* 列表 */ +.list { + padding: 20rpx 30rpx 30rpx; + box-sizing: border-box; + margin-top: 100rpx; +} + +.list-item { + background-color: #ffffff; + border-radius: 20rpx; + padding: 30rpx; + box-sizing: border-box; + margin-bottom: 30rpx; + box-shadow: 0 4rpx 30rpx 2rpx rgba(0, 0, 0, .05); +} + +.list-top { + display: flex; + margin-bottom: 30rpx; + line-height: 48rpx; +} + +.list-top-no { + flex: 1; +} + +.list-top-status { + color: #ff8100; +} + +.list-goods { + display: flex; +} + +.list-goods-img { + width: 184rpx; + height: 184rpx; + margin-right: 30rpx; + border-radius: 10rpx; +} + +.list-goods-cont { + width: calc(100% - 214rpx); +} + +.list-goods-name { + font-size: 32rpx; +} + +.list-goods-text { + line-height: 90rpx; + display: flex; + font-size: 28rpx; + color: #999999; +} + +.list-goods-text text { + flex: 1; +} + +.list-goods-parice { + text-align: right; + font-size: 28rpx; +} + +.list-goods-parice text { + font-size: 32rpx; +} + +.list-total { + text-align: right; + margin-top: 30rpx; + font-size: 30rpx; +} + +.list-total.active { + color: #da2b54; +} + +.list-total text { + font-size: 30rpx; +} + +.list-total-price { + display: inline-block; + font-weight: 600; + font-size: 38rpx; +} + +.list-tips { + background-color: #f7faff; + display: flex; + padding: 20rpx 30rpx; + box-sizing: border-box; + margin: 30rpx 0 40rpx; + border-radius: 10rpx; + line-height: 44rpx; + font-size: 28rpx; +} + +.list-tips-left { + display: flex; + margin-right: 40rpx; +} + +.list-tips-img { + width: 44rpx; + height: 44rpx; + margin-right: 10rpx; +} + +.list-tips-right { + color: #707070; + width: calc(100% - 210rpx); +} + +.list-operate { + display: flex; +} + +.list-more { + flex: 1; + line-height: 56rpx; + font-size: 26rpx; + color: #999999; +} + +.list-btn { + text-align: right; +} + +.list-btn-labor { + border: 2rpx solid #ff8100; + color: #ff8100; + border-radius: 80rpx; + height: 56rpx; + line-height: 56rpx; + padding: 0 25rpx; + display: inline-block; + font-size: 26rpx; + margin-left: 30rpx; +} + +.list-btn-labor.grey { + color: grey; + border-color: grey; +} \ No newline at end of file diff --git a/pages/order/logistic/logistic.js b/pages/order/logistic/logistic.js new file mode 100644 index 0000000..b846fab --- /dev/null +++ b/pages/order/logistic/logistic.js @@ -0,0 +1,41 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + data: { + orderNo : '', + logisticArr : [], + expressData : '', + }, + + onLoad(options) { + this.setData({ + orderNo: options.orderno + }) + }, + + onShow() { + // 查看物流 + this.h5url(); + }, + + // 查看物流 + h5url() { + wx.$api.order.kuaiDi(this.data.orderNo).then(res => { + this.setData({ + expressData: res.data.orderExpress, + logisticArr: res.data.logistics + }) + }).catch(err => {}) + // wx.request({ + // url: 'http://shanhe.kim/api/za/kuaidi.php?id=' + this.data.expressData.express_no, //需更换需请求数据的接口 + // success: res=> { + // this.setData({ + // logisticArr: res.data.data + // }) + // }, + // }); + } +}) diff --git a/pages/order/logistic/logistic.json b/pages/order/logistic/logistic.json new file mode 100644 index 0000000..e2aeb4c --- /dev/null +++ b/pages/order/logistic/logistic.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "物流信息" +} \ No newline at end of file diff --git a/pages/order/logistic/logistic.wxml b/pages/order/logistic/logistic.wxml new file mode 100644 index 0000000..d24e024 --- /dev/null +++ b/pages/order/logistic/logistic.wxml @@ -0,0 +1,42 @@ + + + + + + {{expressData.logistic_name}} + + {{expressData.express_no}} + + + {{expressData.order_state}} + + + + + + 收 + + + {{expressData.address}} + + + + + + + {{item.time}} + + + + {{item.context}} + + + + + + + + 暂无物流信息 + \ No newline at end of file diff --git a/pages/order/logistic/logistic.wxss b/pages/order/logistic/logistic.wxss new file mode 100644 index 0000000..a490d0d --- /dev/null +++ b/pages/order/logistic/logistic.wxss @@ -0,0 +1,141 @@ +.top { + background-color: #da2b54; + padding: 30rpx 30rpx 60rpx; + box-sizing: border-box; + display: flex; +} + +.top-logo { + background-color: #ffffff; + border-radius: 10rpx; + width: 100rpx; + height: 100rpx; + padding: 10rpx; + box-sizing: border-box; +} + +.top-logo image { + width: 100%; + height: 100%; +} + +.top-cont { + color: #ffffff; + width: calc(100% - 130rpx); + margin-left: 30rpx; +} + +.top-name { + display: flex; + line-height: 44rpx; + padding: 10rpx 0; +} + +.top-no { + font-size: 26rpx; + padding-left: 30rpx; + opacity: .9; +} + +.top-type { + font-size: 24rpx; +} + +.top-type text { + padding-left: 20rpx; +} + +.address { + color: #333333; + font-size: 24rpx; + display: flex; + padding: 30rpx 30rpx 0; +} + +.address-tips { + width: 54rpx; + text-align: center; + height: 54rpx; + line-height: 54rpx; + border-radius: 50%; + background-color: #EEEEEE; + margin-left: -15rpx; + font-size: 24rpx +} + +.address-text { + width: calc(100% - 74rpx); + margin-left: 20rpx; + padding-top: 10rpx; +} + +.white { + margin-top: -30rpx; + background-color: #ffffff; + border-radius: 20rpx; +} + +.list { + padding: 0 30rpx; + box-sizing: border-box; +} + +.item { + padding-bottom: 40rpx; + padding-left: 40rpx; + box-sizing: border-box; + position: relative; +} + +.item:first-child { + padding-top: 30rpx; +} + +.item::after { + position: absolute; + content: ''; + background-color: #DDDDDD; + width: 14rpx; + height: 14rpx; + border-radius: 50%; + left: 0; + top: calc(50% - 6rpx); + z-index: 3; + border: 2rpx solid #ffffff; +} + +.item::before { + position: absolute; + content: ''; + background-color: #F0F0F0; + width: 2rpx; + height: 100%; + border-radius: 50%; + left: 8rpx; + top: 0; +} + +.item-name { + display: flex; +} + +.item-status { + font-weight: 600; + padding-right: 20rpx; +} + +.item-time { + color: #868686; +} + +.item-text { + color: #868686; + font-size: 24rpx; + line-height: 40rpx; + margin-top: 20rpx; +} + +.item:first-child .item-time, +.item:first-child .item-text { + color: #ff8100 !important; +} diff --git a/pages/pay/index.js b/pages/pay/index.js new file mode 100644 index 0000000..0149e69 --- /dev/null +++ b/pages/pay/index.js @@ -0,0 +1,28 @@ +/* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ +*/ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + const params = JSON.parse(decodeURIComponent(options.params)); + console.log(params) + }, + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, +}) \ No newline at end of file diff --git a/pages/pay/index.json b/pages/pay/index.json new file mode 100644 index 0000000..1bad2c6 --- /dev/null +++ b/pages/pay/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "收银台" +} \ No newline at end of file diff --git a/pages/pay/index.wxml b/pages/pay/index.wxml new file mode 100644 index 0000000..d873eee --- /dev/null +++ b/pages/pay/index.wxml @@ -0,0 +1,23 @@ + + 支付有效期为10分钟,请尽快支付 + 199.00 + 微信支付 + + + + + + 微信支付 + + + + + + 确认支付 + 确认支付 + + + + + 疯狂加载中... + \ No newline at end of file diff --git a/pages/pay/index.wxss b/pages/pay/index.wxss new file mode 100644 index 0000000..12efd18 --- /dev/null +++ b/pages/pay/index.wxss @@ -0,0 +1,86 @@ +page { + background-color: #f4f4f6; +} + +.payTop { + text-align: center; + padding: 140rpx 0; +} + +.payTop-price { + font-weight: 600; + font-size: 78rpx; + line-height: 70rpx; + padding: 20rpx 0 0; +} + +.payTop-price text { + font-size: 36rpx; +} + +.payTop-time, +.payTop-text { + font-size: 28rpx; + color: #666666; +} + +.payWay { + padding: 0 30rpx; + box-sizing: border-box; +} + +.payWay-item { + background-color: #ffffff; + border-radius: 15rpx; + padding: 25rpx 30rpx; + box-sizing: border-box; + display: flex; + line-height: 74rpx; + font-size: 34rpx; + position: relative; +} + +.payWay-img { + width: 74rpx; + height: 74rpx; + margin-right: 20rpx; +} + +.payWay-icon { + width: 42rpx; + height: 42rpx; + position: absolute; + right: 30rpx; + top: 40rpx; +} + + +/* 按钮 */ +.footer { + width: 100%; + height: 100px; + background-color: #f4f4f6; + position: fixed; + left: 0; + bottom: 0; + z-index: 9; + padding: 20px 20px 50rpx; + box-sizing: border-box; +} + +.btn { + line-height: 54px; + background-color: #da2b54; + height: 100%; + text-align: center; + color: #FFFFFF; + border-radius: 10rpx; +} +.btn.active { + background-color: #cacaca; +} + +.grey { + background-color: #f9f9f9; + z-index: 99999; +} \ No newline at end of file diff --git a/pages/register/index.js b/pages/register/index.js new file mode 100644 index 0000000..cf0c387 --- /dev/null +++ b/pages/register/index.js @@ -0,0 +1,149 @@ +/* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ +*/ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + successHide : false, // 注册成功 + checked : false, // 勾选协议 + codename : '获取验证码', + smsDisabled : false,// 获取验证码 禁止点击 + seeState : false, //小眼睛 + againState : false, //小眼睛-再次输入密码 + passwordState: true, //小眼睛-显示 + passwordAgain: true, //小眼睛-显示-再次输入密码 + phone : "", // 手机号 + code : "", // 验证码 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad() {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() {}, + + /** + * 手机号码 + */ + bindInput(e) { + this.setData({ + phone: e.detail.value + }) + }, + + /** + * 短信验证码 + */ + bindCode(e) { + this.setData({ + code: e.detail.value + }) + }, + + /** + * 获取短信验证码 + */ + getPhoneCode(e) { + let mobile = this.data.phone + var _this = this + if (mobile == "") { + wx.showToast({ + title : '手机号不能为空', + icon : 'none', + duration : 1000 + }) + return false; + }else{ + wx.$api.auth.getSms({ + mobileNo: mobile + }).then(res=>{ + console.log(res) + _this.setData({ + smsDisabled : true + }) + + wx.showToast({ + title : '发送成功', + icon : 'success', + duration: 2000 + }) + var num = 60; + var timer = setInterval(function () { + num--; + if (num <= 0) { + clearInterval(timer); + _this.setData({ + codename : '重新发送', + smsDisabled : false + }) + + } else { + _this.setData({ + codename : num + "s后重新获取", + smsDisabled : true + }) + } + }, 1000) + }).catch(err=>{}) + } + }, + + /** + * 查看密码 + */ + seeClick() { + this.setData({ + seeState : !this.data.seeState, + passwordState: !this.data.passwordState + }) + }, + + /** + * 查看密码-再次 + */ + seeAgain() { + this.setData({ + againState : !this.data.againState, + passwordAgain : !this.data.passwordAgain + }) + }, + + /** + * 立即注册 + */ + registerForm(e) { + let value = e.detail.value + let data = { + username : this.data.phone, + code : value.code, + password : value.password, + password_confirmation : value.password_confirmation, + parent_id : '' + } + wx.$api.auth.register(data).then(res => { + // 存储登录信息 + wx.setStorage({ + key : 'token', + data : res.data.token_type + ' ' + res.data.access_token, + success: () =>{ + this.setData({ + successHide: true + }) + } + }) + }).catch(() =>{ + this.setData({ + disabled: false + }) + }) + } +}) \ No newline at end of file diff --git a/pages/register/index.json b/pages/register/index.json new file mode 100644 index 0000000..1d4d7bd --- /dev/null +++ b/pages/register/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "", + "navigationBarBackgroundColor": "#f7f6fa" +} \ No newline at end of file diff --git a/pages/register/index.wxml b/pages/register/index.wxml new file mode 100644 index 0000000..ee64fd2 --- /dev/null +++ b/pages/register/index.wxml @@ -0,0 +1,35 @@ + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + 注册成功 + 恭喜您成功注册,请登录绚火平台 + 立即登录 + + + \ No newline at end of file diff --git a/pages/register/index.wxss b/pages/register/index.wxss new file mode 100644 index 0000000..df77aa4 --- /dev/null +++ b/pages/register/index.wxss @@ -0,0 +1,158 @@ +page { + background-color: #f7f6fa; +} + +.loginImg { + width: 100%; +} + +.loginTitle { + width: 100%; + text-align: center; + padding: 0 50rpx; + box-sizing: border-box; + margin-top: -50rpx; +} + +.site-form { + display: block; + padding: 50rpx 50rpx 20rpx; + box-sizing: border-box; +} + +.inputs { + background: #edebf1; + border: none; + position: relative; + margin-bottom: 40rpx; + height: 100rpx; + line-height: 100rpx; + border-radius: 80rpx; + padding: 0 50rpx; + box-sizing: border-box; + display: flex; + position: relative; +} + +.inputs input { + width: 100%; + height: 100rpx; + line-height: 100rpx; + border: none; + font-size: 32rpx; +} + +.inputs-see { + position: absolute; + right: 50rpx; + top: 32rpx; + width: 38rpx; + height: 38rpx; + z-index: 9; +} + +.sms-btn[size='mini'] { + font-weight: normal; + height: 100rpx; + line-height: 100rpx; + position: absolute; + top: 0; + right: 30rpx; + margin: 0; + border-radius: 0; + border-left: solid 1rpx #f2f2f2; + color: #da2b54 !important; + font-size: 32rpx; + background-color: transparent !important; + z-index: 9; +} + +.btn { + background: #da2b54 !important; + width: 100% !important; + color: white !important; + border-radius: 100rpx; + font-size: 32rpx; + line-height: 100rpx; + height: 100rpx; + font-weight: bold; + font-weight: normal; + padding: 0; +} + +.btn::after { + border: none; +} + +.btn[disabled] { + background: #da2b54 !important; +} + +/* 注册成功弹出 */ +/* 弹出 */ +.refertoEject { + position: fixed; + width: 100vw; + height: 100vh; + left: 0; + top: 0; + background-color: rgba(0, 0, 0, .7); + z-index: 1000; + display: none; +} + +.refertoEject.active { + display: block; +} + +.refertoCont { + -webkit-box-orient: vertical; + -webkit-box-pack: center; + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + z-index: 10000; + padding: 0 15%; + box-sizing: border-box; + text-align: center; + display: none; +} + +.refertoCont.active { + display: -webkit-box; +} + +.refertoWrite { + background-color: white; + border-radius: 20rpx; + overflow: hidden; +} + +.refertoCont-img { + width: 100%; +} + +.refertoCont-name { + padding: 30rpx 0 40rpx; +} + +.refertoCont-title { + color: #da2b54; + font-size: 40rpx; +} + +.refertoCont-text { + padding: 20rpx 0 40rpx; + color: #999999; +} + +.refertoCont-go { + background-color: #da2b54; + display: inline-block; + color: #ffffff; + line-height: 88rpx; + width: 80%; + border-radius: 80rpx; +} \ No newline at end of file diff --git a/pages/search/search.js b/pages/search/search.js new file mode 100644 index 0000000..97a3cbd --- /dev/null +++ b/pages/search/search.js @@ -0,0 +1,72 @@ +/* + * 手太欠 + * 肥督督商城 + */ + +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + searchHistory : [] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { + if (wx.getStorageSync('searchHistory')) { + this.setData({ + searchHistory: wx.getStorageSync('searchHistory') + }) + } + }, + + /** + * 搜索 + */ + searchForm(e) { + // 存入历史搜索 + let searchHistory = this.data.searchHistory, + searchValue = e.detail.value.search, + newsearchHistory + + if (searchValue != '') { + searchHistory.push(searchValue) + newsearchHistory = Array.from(new Set(searchHistory)) + // 写入缓存 + wx.setStorageSync('searchHistory', newsearchHistory) + // 转跳搜索结果页 + wx.navigateTo({ + url: '/pages/mall/goods/goods?title=' + searchValue + }) + } + }, + + /** + * 历史记录搜索 + */ + bindSearch(e) { + wx.navigateTo({ + url: '/pages/mall/goods/goods?title=' + e.currentTarget.dataset.value + }) + }, + + /** + * 清理搜索结果 + */ + removeSearchHistory() { + wx.removeStorage({ + key: 'searchHistory', + success: res => { + if (res.errMsg == "removeStorage:ok") { + this.setData({ + searchHistory: [] + }) + } + } + }) + } +}) \ No newline at end of file diff --git a/pages/search/search.json b/pages/search/search.json new file mode 100644 index 0000000..869c2a4 --- /dev/null +++ b/pages/search/search.json @@ -0,0 +1,4 @@ +{ + "usingComponents" : {}, + "navigationBarTitleText": "商品搜索" +} \ No newline at end of file diff --git a/pages/search/search.wxml b/pages/search/search.wxml new file mode 100644 index 0000000..e33d77f --- /dev/null +++ b/pages/search/search.wxml @@ -0,0 +1,23 @@ + + + + +
+ + + + +
+
+ + + + 搜索历史 + 清理 + + + {{item}} + + + +无历史搜索 \ No newline at end of file diff --git a/pages/search/search.wxss b/pages/search/search.wxss new file mode 100644 index 0000000..c16adee --- /dev/null +++ b/pages/search/search.wxss @@ -0,0 +1,79 @@ +/* 搜索 */ + +.search { + padding: 30rpx; + box-sizing: border-box; + position: relative; + left: 0; + top: 0; + width: 100%; + background: #fff; + color: #999; + z-index: 999; +} + +.search-input { + display: flex; + width: 100%; + height: 90rpx; + line-height: 90rpx; + background: #f7f7f7; +} + +.search-input input { + padding: 0 30rpx; + box-sizing: border-box; + height: 90rpx; + color: #000; + font-size: 28rpx; + flex: 1; + width: calc(100% - 150rpx); +} + +.search-btn { + font-size: 28rpx; + background: #f1f1f1; + color: #4c4c4c; + width: 150rpx !important; + padding: 0 !important; + line-height: 90rpx; + border-radius: 0; +} + +.search-btn::after { + border: none; +} + +/* 搜索历史 */ + +.search-history{ + padding: 20rpx 20rpx 0 20rpx; +} + +.search-history-title{ + padding: 0 10rpx 20rpx 10rpx; +} + +.search-history-title text{ + float: right; + font-size: 26rpx; + color: #a2a7ba; +} + +.search-history-tag{ + overflow: hidden; +} + +.search-history-tag view{ + display: inline-block; + margin: 0 10rpx 20rpx 10rpx; + background: #f5f6fa; + padding: 10rpx 20rpx; + font-size: 26rpx; +} + +.search-history-null{ + text-align: center; + padding: 50rpx 0; + color: #747788; +} diff --git a/pages/site/add/add.js b/pages/site/add/add.js new file mode 100644 index 0000000..2b999aa --- /dev/null +++ b/pages/site/add/add.js @@ -0,0 +1,179 @@ +/* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + nameValue : '', // 姓名 + mobile : '', // 电话 + address : '', // 地址 + isDefault : '', // 默认地址 + // 省份选择 + areasArr : [], + areaId : 0, + areaIndex : 0, + + // 市级选择 + cityArr : [], + cityId : 0, + cityIndex : 0, + + // 区域选择 + regiArr : [], + regiId : 0, + regiIndex : 0, + + disabled : false + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + experience: options.experience + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取省市区列表 + this.createInfo(); + }, + + /** + * 省市区列表 + */ + createInfo() { + wx.$api.site.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.site.create({ + parent_id: cityId + }).then(res=>{ + let cityArr = res.data + 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.cityIndex) { + this.setData({ + cityIndex : index, + cityId : citycode + }) + + // 获取市级列表 + this.regilist(citycode) + } + }, + + /** + * 区列表 + */ + regilist(areaId) { + wx.$api.site.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 + }) + }, + + /* + 姓名截取 + */ + bindinput(e) { + this.setData({ + nameValue: e.detail.value.substr(0,5) + }) + }, + + // 提交表单 + siteform(e) { + let value = e.detail.value + let data = { + name : this.data.nameValue, + mobile : value.mobile, + address : value.address, + province_id : this.data.areaId, + city_id : this.data.cityId, + district_id : this.data.regiId + } + this.setData({ + disabled: true + }) + wx.$api.site.siteAdd(data).then(res => { + wx.navigateBack() + }).catch(() =>{ + this.setData({ + disabled: false + }) + }) + } +}) \ No newline at end of file diff --git a/pages/site/add/add.json b/pages/site/add/add.json new file mode 100644 index 0000000..9b706f4 --- /dev/null +++ b/pages/site/add/add.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "新增地址" +} \ No newline at end of file diff --git a/pages/site/add/add.wxml b/pages/site/add/add.wxml new file mode 100644 index 0000000..7ef256d --- /dev/null +++ b/pages/site/add/add.wxml @@ -0,0 +1,44 @@ +
+ + + + + + + + + + + + + {{ areasArr[areaIndex].name }} + + + + + + + + + {{ cityArr[cityIndex].name }} + + + + + + + + + {{ regiArr[regiIndex].name }} + + + + + + + + + + + +
\ No newline at end of file diff --git a/pages/site/add/add.wxss b/pages/site/add/add.wxss new file mode 100644 index 0000000..e6b52c1 --- /dev/null +++ b/pages/site/add/add.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: 44rpx; + height: 44rpx; + position: absolute; + right: 20rpx; + top: calc(50% - 22rpx); +} + +.site-btn { + padding: 20rpx 30rpx; + margin-top: 100rpx; +} + +.site-btn button[size="mini"] { + width: 100%; + background: #e92152; + height: 88rpx; + line-height: 88rpx; + font-size: 30rpx; + color: white; + padding: 0; +} + +.site-btn button[disabled] { + background: #e92152 !important; + color: #fff !important; +} + +.site-switch { + font-size: 32rpx; + margin: 30rpx; + display: flex; + line-height: 40rpx; +} + +.site-switch text { + flex: 1; +} + +.site-switch-active { + color: #797979; +} \ No newline at end of file diff --git a/pages/site/edit/edit.js b/pages/site/edit/edit.js new file mode 100644 index 0000000..66880dd --- /dev/null +++ b/pages/site/edit/edit.js @@ -0,0 +1,225 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + data: { + addressId : '', + nameValue : '', + mobile : '', + address : '', + isDefault : '', + disabled : false, + + //省份选择 + areas : [], + areaId : '', + areaIndex : 0, + + //市级选择 + cityList : [], + cityId : 0, + cityIndex : 0, + + //区域选择 + regiList : [], + regiId : 0, + regiIndex : 0, + }, + + onLoad(options) { + this.setData({ + addressId: options.addressid + }) + }, + + onShow() { + // 获取收货人信息 + this.getUserAddress() + }, + + /** + * 收货人信息 + */ + getUserAddress(){ + wx.$api.site.siteSee(this.data.addressId).then(res => { + let areasValue = res.data.provinces.findIndex(val=> val.name == res.data.province.name), + cityValue = res.data.cities.findIndex(val=> val.name == res.data.city.name), + regiValue = res.data.districts.findIndex(val=> val.name == res.data.district.name) + this.setData({ + nameValue : res.data.name, + mobile : res.data.mobile, + areas : res.data.provinces, + cityList : res.data.cities, + regiList : res.data.districts, + areaIndex : areasValue, + cityIndex : cityValue, + regiIndex : regiValue, + areaId : res.data.province.region_id, + cityId : res.data.city.region_id, + regiId : res.data.district.region_id, + address : res.data.address, + isDefault : res.data.default + }) + }).catch(err => {}) + }, + + /** + * 省市区列表 + */ + createInfo() { + wx.$api.site.create().then(res => { + let areas = res.data, + areaIndex = this.data.areaIndex + this.setData({ + areas : areas, + areaId : areas[areaIndex].id, + }) + + this.citylist(areas[areaIndex].id) + }).catch(err => {}) + }, + + /** + * 所在省份-下拉 + */ + areasChange(e) { + let area = this.data.areas, + 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.site.create({ + parent_id: cityId + }).then(res=>{ + let cityArr = res.data + this.setData({ + cityId : cityArr[0].id, + cityIndex : 0, + cityList : cityArr + }) + + // 获取区级列表 + this.regilist(cityArr[0].id) + }) + }, + + /** + * 市级下拉筛选 + */ + cityDrop(e) { + let city = this.data.cityList, + index = e.detail.value, + citycode = city[index].id + if (index != this.data.cityIndex) { + this.setData({ + cityIndex : index, + cityId : citycode + }) + + // 获取区列表 + this.regilist(citycode) + } + }, + + /** + * 区列表 + */ + regilist(areaId) { + wx.$api.site.create({ + parent_id: areaId + }).then(res=>{ + this.setData({ + regiList : res.data, + regiId : res.data[0].id, + regiIndex : 0 + }) + }) + }, + + /** + * 区下拉筛选 + */ + regiDrop(e) { + let newIndex = e.detail.value + this.setData({ + regiIndex : newIndex, + regiId : this.data.regiList[newIndex].id + }) + }, + + /** + * 默认地址 + */ + addressDefault() { + wx.$api.site.siteDefault(this.data.addressId).then(res => { + this.setData({ + isDefault: !this.data.isDefault + }) + }).catch(err => {}) + }, + + /* + 姓名截取 + */ + bindinput(e) { + this.setData({ + nameValue: e.detail.value.substr(0,5) + }) + }, + + /** + * 提交表单 + */ + siteform(e) { + let value = e.detail.value + let data = { + name : this.data.nameValue, + mobile : value.mobile, + address : value.address, + province_id : this.data.areaId, + city_id : this.data.cityId, + district_id : this.data.regiId, + is_default : this.data.isDefault + } + wx.$api.site.siteEdit(this.data.addressId, data).then(res => { + this.setData({ + disabled: true + }) + wx.navigateBack() + }).catch(err => {}) + }, + + /** + * 删除地址 + */ + addressRemove(){ + wx.showModal({ + title : '提示', + content : '是否删除地址', + success : res=> { + if (res.confirm) { + wx.showLoading({ + title: '删除中', + }) + wx.$api.site.siteDel(this.data.addressId).then(res=>{ + wx.navigateBack() + }) + } + } + }) + }, +}) diff --git a/pages/site/edit/edit.json b/pages/site/edit/edit.json new file mode 100644 index 0000000..9fb26d3 --- /dev/null +++ b/pages/site/edit/edit.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "编辑地址" +} \ No newline at end of file diff --git a/pages/site/edit/edit.wxml b/pages/site/edit/edit.wxml new file mode 100644 index 0000000..646c5ea --- /dev/null +++ b/pages/site/edit/edit.wxml @@ -0,0 +1,52 @@ +
+ + + + + + + + + + + + + {{ areas[areaIndex].name }} + + + + + + + + + {{ cityList[cityIndex].name }} + + + + + + + + + {{ regiList[regiIndex].name }} + + + + + + + + + + 设置默认地址 + + + + + 删除地址 + + + + +
\ No newline at end of file diff --git a/pages/site/edit/edit.wxss b/pages/site/edit/edit.wxss new file mode 100644 index 0000000..0a571a8 --- /dev/null +++ b/pages/site/edit/edit.wxss @@ -0,0 +1,99 @@ +.site-form { + background: white; + display: block; +} + +.site-input { + padding: 0 30rpx 0 200rpx; + position: relative; + line-height: 110rpx; + min-height: 110rpx; +} + +.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: 44rpx; + height: 44rpx; + position: absolute; + right: 20rpx; + top: calc(50% - 22rpx); +} + +.site-btn { + padding: 20rpx 30rpx; + margin-top: 100rpx; +} + +.site-btn button[size="mini"] { + width: 100%; + background: #e92152; + height: 88rpx; + line-height: 88rpx; + font-size: 30rpx; + color: white; + padding: 0; +} + +.site-btn button[disabled] { + background: #e92152 !important; + color: #fff !important; +} + +.site-switch { + font-size: 32rpx; + margin: 30rpx; + display: flex; + line-height: 40rpx; +} + +.site-switch text { + flex: 1; +} + +.site-switch-active { + color: #797979; +} + +.site-del { + width: 100%; + text-align: center; + margin-top: 40rpx; + padding-top: 60rpx; + border-top: 2rpx solid rgb(228, 230, 242); + color: #ff9951; +} + +.site-del-btn { + text-align: center; +} + +.site-del-img { + width: 46rpx; + height: 46rpx; + display: inline-block; + vertical-align: -10rpx; + margin-right: 5rpx; +} \ No newline at end of file diff --git a/pages/site/index.js b/pages/site/index.js new file mode 100644 index 0000000..915b5ce --- /dev/null +++ b/pages/site/index.js @@ -0,0 +1,76 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + type : '', //类型 + listArr : [] //收货地址 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + if(options) { + this.setData({ + type: options.type + }) + } + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取地址列表 + this.listInfo(); + }, + + /** + * 地址列表 + */ + listInfo (){ + wx.$api.site.siteList().then(res => { + this.setData({ + listArr: res.data + }) + }).catch(err => { }) + }, + + /** + * 选择地址 + */ + 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() + }, + + /** + * 编辑地址 + */ + addressEdit(e) { + wx.navigateTo({ + url: './edit/edit?addressid=' + e.currentTarget.dataset.id, + }) + }, +}) \ No newline at end of file diff --git a/pages/site/index.json b/pages/site/index.json new file mode 100644 index 0000000..f30802c --- /dev/null +++ b/pages/site/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "地址管理" +} \ No newline at end of file diff --git a/pages/site/index.wxml b/pages/site/index.wxml new file mode 100644 index 0000000..d31a91f --- /dev/null +++ b/pages/site/index.wxml @@ -0,0 +1,37 @@ + + + + + + + + + + + {{item.name}} + + + {{item.mobile}} + + + 默认 + + + {{item.full_address}} + + + + + + 选择地址 + + + + + + + 暂无收货地址 + + + 添加收货地址 + \ No newline at end of file diff --git a/pages/site/index.wxss b/pages/site/index.wxss new file mode 100644 index 0000000..906ae0a --- /dev/null +++ b/pages/site/index.wxss @@ -0,0 +1,116 @@ +page{ + background-color: #f4f4f6; +} + +.list { + border-bottom: 90px solid transparent; + padding: 30rpx; + box-sizing: border-box; +} + +.address { + background-color: #FFFFFF; + margin-bottom: 30rpx; + padding: 30rpx; + box-sizing: border-box; + border-radius: 10rpx; +} + +.address:last-child { + margin-bottom: 0; +} + +.address-top { + display: flex; +} + +.address-img { + background-color: #eeeeee; + border-radius: 50%; + width: 60rpx; + height: 60rpx; + padding: 10rpx; + box-sizing: border-box; + margin-top: 25rpx; +} + +.address-img image { + width: 100%; + height: 100%; +} + +.address-btn { + width: 40rpx; + height: 40rpx; + margin-top: 62rpx; +} + +.address-cont { + width: calc(100% - 102rpx); + padding: 0 30rpx; + box-sizing: border-box; +} + +.address-cont-title { + display: flex; + margin-bottom: 20rpx; + line-height: 44rpx; +} + +.address-cont-mobile { + margin: 0 20rpx; + color: rgb(104, 104, 104); +} + +.address-cont-default { + background-color: #ff9951; + color: #FFFFFF; + font-size: 24rpx; + border-radius: 40rpx; + padding: 0 15rpx; + height: 38rpx; + line-height: 38rpx; + margin-top: 2rpx; +} + +.address-cont-text { + line-height: 42rpx; + font-size: 28rpx; +} + +.select { + text-align: right; + padding-top: 30rpx; +} + +.select-btn { + border: 2rpx solid #e92152; + color: #ff9951; + display: inline-block; + font-size: 28rpx; + padding: 0 30rpx; + line-height: 54rpx; + border-radius: 5rpx; +} + +/* 按钮 */ +.footer { + width: 100%; + height: 90px; + background-color: #FFFFFF; + position: fixed; + left: 0; + bottom: 0; + z-index: 9; + padding: 20px; + box-sizing: border-box; +} + +.btn { + line-height: 50px; + background-color: #e92152; + height: 100%; + text-align: center; + color: #FFFFFF; + border-radius: 10rpx; +} \ No newline at end of file diff --git a/pages/user/about/about.js b/pages/user/about/about.js new file mode 100644 index 0000000..9339bf4 --- /dev/null +++ b/pages/user/about/about.js @@ -0,0 +1,66 @@ +// pages/user/about/about.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/user/about/about.json b/pages/user/about/about.json new file mode 100644 index 0000000..fb72ae5 --- /dev/null +++ b/pages/user/about/about.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "关于我们" +} \ No newline at end of file diff --git a/pages/user/about/about.wxml b/pages/user/about/about.wxml new file mode 100644 index 0000000..500eb9e --- /dev/null +++ b/pages/user/about/about.wxml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/pages/user/about/about.wxss b/pages/user/about/about.wxss new file mode 100644 index 0000000..2ea6989 --- /dev/null +++ b/pages/user/about/about.wxss @@ -0,0 +1,8 @@ +.about { + width: 100%; +} + +image { + width: 100%; + display: block; +} \ No newline at end of file diff --git a/pages/user/code/code.js b/pages/user/code/code.js new file mode 100644 index 0000000..7c48f6a --- /dev/null +++ b/pages/user/code/code.js @@ -0,0 +1,172 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + barHeight : getApp().globalData.barHeight, // 状态栏高度 + shareSee : false, //分享弹出 + inviteText : '', //邀请码 + inviteCode : '', //二维码 + + //海报 + canvas : '' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + // 初始化画布 + wx.createSelectorQuery().select('#coverCanvas').fields({node: true, size: true}).exec(canvasNode => { + const canvas = canvasNode[0].node + canvas.width = 375 + canvas.height = 800 + this.setData({ + canvas + }) + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 小程序码 + // this.ShareInfo(); + }, + + /** + * 小程序码 + */ + ShareInfo() { + wx.$api.user.miniShare({ + url: '/pages/mall/index' + }).then(res => { + this.setData({ + inviteCode: res.data.qrcode + }) + }).catch(err => {}) + }, + + /** + * 生成海报 + */ + onCanvas(){ + wx.showLoading({ + title: '生成图片中...', + mask : true + }) + const canvas = this.data.canvas + const ctx = canvas.getContext('2d') + const codeImgEl = canvas.createImage() + const backBackEl = canvas.createImage() + + // codeImgEl.src = this.data.inviteCode //二维码 + codeImgEl.src = '/static/imgs/userHead.png' //二维码 + backBackEl.src = 'https://cdn.douhuofalv.com/images/2023/08/11/cd8093d6ab1a248e5154be48b0ddcaac.jpg' //背景素材 + const codeImgLoding = new Promise((resolve, reason) => { + codeImgEl.onload = () => { + resolve() + } + }) + const backBackLoding = new Promise((resolve, reason) => { + backBackEl.onload = () => { + resolve() + } + }) + Promise.all([codeImgLoding, backBackLoding]).then(() => { + ctx.drawImage(backBackEl, 0, 0, 375, 800) + // 绘制[二维码-白色背景] + ctx.fillStyle = "#ffffff"; + ctx.fillRect(140, 610, 130, 130); + + // 绘制[二维码-白色背景黑框] + ctx.strokeStyle = "#da2b54"; + ctx.lineWidth = 2 + ctx.strokeRect(140, 610, 132, 132); + + // 绘制[二维码] + ctx.drawImage(codeImgEl, 150, 620, 110, 110) + + // 文字 + ctx.font = "bold 14px Arial"; //字体大小 + ctx.fillStyle = "#ffffff"; //字体颜色 + ctx.textAlign = "center" + ctx.fillText('保存并分享二维码', 208, 770); + + wx.hideLoading() + wx.canvasToTempFilePath({ + canvas: this.data.canvas, + success : res => { + wx.saveImageToPhotosAlbum({ + filePath: res.tempFilePath, + success: saveRes => { + wx.showToast({ + title: '海报已保存至您的相册', + icon : 'none' + }) + this.setData({ + shareSee: false + }) + }, + fail: () => { + wx.hideLoading() + wx.showModal({ + title: '提示', + content: '暂未授权小程序写入您的相册,无法存储海报', + confirmColor: '#e50d01', + confirmText: '去设置', + success: res => { + if (res.confirm) { + wx.openSetting() + } + } + }) + } + }) + }, + }) + }).catch(err => { + wx.showToast({ + title: '图片加载失败', + icon : 'none' + }) + }) + }, + + /** + * 分享弹出 + */ + shareTap() { + this.setData({ + shareSee: !this.data.shareSee + }) + }, + + // 返回上一页 + returnGo() { + wx.navigateBack({ + delta: 1 + }) + }, + + /** + * 微信分享 + */ + onShareAppMessage(){ + this.setData({ + shareSee: false + }) + return { + title : '水感应修复、紧致、舒缓喷雾', + path : "/pages/index/index?invite=" + wx.getStorageSync("invite"), + imageUrl: "https://cdn.shuiganying.com/images/2023/04/04/9cd9968136e7efd85028fba69e4c587a.jpg" + } + } +}) \ No newline at end of file diff --git a/pages/user/code/code.json b/pages/user/code/code.json new file mode 100644 index 0000000..f7efdab --- /dev/null +++ b/pages/user/code/code.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationStyle": "custom" + } \ No newline at end of file diff --git a/pages/user/code/code.wxml b/pages/user/code/code.wxml new file mode 100644 index 0000000..5c10c85 --- /dev/null +++ b/pages/user/code/code.wxml @@ -0,0 +1,35 @@ + + + + + + + + + + + 保存并分享二维码 + + + + 分享 + + + + + + + + + + + + + 保存二维码 + + + 取消 + \ No newline at end of file diff --git a/pages/user/code/code.wxss b/pages/user/code/code.wxss new file mode 100644 index 0000000..7972b93 --- /dev/null +++ b/pages/user/code/code.wxss @@ -0,0 +1,148 @@ +/* 返回上一页 */ +.navigation{ + position: fixed; + top: 0; + left: 0; + z-index: 99; + width: 100%; + height: 90rpx; + background-color: transparent; + transition: .2s; +} + +.navigation.active { + background-color: transparent; +} + +.navigation-arrow { + width: 44rpx; + height: 44rpx; + margin: 20rpx 15rpx 0 20rpx; +} + + +/* 二维码 */ +.code { + width: 100vw; + height: 100vh; + position: relative; +} + +.code-back { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; +} + +.code-cont { + width: 400rpx; + position: absolute; + z-index: 9; + text-align: center; + left: calc(50% - 200rpx); + bottom: 5%; +} + +.code-img{ + margin: 0 auto 20rpx; + overflow: hidden; + width: 260rpx; + height: 260rpx; + border: 4rpx solid #ff4f64; + background-color: #ffffff; + padding: 10rpx; + box-sizing: border-box; +} + +.code-img image { + width: 100%; +} + +.code-text { + color: #ffffff; + font-size: 32rpx; +} + +.code-share { + position: absolute; + z-index: 10; + right: 0; + bottom: 15%; + background: linear-gradient(to right, #fffafb, #ffd4dd); + width: 50rpx; + text-align: center; + border-radius: 26rpx 0 0 26rpx; + padding: 30rpx 10rpx 30rpx 15rpx; + box-shadow: 0 0 0 6rpx rgba(249, 96, 116, .8); +} + +.code-share-name { + writing-mode:vertical-rl; + font-size: 30rpx; + padding-left: 4rpx; + color: #da2b54; +} + +.code-share image { + width: 36rpx; + height: 36rpx; + margin-bottom: 5rpx; +} + +.sharePop { + position: fixed; + width: 100%; + z-index: 99; + left: 0; + bottom: 0; + background-color: #ffffff; + display: none; +} + +.sharePop.active { + display: block; +} + +.shareCont-label image { + width: 60rpx; + height: 60rpx; + display: block; + margin: 0 auto 10rpx; +} + +.shareCancel { + border-top: 2rpx solid #ebebeb; + color: #000000; + width: 100%; + text-align: center; + line-height: 100rpx; +} + +.shareCont{ + display: flex; + padding: 30rpx 0; +} + +.shareCont-label { + color: #000000; + flex: 2; + text-align: center; + font-size: 28rpx; +} + +.codeShare-button { + background-color: transparent; + padding: 0; + font-weight: normal; +} + +/* canvas */ +.canvas-img { + position: fixed; + left: 0%; + /* left: -10000%; */ + top: 0; + z-index: 99; +} \ No newline at end of file diff --git a/pages/user/index.js b/pages/user/index.js new file mode 100644 index 0000000..c012f08 --- /dev/null +++ b/pages/user/index.js @@ -0,0 +1,66 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ +Page({ + + /** + * 页面的初始数据 + */ + data: { + userLogin: false, + userData: '', // 用户信息 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取登录状态 + if(wx.getStorageSync("token") != ''){ + this.setData({ + userLogin: true + }) + // 获取用户信息 + this.userInfo(); + return + } + this.setData({ + userLogin: false + }) + }, + + /** + * 用户信息 + */ + userInfo() { + wx.$api.user.userIndex().then(res => { + this.setData({ + userData: res.data + }) + console.log(res) + }).catch(err => {}) + }, + + /** + * 处理未登录时的转跳 + */ + userNav(e){ + let pageUrl = e.currentTarget.dataset.url + if(wx.getStorageSync("token") != ''){ + wx.navigateTo({ + url: pageUrl + }) + }else{ + // 去登录 + wx.navigateTo({ + url: "/pages/login/index" + }) + } + } +}) \ No newline at end of file diff --git a/pages/user/index.json b/pages/user/index.json new file mode 100644 index 0000000..0adfdc3 --- /dev/null +++ b/pages/user/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "我的", + "navigationBarBackgroundColor": "#fbe2e1" +} \ No newline at end of file diff --git a/pages/user/index.wxml b/pages/user/index.wxml new file mode 100644 index 0000000..dfa2652 --- /dev/null +++ b/pages/user/index.wxml @@ -0,0 +1,122 @@ + + + + + {{userData.user.nickname}} + 生命可以如此精彩~ + + 编辑 > + + + + + + 请先登录 + 生命可以如此精彩~ + + + + + + + + + + 我的订单 + 全部 > + + + + + 待付款 + + {{userData.order.init}} + + + + + 待发货 + + {{userData.order.paid}} + + + + + 待收货 + + {{userData.order.delivered}} + + + + + 已签收 + + + + + + + + + + + + + 我的账户 + + + + 我的银行卡 + + + + 我的团队 + + + + 邀请码 + + + + 我的地址 + + + + 意见反馈 + + + + 关于我们 + + + + 用户设置 + + + + + + + + + 为你推荐 + + + + + + + + {{item.name}} + {{item.description}} + + ¥{{item.original_price}} + 游览 {{item.clicks}} + + + + + \ No newline at end of file diff --git a/pages/user/index.wxss b/pages/user/index.wxss new file mode 100644 index 0000000..125118c --- /dev/null +++ b/pages/user/index.wxss @@ -0,0 +1,241 @@ +page { + background-color: #f6f6f6; +} + +/* 用户 */ +.linearBack { + background-image: linear-gradient(to top, #f6f6f6 20%, #fbe2e1); + padding: 30rpx; + box-sizing: border-box; +} + +.head { + position: relative; +} + +.head-img { + width: 120rpx; + height: 120rpx; + border-radius: 50%; + border: 4rpx solid #ffffff; +} + +.head-cont { + position: absolute; + left: 0; + top: 0; + width: 100%; + padding: 15rpx 30rpx 0 160rpx; + box-sizing: border-box; +} + +.head-name { + font-size: 34rpx; + font-weight: 600; +} + +.head-text { + line-height: 70rpx; + font-size: 26rpx; + color: #111111; +} + +.head-edit { + position: absolute; + right: 0; + top: 0; + line-height: 120rpx; + font-size: 28rpx; +} + +/* 订单 */ +.userCont { + padding: 15rpx 30rpx; + box-sizing: border-box; +} + +.white { + background-color: white; + border-radius: 20rpx; + box-sizing: border-box; +} + +.order-top { + display: flex; + line-height: 40rpx; + padding: 30rpx 30rpx 15rpx; + box-sizing: border-box; +} + +.order-title { + flex: 1; + font-size: 32rpx; +} + +.order-more { + font-size: 28rpx; + color: #666666; +} + +.order-list { + display: flex; + padding: 0 0 10rpx; +} + +.order-item { + width: 25%; + float: left; + text-align: center; + position: relative; + margin: 20rpx 0; +} + +.order-icon { + width: 56rpx; +} + +.order-label { + font-size: 26rpx; +} + +.order--number { + border-radius: 50%; + color: #ffffff; + background-color: #da2b54; + position: absolute; + top: -10rpx; + right: 40rpx; + font-size: 24rpx; + width: 30rpx; + height: 30rpx; + line-height: 30rpx; + border: 4rpx solid #ffffff; +} + + +/* 工具 */ +.tool-list { + overflow: hidden; + padding: 15rpx 0; +} + +.tool-icon { + width: 62rpx; + margin-bottom: 10rpx; +} + +/* 推荐 */ +.goods { + padding: 30rpx; + box-sizing: border-box; +} + +.goods-title { + text-align: center; + margin-bottom: 30rpx; +} + +.goods-title-name { + position: relative; + color: #da2b54; + font-size: 32rpx; + width: 260rpx; + margin: 0 auto; +} + +.goods-title text { + display: inline-block; +} + +.goods-title-left::after, +.goods-title-right::after { + position: absolute; + top: calc(50% - 6rpx); + content: ''; + width: 10rpx; + height: 10rpx; + border-radius: 50%; + background-color: #ffffff; + border: 4rpx solid #da2b54; + z-index: 9; +} +.goods-title-left::after { + right: 30rpx; +} +.goods-title-right::after { + left: 30rpx; +} + +.goods-title-left::before, +.goods-title-right::before { + position: absolute; + top: calc(50% - 0rpx); + content: ''; + width: 60rpx; + height: 4rpx; +} +.goods-title-left::before { + left: -20rpx; + background-image: linear-gradient(to right, #f6f6f6, #da2b54); +} +.goods-title-right::before { + right: -20rpx; + background-image: linear-gradient(to right, #da2b54, #f6f6f6); +} + +.goodsList { + flex-wrap: wrap; + justify-content: flex-start; +} + +.goodsItem { + margin: 0 15rpx 20rpx; + width: calc(50% - 30rpx); + display: inline-block; + background-color: white; + border-radius: 30rpx; + overflow: hidden; +} + +.goodsItem-img { + width: 100%; + position: relative; + padding-top: 100%; +} + +.goodsItem-img image { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; +} + +.goodsItem-cont { + padding: 30rpx 20rpx; + box-sizing: border-box; +} + +.goodsItem-text { + color: #ff9b26; + font-size: 26rpx; + line-height: 54rpx; +} + +.goodsItem-tips { + margin-top: 20rpx; + display: flex; + line-height: 40rpx; +} + +.goodsItem-price { + flex: 1; + color: #ff1122; + font-size: 32rpx; + font-weight: 600; +} + +.goodsItem-sales { + font-size: 26rpx; + color: #999999; +} \ No newline at end of file diff --git a/pages/user/setup/setup.js b/pages/user/setup/setup.js new file mode 100644 index 0000000..4b58371 --- /dev/null +++ b/pages/user/setup/setup.js @@ -0,0 +1,135 @@ +// pages/user/setup/setup.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + userData : '', // 基础信息 + avatar : '', + nickName : '', + nameState : false, + disabled : false, + reviseType: '', // 修改类型 + nameValue : '' // 限制5个字符 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 获取登录状态 + if(wx.getStorageSync("token") != ''){ + // 获取用户信息 + this.userInfo(); + } + }, + + /** + * 用户设置信息 + */ + userInfo() { + wx.$api.user.userSetup().then(res => { + this.setData({ + userData : res.data, + avatar : res.data.avatar, + nickName : res.data.nickname + }) + }).catch(err => {}) + }, + + /** + * 头像上传 + */ + updImg(e){ + let type = e.currentTarget.dataset.type + this.setData({ + reviseType: e.currentTarget.dataset.type + }) + if(type == 'avatar') { + wx.chooseMedia({ + count : 1, + mediaType: ['image'], + success : path => { + // 上传图片 + wx.$api.file.uploadImg(path.tempFiles[0].tempFilePath, {}).then(res=>{ + this.setData({ + avatar:res.url + }) + this.settingInfo(type, res.path) + }) + } + }) + return + } + + // 修改用户名 + this.setData({ + nameState: true + }) + }, + + /* + 姓名截取 + */ + bindinput(e) { + this.setData({ + nameValue: e.detail.value.substr(0,5) + }) + }, + + // 修改用户名 + freeform() { + this.settingInfo(this.data.reviseType, this.data.nameValue) + }, + + /** + * 上传用户信息 + */ + settingInfo(key, value) { + wx.$api.user.setting(key, { + value: value + }).then(() => { + this.setData({ + nameState: false, + nameValue: '' + }) + // 获取用户信息 + this.userInfo(); + }).catch(err => {}) + }, + + // 关闭弹框 + establish() { + this.setData({ + nameState: false, + nameValue: '' + }) + }, + + + /** + * 退出登录 + */ + outLogin() { + wx.showModal({ + title : '提示', + content : '是否退出登录', + success : res=> { + if (res.confirm) { + // 清理客户端登录缓存 + wx.removeStorageSync("token") + + wx.switchTab({ + url: '/pages/user/index' + }) + } + } + }) + }, +}) \ No newline at end of file diff --git a/pages/user/setup/setup.json b/pages/user/setup/setup.json new file mode 100644 index 0000000..57e5f5a --- /dev/null +++ b/pages/user/setup/setup.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "用户设置" + } \ No newline at end of file diff --git a/pages/user/setup/setup.wxml b/pages/user/setup/setup.wxml new file mode 100644 index 0000000..fc8ccb7 --- /dev/null +++ b/pages/user/setup/setup.wxml @@ -0,0 +1,51 @@ + + + + + 修改头像 + + + + + + + + + + 用户昵称 + + + {{nickName}} + + + + + + + + + + 退出登录 + + + + + + + + + + + + {{reviseType == 'nickname' ? '用户昵称' : '真实姓名'}} +
+ + + + + 暂不修改 + + +
+
+
\ No newline at end of file diff --git a/pages/user/setup/setup.wxss b/pages/user/setup/setup.wxss new file mode 100644 index 0000000..f55710c --- /dev/null +++ b/pages/user/setup/setup.wxss @@ -0,0 +1,173 @@ +page { + background-color: #f8f8f8; +} + +.setupItem { + margin-bottom: 30rpx; + background-color: #ffffff; +} + +.label { + line-height: 60rpx; + display: flex; + padding: 30rpx; + box-sizing: border-box; + border-bottom: 2rpx solid #f7f9fa; +} + +.label:last-child { + border: none; +} + +.label-name { + display: flex; + flex: 1; +} + +.label-name-img { + width: 34rpx; + height: 34rpx; + margin-top: 14rpx; + margin-right: 20rpx; +} + +.label-tips, +.entry { + display: flex; + color: rgb(110, 110, 110); +} + +.label-name-head { + width: 54rpx; + height: 54rpx; + border-radius: 50%; + margin-right: 20rpx; +} + +.label-name-nickName { + padding-right: 10rpx; + color: rgb(110, 110, 110); + font-size: 30rpx; +} + +.label-name-arrow { + width: 24rpx; + height: 24rpx; + margin-top: 18rpx; +} + +.label-name-number { + display: inline-block; + background-color: #f8f8f8; + color: #ffffff; + border-radius: 60rpx; + height: 36rpx; + line-height: 36rpx; + padding: 0 20rpx; + font-size: 28rpx; + margin: 12rpx 20rpx 0 0; +} + + +/* 弹出层提示 */ +.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: 240px; + margin-left: -120px; + margin-top: -340rpx; + position: fixed; + z-index: 100; +} + +.publicPop-cont { + width: 100%; + background-color: #FFFFFF; + border-radius: 30rpx; + text-align: center; + overflow: hidden; + padding: 50rpx 0 0; + box-sizing: border-box; +} + +.free-title { + font-weight: 600; + margin-bottom: 40rpx; + font-size: 34rpx; +} + +.free-input { + padding: 0 30rpx; + box-sizing: border-box; + height: 90rpx; + line-height: 90rpx; + font-size: 30rpx; +} + +.free-input input { + height: 90rpx; + border-radius: 10rpx; + background-color: #f8f8f8; +} + +.publicPop-text { + color: #9d9d9d; + font-size: 32rpx; + text-align: center; +} + +.publicPop-text text { + color: #000000; + font-size: 40rpx; + display: block; + font-weight: 600; + margin: 20rpx 0 10rpx; +} + +.publicPop-btn { + line-height: 80rpx; + margin-top: 70rpx; + font-size: 32rpx; + display: flex; + border-top: 2rpx solid #f8f8f8; +} + +.publicPop-btn button { + margin: 0 !important; + padding: 0 !important; + background-color: transparent; + font-weight: normal !important; + color: #6c78f8; +} + +.publicPop-btn-go { + width: 50% !important; + text-align: center; + height: 90rpx !important; + line-height: 90rpx !important; + font-size: 30rpx !important; +} + +.publicPop-btn-border { + position: relative; +} + +.publicPop-btn-border::after { + position: absolute; + content: ''; + right: 0; + top: 0; + width: 2rpx; + height: 100rpx; + background-color: #f8f8f8; +} \ No newline at end of file diff --git a/pages/user/team/index.js b/pages/user/team/index.js new file mode 100644 index 0000000..de20f2c --- /dev/null +++ b/pages/user/team/index.js @@ -0,0 +1,77 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + teamsInfo : '', + perfInfo : '', + childrenArr : [], + page : {}, //分页信息 + lodingStats : false, //加载状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 我的团队 + this.teamInfo(); + }, + + /** + * 我的团队 + */ + teamInfo(page) { + wx.$api.user.teamList({ + page: page + }).then(res => { + console.log(res.data) + let listArr = this.data.childrenArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.children.data) + this.setData({ + teamsInfo : res.data.teams, + perfInfo : res.data.perf, + childrenArr : newData, + page : res.data.children.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + }).catch(err => {}) + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取我的团队 + this.teamInfo(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取我的团队 + this.teamInfo(pageNumber); + } + } +}) \ No newline at end of file diff --git a/pages/user/team/index.json b/pages/user/team/index.json new file mode 100644 index 0000000..5bbb260 --- /dev/null +++ b/pages/user/team/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "我的团队" +} \ No newline at end of file diff --git a/pages/user/team/index.wxml b/pages/user/team/index.wxml new file mode 100644 index 0000000..e8b53fd --- /dev/null +++ b/pages/user/team/index.wxml @@ -0,0 +1,68 @@ + + + 个人当日消费额 + {{perfInfo.day_perf}} + + + + 个人累计消费额 + {{perfInfo.self_perf}} + + + + + + 个人当日消费额 + {{perfInfo.group_perf}} + + + + + + 我的客户 + {{teamsInfo.recommand}} + + + + 团队客户 + {{teamsInfo.group}} + + + + + + + 我的客户列表 + 共 {{teamsInfo.recommand}} 名 + + + + + + + + 李莉莉 + + + 152****7708 + + + + + 2023-08-18 + + + + + 加载中... + + + 没有更多了~ + + + + + + 暂无数据 + + \ No newline at end of file diff --git a/pages/user/team/index.wxss b/pages/user/team/index.wxss new file mode 100644 index 0000000..47b6488 --- /dev/null +++ b/pages/user/team/index.wxss @@ -0,0 +1,130 @@ +page { + background-color: #f6f6f6; + padding: 30rpx 15rpx; + box-sizing: border-box; +} + +.item { + display: flex; +} + +.item-label { + flex: 2; + background-color: #ffffff; + border-radius: 20rpx; + padding: 30rpx; + box-sizing: border-box; + margin: 0 15rpx 30rpx; + position: relative; +} + +.item-blue { + background-image: linear-gradient(to top, #ffffff, #eef7ff); +} + +.item-name { + margin-bottom: 20rpx; + color: #333333; +} + +.item-number { + font-weight: 600; + font-size: 42rpx; +} + +.item-number-red { + color: #da2b54; +} + +.item-number-yellow { + color: #ffaa17; +} + +.item-number-blue { + color: #49a7ff; +} + +.item-icon { + width: 90rpx; + position: absolute; + bottom: 15rpx; + right: 15rpx; +} + +.list { + padding: 0 15rpx; + box-sizing: border-box; +} + +.listTitle { + display: flex; + line-height: 58rpx; +} + +.listTitle-name { + flex: 1; + font-weight: 600; + font-size: 32rpx; +} + +.listTitle-number { + font-size: 28rpx; +} + +.listItem { + margin-top: 30rpx; +} + +.listItem-item { + background-color: #ffffff; + border-radius: 20rpx; + padding: 30rpx; + box-sizing: border-box; + display: flex; + margin-bottom: 30rpx; +} + +.listItem-top { + position: relative; + flex: 1; +} + +.listItem-head { + width: 100rpx; +} + +.listItem-cont { + position: absolute; + left: 0; + top: 0; + width: 100%; + padding-left: 130rpx; +} + +.listItem-name { + font-weight: 600; +} + +.listItem-tel { + margin-top: 20rpx; + color: #666666; +} + +.listItem-time { + line-height: 100rpx; +} + + +/* 暂无数据 */ +.pages-no { + background-color: #fff; + margin-top: 30rpx; + text-align: center; + padding: 120rpx 0; + color: #6d6d6d; + font-size: 28rpx; +} + +.pages-no image { + width: 180rpx; +} \ No newline at end of file diff --git a/project.config.json b/project.config.json new file mode 100644 index 0000000..143ba72 --- /dev/null +++ b/project.config.json @@ -0,0 +1,52 @@ +{ + "description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", + "setting": { + "bundle": false, + "userConfirmedBundleSwitch": false, + "urlCheck": true, + "scopeDataCheck": false, + "coverView": true, + "es6": true, + "postcss": true, + "compileHotReLoad": false, + "lazyloadPlaceholderEnable": false, + "preloadBackgroundData": false, + "minified": true, + "autoAudits": false, + "newFeature": false, + "uglifyFileName": false, + "uploadWithSourceMap": true, + "useIsolateContext": true, + "nodeModules": false, + "enhance": true, + "useMultiFrameRuntime": true, + "showShadowRootInWxmlPanel": true, + "packNpmManually": false, + "enableEngineNative": false, + "packNpmRelationList": [], + "minifyWXSS": true, + "showES6CompileOption": false, + "minifyWXML": true, + "babelSetting": { + "ignore": [], + "disablePlugins": [], + "outputPath": "" + }, + "useStaticServer": true, + "checkInvalidKey": true, + "disableUseStrict": false, + "useCompilerPlugins": false, + "ignoreUploadUnusedFiles": true + }, + "compileType": "miniprogram", + "condition": {}, + "editorSetting": { + "tabIndent": "insertSpaces", + "tabSize": 4 + }, + "packOptions": { + "ignore": [], + "include": [] + }, + "appid": "wx7662853c6f7f46b4" +} \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json new file mode 100644 index 0000000..b054770 --- /dev/null +++ b/project.private.config.json @@ -0,0 +1,22 @@ +{ + "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", + "projectname": "xuan_wechat", + "setting": { + "compileHotReLoad": true, + "urlCheck": true + }, + "condition": { + "miniprogram": { + "list": [ + { + "name": "", + "pathName": "pages/login/index", + "query": "", + "launchMode": "default", + "scene": null + } + ] + } + }, + "libVersion": "2.33.0" +} \ No newline at end of file diff --git a/sitemap.json b/sitemap.json new file mode 100644 index 0000000..ca02add --- /dev/null +++ b/sitemap.json @@ -0,0 +1,7 @@ +{ + "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", + "rules": [{ + "action": "allow", + "page": "*" + }] +} \ No newline at end of file diff --git a/static/icons/address-icon.png b/static/icons/address-icon.png new file mode 100644 index 0000000..4a01260 Binary files /dev/null and b/static/icons/address-icon.png differ diff --git a/static/icons/address.png b/static/icons/address.png new file mode 100644 index 0000000..35b8429 Binary files /dev/null and b/static/icons/address.png differ diff --git a/static/icons/address_tool_00.png b/static/icons/address_tool_00.png new file mode 100644 index 0000000..ad1ad77 Binary files /dev/null and b/static/icons/address_tool_00.png differ diff --git a/static/icons/address_tool_01.png b/static/icons/address_tool_01.png new file mode 100644 index 0000000..30da581 Binary files /dev/null and b/static/icons/address_tool_01.png differ diff --git a/static/icons/arrowWrite.png b/static/icons/arrowWrite.png new file mode 100644 index 0000000..f05e62a Binary files /dev/null and b/static/icons/arrowWrite.png differ diff --git a/static/icons/arrow_more.png b/static/icons/arrow_more.png new file mode 100644 index 0000000..c734f3b Binary files /dev/null and b/static/icons/arrow_more.png differ diff --git a/static/icons/circle_add.png b/static/icons/circle_add.png new file mode 100644 index 0000000..f81b481 Binary files /dev/null and b/static/icons/circle_add.png differ diff --git a/static/icons/close.png b/static/icons/close.png new file mode 100644 index 0000000..b7858f5 Binary files /dev/null and b/static/icons/close.png differ diff --git a/static/icons/goodsShare.png b/static/icons/goodsShare.png new file mode 100644 index 0000000..213fc24 Binary files /dev/null and b/static/icons/goodsShare.png differ diff --git a/static/icons/homeBlack.png b/static/icons/homeBlack.png new file mode 100644 index 0000000..5e4de66 Binary files /dev/null and b/static/icons/homeBlack.png differ diff --git a/static/icons/homeWrite.png b/static/icons/homeWrite.png new file mode 100644 index 0000000..f8745f0 Binary files /dev/null and b/static/icons/homeWrite.png differ diff --git a/static/icons/loadingGif.gif b/static/icons/loadingGif.gif new file mode 100644 index 0000000..d08d4e3 Binary files /dev/null and b/static/icons/loadingGif.gif differ diff --git a/static/icons/notice.png b/static/icons/notice.png new file mode 100644 index 0000000..e488bb6 Binary files /dev/null and b/static/icons/notice.png differ diff --git a/static/icons/orderArrow.png b/static/icons/orderArrow.png new file mode 100644 index 0000000..bfbd9ce Binary files /dev/null and b/static/icons/orderArrow.png differ diff --git a/static/icons/price_icon.png b/static/icons/price_icon.png new file mode 100644 index 0000000..393348f Binary files /dev/null and b/static/icons/price_icon.png differ diff --git a/static/icons/price_icon_active.png b/static/icons/price_icon_active.png new file mode 100644 index 0000000..7e893a7 Binary files /dev/null and b/static/icons/price_icon_active.png differ diff --git a/static/icons/price_nr.png b/static/icons/price_nr.png new file mode 100644 index 0000000..99f6a65 Binary files /dev/null and b/static/icons/price_nr.png differ diff --git a/static/icons/refresh_loding.gif b/static/icons/refresh_loding.gif new file mode 100644 index 0000000..5bb90fd Binary files /dev/null and b/static/icons/refresh_loding.gif differ diff --git a/static/icons/reportColse.png b/static/icons/reportColse.png new file mode 100644 index 0000000..392ec82 Binary files /dev/null and b/static/icons/reportColse.png differ diff --git a/static/icons/returnBlue.png b/static/icons/returnBlue.png new file mode 100644 index 0000000..b27d7e6 Binary files /dev/null and b/static/icons/returnBlue.png differ diff --git a/static/icons/returnWrite.png b/static/icons/returnWrite.png new file mode 100644 index 0000000..0a47644 Binary files /dev/null and b/static/icons/returnWrite.png differ diff --git a/static/icons/search.png b/static/icons/search.png new file mode 100644 index 0000000..1a53fa9 Binary files /dev/null and b/static/icons/search.png differ diff --git a/static/icons/see.png b/static/icons/see.png new file mode 100644 index 0000000..1731fed Binary files /dev/null and b/static/icons/see.png differ diff --git a/static/icons/see_active.png b/static/icons/see_active.png new file mode 100644 index 0000000..2eb1a4e Binary files /dev/null and b/static/icons/see_active.png differ diff --git a/static/icons/shop.png b/static/icons/shop.png new file mode 100644 index 0000000..175219f Binary files /dev/null and b/static/icons/shop.png differ diff --git a/static/icons/siteEdit.png b/static/icons/siteEdit.png new file mode 100644 index 0000000..5dfc56d Binary files /dev/null and b/static/icons/siteEdit.png differ diff --git a/static/icons/siteIcon.png b/static/icons/siteIcon.png new file mode 100644 index 0000000..7c4c323 Binary files /dev/null and b/static/icons/siteIcon.png differ diff --git a/static/icons/sort.png b/static/icons/sort.png new file mode 100644 index 0000000..6908243 Binary files /dev/null and b/static/icons/sort.png differ diff --git a/static/imgs/address.png b/static/imgs/address.png new file mode 100644 index 0000000..7608b5e Binary files /dev/null and b/static/imgs/address.png differ diff --git a/static/imgs/cont_null.png b/static/imgs/cont_null.png new file mode 100644 index 0000000..473d916 Binary files /dev/null and b/static/imgs/cont_null.png differ diff --git a/static/imgs/loginImg.png b/static/imgs/loginImg.png new file mode 100644 index 0000000..099ce6b Binary files /dev/null and b/static/imgs/loginImg.png differ diff --git a/static/imgs/loginTitle.png b/static/imgs/loginTitle.png new file mode 100644 index 0000000..a60aa34 Binary files /dev/null and b/static/imgs/loginTitle.png differ diff --git a/static/imgs/logistics.png b/static/imgs/logistics.png new file mode 100644 index 0000000..e132fff Binary files /dev/null and b/static/imgs/logistics.png differ diff --git a/static/imgs/order_01.png b/static/imgs/order_01.png new file mode 100644 index 0000000..542f246 Binary files /dev/null and b/static/imgs/order_01.png differ diff --git a/static/imgs/order_02.png b/static/imgs/order_02.png new file mode 100644 index 0000000..b8f033f Binary files /dev/null and b/static/imgs/order_02.png differ diff --git a/static/imgs/order_03.png b/static/imgs/order_03.png new file mode 100644 index 0000000..70fadad Binary files /dev/null and b/static/imgs/order_03.png differ diff --git a/static/imgs/order_04.png b/static/imgs/order_04.png new file mode 100644 index 0000000..b48edba Binary files /dev/null and b/static/imgs/order_04.png differ diff --git a/static/imgs/order_05.png b/static/imgs/order_05.png new file mode 100644 index 0000000..ac6e669 Binary files /dev/null and b/static/imgs/order_05.png differ diff --git a/static/imgs/teamIcon_01.png b/static/imgs/teamIcon_01.png new file mode 100644 index 0000000..d8f3756 Binary files /dev/null and b/static/imgs/teamIcon_01.png differ diff --git a/static/imgs/teamIcon_02.png b/static/imgs/teamIcon_02.png new file mode 100644 index 0000000..d43cc1f Binary files /dev/null and b/static/imgs/teamIcon_02.png differ diff --git a/static/imgs/teamIcon_03.png b/static/imgs/teamIcon_03.png new file mode 100644 index 0000000..b965c8c Binary files /dev/null and b/static/imgs/teamIcon_03.png differ diff --git a/static/imgs/teamIcon_04.png b/static/imgs/teamIcon_04.png new file mode 100644 index 0000000..eb0e94a Binary files /dev/null and b/static/imgs/teamIcon_04.png differ diff --git a/static/imgs/text_null.png b/static/imgs/text_null.png new file mode 100644 index 0000000..1326295 Binary files /dev/null and b/static/imgs/text_null.png differ diff --git a/static/imgs/tool_01.png b/static/imgs/tool_01.png new file mode 100644 index 0000000..52400c8 Binary files /dev/null and b/static/imgs/tool_01.png differ diff --git a/static/imgs/tool_02.png b/static/imgs/tool_02.png new file mode 100644 index 0000000..99d7009 Binary files /dev/null and b/static/imgs/tool_02.png differ diff --git a/static/imgs/tool_03.png b/static/imgs/tool_03.png new file mode 100644 index 0000000..2acd08d Binary files /dev/null and b/static/imgs/tool_03.png differ diff --git a/static/imgs/tool_04.png b/static/imgs/tool_04.png new file mode 100644 index 0000000..3f149ef Binary files /dev/null and b/static/imgs/tool_04.png differ diff --git a/static/imgs/tool_05.png b/static/imgs/tool_05.png new file mode 100644 index 0000000..46f46ba Binary files /dev/null and b/static/imgs/tool_05.png differ diff --git a/static/imgs/tool_06.png b/static/imgs/tool_06.png new file mode 100644 index 0000000..ff87f70 Binary files /dev/null and b/static/imgs/tool_06.png differ diff --git a/static/imgs/tool_07.png b/static/imgs/tool_07.png new file mode 100644 index 0000000..87e12e0 Binary files /dev/null and b/static/imgs/tool_07.png differ diff --git a/static/imgs/tool_08.png b/static/imgs/tool_08.png new file mode 100644 index 0000000..166a577 Binary files /dev/null and b/static/imgs/tool_08.png differ diff --git a/static/imgs/userHead.png b/static/imgs/userHead.png new file mode 100644 index 0000000..8642e3a Binary files /dev/null and b/static/imgs/userHead.png differ diff --git a/static/ls/1.jpg b/static/ls/1.jpg new file mode 100644 index 0000000..1acb8ac Binary files /dev/null and b/static/ls/1.jpg differ diff --git a/static/ls/10.png b/static/ls/10.png new file mode 100644 index 0000000..781a7cc Binary files /dev/null and b/static/ls/10.png differ diff --git a/static/ls/11.png b/static/ls/11.png new file mode 100644 index 0000000..85c2f09 Binary files /dev/null and b/static/ls/11.png differ diff --git a/static/ls/12.png b/static/ls/12.png new file mode 100644 index 0000000..4240b6c Binary files /dev/null and b/static/ls/12.png differ diff --git a/static/ls/13.png b/static/ls/13.png new file mode 100644 index 0000000..3ec995e Binary files /dev/null and b/static/ls/13.png differ diff --git a/static/ls/14.png b/static/ls/14.png new file mode 100644 index 0000000..96952d5 Binary files /dev/null and b/static/ls/14.png differ diff --git a/static/ls/15.png b/static/ls/15.png new file mode 100644 index 0000000..9095f13 Binary files /dev/null and b/static/ls/15.png differ diff --git a/static/ls/16.jpg b/static/ls/16.jpg new file mode 100644 index 0000000..73ed4e4 Binary files /dev/null and b/static/ls/16.jpg differ diff --git a/static/ls/17.jpg b/static/ls/17.jpg new file mode 100644 index 0000000..d50ce65 Binary files /dev/null and b/static/ls/17.jpg differ diff --git a/static/ls/18.jpg b/static/ls/18.jpg new file mode 100644 index 0000000..a22f74b Binary files /dev/null and b/static/ls/18.jpg differ diff --git a/static/ls/19.jpg b/static/ls/19.jpg new file mode 100644 index 0000000..1fb50c3 Binary files /dev/null and b/static/ls/19.jpg differ diff --git a/static/ls/2.jpg b/static/ls/2.jpg new file mode 100644 index 0000000..93e6550 Binary files /dev/null and b/static/ls/2.jpg differ diff --git a/static/ls/2.png b/static/ls/2.png new file mode 100644 index 0000000..87b0738 Binary files /dev/null and b/static/ls/2.png differ diff --git a/static/ls/3.png b/static/ls/3.png new file mode 100644 index 0000000..cc607b5 Binary files /dev/null and b/static/ls/3.png differ diff --git a/static/ls/4.png b/static/ls/4.png new file mode 100644 index 0000000..0a7e81c Binary files /dev/null and b/static/ls/4.png differ diff --git a/static/ls/5.png b/static/ls/5.png new file mode 100644 index 0000000..ceba64b Binary files /dev/null and b/static/ls/5.png differ diff --git a/static/ls/7.png b/static/ls/7.png new file mode 100644 index 0000000..1e90057 Binary files /dev/null and b/static/ls/7.png differ diff --git a/static/ls/8.png b/static/ls/8.png new file mode 100644 index 0000000..caf15a5 Binary files /dev/null and b/static/ls/8.png differ diff --git a/static/ls/9.png b/static/ls/9.png new file mode 100644 index 0000000..b7b531d Binary files /dev/null and b/static/ls/9.png differ diff --git a/static/tabBarIcon/tabBar_00.png b/static/tabBarIcon/tabBar_00.png new file mode 100644 index 0000000..cdf8fe7 Binary files /dev/null and b/static/tabBarIcon/tabBar_00.png differ diff --git a/static/tabBarIcon/tabBar_01.png b/static/tabBarIcon/tabBar_01.png new file mode 100644 index 0000000..8999bee Binary files /dev/null and b/static/tabBarIcon/tabBar_01.png differ diff --git a/static/tabBarIcon/tabBar_02.png b/static/tabBarIcon/tabBar_02.png new file mode 100644 index 0000000..1bef7ea Binary files /dev/null and b/static/tabBarIcon/tabBar_02.png differ diff --git a/static/tabBarIcon/tabBar_03.png b/static/tabBarIcon/tabBar_03.png new file mode 100644 index 0000000..4b62d12 Binary files /dev/null and b/static/tabBarIcon/tabBar_03.png differ diff --git a/static/tabBarIcon/tabBar_selected_00.png b/static/tabBarIcon/tabBar_selected_00.png new file mode 100644 index 0000000..25ace18 Binary files /dev/null and b/static/tabBarIcon/tabBar_selected_00.png differ diff --git a/static/tabBarIcon/tabBar_selected_01.png b/static/tabBarIcon/tabBar_selected_01.png new file mode 100644 index 0000000..c89955e Binary files /dev/null and b/static/tabBarIcon/tabBar_selected_01.png differ diff --git a/static/tabBarIcon/tabBar_selected_02.png b/static/tabBarIcon/tabBar_selected_02.png new file mode 100644 index 0000000..d075a3d Binary files /dev/null and b/static/tabBarIcon/tabBar_selected_02.png differ diff --git a/static/tabBarIcon/tabBar_selected_03.png b/static/tabBarIcon/tabBar_selected_03.png new file mode 100644 index 0000000..da2ff1c Binary files /dev/null and b/static/tabBarIcon/tabBar_selected_03.png differ diff --git a/utils/util.js b/utils/util.js new file mode 100644 index 0000000..764bc2c --- /dev/null +++ b/utils/util.js @@ -0,0 +1,19 @@ +const formatTime = date => { + const year = date.getFullYear() + const month = date.getMonth() + 1 + const day = date.getDate() + const hour = date.getHours() + const minute = date.getMinutes() + const second = date.getSeconds() + + return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}` +} + +const formatNumber = n => { + n = n.toString() + return n[1] ? n : `0${n}` +} + +module.exports = { + formatTime +}