绚火健康

This commit is contained in:
2023-08-15 17:18:15 +08:00
commit 32cc588ae7
200 changed files with 8924 additions and 0 deletions

66
pages/user/about/about.js Normal file
View File

@@ -0,0 +1,66 @@
// pages/user/about/about.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "关于我们"
}

View File

@@ -0,0 +1,3 @@
<view class="about">
<image src="https://cdn.douhuofalv.com/images/2023/08/07/cb93881489af4532322ead5fabd36b0d.png" mode="widthFix"></image>
</view>

View File

@@ -0,0 +1,8 @@
.about {
width: 100%;
}
image {
width: 100%;
display: block;
}

172
pages/user/code/code.js Normal file
View File

@@ -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"
}
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationStyle": "custom"
}

35
pages/user/code/code.wxml Normal file
View File

@@ -0,0 +1,35 @@
<view class="navigation {{isFixedTop > 0 ? 'active' : ''}}" style="padding-top:{{barHeight}}px;">
<image bindtap="returnGo" class="navigation-arrow" src="{{isFixedTop > 0 ? '/static/icons/arrowBlack.png' : '/static/icons/arrowWrite.png'}}"></image>
</view>
<view class="code">
<image src="https://cdn.douhuofalv.com/images/2023/08/11/cd8093d6ab1a248e5154be48b0ddcaac.jpg" class="code-back"></image>
<view class="code-cont">
<view class="code-img">
<image src="{{inviteCode}}" mode="widthFix"></image>
</view>
<view class="code-text"><text>保存并分享二维码</text></view>
</view>
<view class="code-share" bindtap="shareTap">
<image src="https://cdn.douhuofalv.com/images/2023/08/11/063dc9fe75abe56e9c654b65c3bfc771.png"></image>
<view class="code-share-name">分享</view>
</view>
</view>
<!-- 海报canvas -->
<canvas type="2d" style="width: 375px; height: 800px;" id="coverCanvas" class="canvas-img" />
<!-- 分享弹出 -->
<view class="sharePop {{shareSee ? 'active' : ''}}">
<view class="shareCont">
<button class="shareCont-label codeShare-button" open-type="share" hover-class="none">
<image src="https://cdn.shuiganying.com/images/2023/03/28/f8b773edc2fe6db8e45f96773b9a8dc4.png"></image>
微信好友
</button>
<view class="shareCont-label" bindtap="onCanvas">
<image src="https://cdn.shuiganying.com/images/2023/03/28/cfe0efbb53eaf7911ea5211923859c65.png"></image>
保存二维码
</view>
</view>
<view class="shareCancel" bindtap="shareTap">取消</view>
</view>

148
pages/user/code/code.wxss Normal file
View File

@@ -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;
}

66
pages/user/index.js Normal file
View File

@@ -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"
})
}
}
})

5
pages/user/index.json Normal file
View File

@@ -0,0 +1,5 @@
{
"usingComponents": {},
"navigationBarTitleText": "我的",
"navigationBarBackgroundColor": "#fbe2e1"
}

122
pages/user/index.wxml Normal file
View File

@@ -0,0 +1,122 @@
<view class="linearBack">
<view class="head" wx:if="{{userLogin}}">
<image class="head-img" src="{{userData.user.avatar ? userData.user.avatar : '/static/imgs/userHead.png'}}" mode="widthFix"></image>
<view class="head-cont">
<view class="head-name">{{userData.user.nickname}}</view>
<view class="head-text">生命可以如此精彩~</view>
</view>
<view class="head-edit" bindtap="userNav" data-url="/pages/user/setup/setup">编辑 ></view>
</view>
<block wx:else>
<navigator hover-class="none" url="/pages/login/index" class="head">
<image class="head-img" src="/static/imgs/userHead.png" mode="widthFix"></image>
<view class="head-cont">
<view class="head-name">请先登录</view>
<view class="head-text">生命可以如此精彩~</view>
</view>
</navigator>
</block>
</view>
<!-- 订单 -->
<view class="userCont">
<view class="white">
<view class="order-top">
<view class="order-title">我的订单</view>
<view bindtap="userNav" data-url="/pages/order/index" class="order-more">全部 ></view>
</view>
<view class="order-list">
<view class="order-item" bindtap="userNav" data-url="/pages/order/index?list_type=unpay">
<image class="order-icon" src="/static/imgs/order_01.png" mode="widthFix"></image>
<view class="order-label">待付款</view>
<block wx:if="{{userLogin}}">
<view class="order--number" wx:if="{{userData.order.init > 0}}">{{userData.order.init}}</view>
</block>
</view>
<view class="order-item" bindtap="userNav" data-url="/pages/order/index?list_type=paid">
<image class="order-icon" src="/static/imgs/order_02.png" mode="widthFix"></image>
<view class="order-label">待发货</view>
<block wx:if="{{userLogin}}">
<view class="order--number" wx:if="{{userData.order.paid > 0}}">{{userData.order.paid}}</view>
</block>
</view>
<view class="order-item" bindtap="userNav" data-url="/pages/order/index?list_type=delivered">
<image class="order-icon" src="/static/imgs/order_03.png" mode="widthFix"></image>
<view class="order-label">待收货</view>
<block wx:if="{{userLogin}}">
<view class="order--number" wx:if="{{userData.order.delivered > 0}}">{{userData.order.delivered}}</view>
</block>
</view>
<view class="order-item" bindtap="userNav" data-url="/pages/order/index?list_type=signed">
<image class="order-icon" src="/static/imgs/order_04.png" mode="widthFix"></image>
<view class="order-label">已签收</view>
</view>
<!-- <view class="order-item">
<image class="order-icon" src="/static/imgs/order_05.png" mode="widthFix"></image>
<view class="order-label">售后</view>
</view> -->
</view>
</view>
</view>
<!-- 工具 -->
<view class="userCont">
<view class="white">
<view class="tool-list">
<view class="order-item" bindtap="userNav" data-url="/pages/account/index">
<image class="tool-icon" src="/static/imgs/tool_05.png" mode="widthFix"></image>
<view class="order-label">我的账户</view>
</view>
<view class="order-item" bindtap="userNav" data-url="/pages/bankCard/index">
<image class="tool-icon" src="/static/imgs/tool_08.png" mode="widthFix"></image>
<view class="order-label">我的银行卡</view>
</view>
<view class="order-item" bindtap="userNav" data-url="/pages/user/team/index">
<image class="tool-icon" src="/static/imgs/tool_06.png" mode="widthFix"></image>
<view class="order-label">我的团队</view>
</view>
<view class="order-item" bindtap="userNav" data-url="/pages/user/code/code">
<image class="tool-icon" src="/static/imgs/tool_07.png" mode="widthFix"></image>
<view class="order-label">邀请码</view>
</view>
<view class="order-item" bindtap="userNav" data-url="/pages/site/index">
<image class="tool-icon" src="/static/imgs/tool_01.png" mode="widthFix"></image>
<view class="order-label">我的地址</view>
</view>
<view class="order-item" bindtap="userNav" data-url="/pages/user/setup/setup">
<image class="tool-icon" src="/static/imgs/tool_02.png" mode="widthFix"></image>
<view class="order-label">意见反馈</view>
</view>
<navigator hover-class="none" class="order-item" url="/pages/user/about/about">
<image class="tool-icon" src="/static/imgs/tool_03.png" mode="widthFix"></image>
<view class="order-label">关于我们</view>
</navigator>
<view class="order-item" bindtap="userNav" data-url="/pages/user/setup/setup">
<image class="tool-icon" src="/static/imgs/tool_04.png" mode="widthFix"></image>
<view class="order-label">用户设置</view>
</view>
</view>
</view>
</view>
<!-- 推荐 -->
<view class="goods" wx:if="{{userData.goods.length > 0}}">
<view class="goods-title">
<view class="goods-title-name"><text class="goods-title-left"></text>为你推荐<text class="goods-title-right"></text></view>
</view>
<view class="goodsList">
<view class="goodsItem" wx:for="{{userData.goods}}" wx:key="goods">
<view class="goodsItem-img">
<image mode="aspectFill" src="{{item.cover}}"></image>
</view>
<view class="goodsItem-cont">
<view class="nowrap goodsItem-name">{{item.name}}</view>
<view class="nowrap goodsItem-text">{{item.description}}</view>
<view class="goodsItem-tips">
<view class="goodsItem-price">¥{{item.original_price}}</view>
<view class="goodsItem-sales">游览 {{item.clicks}}</view>
</view>
</view>
</view>
</view>
</view>

241
pages/user/index.wxss Normal file
View File

@@ -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;
}

135
pages/user/setup/setup.js Normal file
View File

@@ -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'
})
}
}
})
},
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "用户设置"
}

View File

@@ -0,0 +1,51 @@
<view class="setupItem">
<view class="label" bindtap="updImg" data-type="avatar">
<view class="label-name">
<image class="label-name-img" src="https://cdn.shuiganying.com/images/2023/04/04/92bfc09706bc88dcb1dfe7de959dbb38.png" mode="aspectFill"></image>
<view class="label-name-text">修改头像</view>
</view>
<view class="label-tips">
<image class="label-name-head" src="{{avatar ? avatar : '/static/imgs/userHead.png'}}" mode="aspectFill"></image>
<image class="label-name-arrow" src="/static/icons/arrow_more.png" mode="widthFix"></image>
</view>
</view>
<view class="label" bindtap="updImg" data-type="nickname">
<view class="label-name">
<image class="label-name-img" src="https://cdn.shuiganying.com/images/2023/04/04/3a96069a287b0de017a3c316b258ba98.png" mode="aspectFill"></image>
<view class="label-name-text">用户昵称</view>
</view>
<view class="label-tips">
<view class="label-name-nickName">{{nickName}}</view>
<image class="label-name-arrow" src="/static/icons/arrow_more.png" mode="widthFix"></image>
</view>
</view>
</view>
<view class="setupItem">
<view class="label" bindtap="outLogin">
<view class="label-name">
<image class="label-name-img" src="https://cdn.shuiganying.com/images/2023/04/11/43e0d6957a9ed4e82d40569cd46fbf42.png" mode="aspectFill"></image>
<view class="label-name-text">退出登录</view>
</view>
<view class="label-tips">
<image class="label-name-arrow" src="/static/icons/arrow_more.png" mode="widthFix"></image>
</view>
</view>
</view>
<!-- 修改用户昵称 start -->
<view class="publicBack" wx:if="{{nameState}}"></view>
<view class="publicPop" wx:if="{{nameState}}">
<view class="publicPop-cont">
<view class="free-title">{{reviseType == 'nickname' ? '用户昵称' : '真实姓名'}}</view>
<form bindsubmit="freeform" class="site-form">
<view class="free-input">
<input placeholder="限制5个字符" type="text" value="{{nameValue}}" bindinput="bindinput" name="name"></input>
</view>
<view class="publicPop-btn">
<view class="publicPop-btn-go publicPop-btn-border" bindtap="establish">暂不修改</view>
<button class="publicPop-btn-go" form-type="submit" disabled="{{disabled}}">确认提交</button>
</view>
</form>
</view>
</view>

173
pages/user/setup/setup.wxss Normal file
View File

@@ -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;
}

77
pages/user/team/index.js Normal file
View File

@@ -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);
}
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "我的团队"
}

View File

@@ -0,0 +1,68 @@
<view class="item">
<view class="item-label">
<view class="item-name">个人当日消费额</view>
<view class="item-number item-number-red">{{perfInfo.day_perf}}</view>
<image class="item-icon" src="/static/imgs/teamIcon_01.png" mode="widthFix"></image>
</view>
<view class="item-label">
<view class="item-name">个人累计消费额</view>
<view class="item-number item-number-red">{{perfInfo.self_perf}}</view>
<image class="item-icon" src="/static/imgs/teamIcon_02.png" mode="widthFix"></image>
</view>
</view>
<view class="item">
<view class="item-label item-blue">
<view class="item-name">个人当日消费额</view>
<view class="item-number item-number-blue">{{perfInfo.group_perf}}</view>
<image class="item-icon" src="/static/imgs/teamIcon_04.png" mode="widthFix"></image>
</view>
</view>
<view class="item">
<view class="item-label">
<view class="item-name">我的客户</view>
<view class="item-number item-number-yellow">{{teamsInfo.recommand}}</view>
<image class="item-icon" src="/static/imgs/teamIcon_03.png" mode="widthFix"></image>
</view>
<view class="item-label">
<view class="item-name">团队客户</view>
<view class="item-number item-number-yellow">{{teamsInfo.group}}</view>
<image class="item-icon" src="/static/imgs/teamIcon_03.png" mode="widthFix"></image>
</view>
</view>
<view class="list">
<view class="listTitle">
<view class="listTitle-name">我的客户列表</view>
<view class="listTitle-number">共 {{teamsInfo.recommand}} 名</view>
</view>
<view class="listItem" wx:if="{{childrenArr.length > 0}}">
<view class="listItem-item" wx:for="{{childrenArr}}" wx:key="childrenArr">
<view class="listItem-top">
<image class="listItem-head" src="/static/imgs/userHead.png" mode="widthFix"></image>
<view class="listItem-cont">
<view class="listItem-name">
李莉莉
</view>
<view class="listItem-tel">
152****7708
</view>
</view>
</view>
<view class="listItem-time">
2023-08-18
</view>
</view>
<view class="pagesLoding" wx:if="{{lodingStats}}">
<block wx:if="{{page.has_more}}">
<image class="pagesLoding-icon" src="/static/icon/refresh_loding.gif" mode="widthFix"></image>加载中...
</block>
<block wx:else>
没有更多了~
</block>
</view>
</view>
<view class="pages-no" wx:else>
<image src="/static/imgs/cont_null.png" mode="widthFix"></image>
<view>暂无数据</view>
</view>
</view>

130
pages/user/team/index.wxss Normal file
View File

@@ -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;
}