fix 任务工单

This commit is contained in:
sdaduanbilei 2025-12-12 14:53:16 +08:00
parent d00c299b1f
commit a5782aba7c
12 changed files with 134 additions and 48 deletions

View File

@ -9,7 +9,7 @@ Component({
type: Boolean,
require: false
},
item: {
info: {
type: Object,
require: true
},

View File

@ -5,13 +5,13 @@
<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>
<image src="{{info.oss.url}}" 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 class="font-16 bold white mt-32">{{info.name}}</view>
<view class="font-14 mt-16 white">徽章获取条件:{{info.desc}}</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>

View File

@ -1,3 +1,5 @@
const { api } = require("../../utils/api")
// pages/about/index.js
Page({
@ -12,19 +14,10 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (options.type !=undefined){
wx.showToast({
title: '获取成功',
icon: 'success'
})
}
},
goHome(){
wx.switchTab({
url: '../index/index',
})
},
/**
* 生命周期函数--监听页面初次渲染完成

View File

@ -64,7 +64,8 @@ Page({
"icon":"broccoli"
}
]
}
},
badge:null
},
/**
@ -159,7 +160,11 @@ Page({
})
api('/plant/add','POST',this.data.form,'json').then(res => {
if (res.code === 200){
this.setData({show:true})
const tmps = res.data
if (tmps != null){
this.setData({badge: tmps[0],show:true})
}
} else {
wx.showModal({
content: res.msg

View File

@ -51,7 +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>
<badge visible="{{show}}" info="{{badge}}" bind:ok="goBack"></badge>
</view>

View File

@ -11,7 +11,7 @@ Page({
id: '',
info: null,
addr: null,
checked:false
checked: false
},
/**
@ -27,10 +27,12 @@ Page({
api('/personal/address/list', 'GET').then(res => {
if (res.code === 200) {
const tmps = res.data
if(tmps.length > 0){
this.setData({addr:tmps[0]})
if (tmps.length > 0) {
this.setData({
addr: tmps[0]
})
}
}
})
},
@ -39,15 +41,20 @@ Page({
const _this = this
wx.chooseAddress({
success(res) {
const data = {isDefault:1,phone:res.telNumber, name :res.userName,detail: res.provinceName + res.cityName + res.countyName + res.detailInfo}
const data = {
isDefault: 1,
phone: res.telNumber,
name: res.userName,
detail: res.provinceName + res.cityName + res.countyName + res.detailInfo
}
_this.saveAddr(data)
}
})
},
saveAddr(data){
api('/personal/address/add','POST',data,'json').then(res => {
if (res.code=== 200) {
saveAddr(data) {
api('/personal/address/add', 'POST', data, 'json').then(res => {
if (res.code === 200) {
this.fetchAddr()
}
})
@ -68,22 +75,63 @@ Page({
this.fetchAddr()
},
change(){
change() {
const checked = !this.data.checked
this.setData({checked:checked})
this.setData({
checked: checked
})
},
pay(){
if (this.data.checked === false){
pay() {
if (this.data.checked === false) {
wx.showModal({
content: '请先勾选,我承诺会好好照顾它,不随意丢弃。',
complete: (res) => {
if (res.confirm) {
}
}
})
return
}
const data = {
addressId: this.data.addr.id,
id: this.data.id
}
wx.showLoading({
title: '请稍后',
})
api('/claim/claim', 'GET', data).then(res => {
if (res.code === 200) {
const orderId = res.data
api('/pay/prePay', 'GET', {
orderId: orderId
}).then(res => {
wx.hideLoading()
if (res.code === 200) {
const pay = res.data
wx.requestPayment({
appId: "wxb463820bf36dd5d6",
nonceStr: pay.nonceStr,
package: pay.package,
signType: pay.signType,
paySign: pay.paySign,
timeStamp: pay.timeStamp,
"success": res => {
// 检查支付
console.log(res);
},
"fail": function (res) {
console.log(res);
},
"complete": function (res) {
console.log(res);
}
})
}
})
} else {
wx.showModal({
content: res.msg,
})
}
})
},
fetchInfo() {

View File

@ -1,20 +1,33 @@
// pages/user/about.js
const {
api
} = require("../../utils/api")
Page({
/**
* 页面的初始数据
*/
data: {
info:null
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.fetchList()
},
fetchList(){
api('/config/qrcode/list','POST').then(res => {
if (res.code === 200){
const tmps = res.data
if (tmps.length > 0){
this.setData({info:tmps[0]})
}
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/

View File

@ -1,7 +1,7 @@
<!--pages/user/about.wxml-->
<view class="content padding">
<view class="flex flex-aligin-center flex-col padding row">
<image src="https://res.catter.cn/kaka/2024/11/02/1730546862685.JPG" style="height: 960rpx;" show-menu-by-longpress></image>
<image wx:if="{{info}}" src="{{info.url}}" style="height: 960rpx;" show-menu-by-longpress></image>
<view class="padding">长按二维码,加入群聊</view>
<view class="padding">一起交流种植小技巧</view>
</view>

View File

@ -11,7 +11,8 @@ Page({
data: {
user: null,
info: null,
inviteCode: ''
inviteCode: '',
badgeList:[]
},
/**
@ -52,6 +53,13 @@ Page({
})
}
})
api('/badge/my/list','POST',{current:0, pageSize:999},'json').then(res => {
if (res.code === 200) {
const tmps = res.data.list
this.setData({badgeList:tmps})
}
})
},
onChooseAvatar(e) {

View File

@ -1,4 +1,7 @@
{
"navigationStyle": "custom",
"usingComponents": {}
"usingComponents": {
"t-avatar": "tdesign-miniprogram/avatar/avatar",
"t-avatar-group": "tdesign-miniprogram/avatar-group/avatar-group"
}
}

View File

@ -18,9 +18,11 @@
</view>
</view>
</view>
<view class="white flex flex-center flex-justify-start mt-16">我的徽章 已解锁 23 个</view>
<view class="mt-32">
<view class="">🎖️🎖️🎖️🎖️🎖️🎖️🎖️</view>
<view class="white flex flex-center flex-justify-start mt-16">我的徽章 已解锁 {{badgeList.length}} 个</view>
<view class="mt-32 flex flex-center flex-justify-start">
<t-avatar-group max="5" collapseAvatar="+5">
<t-avatar wx:for="{{badgeList}}" image="{{item.oss.url}}" size="small"/>
</t-avatar-group>
</view>
</view>
@ -85,9 +87,9 @@
<view style="padding: 0 32rpx">
<view class="row" style="padding-top: 8rpx; padding-bottom: 8rpx;margin-bottom: 32rpx;">
<t-cell title="植物百科" hover arrow url="../knowlage/index"/>
<t-cell title="植物百科" hover arrow url="../knowlage/index" />
<t-cell title="植物领养中心" hover arrow bind:tap="goStore" />
<t-cell title="关注公众号" hover arrow />
<!-- <t-cell title="关注公众号" hover arrow /> -->
<t-cell title="加入微信群" hover arrow bind:tap="goAbout" />
<t-cell title="用户协议" hover arrow bind:tap="goPrivate" />
<button class="avatar-wrapper " style="width: 100%;" open-type="share">

View File

@ -23,12 +23,26 @@
"condition": {
"miniprogram": {
"list": [
{
"name": "pages/order/index",
"pathName": "pages/order/index",
"query": "id=355fad80-d403-11f0-883c-bc2411e64a23",
"scene": null,
"launchMode": "default"
},
{
"name": "pages/store/info",
"pathName": "pages/store/info",
"query": "id=355fad80-d403-11f0-883c-bc2411e64a23",
"launchMode": "default",
"scene": null
},
{
"name": "pages/knowlage/info",
"pathName": "pages/knowlage/info",
"query": "id=8e3af6f8-ce61-11f0-bb28-bc2411e64a23",
"scene": null,
"launchMode": "default"
"launchMode": "default",
"scene": null
}
]
}