Lj 4 weeks ago
parent
commit
432e138850
10 changed files with 325 additions and 262 deletions
  1. +2
    -2
      App.vue
  2. +4
    -1
      config.js
  3. +44
    -38
      pages/baoyou-city/baoyou-city.vue
  4. +22
    -22
      pages/component/home.vue
  5. +1
    -3
      pages/component/my.vue
  6. +1
    -0
      pages/component/recycle.vue
  7. +1
    -0
      pages/index/index.vue
  8. +6
    -2
      pages/subcomponent/inspection-report.vue
  9. +14
    -4
      pages/subcomponent/pickup.vue
  10. +230
    -190
      pages/subcomponent/promo-qrcode.vue

+ 2
- 2
App.vue View File

@ -166,8 +166,8 @@
uni.getImageInfo({
src: `${config.baseUrl}/recycle-admin/applet/promotion/getInviteCode?token=${uni.getStorageSync('token')}`,
success: res => {
getApp().globalData.configData.qr_path = res.path
console.log(getApp().globalData.configData.qr_path, 'qr_path')
getApp().globalData.qr_path = res.path
console.log(getApp().globalData.qr_path, 'qr_path')
this.updateProgress()
resolve()
},


+ 4
- 1
config.js View File

@ -1,7 +1,10 @@
// config.js
const type = 'dev'
const type = 'local'
const config = {
local: {
baseUrl: 'http://127.0.0.1:8002',
},
dev: {
baseUrl: 'http://h5.xzaiyp.top',
},


+ 44
- 38
pages/baoyou-city/baoyou-city.vue View File

@ -39,44 +39,50 @@
</template>
<script>
export default {
data() {
return {
statusBarHeight: 0,
navBarHeight: 88, //
menuButtonInfo: null,
cityList: [],
bannerTop: 0 // banner
}
},
onLoad() {
const sysInfo = uni.getSystemInfoSync()
this.statusBarHeight = sysInfo.statusBarHeight
let menuButtonInfo = null
try {
menuButtonInfo = uni.getMenuButtonBoundingClientRect()
} catch (e) {}
this.menuButtonInfo = menuButtonInfo
if (menuButtonInfo && menuButtonInfo.height) {
// = bottom + top -
this.navBarHeight = menuButtonInfo.bottom + menuButtonInfo.top - sysInfo.statusBarHeight
} else {
this.navBarHeight = 88 //
}
this.bannerTop = this.statusBarHeight + this.navBarHeight
this.$api('getFreeCityList', {}, res => {
if (res && res.success && Array.isArray(res.result)) {
this.cityList = res.result.filter(item => item.open === 'Y');
// console.log(this.cityList);
}
});
},
methods: {
goBack() {
uni.navigateBack()
}
}
}
export default {
data() {
return {
statusBarHeight: 0,
navBarHeight: 88, //
menuButtonInfo: null,
cityList: [],
bannerTop: 0 // banner
}
},
onLoad() {
const sysInfo = uni.getSystemInfoSync()
this.statusBarHeight = sysInfo.statusBarHeight
let menuButtonInfo = null
try {
menuButtonInfo = uni.getMenuButtonBoundingClientRect()
} catch (e) {}
this.menuButtonInfo = menuButtonInfo
if (menuButtonInfo && menuButtonInfo.height) {
// = bottom + top -
this.navBarHeight = menuButtonInfo.bottom + menuButtonInfo.top - sysInfo.statusBarHeight
} else {
this.navBarHeight = 88 //
}
this.bannerTop = this.statusBarHeight + this.navBarHeight
this.$api('getFreeCityList', {}, res => {
if (res && res.success && Array.isArray(res.result)) {
this.cityList = res.result.filter(item => item.open === 'Y');
// console.log(this.cityList);
}
});
},
computed: {
city_desc() {
const item = getApp().globalData.configData.find(i => i.keyName === 'city_desc')
return item ? item.keyContent : ''
},
},
methods: {
goBack() {
uni.navigateBack()
}
}
}
</script>
<style lang="scss" scoped>


+ 22
- 22
pages/component/home.vue View File

@ -17,7 +17,6 @@
<view class="process-section">
<view class="section-header">
<text class="title">回收流程</text>
</view>
<view class="process-grid">
<view class="process-item" v-for="(item, index) in processes" :key="index">
@ -172,26 +171,27 @@
processes: [],
priceList: [],
records: [],
destinations: [{
icon: '/static/home/爱心援乡.png',
title: '爱心援乡',
description: '精准帮扶贫困群体'
},
{
icon: '/static/home/回塑新源.png',
title: '回塑新源',
description: '塑料的第二次成型'
},
{
icon: '/static/home/织物出海.png',
title: '织物出海',
description: '分拣出最高价值'
},
{
icon: '/static/home/碳循再生.png',
title: '碳循再生',
description: '减碳从出发生系统'
}
destinations: [
// {
// icon: '/static/home/.png',
// title: '',
// description: ''
// },
// {
// icon: '/static/home/.png',
// title: '',
// description: ''
// },
// {
// icon: '/static/home/.png',
// title: '',
// description: ''
// },
// {
// icon: '/static/home/.png',
// title: '',
// description: ''
// }
],
bannerList: [],
pricePreviewList: [],
@ -323,7 +323,7 @@
},
goToInspectionReport(item) {
uni.navigateTo({
url: `/pages/subcomponent/inspection-report?id=${item.orderId}`
url: `/pages/subcomponent/inspection-report?orderId=${item.orderId}`
})
},
getFreeCityList() {


+ 1
- 3
pages/component/my.vue View File

@ -365,9 +365,7 @@ export default {
return item ? item.keyContent : ''
},
userTypeText() {
if (this.userInfo.isTuiType === 0) return '推广官'
if (this.userInfo.isTuiType === 1) return '推广达人'
if (this.userInfo.isTuiType === 2) return '推广大使'
if (this.userInfo.isUser == 'Y') return this.userInfo.isTuiTypeTitle
return '普通用户'
}
},


+ 1
- 0
pages/component/recycle.vue View File

@ -734,6 +734,7 @@ export default {
icon: item.image,
quantity: item.quantity,
unitPrice: item.price,
maxPrice : item.maxPrice,
desc: item.brandName ? `品牌:${item.brandName}` : '允许脏破烂,160码以上'
}


+ 1
- 0
pages/index/index.vue View File

@ -301,6 +301,7 @@
.cancel-btn {
background-color: rgba(255, 253, 249);
color: #f7990c;
background-color: #f9ece5;
border: 1px solid rgba(249, 178, 71);
}


+ 6
- 2
pages/subcomponent/inspection-report.vue View File

@ -98,7 +98,8 @@ export default {
problemList: [], //
reportData: null,
showQualified: false,
showProblem: false
showProblem: false,
orderId : 0,
}
},
computed: {
@ -122,6 +123,7 @@ export default {
this.navBarTotalHeight = this.statusBarHeight + this.navBarHeight
// orderId
const orderId = options.orderId
this.orderId = orderId
if (orderId) {
this.fetchQualityReport(orderId)
}
@ -129,7 +131,9 @@ export default {
methods: {
async fetchQualityReport(orderId) {
//
this.$api && this.$api('getOrderDetail', { orderId }, res => {
this.$api && this.$api('getOrderDetail', {
orderId : this.orderId
}, res => {
if (res && res.code === 200 && res.result) {
this.reportData = res.result
//


+ 14
- 4
pages/subcomponent/pickup.vue View File

@ -66,9 +66,9 @@
</view>
<!-- <view class="desc">{{ item.desc }}</view> -->
<view class="price-row">
<text class="price">{{ item.unitPrice }}/</text>
<text class="price">{{ item.price || item.unitPrice }}~{{ item.maxPrice || item.unitPrice }}/</text>
<text class="count">x{{ item.quantity }}</text>
<text class="amount">{{ item.unitPrice * item.quantity }}</text>
<text class="amount">{{ ((item.price || item.unitPrice) * item.quantity).toFixed(2) }}~{{ ((item.maxPrice || item.unitPrice) * item.quantity).toFixed(2) }}</text>
</view>
</view>
</view>
@ -240,8 +240,18 @@ export default {
},
totalPriceRange() {
if (this.selectedItems.length === 0) return '0-0'
const total = this.selectedItems.reduce((sum, item) => sum + (item.unitPrice * item.quantity), 0)
return `${(total * 0.92).toFixed(2)}~${(total * 1.1).toFixed(2)}`
let minTotal = 0
let maxTotal = 0
this.selectedItems.forEach(item => {
const minPrice = item.price || item.unitPrice || 0
const maxPrice = item.maxPrice || item.unitPrice || 0
minTotal += minPrice * item.quantity
maxTotal += maxPrice * item.quantity
})
return `${minTotal.toFixed(2)}~${maxTotal.toFixed(2)}`
},
canSubmit() {
return this.agreed && this.selectedItems.length > 0 && this.selectedTime && this.displayAddress


+ 230
- 190
pages/subcomponent/promo-qrcode.vue View File

@ -1,197 +1,237 @@
<template>
<view class="promo-modal-page">
<!-- 顶部导航栏 -->
<view class="nav-bar" :style="{height: navBarTotalHeight + 'px', paddingTop: statusBarHeight + 'px'}">
<view class="nav-bar-inner">
<view class="back-icon" @tap="navigateBack">
<uni-icons type="left" size="22" color="#222" />
</view>
<view class="nav-bar-title">推广链接</view>
<view class="nav-bar-right">
<uni-icons type="more-filled" size="22" color="#222" />
</view>
</view>
</view>
<!-- 用户信息 -->
<view class="user-info-modal" :style="{ marginTop: navBarTotalHeight + 'px' }">
<view class="avatar-frame">
<image class="avatar-img" :src="userInfo.avatar" mode="aspectFill" />
</view>
<view class="nickname">{{userInfo.name}}</view>
</view>
<!-- 二维码区 -->
<view class="qrcode-modal-section">
<image class="qrcode-img" :src="qrcodeUrl" mode="aspectFit" />
<!-- <view class="invite-code">邀请码{{inviteCode}}</view> -->
</view>
<!-- 底部按钮 -->
<view class="bottom-btns-modal">
<button class="btn gray">分享给好友</button>
<button class="btn green">保存到本地</button>
</view>
</view>
<view class="promo-modal-page">
<!-- 顶部导航栏 -->
<view class="nav-bar" :style="{height: navBarTotalHeight + 'px', paddingTop: statusBarHeight + 'px'}">
<view class="nav-bar-inner">
<view class="back-icon" @tap="navigateBack">
<uni-icons type="left" size="22" color="#222" />
</view>
<view class="nav-bar-title">推广链接</view>
<view class="nav-bar-right">
<uni-icons type="more-filled" size="22" color="#222" />
</view>
</view>
</view>
<!-- 用户信息 -->
<view class="user-info-modal" :style="{ marginTop: navBarTotalHeight + 'px' }">
<view class="avatar-frame">
<image class="avatar-img" :src="userInfo.avatar" mode="aspectFill" />
</view>
<view class="nickname">{{userInfo.name}}</view>
</view>
<!-- 二维码区 -->
<view class="qrcode-modal-section">
<image class="qrcode-img" :src="qrcodeUrl" mode="widthFix" />
<!-- <view class="invite-code">邀请码{{inviteCode}}</view> -->
</view>
<!-- 底部按钮 -->
<view class="bottom-btns-modal">
<button class="btn gray">分享给好友</button>
<button class="btn green">保存到本地</button>
</view>
</view>
</template>
<script>
import pullRefreshMixin from '@/pages/mixins/pullRefreshMixin.js'
export default {
mixins: [pullRefreshMixin],
data() {
return {
statusBarHeight: 0,
navBarHeight: 44,
navBarTotalHeight: 44,
userInfo: {
avatar: '/static/avatar.png',
name: '战斗世界',
},
qrcodeUrl: '/static/qrcode.png',
inviteCode: '888888',
}
},
onLoad() {
const sysInfo = uni.getSystemInfoSync()
this.statusBarHeight = sysInfo.statusBarHeight
this.navBarHeight = 44
this.navBarTotalHeight = this.statusBarHeight + this.navBarHeight
//
this.qrcodeUrl = getApp().globalData.configData.qr_path
},
methods: {
async onRefresh() {
//
await new Promise(resolve => setTimeout(resolve, 1000))
uni.stopPullRefresh()
},
navigateBack() {
uni.navigateBack()
},
}
}
import pullRefreshMixin from '@/pages/mixins/pullRefreshMixin.js'
export default {
mixins: [pullRefreshMixin],
data() {
return {
statusBarHeight: 0,
navBarHeight: 44,
navBarTotalHeight: 44,
userInfo: {
avatar: '/static/avatar.png',
name: '战斗世界',
},
qrcodeUrl: '/static/qrcode.png',
inviteCode: '888888',
}
},
onLoad() {
const sysInfo = uni.getSystemInfoSync()
this.statusBarHeight = sysInfo.statusBarHeight
this.navBarHeight = 44
this.navBarTotalHeight = this.statusBarHeight + this.navBarHeight
//
this.getQrcode()
},
methods: {
async onRefresh() {
//
await new Promise(resolve => setTimeout(resolve, 1000))
uni.stopPullRefresh()
},
navigateBack() {
uni.navigateBack()
},
getQrcode(){
//
if (getApp().globalData.qr_path) {
console.log('获取到二维码路径', getApp().globalData.qr_path)
this.qrcodeUrl = getApp().globalData.qr_path
} else {
console.log('全局二维码路径不存在')
uni.getImageInfo({
src: `${config.baseUrl}/recycle-admin/applet/promotion/getInviteCode?token=${uni.getStorageSync('token')}`,
success: res => {
getApp().globalData.qr_path = res.path
console.log(getApp().globalData.qr_path, 'qr_path')
this.qrcodeUrl = getApp().globalData.qr_path
},
fail: err => {
console.log('QR code load failed:', err)
}
})
}
},
}
}
</script>
<style lang="scss" scoped>
.promo-modal-page {
min-height: 100vh;
background: linear-gradient(to bottom, #f6fff2 0%, #fff 100%);
display: flex;
flex-direction: column;
align-items: center;
position: relative;
.nav-bar {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 1000;
width: 100vw;
background: linear-gradient(to right, #b2f08d 0%, #39e9d2 100%);
box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.03);
.nav-bar-inner {
display: flex;
align-items: center;
height: 44px;
width: 100vw;
position: relative;
}
.back-icon, .nav-bar-right {
width: 44px;
height: 44px;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
}
.back-icon { left: 0; }
.nav-bar-right { right: 0; }
.nav-bar-title {
flex: 1;
text-align: center;
font-size: 36rpx;
font-weight: bold;
color: #222;
letter-spacing: 2rpx;
line-height: 44px;
}
}
.user-info-modal {
display: flex;
flex-direction: column;
align-items: center;
.avatar-frame {
width: 104rpx;
height: 104rpx;
border-radius: 10rpx;
overflow: hidden;
background: #f2f2f2;
box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.10);
.avatar-img {
width: 104rpx;
height: 104rpx;
object-fit: cover;
display: block;
}
}
.nickname {
margin-top: 24rpx;
font-size: 32rpx;
font-weight: bold;
color: #222;
text-align: center;
}
}
.qrcode-modal-section {
margin-top: 48rpx;
width: 120vw;
display: flex;
flex-direction: column;
align-items: center;
.qrcode-img {
width: 100%;
height: 100%;
max-width: 480rpx;
max-height: 480rpx;
background: #fff;
border-radius: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.08);
}
.invite-code {
margin-top: 32rpx;
font-size: 30rpx;
color: #222;
font-weight: bold;
text-align: center;
}
}
.bottom-btns-modal {
position: fixed;
left: 0;
right: 0;
bottom: 0;
display: flex;
justify-content: space-between;
padding: 24rpx 32rpx calc(env(safe-area-inset-bottom) + 24rpx) 32rpx;
background: #fff;
z-index: 100;
.btn {
flex: 1;
height: 88rpx;
border-radius: 44rpx;
font-size: 32rpx;
font-weight: bold;
margin: 0 12rpx;
border: none;
&.gray {
background: linear-gradient(90deg, #f7f7f7, #f2f2f2);
color: #888;
}
&.green {
background: linear-gradient(90deg, #b2f08d, #39e9d2);
color: #fff;
}
}
}
}
</style>
.promo-modal-page {
min-height: 100vh;
background: linear-gradient(to bottom, #f6fff2 0%, #fff 100%);
display: flex;
flex-direction: column;
align-items: center;
position: relative;
.nav-bar {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 1000;
width: 100vw;
background: linear-gradient(to right, #b2f08d 0%, #39e9d2 100%);
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.03);
.nav-bar-inner {
display: flex;
align-items: center;
height: 44px;
width: 100vw;
position: relative;
}
.back-icon,
.nav-bar-right {
width: 44px;
height: 44px;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
}
.back-icon {
left: 0;
}
.nav-bar-right {
right: 0;
}
.nav-bar-title {
flex: 1;
text-align: center;
font-size: 36rpx;
font-weight: bold;
color: #222;
letter-spacing: 2rpx;
line-height: 44px;
}
}
.user-info-modal {
display: flex;
flex-direction: column;
align-items: center;
.avatar-frame {
width: 104rpx;
height: 104rpx;
border-radius: 10rpx;
overflow: hidden;
background: #f2f2f2;
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.10);
.avatar-img {
width: 104rpx;
height: 104rpx;
object-fit: cover;
display: block;
}
}
.nickname {
margin-top: 24rpx;
font-size: 32rpx;
font-weight: bold;
color: #222;
text-align: center;
}
}
.qrcode-modal-section {
margin-top: 48rpx;
width: 300rpx;
display: flex;
flex-direction: column;
align-items: center;
.qrcode-img {
width: 100%;
height: 100%;
background: #fff;
border-radius: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.08);
}
.invite-code {
margin-top: 32rpx;
font-size: 30rpx;
color: #222;
font-weight: bold;
text-align: center;
}
}
.bottom-btns-modal {
position: fixed;
left: 0;
right: 0;
bottom: 0;
display: flex;
justify-content: space-between;
padding: 24rpx 32rpx calc(env(safe-area-inset-bottom) + 24rpx) 32rpx;
background: #fff;
z-index: 100;
.btn {
flex: 1;
height: 88rpx;
border-radius: 44rpx;
font-size: 32rpx;
font-weight: bold;
margin: 0 12rpx;
border: none;
&.gray {
background: linear-gradient(90deg, #f7f7f7, #f2f2f2);
color: #888;
}
&.green {
background: linear-gradient(90deg, #b2f08d, #39e9d2);
color: #fff;
}
}
}
}
</style>

Loading…
Cancel
Save