管理员可以修改项目所属人

This commit is contained in:
sdaduanbilei 2025-12-02 14:55:29 +08:00
parent 522d847094
commit 0ea43d0c62
10 changed files with 210 additions and 16 deletions

35
components/badge/index.js Normal file
View File

@ -0,0 +1,35 @@
// components/badge/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
visible:{
type: Boolean,
require: false
},
item: {
type: Object,
require: true
},
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
tap(){
this.triggerEvent('ok', {
value: ""
});
}
}
})

View File

@ -0,0 +1,7 @@
{
"component": true,
"styleIsolation": "apply-shared",
"usingComponents": {
"t-overlay": "tdesign-miniprogram/overlay/overlay"
}
}

View File

@ -0,0 +1,17 @@
<!--components/badge/index.wxml-->
<t-overlay visible="{{visible}}" bind:click="handleOverlayClick">
<view class="full-width flex flex-center flex-col" style="height: 100vh; ">
<view class="badge-scene" style="margin-top: -180rpx;">
<view class="badge-bg-rays"></view>
<view class="badge-3d-wrapper">
<view class="badge-content-container">
<image src="https://res.catter.cn/pub/2025/12/02/20251202140711605.png" class="badge-img-inner"></image>
</view>
</view>
</view>
<view class="font-16 bold white mt-32">新手园丁</view>
<view class="font-14 mt-16 white">徽章获取条件2025年12月15日添加第一颗植物</view>
<button theme="primary" style="background-color: #E8D7B4;width: 80%;border-radius: 50rpx; margin-top: 32rpx; color: #7B6946;" shape="round" bind:tap="tap">佩戴徽章</button>
</view>
</t-overlay>

121
components/badge/index.wxss Normal file
View File

@ -0,0 +1,121 @@
/* components/badge/index.wxss */
/* =================================
1. 舞台层 (保持透视)
================================= */
.badge-scene {
position: relative;
width: 285rpx;
height: 285rpx;
margin: 50rpx auto;
/* 透视距离决定旋转时的立体感1000rpx 比较自然 */
perspective: 1000rpx;
}
/* =================================
2. 背景光线层 (不变)
================================= */
.badge-bg-rays {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 180%;
height: 180%;
z-index: 0;
border-radius: 50%;
background: repeating-conic-gradient(
from 0deg,
transparent 0deg 20deg,
rgba(255, 223, 128, 0.4) 20deg 40deg
);
filter: blur(30px);
animation: rotate-rays 20s linear infinite;
pointer-events: none;
}
/* =================================
3. 3D包裹层 (修改了动画)
================================= */
.badge-3d-wrapper {
width: 100%;
height: 100%;
position: relative;
z-index: 2;
transform-style: preserve-3d;
/* 【修改点】应用纯左右摇摆动画 */
/* 4s 一个周期ease-in-out 让两头慢中间快,更有质感 */
animation: swayLeftRight 4s ease-in-out infinite;
}
/* =================================
4. 内容层 (不变)
================================= */
.badge-content-container {
width: 100%;
height: 100%;
border-radius: 50%;
box-shadow: 0 10px 25px rgba(0,0,0,0.3);
overflow: hidden;
position: relative;
background: #fff;
}
.badge-img-inner {
width: 100%;
height: 100%;
display: block;
}
/* 流光层 (不变) */
.badge-content-container::after {
content: '';
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: linear-gradient(
to bottom right,
rgba(255, 255, 255, 0) 30%,
rgba(255, 255, 255, 0.6) 50%,
rgba(255, 255, 255, 0) 70%
);
transform: rotate(30deg);
animation: shimmer 3s infinite ease-in-out;
pointer-events: none;
z-index: 3;
}
/* =================================
动画定义 (Keyframes)
================================= */
/* 【新动画】纯左右 3D 摇摆 */
@keyframes swayLeftRight {
0% {
/* 向左侧转 20度 */
transform: rotateY(-20deg);
}
50% {
/* 向右侧转 20度 */
transform: rotateY(20deg);
}
100% {
/* 回到左侧 */
transform: rotateY(-20deg);
}
}
/* 光线背景旋转 (不变) */
@keyframes rotate-rays {
from { transform: translate(-50%, -50%) rotate(0deg); }
to { transform: translate(-50%, -50%) rotate(360deg); }
}
/* 流光扫过 (不变) */
@keyframes shimmer {
0% { transform: translateX(-100%) translateY(-100%) rotate(30deg); }
100% { transform: translateX(100%) translateY(100%) rotate(30deg); }
}

View File

@ -11,6 +11,7 @@ Page({
*/
data: {
minDate: new Date(2019, 1, 1).getTime(),
show:false,
value: new Date().getTime(),
showDate:false,
visible: false,
@ -158,7 +159,7 @@ Page({
})
api('/plant/add','POST',this.data.form,'json').then(res => {
if (res.code === 200){
wx.navigateBack()
this.setData({show:true})
} else {
wx.showModal({
content: res.msg
@ -167,6 +168,10 @@ Page({
})
},
goBack(){
wx.navigateBack()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/

View File

@ -2,6 +2,7 @@
"navigationBarTitleText": "添加新植物",
"usingComponents": {
"t-calendar": "tdesign-miniprogram/calendar/calendar",
"count-picker":"/components/count-picker/index"
"count-picker":"/components/count-picker/index",
"badge":"/components/badge/index"
}
}

View File

@ -3,7 +3,7 @@
<view class="row padding">
<view>植物图片</view>
<view class="mt-32">
<view class="border flex flex-center" bind:tap="upload" >
<view class="border flex flex-center" bind:tap="upload">
<view class="flex flex-center flex-col" wx:if="{{pic.length === 0}}">
<view class="camera flex flex-center">
<t-icon name="camera-filled" class="primary" size="24"></t-icon>
@ -12,7 +12,7 @@
<view class="mt-16 font-12 grey">支持JPG、PNG 格式,最大 5MB</view>
</view>
<view wx:else class="flex flex-center full-width">
<image src="{{pic}}" mode="aspectFill" style="height: 398rpx;padding: 0rpx; border-radius: 16rpx;" ></image>
<image src="{{pic}}" mode="aspectFill" style="height: 398rpx;padding: 0rpx; border-radius: 16rpx;"></image>
</view>
</view>
</view>
@ -31,7 +31,7 @@
<view class="mt-32">
<view class="custom-label font-14 ml-32">种植日期 </view>
</view>
<t-cell title="{{form.plantTime}}" right-icon="calendar-1" bind:tap="showDatePicker"></t-cell>
<t-cell title="{{form.plantTime}}" right-icon="calendar-1" bind:tap="showDatePicker"></t-cell>
</view>
</view>
<view class="row padding mt-32">
@ -39,7 +39,7 @@
<view class="mt-32">
<view>
<count-picker item="{{item}}" wx:for="{{form.carePlans}}" bind:ok="update"></count-picker>
</view>
</view>
</view>
@ -51,6 +51,7 @@
<!-- date -->
<t-calendar min-date="{{minDate}}" max-date="{{value}}" value="{{value}}" visible="{{showDate}}" confirm-btn="确认" bind:confirm="handleConfirm" />
<badge visible="{{show}}" bind:ok="goBack"></badge>
</view>

View File

@ -21,4 +21,4 @@
color: red;
font-size: 32rpx;
margin-left: 4rpx;
}
}

View File

@ -141,12 +141,12 @@ Page({
goAdd() {
const tmp = wx.getStorageSync('user')
if (tmp.phone.length === 0){
wx.navigateTo({
url: '../login/index',
})
return
}
// if (tmp.phone.length === 0){
// wx.navigateTo({
// url: '../login/index',
// })
// return
// }
wx.navigateTo({
url: '../add/index',
})

View File

@ -23,12 +23,19 @@
"condition": {
"miniprogram": {
"list": [
{
"name": "pages/add/index",
"pathName": "pages/add/index",
"query": "",
"scene": null,
"launchMode": "default"
},
{
"name": "pages/community/info",
"pathName": "pages/community/info",
"query": "id=d7082150-c68d-11f0-b4a9-bc2411e64a23",
"scene": null,
"launchMode": "default"
"launchMode": "default",
"scene": null
}
]
}