hflllll 1 month ago
parent
commit
0c577176eb
9 changed files with 726 additions and 78 deletions
  1. +6
    -0
      pages.json
  2. +81
    -9
      pages/index/center.vue
  3. +4
    -7
      pages/index/order.vue
  4. +210
    -0
      pages_order/mine/assets.vue
  5. +148
    -0
      pages_order/mine/myTeam.vue
  6. +81
    -55
      pages_order/mine/team.vue
  7. +6
    -7
      pages_order/mine/wallet.vue
  8. +117
    -0
      static/js/mockAssets.js
  9. +73
    -0
      static/js/mockTeamData.js

+ 6
- 0
pages.json View File

@ -145,6 +145,12 @@
{
"path": "mine/wallet"
},
{
"path": "mine/assets"
},
{
"path": "mine/myTeam"
},
{
"path": "order/instantGift"
},


+ 81
- 9
pages/index/center.vue View File

@ -11,9 +11,9 @@
</view>
</view>
<view class="role-switch-btn">
<view class="role-switch-btn" @tap="switchIdentity">
<uv-icon name="reload" size="30rpx" color="#fff" style="margin-right: 6rpx;" />
<text>切换为{{ userInfo.role }}</text>
<text>切换为{{ !identity ? '团长' : '团员'}}</text>
</view>
</view>
@ -28,7 +28,8 @@
</view>
<view class="order-types">
<view class="order-type-item" @tap="navigateTo('/pages/index/order?status=pending')">
<view class="order-type-item" v-if="identity === 0"
@tap="navigateTo('/pages/index/order?status=pending')">
<view class="order-icon-wrapper">
<view class="green-circle">
<uv-icon name="red-packet" size="44rpx" color="#fff" />
@ -91,7 +92,7 @@
<text class="section-title">团员功能</text>
</view>
<view class="function-grid">
<view class="function-grid" v-if="identity === 0">
<view class="function-item" @tap="navigateTo('/pages_order/mine/updateUser')">
<view class="function-icon">
<uv-icon name="chat" size="94rpx" color="#019245" />
@ -127,6 +128,45 @@
<text class="function-text">优惠券</text>
</view>
<view class="function-item" @tap="navigateTo('/pages_order/mine/wallet')">
<view class="function-icon">
<uv-icon name="chat" size="94rpx" color="#019245" />
</view>
<text class="function-text">钱包</text>
</view>
</view>
<view class="function-grid" v-else>
<view class="function-item" @tap="navigateTo('/pages_order/mine/updateUser')">
<view class="function-icon">
<uv-icon name="chat" size="94rpx" color="#019245" />
</view>
<text class="function-text">我的资料</text>
</view>
<view class="function-item" @tap="navigateTo('/pages_order/mine/myTeam')">
<view class="function-icon">
<uv-icon name="chat" size="94rpx" color="#019245" />
</view>
<text class="function-text">我的团员</text>
</view>
<view class="function-item" @tap="navigateTo('/pages_order/mine/team')">
<view class="function-icon">
<uv-icon name="chat" size="94rpx" color="#019245" />
</view>
<text class="function-text">团长信息</text>
</view>
<view class="function-item" @tap="navigateTo('/pages_order/mine/share')">
<view class="function-icon">
<uv-icon name="chat" size="94rpx" color="#019245" />
</view>
<text class="function-text">推广链接</text>
</view>
<view class="function-item" @tap="navigateTo('/pages_order/mine/wallet')">
<view class="function-icon">
<uv-icon name="chat" size="94rpx" color="#019245" />
@ -143,24 +183,56 @@
<script>
import tabber from '@/components/base/tabbar.vue'
import { mockUserInfo } from '@/static/js/mockUserInfo.js'
import shareConfig from '@/mixins/configList.js'
// import { unix } from 'dayjs'
export default {
components: {
tabber
},
mixins: [shareConfig],
data() {
return {
userInfo: mockUserInfo
userInfo: mockUserInfo,
identity: 0
}
},
methods: {
navigateTo(url) {
console.log(111222);
this.$utils.navigateTo({
url
})
},
switchIdentity() {
uni.showModal({
title: '提示',
content: `确定要切换为${this.identity === 0 ? '团长' : '团员'}吗?`,
confirmColor: '#019245',
// cancelColor: '#FF2A2A',
success: (res) => {
if (res.confirm){
//
uni.showLoading({
title: '切换中...'
})
setTimeout(() => {
uni.hideLoading();
this.identity = this.identity === 0 ? 1 : 0;
uni.setStorageSync('identity', this.identity)
uni.showToast({
title: '切换成功',
icon: 'success',
duration: 2000
})
}, 1000);
}
}
})
}
},
onLoad (){
uni.setStorageSync('identity', 0) //
this.identity = uni.getStorageSync('identity') //
}
}
</script>
@ -275,13 +347,13 @@ export default {
.order-types {
// background-color: red;
display: flex;
// justify-content: space-around;
justify-content: space-around;
.order-type-item {
display: flex;
flex-direction: column;
align-items: center;
width: 20%;
// width: 20%;
.order-icon-wrapper {
position: relative;


+ 4
- 7
pages/index/order.vue View File

@ -18,7 +18,7 @@
</view>
<!-- 团餐列表 -->
<view class="group-meal-list">
<view class="group-meal-list" v-if="identity">
<view class="meal-item" v-for="(meal, index) in groupMeals" :key="index+meal.id">
<view class="meal-name">{{ meal.name }}</view>
<view class="meal-price">本单佣金合计: <text class="price-value">¥{{meal.price}}</text></view>
@ -29,7 +29,7 @@
</view>
<!-- 订单列表 -->
<view class="order-list" v-if="false">
<view class="order-list" v-else>
<OrderItem v-for="(order, index) in orderList" :key="order.id" :order="order" @cancel="handleCancelOrder"
@pay="handlePayOrder" @tap="goToOrderDetail(order)" />
<view style="
@ -158,14 +158,11 @@
current: 0,
mixinsListApi: 'getOrderPageList',
orderList: [],
groupMeals: []
groupMeals: [],
identity: uni.getStorageSync('identity')
}
},
onLoad(args) {
// this.current = args.type || 0
// this.clickTabs({
// index: this.current
// })
if (args.status) {
// Map


+ 210
- 0
pages_order/mine/assets.vue View File

@ -0,0 +1,210 @@
<template>
<view class="assets-page">
<!-- 导航栏 -->
<navbar title="资产明细" leftClick @leftClick="$utils.navigateBack" bgColor="#019245" color="#fff" />
<!-- diy的tab栏 -->
<uv-sticky>
<view class="tab-container">
<view class="tab-wrapper">
<view
v-for="(item, index) in list"
:key="index"
class="tab-item"
:class="{ active: currentTab === index }"
@click="switchTab(index)"
>
{{ item.name }}
</view>
<!-- 滑块 -->
<view class="tab-slider" :style="{ left: currentTab * 50 + '%' }" />
</view>
</view>
</uv-sticky>
<!-- 交易记录列表 -->
<view class="transaction-list">
<view class="transaction-item" v-for="item in incomeList" :key="item.id">
<!-- 左侧图标和类型 -->
<view class="item-left">
<view class="icon-container">
<uv-icon name="empty-coupon" color="#019245" size="44"></uv-icon>
</view>
<view class="item-info">
<view class="item-type">{{ item.type }}</view>
<view class="item-time">{{ item.time }}</view>
</view>
</view>
<!-- 右侧金额 -->
<view class="item-amount income">¥{{ item.amount }}</view>
</view>
</view>
</view>
</template>
<script>
import navbar from '@/components/base/navbar.vue'
import { assetsData, assetsDataForHead } from '@/static/js/mockAssets.js'
export default {
components: {
navbar
},
data() {
return {
currentTab: 0, // 0- 1-
incomeList: [],
expenseList: [],
list: [
{
name: '收入明细',
},
{
name: '支出明细',
}
],
Data: []
}
},
onLoad() {
const identity = uni.getStorageSync('identity')
if (identity) {
// mock
this.Data = assetsDataForHead
} else {
// mock
this.Data = assetsData
}
this.switchTab(0)
},
methods: {
//
switchTab(index) {
this.currentTab = index
//
if (index === 0) {
this.incomeList = this.Data.incomeList
} else {
this.incomeList = this.Data.expenseList
}
}
}
}
</script>
<style lang="scss" scoped>
.assets-page {
// min-height: 100vh;
// background-color: #f5f5f5;
}
.transaction-list {
padding: 0 20rpx;
// background-color: #fff;
}
.transaction-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx 10rpx;
border-bottom: 1rpx solid #E0E0E0;
&:last-child {
border-bottom: none;
}
.item-left {
display: flex;
align-items: center;
.icon-container {
width: 70rpx;
height: 70rpx;
border-radius: 50%;
// background-color: rgba(1, 146, 69, 0.1);
display: flex;
justify-content: center;
align-items: center;
margin-right: 20rpx;
border: 4rpx solid $uni-color ;
}
.item-info {
.item-type {
font-size: 30rpx;
color: #333;
margin-bottom: 6rpx;
font-weight: 600;
}
.item-time {
font-size: 24rpx;
color: #949494;
}
}
}
.item-amount {
font-size: 32rpx;
font-weight: 500;
&.income {
color: $uni-color-second;
}
&.expense {
color: #333;
}
}
}
// tab
.tab-container {
width: 100%;
// background-color: #fff;
padding: 30rpx 0;
}
.tab-wrapper {
display: flex;
position: relative;
width: 90%;
height: 68rpx;
margin: 0 auto;
background-color: #cfcfcf;
border-radius: 42rpx;
overflow: hidden;
margin-bottom: 20rpx;
}
.tab-item {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
height: 100%;
font-size: 28rpx;
color: #333;
position: relative;
z-index: 1;
transition: color 0.3s;
&.active {
color: #fff;
font-weight: 500;
}
}
.tab-slider {
position: absolute;
width: 50%;
height: 100%;
background-color: $uni-color;
border-radius: 42rpx;
top: 0;
transition: left 0.3s cubic-bezier(0.35, 0, 0.25, 1);
z-index: 0;
}
</style>

+ 148
- 0
pages_order/mine/myTeam.vue View File

@ -0,0 +1,148 @@
<template>
<view class="my-team">
<!-- 导航栏 -->
<navbar title="我的团员" leftClick @leftClick="$utils.navigateBack" bgColor="#019245" color="#fff" />
<!-- 团队信息展示 -->
<view class="team-info-section">
<!-- 店铺图片 -->
<image :src="teamData.teamInfo.shopImage" mode="aspectFill" class="shop-image" />
<!-- 团员数量 -->
<view class="member-count">
我的团员<text class="count">{{ teamData.teamInfo.memberCount }}</text>
</view>
</view>
<!-- 团员列表 -->
<view class="member-list">
<view class="member-item" v-for="member in teamData.memberList" :key="member.id">
<!-- 状态点 -->
<view class="status-dot"></view>
<!-- 头像 -->
<image :src="member.avatar" mode="aspectFill" class="member-avatar" />
<!-- 团员信息 -->
<view class="member-info">
<view class="member-name">{{ member.nickname }}</view>
<view class="join-time">注册时间: {{ member.joinTime }}</view>
</view>
</view>
</view>
</view>
</template>
<script>
import navbar from '@/components/base/navbar.vue'
import { teamData } from '@/static/js/mockTeamData.js'
import shareConfig from '@/mixins/configList.js'
export default {
components: {
navbar
},
mixins: [shareConfig],
data() {
return {
teamData: null
}
},
onLoad() {
this.teamData = teamData
//
this.Gshare = {
...this.Gshare,
title: '查看我的团队成员',
path: '/pages_order/mine/myTeam',
identity: 1 //
}
},
methods: {
//
}
}
</script>
<style lang="scss" scoped>
.my-team {
min-height: 100vh;
background-color: #fff;
}
.team-info-section {
display: flex;
flex-direction: column;
align-items: center;
padding: 30rpx 0;
.shop-image {
width: 140rpx;
height: 140rpx;
border-radius: 10rpx;
margin-bottom: 20rpx;
}
.member-count {
font-size: 30rpx;
color: #333;
.count {
color: #019245;
font-weight: bold;
}
}
}
.member-list {
padding: 0 30rpx;
.member-item {
display: flex;
align-items: center;
padding: 24rpx 0;
border-bottom: 1rpx solid #f0f0f0;
position: relative;
&:last-child {
margin-bottom: 30rpx;
}
.status-dot {
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 12rpx;
height: 12rpx;
border-radius: 50%;
background-color: #019245;
}
.member-avatar {
width: 80rpx;
height: 80rpx;
// border-radius: 50%;
margin-left: 20rpx;
}
.member-info {
margin-left: 20rpx;
flex: 1;
.member-name {
font-size: 28rpx;
color: #333;
margin-bottom: 6rpx;
}
.join-time {
font-size: 24rpx;
color: #999;
}
}
}
}
</style>

+ 81
- 55
pages_order/mine/team.vue View File

@ -1,50 +1,11 @@
首页
工单管理
合并请求
里程碑
探索
通知
创建
个人信息和配置
Augcl / teambuy-front
生成自 hly/uniapp-shop-templates
关注
1
点赞
0
派生
0
代码
工单
0
合并请求
0
项目
0
版本发布
0
百科
动态
敢为人鲜小程序前端代码仓库
58 提交
2 分支
57 MiB
分支: hfll
teambuy-front/pages_order/mine/team.vue
335
8.7 KiB
原始文件
永久链接
Blame
文件历史
<template>
<view class="page">
<!-- 导航栏 -->
<navbar title="团长申请" leftClick @leftClick="$utils.navigateBack" bgColor="#019245" color="#fff" />
<navbar :title="`${ !identity ? '团长申请' : '团长信息' }`" leftClick @leftClick="$utils.navigateBack" bgColor="#019245"
color="#fff" />
<!-- 顶部图片区域 -->
<view class="banner">
<view class="banner" v-if="!identity">
<image src="/static/image/红烧肉.png" mode="aspectFill" class="banner-image"></image>
</view>
@ -53,11 +14,12 @@ Blame
<view class="section-title">送餐点照片</view>
<view class="section-block">
<view class="upload-container">
<view class="upload-area" @click="chooseImage" v-if="!locationImage">
<view class="upload-area" @tap="chooseImage" v-if="!formData.locationImage">
<view class="plus">+</view>
<view class="upload-text">添加图片</view>
</view>
<image v-else :src="locationImage" mode="aspectFill" class="upload-area" @click="chooseImage" />
<image v-else :src="formData.locationImage" mode="aspectFill" class="upload-area"
@tap="chooseImage" />
</view>
</view>
@ -72,7 +34,7 @@ Blame
</view>
<view class="form-item">
<text class="label">您的姓名</text>
<input class="input" type="text" v-model="formData.contactName" placeholder="请输入您的姓名"
<input class="input" type="nickname" v-model="formData.contactName" placeholder="请输入您的姓名"
placeholder-class="placeholder" />
</view>
<view class="form-item">
@ -80,7 +42,7 @@ Blame
<input class="input" type="number" v-model="formData.contactPhone" placeholder="请输入您的手机号"
placeholder-class="placeholder" />
</view>
<view class="form-item region-item" @click="showRegionPicker">
<view class="form-item region-item" @tap="showRegionPicker">
<text class="label">所在地区</text>
<view class="region-value">
<text :class="{ 'placeholder': !formData.region }" style="color: #000;">{{ formData.region ||
@ -97,8 +59,12 @@ Blame
</view>
</view>
<!-- 提交按钮 -->
<view class="submit-btn" @click="submitApplication">
提交申请
<view v-if="!this.beModify" class="submit-btn" @tap="submitApplication">
{{ !identity ? '提交申请' : '提交保存' }}
</view>
<view v-else class="submit-btn-container">
<view class="submit-btn-modify" @tap="submitApplication">修改</view>
<view class="submit-btn-save" @tap="submitApplication">保存</view>
</view>
</view>
</view>
@ -106,21 +72,25 @@ Blame
<script>
import navbar from '@/components/base/navbar.vue'
import shareConfig from '@/mixins/configList.js'
export default {
components: {
navbar
},
mixins: [shareConfig],
data() {
return {
locationImage: '', //
formData: {
locationImage: '', //
name: '', //
contactName: '', //
contactPhone: '', //
region: '', //
address: '' //
}
},
identity: uni.getStorageSync('identity'),
beModify: false //
}
},
methods: {
@ -133,7 +103,7 @@ export default {
success: (res) => {
//
//
this.locationImage = res.tempFilePaths[0]
this.formData.locationImage = res.tempFilePaths[0]
}
})
},
@ -153,7 +123,7 @@ export default {
//
submitApplication() {
//
if (!this.locationImage) {
if (!this.formData.locationImage) {
return uni.showToast({
title: '请上传送餐点照片',
icon: 'none'
@ -211,14 +181,20 @@ export default {
setTimeout(() => {
uni.hideLoading()
if (this.identity) {
//
this.saveInfo()
return
}
uni.showModal({
title: '提交成功!',
content: '我们的工作人员会及时与您联系,\n请保持电话畅通!~',
content: '我们的工作人员会及时与您联系,\n请保持电话畅通!',
showCancel: false,
confirmColor: '#019245',
success: (res) => {
if (res.confirm) {
//
//
setTimeout(() => {
this.$utils.navigateBack()
}, 500)
@ -226,6 +202,27 @@ export default {
}
})
}, 1000)
},
//
saveInfo() {
uni.setStorageSync('team_form_data', JSON.stringify(this.formData))
uni.showToast({
title: '保存成功!',
icon: 'none',
duration: 2000
})
}
},
onLoad() {
if (this.identity) {
//
const addData = uni.getStorageSync('team_form_data')
if (addData) {
this.beModify = true
this.formData = JSON.parse(addData)
}
}
}
}
@ -372,6 +369,35 @@ export default {
justify-content: center;
align-items: center;
border-radius: 50rpx;
// margin-top: 60rpx;
}
.submit-btn-container {
display: flex;
justify-content: space-between;
align-items: center;
margin: 40rpx auto 0;
width: 74%;
.submit-btn-modify {
width: 45%;
height: 90rpx;
background-color: #fff;
color: $uni-color;
font-size: 32rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 50rpx;
border: 4rpx solid $uni-color;
}
.submit-btn-save {
width: 45%;
height: 90rpx;
background-color: $uni-color;
color: #fff;
font-size: 32rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 50rpx;
}
}
</style>

+ 6
- 7
pages_order/mine/wallet.vue View File

@ -93,10 +93,7 @@ export default {
//
navigateToDetail() {
uni.showToast({
title: '资产明细功能暂未开放',
icon: 'error'
})
this.$utils.navigateTo('/pages_order/mine/assets')
},
//
@ -190,12 +187,12 @@ export default {
icon: 'success'
})
//
this.walletData.balance -= parseFloat(this.withdrawAmount)
//
this.withdrawAmount = ''
this.realName = ''
//
this.walletData.balance -= parseFloat(this.withdrawAmount)
this.isFormValid = true
}, 1500)
},
@ -220,6 +217,8 @@ export default {
title: '充值成功',
icon: 'success'
})
//
this.walletData.balance += parseFloat(this.rechargeAmount)
//
this.rechargeAmount = ''
this.isRecharge = false


+ 117
- 0
static/js/mockAssets.js View File

@ -0,0 +1,117 @@
// 资产明细的mock数据
export const assetsData = {
// 收入明细
incomeList: [
{
id: 1,
type: '充值',
amount: 200,
time: '2020-12-29 12:54:54'
},
{
id: 2,
type: '充值',
amount: 200,
time: '2020-12-29 12:54:54'
},
{
id: 3,
type: '充值',
amount: 200,
time: '2020-12-29 12:54:54'
},
{
id: 4,
type: '充值',
amount: 200,
time: '2020-12-29 12:54:54'
},
{
id: 5,
type: '充值',
amount: 200,
time: '2020-12-29 12:54:54'
}
],
// 支出明细
expenseList: [
{
id: 6,
type: '提现',
amount: 100,
time: '2020-12-25 14:30:22'
},
{
id: 7,
type: '提现',
amount: 150,
time: '2020-12-20 09:15:36'
},
{
id: 8,
type: '点餐',
amount: 50,
time: '2020-12-15 18:22:10'
}
]
}
// 这是团长用的静态资产明细
export const assetsDataForHead = {
// 收入明细
incomeList: [
{
id: 1,
type: '佣金',
amount: 200,
time: '2020-12-29 12:54:54'
},
{
id: 2,
type: '佣金',
amount: 200,
time: '2020-12-29 12:54:54'
},
{
id: 3,
type: '佣金',
amount: 200,
time: '2020-12-29 12:54:54'
},
{
id: 4,
type: '佣金',
amount: 200,
time: '2020-12-29 12:54:54'
},
{
id: 5,
type: '佣金',
amount: 200,
time: '2020-12-29 12:54:54'
}
],
// 支出明细
expenseList: [
{
id: 6,
type: '提现',
amount: 100,
time: '2020-12-25 14:30:22'
},
{
id: 7,
type: '提现',
amount: 150,
time: '2020-12-20 09:15:36'
},
{
id: 8,
type: '点餐',
amount: 50,
time: '2020-12-15 18:22:10'
}
]
}

+ 73
- 0
static/js/mockTeamData.js View File

@ -0,0 +1,73 @@
// 团长的团队数据mock
export const teamData = {
// 团队信息
teamInfo: {
shopName: '回美寿洪店',
shopImage: '/static/image/红烧肉.png', // 使用红烧肉图片代替
memberCount: 150
},
// 团员列表
memberList: [
{
id: 1,
nickname: '学生妹',
avatar: '/static/image/中森明菜.webp', // 使用中森明菜图片
joinTime: '2020.08.06'
},
{
id: 2,
nickname: '学生妹',
avatar: '/static/image/中森明菜.webp',
joinTime: '2020.08.06'
},
{
id: 3,
nickname: '学生妹',
avatar: '/static/image/中森明菜.webp',
joinTime: '2020.08.06'
},
{
id: 4,
nickname: '学生妹',
avatar: '/static/image/中森明菜.webp',
joinTime: '2020.08.06'
},
{
id: 5,
nickname: '学生妹',
avatar: '/static/image/中森明菜.webp',
joinTime: '2020.08.06'
},
{
id: 6,
nickname: '学生妹',
avatar: '/static/image/中森明菜.webp',
joinTime: '2020.08.06'
},
{
id: 7,
nickname: '学生妹',
avatar: '/static/image/中森明菜.webp',
joinTime: '2020.08.06'
},
{
id: 8,
nickname: '学生妹',
avatar: '/static/image/中森明菜.webp',
joinTime: '2020.08.06'
},
{
id: 9,
nickname: '学生妹',
avatar: '/static/image/中森明菜.webp',
joinTime: '2020.08.06'
},
{
id: 10,
nickname: '学生妹',
avatar: '/static/image/中森明菜.webp',
joinTime: '2020.08.06'
}
]
}

Loading…
Cancel
Save