From 65a0c98dffdf01c62bcbd2cc32bb687096741d4b Mon Sep 17 00:00:00 2001
From: huliyong <2783385703@qq.com>
Date: Tue, 17 Jun 2025 14:31:47 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=B9=B8=E8=BF=90?=
=?UTF-8?q?=E5=A4=A7=E8=BD=AC=E7=9B=98=E5=8A=9F=E8=83=BD=E5=B9=B6=E4=BC=98?=
=?UTF-8?q?=E5=8C=96=E6=8B=9B=E8=81=98=E7=A7=9F=E6=88=BF=E6=A8=A1=E5=9D=97?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 新增幸运大转盘营销功能,包含抽奖动画和奖品展示
- 优化招聘模块,支持编辑和删除功能
- 优化租房模块,支持编辑和删除功能
- 调整环境配置为开发模式
- 重构组件路径引用方式
- 更新页面路由配置
---
api/api.js | 44 +-
.../list/renting/rentingItem.vue | 0
components/list/work/workItem.vue | 195 +++++++++
config.js | 2 +-
pages.json | 8 +
pages/index/center.vue | 23 +-
pages/index/index.vue | 107 +++++
pages_order/auth/wxLogin.vue | 2 +-
pages_order/marketing/turntable.vue | 447 +++++++++++++++++++++
pages_order/renting/addRenting.vue | 164 +++++++-
pages_order/renting/rentingList.vue | 2 +-
pages_order/work/addWork.vue | 165 ++++++--
12 files changed, 1117 insertions(+), 42 deletions(-)
rename {pages_order/components => components}/list/renting/rentingItem.vue (100%)
create mode 100644 components/list/work/workItem.vue
create mode 100644 pages_order/marketing/turntable.vue
diff --git a/api/api.js b/api/api.js
index b0f3bf3..920e8f1 100644
--- a/api/api.js
+++ b/api/api.js
@@ -376,7 +376,49 @@ const config = {
url: '/cashout/getMoney',
method: 'GET',
auth : true,
- }
+ },
+
+ // 删除我的招聘
+ deleteMyJob : {
+ url: '/token/deleteMyJob',
+ method: 'POST',
+ auth : true,
+ },
+
+ // 删除我的租房
+ deleteMyRent : {
+ url: '/token/deleteMyRent',
+ method: 'POST',
+ auth : true,
+ },
+
+ // 编辑我的招聘
+ editMyJob : {
+ url: '/token/editMyJob',
+ method: 'POST',
+ auth : true,
+ },
+
+ // 编辑我的租房
+ editMyRent : {
+ url: '/token/editMyRent',
+ method: 'POST',
+ auth : true,
+ },
+
+ // 查询我的招聘
+ getMyJob : {
+ url: '/token/getMyJob',
+ method: 'GET',
+ auth : true,
+ },
+
+ // 查询我的租房
+ getMyRent : {
+ url: '/token/getMyRent',
+ method: 'GET',
+ auth : true,
+ },
}
const models = ['order']
diff --git a/pages_order/components/list/renting/rentingItem.vue b/components/list/renting/rentingItem.vue
similarity index 100%
rename from pages_order/components/list/renting/rentingItem.vue
rename to components/list/renting/rentingItem.vue
diff --git a/components/list/work/workItem.vue b/components/list/work/workItem.vue
new file mode 100644
index 0000000..b31ece0
--- /dev/null
+++ b/components/list/work/workItem.vue
@@ -0,0 +1,195 @@
+
+
+
+
+
+
+ {{ item.title }}
+
+
+
+
+ {{item.minPrice}}
+
+
+
+
+
+
+ |
+
+
+ {{item.workYear}}
+
+
+
+
+ |
+
+
+ {{t}}
+
+
+
+
+
+
+
+ {{ item.company }}
+
+
+
+ {{ item.isCardOpen }}
+
+
+
+
+
+ {{ item.iconTitle }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/config.js b/config.js
index a9a1d79..acda4c0 100644
--- a/config.js
+++ b/config.js
@@ -7,7 +7,7 @@ import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI);
// 当前环境
-const type = 'prod'
+const type = 'dev'
// 环境配置
diff --git a/pages.json b/pages.json
index 011895e..6e210ca 100644
--- a/pages.json
+++ b/pages.json
@@ -181,6 +181,14 @@
},
{
"path": "mine/purse"
+ },
+ {
+ "path": "marketing/turntable",
+ "style": {
+ "navigationBarTitleText": "幸运大转盘",
+ "enablePullDownRefresh": false,
+ "navigationBarTextStyle": "white"
+ }
}
]
}],
diff --git a/pages/index/center.vue b/pages/index/center.vue
index 4b6af53..6822459 100644
--- a/pages/index/center.vue
+++ b/pages/index/center.vue
@@ -153,6 +153,18 @@
/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 🎰
+
+
+
+ 幸运大转盘
+ 天天有惊喜,转一转试试手气!
+
+
+ →
+
+
+
+
@@ -463,6 +486,90 @@
z-index: 9;
overflow: hidden;
+ // 大转盘入口样式
+ .turntable-entrance {
+ margin: 20rpx;
+ border-radius: 20rpx;
+ background: linear-gradient(135deg, #ff6b6b 0%, #ffd93d 100%);
+ box-shadow: 0 8rpx 20rpx rgba(255, 107, 107, 0.3);
+ overflow: hidden;
+ position: relative;
+
+ &::before {
+ content: '';
+ position: absolute;
+ top: 0;
+ left: -100%;
+ width: 100%;
+ height: 100%;
+ background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
+ animation: shine 3s infinite;
+ }
+
+ .turntable-content {
+ display: flex;
+ align-items: center;
+ padding: 30rpx;
+ position: relative;
+ z-index: 2;
+
+ .turntable-icon {
+ position: relative;
+ margin-right: 30rpx;
+
+ .icon {
+ font-size: 60rpx;
+ display: block;
+ animation: bounce 2s infinite;
+ }
+ }
+
+ .turntable-text {
+ flex: 1;
+
+ .title {
+ display: block;
+ font-size: 32rpx;
+ font-weight: bold;
+ color: white;
+ margin-bottom: 10rpx;
+ text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.3);
+ }
+
+ .subtitle {
+ display: block;
+ font-size: 24rpx;
+ color: rgba(255, 255, 255, 0.9);
+ text-shadow: 0 1rpx 2rpx rgba(0, 0, 0, 0.3);
+ }
+ }
+
+ .turntable-arrow {
+ font-size: 36rpx;
+ color: white;
+ font-weight: bold;
+ text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.3);
+ animation: arrow-bounce 1.5s infinite;
+ }
+ }
+ }
+
+ @keyframes shine {
+ 0% { left: -100%; }
+ 100% { left: 100%; }
+ }
+
+ @keyframes bounce {
+ 0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
+ 40% { transform: translateY(-10rpx); }
+ 60% { transform: translateY(-5rpx); }
+ }
+
+ @keyframes arrow-bounce {
+ 0%, 100% { transform: translateX(0); }
+ 50% { transform: translateX(10rpx); }
+ }
+
.life {
display: flex;
diff --git a/pages_order/auth/wxLogin.vue b/pages_order/auth/wxLogin.vue
index df845c2..da01fdf 100644
--- a/pages_order/auth/wxLogin.vue
+++ b/pages_order/auth/wxLogin.vue
@@ -13,7 +13,7 @@
- 微信授权登录
+ 快捷登录
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ prize.icon }}
+ {{ prize.name }}
+ {{ prize.value }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ isSpinning ? '抽奖中...' : '开始抽奖' }}
+
+
+
+
+
+
+ 🎉 恭喜您 🎉
+
+ {{ currentPrize.icon }}
+ {{ currentPrize.name }}
+ {{ currentPrize.value }}
+
+
+
+
+
+
+
+
+
+ 今日剩余抽奖次数: {{ remainingSpins }}
+
+
+
+
+
+
+
+
diff --git a/pages_order/renting/addRenting.vue b/pages_order/renting/addRenting.vue
index 5851049..b1fc21b 100644
--- a/pages_order/renting/addRenting.vue
+++ b/pages_order/renting/addRenting.vue
@@ -1,6 +1,6 @@
-
+
@@ -43,6 +43,15 @@
isLink
> -->
+
+
楼层
@@ -208,7 +217,13 @@
- 发布
+ {{ isEdit ? '保存修改' : '发布' }}
+
+
+
+
+ 删除租房
@@ -220,6 +235,8 @@
export default {
data() {
return {
+ rentingId: '', // 租房ID,用于编辑模式
+ isEdit: false, // 是否为编辑模式
form : {
addId : '',//地区id
address : '',//地址
@@ -230,6 +247,14 @@
deliver : '整租',
floor : '',
decoration : '',
+ title: '', // 租房标题
+ home: '', // 户型
+ payment: '', // 付款方式
+ money: '', // 租金
+ phone: '', // 联系电话
+ titleSub: '', // 备注
+ latitude: '', // 纬度
+ longitude: '', // 经度
},
showingsRadio : [//看房
{
@@ -272,11 +297,18 @@
pickerKey : '',
}
},
- onLoad() {
- // for (var i = 0; i < 30; i++) {
- // this.picker.workYear.push((i + 1) + '年')
- // }
- this.form.addId = this.cityList[0].id
+ onLoad(options) {
+ // 检查是否是编辑模式
+ if (options.id) {
+ this.rentingId = options.id
+ this.isEdit = true
+ this.getRentingDetail()
+ } else {
+ // 新增模式,设置默认地区
+ if (this.cityList && this.cityList.length > 0) {
+ this.form.addId = this.cityList[0].id
+ }
+ }
},
computed : {
columns(){
@@ -284,7 +316,60 @@
},
...mapState(['cityList', 'category']),
},
+ watch: {
+ // 监听cityList变化,用于处理异步加载的城市数据
+ cityList: {
+ handler(newVal) {
+ if (newVal && newVal.length > 0 && !this.isEdit && !this.form.addId) {
+ this.form.addId = newVal[0].id
+ }
+ },
+ immediate: true
+ }
+ },
methods: {
+ // 获取租房详情数据
+ getRentingDetail() {
+ this.$api('getRentDetail', { id: this.rentingId }, res => {
+ if (res.code == 200) {
+ const data = res.result
+
+ // 回显基本信息
+ this.form = {
+ ...this.form,
+ title: data.title || '',
+ address: data.address || '',
+ face: data.face || '',
+ decoration: data.decoration || '',
+ floor: data.floor || '',
+ home: data.home || '',
+ payment: data.payment || '',
+ money: data.money || '',
+ crm: data.crm || '',
+ showings: data.showings || '随时可看',
+ lift: data.lift || '有',
+ deliver: data.deliver || '整租',
+ phone: data.phone || '',
+ titleSub: data.titleSub || '',
+ addId: data.addId || (this.cityList.length > 0 ? this.cityList[0].id : ''),
+ latitude: data.latitude || '',
+ longitude: data.longitude || '',
+ }
+
+ // 回显图片
+ if (data.image) {
+ const images = data.image.split(',').filter(img => img.trim())
+ this.fileList = images.map(url => ({ url: url.trim() }))
+ }
+ } else {
+ uni.showToast({
+ title: res.msg || '获取租房信息失败',
+ icon: 'none'
+ })
+ }
+ })
+ },
+
openPicker(key){
this.pickerKey = key
this.$refs.picker.open()
@@ -307,7 +392,7 @@
},
//地图上选择地址
selectAddr() {
- Position.selectAddress(0, 0, res => {
+ Position.selectAddress(this.form.latitude || 0, this.form.longitude || 0, res => {
//经纬度信息
this.form.latitude = res.latitude
this.form.longitude = res.longitude
@@ -334,7 +419,6 @@
lift : '请选择电梯',
deliver : '请选择交付方式',
phone: '请输入联系电话',
- // titleSub : '请输入备注',
})) {
return
}
@@ -346,16 +430,57 @@
})
}
+ // 处理图片数据
this.form.image = this.fileList.map(n => n.url).join(',')
- this.$api('publishRent', this.form, res => {
+ // 根据是否是编辑模式调用不同的API
+ const apiName = this.isEdit ? 'editMyRent' : 'publishRent'
+ const params = this.isEdit ? { ...this.form, id: this.rentingId } : this.form
+
+ this.$api(apiName, params, res => {
if(res.code == 200){
uni.showToast({
- title: '发布成功!',
+ title: this.isEdit ? '修改成功!' : '发布成功!',
icon: 'none'
})
- setTimeout(uni.navigateBack, 1000, -1)
+ setTimeout(() => {
+ uni.navigateBack()
+ }, 1000)
+ } else {
+ uni.showToast({
+ title: res.msg || (this.isEdit ? '修改失败' : '发布失败'),
+ icon: 'none'
+ })
+ }
+ })
+ },
+ // 删除租房
+ deleteRenting() {
+ uni.showModal({
+ title: '确认删除',
+ content: '确定要删除这个租房信息吗?删除后无法恢复。',
+ confirmColor: '#ff4757',
+ success: (res) => {
+ if (res.confirm) {
+ this.$api('deleteMyRent', { id: this.rentingId }, res => {
+ if (res.code == 200) {
+ uni.showToast({
+ title: '删除成功!',
+ icon: 'none'
+ })
+
+ setTimeout(() => {
+ uni.navigateBack()
+ }, 1000)
+ } else {
+ uni.showToast({
+ title: res.msg || '删除失败',
+ icon: 'none'
+ })
+ }
+ })
+ }
}
})
},
@@ -416,6 +541,21 @@
}
}
+ .delete-btn {
+ background: #ff4757;
+ color: white;
+ text-align: center;
+ padding: 20rpx;
+ margin: 30rpx;
+ border-radius: 40rpx;
+ font-size: 28rpx;
+ font-weight: bold;
+
+ &:active {
+ background: #ff3742;
+ }
+ }
+
.category{
padding: 20rpx;
.title{
diff --git a/pages_order/renting/rentingList.vue b/pages_order/renting/rentingList.vue
index 4f14c66..c959062 100644
--- a/pages_order/renting/rentingList.vue
+++ b/pages_order/renting/rentingList.vue
@@ -25,7 +25,7 @@