管理员可以修改项目所属人
This commit is contained in:
parent
5a4051edde
commit
7dbeeeb0c9
2
app.js
2
app.js
@ -12,7 +12,7 @@ App({
|
|||||||
// 发送 res.code 到后台换取 openId, sessionKey, unionId
|
// 发送 res.code 到后台换取 openId, sessionKey, unionId
|
||||||
api("/auth/miniLogin?code=" + res.code).then(res => {
|
api("/auth/miniLogin?code=" + res.code).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
wx.setStorageSync('saOpenId', res.data.user.openId)
|
wx.setStorageSync('openId', res.data.user.miniOpenId)
|
||||||
wx.setStorageSync('sessionKey', res.data.user.sessionKey)
|
wx.setStorageSync('sessionKey', res.data.user.sessionKey)
|
||||||
if (res.data.user.id){
|
if (res.data.user.id){
|
||||||
wx.setStorageSync('user', res.data.user)
|
wx.setStorageSync('user', res.data.user)
|
||||||
|
|||||||
@ -23,13 +23,12 @@ Page({
|
|||||||
|
|
||||||
goAdd(){
|
goAdd(){
|
||||||
const tmp = wx.getStorageSync('user')
|
const tmp = wx.getStorageSync('user')
|
||||||
// todo
|
if (tmp.phone.length === 0){
|
||||||
// if (tmp.phone.length === 0){
|
wx.navigateTo({
|
||||||
// wx.navigateTo({
|
url: '../login/index',
|
||||||
// url: '../login/index',
|
})
|
||||||
// })
|
return
|
||||||
// return
|
}
|
||||||
// }
|
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: '../community/add',
|
url: '../community/add',
|
||||||
})
|
})
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
<view class="mt-16">
|
<view class="mt-16">
|
||||||
<view wx:if="{{info.imgList.length == 1}}">
|
<view wx:if="{{info.imgList.length == 1}}">
|
||||||
<view wx:for="{{info.imgList}}">
|
<view wx:for="{{info.imgList}}">
|
||||||
<image src="{{info.url}}" style="border-radius: 16rpx; height: 50vw; width: 100%;" mode="aspectFill"></image>
|
<image src="{{info.imgList[0].url}}" style="border-radius: 16rpx; height: 50vw; width: 100%;" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view wx:else class="grid">
|
<view wx:else class="grid">
|
||||||
|
|||||||
@ -3,7 +3,8 @@ const { api } = require("../../utils/api")
|
|||||||
// index.js
|
// index.js
|
||||||
Page({
|
Page({
|
||||||
data: {
|
data: {
|
||||||
list:[]
|
list:[],
|
||||||
|
dash:null
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
|
||||||
@ -30,6 +31,14 @@ Page({
|
|||||||
this.setData({list:res.data})
|
this.setData({list:res.data})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
api('/plant/taskProgress','GET').then(res => {
|
||||||
|
if (res.code == 200){
|
||||||
|
const dash = res.data
|
||||||
|
dash.progress = parseFloat((dash.progress * 100).toFixed(2))
|
||||||
|
this.setData({dash:dash})
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
goAdd(){
|
goAdd(){
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
|
|||||||
@ -1,16 +1,16 @@
|
|||||||
<!--index.wxml-->
|
<!--index.wxml-->
|
||||||
<view class="flex flex-center flex-col">
|
<view class="flex flex-center flex-col">
|
||||||
<view class="full-width white-bg">
|
<view class="full-width white-bg">
|
||||||
<view class="padding">
|
<view class="padding" wx:if="{{dash}}">
|
||||||
<view class="mb-16 flex flex-center flex-justify-between">
|
<view class="mb-16 flex flex-center flex-justify-between">
|
||||||
<view>
|
<view>
|
||||||
📅 今日养护(4个任务)
|
📅 今日养护( {{dash.total}}个任务)
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
已经完成 4 / 5
|
已经完成 {{dash.complete}} / {{dash.total}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<t-progress theme="plump" color="{{ { from: '#0052D9', to: '#00A870' } }}" percentage="80" status="active" />
|
<t-progress theme="plump" color="{{ { from: '#0052D9', to: '#00A870' } }}" percentage="{{dash.progress}}" status="active" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
@ -31,7 +31,7 @@
|
|||||||
<view wx:for="{{list}}" >
|
<view wx:for="{{list}}" >
|
||||||
<view class="mb-16 bo">{{item.name}}</view>
|
<view class="mb-16 bo">{{item.name}}</view>
|
||||||
<view wx:for="{{item.careList}}">
|
<view wx:for="{{item.careList}}">
|
||||||
<view class="row padding mb-32" data-id="{{item.id}}" bind:tap="goInfo">
|
<view class="row padding mb-32" data-id="{{item.plant.id}}" bind:tap="goInfo">
|
||||||
<view class="flex flex-center flex-justify-start">
|
<view class="flex flex-center flex-justify-start">
|
||||||
<image class="pic" mode="aspectFill" wx:if="{{item.plant.imgList[0].url}}" src="{{item.plant.imgList[0].url}}"></image>
|
<image class="pic" mode="aspectFill" wx:if="{{item.plant.imgList[0].url}}" src="{{item.plant.imgList[0].url}}"></image>
|
||||||
<image class="pic" mode="aspectFill" wx:else src="https://res.catter.cn/pub/2025/09/30/20250930143920286.png"></image>
|
<image class="pic" mode="aspectFill" wx:else src="https://res.catter.cn/pub/2025/09/30/20250930143920286.png"></image>
|
||||||
|
|||||||
@ -141,12 +141,12 @@ Page({
|
|||||||
|
|
||||||
goAdd() {
|
goAdd() {
|
||||||
const tmp = wx.getStorageSync('user')
|
const tmp = wx.getStorageSync('user')
|
||||||
// if (tmp.phone.length === 0){
|
if (tmp.phone.length === 0){
|
||||||
// wx.navigateTo({
|
wx.navigateTo({
|
||||||
// url: '../login/index',
|
url: '../login/index',
|
||||||
// })
|
})
|
||||||
// return
|
return
|
||||||
// }
|
}
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: '../add/index',
|
url: '../add/index',
|
||||||
})
|
})
|
||||||
|
|||||||
@ -52,8 +52,6 @@ Page({
|
|||||||
api("/auth/getPhone", 'GET', data).then(res => {
|
api("/auth/getPhone", 'GET', data).then(res => {
|
||||||
wx.hideLoading()
|
wx.hideLoading()
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
wx.setStorageSync('user', res.data.user)
|
|
||||||
wx.setStorageSync('token', res.data.token)
|
|
||||||
wx.navigateBack()
|
wx.navigateBack()
|
||||||
} else {
|
} else {
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
|
|||||||
@ -60,6 +60,7 @@ Page({
|
|||||||
if (data.code === 200) {
|
if (data.code === 200) {
|
||||||
const tmps = _this.data.user
|
const tmps = _this.data.user
|
||||||
tmps.avatar = data.data.file
|
tmps.avatar = data.data.file
|
||||||
|
tmps.avatarId = data.data.file.id
|
||||||
_this.setData({
|
_this.setData({
|
||||||
user:tmps
|
user:tmps
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user